public class NodeListView extends javax.swing.JList<DraggedNode>
Modifier and Type | Class and Description |
---|---|
class |
NodeListView.NodeTransferHandler
Implements drag-and-drop transfers from NodeListView.
|
javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
NodeListView()
Initializes a new instance of the NodeListView class.
|
Modifier and Type | Method and Description |
---|---|
void |
addNode(DiagramNode node)
Adds a new node to the end of the list view.
|
void |
addNode(DiagramNode node,
java.lang.String label)
Adds a new node to the end of the list view.
|
void |
addNodeListViewListener(NodeListViewListener listener)
Registers
listener so that it will receive events when
users select or delete nodes from the list. |
void |
addNodes(DiagramNode[] nodes,
java.lang.String[] labels)
Adds the specified nodes to the end of the list box.
|
void |
addNodes(DiagramNodeList nodes)
Adds the specified nodes to the end of the list box.
|
void |
addNodes(DiagramNodeList nodes,
java.lang.String[] labels)
Adds the specified nodes to the end of the list box.
|
void |
clearNodes()
Removes all nodes from the list view.
|
boolean |
getAllowRemove()
Gets a value indicating whether to allow deletion of list nodes by pressing Del.
|
java.awt.geom.Dimension2D |
getDefaultNodeSize()
Gets the default size with which nodes dragged onto a diagram will be created.
|
java.awt.Dimension |
getIconMargin()
Gets the horizontal and vertical margins around the nodes.
|
java.awt.Dimension |
getIconSize()
Gets the size of the nodes displayed in the list.
|
GraphicsUnit |
getMeasureUnit()
Gets the unit of measure used when drawing nodes.
|
DiagramNode |
getNodeAt(int index)
Gets the node at the specified position.
|
int |
getNodesCount()
Gets the number of nodes in the list view.
|
boolean |
getShowLabels()
Gets a value indicating whether to show text labels along with icons for each list item.
|
void |
insertNode(int index,
DiagramNode node)
Inserts the node at the specified position.
|
void |
insertNode(int index,
DiagramNode node,
java.lang.String label)
Inserts the node at the specified position.
|
protected void |
onComponentResized() |
protected void |
onItemSelected(javax.swing.event.ListSelectionEvent e) |
protected void |
onKeyPressed(java.awt.event.KeyEvent e) |
protected void |
onNodeRemoved(NodeListEvent e) |
protected void |
onNodeSelected(NodeListEvent e) |
void |
removeNodeAt(int index)
Removes the node at the specified position.
|
void |
removeNodeListViewListener(NodeListViewListener listener)
Unregisters
listener so that it will no longer
receive NodeListView events. |
void |
setAllowRemove(boolean value)
Sets a value indicating whether to allow deletion of list nodes by pressing Del.
|
void |
setDefaultNodeSize(java.awt.geom.Dimension2D value)
Sets the default size with which nodes dragged onto a diagram will be created.
|
void |
setIconMargin(java.awt.Dimension value)
Sets the horizontal and vertical margins around the nodes.
|
void |
setIconSize(java.awt.Dimension value)
Sets the size of the nodes displayed in the list.
|
void |
setMeasureUnit(GraphicsUnit value)
Sets the unit of measure used when drawing nodes.
|
void |
setShowLabels(boolean value)
Sets a value specifying whether to show text labels along with icons for each list item.
|
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getDropLocation, getDropMode, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectedValuesList, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, 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, validate, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, imageUpdate, 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
public NodeListView()
protected void onComponentResized()
protected void onKeyPressed(java.awt.event.KeyEvent e)
protected void onItemSelected(javax.swing.event.ListSelectionEvent e)
public GraphicsUnit getMeasureUnit()
GraphicsUnit
enumeration.public void setMeasureUnit(GraphicsUnit value)
value
- A member of the GraphicsUnit
enumeration.public java.awt.Dimension getIconSize()
Dimension
instance specifying the node size.public void setIconSize(java.awt.Dimension value)
value
- A Dimension
instance specifying the node size.public java.awt.Dimension getIconMargin()
Dimension
instance specifying the icon margins.public void setIconMargin(java.awt.Dimension value)
value
- A Dimension
instance specifying the icon margins.public java.awt.geom.Dimension2D getDefaultNodeSize()
Dimension2D
instance specifying the size of created nodes.public void setDefaultNodeSize(java.awt.geom.Dimension2D value)
value
- A Dimension2D
instance specifying the size of created nodes.public boolean getAllowRemove()
public void setAllowRemove(boolean value)
value
- true to allow node deletion, otherwise false.public void addNode(DiagramNode node)
node
- The node to add.public void addNode(DiagramNode node, java.lang.String label)
node
- The node to add.label
- The text to be displayed for the node.public void addNodes(DiagramNodeList nodes)
nodes
- The collection of nodes to add.public void addNodes(DiagramNodeList nodes, java.lang.String[] labels)
nodes
- The collection of nodes to add.labels
- The array of texts to be displayed for the nodes.public void addNodes(DiagramNode[] nodes, java.lang.String[] labels)
nodes
- The array of nodes to add.labels
- The array of texts to be displayed for the nodes.public void insertNode(int index, DiagramNode node)
index
- The zero-based index at which the node should be inserted.node
- The node to insert.public void insertNode(int index, DiagramNode node, java.lang.String label)
index
- The zero-based index at which the node should be inserted.node
- The node to insert. The text to be displayed for the node.label
- The text to be displayed for the node.public void removeNodeAt(int index)
index
- The zero-based index of the node to remove.public void clearNodes()
public DiagramNode getNodeAt(int index)
index
- An integer value specifying the node's index in the list.DiagramNode
at the specified position.public int getNodesCount()
protected void onNodeSelected(NodeListEvent e)
protected void onNodeRemoved(NodeListEvent e)
public void addNodeListViewListener(NodeListViewListener listener)
listener
so that it will receive events when
users select or delete nodes from the list.listener
- An object implementing the NodeListViewListener
interface.public void removeNodeListViewListener(NodeListViewListener listener)
listener
so that it will no longer
receive NodeListView events.listener
- An object implementing the NodeListViewListener
interface.public boolean getShowLabels()
true
if labels are shown.public void setShowLabels(boolean value)
value
- true
if text labels must be shown, otherwise false
.