|
|||||||||
| 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
org.flexdock.view.View
public class View
The View class is slightly incompatible with JComponent.
Similar to JFC/Swing top-level containers, a View contains only a
content pane Container and a Titlebar. The content pane
should contain all the components displayed by the View. As a
convenience add and its variants, remove(Component) and
setLayout have been overridden to forward to the
contentPane as necessary. This means you can write:
view.add(child);And the child will be added to the contentPane. The content pane will always be non-null. Attempting to set it to null will cause the View to throw an exception. The default content pane will not have a layout manager set.
JFrame,
JRootPane,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
View.ViewLayout
|
| 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 Container |
contentPane
|
protected boolean |
contentPaneCheckingEnabled
|
protected ArrayList |
dockingListeners
|
protected ArrayList |
dragSources
|
protected HashSet |
frameDragSources
|
protected Titlebar |
titlepane
|
static String |
uiClassID
|
| 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.Dockable |
|---|
DOCKABLE_INDICATOR |
| 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 | |
|---|---|
View(String persistentId)
|
|
View(String persistentId,
String title)
|
|
View(String persistentId,
String title,
String tabText)
|
|
| Method Summary | |
|---|---|
void |
addAction(Action action)
|
void |
addAction(String action)
|
void |
addDockingListener(DockingListener listener)
|
protected void |
addImpl(Component comp,
Object constraints,
int index)
|
protected Container |
createContentPane()
|
protected LayoutManager |
createLayout()
|
protected Titlebar |
createTitlebar()
|
boolean |
dock(Dockable dockable)
Implements the semantics for docking an external Dockable to this
Dockable and returns a boolean indicating whether or not
the docking operation was successful. |
boolean |
dock(Dockable dockable,
String relativeRegion)
Implements the semantics for docking an external Dockable to the
specified region of this Dockable and returns a boolean
indicating whether or not the docking operation was successful. |
boolean |
dock(Dockable dockable,
String relativeRegion,
float ratio)
Implements the semantics for docking an external Dockable to the
specified region of this Dockable with the specified layout
ratio, returning a boolean indicating whether or not the docking
operation was successful. |
void |
dockingCanceled(DockingEvent evt)
Fired when docking of a Dockable is canceled during the operation. |
void |
dockingComplete(DockingEvent evt)
Fired when docking of a Dockable has completed. |
void |
dragStarted(DockingEvent evt)
Fired when the dragging of a Dockable has begun. |
void |
dropStarted(DockingEvent evt)
Fired when the dropping of a Dockable has begun at the release
of a drag-operation. |
AbstractButton |
getActionButton(String actionName)
|
Component |
getComponent()
Returns the Component that is to be dragged and docked. |
Container |
getContentPane()
|
DockingListener[] |
getDockingListeners()
|
DockingPort |
getDockingPort()
Returns the DockingPort within which this Dockable is currently docked. |
DockablePropertySet |
getDockingProperties()
Returns a DockablePropertySet instance associated with this
Dockable. |
List |
getDragSources()
Returns a List of the Components that are event sources
for drag operations. |
Set |
getFrameDragSources()
Returns a Set of the Components that are used as frame
drag sources. |
static View |
getInstance(String viewId)
|
int |
getMinimizedConstraint()
|
String |
getPersistentId()
Returns a String identifier that is unique within a JVM instance,
but persistent across JVM instances. |
protected String |
getPreferredTitlebarUIName()
|
Dockable |
getSibling(String region)
|
Icon |
getTabIcon()
|
String |
getTabText()
|
String |
getTitle()
|
Titlebar |
getTitlebar()
|
protected Component |
getTitlePane()
|
String |
getUIClassID()
|
Viewport |
getViewport()
|
ViewProps |
getViewProperties()
|
boolean |
isActionBlocked(String actionName)
|
boolean |
isActive()
|
boolean |
isActiveStateLocked()
|
protected boolean |
isContentPaneCheckingEnabled()
|
boolean |
isFloating()
|
boolean |
isMinimized()
|
boolean |
isTerritoryBlocked(Dockable dockable,
String region)
|
protected String |
paramString()
|
void |
remove(Component comp)
|
void |
removeDockingListener(DockingListener listener)
|
void |
setActionBlocked(String actionName,
boolean blocked)
|
void |
setActive(boolean b)
|
void |
setActiveStateLocked(boolean b)
|
void |
setContentPane(Container c)
Sets the content pane for this view. |
protected void |
setContentPaneCheckingEnabled(boolean contentPaneCheckingEnabled)
|
void |
setIcon(Icon icon)
|
void |
setIcon(String imgUri)
|
void |
setLayout(LayoutManager manager)
Sets the LayoutManager. |
void |
setTabIcon(Icon icon)
|
void |
setTabText(String tabText)
|
void |
setTerritoryBlocked(String region,
boolean blocked)
|
void |
setTitle(String title)
|
void |
setTitle(String title,
boolean alsoTabText)
|
void |
setTitlebar(Titlebar titlebar)
|
void |
undockingComplete(DockingEvent evt)
|
void |
undockingStarted(DockingEvent evt)
|
void |
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.Dockable |
|---|
addPropertyChangeListener, getClientProperty, putClientProperty, removePropertyChangeListener |
| Field Detail |
|---|
public static final String uiClassID
protected Titlebar titlepane
protected Container contentPane
protected boolean contentPaneCheckingEnabled
protected ArrayList dockingListeners
protected ArrayList dragSources
protected HashSet frameDragSources
| Constructor Detail |
|---|
public View(String persistentId)
public View(String persistentId,
String title)
public View(String persistentId,
String title,
String tabText)
| Method Detail |
|---|
public static View getInstance(String viewId)
protected Container createContentPane()
protected LayoutManager createLayout()
protected Titlebar createTitlebar()
public Container getContentPane()
public Titlebar getTitlebar()
public DockablePropertySet getDockingProperties()
DockableDockablePropertySet instance associated with this
Dockable. Developers implementing the Dockable interface
may or may not choose to provide their own DockablePropertySet
implementation for use with this method. A default implementation is
supplied by the framework and most Dockable implementations,
including all implementations provided by the framework, will return the
default DockablePropertySet via a call to
org.flexdock.docking.props.PropertyManager. Developers are
encouraged to take advantage of this by calling
PropertyManager.getDockablePropertySet(this).
getDockingProperties in interface DockableDockablePropertySet associated with this
Dockable This method may not return a null
reference.DockablePropertySet,
PropertyManager.getDockablePropertySet(Dockable)public ViewProps getViewProperties()
public void addAction(Action action)
public void addAction(String action)
public void setIcon(Icon icon)
public void setIcon(String imgUri)
public void setContentPane(Container c)
throws IllegalArgumentException
c - the container to use as the content pane.
IllegalArgumentException - if c is null or if c is the
titlepane.titlepane,
getTitlePane()protected String getPreferredTitlebarUIName()
public void setTitlebar(Titlebar titlebar)
protected Component getTitlePane()
public void setTitle(String title)
public void setTitle(String title,
boolean alsoTabText)
public String getTitle()
public void updateUI()
updateUI in class JComponentpublic String getUIClassID()
getUIClassID in class JComponent
protected void addImpl(Component comp,
Object constraints,
int index)
addImpl in class Containerpublic void remove(Component comp)
remove in class Containerpublic AbstractButton getActionButton(String actionName)
public Component getComponent()
DockablegetDragSources().
The framework performs indexing on the underlying Component.
Consequently, this method may not return a null
reference.
getComponent in interface Dockablepublic List getDragSources()
DockableList of the Components that are event sources
for drag operations. The list may or may not include the Component
returned by getComponent().
getDragSources in interface Dockablepublic Set getFrameDragSources()
DockableSet of the Components that are used as frame
drag sources. When a Dockable is floated into an external frame,
that frame may or may not have a titlebar for repositioning. The
Components returned by this method will be setup with appropriate event
listeners such that dragging them will serve to reposition the containing
frame as if they were the frame titlebar. If a Component exists in both
the Set returned by this method and the List returned by
getDragSources(), the "frame reposition" behavior will supercede
any "drag-to-dock" behavior while the Dockable is in a floating state.
getFrameDragSources in interface Dockablepublic String getPersistentId()
DockableString identifier that is unique within a JVM instance,
but persistent across JVM instances. This is used for configuration
mangement, allowing the JVM to recognize a Dockable instance
within an application instance, persist the ID, and recall it in later
application instances. The ID should be unique within an appliation
instance so that there are no collisions with other Dockable
instances, but it should also be consistent from JVM to JVM so that the
association between a Dockable instance and its ID can be
remembered from session to session.
The framework performs indexing on the persistent ID. Consequently, this
method may not return a null reference.
getPersistentId in interface Dockable
public boolean isTerritoryBlocked(Dockable dockable,
String region)
public void setTerritoryBlocked(String region,
boolean blocked)
public String getTabText()
public void setTabText(String tabText)
public Icon getTabIcon()
public void setTabIcon(Icon icon)
public boolean dock(Dockable dockable)
DockableDockable to this
Dockable and returns a boolean indicating whether or not
the docking operation was successful. The framework already
provides a default implementation for this method through
DockingManager.dock(Dockable dockable, Dockable parent). While
users are free to provide their own implementation for this method, the
recommended approach is to use the default implementation with the
following line:
return DockingManager.dock(dockable, this);
dock in interface Dockabledockable - the Dockable to dock relative to this Dockable
true if the docking operation was successful;
false otherwise.Dockable.dock(Dockable, String),
Dockable.dock(Dockable, String, float),
DockingManager.dock(Dockable, Dockable)public DockingPort getDockingPort()
Dockable
getDockingPort in interface Dockablenull if the
dockable is not currently docked (i.e. in the middle of a drag
operation).public Dockable getSibling(String region)
public Viewport getViewport()
public boolean dock(Dockable dockable,
String relativeRegion)
DockableDockable to the
specified region of this Dockable and returns a boolean
indicating whether or not the docking operation was successful. If the
docking operation results in a split layout, this method should determine
an appropriate ratio of available space to allot to the new sibling
Dockable. The framework already provides a default
implementation for this method through
DockingManager.dock(Dockable dockable, Dockable parent, String region).
While users are free to provide their own implementation for this method,
the recommended approach is to use the default implementation with the
following line:
return DockingManager.dock(dockable, this, relativeRegion);
dock in interface Dockabledockable - the Dockable to dock relative to this DockablerelativeRegion - the docking region into which to dock the specified
Dockable
true if the docking operation was successful;
false otherwise.Dockable.dock(Dockable, String, float),
DockingManager.dock(Dockable, Dockable, String)
public boolean dock(Dockable dockable,
String relativeRegion,
float ratio)
DockableDockable to the
specified region of this Dockable with the specified layout
ratio, returning a boolean indicating whether or not the docking
operation was successful. If the docking operation results in a split
layout, this method should use the specified ratio to determine
the amount of available space to allot to the new sibling
Dockable.
The framework already provides a default implementation for this method
through
DockingManager.dock(Dockable dockable, Dockable parent, String region, float proportion).
While users are free to provide their own implementation for this method,
the recommended approach is to use the default implementation with the
following line:
return DockingManager.dock(dockable, this, relativeRegion, ratio);
dock in interface Dockabledockable - the Dockable to dock relative to this DockablerelativeRegion - the docking region into which to dock the specified
Dockableratio - the proportion of available space in the resulting layout to
allot to the new sibling Dockable.
true if the docking operation was successful;
false otherwise.DockingManager.dock(Dockable, Dockable, String, float)public void setActive(boolean b)
public boolean isActive()
public void setActiveStateLocked(boolean b)
public boolean isActiveStateLocked()
public boolean isMinimized()
public int getMinimizedConstraint()
public void addDockingListener(DockingListener listener)
addDockingListener in interface DockingMonitorpublic DockingListener[] getDockingListeners()
getDockingListeners in interface DockingMonitorpublic void removeDockingListener(DockingListener listener)
removeDockingListener in interface DockingMonitorpublic void dockingCanceled(DockingEvent evt)
DockingListenerDockable is canceled during the operation.
dockingCanceled in interface DockingListenerevt - the DockingEvent event which provides the
source Dockable, the old DockingPort and the new DockingPortpublic void dockingComplete(DockingEvent evt)
DockingListenerDockable has completed.
dockingComplete in interface DockingListenerevt - the DockingEvent event which provides the
source Dockable, the old DockingPort and the new DockingPortpublic void dragStarted(DockingEvent evt)
DockingListenerDockable has begun.
dragStarted in interface DockingListenerevt - the DockingEvent event which provides the
source Dockable, the old DockingPort and the new DockingPortpublic void dropStarted(DockingEvent evt)
DockingListenerDockable has begun at the release
of a drag-operation.
dropStarted in interface DockingListenerevt - the DockingEvent event which provides the
source Dockable, the old DockingPort and the new DockingPortpublic void undockingComplete(DockingEvent evt)
undockingComplete in interface DockingListenerpublic void undockingStarted(DockingEvent evt)
undockingStarted in interface DockingListener
public void setActionBlocked(String actionName,
boolean blocked)
public boolean isActionBlocked(String actionName)
public boolean isFloating()
protected String paramString()
paramString in class JComponentprotected boolean isContentPaneCheckingEnabled()
protected void setContentPaneCheckingEnabled(boolean contentPaneCheckingEnabled)
contentPaneCheckingEnabled - the contentPaneCheckingEnabled to setpublic void setLayout(LayoutManager manager)
LayoutManager. Overridden to conditionally
forward the call to the contentPane.
setLayout in class Containermanager - the LayoutManagersetContentPaneCheckingEnabled(boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||