Class FloatingDockingPort
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- org.flexdock.docking.defaults.DefaultDockingPort
-
- org.flexdock.docking.floating.frames.FloatingDockingPort
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,DockingConstants,DockingPort,DockingListener,DockingMonitor
public class FloatingDockingPort extends DefaultDockingPort
- Author:
- Christopher Butler
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.flexdock.docking.defaults.DefaultDockingPort
DefaultDockingPort.PortLayout
-
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
-
Nested classes/interfaces inherited from interface org.flexdock.docking.event.DockingListener
DockingListener.Stub
-
-
Field Summary
Fields Modifier and Type Field Description protected FrameDragListenerdragListenerprotected DockingFrameframe-
Fields inherited from class org.flexdock.docking.defaults.DefaultDockingPort
dockingListeners
-
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
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface org.flexdock.docking.DockingConstants
ACTIVE_WINDOW, BOTTOM, CENTER, CENTER_REGION, CLOSE_ACTION, DEFAULT_PERSISTENCE_KEY, DOCKING_ID, EAST_REGION, HEAVYWEIGHT_DOCKABLES, HORIZONTAL, LEFT, MOUSE_PRESSED, NORTH_REGION, PERMANENT_FOCUS_OWNER, PIN_ACTION, REGION, RIGHT, SOUTH_REGION, TOP, UNINITIALIZED, UNINITIALIZED_RATIO, UNKNOWN_REGION, UNSPECIFIED_SIBLING_PREF, VERTICAL, WEST_REGION
-
Fields inherited from interface org.flexdock.docking.DockingPort
INITIAL_TAB_POSITION
-
-
Constructor Summary
Constructors Constructor Description FloatingDockingPort(DockingFrame frame, java.lang.String persistentId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandock(Dockable dockable, java.lang.String region)Docks the specifiedDockablewithin the specified region.voiddragStarted(DockingEvent evt)No operation.intgetDockableCount()protected java.util.SetgetFrameDragSources(Dockable dockable)java.lang.StringgetRegion(java.awt.Point p)Returns the docking region within thisDockingPortthat contains the specifiedPoint.protected voidinstallListeners(Dockable dockable)booleanisDockingAllowed(java.lang.String region, java.awt.Component comp)protected voidtoggleListeners(java.awt.Component comp, boolean add)booleanundock(java.awt.Component comp)Undocks the specifiedComponentand returns a boolean indicating the success of the operation.voidundockingComplete(DockingEvent evt)No operation.protected voiduninstallListeners(Dockable dockable)-
Methods inherited from class org.flexdock.docking.defaults.DefaultDockingPort
add, add, add, add, add, addDockingListener, clear, createBorderManager, createLayout, createTabbedPane, dock, dockingCanceled, dockingComplete, dropStarted, exportLayout, getBorderManager, getCenterDockable, getComponent, getDockable, getDockableAt, getDockables, getDockableSet, getDockedComponent, getDockingListeners, getDockingProperties, getDockingStrategy, getInitTabPlacement, getPersistentId, getRegionChecker, importLayout, installMaximizedDockable, isDockingAllowed, isParentDockingPort, isRoot, isSingleTabAllowed, isTabsAsDragSource, isValidDockableChild, isValidDockingRegion, paint, releaseForMaximization, remove, removeAll, removeDockingListener, returnFromMaximization, setBorderManager, setDragInProgress, setPersistentId, setRoot, setSingleTabAllowed, setTabsAsDragSource, undockingStarted, uninstallMaximizedDockable, updateTab
-
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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
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, removeContainerListener, setComponentZOrder, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.flexdock.docking.DockingPort
getClientProperty, putClientProperty
-
-
-
-
Field Detail
-
frame
protected DockingFrame frame
-
dragListener
protected FrameDragListener dragListener
-
-
Constructor Detail
-
FloatingDockingPort
public FloatingDockingPort(DockingFrame frame, java.lang.String persistentId)
-
-
Method Detail
-
getRegion
public java.lang.String getRegion(java.awt.Point p)
Description copied from class:DefaultDockingPortReturns the docking region within thisDockingPortthat contains the specifiedPoint. Valid return values are those regions defined inDockingConstantsand includeNORTH_REGION,SOUTH_REGION,EAST_REGION,WEST_REGION,CENTER_REGION, andUNKNOWN_REGION.If
locationisnull, thenUNKNOWN_REGIONis returned.This method gets the
RegionCheckerfor thisDockingPortby callinggetRegionChecker(). It then attempts to locate theDockableat the specifiedlocationby callinggetDockableAt(Point location).This method defers processing to
getRegion(Component c, Point p)for the currentRegionChecker. If aDockablewas found at the specifiedPoint, then the location of thePointis translated to the coordinate system of theComponentfor the embeddedDockableand thatComponentand modifiedPointare passed intogetRegion(Component c, Point p)} for the currentRegionChecker. If noDockablewas found, then the specifiedPointis left unmodified and thisDockingPortand the suppliedPointare passed togetRegion(Component c, Point p)} for the currentRegionChecker.- Specified by:
getRegionin interfaceDockingPort- Overrides:
getRegionin classDefaultDockingPort- Parameters:
p- the location within thisDockingPortto examine for a docking region.- Returns:
- the docking region within this
DockingPortthat contains the specifiedPoint - See Also:
DefaultDockingPort.getRegionChecker(),DefaultDockingPort.getDockableAt(Point),Dockable.getComponent(),RegionChecker.getRegion(Component, Point)
-
isDockingAllowed
public boolean isDockingAllowed(java.lang.String region, java.awt.Component comp)
-
dock
public boolean dock(Dockable dockable, java.lang.String region)
Description copied from class:DefaultDockingPortDocks the specifiedDockablewithin the specified region. TheComponentused for docking is returned by callinggetComponent()on the specifiedDockable. This method returnsfalseimmediately if the specifiedDockableisnullor ifisDockingAllowed(Component comp, String region)returnsfalse.If this
DockingPortis currently empty, then theDockableis docked into theCENTER_REGION, regardless of the suppliedregionparameter's value.If
isSingleTabAllowed()returnsfalseand theDockingPortis emtpy, then theDockablewill be added directly to theDockingPortand will take up all available space within theDockingPort. In this case, subsequent calls togetDockedComponent()will return the dockableComponent.If
isSingleTabAllowed()returnstrueand theDockingPortis emtpy, then aJTabbedPanewill be added directly to theDockingPortand will take up all available space within theDockingPort. The dockableComponentwill be added as a tab within the tabbed pane. In this case, subsequent calls togetDockedComponent()will return theJTabbedPane.If the
DockingPortis not empty, and the specified region isCENTER_REGION, then the dockableComponentwill be added to theJTabbedPanereturned bygetDockedComponent(). If thisDockingPortonly contained a single dockableComponentwithout a tabbed pane, then the currently dockedComponentis removed, aJTabbedPaneis created and added, and both the oldComponentand the new one are added to theJTabbedPane. In this case, subsequent calls togetDockedComponent()will return theJTabbedPane.If the
DockingPortis not empty, and the specified region isNORTH_REGION,SOUTH_REGION,EAST_REGION, orWEST_REGION, then the currently dockedComponentis removed and replaced with aJSplitPane. Two newDefaultDockingPortsare created as sub-ports and are added to each side of theJSplitPane. The previously dockedComponentis docked to the CENTER_REGION of one of the sub-ports and the newComponentis added to the other. In this case, subsequent calls togetDockedComponent()will return theJSplitPane. In this fasion, the sub-ports will now be capable of handling further sub-docking within the layout.JSplitPaneand sub-DockingPortcreation are delegated to theDockingStrategyreturned bygetDockingStrategy(). Initial splitpane divider location is also controlled by thisDockingStrategy.- Specified by:
dockin interfaceDockingPort- Overrides:
dockin classDefaultDockingPort- Parameters:
dockable- theDockableto be docked within thisDockingPortregion- the region within thisDockingPortto dock the specifiedDockable- Returns:
trueif the docking operation was successful,falseotherwise.- See Also:
DockingPort.dock(Dockable, String),DefaultDockingPort.isDockingAllowed(Component, String),DefaultDockingPort.getDockedComponent(),DefaultDockingPort.getDockingStrategy(),DockingStrategy.createDockingPort(DockingPort),DockingStrategy.createSplitPane(DockingPort, String),DockingStrategy.getInitialDividerLocation(DockingPort, JSplitPane),DockingStrategy.getDividerProportion(DockingPort, JSplitPane)
-
undock
public boolean undock(java.awt.Component comp)
Description copied from class:DefaultDockingPortUndocks the specifiedComponentand returns a boolean indicating the success of the operation.Since
DefaultDockingPortmay only contain one child component, there i s a container hierarchy to manage tabbed interfaces, split layouts, and sub-docking. As components are removed from this hierarchy, the hierarchy itself must be reevaluated. Removing a component from a child code>DefaultDockingPort} within aJSplitPanerenders the childDefaultDockingPortunnecessary, which, in turn, renders the notion of splitting the layout with aJSplitPaneunnecessary (since there are no longer two components to split the layout between). Likewise, removing a child component from aJTabbedPanesuch that there is only one child left within theJTabbedPaneremoves the need for a tabbed interface to begin with.This method automatically handles the reevaluation of the container hierarchy to keep wrapper-container usage at a minimum. Since
DockingManagermakes this callback automatic, developers normally will not need to call this method explicitly. However, when removing a component from aDefaultDockingPortusing application code, developers should keep in mind to use this method instead ofremove().- Specified by:
undockin interfaceDockingPort- Overrides:
undockin classDefaultDockingPort- Parameters:
comp- theComponentto be undocked.- Returns:
- a boolean indicating the success of the operation
- See Also:
DockingPort.undock(Component comp),DockingManager.undock(Dockable)
-
dragStarted
public void dragStarted(DockingEvent evt)
Description copied from class:DefaultDockingPortNo operation. Provided as a method stub to fulfull theDockingListenerinterface contract.- Specified by:
dragStartedin interfaceDockingListener- Overrides:
dragStartedin classDefaultDockingPort- Parameters:
evt- theDockingEventto respond to.- See Also:
DockingListener.dragStarted(DockingEvent)
-
undockingComplete
public void undockingComplete(DockingEvent evt)
Description copied from class:DefaultDockingPortNo operation. Provided as a method stub to fulfull theDockingListenerinterface contract.- Specified by:
undockingCompletein interfaceDockingListener- Overrides:
undockingCompletein classDefaultDockingPort- Parameters:
evt- theDockingEventto respond to.- See Also:
DockingListener.undockingComplete(DockingEvent)
-
toggleListeners
protected void toggleListeners(java.awt.Component comp, boolean add)
-
installListeners
protected void installListeners(Dockable dockable)
-
uninstallListeners
protected void uninstallListeners(Dockable dockable)
-
getDockableCount
public int getDockableCount()
-
getFrameDragSources
protected java.util.Set getFrameDragSources(Dockable dockable)
-
-