Merge pull request #1 from srcarter3/unidata_20.3.2-dev

Change default d2d startup to 1 pane
This commit is contained in:
tiffanycmeyer13 2022-08-30 09:21:11 -05:00 committed by GitHub
commit 132a15cbd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 9 deletions

View file

@ -251,7 +251,7 @@
label="1 Pane Layout">
<parameter
name="sideViews"
value="1">
value="0">
</parameter>
</command>
<command

View file

@ -51,6 +51,8 @@ import com.raytheon.viz.ui.EditorUtil;
* Jan 23, 2018 7082 njensen Rewrote execute() to use Eclipse 4 MUIElements
* to resize the display for differing number of
* side views
* Aug 24, 2022 srcarter If no side panes, make the side width 0
* Aug 29, 2022 srcarter Set the initial side pane count to 0
*
* </pre>
*
@ -64,7 +66,7 @@ public class ChangeD2DLayoutAction extends AbstractHandler {
public static int getViewCount() {
Integer views = viewMap
.get(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
return views != null ? views : 4;
return views != null ? views : 0;
}
@Override
@ -164,10 +166,17 @@ public class ChangeD2DLayoutAction extends AbstractHandler {
*/
private void sizeWidth(MElementContainer<MUIElement> sideViewsContainer,
int nSideViews) {
int width;
if (nSideViews > 5) {
nSideViews = 5;
}
int width = (6 - nSideViews) * 1000;
// When switching back to single pane (nSideViews == 0) make sure
// the side panes are completely collapsed
if (nSideViews == 0) {
width = 0;
} else {
width = (6 - nSideViews) * 1000;
}
int diff = 10000 - width;
MElementContainer<MUIElement> screenContainer = sideViewsContainer
.getParent();

View file

@ -51,6 +51,7 @@ import com.raytheon.viz.ui.UiUtil;
* 7/1/06 chammack Initial Creation.
* Mar 21, 2013 1638 mschenke Changed map scales not tied to d2d
* Oct 10, 2013 2104 mschenke Switched to use MapScalesManager
* Aug 29, 2022 srcarter Default to single pane view, with zero side panel width
*
* </pre>
*
@ -65,10 +66,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,7 +94,7 @@ public class D2D5Pane implements IPerspectiveFactory {
}
}
int numViews = ChangeD2DLayoutAction.getViewCount() == 2 ? 2
int numViews = ChangeD2DLayoutAction.getViewCount() == 0 ? 0
: baseViewsToAdd.size();
String lastAdded = null;
@ -108,7 +109,7 @@ public class D2D5Pane implements IPerspectiveFactory {
baseView,
false,
IPageLayout.LEFT,
ChangeD2DLayoutAction.getViewCount() == 2 ? THREE_PANE_WIDTH
ChangeD2DLayoutAction.getViewCount() == 0 ? ZERO_PANE_WIDTH
: FIVE_PANE_WIDTH, editorArea);
} else {
layout.addStandaloneView(baseView, false,