gishur.gui2
Class Style

java.lang.Object
  |
  +--gishur.gui2.Style
Direct Known Subclasses:
EdgeStyle, FancyPointStyle, GraphElementInfoStyle, InfoStyle, InrectStyle, InvectStyle, LineStyle, PolygonStyle, RoundNodeStyle, RoundPointStyle, ShadowStyle, SquarePointStyle

public abstract class Style
extends java.lang.Object

Style is the global part of a set of painters. It can store global information for all Painters created by its createPainter(java.lang.String, java.lang.String, gishur.gui2.PropertyStatusReader) method. The method validatePainterCreation(java.lang.String, gishur.gui2.PropertyStatusReader) reads properties from a given PropertyStatusReader in its default implementation. The following list shows, which properties are read. The subtype and style of the PropertyStatusReader will be set to the values given to the createPainter(java.lang.String, java.lang.String, gishur.gui2.PropertyStatusReader) method (that calls validatePainterCreation(java.lang.String, gishur.gui2.PropertyStatusReader)).

Properties Summary
Key Value Type Default value Meaning
visible java.lang.Boolean true The visibility of the Painter to be created
locateable java.lang.Boolean true

Specifies, if the Painter, that should be created, should be locateable (by the mouse). Unvisible Painters may still be locateable.

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
Style()
           
 
Method Summary
protected abstract  Painter createNewPainter()
          Creates a new Painter object.
 Painter createPainter(java.lang.String name, java.lang.String subtypeprefix, PropertyStatusReader prop)
          Returns a new Painter object.
protected abstract  java.lang.String stylePrefix()
          Returns the style prefix string used for reading properties by all Painters that are created by this Style.
protected  boolean validatePainterCreation(java.lang.String name, PropertyStatusReader prop)
          Validates the creation of new Painters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Style

public Style()
Method Detail

stylePrefix

protected abstract java.lang.String stylePrefix()
Returns the style prefix string used for reading properties by all Painters that are created by this Style.
Returns:
the style prefix string used for reading properties.

createNewPainter

protected abstract Painter createNewPainter()
Creates a new Painter object.
Returns:
new Painter instance.

validatePainterCreation

protected boolean validatePainterCreation(java.lang.String name,
                                          PropertyStatusReader prop)
Validates the creation of new Painters. The default implementation checks the visible and locateable properties, and returns false, iff both are set false. The default values for these properties are set to true.
Parameters:
name - the name of the painter to be created
prop - the PropertyStatusReader to use for reading properties

createPainter

public final Painter createPainter(java.lang.String name,
                                   java.lang.String subtypeprefix,
                                   PropertyStatusReader prop)
Returns a new Painter object.
Parameters:
subtypeprefix - the subtype prefix that the created Painter should use for reading properties.
name - the name of the created Painter
subtypeprefix - the prefix string for reading properties
prop - PropertyStatusReader that can be used to validate the creation via validatePainterCreation(java.lang.String, gishur.gui2.PropertyStatusReader).
Returns:
new Painter instance.