net.kwfgrid.gwui.graphview
Class ArcEdgePainter

java.lang.Object
  extended by net.kwfgrid.gwui.graphview.ArcEdgePainter
All Implemented Interfaces:
EdgePainter, Member

public class ArcEdgePainter
extends java.lang.Object
implements Member, EdgePainter

The painter for ArcEdges.
This painter has the following properties which can be configured via the application's theme:

The size property of the arrow assumes an upright arrow.


Field Summary
protected static java.awt.Dimension ARROW_SIZE
           
protected static java.lang.String ARROW_SIZE_KEY
           
protected static java.awt.Color COLOR
           
protected static java.lang.String COLOR_KEY
           
protected static java.awt.Font FONT
           
protected static java.lang.String FONT_KEY
           
static java.lang.String IDENTIFIER
           
protected static java.awt.Stroke STROKE
           
protected static java.lang.String STROKE_KEY
           
protected static java.awt.Color TEXT_COLOR
           
protected static java.lang.String TEXT_COLOR_KEY
           
 
Constructor Summary
ArcEdgePainter()
           
 
Method Summary
 void getEdgeScreenBounds(JGraphPane grp, Edge edge, java.awt.Rectangle scr)
          Returns the outer rectangle of the edge on screen.
 Group getGroup()
          Get the group this member belongs to.
 java.lang.String getIdentifier()
          Get a unique identifier of the member.
 void groupPropertyChanged(java.lang.String name, java.lang.Object oldvalue, java.lang.Object newvalue)
          Called by this member's group if a property of the group changed.
 void paintEdge(JGraphPane grp, java.awt.Graphics2D g, Edge edge)
          Paints the supplied edge.
 double screenDistanceFromEdge(JGraphPane grp, Edge edge, java.awt.Point point)
          Returns the distance of the point to the edge.
 void setGroup(Group group)
          Sets the group of this member.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER

public static final java.lang.String IDENTIFIER
See Also:
Constant Field Values

ARROW_SIZE_KEY

protected static final java.lang.String ARROW_SIZE_KEY
See Also:
Constant Field Values

COLOR_KEY

protected static final java.lang.String COLOR_KEY
See Also:
Constant Field Values

TEXT_COLOR_KEY

protected static final java.lang.String TEXT_COLOR_KEY
See Also:
Constant Field Values

FONT_KEY

protected static final java.lang.String FONT_KEY
See Also:
Constant Field Values

STROKE_KEY

protected static final java.lang.String STROKE_KEY
See Also:
Constant Field Values

ARROW_SIZE

protected static final java.awt.Dimension ARROW_SIZE

COLOR

protected static final java.awt.Color COLOR

TEXT_COLOR

protected static final java.awt.Color TEXT_COLOR

FONT

protected static final java.awt.Font FONT

STROKE

protected static final java.awt.Stroke STROKE
Constructor Detail

ArcEdgePainter

public ArcEdgePainter()
Method Detail

getGroup

public Group getGroup()
Description copied from interface: Member
Get the group this member belongs to.

Specified by:
getGroup in interface Member
Returns:
The group this member belong to or null if the member currently does not belong to a group.

getIdentifier

public java.lang.String getIdentifier()
Description copied from interface: Member
Get a unique identifier of the member.

Specified by:
getIdentifier in interface Member

groupPropertyChanged

public void groupPropertyChanged(java.lang.String name,
                                 java.lang.Object oldvalue,
                                 java.lang.Object newvalue)
Description copied from interface: Member
Called by this member's group if a property of the group changed.

Specified by:
groupPropertyChanged in interface Member

setGroup

public void setGroup(Group group)
              throws java.lang.IllegalArgumentException
Description copied from interface: Member
Sets the group of this member. This method will usually be called by the group itself when this member is added to or removed from it.

Specified by:
setGroup in interface Member
Throws:
java.lang.IllegalArgumentException

paintEdge

public void paintEdge(JGraphPane grp,
                      java.awt.Graphics2D g,
                      Edge edge)
Description copied from interface: EdgePainter
Paints the supplied edge.

Specified by:
paintEdge in interface EdgePainter
Parameters:
grp - the graph pane
g - the graphics
edge - the edge to paint

getEdgeScreenBounds

public void getEdgeScreenBounds(JGraphPane grp,
                                Edge edge,
                                java.awt.Rectangle scr)
Description copied from interface: EdgePainter
Returns the outer rectangle of the edge on screen.

Specified by:
getEdgeScreenBounds in interface EdgePainter
Parameters:
grp - the graph pane
edge - the edge
scr - the rectangle receiving the edge's coordinates

screenDistanceFromEdge

public double screenDistanceFromEdge(JGraphPane grp,
                                     Edge edge,
                                     java.awt.Point point)
Description copied from interface: EdgePainter
Returns the distance of the point to the edge.

Specified by:
screenDistanceFromEdge in interface EdgePainter
Parameters:
grp - the graph pane
edge - the edge
point - the point
Returns:
the distance of the point from the edge


Copyright © 2005-2010 The K-Wf Grid Consortium. All Rights Reserved.