com.quadrique.jbuildingblocks.gui
Class DesktopPanel

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.quadrique.jbuildingblocks.gui.DesktopPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class DesktopPanel
extends JDesktopPane

This is the base class of all desktop panel

Author:
Hervé Rivere
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
 
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
TOOL_TIP_TEXT_KEY, 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
DesktopPanel(String zBackgroundImage)
          Constructor
 
Method Summary
 void addFrame(JInternalFrame zFrame)
          This method is used to add a frame to the desktop pane.
 void cascadeAllFrames()
          This method is used to cascade all the frames in the default layer
 void closeAllFrames()
          This method is used to releaseConnection all the frames in the default layer
 boolean closeCurrentFrame()
          This method is used to releaseConnection the current frame (i.e.
 boolean closeFrame(JInternalFrame zFrame)
          This method is used to remove a frame from the desktop pane.
 JInternalFrame getCurrentFrame()
          Retrieves the frame that is on top of all the other frames (if any) in the default layer (- this method ignores any palette frame).
 Iterator<JInternalFrame> getFramesCollection()
          The iterator to loop over all internal frames
 int getNbOfFrames()
           
 JInternalFrame getSelectedFrame()
          Retrieves the frame that is selected (if any) If there is a palette and if the palette has the selection, this method will return a reference to the palette.
 void minimizeAllFrames()
          This method is used to minimize all the frames that are in the default layer (e.g.
 void nextFrame()
          This method moves the next frame to the front and activates it.
 void paintComponent(Graphics g)
           
 void previousFrame()
          This method moves the previous frame to the front and activates it.
 void tileAllFramesHorizontally()
          This method is used to tile all the frames in the default layer horizontally
 void tileAllFramesVertically()
          This method is used to tile all the frames in the default layer vertically .
 
Methods inherited from class javax.swing.JDesktopPane
getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getUI, getUIClassID, remove, removeAll, selectFrame, setComponentZOrder, setDesktopManager, setDragMode, setSelectedFrame, setUI, updateUI
 
Methods inherited from class javax.swing.JLayeredPane
getComponentCountInLayer, getComponentsInLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getPosition, highestLayer, 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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, 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, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, removeContainerListener, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DesktopPanel

public DesktopPanel(String zBackgroundImage)
Constructor

Parameters:
zBackgroundImage - an optional (use null if you don't want one) background image
Method Detail

paintComponent

public void paintComponent(Graphics g)
Overrides:
paintComponent in class JComponent

getNbOfFrames

public int getNbOfFrames()
Returns:
the number of frames in the default layer (e.g. palette if any is not included)

getFramesCollection

public Iterator<JInternalFrame> getFramesCollection()
The iterator to loop over all internal frames

Returns:

addFrame

public void addFrame(JInternalFrame zFrame)
This method is used to add a frame to the desktop pane. If a frame is already maximized, the new frame will also be maximized. If not, it will be added to the desktop in cascade.

Parameters:
zFrame - the new frame to add to the desktop pane

closeFrame

public boolean closeFrame(JInternalFrame zFrame)
This method is used to remove a frame from the desktop pane.

Parameters:
zFrame - the frame to remove
Returns:
true if the frame was closed, false otherwise

closeAllFrames

public void closeAllFrames()
This method is used to releaseConnection all the frames in the default layer


closeCurrentFrame

public boolean closeCurrentFrame()
This method is used to releaseConnection the current frame (i.e. the frame at the top position in the default layer).

Returns:
true if the frame was closed, false otherwise

cascadeAllFrames

public void cascadeAllFrames()
                      throws Exception
This method is used to cascade all the frames in the default layer

Throws:
Exception - an exception if an error occurs

tileAllFramesHorizontally

public void tileAllFramesHorizontally()
                               throws Exception
This method is used to tile all the frames in the default layer horizontally

Throws:
Exception - an exception if an error occurs

tileAllFramesVertically

public void tileAllFramesVertically()
                             throws Exception
This method is used to tile all the frames in the default layer vertically .

Throws:
Exception - an exception if an error occurs

minimizeAllFrames

public void minimizeAllFrames()
                       throws Exception
This method is used to minimize all the frames that are in the default layer (e.g. palette will not be impacted)

Throws:
Exception - an exception if an error occurs

getCurrentFrame

public JInternalFrame getCurrentFrame()
Retrieves the frame that is on top of all the other frames (if any) in the default layer (- this method ignores any palette frame).

Returns:
the current JInternalFrame or null if none is available

getSelectedFrame

public JInternalFrame getSelectedFrame()
Retrieves the frame that is selected (if any) If there is a palette and if the palette has the selection, this method will return a reference to the palette.

Overrides:
getSelectedFrame in class JDesktopPane
Returns:
the selected JInternalFrame or null if none is available

nextFrame

public void nextFrame()
               throws Exception
This method moves the next frame to the front and activates it.

Throws:
Exception - an exception if an error occurs

previousFrame

public void previousFrame()
                   throws Exception
This method moves the previous frame to the front and activates it.

Throws:
Exception - an exception if an error occurs


Copyright © 2001-2009 Quadrique Corporation. All Rights Reserved.