diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/FlowCellEditor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/FlowCellEditor.java new file mode 100644 index 0000000..cd39823 --- /dev/null +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/FlowCellEditor.java @@ -0,0 +1,20 @@ +package application.editor; + +import java.util.EventObject; + +import com.mxgraph.swing.mxGraphComponent; +import com.mxgraph.swing.view.mxICellEditor; + +abstract public class FlowCellEditor implements mxICellEditor { + protected Stage stage = null; + protected mxGraphComponent graphComponent = null; + + protected FlowCellEditor(Stage stage, mxGraphComponent graphComponent) { + this.stage = stage; + this.graphComponent = graphComponent; + } + + abstract public Object getEditingCell(); + abstract public void startEditing(Object arg0, EventObject arg1); + abstract public void stopEditing(boolean arg0); +} diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationCellEditor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationCellEditor.java new file mode 100644 index 0000000..813ef2e --- /dev/null +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationCellEditor.java @@ -0,0 +1,56 @@ +package application.editor.stages; + +import java.util.EventObject; + +import com.mxgraph.swing.mxGraphComponent; +import com.mxgraph.swing.view.mxICellEditor; + +import application.editor.FlowCellEditor; + +public class ControlFlowDelegationCellEditor extends FlowCellEditor { + + private mxGraphComponent graphComponent = null; + private Object editingCell = null; + + /**-------------------------------------------------------------------------------- + * [ *constructor ] + /*-------------------------------------------------------------------------------- + * + * @param graph + */ + public ControlFlowDelegationCellEditor(ControlFlowDelegationStage stage, mxGraphComponent graphComponent) { + super(stage, graphComponent); + } + + /**-------------------------------------------------------------------------------- + * [ *public ] + /*-------------------------------------------------------------------------------- + * + * @param graph + */ + @Override + public Object getEditingCell() { + return editingCell; + } + + /*-------------------------------------------------------------------------------- + * + */ + @Override + public void startEditing(Object cellObj, EventObject eventObj) { + if( editingCell != null) stopEditing(true); + + if( graphComponent.getGraph().getModel().isEdge(cellObj) ) { + System.err.println("Edge: " + cellObj.toString()); + } + } + + /*-------------------------------------------------------------------------------- + * + */ + @Override + public void stopEditing(boolean arg0) { + + } + +} diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java index b63196a..4392d14 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/DataFlowModelingStage.java @@ -2,20 +2,17 @@ import java.util.HashMap; import java.util.Map; -import java.util.concurrent.Flow; import com.mxgraph.model.mxCell; import com.mxgraph.model.mxGeometry; import com.mxgraph.model.mxGraphModel; import com.mxgraph.swing.mxGraphComponent; -import com.mxgraph.swing.view.mxICellEditor; import com.mxgraph.util.mxPoint; import com.mxgraph.view.mxGraph; import algorithms.Validation; import application.editor.Editor.SrcDstAttribute; import application.editor.FlowCellEditor; -import application.editor.Editor; import application.editor.Stage; import models.dataConstraintModel.ChannelGenerator; import models.dataConstraintModel.ChannelMember; diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionCellEditor.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionCellEditor.java new file mode 100644 index 0000000..86180c0 --- /dev/null +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/PushPullSelectionCellEditor.java @@ -0,0 +1,33 @@ +package application.editor.stages; + +import java.util.EventObject; + +import com.mxgraph.swing.mxGraphComponent; + +import application.editor.FlowCellEditor; + +public class PushPullSelectionCellEditor extends FlowCellEditor { + + public PushPullSelectionCellEditor(PushPullSelectionStage stage, mxGraphComponent graphComponent) { + super(stage, graphComponent); + } + + @Override + public Object getEditingCell() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void startEditing(Object arg0, EventObject arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void stopEditing(boolean arg0) { + // TODO Auto-generated method stub + + } + +}