Package org.jorigin.gui
Class JDesktopPane
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JLayeredPane
-
- javax.swing.JDesktopPane
-
- org.jorigin.gui.JDesktopPane
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible
public class JDesktopPane extends javax.swing.JDesktopPaneThis class extends aJDesktopPaneand provide organization methods for the internal frames.- Since:
- 1.0.1
- Author:
- Julien Seinturier - (c) 2009 - JOrigin project - http:/www.jorigin.org
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JDesktopPane
javax.swing.JDesktopPane.AccessibleJDesktopPane
-
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
javax.swing.JLayeredPane.AccessibleJLayeredPane
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description static intCASCADEThis flag represents a cascade organization for the internal frames.static intFIT_CENTERAdded component are centeredstatic intFIT_CENTER_DELTAAdded component are centered then switched in x and y by a delta.static intFIT_CENTER_RESIZEAdded component are centered and resized to fit the default.static intFIT_CENTER_RESIZE_DELTAAdded component are centered, resized and switched by a delta.static intFIT_NONENo fit is applied to the added componentsstatic intMOSAICThis flag represents a mosaic organization for the internal frames.static intNONEThis flag represent a no organization method for the internal frames.-
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
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description JDesktopPane()Create a new default desktop pane.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInternalFrame(java.lang.String title, java.awt.Container container)Add a container as internal frame in the current desktop.voidaddInternalFrame(java.lang.String title, java.awt.Container container, boolean fit)Add a container as internal frame in the current desktop.voidaddInternalFrame(javax.swing.JInternalFrame frame, boolean fit)Add an internal frame to the desktop.voidcascade()Reorganize the frames of the desktop by using cascadingvoidfit(javax.swing.JInternalFrame frame)Fit the givenframeto take all the available space within the desktop pane.doublegetFitDeltaMax()Get the fit delta maximum value.intgetFitMethod()Get the fit method used to initialize space occupation of new components.doublegetFrameDimensionRatio()Get the frame dimension ratio for internal frame.intgetOrganizeMethod()Get the organization method used by the desktop to organize components.voidmosaic()Reorganize the frames of the desktop by using mosaicvoidorganize()Organize the Internal frames following the default methodvoidorganize(int method)Organize the Internal frames following the method given in parameter.voidsetFitDeltaMax(double delta)Set the fit delta maximum value.voidsetFitMethod(int fitMethod)Set the fit method used to initialize space occupation of new components.voidsetFrameDimensionRatio(double ratio)Set the frame dimension ratio for internal frame.voidsetOrganizeMethod(int method)Set the organization method used by the desktop to organize components.-
Methods inherited from class javax.swing.JDesktopPane
addImpl, getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, paramString, remove, remove, removeAll, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, 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, 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, removeContainerListener, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
NONE
public static final int NONE
This flag represent a no organization method for the internal frames.- See Also:
MOSAIC,CASCADE, Constant Field Values
-
MOSAIC
public static final int MOSAIC
This flag represents a mosaic organization for the internal frames.- See Also:
NONE,CASCADE, Constant Field Values
-
CASCADE
public static final int CASCADE
This flag represents a cascade organization for the internal frames.- See Also:
NONE,MOSAIC, Constant Field Values
-
FIT_NONE
public static final int FIT_NONE
No fit is applied to the added components- See Also:
- Constant Field Values
-
FIT_CENTER
public static final int FIT_CENTER
Added component are centered- See Also:
- Constant Field Values
-
FIT_CENTER_RESIZE
public static final int FIT_CENTER_RESIZE
Added component are centered and resized to fit the default. The fit ratio is given by methodgetFrameDimensionRatio()- See Also:
- Constant Field Values
-
FIT_CENTER_DELTA
public static final int FIT_CENTER_DELTA
Added component are centered then switched in x and y by a delta. The delta is available with methodssetFitDeltaMax(double delta)andgetFitDeltaMax- See Also:
- Constant Field Values
-
FIT_CENTER_RESIZE_DELTA
public static final int FIT_CENTER_RESIZE_DELTA
Added component are centered, resized and switched by a delta. The fit ratio is given by methodgetFrameDimensionRatio(). The delta is available with methodssetFitDeltaMax(double delta)andgetFitDeltaMax- See Also:
- Constant Field Values
-
-
Method Detail
-
setOrganizeMethod
public void setOrganizeMethod(int method)
Set the organization method used by the desktop to organize components.
-
getOrganizeMethod
public int getOrganizeMethod()
Get the organization method used by the desktop to organize components.- Returns:
- the organization method.
-
setFrameDimensionRatio
public void setFrameDimensionRatio(double ratio)
Set the frame dimension ratio for internal frame. All added internal frame will be redimensionned to fit the ratio of descktop dimension.- Parameters:
ratio- the ratio of desktop dimension.
-
getFrameDimensionRatio
public double getFrameDimensionRatio()
Get the frame dimension ratio for internal frame. All added internal frame will be redimensionned to fit the ratio of descktop dimension.- Returns:
- ratio the ratio of desktop dimension.
-
setFitMethod
public void setFitMethod(int fitMethod)
Set the fit method used to initialize space occupation of new components.- Parameters:
fitMethod- the fit method to use (FIT_CENTER, FIT_CENTER_RESIZE, ...)
-
getFitMethod
public int getFitMethod()
Get the fit method used to initialize space occupation of new components.- Returns:
- the fit method to use (FIT_CENTER, FIT_CENTER_RESIZE, ...)
-
setFitDeltaMax
public void setFitDeltaMax(double delta)
Set the fit delta maximum value. The delta is used when an organization with random delta is processed.- Parameters:
delta- the max delta value.
-
getFitDeltaMax
public double getFitDeltaMax()
Get the fit delta maximum value. The delta is used when an organization with random delta is processed.- Returns:
- the max delta value.
-
organize
public void organize()
Organize the Internal frames following the default method
-
organize
public void organize(int method)
Organize the Internal frames following the method given in parameter.MOSAIC
-
cascade
public void cascade()
Reorganize the frames of the desktop by using cascading
-
mosaic
public void mosaic()
Reorganize the frames of the desktop by using mosaic
-
fit
public void fit(javax.swing.JInternalFrame frame)
Fit the givenframeto take all the available space within the desktop pane.- Parameters:
frame- theframeto fit.
-
addInternalFrame
public void addInternalFrame(java.lang.String title, java.awt.Container container, boolean fit)Add a container as internal frame in the current desktop.- Parameters:
title- String the title of the internal framecontainer- Container the conainer to addfit- If this boolean is true, the frame is redimensioned and relocated by the desktop to fit the default placement methods. If false is given, the internal frame is not resized and relocated.
-
addInternalFrame
public void addInternalFrame(java.lang.String title, java.awt.Container container)Add a container as internal frame in the current desktop.- Parameters:
title- String the title of the internal framecontainer- Container the conainer to add
-
addInternalFrame
public void addInternalFrame(javax.swing.JInternalFrame frame, boolean fit)Add an internal frame to the desktop.- Parameters:
frame- the frame to add.fit- is the frame has to fit within the desktop pane.
-
-