summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.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/MainWindow.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/MainWindow.java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java88
1 files changed, 46 insertions, 42 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
index 7cf7df23..c291f31f 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java
@@ -73,23 +73,23 @@ public class MainWindow {
/**
* the configuration button
*/
- CONFIG,
-
+ CONFIG,
+
/**
* the open button
*/
- OPEN,
-
+ OPEN,
+
/**
* the position button
*/
- POSITION,
-
+ POSITION,
+
/**
* the signature button
*/
- SIGN,
-
+ SIGN,
+
/**
* the final button
*/
@@ -111,7 +111,8 @@ public class MainWindow {
this.stateMachine = stateMachine;
- this.buttonMap = new EnumMap<MainWindow.Buttons, MainBarButton>(Buttons.class);
+ this.buttonMap = new EnumMap<MainWindow.Buttons, MainBarButton>(
+ Buttons.class);
}
/**
@@ -201,61 +202,64 @@ public class MainWindow {
this.btn_config = new MainBarRectangleButton(composite, SWT.NONE);
FormData fd_btn_config = new FormData();
fd_btn_config.bottom = new FormAttachment(100);
- fd_btn_config.right = new FormAttachment(0,57);
+ fd_btn_config.right = new FormAttachment(0, 57);
fd_btn_config.top = new FormAttachment(0);
- fd_btn_config.left = new FormAttachment(0, 2);
+ fd_btn_config.left = new FormAttachment(0);
this.btn_config.setLayoutData(fd_btn_config);
this.btn_config.setText(Messages.getString("main.configuration")); //$NON-NLS-1$
- this.btn_config.setToolTipText(Messages.getString("main.configuration")); //$NON-NLS-1$
+ this.btn_config
+ .setToolTipText(Messages.getString("main.configuration")); //$NON-NLS-1$
this.btn_config.addMouseListener(new MouseListener() {
-
+
@Override
public void mouseUp(MouseEvent e) {
- MainWindow.this.stateMachine.jumpToState(new ConfigurationUIState(
- MainWindow.this.stateMachine));
+ MainWindow.this.stateMachine
+ .jumpToState(new ConfigurationUIState(
+ MainWindow.this.stateMachine));
}
-
+
@Override
public void mouseDown(MouseEvent e) {
// NOTHING TO DO HERE
}
-
+
@Override
public void mouseDoubleClick(MouseEvent e) {
- // NOTHING TO DO HERE
+ // NOTHING TO DO HERE
}
});
this.buttonMap.put(Buttons.CONFIG, this.btn_config);
-
+
InputStream is = this.getClass().getResourceAsStream("/img/config.png"); //$NON-NLS-1$
-
- this.btn_config.setImage(new Image(Display.getDefault(), new ImageData(is)));
-
+
+ this.btn_config.setImage(new Image(Display.getDefault(), new ImageData(
+ is)));
+
this.btn_open = new MainBarStartButton(composite, SWT.NONE);
FormData fd_btn_open = new FormData();
fd_btn_open.bottom = new FormAttachment(100);
- fd_btn_open.right = new FormAttachment(35, 5);
+ fd_btn_open.right = new FormAttachment(35, (MainBarButton.SplitFactor / 2));
fd_btn_open.top = new FormAttachment(0);
fd_btn_open.left = new FormAttachment(0, 57);
this.btn_open.setLayoutData(fd_btn_open);
this.btn_open.setText(Messages.getString("common.open")); //$NON-NLS-1$
this.btn_open.setToolTipText(Messages.getString("common.open")); //$NON-NLS-1$
this.btn_open.addMouseListener(new MouseListener() {
-
+
@Override
public void mouseUp(MouseEvent e) {
MainWindow.this.stateMachine.jumpToState(new OpenState(
MainWindow.this.stateMachine));
}
-
+
@Override
public void mouseDown(MouseEvent e) {
// NOTHING TO DO HERE
}
-
+
@Override
public void mouseDoubleClick(MouseEvent e) {
- // NOTHING TO DO HERE
+ // NOTHING TO DO HERE
}
});
this.buttonMap.put(Buttons.OPEN, this.btn_open);
@@ -263,28 +267,28 @@ public class MainWindow {
this.btn_position = new MainBarMiddleButton(composite, SWT.NONE);
FormData fd_btn_position = new FormData();
fd_btn_position.bottom = new FormAttachment(100);
- fd_btn_position.right = new FormAttachment(60, 5);
+ fd_btn_position.right = new FormAttachment(60, (MainBarButton.SplitFactor / 2));
fd_btn_position.top = new FormAttachment(0);
- fd_btn_position.left = new FormAttachment(35, -5);
+ fd_btn_position.left = new FormAttachment(35, -1 * (MainBarButton.SplitFactor / 2));
this.btn_position.setLayoutData(fd_btn_position);
this.btn_position.setText(Messages.getString("main.position")); //$NON-NLS-1$
this.btn_position.setToolTipText(Messages.getString("main.position")); //$NON-NLS-1$
this.btn_position.addMouseListener(new MouseListener() {
-
+
@Override
public void mouseUp(MouseEvent e) {
MainWindow.this.stateMachine.jumpToState(new PositioningState(
MainWindow.this.stateMachine));
}
-
+
@Override
public void mouseDown(MouseEvent e) {
// NOTHING TO DO HERE
}
-
+
@Override
public void mouseDoubleClick(MouseEvent e) {
- // NOTHING TO DO HERE
+ // NOTHING TO DO HERE
}
});
this.buttonMap.put(Buttons.POSITION, this.btn_position);
@@ -292,9 +296,9 @@ public class MainWindow {
this.btn_sign = new MainBarMiddleButton(composite, SWT.NONE);
FormData fd_btn_sign = new FormData();
fd_btn_sign.bottom = new FormAttachment(100);
- fd_btn_sign.right = new FormAttachment(85, 5);
+ fd_btn_sign.right = new FormAttachment(85, (MainBarButton.SplitFactor / 2));
fd_btn_sign.top = new FormAttachment(0);
- fd_btn_sign.left = new FormAttachment(60, -5);
+ fd_btn_sign.left = new FormAttachment(60, -1 * (MainBarButton.SplitFactor / 2));
this.btn_sign.setLayoutData(fd_btn_sign);
this.btn_sign.setText(Messages.getString("main.signature")); //$NON-NLS-1$
this.btn_sign.setToolTipText(Messages.getString("main.signature")); //$NON-NLS-1$
@@ -303,20 +307,20 @@ public class MainWindow {
MainBarEndButton end = new MainBarEndButton(composite, SWT.NONE);
FormData fd_btn_end = new FormData();
fd_btn_end.bottom = new FormAttachment(100);
- fd_btn_end.right = new FormAttachment(100, -10);
+ fd_btn_end.right = new FormAttachment(100);
fd_btn_end.top = new FormAttachment(0);
- fd_btn_end.left = new FormAttachment(85, -5);
+ fd_btn_end.left = new FormAttachment(85, -1 * (MainBarButton.SplitFactor / 2));
end.setLayoutData(fd_btn_end);
end.setText(Messages.getString("main.done")); //$NON-NLS-1$
end.setToolTipText(Messages.getString("main.done")); //$NON-NLS-1$
this.buttonMap.put(Buttons.FINAL, end);
-
+
this.container = new Composite(getShell(), SWT.RESIZE);
FormData fd_composite_1 = new FormData();
- fd_composite_1.bottom = new FormAttachment(100, -5);
- fd_composite_1.right = new FormAttachment(100, -5);
+ fd_composite_1.bottom = new FormAttachment(100, -10);
+ fd_composite_1.right = new FormAttachment(100, -10);
fd_composite_1.top = new FormAttachment(0, 70);
- fd_composite_1.left = new FormAttachment(0, 5);
+ fd_composite_1.left = new FormAttachment(0, 10);
this.container.setLayoutData(fd_composite_1);
this.stack = new StackLayout();
this.container.setLayout(this.stack);
@@ -343,7 +347,7 @@ public class MainWindow {
}
}
- if(behavior.getMainBarVisible()) {
+ if (behavior.getMainBarVisible()) {
this.mainBarFormData.bottom = new FormAttachment(0, 60);
} else {
this.mainBarFormData.bottom = new FormAttachment(0, 0);