summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 18:59:39 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 18:59:39 +0000
commitd90922ab28157a9ea704e210484953abb06bea6f (patch)
tree415ee4a0321a20d9d55ba86c97976dcf5d8b1f70 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java
parente60e1df5284c93b25cf6f6a477b924850dffb9d5 (diff)
downloadpdf-over-d90922ab28157a9ea704e210484953abb06bea6f.tar.gz
pdf-over-d90922ab28157a9ea704e210484953abb06bea6f.tar.bz2
pdf-over-d90922ab28157a9ea704e210484953abb06bea6f.zip
Main Bar improvements
Configuration fixed git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@70 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java73
1 files changed, 68 insertions, 5 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java
index 6f8b8340..102d2c07 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarRectangleButton.java
@@ -44,26 +44,89 @@ public class MainBarRectangleButton extends MainBarButton {
private static final Logger log = LoggerFactory
.getLogger(MainBarRectangleButton.class);
- /* (non-Javadoc)
- * @see at.asit.pdfover.gui.controls.MainBarButton#paintButton(org.eclipse.swt.events.PaintEvent)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * at.asit.pdfover.gui.controls.MainBarButton#paintButton(org.eclipse.swt
+ * .events.PaintEvent)
*/
@Override
protected void paintButton(PaintEvent e) {
-
+
Point size = this.getSize();
int height = size.y - 3;
int width = size.x;
-
+
e.gc.drawLine(0, 0, width, 0);
e.gc.drawLine(width, 0, width, height);
e.gc.drawLine(width, height, 0, height);
e.gc.drawLine(0, height, 0, 0);
+
+ }
+
+ @Override
+ protected void paintBackground(PaintEvent e) {
+ Point size = this.getSize();
+ int height = size.y - 2;
+
+ int width = size.x;
+
+ 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 right_reg = new Region();
+ right_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(right_reg);
+ // RIGTH
+ e.gc.fillGradientRectangle(width, 0, -1 * factor, height,
+ false);
+ e.gc.setClipping((Region)null);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see at.asit.pdfover.gui.controls.MainBarButton#getCustomRegion()
*/
@Override