net.sf.jaxodraw.object.arrow
Class AbstractBaseArrow

java.lang.Object
  extended by net.sf.jaxodraw.object.arrow.AbstractBaseArrow
All Implemented Interfaces:
PropertyChangeListener, Serializable, Cloneable, EventListener, JaxoArrow
Direct Known Subclasses:
JaxoDefaultArrow

public abstract class AbstractBaseArrow
extends Object
implements JaxoArrow

An arrow for a JaxoObject.

Note: Implementing sub-classes need to initialize the Stroke property during de-serialization if a default value is set in the constructor.

Since:
2.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.jaxodraw.object.arrow.JaxoArrow
JaxoArrow.Coordinates
 
Field Summary
 
Fields inherited from interface net.sf.jaxodraw.object.arrow.JaxoArrow
D_FORMAT
 
Constructor Summary
AbstractBaseArrow()
           
 
Method Summary
 JaxoArrow copy()
          Returns an exact copy of the given JaxoArrow.
 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.
 Color getColor()
          Returns the color of this arrow.
 Color getFillColor()
          Returns the fill color of this arrow.
 Stroke getStroke()
          Returns the stroke of this arrow.
 boolean isCopy(JaxoArrow testArrow)
          Checks if this Arrow is a copy of the given test Arrow.
 boolean isFilled()
          Determines if the arrow is filled.
 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.
 void setColor(Color c)
          Sets the color of this arrow.
 void setFillColor(Color c)
          Sets the fill color of this arrow.
 void setFilled(boolean value)
          Determines if the arrow should be filled.
 void setStroke(Stroke newStroke)
          Sets the stroke of this arrow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jaxodraw.object.arrow.JaxoArrow
getBounds, getEditPanel, latexCommand, paint
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

AbstractBaseArrow

public AbstractBaseArrow()
Method Detail

getColor

public final Color getColor()
Returns the color of this arrow.

Returns:
The color of this arrow.

setColor

public final void setColor(Color c)
Sets the color of this arrow.

Parameters:
c - The color of this arrow.

getFillColor

public final Color getFillColor()
Returns the fill color of this arrow.

Returns:
The fill color of this arrow.

setFillColor

public final void setFillColor(Color c)
Sets the fill color of this arrow.

Parameters:
c - The fill color of this arrow.

isFilled

public final boolean isFilled()
Determines if the arrow is filled.

Returns:
True if the fillColor is used.

setFilled

public final void setFilled(boolean value)
Determines if the arrow should be filled.

Parameters:
value - True if the fillColor should be used.

getStroke

public final Stroke getStroke()
Returns the stroke of this arrow.

Returns:
The stroke of this arrow.

setStroke

public final void setStroke(Stroke newStroke)
Sets the stroke of this arrow.

Parameters:
newStroke - The stroke property of this arrow.

getArrowWidth

public final float getArrowWidth()
Returns the width of this arrow.

Returns:
The width of this arrow.

setArrowWidth

public final void setArrowWidth(float newWidth)
Sets the width of this arrow.

Parameters:
newWidth - The new width, must be positive otherwise an IllegalArgumentException is thrown.

getArrowLength

public final float getArrowLength()
Returns the length of this arrow.

Returns:
The length of this arrow.

setArrowLength

public final void setArrowLength(float newLength)
Sets the length of this arrow.

Parameters:
newLength - The new length, must be positive otherwise an IllegalArgumentException is thrown.

getArrowInset

public final float getArrowInset()
Returns the tail length of this arrow.

Returns:
The tail length of this arrow, a number between 0 and 1.

setArrowInset

public final 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.

copy

public JaxoArrow copy()
Returns an exact copy of the given JaxoArrow. This implementation uses Object.clone(), so the only thing to do in subclasses is to recursively clone mutable object properties.

Specified by:
copy in interface JaxoArrow
Returns:
The copy of the given JaxoArrow.

isCopy

public boolean isCopy(JaxoArrow testArrow)
Checks if this Arrow is a copy of the given test Arrow.

Specified by:
isCopy in interface JaxoArrow
Parameters:
testArrow - the Arrow to test against.
Returns:
True if the two arrows are equal.


Copyright © 2003-2011 The JaxoDraw team. All Rights Reserved.