|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.flexdock.docking.defaults.DefaultDockingPort
public class DefaultDockingPort
This is a Container that implements the DockingPort
interface. It provides a default implementation of DockingPort to
allow ease of development within docking-enabled applications.
The DefaultDockingPort handles docking in one of three ways. If the
port is empty, then all incoming Dockables are docked to the CENTER
region. If the port is not empty, then all incoming Dockables docked
to the CENTER region are embedded within a JTabbedPane. All incoming
Dockables docked to an outer region (NORTH, SOUTH, EAST, and WEST) of
a non-empty port are placed into a split layout using a JSplitPane.
For centrally docked Components, the immediate child of the
DefaultDockingPort may or may not be a JTabbedPane. If
isSingleTabAllowed() returns true for the current
DefaultDockingPort, then the immediate child returned by
getDockedComponent() will return a JTabbedPane instance even
if there is only one Dockable embedded within the port. If there is a
single Dockable in the port, but isSingleTabAllowed() returns
false, then getDockedComponent() will return the
Component that backs the currently docked Dockable, returned
by the Dockable's getComponent() method.
isSingleTabAllowed() is a scoped property that may apply to this
port, all ports across the JVM, or all ports within a user defined scope.
getDockedComponent() will return a JTabbedPane at all times
if there is more than one centrally docked Dockable within the port,
and all docked Components will reside within the tabbed pane.
Components that are docked in the NORTH, SOUTH, EAST, or WEST regions are
placed in a JSplitPane splitting the layout of the
DockingPort between child components. Each region of the
JSplitPane contains a new DefaultDockingPort, which, in
turn, contains the docked components. In this situation,
getDockedComponent() will return a JSplitPane reference.
A key concept that drives the DefaultDockingPort, then, is the
notion that this DockingPort implementation may only ever have one
single child component, which may or may not be a wrapper for other child
components. Because JSplitPane contains child
DefaultDockingPorts, each of those DefaultDockingPorts is
available for further sub-docking operations.
Since a DefaultDockingPort may only contain one child component,
there is 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
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.
When the DockingManager removes a component from a
DockingPort via DockingManager.undock(Dockable dockable) it
uses a call to undock() on the current DockingPort.
undock() 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 undock() instead of
remove().
Border management after docking and undocking operations are accomplished
using a BorderManager. setBorderManager() may be used to set
the border manager instance and customize border management.
| Nested Class Summary | |
|---|---|
protected class |
DefaultDockingPort.PortLayout
|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Nested classes/interfaces inherited from interface org.flexdock.docking.event.DockingListener |
|---|
DockingListener.Stub |
| Field Summary | |
|---|---|
protected ArrayList |
dockingListeners
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, 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 |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface org.flexdock.docking.DockingPort |
|---|
INITIAL_TAB_POSITION |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
DefaultDockingPort()
Creates a new DefaultDockingPort with a persistent ID equal to
the String value of this a random UUID. |
|
DefaultDockingPort(String id)
Creates a new DefaultDockingPort with the specified persistent
ID. |
|
| Method Summary | |
|---|---|
Component |
add(Component comp)
Overridden to set the currently docked component. |
Component |
add(Component comp,
int index)
Overridden to set the currently docked component. |
void |
add(Component comp,
Object constraints)
Overridden to set the currently docked component. |
void |
add(Component comp,
Object constraints,
int index)
Overridden to set the currently docked component. |
Component |
add(String name,
Component comp)
Overridden to set the currently docked component. |
void |
addDockingListener(DockingListener listener)
Adds a DockingListener to observe docking events for this
DockingPort. |
void |
clear()
Removes all Dockables from this DockingPort. |
protected BorderManager |
createBorderManager()
Creates a standard border manager for this docking port. |
protected LayoutManager |
createLayout()
|
protected JTabbedPane |
createTabbedPane()
If this method returns null, implementations may throw
NullPointerExceptions. |
boolean |
dock(Component comp,
String region)
Docks the specified component within the specified region. |
boolean |
dock(Dockable dockable,
String region)
Docks the specified Dockable within the specified region. |
void |
dockingCanceled(DockingEvent evt)
No operation. |
void |
dockingComplete(DockingEvent evt)
Requests activation for the newly docked Dockable. |
void |
dragStarted(DockingEvent evt)
No operation. |
void |
dropStarted(DockingEvent evt)
No operation. |
LayoutNode |
exportLayout()
Returns a LayoutNode containing metadata that describes the
current layout contained within this DefaultDockingPort. |
BorderManager |
getBorderManager()
Returns the currently intalled BorderManager. |
protected Dockable |
getCenterDockable()
|
Component |
getComponent(String region)
Returns the Component currently docked within the specified
region. |
Dockable |
getDockable(String region)
Returns the Dockable currently docked within the specified
region. |
Dockable |
getDockableAt(Point location)
Returns the direct child Dockable located at the specified
Point. |
Set |
getDockables()
Returns all Dockables docked within this DockingPort and
all sub-DockingPorts. |
protected Set |
getDockableSet(int depth,
int level,
Class desiredClass)
|
Component |
getDockedComponent()
Returns the child Component currently embedded within with
DockingPort. |
DockingListener[] |
getDockingListeners()
Returns an array of all DockingListeners added to this
DockingPort. |
DockingPortPropertySet |
getDockingProperties()
Returns a DockingPortPropertySet instance associated with this
DockingPort. |
DockingStrategy |
getDockingStrategy()
Returns the DockingStrategy used by this DockingPort. |
protected int |
getInitTabPlacement()
|
String |
getPersistentId()
Returns a String identifier that is unique to
DockingPorts within a JVM instance, but persistent across JVM
instances. |
String |
getRegion(Point location)
Returns the docking region within this DockingPort that contains
the specified Point. |
RegionChecker |
getRegionChecker()
Returns the RegionChecker currently used by this
DockingPort. |
void |
importLayout(LayoutNode node)
Clears out the existing layout within this DockingPort and
reconstructs a new layout based upon the specified LayoutNode. |
void |
installMaximizedDockable(Dockable dockable)
Asks this DockingPort to temporarily install the specified
Dockable and maximize its component. |
boolean |
isDockingAllowed(Component comp,
String region)
Returns true if docking is allowed for the specified
Component within the supplied region, false
otherwise. |
boolean |
isParentDockingPort(Component comp)
Indicates whether or not the specified component is docked somewhere within this DefaultDockingPort. |
boolean |
isRoot()
Returns a boolean indicating whether or not this DockingPort is
nested within another DockingPort. |
boolean |
isSingleTabAllowed()
Returns true if single tabs are allowed within this
DockingPort, false otherwise. |
boolean |
isTabsAsDragSource()
Returns true if drag-to-dock support is enabled for tabs and
their associated Dockables, false otherwise. |
protected boolean |
isValidDockableChild(Component c,
Class desiredClass)
|
protected boolean |
isValidDockingRegion(String region)
|
void |
paint(Graphics g)
Overridden to provide enhancements during drag operations. |
void |
releaseForMaximization(Dockable dockable)
Asks this DockingPort to temporarily release its child
Dockable for use by another DockingPort to achieve
maximization. |
void |
remove(int index)
Overridden to decorate superclass method, keeping track of internal docked-component reference. |
void |
removeAll()
Overridden to decorate superclass method, keeping track of internal docked-component reference. |
void |
removeDockingListener(DockingListener listener)
Removes the specified DockingListener from this
DockingPort. |
void |
returnFromMaximization()
Notifies this DockingPort that the Dockable previously
released for maximization via a call to
DockingPort.releaseForMaximization(Dockable) is now ready to be returned to
its original state inside this DockingPort. |
void |
setBorderManager(BorderManager mgr)
Sets the currently installed BorderManager. |
void |
setDragInProgress(boolean inProgress)
This method is used internally by the framework to notify DefaultDockingPorts whether a drag operation is or is not
currently in progress and should not be called by application-level
developers. |
void |
setPersistentId(String id)
Sets the persisent ID to be used for this DockingPort. |
void |
setRoot(boolean root)
This method is used internally by the framework to notify DefaultDockingPorts whether they are "root" DockingPorts
according to the rules specified by isRoot() on the
DockingPort interface. |
void |
setSingleTabAllowed(boolean allowed)
Sets the "single tab" property for this DockingPort, allowing or
disallowing a single Dockable within the DockingPort to
appear within a tabbed layout. |
void |
setTabsAsDragSource(boolean enabled)
Enables or disables drag support for docking operations on the tabs used within an embedded tabbed layout. |
boolean |
undock(Component comp)
Undocks the specified Component and returns a boolean indicating
the success of the operation. |
void |
undockingComplete(DockingEvent evt)
No operation. |
void |
undockingStarted(DockingEvent evt)
No operation. |
void |
uninstallMaximizedDockable()
Notifies this DockingPort that the Dockable previously
installed for maximization via a call to
DockingPort.installMaximizedDockable(Dockable) should now be returned to its
original DockingPort and that this DockingPort should
return to its original state from before the call to
DockingPort.installMaximizedDockable(Dockable). |
protected void |
updateTab(Dockable dockable)
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| 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 |
|---|
protected ArrayList dockingListeners
| Constructor Detail |
|---|
public DefaultDockingPort()
DefaultDockingPort with a persistent ID equal to
the String value of this a random UUID.
UUIDpublic DefaultDockingPort(String id)
DefaultDockingPort with the specified persistent
ID. If id is null, then the String value of this
Object's hash code is used. The persistent ID will be the same
value returned by invoking getPersistentId() for this
DefaultDockingPort.
id - the persistent ID for the new DefaultDockingPort
instance.| Method Detail |
|---|
protected LayoutManager createLayout()
protected BorderManager createBorderManager()
This method is called from the constructor.
public Component add(Component comp)
add in class Containercomp - the component to be added
public Component add(Component comp,
int index)
add in class Containercomp - the component to be addedindex - the position at which to insert the component, or -1
to append the component to the end
public void add(Component comp,
Object constraints)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for this component
public void add(Component comp,
Object constraints,
int index)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for thisindex - the position in the container's list at which to insert the
component; -1 means insert at the end
public Component add(String name,
Component comp)
add in class Containername - the name of the Component to be added.comp - the Component to add.
public boolean isDockingAllowed(Component comp,
String region)
true if docking is allowed for the specified
Component within the supplied region, false
otherwise. It is important to note that success of a docking operation
relies on many factors and a return value of true from this
method does not necessarily guarantee that a call to dock() will
succeed. This method merely indicates that the current
DockingPort does not have any outstanding reason to block a
docking operation with respect to the specified Component and
region.
If comp is null or region is invalid according to
DockingManager.isValidDockingRegion(String region), then this
method returns false.
If this DockingPort is not already the parent DockingPort
for the specified Component, then this method returns
true.
If this DockingPort is already the parent DockingPort for
the specified Component, then a check is performed to see if
there is a tabbed layout. Tabbed layouts may contain multiple
Dockables, and thus the tab ordering may be rearranged, or
shifted into a split layout. If comp is the only docked
Component within this DockingPort, then this method
returns false since the layout cannot be rearranged. Otherwise,
this method returns true.
isDockingAllowed in interface DockingPortcomp - the Component whose docking availability is to be
checkedregion - the region to be checked for docking availability for the
specified Component.
true if docking is allowed for the specified
Component within the supplied region,
false otherwise.DockingPort.isDockingAllowed(Component, String),
DockingManager.isValidDockingRegion(String),
isParentDockingPort(Component)public String getRegion(Point location)
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 DockingPortlocation - the location within this DockingPort to examine for a
docking region.
DockingPort that contains
the specified PointgetRegionChecker(),
getDockableAt(Point),
Dockable.getComponent(),
RegionChecker.getRegion(Component, Point)public RegionChecker getRegionChecker()
RegionChecker currently used by this
DockingPort. This method retrieves the
DockingPortPropertySet instance for this DockingPort by
calling getDockingProperties(). It then returns by invoking
getRegionChecker() on the resolved DockingPortPropertySet.
RegionChecker currently used by this
DockingPort.getDockingProperties(),
DockingPortPropertySet.getRegionChecker()public Dockable getDockableAt(Point location)
Dockable located at the specified
Point. If location is null, or this
DockingPort is empty, then a null reference is returned.
If this DockingPort contains a split layout, then any nested
Dockables will be within a sub-DockingPort and not a
direct child of this DockingPort. Therefore, if
getDockedComponent() returns a JSplitPane, then this
method will return a null reference.
If this DockingPort contains a tabbed layout, then the
JTabbedPane returned by getDockedComponent() will be
checked for a Dockable at the specified Point.
location - the location within the DockingPort to test for a
Dockable.
Dockable located at the specified
Point.getDockedComponent(),
DockingManager.getDockable(Component),
Container.getComponentAt(int x, int y)public Component getComponent(String region)
Component currently docked within the specified
region.
If this DockingPort has either a single child Dockable or
a tabbed layout, then the supplied region must be CENTER_REGION
or this method will return a null reference. If there is a single
child Dockable, then this method will return the same
Component as returned by getDockedComponent(). If there
is a tabbed layout, then this method will return the Component in
the currently selected tab.
If this DockingPort has a split layout, then a check for
CENTER_REGION will return a null reference. For outer
regions (NORTH_REGION, SOUTH_REGION,
EAST_REGION, or WEST_REGION), the supplied region
parameter must match the o>
Containercomp - the component to be added
public Component add(Component comp,
int index)
add in class Containercomp - the component to be addedindex - the position at which to insert the component, or -1
to append the component to the end
public void add(Component comp,
Object constraints)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for this component
public void add(Component comp,
Object constraints,
int index)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for thisindex - the position in the container's list at which to insert the
component; -1 means insert at the end
public Component add(String name,
Component comp)
add in class Containername - the name of the Component to be added.comp - the Component to add.
public boolean isDockingAllowed(Component comp,
String region)
true if docking is allowed for the specified
Component within the supplied region, false
otherwise. It is important to note that success of a docking operation
relies on many factors and a return value of true from this
method does not necessarily guarantee that a call to dock() will
succeed. This method merely indicates that the current
DockingPort does not have any outstanding reason to block a
docking operation with respect to the specified Component and
region.
If comp is null or region is invalid according to
DockingManager.isValidDockingRegion(String region), then this
method returns false.
If this DockingPort is not already the parent DockingPort
for the specified Component, then this method returns
true.
If this DockingPort is already the parent DockingPort for
the specified Component, then a check is performed to see if
there is a tabbed layout. Tabbed layouts may contain multiple
Dockables, and thus the tab ordering may be rearranged, or
shifted into a split layout. If comp is the only docked
Component within this DockingPort, then this method
returns false since the layout cannot be rearranged. Otherwise,
this method returns true.
isDockingAllowed in interface DockingPortcomp - the Component whose docking availability is to be
checkedregion - the region to be checked for docking availability for the
specified Component.
true if docking is allowed for the specified
Component within the supplied region,
false otherwise.DockingPort.isDockingAllowed(Component, String),
DockingManager.isValidDockingRegion(String),
isParentDockingPort(Component)public String getRegion(Point location)
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 DockingPortlocation - the location within this DockingPort to examine for a
docking region.
DockingPort that contains
the specified PointgetRegionChecker(),
getDockableAt(Point),
Dockable.getComponent(),
RegionChecker.getRegion(Component, Point)public RegionChecker getRegionChecker()
RegionChecker currently used by this
DockingPort. This method retrieves the
DockingPortPropertySet instance for this DockingPort by
calling getDockingProperties(). It then returns by invoking
getRegionChecker() on the resolved DockingPortPropertySet.
RegionChecker currently used by this
DockingPort.getDockingProperties(),
DockingPortPropertySet.getRegionChecker()public Dockable getDockableAt(Point location)
Dockable located at the specified
Point. If location is null, or this
DockingPort is empty, then a null reference is returned.
If this DockingPort contains a split layout, then any nested
Dockables will be within a sub-DockingPort and not a
direct child of this DockingPort. Therefore, if
getDockedComponent() returns a JSplitPane, then this
method will return a null reference.
If this DockingPort contains a tabbed layout, then the
JTabbedPane returned by getDockedComponent() will be
checked for a Dockable at the specified Point.
location - the location within the DockingPort to test for a
Dockable.
Dockable located at the specified
Point.getDockedComponent(),
DockingManager.getDockable(Component),
Container.getComponentAt(int x, int y)public Component getComponent(String region)
Component currently docked within the specified
region.
If this DockingPort has either a single child Dockable or
a tabbed layout, then the supplied region must be CENTER_REGION
or this method will return a null reference. If there is a single
child Dockable, then this method will return the same
Component as returned by getDockedComponent(). If there
is a tabbed layout, then this method will return the Component in
the currently selected tab.
If this DockingPort has a split layout, then a check for
CENTER_REGION will return a null reference. For outer
regions (NORTH_REGION, SOUTH_REGION,
EAST_REGION, or WEST_REGION), the supplied region
parameter must match the o>
Containercomp - the component to be added
public Component add(Component comp,
int index)
add in class Containercomp - the component to be addedindex - the position at which to insert the component, or -1
to append the component to the end
public void add(Component comp,
Object constraints)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for this component
public void add(Component comp,
Object constraints,
int index)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for thisindex - the position in the container's list at which to insert the
component; -1 means insert at the end
public Component add(String name,
Component comp)
add in class Containername - the name of the Component to be added.comp - the Component to add.
public boolean isDockingAllowed(Component comp,
String region)
true if docking is allowed for the specified
Component within the supplied region, false
otherwise. It is important to note that success of a docking operation
relies on many factors and a return value of true from this
method does not necessarily guarantee that a call to dock() will
succeed. This method merely indicates that the current
DockingPort does not have any outstanding reason to block a
docking operation with respect to the specified Component and
region.
If comp is null or region is invalid according to
DockingManager.isValidDockingRegion(String region), then this
method returns false.
If this DockingPort is not already the parent DockingPort
for the specified Component, then this method returns
true.
If this DockingPort is already the parent DockingPort for
the specified Component, then a check is performed to see if
there is a tabbed layout. Tabbed layouts may contain multiple
Dockables, and thus the tab ordering may be rearranged, or
shifted into a split layout. If comp is the only docked
Component within this DockingPort, then this method
returns false since the layout cannot be rearranged. Otherwise,
this method returns true.
isDockingAllowed in interface DockingPortcomp - the Component whose docking availability is to be
checkedregion - the region to be checked for docking availability for the
specified Component.
true if docking is allowed for the specified
Component within the supplied region,
false otherwise.DockingPort.isDockingAllowed(Component, String),
DockingManager.isValidDockingRegion(String),
isParentDockingPort(Component)public String getRegion(Point location)
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 DockingPortlocation - the location within this DockingPort to examine for a
docking region.
DockingPort that contains
the specified PointgetRegionChecker(),
getDockableAt(Point),
Dockable.getComponent(),
RegionChecker.getRegion(Component, Point)public RegionChecker getRegionChecker()
RegionChecker currently used by this
DockingPort. This method retrieves the
DockingPortPropertySet instance for this DockingPort by
calling getDockingProperties(). It then returns by invoking
getRegionChecker() on the resolved DockingPortPropertySet.
RegionChecker currently used by this
DockingPort.getDockingProperties(),
DockingPortPropertySet.getRegionChecker()public Dockable getDockableAt(Point location)
Dockable located at the specified
Point. If location is null, or this
DockingPort is empty, then a null reference is returned.
If this DockingPort contains a split layout, then any nested
Dockables will be within a sub-DockingPort and not a
direct child of this DockingPort. Therefore, if
getDockedComponent() returns a JSplitPane, then this
method will return a null reference.
If this DockingPort contains a tabbed layout, then the
JTabbedPane returned by getDockedComponent() will be
checked for a Dockable at the specified Point.
location - the location within the DockingPort to test for a
Dockable.
Dockable located at the specified
Point.getDockedComponent(),
DockingManager.getDockable(Component),
Container.getComponentAt(int x, int y)public Component getComponent(String region)
Component currently docked within the specified
region.
If this DockingPort has either a single child Dockable or
a tabbed layout, then the supplied region must be CENTER_REGION
or this method will return a null reference. If there is a single
child Dockable, then this method will return the same
Component as returned by getDockedComponent(). If there
is a tabbed layout, then this method will return the Component in
the currently selected tab.
If this DockingPort has a split layout, then a check for
CENTER_REGION will return a null reference. For outer
regions (NORTH_REGION, SOUTH_REGION,
EAST_REGION, or WEST_REGION), the supplied region
parameter must match the o>
Containercomp - the component to be added
public Component add(Component comp,
int index)
add in class Containercomp - the component to be addedindex - the position at which to insert the component, or -1
to append the component to the end
public void add(Component comp,
Object constraints)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for this component
public void add(Component comp,
Object constraints,
int index)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for thisindex - the position in the container's list at which to insert the
component; -1 means insert at the end
public Component add(String name,
Component comp)
add in class Containername - the name of the Component to be added.comp - the Component to add.
public boolean isDockingAllowed(Component comp,
String region)
true if docking is allowed for the specified
Component within the supplied region, false
otherwise. It is important to note that success of a docking operation
relies on many factors and a return value of true from this
method does not necessarily guarantee that a call to dock() will
succeed. This method merely indicates that the current
DockingPort does not have any outstanding reason to block a
docking operation with respect to the specified Component and
region.
If comp is null or region is invalid according to
DockingManager.isValidDockingRegion(String region), then this
method returns false.
If this DockingPort is not already the parent DockingPort
for the specified Component, then this method returns
true.
If this DockingPort is already the parent DockingPort for
the specified Component, then a check is performed to see if
there is a tabbed layout. Tabbed layouts may contain multiple
Dockables, and thus the tab ordering may be rearranged, or
shifted into a split layout. If comp is the only docked
Component within this DockingPort, then this method
returns false since the layout cannot be rearranged. Otherwise,
this method returns true.
isDockingAllowed in interface DockingPortcomp - the Component whose docking availability is to be
checkedregion - the region to be checked for docking availability for the
specified Component.
true if docking is allowed for the specified
Component within the supplied region,
false otherwise.DockingPort.isDockingAllowed(Component, String),
DockingManager.isValidDockingRegion(String),
isParentDockingPort(Component)public String getRegion(Point location)
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 DockingPortlocation - the location within this DockingPort to examine for a
docking region.
DockingPort that contains
the specified PointgetRegionChecker(),
getDockableAt(Point),
Dockable.getComponent(),
RegionChecker.getRegion(Component, Point)public RegionChecker getRegionChecker()
RegionChecker currently used by this
DockingPort. This method retrieves the
DockingPortPropertySet instance for this DockingPort by
calling getDockingProperties(). It then returns by invoking
getRegionChecker() on the resolved DockingPortPropertySet.
RegionChecker currently used by this
DockingPort.getDockingProperties(),
DockingPortPropertySet.getRegionChecker()public Dockable getDockableAt(Point location)
Dockable located at the specified
Point. If location is null, or this
DockingPort is empty, then a null reference is returned.
If this DockingPort contains a split layout, then any nested
Dockables will be within a sub-DockingPort and not a
direct child of this DockingPort. Therefore, if
getDockedComponent() returns a JSplitPane, then this
method will return a null reference.
If this DockingPort contains a tabbed layout, then the
JTabbedPane returned by getDockedComponent() will be
checked for a Dockable at the specified Point.
location - the location within the DockingPort to test for a
Dockable.
Dockable located at the specified
Point.getDockedComponent(),
DockingManager.getDockable(Component),
Container.getComponentAt(int x, int y)public Component getComponent(String region)
Component currently docked within the specified
region.
If this DockingPort has either a single child Dockable or
a tabbed layout, then the supplied region must be CENTER_REGION
or this method will return a null reference. If there is a single
child Dockable, then this method will return the same
Component as returned by getDockedComponent(). If there
is a tabbed layout, then this method will return the Component in
the currently selected tab.
If this DockingPort has a split layout, then a check for
CENTER_REGION will return a null reference. For outer
regions (NORTH_REGION, SOUTH_REGION,
EAST_REGION, or WEST_REGION), the supplied region
parameter must match the o>
Containercomp - the component to be added
public Component add(Component comp,
int index)
add in class Containercomp - the component to be addedindex - the position at which to insert the component, or -1
to append the component to the end
public void add(Component comp,
Object constraints)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for this component
public void add(Component comp,
Object constraints,
int index)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for thisindex - the position in the container's list at which to insert the
component; -1 means insert at the end
public Component add(String name,
Component comp)
add in class Containername - the name of the Component to be added.comp - the Component to add.
public boolean isDockingAllowed(Component comp,
String region)
true if docking is allowed for the specified
Component within the supplied region, false
otherwise. It is important to note that success of a docking operation
relies on many factors and a return value of true from this
method does not necessarily guarantee that a call to dock() will
succeed. This method merely indicates that the current
DockingPort does not have any outstanding reason to block a
docking operation with respect to the specified Component and
region.
If comp is null or region is invalid according to
DockingManager.isValidDockingRegion(String region), then this
method returns false.
If this DockingPort is not already the parent DockingPort
for the specified Component, then this method returns
true.
If this DockingPort is already the parent DockingPort for
the specified Component, then a check is performed to see if
there is a tabbed layout. Tabbed layouts may contain multiple
Dockables, and thus the tab ordering may be rearranged, or
shifted into a split layout. If comp is the only docked
Component within this DockingPort, then this method
returns false since the layout cannot be rearranged. Otherwise,
this method returns true.
isDockingAllowed in interface DockingPortcomp - the Component whose docking availability is to be
checkedregion - the region to be checked for docking availability for the
specified Component.
true if docking is allowed for the specified
Component within the supplied region,
false otherwise.DockingPort.isDockingAllowed(Component, String),
DockingManager.isValidDockingRegion(String),
isParentDockingPort(Component)public String getRegion(Point location)
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 DockingPortlocation - the location within this DockingPort to examine for a
docking region.
DockingPort that contains
the specified PointgetRegionChecker(),
getDockableAt(Point),
Dockable.getComponent(),
RegionChecker.getRegion(Component, Point)public RegionChecker getRegionChecker()
RegionChecker currently used by this
DockingPort. This method retrieves the
DockingPortPropertySet instance for this DockingPort by
calling getDockingProperties(). It then returns by invoking
getRegionChecker() on the resolved DockingPortPropertySet.
RegionChecker currently used by this
DockingPort.getDockingProperties(),
DockingPortPropertySet.getRegionChecker()public Dockable getDockableAt(Point location)
Dockable located at the specified
Point. If location is null, or this
DockingPort is empty, then a null reference is returned.
If this DockingPort contains a split layout, then any nested
Dockables will be within a sub-DockingPort and not a
direct child of this DockingPort. Therefore, if
getDockedComponent() returns a JSplitPane, then this
method will return a null reference.
If this DockingPort contains a tabbed layout, then the
JTabbedPane returned by getDockedComponent() will be
checked for a Dockable at the specified Point.
location - the location within the DockingPort to test for a
Dockable.
Dockable located at the specified
Point.getDockedComponent(),
DockingManager.getDockable(Component),
Container.getComponentAt(int x, int y)public Component getComponent(String region)
Component currently docked within the specified
region.
If this DockingPort has either a single child Dockable or
a tabbed layout, then the supplied region must be CENTER_REGION
or this method will return a null reference. If there is a single
child Dockable, then this method will return the same
Component as returned by getDockedComponent(). If there
is a tabbed layout, then this method will return the Component in
the currently selected tab.
If this DockingPort has a split layout, then a check for
CENTER_REGION will return a null reference. For outer
regions (NORTH_REGION, SOUTH_REGION,
EAST_REGION, or WEST_REGION), the supplied region
parameter must match the o>
Containercomp - the component to be added
public Component add(Component comp,
int index)
add in class Containercomp - the component to be addedindex - the position at which to insert the component, or -1
to append the component to the end
public void add(Component comp,
Object constraints)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for this component
public void add(Component comp,
Object constraints,
int index)
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for thisindex - the position in the container's list at which to insert the
component; -1 means insert at the end
public Component add(String name,
Component comp)
add in class Containername - the name of the Component to be added.comp - the Component to add.
public boolean isDockingAllowed(Component comp,
String region)
true if docking is allowed for the specified
Component within the supplied region, false
otherwise. It is important to note that success of a docking operation
relies on many factors and a return value of true from this
method does not necessarily guarantee that a call to dock() will
succeed. This method merely indicates that the current
DockingPort does not have any outstanding reason to block a
docking operation with respect to the specified Component and
region.
If comp is null or region is invalid according to
DockingManager.isValidDockingRegion(String region), then this
method returns false.
If this DockingPort is not already the parent DockingPort
for the specified Component, then this method returns
true.
If this DockingPort is already the parent DockingPort for
the specified Component, then a check is performed to see if
there is a tabbed layout. Tabbed layouts may contain multiple
Dockables, and thus the tab ordering may be rearranged, or
shifted into a split layout. If comp is the only docked
Component within this DockingPort, then this method
returns false since the layout cannot be rearranged. Otherwise,
this method returns true.
isDockingAllowed in interface DockingPortcomp - the Component whose docking availability is to be
checkedregion - the region to be checked for docking availability for the
specified Component.
true if docking is allowed for the specified
Component within the supplied region,
false otherwise.DockingPort.isDockingAllowed(Component, String),
DockingManager.isValidDockingRegion(String),
isParentDockingPort(Component)public String getRegion(Point location)
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