Package snake2D
Class Snake2DScale
java.lang.Object
java.awt.Polygon
snake2D.Snake2DScale
- All Implemented Interfaces:
Shape
,Serializable
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThis 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
This flag is used to determine how to draw the outline of this scale.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
This flag is used to determine how to draw the interior of this scale. -
Constructor Summary
ConstructorsConstructorDescriptionThis constructor builds a scale with default values.Snake2DScale
(Color bestAttemptColor, Color currentAttemptColor, boolean closed, boolean filled) This constructor builds a scale with the provided colors and flags. -
Method Summary
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
-
Field Details
-
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. IfbestAttempt
isnull
, the color returned by the methodij.gui.PolygonRoi.getColor()
will be used instead. -
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. IfcurrentAttempt
isnull
, the color that is most complementary to the color returned by the methodij.gui.PolygonRoi.getColor()
will be used instead. -
closed
public boolean closedThis flag is used to determine how to draw the outline of this scale. If it is set totrue
, then the first and the last point of the polygon are joined. Otherwise, if it is set tofalse
, then the first and the last point of the polygon are not joined. A closed scale can be filled.- See Also:
-
filled
public boolean filledThis flag is used to determine how to draw the interior of this scale. If it is set totrue
, then the scale is filled. Otherwise, if it is set tofalse
, 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 theclosed
flag.- See Also:
-
-
Constructor Details
-
Snake2DScale
public Snake2DScale()This constructor builds a scale with default values. Points can be added with the methodadd()
of the classPolygon
. The default colorsbestAttempt
andcurrentAttempt
are both set tonull
. The scale is closed by default, and it is not filled. -
Snake2DScale
public Snake2DScale(Color bestAttemptColor, Color currentAttemptColor, boolean closed, boolean filled) This constructor builds a scale with the provided colors and flags.- Parameters:
bestAttemptColor
- Color showing the most successful attempt during optimization.currentAttemptColor
- Color showing the current attempt during optimization.closed
- Set totrue
if the lastCoordinate
of thisPolygon
has to be joined to the first.filled
- Set totrue
if thisPolygon
is closed and represents an area instead of an outline.
-
-
Method Details