Interface JaxoArrow
-
- All Superinterfaces:
Cloneable
,EventListener
,PropertyChangeListener
,Serializable
- All Known Implementing Classes:
AbstractBaseArrow
,JaxoDefaultArrow
public interface JaxoArrow extends Serializable, Cloneable, PropertyChangeListener
An arrow for a AbstractJaxoObject.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
JaxoArrow.Coordinates
The coordinates of an arrow.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JaxoArrow
copy()
Returns an exact copy (clone) of the given JaxoArrow.double
getArrowAngle()
Returns the angle of this arrow.float
getArrowInset()
Returns the tail length of this arrow.float
getArrowLength()
Returns the length of this arrow.float
getArrowWidth()
Returns the width of this arrow.Rectangle
getBounds(JaxoArrow.Coordinates coords)
Returns a bounding rectangle for this arrow at the given coordinates.boolean
isCopy(JaxoArrow obj)
Checks if this Arrow is a copy of the given test Arrow.void
paint(Graphics2D g2, JaxoArrow.Coordinates coords)
Paints the arrow to the given graphics context.void
setArrowAngle(double newAngle)
Sets the width of this arrow.void
setArrowInset(float newInset)
Sets the inset ratio of this arrow.void
setArrowLength(float newLength)
Sets the length of this arrow.void
setArrowWidth(float newWidth)
Sets the width of this arrow.-
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
-
-
-
-
Method Detail
-
paint
void paint(Graphics2D g2, JaxoArrow.Coordinates coords)
Paints the arrow to the given graphics context.- Parameters:
g2
- The graphics context to paint to.coords
- The coordinates of the arrow to paint.
-
copy
JaxoArrow copy()
Returns an exact copy (clone) of the given JaxoArrow.- Returns:
- The copy of the given JaxoArrow.
-
getBounds
Rectangle getBounds(JaxoArrow.Coordinates coords)
Returns a bounding rectangle for this arrow at the given coordinates.- Parameters:
coords
- The coordinates of the arrow.- Returns:
- a rectangle that completely contains the arrow.
-
isCopy
boolean isCopy(JaxoArrow obj)
Checks if this Arrow is a copy of the given test Arrow.Two JaxoArrows are copies of each other if all their editable properties are equal. This method should be synchronized with
copy()
such that for any non-null JaxoArrowarrow
, a call likeisCopy(arrow.copy())
must return true.Finally, this method implements an equivalence relation on non-null object references, it should satisfy the same constraints as the
Object.equals(java.lang.Object)
method.- Parameters:
obj
- the Arrow to test against. May be null in which case false is returned.- Returns:
- True if the two arrows are equivalent.
-
getArrowInset
float getArrowInset()
Returns the tail length of this arrow.- Returns:
- The tail length of this arrow, a number between 0 and 1.
-
setArrowInset
void setArrowInset(float newInset)
Sets the inset ratio of this arrow. This is the ratio of the inset (or tail length) to the length of the arrow.- Parameters:
newInset
- The inset ratio, needs to be between 0 and 1, otherwise an IllegalArgumentException is thrown.
-
getArrowLength
float getArrowLength()
Returns the length of this arrow.- Returns:
- The length of this arrow.
-
setArrowLength
void setArrowLength(float newLength)
Sets the length of this arrow.- Parameters:
newLength
- The new length, must be positive otherwise an IllegalArgumentException is thrown.
-
getArrowWidth
float getArrowWidth()
Returns the width of this arrow.- Returns:
- The width of this arrow.
-
setArrowWidth
void setArrowWidth(float newWidth)
Sets the width of this arrow.- Parameters:
newWidth
- The new width, must be positive otherwise an IllegalArgumentException is thrown.
-
getArrowAngle
double getArrowAngle()
Returns the angle of this arrow.- Returns:
- The angle of this arrow.
-
setArrowAngle
void setArrowAngle(double newAngle)
Sets the width of this arrow.- Parameters:
newAngle
- The new angle.
-
-