plugins.big.bigsnakeutils.icy.snake2D
Class Snake2DScale

java.lang.Object
  extended by java.awt.geom.Path2D
      extended by java.awt.geom.Path2D.Double
          extended by plugins.big.bigsnakeutils.icy.snake2D.Snake2DScale
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable

public class Snake2DScale
extends java.awt.geom.Path2D.Double

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 Path2D by additional state variables.

Version:
May 3, 2014
Author:
Ricard Delgado-Gonzalo (ricard.delgado@gmail.com), Nicolas Chenouard (nicolas.chenouard@gmail.com), Philippe Thévenaz (philippe.thevenaz@epfl.ch)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Path2D
java.awt.geom.Path2D.Double, java.awt.geom.Path2D.Float
 
Field Summary
 int npoints
           
 float[] xpoints
           
 float[] ypoints
           
 
Fields inherited from class java.awt.geom.Path2D
WIND_EVEN_ODD, WIND_NON_ZERO
 
Constructor Summary
Snake2DScale()
          This constructor builds a scale with default values.
Snake2DScale(java.awt.Color color, boolean closed)
          This constructor builds a scale with the provided colors and flags.
Snake2DScale(double[] xpoints, double[] ypoints, int npoints, java.awt.Color color, boolean closed)
          This constructor builds a scale with the provided colors and flags.
Snake2DScale(float[] xpoints, float[] ypoints, int npoints, java.awt.Color color, boolean closed)
          This constructor builds a scale with the provided colors and flags.
 
Method Summary
 java.awt.Color getColor()
          Returns the associated color of the scale.
 float getStrokeWidth()
          Returns the associated stroke width of the scale.
 boolean isClosed()
           
 void loadFromXML(org.w3c.dom.Node node)
          Loads the scale from an XML node.
 void saveToXML(org.w3c.dom.Node node)
          Saves the scale in an XML node.
 void setStrokeWidth(float strokeWidth)
          Returns the associated stroke width of the scale.
 java.lang.String toString()
          This method returns text-based information about this object.
 
Methods inherited from class java.awt.geom.Path2D.Double
append, clone, curveTo, getBounds2D, getPathIterator, lineTo, moveTo, quadTo, transform
 
Methods inherited from class java.awt.geom.Path2D
append, closePath, contains, contains, contains, contains, contains, contains, contains, contains, createTransformedShape, getBounds, getCurrentPoint, getPathIterator, getWindingRule, intersects, intersects, intersects, intersects, reset, setWindingRule
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xpoints

public float[] xpoints

ypoints

public float[] ypoints

npoints

public int npoints
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 color coloris set to Color.RED. The scale is closed by default.


Snake2DScale

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


Snake2DScale

public Snake2DScale(double[] xpoints,
                    double[] ypoints,
                    int npoints,
                    java.awt.Color color,
                    boolean closed)
This constructor builds a scale with the provided colors and flags.


Snake2DScale

public Snake2DScale(float[] xpoints,
                    float[] ypoints,
                    int npoints,
                    java.awt.Color color,
                    boolean closed)
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

saveToXML

public void saveToXML(org.w3c.dom.Node node)
Saves the scale in an XML node.


loadFromXML

public void loadFromXML(org.w3c.dom.Node node)
Loads the scale from an XML node.


getColor

public java.awt.Color getColor()
Returns the associated color of the scale.


isClosed

public boolean isClosed()

getStrokeWidth

public float getStrokeWidth()
Returns the associated stroke width of the scale.


setStrokeWidth

public void setStrokeWidth(float strokeWidth)
Returns the associated stroke width of the scale.