view
Class DrawingInfo

java.lang.Object
  extended by view.DrawingInfo

public final class DrawingInfo
extends Object

Collects info on how an object should be drawn. Has at least a color. Defaults a fill attribute to false, and possibly has a stroke and composite value. Can be constructed with a StringTool.DOLLAR separated single string giving at least the color as a MyColor, followed (all further optional) by 'true' or 'false' as a filling property, a string giving the composite as a MyAlphaComposite and the stroke as a MyStroke.


Field Summary
private  boolean active
          Normally true, means that it should be applied.
private  Paint color
          The color of the data set.
private  Composite composite
          A composite object for the set, might be null.
private  Stroke stroke
          A stroke attribute to this set, might be null.
 
Constructor Summary
DrawingInfo(Paint col)
          Constructs a new data set key.
DrawingInfo(Paint col, Stroke how)
          Constructs a new data set key.
DrawingInfo(Paint col, Stroke how, Composite over)
          Construct a new data set.
DrawingInfo(String poly)
          Constructs a data set from a single line.
 
Method Summary
 boolean equals(Object other)
          To drawing infos are equal if their unique name matches and all other attributes are equal.
 Paint getColor()
          Returns the set color.
 Composite getComposite()
          Returns how this object is drawn on top of other object, that have already been drawn.
 Stroke getStroke()
          Returns how the outline of this object should be drawn.
 int hashCode()
          The hash key for this set is derived from its color.
 boolean isActive()
          Returns true, if this drawing info is active, meaning that it should be applied.
 void setActive(boolean to)
          Sets the active flag to the desired value.
private  void setColor(Paint col)
          Sets the color.
private  void setComposite(Composite over)
          Set hoe this set is drawn over existing figures.
private  void setStroke(Stroke how)
          Set how the shape of this set is stroked.
 boolean toggleActive()
          Toggles the active flag and returns the new state.
 String toString()
          The string representation is parsable from the constructor.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

active

private boolean active
Normally true, means that it should be applied.


color

private Paint color
The color of the data set.


composite

private Composite composite
A composite object for the set, might be null.


stroke

private Stroke stroke
A stroke attribute to this set, might be null.

Constructor Detail

DrawingInfo

public DrawingInfo(String poly)
Constructs a data set from a single line. The line has first the color, parsable from MyColor, then, a boolean stating the fill attribute, and composite and stroke attributes.


DrawingInfo

public DrawingInfo(Paint col)
Constructs a new data set key.


DrawingInfo

public DrawingInfo(Paint col,
                   Stroke how)
Constructs a new data set key.


DrawingInfo

public DrawingInfo(Paint col,
                   Stroke how,
                   Composite over)
Construct a new data set.

Method Detail

isActive

public boolean isActive()
Returns true, if this drawing info is active, meaning that it should be applied.


toggleActive

public boolean toggleActive()
Toggles the active flag and returns the new state.


setActive

public void setActive(boolean to)
Sets the active flag to the desired value.


hashCode

public int hashCode()
The hash key for this set is derived from its color. The color is always set.

Overrides:
hashCode in class Object

setColor

private void setColor(Paint col)
Sets the color.


setComposite

private void setComposite(Composite over)
Set hoe this set is drawn over existing figures.


setStroke

private void setStroke(Stroke how)
Set how the shape of this set is stroked.


getColor

public Paint getColor()
Returns the set color. Always set.


getComposite

public Composite getComposite()
Returns how this object is drawn on top of other object, that have already been drawn. Might retrun null.


getStroke

public Stroke getStroke()
Returns how the outline of this object should be drawn. Might retrun null.


equals

public boolean equals(Object other)
To drawing infos are equal if their unique name matches and all other attributes are equal.

Overrides:
equals in class Object

toString

public String toString()
The string representation is parsable from the constructor.

Overrides:
toString in class Object