public static class PortLabelVertexView.PortLabelVertexRenderer
extends org.jgraph.graph.VertexRenderer
javax.swing.JLabel.AccessibleJLabeljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static int |
COLORHEIGHTBUFFER
The vertical distance added to the label height to make the color
backdrop extend beyond the label text
|
protected java.awt.FontMetrics |
fontMetrics |
static int |
MAXLABELWIDTH
The maximum width of a label, any label more than this value in width
|
static int |
MINIMUMHORIZONTALSPACING |
static int |
MINIMUMVERTICALSPACING |
static int |
PORTLABELSPACING |
protected org.jgraph.graph.CellView[] |
ports |
bordercolor, borderWidth, childrenSelected, defaultBackground, defaultForeground, gradientColor, gridColor, hasFocus, highlightColor, isDoubleBuffered, labelEnabled, lockedHandleColor, preview, selected, viewaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
PortLabelVertexView.PortLabelVertexRenderer() |
| Modifier and Type | Method and Description |
|---|---|
static void |
drawPortLabel(java.awt.Graphics g,
java.lang.String labelValue,
double x,
double y,
java.awt.Color background,
boolean isLeftLabel)
Draws a
String. |
java.awt.Dimension |
getPreferredSize() |
java.awt.Component |
getRendererComponent(org.jgraph.JGraph graph,
org.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(org.jgraph.graph.CellView view)
Install the attributes of specified cell in this renderer instance.
|
void |
paint(java.awt.Graphics g)
Paint the renderer.
|
void |
paintPortLabels(java.awt.Graphics g)
Paints port labels the view.
|
firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getGradientColor, getPerimeterPoint, paintSelectionBorder, repaint, repaint, resetAttributes, revalidate, setGradientColor, validatecheckHorizontalKey, 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, updateUIaddAncestorListener, 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, 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, updateadd, 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, validateTreeaction, 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, transferFocusUpCycleprotected org.jgraph.graph.CellView[] ports
protected java.awt.FontMetrics fontMetrics
public static transient int PORTLABELSPACING
public static transient int MINIMUMHORIZONTALSPACING
public static transient int MINIMUMVERTICALSPACING
public static transient int COLORHEIGHTBUFFER
public static transient int MAXLABELWIDTH
public PortLabelVertexView.PortLabelVertexRenderer()
public void paint(java.awt.Graphics g)
org.jgraph.graph.VertexRendererpaint in class org.jgraph.graph.VertexRendererpublic java.awt.Component getRendererComponent(org.jgraph.JGraph graph,
org.jgraph.graph.CellView view,
boolean sel,
boolean focus,
boolean preview)
org.jgraph.graph.VertexRendererconvertValueToString. We recommend you check the value's
class and throw an illegal argument exception if it's not correct.getRendererComponent in interface org.jgraph.graph.CellViewRenderergetRendererComponent in class org.jgraph.graph.VertexRenderergraph - 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 installAttributes(org.jgraph.graph.CellView view)
installAttributes in class org.jgraph.graph.VertexRendererview - the cell view to retrieve the attribute values from.public static void drawPortLabel(java.awt.Graphics g,
java.lang.String labelValue,
double x,
double y,
java.awt.Color background,
boolean isLeftLabel)
String. Its horizontal position x
is given and its vertical position is centered on given
y.g - a Graphics2D to draw withlabel - a String to drawx - an offset to left edge of the bounding box of vertexy - an offset to center of the stringbackground - the background color, if any, behind the textisLeftLabel - whether or not this label is on the left-hand side of the
vertexpublic void paintPortLabels(java.awt.Graphics g)
g - a Graphics2D to draw withpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponent