Class PicText

  • All Implemented Interfaces:
    Element, PicObjectConstants, CustomizerFactory

    public class PicText
    extends TextEditable
    implements CustomizerFactory
    Textual elements, possibly surrounded by a box (currently, only rectangular, oval and circular shapes are supported). The box size is computed from the text size (ie aka LaTeX's \\framebox command with no width/height argument).
    Since:
    PicEdt 1.0
    Version:
    $Id: PicText.java,v 1.24.2.1 2007/09/02 11:56:27 reynal Exp $
    Author:
    Sylvain Reynal
    • Field Detail

      • width

        protected double width
        dimensions (in latex sense) of the latex box (this does not include frame)
      • height

        protected double height
      • depth

        protected double depth
      • frame

        protected java.awt.Shape frame
      • frameSep

        protected double frameSep
      • nodeSep

        protected double nodeSep
    • Constructor Detail

      • PicText

        public PicText​(PicPoint ptA,
                       java.lang.String textString,
                       PicAttributeSet set)
        Create a new PicText object with the whole bunch of parameters !
        Parameters:
        ptA - Anchor point (see setHorAlign() and setVertAlign() for details)
        textString - the text content
      • PicText

        public PicText​(PicPoint ptA,
                       PicAttributeSet set)
        Creates a PicText object with the following default values :
        • empty string,
        • frame and alignment according to the attribute set
      • PicText

        public PicText​(PicAttributeSet set)
        Creates a PicText object with the following default values :
        • empty string,
        • frame and alignment according to the attribute set
        and anchor point at (0,0)
      • PicText

        public PicText()
        Creates a PicText object with a default attribute set, and the following default values :
        • empty string,
        • no frame,
        • bottom-left alignment.
        and anchor point at (0,0)
      • PicText

        public PicText​(PicText text)
        cloning constructor
    • Method Detail

      • setPoint

        public void setPoint​(int index,
                             PicPoint pt,
                             EditPointConstraint constraint)
        Description copied from class: DefaultLeafElement
        Set the user-controlled point indexed by "index" to the given value, using the specified geometrical constraint. Constraints depend on the particular concrete implementation, and may involve restricting movement along a particular direction, moving several points at once to preserve parallelism,... The default constraint in this implementation reduces to simply calling setSpecificationPoint, then firing a GEOMETRY_CHANGE change-update.
        Specified by:
        setPoint in interface Element
        Overrides:
        setPoint in class DefaultLeafElement
        constraint - a geometry constraint, or null if no particular constraint is being imposed (aka default).
      • getHorAlign

        public java.lang.String getHorAlign()
        Return horizontal alignment (see constant fields above)
      • setHorAlign

        public void setHorAlign​(java.lang.String horAlign)
        Set the horizontal alignment (see constant fields above)
      • getVertAlign

        public java.lang.String getVertAlign()
        Return vertical alignement (see static constant above)
      • setVertAlign

        public void setVertAlign​(java.lang.String vertAlign)
        set the vertical alignement (see constant fields above)
      • isFramed

        public boolean isFramed()
        Return TRUE if the box has to be drawn
      • setFrameType

        public void setFrameType​(java.lang.String frameType)
        Set the type of frame to be put around the text.
      • getFrameType

        public java.lang.String getFrameType()
        Set the frame type
      • getShapeOfFrame

        public java.awt.Shape getShapeOfFrame()
        Returns the frame that surrounds the text, ignoring rotation (the view will rotate it)
      • updateFrame

        public void updateFrame()
        First computes frame dimensions (frameWidth, etc). Then computes the frame that surrounds the text, ignoring rotation (the view will rotate it)
      • getWidth

        public double getWidth()
        Return the width of text only
      • getHeight

        public double getHeight()
        Return the height of text only
      • getDepth

        public double getDepth()
        Return the depth of text only
      • getLeftX

        public double getLeftX()
        Return x-coordinate of left boundary of text only
      • getRightX

        public double getRightX()
        Return x-coordinate of right boundary of text only
      • getCenterX

        public double getCenterX()
        Return x-coordinate of center of text only
      • getBottomY

        public double getBottomY()
        Return y-coordinate of bottom boundary of text only
      • getTopY

        public double getTopY()
        Return y-coordinate of top boundary of text only
      • getBaseLineY

        public double getBaseLineY()
        Return y-coordinate of baseline
      • getCenterY

        public double getCenterY()
        Return y-coordinate of center of text only
      • getFrameWidth

        public double getFrameWidth()
        Return the width of the text including frame
      • getFrameHeight

        public double getFrameHeight()
        Return the height of the text including frame
      • getFrameDepth

        public double getFrameDepth()
        Return the depth of the text including frame
      • getFrameLeftX

        public double getFrameLeftX()
        Return x-coordinate of left boundary, including frame
      • getFrameRightX

        public double getFrameRightX()
        Return x-coordinate of right boundary
      • getFrameCenterX

        public double getFrameCenterX()
        Return x-coordinate of center
      • getFrameTopY

        public double getFrameTopY()
        Return y-coordinate of top boundary
      • getFrameBottomY

        public double getFrameBottomY()
        Return y-coordinate of bottom boundary
      • getFrameBaseLineY

        public double getFrameBaseLineY()
        Return y-coordinate of baseline
      • getFrameCenterY

        public double getFrameCenterY()
        Return y-coordinate of center
      • setDimensions

        public void setDimensions​(double w,
                                  double h,
                                  double d)
        set the width, height, and depth (of the text box, without frame). Normally, are set by the view.