org.jgraph.graph.EdgeView Class Reference

Inheritance diagram for org.jgraph.graph.EdgeView:

org.jgraph.graph.AbstractCellView org.jgraph.graph.CellView List of all members.

Public Member Functions

 EdgeView ()
 EdgeView (Object cell)
void refresh (GraphModel model, CellMapper mapper, boolean createDependentViews)
void update ()
Shape getShape ()
Rectangle2D getLabelBounds ()
Rectangle2D getExtraLabelBounds (int index)
boolean intersects (JGraph graph, Rectangle2D rect)
Rectangle2D getBounds ()
CellViewRenderer getRenderer ()
CellHandle getHandle (GraphContext context)
CellView getSource ()
CellView getSourceParentView ()
void setSource (CellView sourceView)
CellView getTarget ()
CellView getTargetParentView ()
void setTarget (CellView targetView)
Point2D getExtraLabelPosition (int index)
Point2D getLabelPosition ()
void setLabelPosition (Point2D pos)
void setExtraLabelPosition (int index, Point2D pos)
boolean isLoop ()
List getPoints ()
int getPointCount ()
Point2D getPoint (int index)
void setPoint (int index, Point2D p)
void addPoint (int index, Point2D p)
void removePoint (int index)
void addExtraLabel (Point2D location, Object label)
void removeExtraLabel (int index)
Point2D getLabelVector ()
Point2D getPerimeterPoint (EdgeView edge, Point2D source, Point2D p)

Static Public Member Functions

static double getLength (CellView view)

Public Attributes

transient Shape beginShape
transient Shape endShape
transient Shape lineShape
transient GeneralPath sharedPath = null

Static Public Attributes

static transient EdgeRenderer renderer = new EdgeRenderer()

Protected Member Functions

CellView getVisibleParent (GraphModel model, CellMapper mapper, Object port)
void checkDefaultLabelPosition ()
void invalidate ()
Point2D getNearestPoint (boolean source)
Point2D getPointLocation (int index)

Protected Attributes

List points
CellView source
CellView target
CellView sourceParentView
CellView targetParentView
Point2D labelPosition
Point2D[] extraLabelPositions
transient Rectangle2D cachedLabelBounds = null
transient Rectangle2D[] cachedExtraLabelBounds = null
transient Point2D labelVector = null
transient Rectangle2D cachedBounds = null

Package Functions

EdgeRenderer getEdgeRenderer ()

Classes

class  EdgeHandle

Detailed Description

The default implementation of an edge view. The getEdgeRenderer method assumes a renderer of type EdgeRenderer. If you provide a custom renderer to a subclass, you must also override the methods that call this method, namely: getShape, getLabelBounds, getExtraLabelBounds, intersects and getBounds.

Version:
1.0 1/1/02
Author:
Gaudenz Alder


Constructor & Destructor Documentation

org.jgraph.graph.EdgeView.EdgeView  ) 
 

Constructs an empty edge view.

org.jgraph.graph.EdgeView.EdgeView Object  cell  ) 
 

Constructs an edge view for the specified model object.

Parameters:
cell reference to the model object


Member Function Documentation

void org.jgraph.graph.EdgeView.addExtraLabel Point2D  location,
Object  label
 

Adds an extra label.

void org.jgraph.graph.EdgeView.addPoint int  index,
Point2D  p
 

Adds p at position index.

void org.jgraph.graph.EdgeView.checkDefaultLabelPosition  )  [protected]
 

Hook for subclassers to avoid default label positions.

Rectangle2D org.jgraph.graph.EdgeView.getBounds  ) 
 

Returns the location for this edgeview.

Reimplemented from org.jgraph.graph.AbstractCellView.

EdgeRenderer org.jgraph.graph.EdgeView.getEdgeRenderer  )  [package]
 

Returns the local renderer. Do not access the renderer field directly. Use this method instead. Note: This method is package private.

Rectangle2D org.jgraph.graph.EdgeView.getExtraLabelBounds int  index  ) 
 

Returns the bounds of label according to the last rendering state

Point2D org.jgraph.graph.EdgeView.getExtraLabelPosition int  index  ) 
 

Returns a point that describes the position of the label.

CellHandle org.jgraph.graph.EdgeView.getHandle GraphContext  context  )  [virtual]
 

Returns a cell handle for the view.

Implements org.jgraph.graph.AbstractCellView.

Rectangle2D org.jgraph.graph.EdgeView.getLabelBounds  ) 
 

Returns the bounds of label according to the last rendering state

Point2D org.jgraph.graph.EdgeView.getLabelPosition  ) 
 

Returns a point that describes the position of the label.

Point2D org.jgraph.graph.EdgeView.getLabelVector  ) 
 

Hook to return the vector that is taken as the base vector to compute relative label positions. Normally, the vector goes from the first to the last point on the edge, unless these points are equal, in which case the average distance of all points to the source point is used.

static double org.jgraph.graph.EdgeView.getLength CellView  view  )  [static]
 

Point2D org.jgraph.graph.EdgeView.getNearestPoint boolean  source  )  [protected]
 

Returns the nearest point wrt to the source or target. This method returns the next or previous point or port in the points list, eg. if source is true it returns the location of the point or port at index 1 without calling the getLocation method on any ports.
Likewise, the method returns the location at index getPointCount()-2 if source is false.

Point2D org.jgraph.graph.EdgeView.getPerimeterPoint EdgeView  edge,
Point2D  source,
Point2D  p
 

Returns the intersection of the bounding rectangle and the straight line between the source and the specified point p. The specified point is expected not to intersect the bounds. Note: You must override this method if you use a different renderer. This is because this method relies on the VertexRenderer interface, which can not be safely assumed for subclassers.

Reimplemented from org.jgraph.graph.AbstractCellView.

Point2D org.jgraph.graph.EdgeView.getPoint int  index  ) 
 

Returns the cached points for this edge.

int org.jgraph.graph.EdgeView.getPointCount  ) 
 

Returns the number of point for this edge.

Point2D org.jgraph.graph.EdgeView.getPointLocation int  index  )  [protected]
 

Returns the point of edge at index. Avoids calling getLocation on any ports of edge.
This is used from within getPoint to pass the nearest point to the portview to find it's location. This uses the center point of the parent view to determine the port view's location to avoid infinite recursion.

List org.jgraph.graph.EdgeView.getPoints  ) 
 

Returns the points.

Returns:
List

CellViewRenderer org.jgraph.graph.EdgeView.getRenderer  )  [virtual]
 

Returns a renderer for the class.

Implements org.jgraph.graph.AbstractCellView.

Shape org.jgraph.graph.EdgeView.getShape  ) 
 

Returns the shape of the view according to the last rendering state

CellView org.jgraph.graph.EdgeView.getSource  ) 
 

Returns the CellView that represents the source of the edge.

CellView org.jgraph.graph.EdgeView.getSourceParentView  ) 
 

CellView org.jgraph.graph.EdgeView.getTarget  ) 
 

Returns the CellView that represents the target of the edge.

CellView org.jgraph.graph.EdgeView.getTargetParentView  ) 
 

CellView org.jgraph.graph.EdgeView.getVisibleParent GraphModel  model,
CellMapper  mapper,
Object  port
[protected]
 

boolean org.jgraph.graph.EdgeView.intersects JGraph  graph,
Rectangle2D  rect
 

Returns true if this view intersects the given rectangle.

Reimplemented from org.jgraph.graph.AbstractCellView.

void org.jgraph.graph.EdgeView.invalidate  )  [protected]
 

Resets the cached values of the edge view

boolean org.jgraph.graph.EdgeView.isLoop  ) 
 

Returns true if the edge is a loop.

void org.jgraph.graph.EdgeView.refresh GraphModel  model,
CellMapper  mapper,
boolean  createDependentViews
 

Overrides the parent method to udpate the cached points, source and target port. If the source or target is removed, a point is inserted into the array of points.

Reimplemented from org.jgraph.graph.AbstractCellView.

void org.jgraph.graph.EdgeView.removeExtraLabel int  index  ) 
 

Removes the point at position index.

void org.jgraph.graph.EdgeView.removePoint int  index  ) 
 

Removes the point at position index.

void org.jgraph.graph.EdgeView.setExtraLabelPosition int  index,
Point2D  pos
 

Sets the description of the label position.

void org.jgraph.graph.EdgeView.setLabelPosition Point2D  pos  ) 
 

Sets the description of the label position.

void org.jgraph.graph.EdgeView.setPoint int  index,
Point2D  p
 

Sets the point at index to p.

void org.jgraph.graph.EdgeView.setSource CellView  sourceView  ) 
 

Sets the sourceView of the edge.

void org.jgraph.graph.EdgeView.setTarget CellView  targetView  ) 
 

Sets the targetView of the edge.

void org.jgraph.graph.EdgeView.update  ) 
 

Update attributes and recurse children.

Reimplemented from org.jgraph.graph.AbstractCellView.


Member Data Documentation

transient Shape org.jgraph.graph.EdgeView.beginShape
 

Drawing attributes that are created on the fly

transient Rectangle2D org.jgraph.graph.EdgeView.cachedBounds = null [protected]
 

transient Rectangle2D [] org.jgraph.graph.EdgeView.cachedExtraLabelBounds = null [protected]
 

transient Rectangle2D org.jgraph.graph.EdgeView.cachedLabelBounds = null [protected]
 

transient Shape org.jgraph.graph.EdgeView.endShape
 

Point2D [] org.jgraph.graph.EdgeView.extraLabelPositions [protected]
 

Point2D org.jgraph.graph.EdgeView.labelPosition [protected]
 

Cached label position of the edge.

transient Point2D org.jgraph.graph.EdgeView.labelVector = null [protected]
 

transient Shape org.jgraph.graph.EdgeView.lineShape
 

List org.jgraph.graph.EdgeView.points [protected]
 

List of points of the edge. May contain ports.

transient EdgeRenderer org.jgraph.graph.EdgeView.renderer = new EdgeRenderer() [static]
 

Renderer for the class.

transient GeneralPath org.jgraph.graph.EdgeView.sharedPath = null
 

Shared-path tune-up.

CellView org.jgraph.graph.EdgeView.source [protected]
 

Cached source and target portview of the edge.

CellView org.jgraph.graph.EdgeView.sourceParentView [protected]
 

CellView org.jgraph.graph.EdgeView.target [protected]
 

CellView org.jgraph.graph.EdgeView.targetParentView [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun May 28 19:13:15 2006 for Digimod by  doxygen 1.4.6-NO