Package net.sf.jaxodraw.object.text
Class JaxoTextObject
- java.lang.Object
-
- net.sf.jaxodraw.object.JaxoObject
-
- net.sf.jaxodraw.object.text.JaxoTextObject
-
- All Implemented Interfaces:
java.awt.Shape
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,JaxoRotationObject
- Direct Known Subclasses:
JaxoLatexText
,JaxoPSText
public abstract class JaxoTextObject extends JaxoObject implements JaxoRotationObject
Defines a JaxoObject which is just a string.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class net.sf.jaxodraw.object.JaxoObject
D_FORMAT, GRAY_SCALE_FORMAT, SELECT_NONE, SELECT_P1
-
-
Constructor Summary
Constructors Constructor Description JaxoTextObject()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeSelected(int handle, int mode)
Determines if the object can be selected (moved, edited, etc) from the given point in a given edit mode.void
copyFrom(JaxoTextObject temp)
Sets all parameters from the given object to the current one.int
getRotationAngle()
Returns the rotationAngle property of this text object.java.lang.String
getTextString()
Returns the textString property of this text object.boolean
isCopy(JaxoObject comp)
Determines if this JaxoObject is a copy of the specified one.java.lang.String
latexWidth()
Returns the line width of this JaxoText.void
paintHandles(JaxoGraphics2D g2, JaxoHandle h, int editMode)
Paints the handles of this JaxoObject that allow to move/resize/edit it.void
rescaleObject(int orx, int ory, float scale)
Rescale this JaxoObject by the scale factor scale, keeping the point (orx, ory) fixed.void
setPreferences()
Applies default values to this JaxoObject.void
setRotationAngle(int angle)
Sets the rotationAngle property of this text object.void
setState(JaxoObject o)
Restore state to the values of 'o'.void
setTextString(java.lang.String string)
Sets the textString property of this text object.-
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, latexCommand, moveBy, paint, paintVisualAid, prepareEditPanel, propertyChange, removePropertyChangeListener, setAsMarked, setColor, setLocation, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setPointCount, setPoints, setTransient, setX, setX, setXPosition, setY, setY, setYPosition, smallestDistanceTo
-
-
-
-
Method Detail
-
getTextString
public final java.lang.String getTextString()
Returns the textString property of this text object.- Returns:
- The textString property of this text object.
-
setTextString
public void setTextString(java.lang.String string)
Sets the textString property of this text object.- Parameters:
string
- The textString property of this text object.
-
getRotationAngle
public final int getRotationAngle()
Returns the rotationAngle property of this text object.- Specified by:
getRotationAngle
in interfaceJaxoRotationObject
- Returns:
- The rotationAngle property of this text object.
-
setRotationAngle
public final void setRotationAngle(int angle)
Sets the rotationAngle property of this text object.- Specified by:
setRotationAngle
in interfaceJaxoRotationObject
- Parameters:
angle
- The rotationAngle property of this text object.
-
isCopy
public boolean isCopy(JaxoObject comp)
Determines if this JaxoObject is a copy of the specified one.- Overrides:
isCopy
in classJaxoObject
- Parameters:
comp
- The JaxoObject to compare against.- Returns:
- True if the JaxoObjects are identical.
-
copyFrom
public void copyFrom(JaxoTextObject 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:
setState
in classJaxoObject
- Parameters:
o
- the object to copy from.
-
paintHandles
public final void paintHandles(JaxoGraphics2D g2, JaxoHandle h, int editMode)
Paints the handles of this JaxoObject that allow to move/resize/edit it.- Specified by:
paintHandles
in classJaxoObject
- Parameters:
g2
- The corresponding graphics context.h
- A handle object to be used for painting.editMode
- The edit mode that the handles are being painted in.
-
canBeSelected
public boolean canBeSelected(int handle, int mode)
Determines if the object can be selected (moved, edited, etc) from the given point in a given edit mode.- Specified by:
canBeSelected
in classJaxoObject
- Parameters:
handle
- One of the static variables SELECT_* defined for this JaxoObject.mode
- The current edit mode.- Returns:
- True if the object may be selected from the given point, false otherwise.
-
latexWidth
public final java.lang.String latexWidth()
Returns the line width of this JaxoText. This is not used for JaxoText.- Specified by:
latexWidth
in classJaxoObject
- Returns:
- Returns "%", corresponding to an empty comment line in LaTeX.
-
rescaleObject
public void rescaleObject(int orx, int ory, float scale)
Rescale this JaxoObject by the scale factor scale, keeping the point (orx, ory) fixed.- Specified by:
rescaleObject
in classJaxoObject
- Parameters:
orx
- The x-coordinate of the fixed point.ory
- The y-coordinate of the fixed point.scale
- The scale parameter.
-
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 classJaxoObject
-
-