com.tensegrity.gui.formatitems
Class PaintItem

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

public class PaintItem
extends java.lang.Object
implements FormatItem

FormatItem for a PaintFormat

Version:
$Id: PaintItem.java,v 1.9 2005/05/04 12:55:06 SebastienGuyon Exp $
Author:
Arnd Houben

Constructor Summary
PaintItem(int style, int backColor, int foreColor, int gradientType, int patternType, java.lang.String textureKey, int transparency, boolean isTransparent, boolean isVisible)
          Constructor which expects initial values for each item data
PaintItem(PaintFormat pf)
          Constructor which requires an initial PaintFormat object for initialisation
PaintItem(PaintItem pi)
          A copy constructor which takes another paint item to initialize all needed parameters
 
Method Summary
 int getColor()
          Returns background color
 java.lang.String getDescription()
          Returns the canonical description used to create a format.
 int getForeColor()
          Returns foreground color
 Format getFormat()
          Returns a new format.
 java.lang.Object[] getFormatData()
          Returns all format parameters
 int getGradientType()
          Returns the gradient type
 int getPatternType()
          Returns the pattern type
 int getStyle()
          Returns the paint style
 java.lang.String getTextureKey()
          Returns the texture key
 int getTransparency()
          Returns the level of transparency
 boolean isTransparent()
          Returns the transparent flag
 boolean isVisible()
          Checks the visibility of this paint item
 void setColor(int color)
          Sets the background color
 void setForeColor(int foreColor)
          Sets the foreground color
 void setGradientType(int gradientType)
          Sets the gradient type
 void setPatternType(int patternType)
          Sets the pattern type
 void setStyle(int style)
          Sets the paint style
 void setTextureKey(java.lang.String textureKey)
          Sets the texture key.
 void setTransparency(int transparency)
          Sets the transparency level
 void setTransparent(boolean isTransparent)
          Sets the transparent flag
 void setVisible(boolean isVisible)
          Sets the visibility of this paint item
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaintItem

public PaintItem(PaintFormat pf)
Constructor which requires an initial PaintFormat object for initialisation

Parameters:
pf - PaintFormat object

PaintItem

public PaintItem(PaintItem pi)
A copy constructor which takes another paint item to initialize all needed parameters

Parameters:
pi - another PaintItem instance

PaintItem

public PaintItem(int style,
                 int backColor,
                 int foreColor,
                 int gradientType,
                 int patternType,
                 java.lang.String textureKey,
                 int transparency,
                 boolean isTransparent,
                 boolean isVisible)
Constructor which expects initial values for each item data

Parameters:
style - the paint style
backColor - the background color
foreColor - the foreground color
gradientType - the gradient type
patternType - the pattern type
textureKey - the texture key
transparency - the level of transparency in percent
isTransparent - true to indicate that transparency should be used, false otherwise
isVisible - true to indicate that this paint item is visible, false otherwise
Method Detail

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 PaintFormatParseException
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:
PaintFormatParseException

getColor

public final int getColor()
Returns background color

Returns:
color in Tensegrity Color Format

setColor

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

Parameters:
color - in Tensegrity Color Format

getForeColor

public final int getForeColor()
Returns foreground color

Returns:
color in Tensegrity Color Format

setForeColor

public final void setForeColor(int foreColor)
Sets the foreground color

Parameters:
foreColor - in Tensegrity Color Format

getGradientType

public final int getGradientType()
Returns the gradient type

Returns:
gradient type

setGradientType

public final void setGradientType(int gradientType)
Sets the gradient type

Parameters:
gradientType - the gradient type

isTransparent

public final boolean isTransparent()
Returns the transparent flag

Returns:
true if PaintFormat should be transparent, false otherwise

setTransparent

public final void setTransparent(boolean isTransparent)
Sets the transparent flag

Parameters:
isTransparent - set to true to indicate that transparency should be used, false otherwise

isVisible

public final boolean isVisible()
Checks the visibility of this paint item

Returns:
true if this paint item is visible, false otherwise

setVisible

public final void setVisible(boolean isVisible)
Sets the visibility of this paint item

Parameters:
isVisible - set to true to indicate that this paint item shoulb be visible, false otherwise

getPatternType

public final int getPatternType()
Returns the pattern type

Returns:
pattern type

setPatternType

public final void setPatternType(int patternType)
Sets the pattern type

Parameters:
patternType - the pattern type

getStyle

public final int getStyle()
Returns the paint style

Returns:
paint style

setStyle

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

Parameters:
style - the paint style

getTransparency

public final int getTransparency()
Returns the level of transparency

Returns:
transparency level

setTransparency

public final void setTransparency(int transparency)
Sets the transparency level

Parameters:
transparency - the transparency level in percent, 0 means no transparency, 100 total transparency

setTextureKey

public final void setTextureKey(java.lang.String textureKey)
Sets the texture key.

Parameters:
textureKey - should be unique

getTextureKey

public final java.lang.String getTextureKey()
Returns the texture key

Returns:
a unique key for a texture

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.