|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jaxodraw.object.JaxoObject
net.sf.jaxodraw.object.JaxoExtendedObject
public abstract class JaxoExtendedObject
A JaxoObject with at least two points.
Field Summary | |
---|---|
static int |
SELECT_DX
A point with coordinates (x,y2). |
static int |
SELECT_DY
A point with coordinates (x2,y). |
static int |
SELECT_P2
Second point (index 1). |
Fields inherited from class net.sf.jaxodraw.object.JaxoObject |
---|
D_FORMAT, GRAY_SCALE_FORMAT, SELECT_NONE, SELECT_P1 |
Constructor Summary | |
---|---|
JaxoExtendedObject()
|
Method Summary | |
---|---|
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(JaxoExtendedObject temp)
Sets all parameters from the given object to the current one. |
int |
getGrabbedHandle(int clickX,
int clickY,
JaxoHandle h)
Determines which handle the user has selected to move/resize/edit an object. |
int |
getHeight()
Returns the height of this object. |
int |
getPointCount()
Returns the number of points it takes to draw this object. |
double |
getRadius()
Convenience method for getting the radius of a 2 point object, ie the distance between the first two points. |
int |
getRelh()
Returns the relative height of this object. |
Dimension |
getRelSize()
Returns the relative width and height of this object. |
int |
getRelw()
Returns the relative width of this object. |
Dimension |
getSize()
Returns the width and height of this object. |
protected BasicStroke |
getStroke()
Returns the stroke of this particle object. |
float |
getStrokeWidth()
Returns the stroke width property of this particle object. |
int |
getWidth()
Returns the width of this object. |
int |
getX(int index)
X coordinate of Point 0 <= index < getPointCount(). |
int |
getX2()
Returns the x2 coordinate of this object. |
int |
getY(int index)
Y coordinate of Point 0 <= index < getPointCount(). |
int |
getY2()
Returns the y2 coordinate of this object. |
boolean |
isCopy(JaxoObject comp)
Determines if this JaxoObject is a copy of the specified one. |
String |
latexWidth()
The LaTeX command that sets the width for this JaxoObject, using the axodraw.sty package. |
void |
moveBy(int deltaX,
int deltaY)
Reset the coordinates of the object when it is moved by deltaX and deltaY. |
void |
paintHandles(JaxoGraphics2D g2,
JaxoHandle h,
int editMode)
Paints the handles of this JaxoObject that allow to move/resize/edit it. |
protected void |
resetStroke()
Resets the stroke to a default BasicStroke with current width. |
void |
setLocation(int newX,
int newY,
int newX2,
int newY2)
Sets the position coordinates of this object. |
void |
setPreferences()
Applies default values to this JaxoObject. |
void |
setRadius(float newRadius)
Convenience method for setting the 'radius' of a 2 point object. |
void |
setRelativeHeight(int h)
Deprecated. unused. Use setY2(int) or setRelWAndH(int,int) instead. |
void |
setRelativeWidth(int w)
Deprecated. unused. Use setX2(int) or setRelWAndH(int,int) instead. |
void |
setRelWAndH(int w,
int h)
Sets the relative width and height of this object. |
void |
setState(JaxoObject o)
Restore state to the values of 'o'. |
protected void |
setStroke(BasicStroke newStroke)
Sets the stroke of this particle object. |
void |
setStrokeWidth(float newStroke)
Sets the stroke width property of this particle object. |
void |
setX(int index,
int value)
Set X coordinate of Point 0 <= index < getPointCount() to 'value'. |
void |
setX2(int newX2)
Sets the x2 coordinate of this object. |
void |
setY(int index,
int value)
Set Y coordinate of Point 0 <= index < getPointCount() to 'value'. |
void |
setY2(int newY2)
Sets the y2 coordinate of this object. |
float |
smallestDistanceTo(int px,
int py)
Determines the smallest distance of any of the handles of this JaxoObject from the given point. |
boolean |
strokeIs(float comp)
Compares the stroke of this JaxoExtendedObject to the given float, taking into account a 0.1% error margin. |
Methods inherited from class net.sf.jaxodraw.object.JaxoObject |
---|
addPropertyChangeListener, contains, contains, contains, contains, copy, copyFrom, firePropertyChange, getBounds2D, getBoundsWithHandles, getColor, getGeneralPath, getLaTexLocation, getName, getPathIterator, getPathIterator, getPoints, getX, getY, intersects, intersects, isAround, isMarked, latexCommand, paint, paintVisualAid, prepareEditPanel, propertyChange, removePropertyChangeListener, rescaleObject, setAsMarked, setColor, setLocation, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setPointCount, setPoints, setTransient, setX, setXPosition, setY, setYPosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.Shape |
---|
getBounds |
Field Detail |
---|
public static final int SELECT_DX
public static final int SELECT_DY
public static final int SELECT_P2
Constructor Detail |
---|
public JaxoExtendedObject()
Method Detail |
---|
public int getPointCount()
getPointCount
in class JaxoObject
public int getX(int index)
getX
in class JaxoObject
index
- The index of the point to get.
public int getY(int index)
getY
in class JaxoObject
index
- The index of the point to get.
public void setX(int index, int value)
setX
in class JaxoObject
index
- The index of the point to set.value
- The value to set.public void setY(int index, int value)
setY
in class JaxoObject
index
- The index of the point to set.value
- The value to set.public final int getX2()
public final void setX2(int newX2)
newX2
- The x2 coordinate of this object.public final int getY2()
public final void setY2(int newY2)
newY2
- The y2 coordinate of this object.public final float getStrokeWidth()
public void setStrokeWidth(float newStroke)
newStroke
- The stroke width property of this particle object.public final int getWidth()
getWidth
in class JaxoObject
public final int getHeight()
getHeight
in class JaxoObject
public final int getRelw()
public final int getRelh()
public final void setRelWAndH(int w, int h)
w
- The relative width of this object.h
- The relative height of this object.public final void setRelativeWidth(int w)
setX2(int)
or setRelWAndH(int,int)
instead.
w
- The relative width of this object.public final void setRelativeHeight(int h)
setY2(int)
or setRelWAndH(int,int)
instead.
h
- The relative heigh of this object.public void setRadius(float newRadius)
newRadius
- The radius to set.public double getRadius()
public final void setLocation(int newX, int newY, int newX2, int newY2)
newX
- The x coordinate of this object.newY
- The y coordinate of this object.newX2
- The x2 coordinate of this object.newY2
- The y2 coordinate of this object.public void moveBy(int deltaX, int deltaY)
moveBy
in class JaxoObject
deltaX
- The x displacement.deltaY
- The y displacement.public final Dimension getSize()
public final Dimension getRelSize()
public boolean isCopy(JaxoObject comp)
isCopy
in class JaxoObject
comp
- The JaxoObject to compare against.
public void copyFrom(JaxoExtendedObject temp)
temp
- The object to copy from.public void setState(JaxoObject o)
JaxoObject.copy()
.
setState
in class JaxoObject
o
- the object to copy from.public float smallestDistanceTo(int px, int py)
smallestDistanceTo
in class JaxoObject
px
- The x coordinate of the test point.py
- The y coordinate of the test point.
public int getGrabbedHandle(int clickX, int clickY, JaxoHandle h)
getGrabbedHandle
in class JaxoObject
clickX
- The x coordinate where the mouse click has ocurred.clickY
- The y coordinate where the mouse click has ocurred.h
- A handle object.
public void paintHandles(JaxoGraphics2D g2, JaxoHandle h, int editMode)
paintHandles
in class JaxoObject
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.public boolean canBeSelected(int handle, int mode)
canBeSelected
in class JaxoObject
handle
- One of the static variables SELECT_* defined for
this JaxoObject.mode
- The current edit mode.
public String latexWidth()
latexWidth
in class JaxoObject
public void setPreferences()
preferences
.
setPreferences
in class JaxoObject
public final boolean strokeIs(float comp)
comp
- The float to compare to.
protected final BasicStroke getStroke()
protected final void setStroke(BasicStroke newStroke)
newStroke
- The strokeof this particle object.protected void resetStroke()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |