|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgraph.graph.DefaultCellViewFactory
easik.sketch.util.graph.ExtendableCellViewFactory
public abstract class ExtendableCellViewFactory
A class that can be extended in order to add new ways of rendering cells.
A cell is the most basic form of data component in JGraph, it can be either an edge or a vertex.
In order to create a new drawing form, a new view must be created, along with a renderer to be associated with it.
The renderer must override the getPreferredSize
and paint
methods.
It is recommended that you map new cell types to views, instead of mapping new views to existing cell types.
It is unspecified what will happen if two views are mapped to the same cell type.
Once the cell and view classes are created, just call addCellType
to create a mapping between the cell and view classes.
Nested Class Summary | |
---|---|
private static class |
ExtendableCellViewFactory.CellViewMapping
A mapping of cell classes to view classes. |
Field Summary | |
---|---|
private java.util.Vector<ExtendableCellViewFactory.CellViewMapping> |
viewIndirections
The list of mappings between cell types and view types |
Constructor Summary | |
---|---|
ExtendableCellViewFactory()
Default constructor that adds no new cell to view mappings. |
Method Summary | |
---|---|
void |
addCellType(java.lang.Class cell,
java.lang.Class view)
Adds a cell to view mapping to the list of mappings. |
protected org.jgraph.graph.EdgeView |
createEdgeView(java.lang.Object cell)
Creates edge views |
protected org.jgraph.graph.VertexView |
createVertexView(java.lang.Object v)
Reads through the list of registered mappings to see if this object is a cell of the specified type. |
java.util.Vector<ExtendableCellViewFactory.CellViewMapping> |
getViewIndirections()
|
void |
setViewIndirections(java.util.Vector<ExtendableCellViewFactory.CellViewMapping> list)
|
Methods inherited from class org.jgraph.graph.DefaultCellViewFactory |
---|
createEdgeView, createPortView, createPortView, createView |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector<ExtendableCellViewFactory.CellViewMapping> viewIndirections
Constructor Detail |
---|
public ExtendableCellViewFactory()
Method Detail |
---|
public void addCellType(java.lang.Class cell, java.lang.Class view)
cell
- The cell type.view
- The view type that should be used when creating a drawing of this cell type.protected org.jgraph.graph.VertexView createVertexView(java.lang.Object v)
createVertexView
in class org.jgraph.graph.DefaultCellViewFactory
v
- The object to base creation on
public java.util.Vector<ExtendableCellViewFactory.CellViewMapping> getViewIndirections()
public void setViewIndirections(java.util.Vector<ExtendableCellViewFactory.CellViewMapping> list)
list
- The new list of mappings between cells and views.protected org.jgraph.graph.EdgeView createEdgeView(java.lang.Object cell)
createEdgeView
in class org.jgraph.graph.DefaultCellViewFactory
cell
- The edge cell to base creation on
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |