EDU.utwente.CoCompose.lang
Class Link

java.lang.Object
  |
  +--EDU.auburn.VGJ.graph.Edge
        |
        +--EDU.utwente.CoCompose.lang.Link

public class Link
extends Edge

Represents a link between nodes. Added some extra functionality to the Edge class to use it with CoCompose models.

Version:
0.0.26, 24 June 2002
Author:
Dennis Wagelaar

Field Summary
static java.awt.Color DEFAULT_EDGE_COLOR
          The default color for drawing edges.
 
Fields inherited from class EDU.auburn.VGJ.graph.Edge
data, data_, defaultDataTypes_, head_, points_, selected, styleColors, styleLabels, styleNames, stylePatterns, tail_
 
Constructor Summary
Link(Node tail, Node head, DPoint3[] points)
          Constructs a Link.
Link(Node tail, Node head, Edge from)
          Constructs a Link.
Link(Node tail, Node head, GMLobject gml)
          Constructs a Link.
 
Method Summary
 void accept(ModelVisitor visitor)
          Accepts a ModelVisitor.
 void draw(java.awt.Graphics graphics, Matrix44 transform, boolean inplane, int quality)
          Draws the link onto the graphics context.
 java.awt.Color getEdgeColor()
          Gets the edge color for drawing.
 java.awt.Color getSelectColor()
          Gets the selection artifact color for drawing.
 void setEdgeColor(java.awt.Color edgeColor)
          Sets the edge color for drawing.
 void setSelectColor(java.awt.Color selectColor)
          Sets the selection artifact color for drawing.
 java.lang.String toPS(Matrix44 transform, boolean inplane)
          Gets the Postscript representation for this link.
 
Methods inherited from class EDU.auburn.VGJ.graph.Edge
draw, getLabel, getLineStyle, head, isDummy, points, PSnum_, psString_, saveState, setGMLvalues, setLabel, setLineStyle, slide, tail, toPS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EDGE_COLOR

public static final java.awt.Color DEFAULT_EDGE_COLOR
The default color for drawing edges.
Constructor Detail

Link

public Link(Node tail,
            Node head,
            DPoint3[] points)
Constructs a Link.
Parameters:
tail - The tail node in the link.
head - The head node in the link.
points - The intermediate points for drawing.

Link

public Link(Node tail,
            Node head,
            Edge from)
Constructs a Link.
Parameters:
tail - The tail node in the link.
head - The head node in the link.
from - The edge to copy the attributes from.

Link

public Link(Node tail,
            Node head,
            GMLobject gml)
Constructs a Link.
Parameters:
tail - The tail node in the link.
head - The head node in the link.
gml - The GML object to read the attributes from.
Method Detail

setSelectColor

public void setSelectColor(java.awt.Color selectColor)
Sets the selection artifact color for drawing.
Parameters:
selectColor - The color.

getSelectColor

public java.awt.Color getSelectColor()
Gets the selection artifact color for drawing.
Returns:
The select color for drawing.

setEdgeColor

public void setEdgeColor(java.awt.Color edgeColor)
Sets the edge color for drawing.
Parameters:
edgeColor - The color.

getEdgeColor

public java.awt.Color getEdgeColor()
Gets the edge color for drawing.
Returns:
The edge color for drawing.

draw

public void draw(java.awt.Graphics graphics,
                 Matrix44 transform,
                 boolean inplane,
                 int quality)
Draws the link onto the graphics context.
Parameters:
graphics - The graphics context.
transform - The coordinate transformation matrix.
inplane - If true, assumes drawing in XY plane.
quality - The drawing quality (> 1 is high quality).

toPS

public java.lang.String toPS(Matrix44 transform,
                             boolean inplane)
Gets the Postscript representation for this link.
Parameters:
transform - The coordinate transformation matrix (3D -> 2D).
inplane - If true, the drawing is done in the XY plane.

accept

public void accept(ModelVisitor visitor)
            throws CoComposeException
Accepts a ModelVisitor.
Parameters:
visitor - The visitor object to accept.
Throws:
CoComposeException - if visiting operation failed.