org.jdrawing.graphics
Class GraphicsElement

java.lang.Object
  extended byorg.jdrawing.graphics.GraphicsElement
Direct Known Subclasses:
GraphicsOperation, Group

public class GraphicsElement
extends java.lang.Object

Base class for entities, that can be added to GraphicsModel.


Field Summary
static java.lang.String BACKGROUND
          Background style.
static java.lang.String COLOR
          Color style.
static java.lang.String COMPOSITE
          Composite style.
static java.lang.String FONT
          Font style.
static java.lang.String PAINT
          Paint style.
protected  Group parent
          Parent Group of this element
protected  int position
          Index of this elements in the children list of the parent Group
static java.lang.String STROKE
          Stroke style.
static java.lang.String TRANSFORM
          Transform style.
 
Constructor Summary
GraphicsElement()
           
 
Method Summary
 void addStyle(java.lang.String style, java.lang.Object value)
          Add style to this element
 Group getParent()
          Returns this parent Group of this element.
 java.lang.Object getStyle(java.lang.String style)
          Gets style of the element with given name
 java.lang.String[] getStyles()
          Returns an array of names of all styles, assigned to this element.
 java.awt.geom.AffineTransform getTransform()
          Returns the AffineTransform that is concatenation of transform of parent group of the element and transform style of the element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLOR

public static final java.lang.String COLOR
Color style. The value of this style must be instance of class Color

See Also:
Constant Field Values

FONT

public static final java.lang.String FONT
Font style. The value of this style must be instance of class Font

See Also:
Constant Field Values

STROKE

public static final java.lang.String STROKE
Stroke style. The value of this style must be instance of class Stroke

See Also:
Constant Field Values

BACKGROUND

public static final java.lang.String BACKGROUND
Background style. The value of this style must be instance of class Color

See Also:
Constant Field Values

COMPOSITE

public static final java.lang.String COMPOSITE
Composite style. The value of this style must be instance of class Composite

See Also:
Constant Field Values

PAINT

public static final java.lang.String PAINT
Paint style. The value of this style must be instance of class Paint

See Also:
Constant Field Values

TRANSFORM

public static final java.lang.String TRANSFORM
Transform style. The value of this style must be instance of class AffineTransform

See Also:
Constant Field Values

parent

protected Group parent
Parent Group of this element


position

protected int position
Index of this elements in the children list of the parent Group

Constructor Detail

GraphicsElement

public GraphicsElement()
Method Detail

getParent

public Group getParent()
Returns this parent Group of this element.

Returns:
The parent Group of this element

addStyle

public void addStyle(java.lang.String style,
                     java.lang.Object value)
Add style to this element

Parameters:
style - Name of the style
value - Value of the style

getStyle

public java.lang.Object getStyle(java.lang.String style)
Gets style of the element with given name

Parameters:
style - Name of the style
Returns:
Value of the style

getStyles

public java.lang.String[] getStyles()
Returns an array of names of all styles, assigned to this element.

Returns:
an array of names of all styles, assigned to this element

getTransform

public java.awt.geom.AffineTransform getTransform()
Returns the AffineTransform that is concatenation of transform of parent group of the element and transform style of the element.

Returns:
concatenated transform