public class FloatingDockingPort extends DefaultDockingPort
DefaultDockingPort.PortLayout
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
java.awt.Container.AccessibleAWTContainer
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
DockingListener.Stub
Modifier and Type | Field and Description |
---|---|
protected FrameDragListener |
dragListener |
protected DockingFrame |
frame |
dockingListeners
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
INITIAL_TAB_POSITION
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
Constructor and Description |
---|
FloatingDockingPort(DockingFrame frame,
java.lang.String persistentId) |
Modifier and Type | Method and Description |
---|---|
boolean |
dock(Dockable dockable,
java.lang.String region)
Docks the specified
Dockable within the specified region. |
void |
dragStarted(DockingEvent evt)
No operation.
|
int |
getDockableCount() |
protected java.util.Set |
getFrameDragSources(Dockable dockable) |
java.lang.String |
getRegion(java.awt.Point p)
Returns the docking region within this
DockingPort that contains
the specified Point . |
protected void |
installListeners(Dockable dockable) |
boolean |
isDockingAllowed(java.lang.String region,
java.awt.Component comp) |
protected void |
toggleListeners(java.awt.Component comp,
boolean add) |
boolean |
undock(java.awt.Component comp)
Undocks the specified
Component and returns a boolean indicating
the success of the operation. |
void |
undockingComplete(DockingEvent evt)
No operation.
|
protected void |
uninstallListeners(Dockable dockable) |
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
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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
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
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, 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, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClientProperty, putClientProperty
protected DockingFrame frame
protected FrameDragListener dragListener
public FloatingDockingPort(DockingFrame frame, java.lang.String persistentId)
public java.lang.String getRegion(java.awt.Point p)
DefaultDockingPort
DockingPort
that contains
the specified Point
. Valid return values are those regions
defined in DockingConstants
and include NORTH_REGION
,
SOUTH_REGION
, EAST_REGION
, WEST_REGION
,
CENTER_REGION
, and UNKNOWN_REGION
.
If location
is null
, then UNKNOWN_REGION
is
returned.
This method gets the RegionChecker
for this DockingPort
by calling getRegionChecker()
. It then attempts to locate the
Dockable
at the specified location
by calling
getDockableAt(Point location)
.
This method defers processing to getRegion(Component c, Point p)
for the current RegionChecker
. If a Dockable
was found
at the specified Point
, then the location of the Point
is translated to the coordinate system of the Component
for the
embedded Dockable
and that Component
and modified
Point
are passed into getRegion(Component c, Point p)
}
for the current RegionChecker
. If no Dockable
was found,
then the specified Point
is left unmodified and this
DockingPort
and the supplied Point
are passed to
getRegion(Component c, Point p)
} for the current
RegionChecker
.
getRegion
in interface DockingPort
getRegion
in class DefaultDockingPort
p
- the location within this DockingPort
to examine for a
docking region.DockingPort
that contains
the specified Point
DefaultDockingPort.getRegionChecker()
,
DefaultDockingPort.getDockableAt(Point)
,
Dockable.getComponent()
,
RegionChecker.getRegion(Component, Point)
public boolean isDockingAllowed(java.lang.String region, java.awt.Component comp)
public boolean dock(Dockable dockable, java.lang.String region)
DefaultDockingPort
Dockable
within the specified region. The
Component
used for docking is returned by calling
getComponent()
on the specified Dockable
. This method
returns false
immediately if the specified Dockable
is
null
or if
isDockingAllowed(Component comp, String region)
returns
false
.
If this DockingPort
is currently empty, then the Dockable
is docked into the CENTER_REGION
, regardless of the supplied
region
parameter's value.
If isSingleTabAllowed()
returns false
and the
DockingPort
is emtpy, then the Dockable
will be added
directly to the DockingPort
and will take up all available space
within the DockingPort
. In this case, subsequent calls to
getDockedComponent()
will return the dockable Component
.
If isSingleTabAllowed()
returns true
and the
DockingPort
is emtpy, then a JTabbedPane
will be added
directly to the DockingPort
and will take up all available space
within the DockingPort
. The dockable Component
will be
added as a tab within the tabbed pane. In this case, subsequent calls to
getDockedComponent()
will return the JTabbedPane
.
If the DockingPort
is not empty, and the specified region
is CENTER_REGION
, then the dockable Component
will be
added to the JTabbedPane
returned by getDockedComponent()
.
If this DockingPort
only contained a single dockable
Component
without a tabbed pane, then the currently docked
Component
is removed, a JTabbedPane
is created and added,
and both the old Component
and the new one are added to the
JTabbedPane
. In this case, subsequent calls to
getDockedComponent()
will return the JTabbedPane
.
If the DockingPort
is not empty, and the specified region
is NORTH_REGION
, SOUTH_REGION
, EAST_REGION
, or
WEST_REGION
, then the currently docked Component
is
removed and replaced with a JSplitPane
. Two new
DefaultDockingPorts
are created as sub-ports and are added to
each side of the JSplitPane
. The previously docked
Component
is docked to the CENTER_REGION of one of the sub-ports
and the new Component
is added to the other. In this case,
subsequent calls to getDockedComponent()
will return the
JSplitPane
. In this fasion, the sub-ports will now be capable of
handling further sub-docking within the layout.
JSplitPane
and sub-DockingPort
creation are delegated to
the DockingStrategy
returned by getDockingStrategy()
.
Initial splitpane divider location is also controlled by this
DockingStrategy
.
dock
in interface DockingPort
dock
in class DefaultDockingPort
dockable
- the Dockable
to be docked within this
DockingPort
region
- the region within this DockingPort
to dock the
specified Dockable
true
if the docking operation was successful,
false
otherwise.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)
public boolean undock(java.awt.Component comp)
DefaultDockingPort
Component
and returns a boolean indicating
the success of the operation.
Since DefaultDockingPort
may 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 a JSplitPane
renders the
child DefaultDockingPort
unnecessary, which, in turn, renders the
notion of splitting the layout with a JSplitPane
unnecessary
(since there are no longer two components to split the layout between).
Likewise, removing a child component from a JTabbedPane
such that
there is only one child left within the JTabbedPane
removes 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
DockingManager
makes this callback automatic, developers normally
will not need to call this method explicitly. However, when removing a
component from a DefaultDockingPort
using application code,
developers should keep in mind to use this method instead of
remove()
.
undock
in interface DockingPort
undock
in class DefaultDockingPort
comp
- the Component
to be undocked.DockingPort.undock(Component comp)
,
DockingManager.undock(Dockable)
public void dragStarted(DockingEvent evt)
DefaultDockingPort
DockingListener
interface contract.dragStarted
in interface DockingListener
dragStarted
in class DefaultDockingPort
evt
- the DockingEvent
to respond to.DockingListener.dragStarted(DockingEvent)
public void undockingComplete(DockingEvent evt)
DefaultDockingPort
DockingListener
interface contract.undockingComplete
in interface DockingListener
undockingComplete
in class DefaultDockingPort
evt
- the DockingEvent
to respond to.DockingListener.undockingComplete(DockingEvent)
protected void toggleListeners(java.awt.Component comp, boolean add)
protected void installListeners(Dockable dockable)
protected void uninstallListeners(Dockable dockable)
public int getDockableCount()
protected java.util.Set getFrameDragSources(Dockable dockable)