gishur.gui2.painter
Class InvectPainter

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

public class InvectPainter
extends Painter

A Painter for vector (arrow) lines used for input of vectors. InvectPainters are created by InvectStyles. Here is an overview of the properties used by a InvectPainter:

Properties Summary
Key Value Type Default value Meaning
color java.awt.Color java.awt.Color.black The colour of the inner area of this line.
width java.lang.Integer 2 Determines the thickness of the line.
arrow.width java.lang.Integer 10 The width (length) of the arrow.
arrow.height java.lang.Integer 4 The height of the arrow.
border.color java.awt.Color java.awt.Color.yellow The colour of the optional one-pixel border around the point.

Version:
1.0
Author:
Thomas Wolf

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
InvectPainter()
          Default constructor.
 
Method Summary
protected  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  java.awt.Point getRelativeAlignmentPoint(java.awt.Point p, byte h_align, byte v_align)
          Returns an alignment point for the given alignment values relatively to the represented line.
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, 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

InvectPainter

public InvectPainter()
Default constructor.
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

protected 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

getRelativeAlignmentPoint

protected java.awt.Point getRelativeAlignmentPoint(java.awt.Point p,
                                                   byte h_align,
                                                   byte v_align)
Returns an alignment point for the given alignment values relatively to the represented line.
Overrides:
getRelativeAlignmentPoint in class Painter
Parameters:
p - a Point object where to store the calculated point or null.
h_align - an alignment value (-128==Alignment.LEFT≤0==Alignment.CENTER≤127==Alignment.RIGHT) for the horizontal alignment
v_align - an alignment value (-128==Alignment.TOP≤0==Alignment.CENTER≤127==Alignment.BOTTOM) for the vertical alignment