|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
simtools.ui.DesktopCardPanel
public class DesktopCardPanel
This class manages a list of swing components inside either internal frames (one per component) on a desktop or a single panel which displays only the selected component. Component selection is performed through a tab pane which displays components names using Component.getName(). The selected component is inside a frame which is at the top of the desktop when desktop mode is used. The selected component is displayed inside a panel under the tab pane when the single panel mode is used. A maximize action on one of the frame of the desktop leads to the single panel mode with the selected component Using the menu provided by the getMenu fonction, one can switch to the desktop pane by clicking on the cascade item This menu displays also all the available components and menu items to select components one after each other.
Nested Class Summary | |
---|---|
class |
DesktopCardPanel.CardPopupMenu
A popup menu to be displayed when a card is selected |
class |
DesktopCardPanel.ComponentRadioButton
The radio button to choose a component in the menu |
class |
DesktopCardPanel.PanelsPaneLayout
The Layout for the panel which holds the component panels |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected javax.swing.JPopupMenu |
_cardPopup
popup menu to be displayed when the right mouse is clicked above a card item |
protected java.util.Vector |
_components
list of components |
protected DesktopCardPanelMode |
_desktopCardPanelMode
|
protected static MenuResourceBundle |
_resources
resources |
protected java.util.Stack |
backwardStack
Two stacks to manage previous and next sheet actions. |
static int |
CARD_MODE
constant for the card display mode |
static int |
DESKTOP_MODE
constant for the desktop display mode |
static int |
EXTERNAL_MODE
constant for the external frame display mode |
protected java.util.Stack |
forwardStack
Two stacks to manage previous and next sheet actions. |
static int |
SCROLLING_MODE
the scrolling mode as defined in JViewPort |
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 | |
---|---|
DesktopCardPanel(boolean scrollable)
Creates a new DesktopCardPanel The single pane mode is selected The list of components is empty |
|
DesktopCardPanel(boolean scrollable,
boolean closable)
Creates a new DesktopCardPanel The single pane mode is selected The list of components is empty |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addComponent(javax.swing.JComponent d)
Adds a component |
void |
addListener(DesktopCardPanelListener dcpl)
Adds a new Listener on component selection |
protected void |
back()
|
protected void |
createCardPopupMenu()
|
javax.swing.JMenu |
createMenu(java.lang.String name)
Creates a menu to switch between components Each component is displayed in the menu using toString() |
javax.swing.JMenu |
createMenu(java.lang.String name,
boolean enableCloseAll)
Creates a menu to switch between components Each component is displayed in the menu using toString() |
javax.swing.JButton |
createNextButton()
|
javax.swing.JButton |
createPreviousButton()
|
javax.swing.JComponent |
getComponentAt(int index)
|
java.util.Iterator |
getComponentIterator()
Gets an iterator on the component list |
java.awt.Container |
getContainer(javax.swing.JComponent d)
returns the ComponentContainer that contains the specified component |
boolean |
getDesktopState()
Deprecated. use get mode instead Gets desktop mode |
int |
getMode()
Gets desktop current mode |
javax.swing.JComponent |
getSelectedComponent()
Gets selected component |
int |
getSelectedIndex()
Gets selected component index |
int |
indexOfComponent(javax.swing.JComponent d)
Gets the index of a component |
boolean |
is_closable()
|
boolean |
is_scrollable()
|
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
protected void |
next()
|
void |
removeAllComponents()
Removes all components |
void |
removeAllListeners()
Removes all Listeners on component selection |
void |
removeComponent(javax.swing.JComponent d)
Removes a component |
void |
removeListener(DesktopCardPanelListener dcpl)
Removes a Listener on component selection |
void |
removeOtherComponents(javax.swing.JComponent jc)
Removes all components |
void |
saveAllComponents()
Save all components. |
void |
selectComponent(javax.swing.JComponent d)
Selects a component |
protected void |
setDesktopCardPanelMode(DesktopCardPanelMode newMode)
set the implementation of the _desktopCardPanelMode wich handles the display of the desktop components |
void |
setDesktopState(boolean state)
Deprecated. use setMode(int mode) instead Changes desktop mode |
void |
setMode(int mode)
set the desktop display mode |
void |
stateChanged(javax.swing.event.ChangeEvent e)
|
void |
updateComponentName(javax.swing.JComponent d)
Updates the name of a component |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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 |
Methods inherited from class java.awt.Container |
---|
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, 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, 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, hide, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static MenuResourceBundle _resources
public static final int CARD_MODE
public static final int DESKTOP_MODE
public static final int EXTERNAL_MODE
public static int SCROLLING_MODE
protected java.util.Vector _components
protected javax.swing.JPopupMenu _cardPopup
protected DesktopCardPanelMode _desktopCardPanelMode
protected java.util.Stack backwardStack
protected java.util.Stack forwardStack
Constructor Detail |
---|
public DesktopCardPanel(boolean scrollable)
scrollable
- true if scrollable pane and frames are requiredpublic DesktopCardPanel(boolean scrollable, boolean closable)
scrollable
- true if scrollable pane and frames are requiredclosable
- true if inner frames created will be closableMethod Detail |
---|
public boolean is_closable()
public boolean is_scrollable()
protected void createCardPopupMenu()
public void setDesktopState(boolean state)
state
- true if desktop is selectedpublic void setMode(int mode)
mode
- CARD_MODE, DESKTOP_MODE or EXTERNAL_MODEprotected void setDesktopCardPanelMode(DesktopCardPanelMode newMode)
newMode
- the new implementation of DesktopCardPanelModepublic int getMode()
public boolean getDesktopState()
public int indexOfComponent(javax.swing.JComponent d)
d
- the component
public java.util.Iterator getComponentIterator()
public javax.swing.JComponent getComponentAt(int index)
public java.awt.Container getContainer(javax.swing.JComponent d)
d
- the component
public void addComponent(javax.swing.JComponent d)
d
- the componentpublic void updateComponentName(javax.swing.JComponent d)
d
- the componentpublic void removeComponent(javax.swing.JComponent d)
d
- the componentpublic void removeAllComponents()
public void removeOtherComponents(javax.swing.JComponent jc)
public void saveAllComponents()
public javax.swing.JComponent getSelectedComponent()
public int getSelectedIndex()
public void selectComponent(javax.swing.JComponent d)
d
- the componentpublic void addListener(DesktopCardPanelListener dcpl)
public void removeListener(DesktopCardPanelListener dcpl)
public void removeAllListeners()
public javax.swing.JButton createPreviousButton()
public javax.swing.JButton createNextButton()
public javax.swing.JMenu createMenu(java.lang.String name)
the
- menu name
public javax.swing.JMenu createMenu(java.lang.String name, boolean enableCloseAll)
name
- the menu nameenableCloseAll
- a boolean indicating if the 'Close all' menu item is showed
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
protected void back()
protected void next()
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |