summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:08:50 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:08:50 +0000
commit31c595076c0574bd3f084c68fcd2f9a7ac163477 (patch)
tree5b3cdd263b9c988ebc384c2162376aeee644900e /pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites
parentc9c5ab74fb8e71b840d4c1584f437fa42d3aea3a (diff)
downloadpdf-over-31c595076c0574bd3f084c68fcd2f9a7ac163477.tar.gz
pdf-over-31c595076c0574bd3f084c68fcd2f9a7ac163477.tar.bz2
pdf-over-31c595076c0574bd3f084c68fcd2f9a7ac163477.zip
Move constants to separate class
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@157 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java23
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java5
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java9
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java17
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java4
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java11
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java12
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java6
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java28
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java26
10 files changed, 62 insertions, 79 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java
index e264aa48..8e70f502 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/AdvancedConfigurationComposite.java
@@ -40,6 +40,7 @@ import org.eclipse.swt.widgets.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.workflow.ConfigurationContainer;
@@ -89,7 +90,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
grpSignatur.setLayoutData(fd_grpSignatur);
FontData[] fD_grpSignaturPosition = grpSignatur.getFont().getFontData();
- fD_grpSignaturPosition[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_grpSignaturPosition[0].setHeight(Constants.TEXT_SIZE_NORMAL);
grpSignatur.setFont(new Font(Display.getCurrent(),
fD_grpSignaturPosition[0]));
@@ -105,7 +106,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
FontData[] fD_btnAutomatischePositionierung = this.btnAutomatischePositionierung
.getFont().getFontData();
- fD_btnAutomatischePositionierung[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btnAutomatischePositionierung[0].setHeight(Constants.TEXT_SIZE_BUTTON);
this.btnAutomatischePositionierung.setFont(new Font(Display
.getCurrent(), fD_btnAutomatischePositionierung[0]));
@@ -131,7 +132,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
.getString("advanced_config.SigPHTransparency")); //$NON-NLS-1$
FontData[] fD_lblTransparenz = lblTransparenz.getFont().getFontData();
- fD_lblTransparenz[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_lblTransparenz[0].setHeight(Constants.TEXT_SIZE_NORMAL);
lblTransparenz.setFont(new Font(Display.getCurrent(),
fD_lblTransparenz[0]));
@@ -145,7 +146,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
FontData[] fD_lblTransparenzLinks = lblTransparenzLinks.getFont()
.getFontData();
- fD_lblTransparenzLinks[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_lblTransparenzLinks[0].setHeight(Constants.TEXT_SIZE_NORMAL);
lblTransparenzLinks.setFont(new Font(Display.getCurrent(),
fD_lblTransparenzLinks[0]));
@@ -159,7 +160,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
FontData[] fD_lblTransparenzRechts = lblTransparenzRechts.getFont()
.getFontData();
- fD_lblTransparenzRechts[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_lblTransparenzRechts[0].setHeight(Constants.TEXT_SIZE_NORMAL);
lblTransparenzRechts.setFont(new Font(Display.getCurrent(),
fD_lblTransparenzRechts[0]));
@@ -195,7 +196,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
grpBkuAuswahl.setLayoutData(fd_grpBkuAuswahl);
FontData[] fD_grpBkuAuswahl = grpBkuAuswahl.getFont().getFontData();
- fD_grpBkuAuswahl[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_grpBkuAuswahl[0].setHeight(Constants.TEXT_SIZE_NORMAL);
grpBkuAuswahl.setFont(new Font(Display.getCurrent(),
fD_grpBkuAuswahl[0]));
@@ -207,7 +208,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
FontData[] fD_cmbBKUAuswahl = this.cmbBKUAuswahl.getFont()
.getFontData();
- fD_cmbBKUAuswahl[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_cmbBKUAuswahl[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.cmbBKUAuswahl.setFont(new Font(Display.getCurrent(),
fD_cmbBKUAuswahl[0]));
@@ -254,7 +255,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
grpSpeicherort.setLayoutData(fd_grpSpeicherort);
FontData[] fD_grpSpeicherort = grpSpeicherort.getFont().getFontData();
- fD_grpSpeicherort[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_grpSpeicherort[0].setHeight(Constants.TEXT_SIZE_NORMAL);
grpSpeicherort.setFont(new Font(Display.getCurrent(),
fD_grpSpeicherort[0]));
@@ -268,7 +269,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
FontData[] fD_lblDefaultOutputFolder = lblDefaultOutputFolder.getFont()
.getFontData();
- fD_lblDefaultOutputFolder[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_lblDefaultOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL);
lblDefaultOutputFolder.setFont(new Font(Display.getCurrent(),
fD_lblDefaultOutputFolder[0]));
@@ -280,7 +281,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
FontData[] fD_txtOutputFolder = this.txtOutputFolder.getFont()
.getFontData();
- fD_txtOutputFolder[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_txtOutputFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.txtOutputFolder.setFont(new Font(Display.getCurrent(),
fD_txtOutputFolder[0]));
@@ -297,7 +298,7 @@ public class AdvancedConfigurationComposite extends BaseConfigurationComposite {
fd_text.right = new FormAttachment(btnBrowse, -5);
FontData[] fD_btnBrowse = btnBrowse.getFont().getFontData();
- fD_btnBrowse[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btnBrowse[0].setHeight(Constants.TEXT_SIZE_BUTTON);
btnBrowse.setFont(new Font(Display.getCurrent(), fD_btnBrowse[0]));
FormData fd_btnBrowse = new FormData();
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java
index 522b3bad..64c4d0a0 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/BKUSelectionComposite.java
@@ -32,6 +32,7 @@ import org.eclipse.swt.widgets.Display;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.workflow.states.State;
import at.asit.pdfover.signator.BKUs;
@@ -133,7 +134,7 @@ public class BKUSelectionComposite extends StateComposite {
btn_mobile.setImage(mobile);
FontData[] fD_btn_mobile = btn_mobile.getFont().getFontData();
- fD_btn_mobile[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btn_mobile[0].setHeight(Constants.TEXT_SIZE_BUTTON);
btn_mobile.setFont(new Font(Display.getCurrent(), fD_btn_mobile[0]));
Button btn_card = new Button(this, SWT.NATIVE | SWT.RESIZE);
@@ -148,7 +149,7 @@ public class BKUSelectionComposite extends StateComposite {
btn_card.addSelectionListener(new LocalSelectionListener());
FontData[] fD_btn_card = btn_card.getFont().getFontData();
- fD_btn_card[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btn_card[0].setHeight(Constants.TEXT_SIZE_BUTTON);
btn_card.setFont(new Font(Display.getCurrent(), fD_btn_card[0]));
Image karte = new Image(getDisplay(), new ImageData(this.getClass().getResourceAsStream("/img/karte.gif"))); //$NON-NLS-1$
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
index b7b0aa1d..2b62d651 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/ConfigurationComposite.java
@@ -26,6 +26,7 @@ import org.eclipse.swt.widgets.TabItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.exceptions.InvalidEmblemFile;
@@ -218,7 +219,7 @@ public class ConfigurationComposite extends StateComposite {
tabFolder.setLayoutData(fd_tabFolder);
FontData[] fD_tabFolder = tabFolder.getFont().getFontData();
- fD_tabFolder[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_tabFolder[0].setHeight(Constants.TEXT_SIZE_NORMAL);
tabFolder.setFont(new Font(Display.getCurrent(), fD_tabFolder[0]));
TabItem simpleTabItem = new TabItem(tabFolder, SWT.NONE);
@@ -268,7 +269,7 @@ public class ConfigurationComposite extends StateComposite {
btnSpeichern.setText(Messages.getString("common.Save")); //$NON-NLS-1$
FontData[] fD_btnSpeichern = btnSpeichern.getFont().getFontData();
- fD_btnSpeichern[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btnSpeichern[0].setHeight(Constants.TEXT_SIZE_BUTTON);
btnSpeichern.setFont(new Font(Display.getCurrent(), fD_btnSpeichern[0]));
Button btnAbbrechen = new Button(this, SWT.NONE);
@@ -286,7 +287,7 @@ public class ConfigurationComposite extends StateComposite {
});
FontData[] fD_btnAbbrechen = btnAbbrechen.getFont().getFontData();
- fD_btnAbbrechen[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btnAbbrechen[0].setHeight(Constants.TEXT_SIZE_BUTTON);
btnAbbrechen.setFont(new Font(Display.getCurrent(), fD_btnAbbrechen[0]));
FormData fd_composite = new FormData();
@@ -338,7 +339,7 @@ public class ConfigurationComposite extends StateComposite {
log.error("Settings validation failed!", e); //$NON-NLS-1$
ErrorDialog dialog = new ErrorDialog(
getShell(),
- e.getMessage(), //$NON-NLS-1$
+ e.getMessage(),
false);
dialog.open();
return false;
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
index 530e0f03..43b84b24 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/DataSourceSelectComposite.java
@@ -45,6 +45,7 @@ import org.eclipse.swt.widgets.Label;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.workflow.states.State;
@@ -149,12 +150,12 @@ public class DataSourceSelectComposite extends StateComposite {
public DataSourceSelectComposite(Composite parent, int style, State state) {
super(parent, style, state);
- this.activeBackground = new Color(getDisplay(),0xB4, 0xCD, 0xEC);
- this.inactiveBackground = new Color(getDisplay(),0xD4, 0xE7, 0xF1);
- this.inactiveBorder = new Color(getDisplay(),0xB4, 0xCD, 0xEC);
- this.activeBorder = new Color(getDisplay(),0x6B, 0xA5, 0xD9);
+ this.activeBackground = Constants.MAINBAR_ACTIVE_BACK_DARK;
+ this.inactiveBackground = Constants.MAINBAR_INACTIVE_BACK;
+ this.inactiveBorder = Constants.MAINBAR_ACTIVE_BACK_DARK;
+ this.activeBorder = Constants.MAINBAR_ACTIVE_BACK_LIGHT;
this.backgroundColor = this.inactiveBackground;
- this.borderColor = this.inactiveBorder;
+ this.borderColor = Constants.DROP_BORDER_COLOR;
this.setLayout(new FormLayout());
@@ -276,7 +277,7 @@ public class DataSourceSelectComposite extends StateComposite {
this.fd_lbl_drag.bottom = new FormAttachment(this.lbl_drag2, -10);
this.lbl_drag.setLayoutData(this.fd_lbl_drag);
FontData[] fD = this.lbl_drag.getFont().getFontData();
- fD[0].setHeight(TEXT_SIZE_BIG);
+ fD[0].setHeight(Constants.TEXT_SIZE_BIG);
this.lbl_drag.setFont(new Font(Display.getCurrent(), fD[0]));
this.lbl_drag.setText(Messages.getString("dataSourceSelection.DropLabel")); //$NON-NLS-1$
this.lbl_drag.setAlignment(SWT.CENTER);
@@ -289,7 +290,7 @@ public class DataSourceSelectComposite extends StateComposite {
// fd_lbl_drag.bottom = new FormAttachment(100, -10);
this.lbl_drag2.setLayoutData(this.fd_lbl_drag2);
FontData[] fD2 = this.lbl_drag2.getFont().getFontData();
- fD2[0].setHeight(TEXT_SIZE_NORMAL);
+ fD2[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.lbl_drag2.setFont(new Font(Display.getCurrent(), fD2[0]));
this.lbl_drag2.setText(Messages.getString("dataSourceSelection.DropLabel2")); //$NON-NLS-1$
this.lbl_drag2.setAlignment(SWT.CENTER);
@@ -298,7 +299,7 @@ public class DataSourceSelectComposite extends StateComposite {
this.btn_open.setText(Messages.getString("dataSourceSelection.browse")); //$NON-NLS-1$
FontData[] fD_open = this.btn_open.getFont().getFontData();
- fD_open[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_open[0].setHeight(Constants.TEXT_SIZE_BUTTON);
this.btn_open.setFont(new Font(Display.getCurrent(), fD_open[0]));
/*
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java
index fb716104..3cd7372f 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/MobileBKUEnterNumberComposite.java
@@ -23,7 +23,6 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Rectangle;
@@ -37,6 +36,7 @@ import org.eclipse.swt.widgets.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.exceptions.InvalidNumberException;
import at.asit.pdfover.gui.exceptions.InvalidPasswordException;
@@ -182,7 +182,7 @@ public class MobileBKUEnterNumberComposite extends StateComposite {
Rectangle clientArea = containerComposite.getClientArea();
//e.gc.setForeground();
- e.gc.setForeground(new Color(getDisplay(),0x6B, 0xA5, 0xD9));
+ e.gc.setForeground(Constants.MAINBAR_ACTIVE_BACK_LIGHT);
e.gc.setLineWidth(3);
e.gc.setLineStyle(SWT.LINE_SOLID);
e.gc.drawRoundRectangle(clientArea.x,
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
index 0ad7617a..7f73d0c8 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/OutputComposite.java
@@ -40,6 +40,7 @@ import org.eclipse.swt.widgets.Link;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.workflow.states.State;
import at.asit.pdfover.signator.DocumentSource;
@@ -54,8 +55,6 @@ public class OutputComposite extends StateComposite {
**/
static final Logger log = LoggerFactory.getLogger(OutputComposite.class);
- private final static String SIGNED_SUFFIX = "_signed"; //$NON-NLS-1$
-
private File inputFile;
File outputFile = null;
@@ -127,7 +126,7 @@ public class OutputComposite extends StateComposite {
name = FilenameUtils.removeExtension(name);
- proposed = path + name + SIGNED_SUFFIX + "." + extension; //$NON-NLS-1$
+ proposed = path + name + Constants.SIGNED_SUFFIX + "." + extension; //$NON-NLS-1$
if (this.getOutputDir() != null && !this.getOutputDir().equals("")) //$NON-NLS-1$
{
@@ -261,7 +260,7 @@ public class OutputComposite extends StateComposite {
.getString("output.success_message")); //$NON-NLS-1$
FontData[] fD1 = lbl_success_message.getFont().getFontData();
- fD1[0].setHeight(TEXT_SIZE_BIG);
+ fD1[0].setHeight(Constants.TEXT_SIZE_BIG);
lbl_success_message.setFont(new Font(Display.getCurrent(), fD1[0]));
this.lnk_saved_file = new Link(this, SWT.NATIVE | SWT.RESIZE);
@@ -277,14 +276,14 @@ public class OutputComposite extends StateComposite {
this.lnk_saved_file.addSelectionListener(new OpenSelectionListener());
FontData[] fD2 = this.lnk_saved_file.getFont().getFontData();
- fD2[0].setHeight(TEXT_SIZE_NORMAL);
+ fD2[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.lnk_saved_file.setFont(new Font(Display.getCurrent(), fD2[0]));
this.btn_save = new Button(this, SWT.NATIVE | SWT.RESIZE);
this.btn_save.setText(Messages.getString("common.Save")); //$NON-NLS-1$
FontData[] fD_btn_save = this.btn_save.getFont().getFontData();
- fD_btn_save[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btn_save[0].setHeight(Constants.TEXT_SIZE_BUTTON);
this.btn_save.setFont(new Font(Display.getCurrent(), fD_btn_save[0]));
FormData fd_btn_save = new FormData();
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
index acb2eed5..e2379926 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java
@@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.ScrollBar;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.workflow.states.State;
import at.asit.pdfover.signator.SignaturePosition;
@@ -54,9 +55,6 @@ public class PositioningComposite extends StateComposite {
static final Logger log = LoggerFactory
.getLogger(PositioningComposite.class);
- /** How far to displace the signature with the arrow keys */
- private static final int SIGNATURE_KEYBOARD_POSITIONING_OFFSET = 15;
-
private SignaturePanel viewer = null;
private PDFFile pdf = null;
@@ -171,19 +169,19 @@ public class PositioningComposite extends StateComposite {
break;
case SWT.ARROW_LEFT:
- sigXOffset -= SIGNATURE_KEYBOARD_POSITIONING_OFFSET;
+ sigXOffset -= Constants.SIGNATURE_KEYBOARD_POSITIONING_OFFSET;
break;
case SWT.ARROW_RIGHT:
- sigXOffset += SIGNATURE_KEYBOARD_POSITIONING_OFFSET;
+ sigXOffset += Constants.SIGNATURE_KEYBOARD_POSITIONING_OFFSET;
break;
case SWT.ARROW_UP:
- sigYOffset -= SIGNATURE_KEYBOARD_POSITIONING_OFFSET;
+ sigYOffset -= Constants.SIGNATURE_KEYBOARD_POSITIONING_OFFSET;
break;
case SWT.ARROW_DOWN:
- sigYOffset += SIGNATURE_KEYBOARD_POSITIONING_OFFSET;
+ sigYOffset += Constants.SIGNATURE_KEYBOARD_POSITIONING_OFFSET;
break;
}
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
index 9511255f..3e0d772b 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SignaturePanel.java
@@ -34,6 +34,8 @@ import javax.swing.JPanel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
+
import com.sun.pdfview.PDFFile;
import com.sun.pdfview.PDFPage;
@@ -90,13 +92,13 @@ public class SignaturePanel extends JPanel {
int prevSigScreenHeight = 0;
/**
- * Create a new PagePanel, with a default size of 800 by 600 pixels.
+ * Create a new PagePanel.
* @param pdf the PDFFile to display
*/
public SignaturePanel(PDFFile pdf) {
super(new BorderLayout());
setDocument(pdf);
- setPreferredSize(new Dimension(800, 600));
+ setPreferredSize(new Dimension(Constants.MAINWINDOW_WIDTH, Constants.MAINWINDOW_HEIGHT - Constants.MAINBAR_HEIGHT));
setFocusable(true);
addMouseListener(this.mouseListener);
addMouseMotionListener(this.mouseListener);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
index ebb99260..4b118a89 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/SimpleConfigurationComposite.java
@@ -34,7 +34,6 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.TraverseEvent;
import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
@@ -57,6 +56,7 @@ import org.eclipse.swt.widgets.Text;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import at.asit.pdfover.gui.Constants;
import at.asit.pdfover.gui.Messages;
import at.asit.pdfover.gui.controls.ErrorDialog;
import at.asit.pdfover.gui.controls.ErrorMarker;
@@ -97,7 +97,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
FontData[] fD_grpHandySignatur = grpHandySignatur.getFont()
.getFontData();
- fD_grpHandySignatur[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_grpHandySignatur[0].setHeight(Constants.TEXT_SIZE_NORMAL);
grpHandySignatur.setFont(new Font(Display.getCurrent(),
fD_grpHandySignatur[0]));
@@ -109,7 +109,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
.setText(Messages.getString("simple_config.PhoneNumber")); //$NON-NLS-1$
FontData[] fD_lblMobileNumber = lblMobileNumber.getFont().getFontData();
- fD_lblMobileNumber[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_lblMobileNumber[0].setHeight(Constants.TEXT_SIZE_NORMAL);
lblMobileNumber.setFont(new Font(Display.getCurrent(),
fD_lblMobileNumber[0]));
@@ -139,7 +139,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
FontData[] fD_txtMobileNumber = this.txtMobileNumber.getFont()
.getFontData();
- fD_txtMobileNumber[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_txtMobileNumber[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.txtMobileNumber.setFont(new Font(Display.getCurrent(),
fD_txtMobileNumber[0]));
@@ -174,7 +174,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
grpBildmarke.setText(Messages.getString("simple_config.Emblem_Title")); //$NON-NLS-1$
FontData[] fD_grpBildmarke = grpBildmarke.getFont().getFontData();
- fD_grpBildmarke[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_grpBildmarke[0].setHeight(Constants.TEXT_SIZE_NORMAL);
grpBildmarke
.setFont(new Font(Display.getCurrent(), fD_grpBildmarke[0]));
@@ -200,7 +200,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
@Override
public void paintControl(PaintEvent e) {
// e.gc.setForeground();
- e.gc.setForeground(new Color(getDisplay(),0xB4, 0xCD, 0xEC));
+ e.gc.setForeground(Constants.DROP_BORDER_COLOR);
e.gc.setLineWidth(3);
e.gc.setLineStyle(SWT.LINE_DASH);
e.gc.drawRoundRectangle(e.x, e.y, e.width - 2, e.height - 2,
@@ -254,7 +254,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
});
FontData[] fD_lblEmblem = this.lblEmblem.getFont().getFontData();
- fD_lblEmblem[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_lblEmblem[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.lblEmblem.setFont(new Font(Display.getCurrent(), fD_lblEmblem[0]));
DropTarget dnd_target = new DropTarget(controlComposite,
@@ -330,7 +330,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
});
FontData[] fD_btnUseImage = this.btnClearImage.getFont().getFontData();
- fD_btnUseImage[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btnUseImage[0].setHeight(Constants.TEXT_SIZE_BUTTON);
this.btnClearImage.setFont(new Font(Display.getCurrent(),
fD_btnUseImage[0]));
@@ -351,7 +351,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
btnBrowseEmblem.setText(Messages.getString("common.browse")); //$NON-NLS-1$
FontData[] fD_btnBrowseEmblem = btnBrowseEmblem.getFont().getFontData();
- fD_btnBrowseEmblem[0].setHeight(TEXT_SIZE_BUTTON);
+ fD_btnBrowseEmblem[0].setHeight(Constants.TEXT_SIZE_BUTTON);
btnBrowseEmblem.setFont(new Font(Display.getCurrent(),
fD_btnBrowseEmblem[0]));
@@ -365,7 +365,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
grpProxy.setText(Messages.getString("simple_config.Proxy_Title")); //$NON-NLS-1$
FontData[] fD_grpProxy = grpProxy.getFont().getFontData();
- fD_grpProxy[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_grpProxy[0].setHeight(Constants.TEXT_SIZE_NORMAL);
grpProxy.setFont(new Font(Display.getCurrent(), fD_grpProxy[0]));
Label lblNewLabel = new Label(grpProxy, SWT.NONE);
@@ -377,7 +377,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
lblNewLabel.setText(Messages.getString("simple_config.ProxyHost")); //$NON-NLS-1$
FontData[] fD_lblNewLabel = lblNewLabel.getFont().getFontData();
- fD_lblNewLabel[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_lblNewLabel[0].setHeight(Constants.TEXT_SIZE_NORMAL);
lblNewLabel.setFont(new Font(Display.getCurrent(), fD_lblNewLabel[0]));
Composite composite = new Composite(grpProxy, SWT.NONE);
@@ -392,7 +392,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
fd_txtProxyHost.left = new FormAttachment(0, 5);
FontData[] fD_txtProxyHost = this.txtProxyHost.getFont().getFontData();
- fD_txtProxyHost[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_txtProxyHost[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.txtProxyHost.setFont(new Font(Display.getCurrent(),
fD_txtProxyHost[0]));
@@ -434,7 +434,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
lblNewLabel_1.setText(Messages.getString("simple_config.ProxyPort")); //$NON-NLS-1$
FontData[] fD_lblNewLabel_1 = lblNewLabel_1.getFont().getFontData();
- fD_lblNewLabel_1[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_lblNewLabel_1[0].setHeight(Constants.TEXT_SIZE_NORMAL);
lblNewLabel_1.setFont(new Font(Display.getCurrent(),
fD_lblNewLabel_1[0]));
@@ -452,7 +452,7 @@ public class SimpleConfigurationComposite extends BaseConfigurationComposite {
this.txtProxyPort.setLayoutData(this.fd_txtProxyPort);
FontData[] fD_txtProxyPort = this.txtProxyPort.getFont().getFontData();
- fD_txtProxyPort[0].setHeight(TEXT_SIZE_NORMAL);
+ fD_txtProxyPort[0].setHeight(Constants.TEXT_SIZE_NORMAL);
this.txtProxyPort.setFont(new Font(Display.getCurrent(),
fD_txtProxyPort[0]));
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
index ce35755f..c7d69c92 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/StateComposite.java
@@ -24,32 +24,12 @@ import at.asit.pdfover.gui.workflow.states.State;
* Composite interface for workflow state gui implementations
*/
public abstract class StateComposite extends Composite {
-
- /**
- * Normal Text size
- */
- public static final int TEXT_SIZE_NORMAL = 12;
-
- /**
- *
- */
- public static final int TEXT_SIZE_BIG = 14;
-
- /**
- *
- */
- public static final int TEXT_SIZE_SMALL = 10;
-
- /**
- *
- */
- public static final int TEXT_SIZE_BUTTON = 12;
-
+
/**
* Current State
*/
protected State state;
-
+
/**
* The base class for state composites
*
@@ -61,7 +41,7 @@ public abstract class StateComposite extends Composite {
super(parent, style);
this.state = state;
}
-
+
/**
* Performs layout for all children in composite
* (SWT layout(...) only layouts children no grandchildren!)