PortRenderer (JGraph v5.12.4.2 API Specification)
Keywords: org.jgraph.graph.PortRenderer class

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

## org.jgraph.graph
Class PortRenderer

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  org.jgraph.graph.PortRenderer

All Implemented Interfaces:
  CellViewRenderer, ImageObserver, MenuContainer, Serializable

public class PortRenderer
extends JComponent
implements CellViewRenderer, Serializable

This renderer displays entries that implement the CellView interface and supports the following attributes:

- GraphConstants.OFFSET GraphConstants.ABSOLUTE

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JComponent
`JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy`

Field Summary
`protected Color` | `graphBackground` Cache the current graph background.
`protected boolean` | `hasFocus` Cached hasFocus and selected value.
`protected boolean` | `preview` Cached hasFocus and selected value.
`protected boolean` | `selected` Cached hasFocus and selected value.
`protected PortView` | `view` Cache the current edgeview for drawing.
`protected boolean` | `xorEnabled` Cached hasFocus and selected value.

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
`PortRenderer()` Constructs a renderer that may be used to render ports.

Method Summary
`void` | `firePropertyChange(String propertyName, boolean oldValue, boolean newValue)` Overridden for performance reasons.
`void` | `firePropertyChange(String propertyName, byte oldValue, byte newValue)` Overridden for performance reasons.
`void` | `firePropertyChange(String propertyName, char oldValue, char newValue)` Overridden for performance reasons.
`void` | `firePropertyChange(String propertyName, double oldValue, double newValue)` Overridden for performance reasons.
`void` | `firePropertyChange(String propertyName, float oldValue, float newValue)` Overridden for performance reasons.
`void` | `firePropertyChange(String propertyName, int oldValue, int newValue)` Overridden for performance reasons.
`void` | `firePropertyChange(String propertyName, long oldValue, long newValue)` Overridden for performance reasons.
`protected void` | `firePropertyChange(String propertyName, Object oldValue, Object newValue)` Overridden for performance reasons.
`void` | `firePropertyChange(String propertyName, short oldValue, short newValue)` Overridden for performance reasons.
`Component` | `getRendererComponent(JGraph graph, CellView view, boolean sel, boolean focus, boolean preview)` Configure and return the renderer based on the passed in components.
`void` | `paint(Graphics g)` Paint the renderer.
`void` | `repaint(long tm, int x, int y, int width, int height)` Overridden for performance reasons.
`void` | `repaint(Rectangle r)` Overridden for performance reasons.
`void` | `revalidate()` Overridden for performance reasons.
`void` | `validate()` Overridden for performance reasons.

Methods inherited from class javax.swing.JComponent
`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validateTree`

Methods inherited from class java.awt.Component
`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, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle`

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

Field Detail

### view

    protected transient PortView view

  Cache the current edgeview for drawing.

### graphBackground

    protected Color graphBackground

  Cache the current graph background.

### hasFocus

    protected transient boolean hasFocus

  Cached hasFocus and selected value.

### selected

    protected transient boolean selected

  Cached hasFocus and selected value.

### preview

    protected transient boolean preview

  Cached hasFocus and selected value.

### xorEnabled

    protected transient boolean xorEnabled

  Cached hasFocus and selected value.

Constructor Detail

### PortRenderer

    public PortRenderer()

  Constructs a renderer that may be used to render ports.

Method Detail

### getRendererComponent

    public Component getRendererComponent(JGraph graph,
                                          CellView view,
                                          boolean sel,
                                          boolean focus,
                                          boolean preview)

  Configure and return the renderer based on the passed in components. The value is typically set from messaging the graph with `convertValueToString`.

  Specified by:
    `getRendererComponent` in interface `CellViewRenderer`
  Parameters:
    `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.
  Returns:
    the component used to render the value.

### paint

    public void paint(Graphics g)

  Paint the renderer. Overrides superclass paint to add specific painting. Note: The preview flag is interpreted as "highlight" in this context. (This is used to highlight the port if the mouse is over it.)

### validate

    public void validate()

  Overridden for performance reasons. See the Implementation Note for more information.

### revalidate

    public void revalidate()

  Overridden for performance reasons. See the Implementation Note for more information.

### repaint

    public void repaint(long tm,
                        int x,
                        int y,
                        int width,
                        int height)

  Overridden for performance reasons. See the Implementation Note for more information.

### repaint

    public void repaint(Rectangle r)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    protected void firePropertyChange(String propertyName,
                                      Object oldValue,
                                      Object newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   byte oldValue,
                                   byte newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   char oldValue,
                                   char newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   short oldValue,
                                   short newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   int oldValue,
                                   int newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   long oldValue,
                                   long newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   float oldValue,
                                   float newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   double oldValue,
                                   double newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   boolean oldValue,
                                   boolean newValue)

  Overridden for performance reasons. See the Implementation Note for more information.

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

Copyright (C) 2001-2008 Gaudenz Alder. All rights reserved.