|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.jgraph.utils.gui.PositionManager
public class PositionManager
Field Summary | |
---|---|
protected static java.util.Vector |
containers
vector with all registered containers |
protected static java.lang.String |
DIVIDER_LOCATION
Key suffix for the Registry to save and load the dividerlocation for the JSplitPane |
protected static java.lang.String |
FRAME_HEIGHT
Key suffix for the Registry to save and load the frame height for the component |
protected static java.lang.String |
FRAME_STATE
Key suffix for the Registry to save and load the frame state for the component |
protected static java.lang.String |
FRAME_WIDTH
Key suffix for the Registry to save and load the frame width for the component |
protected static java.lang.String |
FRAME_X
Key suffix for the Registry to save and load the frame x position for the component |
protected static java.lang.String |
FRAME_Y
Key suffix for the Registry to save and load the frame y position for the component |
protected static net.clackrouter.jgraph.utils.gui.PosComponentListener |
posComponentListener
we only need one adapter for all components |
protected static net.clackrouter.jgraph.utils.gui.PosPropertyChangeListener |
posPropertyChangeListener
We only need one listener for all split panes. |
Constructor Summary | |
---|---|
PositionManager()
|
Method Summary | |
---|---|
static void |
addComponent(java.awt.Component comp)
Adds a component to the control of the position manager. |
static int |
getIntPos(java.awt.Component comp,
java.lang.String extension,
int defaultValue)
Returns an int value from the preferences. |
static java.lang.String |
getKey(java.awt.Component comp)
Gets the key for the component. |
static java.util.prefs.Preferences |
getPreferences()
Returns the Preferences Node which can use for position storings. |
static void |
main(java.lang.String[] args)
Implements a test case |
static void |
removeComponent(java.awt.Component comp)
Removes a component from the control of the position manager. |
static void |
setIntPos(java.awt.Component comp,
java.lang.String extension,
int value)
Sets a value for the component. |
static void |
updateComponent(java.awt.Component comp)
The method reads the old position values and sets them to the component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String FRAME_WIDTH
protected static final java.lang.String FRAME_HEIGHT
protected static final java.lang.String FRAME_STATE
protected static final java.lang.String FRAME_X
protected static final java.lang.String FRAME_Y
protected static final java.lang.String DIVIDER_LOCATION
protected static java.util.Vector containers
protected static net.clackrouter.jgraph.utils.gui.PosComponentListener posComponentListener
protected static net.clackrouter.jgraph.utils.gui.PosPropertyChangeListener posPropertyChangeListener
Constructor Detail |
---|
public PositionManager()
Method Detail |
---|
public static void addComponent(java.awt.Component comp)
JFrame f = new JFrame(); PositionManager.addContainer(f); f.setVisible(true);Adds the needed listeners at the component. Before the addition the method reads the old position values and sets them to the component. If the method can't find old values then the method will try to get the screen size and will set 2/3 % from the screen size to the frame. If there is no availabe screen size the method uses the 400 x 600 dimensions. Currently we a support for the following components
Window
JInternalFrame
JSplitPane
comp
- the concerning componentpublic static void updateComponent(java.awt.Component comp)
Window
JInternalFrame
JSplitPane
comp
- the concerning containerpublic static void removeComponent(java.awt.Component comp)
public static void setIntPos(java.awt.Component comp, java.lang.String extension, int value)
getIntPos(Component, String, int)
method, you will get back the value.
comp
- the componentpublic static java.lang.String getKey(java.awt.Component comp)
comp
- public static java.util.prefs.Preferences getPreferences()
public static int getIntPos(java.awt.Component comp, java.lang.String extension, int defaultValue)
comp
- the componentextension
- a value to save different values for the componentdefaultValue
- the default value
setIntPos(Component, String, int)
public static void main(java.lang.String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |