public class ItemListView extends javax.swing.JList<DraggedItem>
| Modifier and Type | Class and Description |
|---|---|
class |
ItemListView.ItemTransferHandler
Implements drag-and-drop transfers from ItemListView.
|
javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocationjavax.swing.JComponent.AccessibleJComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
ItemListView()
Initializes a new instance of the ItemListView class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(DiagramItem item)
Adds a new item to the end of the list view.
|
void |
addItem(DiagramItem item,
java.lang.String label)
Adds a new item to the end of the list view.
|
void |
addItemListViewListener(ItemListViewListener listener)
Registers
listener so that it will receive events when
users select or delete items from the list. |
void |
addItems(DiagramItem[] items,
java.lang.String[] labels)
Adds the specified items to the end of the list box.
|
void |
addItems(DiagramItemList items)
Adds the specified items to the end of the list box.
|
void |
addItems(DiagramItemList items,
java.lang.String[] labels)
Adds the specified items to the end of the list box.
|
void |
clearItems()
Removes all items from the list view.
|
boolean |
getAllowRemove()
Gets a value indicating whether to allow deletion of list items by pressing Del.
|
float |
getAutoConnectDistance()
Gets the maximum distance within which a link will attempt to auto-connect to a nearby node.
|
boolean |
getAutoConnectLinks()
Gets a value indicating whether links should be automatically connected to nearby nodes
when dropped from the ItemListView.
|
java.awt.Dimension |
getIconMargin()
Gets the horizontal and vertical margins around the items.
|
java.awt.Dimension |
getIconSize()
Gets the size of the items displayed in the list.
|
DiagramItem |
getItemAt(int index)
Gets the item at the specified position.
|
int |
getItemsCount()
Gets the number of items in the list view.
|
GraphicsUnit |
getMeasureUnit()
Gets the unit of measure used when drawing items.
|
java.awt.geom.Dimension2D |
getNewInstanceSize()
Gets the default size with which items dragged onto a diagram will be created.
|
boolean |
getShowLabels()
Gets a value indicating whether to show text labels along with icons for each list item.
|
void |
insertItem(int index,
DiagramItem item)
Inserts the item at the specified position.
|
void |
insertItem(int index,
DiagramItem item,
java.lang.String label)
Inserts the item at the specified position.
|
protected void |
onComponentResized() |
protected void |
onItemRemoved(ItemListEvent e) |
protected void |
onItemSelected(ItemListEvent e) |
protected void |
onItemSelected(javax.swing.event.ListSelectionEvent e) |
protected void |
onKeyPressed(java.awt.event.KeyEvent e) |
void |
removeItemAt(int index)
Removes the item at the specified position.
|
void |
removeItemListViewListener(ItemListViewListener listener)
Unregisters
listener so that it will no longer
receive ItemListView events. |
void |
setAllowRemove(boolean value)
Sets a value indicating whether to allow deletion of list items by pressing Del.
|
void |
setAutoConnectDistance(float value)
Sets the maximum distance within which a link will attempt to auto-connect to a nearby node.
|
void |
setAutoConnectLinks(boolean value)
Sets a value indicating whether links should be automatically connected to nearby nodes
when dropped from the ItemListView.
|
void |
setIconMargin(java.awt.Dimension value)
Sets the horizontal and vertical margins around the items.
|
void |
setIconSize(java.awt.Dimension value)
Sets the size of the items displayed in the list.
|
void |
setMeasureUnit(GraphicsUnit value)
Sets the unit of measure used when drawing items.
|
void |
setNewInstanceSize(java.awt.geom.Dimension2D value)
Sets the default size with which items dragged onto a diagram will be created.
|
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, updateUIaddAncestorListener, 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, 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, validate, 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, 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, transferFocusUpCyclepublic ItemListView()
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 item size.public void setIconSize(java.awt.Dimension value)
value - A Dimension instance specifying the item 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 getNewInstanceSize()
Dimension2D instance specifying the size of created items.public void setNewInstanceSize(java.awt.geom.Dimension2D value)
value - A Dimension2D instance specifying the size of created items.public boolean getAllowRemove()
public void setAllowRemove(boolean value)
value - true to allow item deletion, otherwise false.public boolean getAutoConnectLinks()
public void setAutoConnectLinks(boolean value)
value - true to auto-connect links, otherwise false.public float getAutoConnectDistance()
public void setAutoConnectDistance(float value)
value - The auto-connect distance.public void addItem(DiagramItem item)
item - The item to add.public void addItem(DiagramItem item, java.lang.String label)
item - The item to add.label - The text to be displayed for the item.public void addItems(DiagramItemList items)
items - The collection of items to add.public void addItems(DiagramItemList items, java.lang.String[] labels)
items - The collection of items to add.labels - The array of texts to be displayed for the items.public void addItems(DiagramItem[] items, java.lang.String[] labels)
items - The array of items to add.labels - The array of texts to be displayed for the items.public void insertItem(int index,
DiagramItem item)
index - The zero-based index at which the item should be inserted.item - The item to insert.public void insertItem(int index,
DiagramItem item,
java.lang.String label)
index - The zero-based index at which the item should be inserted.item - The item to insert.label - The text to be displayed for the item.public void removeItemAt(int index)
index - The zero-based index of the item to remove.public void clearItems()
public DiagramItem getItemAt(int index)
index - An integer value specifying the item's index in the list.DiagramItem at the specified position.public int getItemsCount()
protected void onItemSelected(ItemListEvent e)
protected void onItemRemoved(ItemListEvent e)
public void addItemListViewListener(ItemListViewListener listener)
listener so that it will receive events when
users select or delete items from the list.listener - An object implementing the ItemListViewListener interface.public void removeItemListViewListener(ItemListViewListener listener)
listener so that it will no longer
receive ItemListView events.listener - An object implementing the ItemListViewListener interface.public boolean getShowLabels()
true if labels are shown.public void setShowLabels(boolean value)
value - true if text labels must be shown, otherwise false.