gishur.gui2.painter
Class PolygonPainter

java.lang.Object
  |
  +--gishur.gui2.Painter
        |
        +--gishur.gui2.painter.PolygonPainter

public class PolygonPainter
extends Painter

A Painter for the inner area of polygons. A complete polygon including activatable border lines, vertex points etc. should be handled by a DisplayXPolygon (assumed you want to display it), this Painter class only draws the inner coloured area of a polygon, i.e. a sole naked coloured area with polygon shape. One of their tasks is to calculate the area of the screen which has to be drawn if an object using this PolygonPainter must be redrawn. For this purpose, the method recalculate(gishur.gui2.RenderContext, gishur.gui2.PropertyStatusReader, gishur.core.Parameters) must be called with the point's properties, location etc. as arguments. The other task is to perform the drawing operation with draw(java.awt.Graphics, gishur.gui2.RenderContext, gishur.gui2.PropertyStatusReader, byte), using the color specified by the property xpolygon.inner.color, which can be set by calling the DrawAtom.setProperty(java.lang.String, java.lang.Object)-method.

Properties Summary
Key Value Type Default value Meaning
color java.awt.Color java.awt.Color.green The colour of the inner area of this polygon.

Version:
1.0
Author:
Christoph Sachse

Fields inherited from class gishur.gui2.Painter
LEVEL_0, LEVEL_1, LEVEL_2, LEVEL_3, LEVEL_ALL, LEVEL_BITS_USED, LEVEL_DEFAULT, LEVEL_FIRST, LEVEL_LAST, LOCATEABLE, VISIBLE
 
Constructor Summary
PolygonPainter()
          Empty and only constructor.
 
Method Summary
 void draw(java.awt.Graphics g, RenderContext context, PropertyStatusReader prop, byte level)
          Draws the specified level of this Painter using the given Graphics object and RenderContext for drawing, and the given PropertyStatusReader for reading properties.
protected  void recalculate(RenderContext context, PropertyStatusReader prop, Parameters param)
          Recalculates this Painter using the given RenderContext, PropertyStatusReader, local point information and other parameters.
 
Methods inherited from class gishur.gui2.Painter
addBounds, addBounds, alignTo, alignTo, calculateDockingPoint, contains, getAlignmentPoint, getRelativeAlignmentPoint, height, isOnLevel, level, locateable, name, outline, reshape, setBounds, setBounds, setLevel, setLocation, setName, setOutline, setSubTypePrefix, style, visible, width, x, y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonPainter

public PolygonPainter()
Empty and only constructor. It only creates a PolygonShape-object which will furthermore store the size and shape of this polygon and provide special drawing functionality.
Method Detail

recalculate

protected void recalculate(RenderContext context,
                           PropertyStatusReader prop,
                           Parameters param)
Recalculates this Painter using the given RenderContext, PropertyStatusReader, local point information and other parameters.
Overrides:
recalculate in class Painter
Parameters:
context - the RenderContext to use
prop - the PropertyStatusReader to use for reading properties
param - a Parameters-object for location and other parameters parsed by the DisplayObject, that uses this Painter.

draw

public void draw(java.awt.Graphics g,
                 RenderContext context,
                 PropertyStatusReader prop,
                 byte level)
Draws the specified level of this Painter using the given Graphics object and RenderContext for drawing, and the given PropertyStatusReader for reading properties.
Overrides:
draw in class Painter
Parameters:
g - the Graphics to draw on
context - the RenderContext to use
prop - the PropertyStatusReader to use for reading properties
level - the level to draw