From dff2e350246d462dd8a70fb211e08554bcf95723 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 3 Oct 2012 08:42:03 +0200 Subject: Main Bar improvements Configuration fixed --- .../main/java/at/asit/pdfover/gui/MainWindow.java | 88 +++++++++++----------- 1 file changed, 46 insertions(+), 42 deletions(-) (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java index 7cf7df23..c291f31f 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java +++ b/trunk/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(Buttons.class); + this.buttonMap = new EnumMap( + 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); -- cgit v1.2.3