diff --git a/AlgebraicDataflowArchitectureModel/src/application/ApplicationWindow.java b/AlgebraicDataflowArchitectureModel/src/application/ApplicationWindow.java index 4630830..17a33ab 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/ApplicationWindow.java +++ b/AlgebraicDataflowArchitectureModel/src/application/ApplicationWindow.java @@ -19,7 +19,7 @@ import application.editor.Editor; import application.editor.stages.DataFlowCellEditor; import application.views.NavigationWindow; -import application.views.controlFlowDelegation.ShowFlowWindow; +import application.views.controlFlowDelegation.ShowFlowLayerWindow; public class ApplicationWindow extends JFrame { private static final long serialVersionUID = -8690140317781055614L; @@ -31,7 +31,7 @@ private ApplicationMenuBar menuBar = null; private NavigationWindow navigationWindow = null; - private ShowFlowWindow FlowLayerWindow = null; + private ShowFlowLayerWindow showFlowLayerWindow = null; public ApplicationWindow() { setTitle(title); @@ -65,11 +65,11 @@ navigationWindow = new NavigationWindow(this, editor); navigationWindow.setVisible(true); - FlowLayerWindow = new ShowFlowWindow(this); - FlowLayerWindow.setVisible(false); + showFlowLayerWindow = new ShowFlowLayerWindow(this); + showFlowLayerWindow.setVisible(false); editor.addStageChangeListener(navigationWindow); - editor.addStageChangeListener(FlowLayerWindow); + editor.addStageChangeListener(showFlowLayerWindow); } public mxGraph getGraph() { @@ -93,7 +93,7 @@ } public void showSwitchLayerWindow() { - FlowLayerWindow.setVisible(true); + showFlowLayerWindow.setVisible(true); } } diff --git a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationStage.java b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationStage.java index 59542e5..72eb256 100644 --- a/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationStage.java +++ b/AlgebraicDataflowArchitectureModel/src/application/editor/stages/ControlFlowDelegationStage.java @@ -464,7 +464,7 @@ ObjectNodeAttribute entryObjAttr = new ObjectNodeAttribute(entryPointObjNode); - // + // Taking over geometry information from the channel node with the same name. mxCell dataFlowLayerCell = (mxCell)root.getChildAt(Stage.DATA_FLOW_LAYER); for(int i = 0; i < dataFlowLayerCell.getChildCount(); i++) { mxCell channelCell =(mxCell)dataFlowLayerCell.getChildAt(i); diff --git a/AlgebraicDataflowArchitectureModel/src/application/views/controlFlowDelegation/ShowFlowLayerWindow.java b/AlgebraicDataflowArchitectureModel/src/application/views/controlFlowDelegation/ShowFlowLayerWindow.java new file mode 100644 index 0000000..f409b46 --- /dev/null +++ b/AlgebraicDataflowArchitectureModel/src/application/views/controlFlowDelegation/ShowFlowLayerWindow.java @@ -0,0 +1,111 @@ +package application.views.controlFlowDelegation; + +import java.awt.Container; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.swing.ButtonGroup; +import javax.swing.JCheckBox; +import javax.swing.JDialog; +import javax.swing.JRadioButton; + +import application.ApplicationWindow; +import application.editor.Editor; +import application.editor.IStageChangeListener; +import application.editor.Stage; +import application.editor.stages.ControlFlowDelegationStage; + +/************************************************************* + * the window has a button group for swichting layers in the control-flow-modeling. + */ +public class ShowFlowLayerWindow extends JDialog implements IStageChangeListener { + private String title = "ShowFlowLayerWindow"; + private JCheckBox dataFlowCheckBox = null; + private JCheckBox pushFlowCheckBox = null; + private JCheckBox pullFlowCheckBox = null; + + private ControlFlowDelegationStage stage = null; + + /************************************************************* + * [ *constructor ] + /************************************************************* + * + */ + public ShowFlowLayerWindow(final ApplicationWindow owner) { + super(owner); + + setTitle(title); + setDefaultCloseOperation(HIDE_ON_CLOSE); + + stage = Editor.STAGE_CONTROL_FLOW_DELEGATION; + + // initialize buttons + dataFlowCheckBox = new JCheckBox("Data-Flow", false); + pushFlowCheckBox = new JCheckBox("Push-Flow", true); + pullFlowCheckBox = new JCheckBox("Pull-Flow", true); + + // each add handler + dataFlowCheckBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + stage.setEnabledForLayer(Stage.DATA_FLOW_LAYER, dataFlowCheckBox.isSelected()); + }}); + + pushFlowCheckBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + stage.setEnabledForLayer(Stage.PUSH_FLOW_LAYER, pushFlowCheckBox.isSelected()); + }}); + + pullFlowCheckBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + stage.setEnabledForLayer(Stage.PULL_FLOW_LAYER, pullFlowCheckBox.isSelected()); + }}); + + dataFlowCheckBox.setEnabled(false); + pushFlowCheckBox.setEnabled(false); + pullFlowCheckBox.setEnabled(false); + + // initialize panel + Container panel = getContentPane(); + panel.setLayout(new GridLayout(/*low*/3, /*col*/1)); + panel.add(dataFlowCheckBox); + panel.add(pushFlowCheckBox); + panel.add(pullFlowCheckBox); + + pack(); + setResizable(false); + } + + /************************************************************* + * [ *public ] + /************************************************************* + * + */ + @Override + public void stageChanged(Stage newStage) { + if((newStage instanceof ControlFlowDelegationStage)) { + + dataFlowCheckBox.setEnabled(true); + pushFlowCheckBox.setEnabled(true); + pullFlowCheckBox.setEnabled(true); + + newStage.setEnabledForLayer(Stage.PUSH_FLOW_LAYER, pushFlowCheckBox.isSelected()); + newStage.setEnabledForLayer(Stage.PULL_FLOW_LAYER, pullFlowCheckBox.isSelected()); + } + else { + dataFlowCheckBox.setEnabled(false); + pushFlowCheckBox.setEnabled(false); + pullFlowCheckBox.setEnabled(false); + + newStage.setEnabledForLayer(Stage.PUSH_FLOW_LAYER, false); + newStage.setEnabledForLayer(Stage.PULL_FLOW_LAYER, false); + } + } +} + diff --git a/AlgebraicDataflowArchitectureModel/src/application/views/controlFlowDelegation/ShowFlowWindow.java b/AlgebraicDataflowArchitectureModel/src/application/views/controlFlowDelegation/ShowFlowWindow.java deleted file mode 100644 index 34c1d6a..0000000 --- a/AlgebraicDataflowArchitectureModel/src/application/views/controlFlowDelegation/ShowFlowWindow.java +++ /dev/null @@ -1,111 +0,0 @@ -package application.views.controlFlowDelegation; - -import java.awt.Container; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.swing.ButtonGroup; -import javax.swing.JCheckBox; -import javax.swing.JDialog; -import javax.swing.JRadioButton; - -import application.ApplicationWindow; -import application.editor.Editor; -import application.editor.IStageChangeListener; -import application.editor.Stage; -import application.editor.stages.ControlFlowDelegationStage; - -/************************************************************* - * the window has a button group for swichting layers in the control-flow-modeling. - */ -public class ShowFlowWindow extends JDialog implements IStageChangeListener { - private String title = "ShowFlowWindow"; - private JCheckBox dataFlowCheckBox = null; - private JCheckBox pushFlowCheckBox = null; - private JCheckBox pullFlowCheckBox = null; - - private ControlFlowDelegationStage stage = null; - - /************************************************************* - * [ *constructor ] - /************************************************************* - * - */ - public ShowFlowWindow(final ApplicationWindow owner) { - super(owner); - - setTitle(title); - setDefaultCloseOperation(HIDE_ON_CLOSE); - - stage = Editor.STAGE_CONTROL_FLOW_DELEGATION; - - // initialize buttons - dataFlowCheckBox = new JCheckBox("Data-Flow", false); - pushFlowCheckBox = new JCheckBox("Push-Flow", true); - pullFlowCheckBox = new JCheckBox("Pull-Flow", true); - - // each add handler - dataFlowCheckBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - stage.setEnabledForLayer(Stage.DATA_FLOW_LAYER, dataFlowCheckBox.isSelected()); - }}); - - pushFlowCheckBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - stage.setEnabledForLayer(Stage.PUSH_FLOW_LAYER, pushFlowCheckBox.isSelected()); - }}); - - pullFlowCheckBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - stage.setEnabledForLayer(Stage.PULL_FLOW_LAYER, pullFlowCheckBox.isSelected()); - }}); - - dataFlowCheckBox.setEnabled(false); - pushFlowCheckBox.setEnabled(false); - pullFlowCheckBox.setEnabled(false); - - // initialize panel - Container panel = getContentPane(); - panel.setLayout(new GridLayout(/*low*/3, /*col*/1)); - panel.add(dataFlowCheckBox); - panel.add(pushFlowCheckBox); - panel.add(pullFlowCheckBox); - - pack(); - setResizable(false); - } - - /************************************************************* - * [ *public ] - /************************************************************* - * - */ - @Override - public void stageChanged(Stage newStage) { - if((newStage instanceof ControlFlowDelegationStage)) { - - dataFlowCheckBox.setEnabled(true); - pushFlowCheckBox.setEnabled(true); - pullFlowCheckBox.setEnabled(true); - - newStage.setEnabledForLayer(Stage.PUSH_FLOW_LAYER, pushFlowCheckBox.isSelected()); - newStage.setEnabledForLayer(Stage.PULL_FLOW_LAYER, pullFlowCheckBox.isSelected()); - } - else { - dataFlowCheckBox.setEnabled(false); - pushFlowCheckBox.setEnabled(false); - pullFlowCheckBox.setEnabled(false); - - newStage.setEnabledForLayer(Stage.PUSH_FLOW_LAYER, false); - newStage.setEnabledForLayer(Stage.PULL_FLOW_LAYER, false); - } - } -} -