public class IlvPaletteManagerCollapsibleTreeViewer extends JScrollPane implements IlvPaletteManagerViewer
To add this GUI to your application, retrieve this
component by calling getComponent()
.
The palettes contained in the palette manager are displayed in trees
(IlvPaletteTreeViewer
objects,) that are in collapsible panels.
That means palettes can be hidden or shown according to the needs of the
user.
This viewer implements drag and drop. This means that you can move or copy palette objects (symbols and categories) from one palette to another. You can also reorganize palettes and symbols in the same palette.
Note: by default, the viewer is not editable, and the drop operation
is not activated. To activate the drop, use setEditable(boolean)
.
The drag is active because it may be needed by other tools, such as
Dashboard Editor.
If you need to detect and manage events which could happen to palettes and
trees, you can specified your own listeners using
IlvPaletteManagerCollapsibleTreeViewer(PaletteListener, MouseListener, PaletteDropListener)
.
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvPaletteManagerCollapsibleTreeViewer()
Creates an instance of this palette manager viewer.
|
IlvPaletteManagerCollapsibleTreeViewer(PaletteListener palettelistener,
MouseListener mouselistener,
PaletteDropListener droplistener)
Use this constructor if you need to set your own listeners to manage
events on palettes or on trees displayed in this viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
addPaletteViewerListener(PaletteViewerListener l)
Adds a listener that is used to track category or symbol selection in
the viewer.
|
protected void |
fireCategoryDeselected(PaletteViewerEvent evt)
Fires a
PaletteViewerEvent to the registered listeners. |
protected void |
fireCategorySelected(PaletteViewerEvent evt)
Fires a
PaletteViewerEvent to the registered listeners. |
protected void |
fireSymbolDeselected(PaletteViewerEvent evt)
Fires a
PaletteViewerEvent to the registered listeners. |
protected void |
fireSymbolSelected(PaletteViewerEvent evt)
Fires a
PaletteViewerEvent to the registered listeners. |
JComponent |
getComponent()
Returns the
Java Swing component that is the palette
manager viewer. |
JPopupMenu |
getHeaderPopupMenu()
Returns the pop-up menu that is displayed when the user right-clicks
the header of a collapsible panel that is displaying a palette tree.
|
IlvPaletteManager |
getPaletteManager()
Returns the palette manager associated with this viewer.
|
IlvPaletteCategory |
getSelectedCategory()
Returns the selected category.
|
IlvPalette |
getSelectedPalette()
Returns the selected palette.
|
IlvPaletteObject |
getSelectedPaletteObject()
Returns the selected object in the palette tree.
|
IlvPaletteObject[] |
getSelectedPaletteObjects()
Returns an array containing references to the selected objects
|
IlvPaletteViewer |
getSelectedPaletteViewer()
Returns the selected palette viewer.
|
IlvPaletteSymbol |
getSelectedSymbol()
Returns the selected symbol.
|
IlvPaletteSymbol[] |
getSelectedSymbols()
Returns a set of selected symbols in an array of
IlvPaletteSymbol objects. |
JPopupMenu |
getTreePopupMenu()
Returns the pop-up menu displayed when the user right-clicks a palette
tree.
|
boolean |
isEditable()
Indicates if this viewer is editable or not.
|
boolean |
isMultiSelectionEnabled()
Indicates if multiple selection is enabled in the palette trees of this
viewer.
|
void |
refreshCollapsiblePanelHeader(IlvPalette palette)
Refresh the header of the collapsible panel containing the given palette.
|
void |
removePaletteViewerListener(PaletteViewerListener l)
Removes a listener that is used to track category or symbol selection
in the viewer.
|
void |
select(IlvPalette palette)
Selects a palette in the viewer.
|
void |
select(IlvPalette palette,
boolean expand)
Selects the collapsible panel corresponding to the given palette and
expands it.
|
void |
select(IlvPaletteSymbol symbol)
Selects a symbol in the symbol viewer.
|
void |
setEditable(boolean editable)
Indicates if this viewer should be editable.
|
void |
setHeaderPopupMenu(JPopupMenu menu)
Sets the pop-up menu that will be displayed when the user right-clicks
the header of a collapsible panel that is displaying a palette tree.
|
void |
setMultiSelectionEnabled(boolean multiselection)
Enables or disables multiple selection in palette trees.
|
void |
setPaletteManager(IlvPaletteManager paletteManager)
Sets the new palette manager for this viewer.
|
void |
setTreePopupMenu(JPopupMenu menu)
Sets a pop-up menu that will be displayed when the user right-clicks
a palette tree.
|
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, 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, 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, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IlvPaletteManagerCollapsibleTreeViewer()
public IlvPaletteManagerCollapsibleTreeViewer(PaletteListener palettelistener, MouseListener mouselistener, PaletteDropListener droplistener)
palettelistener
- The custom palette listener added to each palette
managed by the palette manager attached to this viewer.mouselistener
- The custom mouse listener added to each
JTree
displayed by this viewer.droplistener
- The custom drop listener added to each
JTree
in order to detect when objects have been copied or
moved in a palette.public void setHeaderPopupMenu(JPopupMenu menu)
menu
- The pop-up menu.public JPopupMenu getHeaderPopupMenu()
public void setTreePopupMenu(JPopupMenu menu)
menu
- The pop-up menu.public JPopupMenu getTreePopupMenu()
public IlvPaletteViewer getSelectedPaletteViewer()
public void addPaletteViewerListener(PaletteViewerListener l)
addPaletteViewerListener
in interface IlvPaletteManagerViewer
l
- The listener to add.public void removePaletteViewerListener(PaletteViewerListener l)
removePaletteViewerListener
in interface IlvPaletteManagerViewer
l
- The listener to remove.public JComponent getComponent()
Java Swing
component that is the palette
manager viewer.getComponent
in interface IlvPaletteManagerViewer
public void setPaletteManager(IlvPaletteManager paletteManager)
setPaletteManager
in interface IlvPaletteManagerViewer
paletteManager
- The new palette manager.public IlvPaletteManager getPaletteManager()
getPaletteManager
in interface IlvPaletteManagerViewer
public IlvPalette getSelectedPalette()
getSelectedPalette
in interface IlvPaletteManagerViewer
public IlvPaletteObject getSelectedPaletteObject()
public IlvPaletteObject[] getSelectedPaletteObjects()
public IlvPaletteSymbol getSelectedSymbol()
getSelectedSymbol
in interface IlvPaletteManagerViewer
public IlvPaletteSymbol[] getSelectedSymbols()
IlvPaletteSymbol
objects.public IlvPaletteCategory getSelectedCategory()
public void select(IlvPaletteSymbol symbol)
select
in interface IlvPaletteManagerViewer
symbol
- The symbol to select.public void select(IlvPalette palette)
PropertyChangeEvent
is fired with "current_palette"
as property name.select
in interface IlvPaletteManagerViewer
palette
- The palette to select.public void select(IlvPalette palette, boolean expand)
PropertyChangeEvent
is fired with "current_palette"
as a property name.palette
- The palette to select.expand
- Expand or not.protected void fireCategorySelected(PaletteViewerEvent evt)
PaletteViewerEvent
to the registered listeners.
This indicates that a category has been selected.evt
- The event.protected void fireCategoryDeselected(PaletteViewerEvent evt)
PaletteViewerEvent
to the registered listeners.
This indicates that a category has been deselected.evt
- The event.protected void fireSymbolSelected(PaletteViewerEvent evt)
PaletteViewerEvent
to the registered listeners.
This indicates that a symbol has been selected.evt
- The event.protected void fireSymbolDeselected(PaletteViewerEvent evt)
PaletteViewerEvent
to the registered listeners.
This indicates that a symbol has been deselected.evt
- The event.public void setEditable(boolean editable)
editable
- Set to true
to set editable.public boolean isEditable()
true
is
returned.public void setMultiSelectionEnabled(boolean multiselection)
multiselection
- Set to true
to enable multiple
selection.public boolean isMultiSelectionEnabled()
true
is
returned.public void refreshCollapsiblePanelHeader(IlvPalette palette)
palette
- The palette© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.