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:
Shape
,PropertyChangeListener
,Serializable
,Cloneable
,EventListener
,JaxoRotationObject
Defines a JaxoObject which is just a string.
- Since:
- 2.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Align center-bottom with respect to text coordinates.static final int
Align center-center with respect to text coordinates.static final int
Align center-top with respect to text coordinates.static final int
Align left-bottom with respect to text coordinates.static final int
Align left-center with respect to text coordinates.static final int
Align left-top with respect to text coordinates.static final int
Align right-bottom with respect to text coordinates.static final int
Align right-center with respect to text coordinates.static final int
Align right-top with respect to text coordinates.static final int
Latex text size footnotesize.static final int
Latex text size huge.static final int
Latex text size large.static final int
Latex text size normalsize.static final int
Latex text size scriptsize.static final int
Latex text size small.static final int
Latex text size tiny.static final int
Latex text size Huge.static final int
Latex text size Large.static final int
Latex text size LARGE.Fields inherited from class net.sf.jaxodraw.object.JaxoObject
D_FORMAT, GRAY_SCALE_FORMAT, SELECT_NONE, SELECT_P1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
copyFrom
(JaxoLatexText temp) Sets all parameters from the given object to the current one.final int
Returns the allign property of this text object.Returns the bounding box of this object.final int
Returns the latex font size of this text object.boolean
isCopy
(JaxoObject comp) Determines if this JaxoObject is a copy of the specified one.final boolean
isRolledOver
(int mouseX, int mouseY) Determines whether the cursor is currently above the visual aid icon of this LatexText.final String
latexCommand
(float scale, Dimension canvasDim) The LaTeX command that is necessary to draw the given JaxoObject using the axodraw.sty package.final void
paint
(JaxoGraphics2D g2) The method that paints the JaxoObject.void
prepareEditPanel
(JaxoObjectEditPanel editPanel) Initializes the given editPanel to edit properties of this JaxoObject.final void
setAllign
(int newAllign) Sets the allign property of this text object.final void
setLatexTextSize
(int newLatexfs) Sets the latex font size of this text object.void
Applies default values to this JaxoObject.void
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 Details
-
ALIGN_LT
public static final int ALIGN_LTAlign left-top with respect to text coordinates.- See Also:
-
ALIGN_LC
public static final int ALIGN_LCAlign left-center with respect to text coordinates.- See Also:
-
ALIGN_LB
public static final int ALIGN_LBAlign left-bottom with respect to text coordinates.- See Also:
-
ALIGN_CT
public static final int ALIGN_CTAlign center-top with respect to text coordinates.- See Also:
-
ALIGN_CC
public static final int ALIGN_CCAlign center-center with respect to text coordinates.- See Also:
-
ALIGN_CB
public static final int ALIGN_CBAlign center-bottom with respect to text coordinates.- See Also:
-
ALIGN_RT
public static final int ALIGN_RTAlign right-top with respect to text coordinates.- See Also:
-
ALIGN_RC
public static final int ALIGN_RCAlign right-center with respect to text coordinates.- See Also:
-
ALIGN_RB
public static final int ALIGN_RBAlign right-bottom with respect to text coordinates.- See Also:
-
TINY
public static final int TINYLatex text size tiny.- See Also:
-
SCRIPTSIZE
public static final int SCRIPTSIZELatex text size scriptsize.- See Also:
-
FOOTNOTESIZE
public static final int FOOTNOTESIZELatex text size footnotesize.- See Also:
-
SMALL
public static final int SMALLLatex text size small.- See Also:
-
NORMALSIZE
public static final int NORMALSIZELatex text size normalsize.- See Also:
-
LARGE
public static final int LARGELatex text size large.- See Also:
-
XLARGE
public static final int XLARGELatex text size Large.- See Also:
-
XXLARGE
public static final int XXLARGELatex text size LARGE.- See Also:
-
HUGE
public static final int HUGELatex text size huge.- See Also:
-
XHUGE
public static final int XHUGELatex text size Huge.- See Also:
-
-
Constructor Details
-
JaxoLatexText
public JaxoLatexText()
-
-
Method Details
-
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
Determines if this JaxoObject is a copy of the specified one.- Overrides:
isCopy
in classJaxoTextObject
- Parameters:
comp
- The JaxoObject to compare against.- Returns:
- True if the JaxoObjects are identical.
-
copyFrom
Sets all parameters from the given object to the current one.- Parameters:
temp
- The object to copy from.
-
setState
Restore state to the values of 'o'. The object 'o' must be an object of the same "type" obtained byJaxoObject.copy()
.- Overrides:
setState
in classJaxoTextObject
- Parameters:
o
- the object to copy from.
-
paint
The method that paints the JaxoObject.- Specified by:
paint
in 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
Returns the bounding box of this object.- Returns:
- the bounding box of this object.
-
latexCommand
The LaTeX command that is necessary to draw the given JaxoObject using the axodraw.sty package.- Specified by:
latexCommand
in 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:
setPreferences
in classJaxoTextObject
-
prepareEditPanel
Initializes the given editPanel to edit properties of this JaxoObject.- Specified by:
prepareEditPanel
in classJaxoObject
- Parameters:
editPanel
- the panel to prepare.
-