snake2D
Class Snake2DScale

java.lang.Object
  extended by java.awt.Polygon
      extended by snake2D.Snake2DScale
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable

public class Snake2DScale
extends java.awt.Polygon

This class is used to store the scales that are used to draw the skin of the snake. It extends the capabilities of the class Polygon by additional state variables.

See Also:
Snake2D, Serialized Form

Field Summary
 java.awt.Color bestAttemptColor
          This is the color with which this scale will be drawn if it is part of the optimal skin found so far in the course of the optimization.
 boolean closed
          This flag is used to determine how to draw the outline of this scale.
 java.awt.Color currentAttemptColor
          This is the color with which this scale will be drawn if it is part of the skin being currently examined in the course of the optimization.
 boolean filled
          This flag is used to determine how to draw the interior of this scale.
 
Fields inherited from class java.awt.Polygon
npoints, xpoints, ypoints
 
Constructor Summary
Snake2DScale()
          This constructor builds a scale with default values.
Snake2DScale(java.awt.Color bestAttemptColor, java.awt.Color currentAttemptColor, boolean closed, boolean filled)
          This constructor builds a scale with the provided colors and flags.
 
Method Summary
 java.lang.String toString()
          This method returns text-based information about this object.
 
Methods inherited from class java.awt.Polygon
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, invalidate, reset, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bestAttemptColor

public java.awt.Color bestAttemptColor
This is the color with which this scale will be drawn if it is part of the optimal skin found so far in the course of the optimization. It is also the color with which it will be drawn during the interactive session. If bestAttempt is null, the color returned by the method ij.gui.PolygonRoi.getColor() will be used instead.


currentAttemptColor

public java.awt.Color currentAttemptColor
This is the color with which this scale will be drawn if it is part of the skin being currently examined in the course of the optimization. It is ignored during the interactive session. If currentAttempt is null, the color that is most complementary to the color returned by the method ij.gui.PolygonRoi.getColor() will be used instead.


closed

public boolean closed
This flag is used to determine how to draw the outline of this scale. If it is set to true, then the first and the last point of the polygon are joined. Otherwise, if it is set to false, then the first and the last point of the polygon are not joined. A closed scale can be filled.

See Also:
filled

filled

public boolean filled
This flag is used to determine how to draw the interior of this scale. If it is set to true, then the scale is filled. Otherwise, if it is set to false, then only the outline of the scale is drawn. The status of this flag is honored only when the scale is closed, as indicated by the closed flag.

See Also:
closed
Constructor Detail

Snake2DScale

public Snake2DScale()
This constructor builds a scale with default values. Points can be added with the method add() of the class Polygon. The default colors bestAttempt and currentAttempt are both set to null. The scale is closed by default, and it is not filled.


Snake2DScale

public Snake2DScale(java.awt.Color bestAttemptColor,
                    java.awt.Color currentAttemptColor,
                    boolean closed,
                    boolean filled)
This constructor builds a scale with the provided colors and flags.

Method Detail

toString

public java.lang.String toString()
This method returns text-based information about this object.

Overrides:
toString in class java.lang.Object