com.tensegrity.gui.formatitems
Class StrokeItem

java.lang.Object
  extended bycom.tensegrity.gui.formatitems.StrokeItem
All Implemented Interfaces:
FormatItem

public class StrokeItem
extends java.lang.Object
implements FormatItem

FormatItem for the StrokeFormat

Version:
$Id: StrokeItem.java,v 1.5 2005/03/24 08:38:46 ArndHouben Exp $
Author:
Arnd Houben

Constructor Summary
StrokeItem(int style, int color, int weight)
          Constructor
StrokeItem(StrokeFormat sf)
          Constructor which requires an initial StrokeFormat
 
Method Summary
 int getColor()
          Returns the stroke color
 java.lang.String getDescription()
          Returns the canonical description used to create a format.
 Format getFormat()
          Returns a new format.
 java.lang.Object[] getFormatData()
          Returns all format parameters
 int getStyle()
          Returns the stroke style
 int getWeight()
          Returns the stroke weight
 boolean isVisible()
          Returns a boolean that indicates whether the corresponding StrokeFormat defines a visible line or not.
 void setColor(int color)
          Sets the stroke color
 void setStyle(int style)
          Sets the stroke style
 void setWeight(int weight)
          Sets the stroke weight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrokeItem

public StrokeItem(StrokeFormat sf)
Constructor which requires an initial StrokeFormat

Parameters:
sf - initial StrokeFormat object

StrokeItem

public StrokeItem(int style,
                  int color,
                  int weight)
Constructor

Parameters:
style - initial style
color - initial color
weight - initial weight
Method Detail

getColor

public final int getColor()
Returns the stroke color

Returns:
color encoded in Tensegrity Color Format

setColor

public final void setColor(int color)
Sets the stroke color

Parameters:
color - encoded in Tensegrity Color Format

getStyle

public final int getStyle()
Returns the stroke style

Returns:
stroke style

setStyle

public final void setStyle(int style)
Sets the stroke style

Parameters:
style - the new stroke style

isVisible

public boolean isVisible()
Returns a boolean that indicates whether the corresponding StrokeFormat defines a visible line or not.

Returns:
true if the corresponding StrokeFormat defines a visible line, false otherwise.

getWeight

public final int getWeight()
Returns the stroke weight

Returns:
stroke weight

setWeight

public final void setWeight(int weight)
Sets the stroke weight

Parameters:
weight - the new stroke weight

getDescription

public final java.lang.String getDescription()
Description copied from interface: FormatItem
Returns the canonical description used to create a format.

Specified by:
getDescription in interface FormatItem
Returns:
a canonical description of this Format

getFormat

public final Format getFormat()
                       throws StrokeFormatParseException
Description copied from interface: FormatItem
Returns a new format. Usually it is pooled within a FormatPool.

Specified by:
getFormat in interface FormatItem
Returns:
the pooled new Format instance
Throws:
StrokeFormatParseException

getFormatData

public final java.lang.Object[] getFormatData()
Description copied from interface: FormatItem
Returns all format parameters

Specified by:
getFormatData in interface FormatItem
Returns:
any array of all format parameters


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.