diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2012-10-03 08:42:03 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2012-10-03 08:42:03 +0200 |
commit | dff2e350246d462dd8a70fb211e08554bcf95723 (patch) | |
tree | 126739110afa3089d975f490867e5231499585c9 /trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java | |
parent | e3fd80899e714e60c329aca6e2d3654cf2fbc93a (diff) | |
download | pdf-over-dff2e350246d462dd8a70fb211e08554bcf95723.tar.gz pdf-over-dff2e350246d462dd8a70fb211e08554bcf95723.tar.bz2 pdf-over-dff2e350246d462dd8a70fb211e08554bcf95723.zip |
Main Bar improvements
Configuration fixed
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java')
-rw-r--r-- | trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java | 74 |
1 files changed, 72 insertions, 2 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java index cbdfc05d..489f17b3 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarStartButton.java @@ -42,6 +42,66 @@ public class MainBarStartButton extends MainBarButton { private static final Logger log = LoggerFactory .getLogger(MainBarStartButton.class); + @Override + protected void paintBackground(PaintEvent e) { + super.paintBackground(e); + /* + Point size = this.getSize(); + int height = size.y - 2; + + int split = SplitFactor; + int width = size.x - split; + + int factor = GradientFactor; + + Region left_reg = new Region(); + left_reg.add(new int[] { 0, 0, factor, factor, factor, height-factor, 0, height, 0, 0 }); + + Region right1_reg = new Region(); + right1_reg.add(new int[] { width, 0, + width - factor, factor, + width - factor, height-factor, width, height, width, 0 }); + + Region top_reg = new Region(); + top_reg.add(new int[] { + 0, 0, + factor, factor, + width - factor, factor, + width, 0, + 0, 0 }); + + Region bottom_reg = new Region(); + bottom_reg.add(new int[] { + 0, height, + factor, height-factor, + width - factor, height-factor, + width, height, 0, height }); + + e.gc.setClipping(top_reg); + + //TOP + e.gc.fillGradientRectangle(0, 0, width, factor, true); + + e.gc.setClipping(bottom_reg); + + //BOTTOM + e.gc.fillGradientRectangle(0, height, width, -1 * (factor), + true); + + e.gc.setClipping(left_reg); + + // LEFT + e.gc.fillGradientRectangle(0, 0, factor, height, false); + + + e.gc.setClipping(right1_reg); + // RIGTH + e.gc.fillGradientRectangle(width, 0, -1 * factor, height, + false); + + e.gc.setClipping((Region)null);*/ + } + /* (non-Javadoc) * @see at.asit.pdfover.gui.controls.MainBarButton#paintButton(org.eclipse.swt.events.PaintEvent) */ @@ -52,7 +112,7 @@ public class MainBarStartButton extends MainBarButton { int height = size.y - 3; - int split = 10; + int split = SplitFactor; int width = size.x - split; e.gc.drawLine(0, 0, width, 0); @@ -72,7 +132,7 @@ public class MainBarStartButton extends MainBarButton { int height = size.y - 2; - int split = 10; + int split = SplitFactor; int width = size.x - split; @@ -82,4 +142,14 @@ public class MainBarStartButton extends MainBarButton { return reg; } + + /** + * change the text position + * @param positionX the position + * @return the new position + */ + @Override + protected int changeTextPosition(int positionX) { + return positionX - (SplitFactor / 2); + } } |