JGraphpad Pro
v6.0.5.0


com.jgraph.editor.factory
Class JGraphEditorComboBox

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JComboBox
                  extended bycom.jgraph.editor.factory.JGraphEditorComboBox
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, ItemSelectable, ListDataListener, MenuContainer, Serializable

public class JGraphEditorComboBox
extends JComboBox

Combo box for selecting cell styles. The class provides a series of factory methods to be added to an editor factory. The following methods are provided: JGraphEditorComboBox.BorderComboFactoryMethod, JGraphEditorComboBox.LineDecorationComboFactoryMethod and JGraphEditorComboBox.LineWidthComboFactoryMethod.

See Also:
Serialized Form

Nested Class Summary
static class JGraphEditorComboBox.BorderComboFactoryMethod
          Provides a factory method to construct a border combo box.
 class JGraphEditorComboBox.CellViewRendererBridge
          This class returns the renderer of the view configured for the selected combo box item.
static class JGraphEditorComboBox.ComboBoxListener
          This class edits the selection of the focused graph according to the selected combo box item.
static class JGraphEditorComboBox.DashPatternComboFactoryMethod
          Provides a factory method to construct a dashpattern combo box.
protected static class JGraphEditorComboBox.JGraphComboEdgeRenderer
          This class removes the translate call in the paint method.
protected static class JGraphEditorComboBox.JGraphComboEdgeView
          This class provides a an edge view with a special renderer.
static class JGraphEditorComboBox.LineDecorationComboFactoryMethod
          Provides a factory method to construct a line decoration combo box.
static class JGraphEditorComboBox.LineWidthComboFactoryMethod
          Provides a factory method to construct a linewidth combo box.
 
Nested classes inherited from class javax.swing.JComboBox
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager
 
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 static org.jgraph.JGraph backingGraph
          Shared graph instance for rendering.
static Border[] defaultBorders
          Default array of borders.
static int[] defaultDecorations
          Default array or arrows.
static int[] defaultFillableDecorations
          Default array of fillable arrows.
protected static float[][] defaultPatterns
          Default array of patterns.
static float[] defaultWidths
          Default array of widths.
protected  org.jgraph.graph.AttributeMap initialAttributes
          Initial view attributes for restoring.
 
Fields inherited from class javax.swing.JComboBox
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
 
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
JGraphEditorComboBox(Map[] attributes, boolean edgePreview)
          Constructs a new combo box for the specified attribute maps.
JGraphEditorComboBox(Map[] attributes, org.jgraph.graph.CellView view, boolean edgePreview)
          Constructs a new combo box for the specified attribute maps.
 
Method Summary
protected  org.jgraph.graph.CellView createEdgeView()
          Returns a new edge to be used for preview.
protected  org.jgraph.graph.CellView createVertexView()
          Returns a new vertex to be used for preview.
static org.jgraph.JGraph getBackingGraph()
          Returns the backing graph which is used for rendering previews.
protected  Dimension getVertexViewSize()
          Hook for subclassers to modify the size of the vertex view.
static void setBackingGraph(org.jgraph.JGraph backingGraph)
          Sets the backing graph which should be used for rendering previews.
 
Methods inherited from class javax.swing.JComboBox
actionPerformed, addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
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, validate, 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

defaultBorders

public static Border[] defaultBorders
Default array of borders.


defaultWidths

public static float[] defaultWidths
Default array of widths.


defaultPatterns

protected static float[][] defaultPatterns
Default array of patterns.


defaultFillableDecorations

public static int[] defaultFillableDecorations
Default array of fillable arrows.


defaultDecorations

public static int[] defaultDecorations
Default array or arrows.


backingGraph

protected static org.jgraph.JGraph backingGraph
Shared graph instance for rendering.


initialAttributes

protected org.jgraph.graph.AttributeMap initialAttributes
Initial view attributes for restoring.

Constructor Detail

JGraphEditorComboBox

public JGraphEditorComboBox(Map[] attributes,
                            boolean edgePreview)
Constructs a new combo box for the specified attribute maps. Uses an edge view for preview of edgePreview is true, otherwise a vertex view is used.

Parameters:
attributes - The array of attributes for the combo box entries.
edgePreview - Whether to use an edge for preview.

JGraphEditorComboBox

public JGraphEditorComboBox(Map[] attributes,
                            org.jgraph.graph.CellView view,
                            boolean edgePreview)
Constructs a new combo box for the specified attribute maps. Uses an edge view for preview if edgePreview is true, otherwise a vertex view is used.

Parameters:
attributes - The array of attributes for the combo box entries.
view - The cell view to use for previewing the attributes.
edgePreview - Whether to use an edge for preview.
Method Detail

createVertexView

protected org.jgraph.graph.CellView createVertexView()
Returns a new vertex to be used for preview. This implementation returns a VertexView with a string user object.

Returns:
Returns a new vertex view for preview.

getVertexViewSize

protected Dimension getVertexViewSize()
Hook for subclassers to modify the size of the vertex view.

Returns:
Returns the size of the vertex view.

createEdgeView

protected org.jgraph.graph.CellView createEdgeView()
Returns a new edge to be used for preview. This implementation returns a JGraphEditorComboBox.JGraphComboEdgeView with a string user object and a set of default points.

Returns:
Returns a new edge view for preview.

getBackingGraph

public static org.jgraph.JGraph getBackingGraph()
Returns the backing graph which is used for rendering previews.

Returns:
Returns the backing graph.

setBackingGraph

public static void setBackingGraph(org.jgraph.JGraph backingGraph)
Sets the backing graph which should be used for rendering previews.

Parameters:
backingGraph - The backing graph to set.

JGraphpad Pro
v6.0.5.0


Copyright (C) 2005 JGraph.com. All rights reserved.