|
Gridarta Editor
|
A JSplitPane that keeps its size even upon ancestor layout changes and is restored upon editor restarts. More...
Inheritance diagram for net.sf.gridarta.gui.utils.GSplitPane:
Collaboration diagram for net.sf.gridarta.gui.utils.GSplitPane:Public Member Functions | |
| GSplitPane (final int newOrientation, @NotNull final Component newLeftComponent, @NotNull final Component newRightComponent, @NotNull final String preferencesKey, final int defaultDividerLocation) | |
| Create a new GSplitPane. More... | |
| void | saveLocation () |
| Saves the current divider location into the preferences. More... | |
| void | setDividerLocation (final int location) |
Private Member Functions | |
| int | getState (final int dividerLocation) |
| Returns the minimized/maximized state for a given divider location. More... | |
Private Attributes | |
| final List< ActionListener > | actionListeners = new ArrayList<>() |
| The ActionListeners attached to the "oneTouchExpandable" buttons of the JSplitPane. More... | |
| final String | defaultDividerLocation |
| The default divider location. More... | |
| final HierarchyListener | hierarchyListener |
| The HierarchyListener for updating the initial divider location. More... | |
| final String | preferencesKey |
| The preferences key for restoring the divider location. More... | |
Static Private Attributes | |
| static final String | MAX = "max" |
| The preferences value for a maximized divider. More... | |
| static final String | MIN = "min" |
| The preferences value for a minimized divider. More... | |
| static final Preferences | PREFERENCES = Preferences.userNodeForPackage(MainControl.class) |
| The preferences. More... | |
| static final long | serialVersionUID = 1L |
| Serial Version UID. More... | |
A JSplitPane that keeps its size even upon ancestor layout changes and is restored upon editor restarts.
The minimized or maximized state of the oneTouchExpandable buttons cannot be set programatically. Therefore calling JSplitPane#setDividerLocation(int) does not work reliably. This class attempts to set the minimized/maximized state by calling the ActionListeners attached to these buttons.
Definition at line 50 of file GSplitPane.java.
| net.sf.gridarta.gui.utils.GSplitPane.GSplitPane | ( | final int | newOrientation, |
| @NotNull final Component | newLeftComponent, | ||
| @NotNull final Component | newRightComponent, | ||
| @NotNull final String | preferencesKey, | ||
| final int | defaultDividerLocation | ||
| ) |
Create a new GSplitPane.
| newOrientation | JSplitPane#HORIZONTAL_SPLIT or JSplitPane#VERTICAL_SPLIT. |
| newLeftComponent | the Component that will appear on the left of a horizontally-split pane, or at the top of a vertically-split pane |
| newRightComponent | the Component that will appear on the right of a horizontally-split pane, or at the bottom of a vertically-split pane |
| preferencesKey | the preferences key for restoring the divider location |
| defaultDividerLocation | the default divider location in case none has been saved; -1 |
Definition at line 143 of file GSplitPane.java.
References net.sf.gridarta.gui.utils.GSplitPane.preferencesKey.
|
private |
Returns the minimized/maximized state for a given divider location.
| dividerLocation | the divider location to get the state of |
Definition at line 246 of file GSplitPane.java.
Referenced by net.sf.gridarta.gui.utils.GSplitPane.saveLocation(), and net.sf.gridarta.gui.utils.GSplitPane.setDividerLocation().
Here is the caller graph for this function:| void net.sf.gridarta.gui.utils.GSplitPane.saveLocation | ( | ) |
Saves the current divider location into the preferences.
Definition at line 211 of file GSplitPane.java.
References net.sf.gridarta.gui.utils.GSplitPane.getState(), net.sf.gridarta.gui.utils.GSplitPane.MAX, and net.sf.gridarta.gui.utils.GSplitPane.MIN.
Referenced by net.sf.gridarta.gui.utils.GSplitPaneTestApplication.main().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.gui.utils.GSplitPane.setDividerLocation | ( | final int | location | ) |
Definition at line 233 of file GSplitPane.java.
References net.sf.gridarta.gui.utils.GSplitPane.getState().
Here is the call graph for this function:
|
private |
The ActionListeners attached to the "oneTouchExpandable" buttons of the JSplitPane.
The size if either two or zero; zero if no action listeners could be found. If action listener have been found, index
is the minimize button, index
is the maximize button.
Definition at line 89 of file GSplitPane.java.
|
private |
The default divider location.
Set to
to not change the divider location.
Definition at line 96 of file GSplitPane.java.
|
private |
The HierarchyListener for updating the initial divider location.
Definition at line 102 of file GSplitPane.java.
|
staticprivate |
The preferences value for a maximized divider.
Definition at line 62 of file GSplitPane.java.
Referenced by net.sf.gridarta.gui.utils.GSplitPane.saveLocation().
|
staticprivate |
The preferences value for a minimized divider.
Definition at line 56 of file GSplitPane.java.
Referenced by net.sf.gridarta.gui.utils.GSplitPane.saveLocation().
|
staticprivate |
The preferences.
Definition at line 73 of file GSplitPane.java.
|
private |
The preferences key for restoring the divider location.
Definition at line 79 of file GSplitPane.java.
Referenced by net.sf.gridarta.gui.utils.GSplitPane.GSplitPane().
|
staticprivate |
Serial Version UID.
Definition at line 67 of file GSplitPane.java.