Package net.sf.jaxodraw.object.text
Class JaxoLatexText
- java.lang.Object
-
- net.sf.jaxodraw.object.JaxoObject
-
- net.sf.jaxodraw.object.text.JaxoTextObject
-
- net.sf.jaxodraw.object.text.JaxoLatexText
-
- All Implemented Interfaces:
java.awt.Shape,java.beans.PropertyChangeListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,JaxoRotationObject
public class JaxoLatexText extends JaxoTextObject
Defines a JaxoObject which is just a string.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intALIGN_CBAlign center-bottom with respect to text coordinates.static intALIGN_CCAlign center-center with respect to text coordinates.static intALIGN_CTAlign center-top with respect to text coordinates.static intALIGN_LBAlign left-bottom with respect to text coordinates.static intALIGN_LCAlign left-center with respect to text coordinates.static intALIGN_LTAlign left-top with respect to text coordinates.static intALIGN_RBAlign right-bottom with respect to text coordinates.static intALIGN_RCAlign right-center with respect to text coordinates.static intALIGN_RTAlign right-top with respect to text coordinates.static intFOOTNOTESIZELatex text size footnotesize.static intHUGELatex text size huge.static intLARGELatex text size large.static intNORMALSIZELatex text size normalsize.static intSCRIPTSIZELatex text size scriptsize.static intSMALLLatex text size small.static intTINYLatex text size tiny.static intXHUGELatex text size Huge.static intXLARGELatex text size Large.static intXXLARGELatex text size LARGE.-
Fields inherited from class net.sf.jaxodraw.object.JaxoObject
D_FORMAT, GRAY_SCALE_FORMAT, SELECT_NONE, SELECT_P1
-
-
Constructor Summary
Constructors Constructor Description JaxoLatexText()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFrom(JaxoLatexText temp)Sets all parameters from the given object to the current one.intgetAllign()Returns the allign property of this text object.java.awt.RectanglegetBounds()Returns the bounding box of this object.intgetLatexTextSize()Returns the latex font size of this text object.booleanisCopy(JaxoObject comp)Determines if this JaxoObject is a copy of the specified one.booleanisRolledOver(int mouseX, int mouseY)Determines whether the cursor is currently above the visual aid icon of this LatexText.java.lang.StringlatexCommand(float scale, java.awt.Dimension canvasDim)The LaTeX command that is necessary to draw the given JaxoObject using the axodraw.sty package.voidpaint(JaxoGraphics2D g2)The method that paints the JaxoObject.voidprepareEditPanel(JaxoObjectEditPanel editPanel)Initializes the given editPanel to edit properties of this JaxoObject.voidsetAllign(int newAllign)Sets the allign property of this text object.voidsetLatexTextSize(int newLatexfs)Sets the latex font size of this text object.voidsetPreferences()Applies default values to this JaxoObject.voidsetState(JaxoObject o)Restore state to the values of 'o'.-
Methods inherited from class net.sf.jaxodraw.object.text.JaxoTextObject
canBeSelected, copyFrom, getRotationAngle, getTextString, latexWidth, paintHandles, rescaleObject, setRotationAngle, setTextString
-
Methods inherited from class net.sf.jaxodraw.object.JaxoObject
addPropertyChangeListener, contains, contains, contains, contains, copy, copyFrom, firePropertyChange, getBounds2D, getBoundsWithHandles, getColor, getGeneralPath, getGrabbedHandle, getHeight, getLaTexLocation, getName, getPathIterator, getPathIterator, getPointCount, getPoints, getWidth, getX, getX, getY, getY, intersects, intersects, isAround, isMarked, moveBy, paintVisualAid, propertyChange, removePropertyChangeListener, setAsMarked, setColor, setLocation, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setPointCount, setPoints, setTransient, setX, setX, setXPosition, setY, setY, setYPosition, smallestDistanceTo
-
-
-
-
Field Detail
-
ALIGN_LT
public static final int ALIGN_LT
Align left-top with respect to text coordinates.- See Also:
- Constant Field Values
-
ALIGN_LC
public static final int ALIGN_LC
Align left-center with respect to text coordinates.- See Also:
- Constant Field Values
-
ALIGN_LB
public static final int ALIGN_LB
Align left-bottom with respect to text coordinates.- See Also:
- Constant Field Values
-
ALIGN_CT
public static final int ALIGN_CT
Align center-top with respect to text coordinates.- See Also:
- Constant Field Values
-
ALIGN_CC
public static final int ALIGN_CC
Align center-center with respect to text coordinates.- See Also:
- Constant Field Values
-
ALIGN_CB
public static final int ALIGN_CB
Align center-bottom with respect to text coordinates.- See Also:
- Constant Field Values
-
ALIGN_RT
public static final int ALIGN_RT
Align right-top with respect to text coordinates.- See Also:
- Constant Field Values
-
ALIGN_RC
public static final int ALIGN_RC
Align right-center with respect to text coordinates.- See Also:
- Constant Field Values
-
ALIGN_RB
public static final int ALIGN_RB
Align right-bottom with respect to text coordinates.- See Also:
- Constant Field Values
-
TINY
public static final int TINY
Latex text size tiny.- See Also:
- Constant Field Values
-
SCRIPTSIZE
public static final int SCRIPTSIZE
Latex text size scriptsize.- See Also:
- Constant Field Values
-
FOOTNOTESIZE
public static final int FOOTNOTESIZE
Latex text size footnotesize.- See Also:
- Constant Field Values
-
SMALL
public static final int SMALL
Latex text size small.- See Also:
- Constant Field Values
-
NORMALSIZE
public static final int NORMALSIZE
Latex text size normalsize.- See Also:
- Constant Field Values
-
LARGE
public static final int LARGE
Latex text size large.- See Also:
- Constant Field Values
-
XLARGE
public static final int XLARGE
Latex text size Large.- See Also:
- Constant Field Values
-
XXLARGE
public static final int XXLARGE
Latex text size LARGE.- See Also:
- Constant Field Values
-
HUGE
public static final int HUGE
Latex text size huge.- See Also:
- Constant Field Values
-
XHUGE
public static final int XHUGE
Latex text size Huge.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllign
public final int getAllign()
Returns the allign property of this text object.- Returns:
- The allign property of this text object.
-
setAllign
public final void setAllign(int newAllign)
Sets the allign property of this text object.- Parameters:
newAllign- The allign property of this text object.
-
getLatexTextSize
public final int getLatexTextSize()
Returns the latex font size of this text object.- Returns:
- The latex font size of this text object.
-
setLatexTextSize
public final void setLatexTextSize(int newLatexfs)
Sets the latex font size of this text object.- Parameters:
newLatexfs- The latex font size of this text object.
-
isCopy
public boolean isCopy(JaxoObject comp)
Determines if this JaxoObject is a copy of the specified one.- Overrides:
isCopyin classJaxoTextObject- Parameters:
comp- The JaxoObject to compare against.- Returns:
- True if the JaxoObjects are identical.
-
copyFrom
public void copyFrom(JaxoLatexText temp)
Sets all parameters from the given object to the current one.- Parameters:
temp- The object to copy from.
-
setState
public void setState(JaxoObject o)
Restore state to the values of 'o'. The object 'o' must be an object of the same "type" obtained byJaxoObject.copy().- Overrides:
setStatein classJaxoTextObject- Parameters:
o- the object to copy from.
-
paint
public final void paint(JaxoGraphics2D g2)
The method that paints the JaxoObject.- Specified by:
paintin classJaxoObject- Parameters:
g2- The graphics context where the object has to be painted.
-
isRolledOver
public final boolean isRolledOver(int mouseX, int mouseY)Determines whether the cursor is currently above the visual aid icon of this LatexText.- Parameters:
mouseX- The current x - coordinate of the cursormouseY- The current y - coordinate of the cursor- Returns:
- A boolean variable
-
getBounds
public java.awt.Rectangle getBounds()
Returns the bounding box of this object.- Returns:
- the bounding box of this object.
-
latexCommand
public final java.lang.String latexCommand(float scale, java.awt.Dimension canvasDim)The LaTeX command that is necessary to draw the given JaxoObject using the axodraw.sty package.- Specified by:
latexCommandin classJaxoObject- Parameters:
scale- A scale factor to translate Java coordinates to LaTeX coordinates.canvasDim- The current dimension of the canvas.- Returns:
- The corresponding axodraw LaTeX command.
-
setPreferences
public void setPreferences()
Applies default values to this JaxoObject. All fields except location points are initialized with values taken from thepreferences.- Overrides:
setPreferencesin classJaxoTextObject
-
prepareEditPanel
public void prepareEditPanel(JaxoObjectEditPanel editPanel)
Initializes the given editPanel to edit properties of this JaxoObject.- Specified by:
prepareEditPanelin classJaxoObject- Parameters:
editPanel- the panel to prepare.
-
-