Class TextPanel

  • All Implemented Interfaces:
    GFXContext, GFXModelContext

    public class TextPanel
    extends TextFrame
    The text panel class represents the geometry and eventually layout of a single panel.

    The client creates all panel instances, either to pass to the sparse stream API or as a result of its implementation of the sparse stream event handling methods. The client must populate its created panels with geometry information. A future implementation may allow the client to set text attributes for a panel as well.

    Once the client passes a panel instance to the sparse stream, AXTE takes over and populates its layout. The layout may come from a client-supplied layout object, or it may be generated by AXTE as the result of a reflow operation.

    Panels are reference counted objects, allowing the client to retain handles to objects that are managed by AXTE.

    While panels have width and height geometry, it is up to the client to decide how to map panels into its rendering space. AXTE treats the top-left corner of each panel as its origin.

    • Constructor Detail

      • TextPanel

        public TextPanel()
        Default constructor.

        Construct a panel with default dimensions of 1" by 1".

      • TextPanel

        public TextPanel​(TextPanel oSource)
        Copy constructor.
        Parameters:
        oSource - - Source panel to copy.
      • TextPanel

        public TextPanel​(UnitSpan oWidth,
                         UnitSpan oHeight)
        Construct a panel with given width and height.
        Parameters:
        oWidth - - Width of the new panel.
        oHeight - - Height of the new panel.
    • Method Detail

      • setWidth

        public void setWidth​(UnitSpan oWidth)
        Set the width of this panel.

        If the width changes for a panel in a sparse stream, it causes reflow of text from that panel on.

        Parameters:
        oWidth - - New width for the panel.
      • getWidth

        public UnitSpan getWidth()
        Return the width of the panel.
        Returns:
        Width of the panel.
      • setHeight

        public void setHeight​(UnitSpan oHeight)
        Set the height of this panel.

        If the height changes for a panel in a sparse stream, it causes reflow of text from that panel on.

        Parameters:
        oHeight - - New height for the panel.
      • getHeight

        public UnitSpan getHeight()
        Return the height of the panel.
        Returns:
        Height of the panel.
      • setDimensions

        public void setDimensions​(UnitSpan oWidth,
                                  UnitSpan oHeight)
        Set the dimensions of this panel.

        This allows the caller to change both settings in a single call. If either dimension changes for a panel in a sparse stream, it causes reflow of text from that panel on.

        Parameters:
        oWidth - - New width for the panel.
        oHeight - - New Height for the panel.
      • copyFrom

        public void copyFrom​(TextPanel oSource)
        Assignment operator.
        Parameters:
        oSource - - Source panel to copy.
      • minWidth

        public UnitSpan minWidth()
        Description copied from class: TextFrame
        Return the frame's minimum width.

        All frames have both a minimum and maximum width, which may or may not be the same. This method returns the minimum width.

        Specified by:
        minWidth in class TextFrame
        Returns:
        Minimum width allowed for the frame. A value of zero is possible, as is a value less than zero. In the latter case, it indicates that the frame is horizontally aligned at a point, though callers should use the AlignHPoint() method to test for this.
      • minHeight

        public UnitSpan minHeight()
        Description copied from class: TextFrame
        Return the frame's minimum height.

        All frames have both a minimum and maximum height, which may or may not be the same. This method returns the minimum height.

        Specified by:
        minHeight in class TextFrame
        Returns:
        Minimum height allowed for the frame. A value of zero is possible, as is a value less than zero. In the latter case, it indicates that the frame is verrically aligned at a point, though callers should use the AlignVPoint() method to test for this.
      • maxWidth

        public UnitSpan maxWidth()
        Description copied from class: TextFrame
        Return the frame's maximum width.

        All frames have both a minimum and maximum width, which may or may not be the same. This method returns the maximum width.

        Specified by:
        maxWidth in class TextFrame
        Returns:
        maximum width allowed for the frame. A value of zero is possible, as is a value less than zero. In the latter case, it indicates that the frame has unlimited width, though callers should use the UnlimitedWidth() method to test for this.
      • maxHeight

        public UnitSpan maxHeight()
        Description copied from class: TextFrame
        Return the frame's maximum height.

        All frames have both a minimum and maximum height, which may or may not be the same. This method returns the maximum height.

        Specified by:
        maxHeight in class TextFrame
        Returns:
        maximum height allowed for the frame. A value of zero is possible, as is a value less than zero. In the latter case, it indicates that the frame has unlimited height, though callers should use the Unlimitedheight() method to test for this.
      • cloneFrame

        public TextFrame cloneFrame()
        Description copied from class: TextFrame
        Create a copy (deep clone) of this frame object.

        The copy must have the same geometry as this object. It is up to AXTE to subsequently manage the clones layout and relationship to content.

        Specified by:
        cloneFrame in class TextFrame
        Returns:
        Cloned copy of the frame. The lifetime of this object will be managed with reference counting.