diff options
author | Lars Vogel | 2019-12-05 21:13:00 +0000 |
---|---|---|
committer | Lars Vogel | 2019-12-10 17:45:09 +0000 |
commit | 0e07fa3a24385ff2bff9603bbbb08b7670417ddc (patch) | |
tree | e5ed879fe8aa429d6122311834de94d0328b33a4 | |
parent | 4300a4e04ab57ecf5b2cf8f829726c5918645108 (diff) | |
download | eclipse.platform.ua-0e07fa3a24385ff2bff9603bbbb08b7670417ddc.tar.gz eclipse.platform.ua-0e07fa3a24385ff2bff9603bbbb08b7670417ddc.tar.xz eclipse.platform.ua-0e07fa3a24385ff2bff9603bbbb08b7670417ddc.zip |
Bug 446171 - Removes dead "simple" check and unused private methodsI20191210-1800
During Bug 446171 I noticed that simple is always set to true and that
several private methods can be removed
Change-Id: I8880e20f1144d7ffeb1ee27b7808699395590efa
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r-- | org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java | 70 |
1 files changed, 6 insertions, 64 deletions
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java index 9083b5e6c..caf3f44ac 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java @@ -100,8 +100,6 @@ public class IntroLaunchBar { @Optional private IntroLaunchBarElement element; - protected boolean simple; - @Inject @Optional private IntroTheme theme; @@ -137,8 +135,8 @@ public class IntroLaunchBar { @Override protected Point computeSize(Composite composite, int wHint, int hHint, boolean changed) { boolean vertical = (getOrientation() & SWT.VERTICAL) != 0; - int marginWidth = vertical ? 1 : simple ? 3 : 7; - int marginHeight = !vertical ? 1 : simple ? 3 : 7; + int marginWidth = vertical ? 1 : 3; + int marginHeight = !vertical ? 1 : 3; int width = 0; int height = 0; @@ -164,8 +162,8 @@ public class IntroLaunchBar { @Override protected void layout(Composite composite, boolean changed) { boolean vertical = (getOrientation() & SWT.VERTICAL) != 0; - int marginWidth = vertical ? 1 : simple ? 4 : 7; - int marginHeight = !vertical ? 1 : simple ? 4 : 7; + int marginWidth = vertical ? 1 : 4; + int marginHeight = !vertical ? 1 : 4; Point tsize = toolBarManager.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, changed); Rectangle carea = composite.getClientArea(); @@ -277,7 +275,6 @@ public class IntroLaunchBar { @PostConstruct void init(Composite parent, MToolControl trimControl) { - simple = true; this.trimControl = trimControl; this.lastPageId = trimControl.getPersistedState().get(LAST_PAGE_ID); @@ -363,63 +360,8 @@ public class IntroLaunchBar { gc.drawRectangle(0, 0, size.x - 1, size.y - 1); } - private void paintLeft(GC gc) { - int[] top = simple ? SIMPLE_TOP_RIGHT_CORNER : TOP_RIGHT_CORNER; - int[] bot = simple ? SIMPLE_BOTTOM_RIGHT_CORNER : BOTTOM_RIGHT_CORNER; - int[] shape = new int[top.length + bot.length + 4]; - int index = 0; - Point size = container.getSize(); - int x = size.x - 1; - int y = 0; - index = fillShape(shape, top, index, x, y, false); - y = size.y - 1; - index = fillShape(shape, bot, index, x, y, true); - shape[index++] = -1; - shape[index++] = size.y - 1; - shape[index++] = -1; - shape[index++] = 0; - gc.fillPolygon(shape); - gc.drawPolygon(shape); - } - - private void paintBottom(GC gc) { - int[] left = simple ? SIMPLE_TOP_LEFT_CORNER : TOP_LEFT_CORNER; - int[] right = simple ? SIMPLE_TOP_RIGHT_CORNER : TOP_RIGHT_CORNER; - int[] shape = new int[left.length + right.length + 4]; - int index = 0; - Point size = container.getSize(); - int x = 0; - int y = 0; - index = fillShape(shape, left, index, x, y, false); - x = size.x - 1; - index = fillShape(shape, right, index, x, y, false); - shape[index++] = size.x - 1; - shape[index++] = size.y; - shape[index++] = 0; - shape[index++] = size.y; - gc.fillPolygon(shape); - gc.drawPolygon(shape); - } - - private void paintRight(GC gc) { - int[] top = simple ? SIMPLE_TOP_LEFT_CORNER : TOP_LEFT_CORNER; - int[] bot = simple ? SIMPLE_BOTTOM_LEFT_CORNER : BOTTOM_LEFT_CORNER; - int[] shape = new int[top.length + bot.length + 4]; - int index = 0; - Point size = container.getSize(); - int x = 0; - int y = 0; - index = fillShape(shape, top, index, x, y, false); - shape[index++] = size.x; - shape[index++] = 0; - shape[index++] = size.x; - shape[index++] = size.y - 1; - x = 0; - y = size.y - 1; - fillShape(shape, bot, index, x, y, true); - gc.fillPolygon(shape); - gc.drawPolygon(shape); - } + + private int fillShape(int[] shape, int[] points, int index, int x, int y, boolean reverse) { |