d2d pane update to use either 5 or zero (full screen)
This commit is contained in:
parent
3a3f36c4fa
commit
785f28b765
3 changed files with 31 additions and 29 deletions
|
@ -200,10 +200,10 @@
|
|||
</command>
|
||||
<command
|
||||
commandId="com.raytheon.uf.viz.d2d.ui.actions.changeD2DLayout"
|
||||
label="Three Pane Layout">
|
||||
label="Full Layout">
|
||||
<parameter
|
||||
name="sideViews"
|
||||
value="2">
|
||||
value="0">
|
||||
</parameter>
|
||||
</command>
|
||||
<separator
|
||||
|
@ -543,10 +543,10 @@
|
|||
<command
|
||||
commandId="com.raytheon.uf.viz.d2d.ui.actions.changeD2DLayout"
|
||||
icon="icons/3-pane.gif"
|
||||
label="Three Pane Layout">
|
||||
label="Full Layout">
|
||||
<parameter
|
||||
name="sideViews"
|
||||
value="2">
|
||||
value="0">
|
||||
</parameter>
|
||||
<visibleWhen>
|
||||
<reference
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ChangeD2DLayoutAction extends AbstractHandler {
|
|||
public static int getViewCount() {
|
||||
Integer views = viewMap.get(PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow());
|
||||
return views != null ? views : 4;
|
||||
return views;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -71,7 +71,7 @@ public class ChangeD2DLayoutAction extends AbstractHandler {
|
|||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
String sideViews = event.getParameter("sideViews");
|
||||
if (sideViews != null) {
|
||||
//if (sideViews != null) {
|
||||
int numViews = Integer.parseInt(sideViews);
|
||||
IWorkbenchWindow window = PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow();
|
||||
|
@ -91,7 +91,7 @@ public class ChangeD2DLayoutAction extends AbstractHandler {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
// get current map editor, if non existent create one.
|
||||
IDisplayPaneContainer part = EditorUtil.getActiveVizContainer();
|
||||
|
|
|
@ -65,10 +65,10 @@ public class D2D5Pane implements IPerspectiveFactory {
|
|||
private static final String BASE_VIEW_ID_PREFIX = SideView.ID
|
||||
+ UiUtil.SECONDARY_ID_SEPARATOR + "sideView";
|
||||
|
||||
private static final float THREE_PANE_WIDTH = 0.4f;
|
||||
|
||||
private static final float FIVE_PANE_WIDTH = 0.2f;
|
||||
|
||||
private static final float ZERO_PANE_WIDTH = 0.0f;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -93,31 +93,33 @@ public class D2D5Pane implements IPerspectiveFactory {
|
|||
}
|
||||
}
|
||||
|
||||
int numViews = ChangeD2DLayoutAction.getViewCount() == 2 ? 2
|
||||
int numViews = ChangeD2DLayoutAction.getViewCount() == 0 ? 0
|
||||
: baseViewsToAdd.size();
|
||||
|
||||
String lastAdded = null;
|
||||
|
||||
Collections.sort(baseViewsToAdd);
|
||||
|
||||
for (int i = 0; i < baseViewsToAdd.size(); ++i) {
|
||||
String baseView = baseViewsToAdd.get(i);
|
||||
if (baseViewsToAdd.contains(baseView)) {
|
||||
if (lastAdded == null) {
|
||||
layout.addStandaloneView(
|
||||
baseView,
|
||||
false,
|
||||
IPageLayout.LEFT,
|
||||
ChangeD2DLayoutAction.getViewCount() == 2 ? THREE_PANE_WIDTH
|
||||
: FIVE_PANE_WIDTH, editorArea);
|
||||
} else {
|
||||
layout.addStandaloneView(baseView, false,
|
||||
IPageLayout.BOTTOM, (i >= numViews) ? 1.0f
|
||||
: 1.0f / (numViews - i + 1), lastAdded);
|
||||
}
|
||||
lastAdded = baseView;
|
||||
addedViews.add(lastAdded);
|
||||
}
|
||||
if (numViews > 0) {
|
||||
for (int i = 0; i < baseViewsToAdd.size(); ++i) {
|
||||
String baseView = baseViewsToAdd.get(i);
|
||||
if (baseViewsToAdd.contains(baseView)) {
|
||||
if (lastAdded == null) {
|
||||
layout.addStandaloneView(
|
||||
baseView,
|
||||
false,
|
||||
IPageLayout.LEFT,
|
||||
ChangeD2DLayoutAction.getViewCount() == 0 ? ZERO_PANE_WIDTH
|
||||
: FIVE_PANE_WIDTH, editorArea);
|
||||
} else {
|
||||
layout.addStandaloneView(baseView, false,
|
||||
IPageLayout.BOTTOM, (i >= numViews) ? 1.0f
|
||||
: 1.0f / (numViews - i + 1), lastAdded);
|
||||
}
|
||||
lastAdded = baseView;
|
||||
addedViews.add(lastAdded);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addedViews.addAll(baseViewsToAdd);
|
||||
|
@ -131,7 +133,7 @@ public class D2D5Pane implements IPerspectiveFactory {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (extraViews.size() > 0) {
|
||||
IFolderLayout folder = layout.createFolder(
|
||||
"com.raytheon.uf.viz.d2d.ui.extrasFolder",
|
||||
|
|
Loading…
Add table
Reference in a new issue