|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.generic.dndTabs.DnDTabPos
public class DnDTabPos
Class to remember position of a DnDTabPane. This class provides a reusable mechanism to remember the relative position of a DnDTabPane. This information is handy in the following cases:
Field Summary | |
---|---|
private java.util.ArrayList<DnDTabbedPane.Location> |
path
Vector to maintain path from center pane to the desired position of a tab. |
(package private) javax.swing.Icon |
prevIcon
The icon (if any) to be used for the tab. |
(package private) java.lang.String |
prevName
The name for the tab when its position is restored. |
(package private) java.awt.Dimension |
prevSize
The preferred width / height of the tab. |
(package private) boolean |
visible
An additional boolean to track if window is visible. |
Constructor Summary | |
---|---|
DnDTabPos()
The default constructor. |
Method Summary | |
---|---|
protected java.awt.Component |
getPosition(java.awt.Component permTab,
DnDTabbedPane.Location[] direction)
Traverse saved position information as much as possible. |
boolean |
isVisible()
Determine the visibility information in this tab. |
void |
restorePosition(java.awt.Container desktop,
java.awt.Component tab)
Primary interface to restore position of a tab. |
private void |
saveInfo(DnDTabbedPane owner,
java.awt.Component tab)
Helper method to save information about the given tab. |
(package private) boolean |
savePosition(java.awt.Component currWin,
java.awt.Component tab)
Recursive helper method to save relative position. |
boolean |
savePosition(java.awt.Container desktop,
java.awt.Component tab)
Method to save the relative position of a given child window. |
void |
setInfo(javax.swing.Icon icon,
java.lang.String name,
java.awt.Dimension size)
Set initial information for restoring a window. |
void |
setVisible(boolean visible)
Set the visibility information in this tab. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.lang.String prevName
javax.swing.Icon prevIcon
java.awt.Dimension prevSize
boolean visible
private java.util.ArrayList<DnDTabbedPane.Location> path
Constructor Detail |
---|
public DnDTabPos()
Method Detail |
---|
public boolean isVisible()
public void setVisible(boolean visible)
visible
- If this parameter is true then the window is assumed to be
visible. Otherwise the window is assumed to be hidden.public void setInfo(javax.swing.Icon icon, java.lang.String name, java.awt.Dimension size)
icon
- The icon to be used when restoring a window using this object.name
- The name of the tab to be used when restoring a window using
this object.size
- The preferred size of the window when restoring.public boolean savePosition(java.awt.Container desktop, java.awt.Component tab)
desktop
- The central desktop that contains all the panels including
the permanent panel. The same panel should be used when
restoring the window's position via the restorePosition() method.tab
- The tab (or child window) whose relative position must
determined and remembered by this class.
boolean savePosition(java.awt.Component currWin, java.awt.Component tab)
currWin
- The current window (may it be a DndTabPanel or a
wxSplitWindow) from where the search for tab must proceed.tab
- The actual window that we are searching for.
private void saveInfo(DnDTabbedPane owner, java.awt.Component tab)
owner
- The owner tab panel from where the information about the child
tab is to be saved.tab
- The child tab whose information is to be saved.public void restorePosition(java.awt.Container desktop, java.awt.Component tab)
desktop
- The central desktop that contains all the panels including
the permanent panel. The same panel should be used when
saving the window's position via the savePosition() method.tab
- The component whose position is to be restored.protected java.awt.Component getPosition(java.awt.Component permTab, DnDTabbedPane.Location[] direction)
permTab
- The top-level permanent tab within which the position
is to be determined.direction
- The last direction that was effectively traversed
using the saved position information is set as the first element in
this array. The caller must allocate this array to contain at least 1
element.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |