Skip to content

Commit be34703

Browse files
committed
Divider positioning
Sort so that when you switch to Offline task mode, the divider in the bottom of the screen is in the middle, not jammed up on one edge.
1 parent ee7e636 commit be34703

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

src/pambatch/config/BatchParameters.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public class BatchParameters implements Serializable, Cloneable{
5353

5454
private HashMap<String, TaskSelection> offlineTasks = new HashMap<>();
5555

56+
// count of offline task selections in display. Needed to set
57+
public int offlineViewCount = 0;
58+
5659
// /**
5760
// * List of datasets to hit with this process.
5861
// */

src/pambatch/swing/BatchTabPanel.java

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public class BatchTabPanel implements PamTabPanel, SettingsObserver {
4343
private PamPanel southPanel;
4444

4545
private SplitPanePositioner southPositioner;
46+
47+
// private int offlineViewCount = 0;
4648

4749
public BatchTabPanel(BatchControl batchControl) {
4850
this.batchControl = batchControl;
@@ -119,15 +121,23 @@ private void layoutPanels() {
119121
// southSplitPane.add(splitSouthN);
120122
// southSplitPane.add(splitSouthS);//
121123
southPanel.invalidate();
122-
// SwingUtilities.invokeLater(new Runnable() {
123-
// not needed since all handled at construction time.
124-
// @Override
125-
// public void run() {
126-
// if (southPositioner != null) {
127-
//// southSplitPane.setDividerLocation(southPositioner.);
128-
// }
129-
// }
130-
// });
124+
125+
// int sDiv = southSplitPane.getDividerLocation();
126+
// System.out.println("Divider at " + sDiv + " of " + southSplitPane.getHeight());
127+
if (batchControl.getBatchParameters().offlineViewCount == 0) {
128+
batchControl.getBatchParameters().offlineViewCount++;
129+
SwingUtilities.invokeLater(new Runnable() {
130+
// not needed since all handled at construction time.
131+
@Override
132+
public void run() {
133+
// if (southPositioner != null) {
134+
southSplitPane.setDividerLocation(southPanel.getHeight()/2);
135+
int sDiv = southSplitPane.getDividerLocation();
136+
// System.out.println("Swing Divider at " + sDiv + " of " + southSplitPane.getHeight());
137+
// }
138+
}
139+
});
140+
}
131141
}
132142
}
133143

0 commit comments

Comments
 (0)