Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph v5.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jgraph.graph
Class EdgeView

    java.lang.Object
      |
      +--org.jgraph.graph.AbstractCellView
            |
            +--org.jgraph.graph.EdgeView

All Implemented Interfaces:
  CellView, Serializable

public class EdgeView
extends AbstractCellView

The default implementation of an edge view.

See Also:
  Serialized Form

Nested Class Summary
`static class` | `EdgeView.EdgeHandle`

Field Summary
`Shape` | `beginShape` Drawing attributes that are created on the fly
`protected Rectangle2D` | `cachedBounds`
`protected Rectangle2D` | `cachedLabelBounds`
`Shape` | `endShape` Drawing attributes that are created on the fly
`protected Point` | `labelPosition` Cached label position of the edge.
`Shape` | `lineShape` Drawing attributes that are created on the fly
`protected List` | `points` List of points of the edge.
`static EdgeRenderer` | `renderer` Renderer for the class.
`GeneralPath` | `sharedPath` Shared-path tune-up.
`protected CellView` | `source` Cached source and target portview of the edge.
`protected CellView` | `target` Cached source and target portview of the edge.

Fields inherited from class org.jgraph.graph.AbstractCellView
`allAttributes, attributes, cell, cellEditor, childViews, graph, mapper, parent`

Constructor Summary
`EdgeView(Object cell, JGraph graph, CellMapper mapper)` Constructs an edge view for the specified model object.

Method Summary
`void` | `addPoint(int index, Point2D p)` Adds `p` at position `index`.
`Rectangle2D` | `getBounds()` Returns the location for this portview.
`EdgeRenderer` | `getEdgeRenderer()` Returns the local renderer.
`CellHandle` | `getHandle(GraphContext context)` Returns a cell handle for the view.
`Rectangle2D` | `getLabelBounds()` Returns the bounds of label according to the last rendering state
`Point2D` | `getLabelPosition()` Returns a point that describes the position of the label.
`static double` | `getLength(CellView view)`
`Point2D` | `getPoint(int index)` Returns the cached points for this edge.
`int` | `getPointCount()` Returns the number of point for this edge.
`List` | `getPoints()` Returns the points.
`CellViewRenderer` | `getRenderer()` Returns a renderer for the class.
`Shape` | `getShape()` Returns the shape of the view according to the last rendering state
`CellView` | `getSource()` Returns the CellView that represents the source of the edge.
`CellView` | `getTarget()` Returns the CellView that represents the target of the edge.
`boolean` | `intersects(Graphics g, Rectangle2D rect)` Returns true if this view intersects the given rectangle.
`void` | `refresh(boolean createDependentViews)` Overrides the parent method to udpate the cached points, source and target port.
`void` | `removePoint(int index)` Removes the point at position `index`.
`void` | `setLabelPosition(Point2D pos)` Sets the description of the label position.
`void` | `setPoint(int index, Point2D p)` Sets the point at `index` to `p`.
`void` | `setSource(CellView sourceView)` Sets the `sourceView` of the edge.
`void` | `setTarget(CellView targetView)` Sets the `targetView` of the edge.
`void` | `update()` Update attributes and recurse children.

Methods inherited from class org.jgraph.graph.AbstractCellView
`childUpdated, getAllAttributes, getAttributes, getBounds, getCell, getChildViews, getDescendantViews, getEditor, getGraph, getMapper, getModel, getParentView, getRendererComponent, isLeaf, removeFromParent, scale, setAttributes, setBounds, translate, updateAllAttributes`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### renderer

    public static EdgeRenderer renderer

  Renderer for the class.

### points

    protected List points

  List of points of the edge. May contain ports.

### source

    protected CellView source

  Cached source and target portview of the edge.

### target

    protected CellView target

  Cached source and target portview of the edge.

### labelPosition

    protected Point labelPosition

  Cached label position of the edge.

### beginShape

    public Shape beginShape

  Drawing attributes that are created on the fly

### endShape

    public Shape endShape

  Drawing attributes that are created on the fly

### lineShape

    public Shape lineShape

  Drawing attributes that are created on the fly

### sharedPath

    public transient GeneralPath sharedPath

  Shared-path tune-up.

### cachedLabelBounds

    protected Rectangle2D cachedLabelBounds

### cachedBounds

    protected Rectangle2D cachedBounds

Constructor Detail

### EdgeView

    public EdgeView(Object cell,
                    JGraph graph,
                    CellMapper mapper)

  Constructs an edge view for the specified model object.

Parameters:
  `cell` - reference to the model object

Method Detail

### refresh

    public void refresh(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.

  Specified by:
    `refresh` in interface `CellView`
  Overrides:
    `refresh` in class `AbstractCellView`

### update

    public void update()

  Update attributes and recurse children.

  Specified by:
    `update` in interface `CellView`
  Overrides:
    `update` in class `AbstractCellView`

### getShape

    public Shape getShape()

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

### getLabelBounds

    public Rectangle2D getLabelBounds()

  Returns the bounds of label according to the last rendering state

### intersects

    public boolean intersects(Graphics g,
                              Rectangle2D rect)

  Returns true if this view intersects the given rectangle.

  Specified by:
    `intersects` in interface `CellView`
  Overrides:
    `intersects` in class `AbstractCellView`

### getBounds

    public Rectangle2D getBounds()

  Returns the location for this portview.

  Specified by:
    `getBounds` in interface `CellView`
  Specified by:
    `getBounds` in class `AbstractCellView`

### getEdgeRenderer

    public EdgeRenderer getEdgeRenderer()

  Returns the local renderer. Do not access the renderer field directly. Use this method instead!

### getRenderer

    public CellViewRenderer getRenderer()

  Returns a renderer for the class.

  Specified by:
    `getRenderer` in class `AbstractCellView`

### getHandle

    public CellHandle getHandle(GraphContext context)

  Returns a cell handle for the view.

  Specified by:
    `getHandle` in interface `CellView`
  Specified by:
    `getHandle` in class `AbstractCellView`

### getSource

    public CellView getSource()

  Returns the CellView that represents the source of the edge.

### setSource

    public void setSource(CellView sourceView)

  Sets the `sourceView` of the edge.

### getTarget

    public CellView getTarget()

  Returns the CellView that represents the target of the edge.

### setTarget

    public void setTarget(CellView targetView)

  Sets the `targetView` of the edge.

### getLabelPosition

    public Point2D getLabelPosition()

  Returns a point that describes the position of the label.

### setLabelPosition

    public void setLabelPosition(Point2D pos)

  Sets the description of the label position.

### getPoints

    public List getPoints()

  Returns the points.

  Returns:
    java.util.List

### getPointCount

    public int getPointCount()

  Returns the number of point for this edge.

### getPoint

    public Point2D getPoint(int index)

  Returns the cached points for this edge.

### setPoint

    public void setPoint(int index,
                         Point2D p)

  Sets the point at `index` to `p`.

### addPoint

    public void addPoint(int index,
                         Point2D p)

  Adds `p` at position `index`.

### removePoint

    public void removePoint(int index)

  Removes the point at position `index`.

### getLength

    public static double getLength(CellView view)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph v5.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 2003-2004 Gaudenz Alder. All rights reserved.