java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLayeredPane
javax.swing.JDesktopPane
org.jorigin.swing.JDesktopPane
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
This class extends a
JDesktopPane and provide organization methods for the internal frames.- Since:
- 1.0.1
- Version:
- "1.0.14" - b202111241200L
- Author:
- Julien SEINTURIER - Université de Toulon / CNRS LIS umr 7020 - github.com/jorigin/jcommon (contact@jorigin.org)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDesktopPane
JDesktopPane.AccessibleJDesktopPaneNested classes/interfaces inherited from class javax.swing.JLayeredPane
JLayeredPane.AccessibleJLayeredPaneNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThis flag represents a cascade organization for the internal frames.static final intAdded component are centeredstatic final intAdded component are centered then switched in x and y by a delta.static final intAdded component are centered and resized to fit the default.static final intAdded component are centered, resized and switched by a delta.static final intNo fit is applied to the added componentsstatic final intThis flag represents a mosaic organization for the internal frames.static final intThis flag represent a no organization method for the internal frames.Fields inherited from class javax.swing.JDesktopPane
LIVE_DRAG_MODE, OUTLINE_DRAG_MODEFields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYERFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInternalFrame(String title, Container container) Add a container as internal frame in the current desktop.voidaddInternalFrame(String title, Container container, boolean fit) Add a container as internal frame in the current desktop.voidaddInternalFrame(JInternalFrame frame, boolean fit) Add an internal frame to the desktop.voidcascade()Reorganize the frames of the desktop by using cascadingvoidfit(JInternalFrame frame) Fit the givenframeto take all the available space within the desktop pane.doubleGet the fit delta maximum value.intGet the fit method used to initialize space occupation of new components.doubleGet the frame dimension ratio for internal frame.intGet 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, updateUIMethods 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, setPositionMethods 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, updateMethods 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, validateTreeMethods 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 Details
-
NONE
public static final int NONEThis flag represent a no organization method for the internal frames.- See Also:
-
MOSAIC
public static final int MOSAICThis flag represents a mosaic organization for the internal frames.- See Also:
-
CASCADE
public static final int CASCADEThis flag represents a cascade organization for the internal frames.- See Also:
-
FIT_NONE
public static final int FIT_NONENo fit is applied to the added components- See Also:
-
FIT_CENTER
public static final int FIT_CENTERAdded component are centered- See Also:
-
FIT_CENTER_RESIZE
public static final int FIT_CENTER_RESIZEAdded component are centered and resized to fit the default. The fit ratio is given by methodgetFrameDimensionRatio()- See Also:
-
FIT_CENTER_DELTA
public static final int FIT_CENTER_DELTAAdded component are centered then switched in x and y by a delta. The delta is available with methodssetFitDeltaMax(double delta)andgetFitDeltaMax- See Also:
-
FIT_CENTER_RESIZE_DELTA
public static final int FIT_CENTER_RESIZE_DELTAAdded 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:
-
-
Constructor Details
-
JDesktopPane
public JDesktopPane()Create a new default desktop pane.
-
-
Method Details
-
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
Fit the givenframeto take all the available space within the desktop pane.- Parameters:
frame- theframeto fit.
-
addInternalFrame
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
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
Add an internal frame to the desktop.- Parameters:
frame- the frame to add.fit- is the frame has to fit within the desktop pane.
-