gishur.x.gui
Class DisplayXPolygon

java.lang.Object
  |
  +--gishur.gui2.DrawAtom
        |
        +--gishur.gui2.DrawObject
              |
              +--gishur.gui2.DisplayObject
                    |
                    +--gishur.gui2.DisplayInteractiveObject
                          |
                          +--gishur.gui2.DisplayInteractiveModel
                                |
                                +--gishur.x.gui.DisplayXObject
                                      |
                                      +--gishur.x.gui.DisplayXPolygon

public class DisplayXPolygon
extends DisplayXObject

This class is a simple visualization class for polygons represented by the XPolygon class of the core package. The appeareance of the polygon is highly configurable by the use of painter classes of the type PolgyonPainter and LinePainters Painters for the vertices. The painters are not locally stored - they are stored in the properties. If a painter is not specified via properties, a new painter of the appropiate type will be created and stored at the local properties list of this object. To use other Painters defined in properties higher in the hierachy, one has to remove the automatically created property entries at this object.

Properties Summary
Used Prefix Meaning
xpolygon Prefix for all properties used at this class and at the used PolygonPainter (see property style at this class).
xpolygon.line Prefix for all properties used for this ploygon's lines.
xpolygon.points Prefix for all properties used for this polygon's vertex points.
xpolygon.inner Prefix for all properties used for this polygons inner area.
Key Value Type Default value Meaning
style gishur.x.gui.PolygonStyle None The Style-object which defines the shape of this DisplayXPolygon and which creates the Painters.

Created Painters
Painting order Name Type Tasks
1 inner PolygonPainter The Painter managing the drawing of the inner area of this DisplayXPolygon
2 ... 2+n (polygon has n vertices) line i LinePainter The Painter managing the drawing of the i-th border line of this polygon, i.e. the line between vertex i and vertex i+1.
2+n+1 ... 2+2n+1 (polygon has n vertices) point i Painter The Painter managing the drawing of the i-th vertex of this polygon.

Version:
1.0
Author:
Christoph Sachse

Fields inherited from class gishur.gui2.DisplayInteractiveObject
ACTIVE, ACTIVE1, ACTIVE2, ACTIVE3, ACTIVE4, NORMAL, SELECTED
 
Fields inherited from class gishur.gui2.DrawAtom
BLOCK_REPAINT, MARK_RECALC, MARK_REPAINT, MARK_SIZE, REPAINT, UNBLOCK_REPAINT, USER_STATES_FIRST, USER_STATES_MASK
 
Constructor Summary
DisplayXPolygon(ModelController model)
          Constructs a new DisplayXPolygon and connects it with the given ModelController (that must have a XPolygon object as source object (model).
DisplayXPolygon(XPolygon source)
          Constructs a new DisplayXPolygon and connects it with the given XPolygon via the construction of a new ModelController.
 
Method Summary
protected  void checkActiveElement(java.lang.String element)
          This method is called by DisplayInteractiveObject.activate().
protected  ElementTransform createElementTransform()
          Creates a new element transformation object.
protected  void recalculate(RenderContext context, PropertyStatusReader properties)
          Forces the DrawAtom to recalculate its representation.
 
Methods inherited from class gishur.x.gui.DisplayXObject
screenX2Transformation
 
Methods inherited from class gishur.gui2.DisplayInteractiveModel
controller, setContoller, setSource, source
 
Methods inherited from class gishur.gui2.DisplayInteractiveObject
activate, activate, active, deactivate, elementTransform, refreshPropertyStatus, select, selected, setActiveElement, setSupportActivation, setSupportElementTransform, setSupportSelection, supportActivation, supportElementTransform, supportSelection, unselect
 
Methods inherited from class gishur.gui2.DisplayObject
addEventListener, calculateDockingPoint, calculateDockingPoint, next, parent, prev, processDrawEvent, removeEventListener
 
Methods inherited from class gishur.gui2.DrawObject
addDrawDependency, addPainter, blockRepaint, checkState, checkStateCleared, child, clear, clearCache, clearState, dependency, dirty, disableEvents, draw, draw, enableEvents, ensureRecalculate, findPainter, firstPainter, fullscreen, hide, hide, insert, levelMask, levelUsed, locate, makeDirty, makeDirty, next, nextPainter, prepeareRenderContext, prev, processEvent, propertyReader, recalculate, remove, removeDrawDependency, repaint, screenTransformation, setFullscreen, setPaintBeforeMembers, setScreenTransformation, setState, show, show, state, state, unblockRepaint, unblockRepaint, visible
 
Methods inherited from class gishur.gui2.DrawAtom
addProperties, collectHits, dispatchEvent, displayManager, drawComponent, getBounds, getLocalProperty, getProperty, getProperty, getRequiredProperty, preprocessEvent, processMessage, properties, removeProperty, sendEvent, sendMessage, setBounds, setPropertiesTo, setProperty, setProperty, setProperty, setProperty, toString, toString, toStringDetail, toTreeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DisplayXPolygon

public DisplayXPolygon(ModelController model)
Constructs a new DisplayXPolygon and connects it with the given ModelController (that must have a XPolygon object as source object (model).
Parameters:
model - the ModelController that controls the source.

DisplayXPolygon

public DisplayXPolygon(XPolygon source)
Constructs a new DisplayXPolygon and connects it with the given XPolygon via the construction of a new ModelController.
Parameters:
source - the source object.
Method Detail

recalculate

protected void recalculate(RenderContext context,
                           PropertyStatusReader properties)
Forces the DrawAtom to recalculate its representation. This method will only be called, if it became dirty via a call to the DrawObject.makeDirty(boolean) method or something has happened, that causes all DrawAtoms to recalculate their representation. This method should only be called by the render system.
Overrides:
recalculate in class DrawObject
Parameters:
context - the RenderContext to use
properties - the PropertyStatusReader to use for reading properties

checkActiveElement

protected void checkActiveElement(java.lang.String element)
This method is called by DisplayInteractiveObject.activate(). It should check, which elements should be set to which activation level if one does activate the element with the given name. To specify the activated elements and their activation levels, call DisplayInteractiveObject.setActiveElement(java.lang.String, byte) for each element. Overwrite this method in order to implement element activation correctly.
Overrides:
checkActiveElement in class DisplayInteractiveObject
Parameters:
element - the element name

createElementTransform

protected ElementTransform createElementTransform()
Creates a new element transformation object. This method will be called by DisplayInteractiveObject.elementTransform() and should be overwritten by subclasses in order to support element transformation objects correctly.
Overrides:
createElementTransform in class DisplayInteractiveObject
Returns:
new element transformation object for this DisplayObject.