diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/FlowCellEditor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/FlowCellEditor.java index c0d6b1a..b4d7176 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/FlowCellEditor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/FlowCellEditor.java @@ -1,45 +1,27 @@ package application.editor; -import java.util.EventObject; - import com.mxgraph.swing.mxGraphComponent; import com.mxgraph.swing.view.mxICellEditor; -abstract public class FlowCellEditor implements mxICellEditor { +import java.util.EventObject; - protected Stage stage = null; - protected mxGraphComponent graphComponent = null; +public abstract class FlowCellEditor implements mxICellEditor { + + protected Stage stage; + protected mxGraphComponent graphComponent; protected Object editingCell = null; - /************************************************************* - * [ *constructor] - /************************************************************* - * - * @param stage - * @param graphComponent - */ protected FlowCellEditor(Stage stage, mxGraphComponent graphComponent) { this.stage = stage; this.graphComponent = graphComponent; } - /************************************************************* - * [ *public ] - /************************************************************* - * - */ + public abstract void startEditing(Object cellObj, EventObject eventObj); + + public abstract void stopEditing(boolean cancel); + public Object getEditingCell() { return this.editingCell; } - - /************************************************************* - * - */ - abstract public void startEditing(Object cellObj, EventObject eventObj); - - /************************************************************* - * - */ - abstract public void stopEditing(boolean cancel); } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/IStageChangeListener.java b/AlgebraicDataflowArchitectureModel/src/application/editor/IStageChangeListener.java index ee00c5f..f2cf45c 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/IStageChangeListener.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/IStageChangeListener.java @@ -1,5 +1,5 @@ package application.editor; public interface IStageChangeListener { - public void stageChanged(Stage newStage); + void stageChanged(Stage newStage); } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/Stage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/Stage.java index 4fd5193..ad24bdc 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/Stage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/Stage.java @@ -8,10 +8,13 @@ import java.awt.event.MouseListener; -abstract public class Stage { +public abstract class Stage { + protected DataTransferModel model = null; - protected mxGraphComponent graphComponent = null; - protected mxGraph graph = null; + + protected mxGraphComponent graphComponent; + protected mxGraph graph; + public static final int NODE_LAYER = 0; public static final int DATA_FLOW_LAYER = 0; public static final int PUSH_FLOW_LAYER = 1; @@ -22,19 +25,15 @@ this.graph = graphComponent.getGraph(); } - public DataTransferModel getModel() { - return model; - } + public abstract boolean canChangeFrom(Stage prevStage); - abstract public boolean canChangeFrom(Stage prevStage); + public abstract void init(Stage prevStage); - abstract public void init(Stage prevStage); + public abstract mxICellEditor createCellEditor(mxGraphComponent graphComponent); - abstract public mxICellEditor createCellEditor(mxGraphComponent graphComponent); + public abstract mxIEventListener createChangeEventListener(Editor editor); - abstract public mxIEventListener createChangeEventListener(Editor editor); - - abstract public MouseListener createMouseEventListener(Editor editor); + public abstract MouseListener createMouseEventListener(Editor editor); public void setEnabledForLayer(final int layerNo, final boolean isEnable) { // TODO Implement @@ -48,4 +47,8 @@ public void showOnlyLayer(final int... argsOfLayers) { // TODO Implement } + + public DataTransferModel getModel() { + return model; + } } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java index 46e1784..5474e05 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java @@ -15,6 +15,7 @@ import java.awt.event.MouseListener; public class DataFlowModelingStage extends Stage { + public int PORT_DIAMETER = 8; public int PORT_RADIUS = PORT_DIAMETER / 2; @@ -74,8 +75,8 @@ /** * Construct a mxGraph from DataFlowModel * - * @param model * @param graph + * @param model * @return constructed mxGraph */ public mxGraph constructGraph(mxGraph graph, DataTransferModel model) { diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionCellEditor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionCellEditor.java index f98ce7d..dbf2c92 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionCellEditor.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionCellEditor.java @@ -9,6 +9,7 @@ import java.util.EventObject; public class PushPullSelectionCellEditor extends FlowCellEditor { + public int DEFAULT_MIN_WIDTH = 70; public int DEFAULT_MIN_HEIGHT = 30; public double DEFAULT_MINIMUM_EDITOR_SCALE = 1; diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java index 20b608a..361b7ed 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionStage.java @@ -12,6 +12,7 @@ import java.awt.event.MouseListener; public class PushPullSelectionStage extends Stage { + protected DataFlowGraph dataFlowGraph = null; public PushPullSelectionStage(mxGraphComponent graphComponent) { @@ -45,10 +46,6 @@ return null; } - public DataFlowGraph getDataFlowGraph() { - return dataFlowGraph; - } - public DataFlowGraph analyzeDataTransferModel(mxGraph graph, DataTransferModel model) { // TODO Implement return null; @@ -57,4 +54,8 @@ private void updateEdgeAttributes(mxGraph graph, DataFlowGraph dataFlowGraph) { // TODO Implement } + + public DataFlowGraph getDataFlowGraph() { + return dataFlowGraph; + } }