From 31c595076c0574bd3f084c68fcd2f9a7ac163477 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:08:50 +0000 Subject: Move constants to separate class git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@157 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../asit/pdfover/gui/controls/MainBarButton.java | 74 ++++++++++------------ 1 file changed, 32 insertions(+), 42 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java index 5c7af927..531937b4 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/MainBarButton.java @@ -29,10 +29,8 @@ import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import at.asit.pdfover.gui.composites.StateComposite; +import at.asit.pdfover.gui.Constants; /** * Main Bar Button implementation @@ -50,7 +48,31 @@ public abstract class MainBarButton extends Canvas { * This should be a multiple of 2! */ public static final int SplitFactor = 10; - + + /** + * the used text color + */ + protected Color textColor = null; + + /** + * the text size + */ + protected int textsize = Constants.TEXT_SIZE_BUTTON; + + private Color inactiveBackground = null; + private Color activeBackground1 = null; + private Color borderColor = null; + private Color activeBackground = null; + + private Color inactiveText = null; + + private String text = ""; //$NON-NLS-1$ + + private boolean active = true; + + private Image image = null; + + /** * @param parent * @param style @@ -80,21 +102,18 @@ public abstract class MainBarButton extends Canvas { this.setCursor(hand); - this.inactiveBackground = new Color(getDisplay(),0xD4, 0xE7, 0xF1); - this.activeBackground1 = new Color(getDisplay(),0x6B, 0xA5, 0xD9); - this.activeBackground = new Color(getDisplay(),0xB4, 0xCD, 0xEC); + this.inactiveBackground = Constants.MAINBAR_INACTIVE_BACK; + this.activeBackground1 = Constants.MAINBAR_ACTIVE_BACK_LIGHT; + this.activeBackground = Constants.MAINBAR_ACTIVE_BACK_DARK; //this.textColor = this.getForeground(); - this.textColor = new Color(getDisplay(), 0x00, 0x00, 0x00); + this.textColor = Constants.MAINBAR_ACTIVE_TEXTCOLOR; //this.borderColor = new Color(getDisplay(), 0xf9, 0xf9, 0xf9); this.borderColor = this.getBackground(); - this.inactiveText = new Color(getDisplay(), 0x40, 0x40, 0x40); - this.textsize = StateComposite.TEXT_SIZE_BUTTON; + this.inactiveText = Constants.MAINBAR_INACTIVE_TEXTCOLOR; + this.textsize = Constants.TEXT_SIZE_BUTTON; } - private Color inactiveBackground = null; - private Color activeBackground1 = null; - /** * @param inactiveBackground * the inactiveBackground to set @@ -111,11 +130,6 @@ public abstract class MainBarButton extends Canvas { this.activeBackground = activeBackground; } - /** - * the text size - */ - protected int textsize = StateComposite.TEXT_SIZE_BUTTON; - /** * @return the textsize */ @@ -131,11 +145,6 @@ public abstract class MainBarButton extends Canvas { this.textsize = textsize; } - /** - * the used text color - */ - protected Color textColor = null; - /** * @param textColor * the textColor to set @@ -160,18 +169,6 @@ public abstract class MainBarButton extends Canvas { } - private Color borderColor = null; - - private Color activeBackground = null; - - private Color inactiveText = null; - - private String text = ""; //$NON-NLS-1$ - - private boolean active = true; - - private Image image = null; - /** * Gets the image * @@ -235,13 +232,6 @@ public abstract class MainBarButton extends Canvas { this.text = text; } - /** - * SLF4J Logger instance - **/ - @SuppressWarnings("unused") - private static final Logger log = LoggerFactory - .getLogger(MainBarButton.class); - /** * Paint 3D style borders * -- cgit v1.2.3