com.sibvisions.rad.ui.swing.ext
Class JVxDesktopPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by javax.swing.JDesktopPane
                      extended by com.sibvisions.rad.ui.swing.ext.JVxDesktopPane
All Implemented Interfaces:
ITabListener, ImageObserver, MenuContainer, Serializable, Accessible

public class JVxDesktopPane
extends JDesktopPane
implements ITabListener

The JVxDesktopPane extends a JDesktopPane and enables the usage of a background image.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDesktopPane
JDesktopPane.AccessibleJDesktopPane
 
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
JLayeredPane.AccessibleJLayeredPane
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JDesktopPane
LIVE_DRAG_MODE, OUTLINE_DRAG_MODE
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
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
JVxDesktopPane()
          Creates a new instance of JVxDesktopPane with the JVxDesktopManager.
 
Method Summary
protected  void addImpl(Component pComponent, Object pConstraints, int pIndex)
          Adds a Component to the desktop.
protected  void addTab(JVxInternalFrame pFrame)
          Adds an internal frame as tab.
 void closeTab(TabEvent pEvent)
          Invoked when a tab will be closed (before it will be closed).
 void deselectTab(TabEvent pEvent)
          Invoked when a tab will be deselected.
 LayoutManager getLayout()
          Gets the layout manager for the content pane.
 JVxTabbedPane getTabbedPane()
          Gets the tab pane.
 boolean isNavigationKeysEnabled()
          Determines whether the navigation with the keyboard is enabled.
 boolean isTabMode()
          Returns if the desktop pane is in tab mode.
 boolean isTabsDragable()
          Returns the drag option of tabs in tabbed mode.
 void moveTab(TabEvent pEvent)
          Invoked when a tab was moved from one index to another index.
 boolean processKeyBinding(KeyStroke pStroke, KeyEvent pEvent, int pModifier, boolean pPressed)
          
 void remove(Component pComponent)
          Removes a component from the desktop or the content pane.
 void removeAll()
          Removes all the components from the desktop and the content pane, if attached.
 void removeNotify()
          
 void selectTab(TabEvent pEvent)
          Invoked when a tab is the curent selected tab.
 void setLayout(LayoutManager pLayout)
          Sets the layout manager for the content pane.
 void setNavigationKeysEnabled(boolean pEnabled)
          En- or disables the frame navigation with the keyboard.
 void setTabMode(boolean pTabMode)
          Sets the tabs display mode of the desktop.
 void setTabsDragable(boolean pDragable)
          Sets the drag option for tabs in tabbed mode.
 
Methods inherited from class javax.swing.JDesktopPane
getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, paramString, remove, selectFrame, setComponentZOrder, setDesktopManager, setDragMode, setSelectedFrame, setUI, updateUI
 
Methods inherited from class javax.swing.JLayeredPane
getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, setLayer, setLayer, setPosition
 
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, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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
 

Constructor Detail

JVxDesktopPane

public JVxDesktopPane()
Creates a new instance of JVxDesktopPane with the JVxDesktopManager.

Method Detail

closeTab

public void closeTab(TabEvent pEvent)
              throws Exception
Invoked when a tab will be closed (before it will be closed).

Specified by:
closeTab in interface ITabListener
Parameters:
pEvent - the event
Throws:
Exception - if the close operation is not possible

deselectTab

public void deselectTab(TabEvent pEvent)
Invoked when a tab will be deselected.

Specified by:
deselectTab in interface ITabListener
Parameters:
pEvent - the event

selectTab

public void selectTab(TabEvent pEvent)
Invoked when a tab is the curent selected tab.

Specified by:
selectTab in interface ITabListener
Parameters:
pEvent - the event

moveTab

public void moveTab(TabEvent pEvent)
Invoked when a tab was moved from one index to another index.

Specified by:
moveTab in interface ITabListener
Parameters:
pEvent - the event

setLayout

public void setLayout(LayoutManager pLayout)
Sets the layout manager for the content pane.

Overrides:
setLayout in class Container
Parameters:
pLayout - the layout manager

getLayout

public LayoutManager getLayout()
Gets the layout manager for the content pane.

Overrides:
getLayout in class Container
Returns:
the layout manager

addImpl

protected void addImpl(Component pComponent,
                       Object pConstraints,
                       int pIndex)
Adds a Component to the desktop. If the component is an internal frame, then it will be added to the destops JLayeredPane otherwise it will be added to the content pane of the desktop.

Overrides:
addImpl in class JDesktopPane
Parameters:
pComponent - the component to be added
pConstraints - constraints an object expressing layout constraints for this component
pIndex - index the position in the container's list at which to insert the component, where -1 means append to the end
Throws:
IllegalArgumentException - if index is invalid
IllegalArgumentException - if adding the container's parent to itself
IllegalArgumentException - if comp has been added to the Container more than once
IllegalArgumentException - if adding a window to a container
See Also:
Container.add(Component), Container.add(Component, int), Container.add(Component, java.lang.Object), LayoutManager, LayoutManager2

removeNotify

public void removeNotify()

Overrides:
removeNotify in class JComponent

removeAll

public void removeAll()
Removes all the components from the desktop and the content pane, if attached.

Overrides:
removeAll in class JDesktopPane

remove

public void remove(Component pComponent)
Removes a component from the desktop or the content pane.

Overrides:
remove in class Container
Parameters:
pComponent - the component to be removed

processKeyBinding

public boolean processKeyBinding(KeyStroke pStroke,
                                 KeyEvent pEvent,
                                 int pModifier,
                                 boolean pPressed)

Overrides:
processKeyBinding in class JComponent

setTabMode

public void setTabMode(boolean pTabMode)
Sets the tabs display mode of the desktop.

Parameters:
pTabMode - true to display internal frames as tabs; false to display internal frames as windows

isTabMode

public boolean isTabMode()
Returns if the desktop pane is in tab mode. That means that all visible and non modal internal frames will be shown as tab page.

Returns:
true if the desktop pane is in tab mode, otherwise false

setTabsDragable

public void setTabsDragable(boolean pDragable)
Sets the drag option for tabs in tabbed mode. If the option is enabled, it's possible to change the position of tabs.

Parameters:
pDragable - true to enable the drag option, otherwise false

isTabsDragable

public boolean isTabsDragable()
Returns the drag option of tabs in tabbed mode.

Returns:
true if it's possible to drag tabs, false otherwise

addTab

protected void addTab(JVxInternalFrame pFrame)
Adds an internal frame as tab.

Parameters:
pFrame - the frame

getTabbedPane

public JVxTabbedPane getTabbedPane()
Gets the tab pane.

Returns:
the tab pane or null if the tab mode is not active

setNavigationKeysEnabled

public void setNavigationKeysEnabled(boolean pEnabled)
En- or disables the frame navigation with the keyboard.

Parameters:
pEnabled - true to enable the navigation with the keyboard, otherwise false

isNavigationKeysEnabled

public boolean isNavigationKeysEnabled()
Determines whether the navigation with the keyboard is enabled.

Returns:
true if the keyboard navigation is enabled, otherwise false


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.