public class VertexRenderer extends javax.swing.JLabel implements CellViewRenderer, java.io.Serializable
javax.swing.JLabel.AccessibleJLabel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
bordercolor
Cached default foreground and default background.
|
protected int |
borderWidth
Cached borderwidth.
|
protected boolean |
childrenSelected
Cached hasFocus and selected value.
|
protected java.awt.Color |
defaultBackground
Cached default foreground and default background.
|
protected java.awt.Color |
defaultForeground
Cached default foreground and default background.
|
protected java.awt.Color |
gradientColor
Caches values of the colors to be used for painting the cell.
|
protected java.awt.Color |
gridColor
Caches values of the colors to be used for painting the cell.
|
protected boolean |
hasFocus
Cached hasFocus and selected value.
|
protected java.awt.Color |
highlightColor
Caches values of the colors to be used for painting the cell.
|
protected boolean |
isDoubleBuffered
Cached value of the double buffered state
|
protected boolean |
labelEnabled
Cached value of whether the label is to be displayed
|
protected java.awt.Color |
lockedHandleColor
Caches values of the colors to be used for painting the cell.
|
protected boolean |
preview
Cached hasFocus and selected value.
|
protected boolean |
selected
Cached hasFocus and selected value.
|
protected VertexView |
view
Cache the current shape for drawing.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
VertexRenderer()
Constructs a renderer that may be used to render vertices.
|
Modifier and Type | Method and Description |
---|---|
void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Overridden for performance reasons.
|
void |
firePropertyChange(java.lang.String propertyName,
byte oldValue,
byte newValue)
Overridden for performance reasons.
|
void |
firePropertyChange(java.lang.String propertyName,
char oldValue,
char newValue)
Overridden for performance reasons.
|
void |
firePropertyChange(java.lang.String propertyName,
double oldValue,
double newValue)
Overridden for performance reasons.
|
void |
firePropertyChange(java.lang.String propertyName,
float oldValue,
float newValue)
Overridden for performance reasons.
|
void |
firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue)
Overridden for performance reasons.
|
void |
firePropertyChange(java.lang.String propertyName,
long oldValue,
long newValue)
Overridden for performance reasons.
|
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Overridden for performance reasons.
|
void |
firePropertyChange(java.lang.String propertyName,
short oldValue,
short newValue)
Overridden for performance reasons.
|
java.awt.Color |
getGradientColor() |
java.awt.geom.Point2D |
getPerimeterPoint(VertexView view,
java.awt.geom.Point2D source,
java.awt.geom.Point2D p)
Returns the intersection of the bounding rectangle and the straight line
between the source and the specified point p.
|
java.awt.Component |
getRendererComponent(JGraph graph,
CellView view,
boolean sel,
boolean focus,
boolean preview)
Configure and return the renderer component based on the passed in cell.
|
protected void |
installAttributes(CellView view)
Install the attributes of specified cell in this renderer instance.
|
void |
paint(java.awt.Graphics g)
Paint the renderer.
|
protected void |
paintSelectionBorder(java.awt.Graphics g)
Provided for subclassers to paint a selection border.
|
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Overridden for performance reasons.
|
void |
repaint(java.awt.Rectangle r)
Overridden for performance reasons.
|
protected void |
resetAttributes()
Hook for subclassers that is invoked when the installAttributes is not
called to reset all attributes to the defaults.
|
void |
revalidate()
Overridden for performance reasons.
|
void |
setGradientColor(java.awt.Color gradientColor) |
void |
validate()
Overridden for performance reasons.
|
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected transient VertexView view
protected transient boolean hasFocus
protected transient boolean selected
protected transient boolean preview
protected transient boolean childrenSelected
protected transient java.awt.Color defaultForeground
protected transient java.awt.Color defaultBackground
protected transient java.awt.Color bordercolor
protected transient int borderWidth
protected transient boolean isDoubleBuffered
protected transient boolean labelEnabled
protected transient java.awt.Color gradientColor
protected transient java.awt.Color gridColor
protected transient java.awt.Color highlightColor
protected transient java.awt.Color lockedHandleColor
public VertexRenderer()
public java.awt.Component getRendererComponent(JGraph graph, CellView view, boolean sel, boolean focus, boolean preview)
convertValueToString
. We recommend you check the value's
class and throw an illegal argument exception if it's not correct.getRendererComponent
in interface CellViewRenderer
graph
- the graph that that defines the rendering context.view
- the cell view that should be rendered.sel
- whether the object is selected.focus
- whether the object has the focus.preview
- whether we are drawing a preview.protected void resetAttributes()
protected void installAttributes(CellView view)
view
- the cell view to retrieve the attribute values from.public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
protected void paintSelectionBorder(java.awt.Graphics g)
public java.awt.geom.Point2D getPerimeterPoint(VertexView view, java.awt.geom.Point2D source, java.awt.geom.Point2D p)
public void validate()
validate
in class java.awt.Container
public void revalidate()
revalidate
in class javax.swing.JComponent
public void repaint(long tm, int x, int y, int width, int height)
repaint
in class javax.swing.JComponent
public void repaint(java.awt.Rectangle r)
repaint
in class javax.swing.JComponent
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, byte oldValue, byte newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, char oldValue, char newValue)
firePropertyChange
in class javax.swing.JComponent
public void firePropertyChange(java.lang.String propertyName, short oldValue, short newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
firePropertyChange
in class javax.swing.JComponent
public void firePropertyChange(java.lang.String propertyName, long oldValue, long newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, float oldValue, float newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, double oldValue, double newValue)
firePropertyChange
in class java.awt.Component
public void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
firePropertyChange
in class javax.swing.JComponent
public java.awt.Color getGradientColor()
public void setGradientColor(java.awt.Color gradientColor)
gradientColor
- The gradientColor to set.Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.