com.ignotus.aifile
Class ShapeAttributeVisitor

java.lang.Object
  extended by com.ignotus.aifile.ComponentVisitor
      extended by com.ignotus.aifile.ShapeAttributeVisitor
All Implemented Interfaces:
ColorableINF

public class ShapeAttributeVisitor
extends ComponentVisitor
implements ColorableINF


Method Summary
 int fillColor()
           
 int fillOpacity()
           
 boolean hasFill()
           
 boolean hasStroke()
           
static ShapeAttributeVisitor makeCurrentStateVisitor(PApplet parent)
           
static ShapeAttributeVisitor makeFilledShapeVisitor(int fillColor)
           
static ShapeAttributeVisitor makeFilledStrokedShapeVisitor(int fillColor, int strokeColor, int weight)
           
static ShapeAttributeVisitor makeStrokedShapeVisitor(int strokeColor, int weight)
           
 void setColors(PApplet host)
          Sets fill and stroke using the current graphics state.
 void setFillColor(int newFillColor)
          Sets the current fill color.
 void setFillOpacity(int opacity)
          Sets opacity of current fill color.
 void setHasFill(boolean newHasFill)
           
 void setHasStroke(boolean newHasStroke)
           
 void setNoFill()
          Equivalent to setHasFill(false).
 void setNoStroke()
          Equivalent to setHasStroke(false).
 void setStrokeColor(int newStrokeColor)
          Sets the current stroke color.
 void setStrokeOpacity(int opacity)
          Sets opacity of current stroke color.
 void setWeight(float newWeight)
           
 int strokeColor()
           
 int strokeOpacity()
           
 void visitBezShape(BezShape comp)
          visits a BezShape node
 float weight()
          Returns the current weight (in points) of stroked lines.
 
Methods inherited from class com.ignotus.aifile.ComponentVisitor
visitCustomComponent, visitDocumentComponent, visitGroupComponent, visitLayerComponent, visitPointText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeCurrentStateVisitor

public static ShapeAttributeVisitor makeCurrentStateVisitor(PApplet parent)

makeFilledShapeVisitor

public static ShapeAttributeVisitor makeFilledShapeVisitor(int fillColor)

makeStrokedShapeVisitor

public static ShapeAttributeVisitor makeStrokedShapeVisitor(int strokeColor,
                                                            int weight)

makeFilledStrokedShapeVisitor

public static ShapeAttributeVisitor makeFilledStrokedShapeVisitor(int fillColor,
                                                                  int strokeColor,
                                                                  int weight)

visitBezShape

public void visitBezShape(BezShape comp)
visits a BezShape node

Overrides:
visitBezShape in class ComponentVisitor
Parameters:
comp - a BezShape instance

setColors

public void setColors(PApplet host)
Sets fill and stroke using the current graphics state.


hasFill

public boolean hasFill()
Specified by:
hasFill in interface ColorableINF
Returns:
true if this shape is filled, false otherwise

setHasFill

public void setHasFill(boolean newHasFill)
Parameters:
newHasFill - pass true if this shape has a fill, false otherwise. Note that the current fillColor will not be discarded by setting hasFill to false: the shape simply won't display or save to file with a fill.

setNoFill

public void setNoFill()
Equivalent to setHasFill(false).

Specified by:
setNoFill in interface ColorableINF

hasStroke

public boolean hasStroke()
Specified by:
hasStroke in interface ColorableINF
Returns:
true if this shape is stroked, false otherwise

setHasStroke

public void setHasStroke(boolean newHasStroke)
Parameters:
newHasStroke - pass true if this shape has a stroke, false otherwise. Note that the current strokeColor will not be discarded by setting hasStroke to false: the shape simply won't display or save to file with a stroke.

setNoStroke

public void setNoStroke()
Equivalent to setHasStroke(false).

Specified by:
setNoStroke in interface ColorableINF

fillColor

public int fillColor()
Specified by:
fillColor in interface ColorableINF
Returns:
the current fill color

setFillColor

public void setFillColor(int newFillColor)
Description copied from interface: ColorableINF
Sets the current fill color.

Specified by:
setFillColor in interface ColorableINF
Parameters:
newFillColor - a Processing color (32-bit int with ARGB bytes).

strokeColor

public int strokeColor()
Specified by:
strokeColor in interface ColorableINF
Returns:
the current stroke color

setStrokeColor

public void setStrokeColor(int newStrokeColor)
Description copied from interface: ColorableINF
Sets the current stroke color.

Specified by:
setStrokeColor in interface ColorableINF
Parameters:
newStrokeColor - a Processing color (32-bit int with ARGB bytes).

setFillOpacity

public void setFillOpacity(int opacity)
Sets opacity of current fill color.

Specified by:
setFillOpacity in interface ColorableINF
Parameters:
opacity - a number in the range 0..255. Value is not checked!

fillOpacity

public int fillOpacity()
Specified by:
fillOpacity in interface ColorableINF
Returns:
the opacity value of the current fill color

setStrokeOpacity

public void setStrokeOpacity(int opacity)
Sets opacity of current stroke color.

Specified by:
setStrokeOpacity in interface ColorableINF
Parameters:
opacity - a number in the range 0..255. Value is not checked!

strokeOpacity

public int strokeOpacity()
Specified by:
strokeOpacity in interface ColorableINF
Returns:
the opacity value of the current stroke color

weight

public float weight()
Returns the current weight (in points) of stroked lines.

Specified by:
weight in interface ColorableINF
Returns:
the current weight (in points) of stroked lines. One point = one pixel on screen.

setWeight

public void setWeight(float newWeight)
Specified by:
setWeight in interface ColorableINF
Parameters:
newWeight - the new weight of stroked lines.


processing library IgnoCodeLib by Paul Hertz. (c) 2011