|
VRJConfig UI API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.vrjuggler.vrjconfig.commoneditors.devicegraph.AbstractCustomVertexRenderer
public abstract class AbstractCustomVertexRenderer
Basic (abstract) custom vertex renderer—based on JPanel—for use with JGraph. This code is based on examples included with JGraph and JGraphAddons for creating custom vertex renderers.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected Color |
defaultBackground
The default background color to use for rendering if none is defined in the cell view attributes. |
protected Color |
defaultForeground
The default foreground color to use for rendering if none is defined in the cell view attributes. |
protected Color |
gradientColor
The gradient (if any) associated with the attributes of the cell view being rendered. |
protected JGraph |
graph
The graph where this vertex renderer is used. |
protected boolean |
hasFocus
A flag indicating if the vertex view has focus. |
protected JLabel |
nameLabel
The Swing component used for displaying the name of the object held by the vertex cell. |
protected boolean |
preview
A flag indicating whether the vertex view should be rendered as a preview is selected. |
protected boolean |
selected
A flag indicating whether the vertex is selected. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AbstractCustomVertexRenderer()
|
|
| Method Summary | |
|---|---|
abstract Component |
getRendererComponent(JGraph graph,
CellView view,
boolean selected,
boolean hasFocus,
boolean preview)
Configures and returns the renderer component based on the passed-in cell view. |
protected void |
installAttributes(JGraph graph,
Map attributes)
Sets up the attributes for the renderer as determined by the given JGraph instance and the given attribute map. |
void |
paint(Graphics g)
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient JGraph graph
protected transient Color gradientColor
installAttributes().
installAttributes(JGraph,Map)protected transient boolean selected
protected transient boolean preview
protected transient boolean hasFocus
protected Color defaultBackground
installAttributes(JGraph,Map)protected Color defaultForeground
installAttributes(JGraph,Map)protected JLabel nameLabel
| Constructor Detail |
|---|
public AbstractCustomVertexRenderer()
| Method Detail |
|---|
public abstract Component getRendererComponent(JGraph graph,
CellView view,
boolean selected,
boolean hasFocus,
boolean preview)
getRendererComponent in interface CellViewRenderergraph - the graph that that defines the rendering contextview - the object that should be renderedselected - whether the object is selectedhasFocus - whether the object has the focuspreview - whether we are drawing a previewCellViewRenderer.getRendererComponent(JGraph,CellView,boolean,boolean,boolean)public void paint(Graphics g)
paint in class JComponent
protected void installAttributes(JGraph graph,
Map attributes)
JGraph instance and the given attribute map.
graph - the graph where this renderer is being usedattributes - the attributes for the cell view with which this
renderer is associatedGraphConstants
|
VRJConfig UI API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||