From 782e41eee1f04f86bc895a95cd2d51353284987a Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 18:51:24 +0000 Subject: Refactoring git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@11 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../java/at/asit/pdfover/gui/DeveloperMain.java | 18 --- .../src/main/java/at/asit/pdfover/gui/Main.java | 13 -- .../at/asit/pdfover/gui/workflow/Workflow.java | 150 --------------------- .../asit/pdfover/gui/workflow/WorkflowState.java | 32 ----- .../gui/workflow/states/BKUSelectionState.java | 15 --- .../workflow/states/DataSourceSelectionState.java | 15 --- .../pdfover/gui/workflow/states/OutputState.java | 15 --- .../gui/workflow/states/PositioningState.java | 15 --- .../workflow/states/PrepareConfigurationState.java | 14 -- .../gui/workflow/states/PrepareSigningState.java | 15 --- .../pdfover/gui/workflow/states/SigningState.java | 15 --- 11 files changed, 317 deletions(-) delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/Main.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/Workflow.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/WorkflowState.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/DataSourceSelectionState.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java delete mode 100644 pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java (limited to 'pdf-over/pdf-gui/src/main/java/at') diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java deleted file mode 100644 index 1093f0fd..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/DeveloperMain.java +++ /dev/null @@ -1,18 +0,0 @@ -package at.asit.pdfover.gui; - -import at.asit.pdfover.gui.workflow.Workflow; - -public class DeveloperMain { - - /** - * Developer Main Entry point... - * @param args - */ - public static void main(String[] args) { - Workflow flow = new Workflow(); - flow.SetCmdArgs(args); - - flow.Start(); - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/Main.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/Main.java deleted file mode 100644 index 2eb27630..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/Main.java +++ /dev/null @@ -1,13 +0,0 @@ -package at.asit.pdfover.gui; - -public class Main { - - /** - * @param args - */ - public static void main(String[] args) { - // TODO Auto-generated method stub - - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/Workflow.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/Workflow.java deleted file mode 100644 index 14dbbcae..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/Workflow.java +++ /dev/null @@ -1,150 +0,0 @@ -package at.asit.pdfover.gui.workflow; - -import java.util.Properties; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -public class Workflow { - /** - * @uml.property name="state" - * @uml.associationEnd multiplicity="(1 1)" aggregation="shared" - * inverse="workflow1:at.asit.pdfover.gui.workflow.WorkflowState" - */ - private WorkflowState state = new at.asit.pdfover.gui.workflow.states.PrepareConfigurationState(); - - /** - * Getter of the property state - * - * @return Returns the state. - * @uml.property name="state" - */ - public WorkflowState getState() { - return state; - } - - private String[] CmdArgs = new String[] {}; - - /** - * Sets the Cmd Arguments - * - * @param args - */ - public void SetCmdArgs(String[] args) { - this.CmdArgs = args; - } - - /** - * Gets the Cmd Arguments - * - * @return - */ - public String[] GetCmdArgs() { - return this.CmdArgs; - } - - private Properties persistent_state = new Properties(); - - /** - * Gets the Persistent State - * - * @return - */ - public Properties GetPersistentState() { - return this.persistent_state; - } - - /** - * Update Workflow logic and let state machine do its job... - */ - public void Update() { - WorkflowState next = null; - do { - this.state.Update(this); - next = this.state.NextState(); - } while (next != null); - } - - private Display display = null; - - private Shell shell = null; - - private Composite container = null; - - private void CreateMainWindow() { - //TODO: Instanciate Main Window Class - this.display = Display.getDefault(); - shell = new Shell(); - shell.setSize(608, 340); - shell.setText("PDFOver 4.0!! :)"); - - container = new Composite(shell, SWT.NONE); - container.setBounds(20, 44, 572, 257); - - shell.open(); - shell.layout(); - } - - /** - * Gets the Shell for drawing the ui - * - * @return - */ - public Composite GetComposite() { - // TODO: implement - // Main window will be build on first call - // returns SWT Composite container for states to draw their GUI - - if(this.container == null) { - this.CreateMainWindow(); - } - - if(this.container == null) { - // TODO throw Exception... - } - - return this.container; - } - - /** - * Only returns a shell if one was already created ... - * - * @return - */ - private Shell NonCreatingGetShell() { - return this.shell; - } - - /** - * Only returns a shell if one was already created ... - * - * @return - */ - private Display NonCreatingGetDisplay() { - return this.display; - } - - /** - * Workflow main entrance point - */ - public void Start() { - // Call update to start processing ... - this.Update(); - - // if a user interaction is required we have a shell ... - Shell shell = this.NonCreatingGetShell(); - Display display = this.NonCreatingGetDisplay(); - - if (shell != null && display != null) { - while (!shell.isDisposed()) { - if (!display.readAndDispatch()) { - display.sleep(); - } - } - display.dispose(); - } - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/WorkflowState.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/WorkflowState.java deleted file mode 100644 index 5a4f1776..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/WorkflowState.java +++ /dev/null @@ -1,32 +0,0 @@ -package at.asit.pdfover.gui.workflow; - -/** - * Base state class - * @author afitzek - */ -public abstract class WorkflowState { - - private WorkflowState _next = null; - - /** - * Gets the next logical state or null if this their is no state transition - * @return - */ - public WorkflowState NextState() { - return this._next; - } - - /** - * Sets the next logical state - * @param state - */ - protected void SetNextState(WorkflowState state) { - this._next = state; - } - - /** - * Perform main logic for this state - * @param workflow - */ - public abstract void Update(Workflow workflow); -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java deleted file mode 100644 index 7c249ef2..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/BKUSelectionState.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.asit.pdfover.gui.workflow.states; - -import at.asit.pdfover.gui.workflow.Workflow; -import at.asit.pdfover.gui.workflow.WorkflowState; - - -public class BKUSelectionState extends WorkflowState { - - @Override - public void Update(Workflow workflow) { - // TODO Auto-generated method stub - - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/DataSourceSelectionState.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/DataSourceSelectionState.java deleted file mode 100644 index a6c92ba3..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/DataSourceSelectionState.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.asit.pdfover.gui.workflow.states; - -import at.asit.pdfover.gui.workflow.Workflow; -import at.asit.pdfover.gui.workflow.WorkflowState; - - -public class DataSourceSelectionState extends WorkflowState { - - @Override - public void Update(Workflow workflow) { - // TODO Auto-generated method stub - - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java deleted file mode 100644 index d984ea7f..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/OutputState.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.asit.pdfover.gui.workflow.states; - -import at.asit.pdfover.gui.workflow.Workflow; -import at.asit.pdfover.gui.workflow.WorkflowState; - - -public class OutputState extends WorkflowState { - - @Override - public void Update(Workflow workflow) { - // TODO Auto-generated method stub - - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java deleted file mode 100644 index 54ed8b31..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PositioningState.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.asit.pdfover.gui.workflow.states; - -import at.asit.pdfover.gui.workflow.Workflow; -import at.asit.pdfover.gui.workflow.WorkflowState; - - -public class PositioningState extends WorkflowState { - - @Override - public void Update(Workflow workflow) { - // TODO Auto-generated method stub - - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java deleted file mode 100644 index 65abeea1..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareConfigurationState.java +++ /dev/null @@ -1,14 +0,0 @@ -package at.asit.pdfover.gui.workflow.states; - -import at.asit.pdfover.gui.workflow.Workflow; -import at.asit.pdfover.gui.workflow.WorkflowState; - - -public class PrepareConfigurationState extends WorkflowState { - - @Override - public void Update(Workflow workflow) { - // TODO Auto-generated method stub - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java deleted file mode 100644 index 5dc96ade..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/PrepareSigningState.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.asit.pdfover.gui.workflow.states; - -import at.asit.pdfover.gui.workflow.Workflow; -import at.asit.pdfover.gui.workflow.WorkflowState; - - -public class PrepareSigningState extends WorkflowState { - - @Override - public void Update(Workflow workflow) { - // TODO Auto-generated method stub - - } - -} diff --git a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java b/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java deleted file mode 100644 index 4753de48..00000000 --- a/pdf-over/pdf-gui/src/main/java/at/asit/pdfover/gui/workflow/states/SigningState.java +++ /dev/null @@ -1,15 +0,0 @@ -package at.asit.pdfover.gui.workflow.states; - -import at.asit.pdfover.gui.workflow.Workflow; -import at.asit.pdfover.gui.workflow.WorkflowState; - - -public class SigningState extends WorkflowState { - - @Override - public void Update(Workflow workflow) { - // TODO Auto-generated method stub - - } - -} -- cgit v1.2.3