From 1e6c7a0d08c57dcc6e32f5a63f41979e235a9de5 Mon Sep 17 00:00:00 2001 From: Justin Geeslin Date: Wed, 21 Oct 2020 07:03:38 -0500 Subject: [PATCH 1/6] Apparent typo in this comment --- java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java b/java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java index aa034d1d..7c98f291 100644 --- a/java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java +++ b/java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java @@ -164,7 +164,7 @@ public WidgetChangeText(Composite parent, * If no widgets are selected, suppresses the event. * * IE: raise an LID event. - * @param e + * @param focusRule */ @Override public boolean confirm(int focusRule) From fe328c27d6c37d1512f5156dd8abb4bc89586efb Mon Sep 17 00:00:00 2001 From: Justin Geeslin Date: Wed, 21 Oct 2020 07:23:40 -0500 Subject: [PATCH 2/6] =?UTF-8?q?Helping=20the=20debugger=20resolve=20?= =?UTF-8?q?=E2=80=98view=E2=80=99=20to=20the=20appropriate=20CogTool=20Vie?= =?UTF-8?q?w=20instead=20of=20SWT/Cocoa=E2=80=99s=20NSView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUI.java | 2 +- java/edu/cmu/cs/hcii/cogtool/ui/FrameEditorUI.java | 2 +- .../cmu/cs/hcii/cogtool/view/ActionPropertySet.java | 12 ++++++------ .../cs/hcii/cogtool/view/FramePropertiesPane.java | 12 ++++++++---- .../cs/hcii/cogtool/view/WidgetPropertiesPane.java | 4 ++-- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUI.java b/java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUI.java index 966ef57a..99456d39 100644 --- a/java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUI.java +++ b/java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUI.java @@ -168,7 +168,7 @@ protected class FrameNameEditor extends SWTTextEditor { public FrameNameEditor() { - super(view.getEditor().getSWTEditorSubstrate(), CENTER_TEXT); + super(DesignEditorUI.this.view.getEditor().getSWTEditorSubstrate(), CENTER_TEXT); } @Override diff --git a/java/edu/cmu/cs/hcii/cogtool/ui/FrameEditorUI.java b/java/edu/cmu/cs/hcii/cogtool/ui/FrameEditorUI.java index eb303bd8..0a09febb 100644 --- a/java/edu/cmu/cs/hcii/cogtool/ui/FrameEditorUI.java +++ b/java/edu/cmu/cs/hcii/cogtool/ui/FrameEditorUI.java @@ -1055,7 +1055,7 @@ protected class WidgetTitleEditor extends SWTTextEditor { public WidgetTitleEditor() { - super(view.getEditor().getSWTEditorSubstrate(), LEFT_JUSTIFY); + super(FrameEditorUI.this.view.getEditor().getSWTEditorSubstrate(), LEFT_JUSTIFY); } @Override diff --git a/java/edu/cmu/cs/hcii/cogtool/view/ActionPropertySet.java b/java/edu/cmu/cs/hcii/cogtool/view/ActionPropertySet.java index 1ea2aaf8..652e2d81 100644 --- a/java/edu/cmu/cs/hcii/cogtool/view/ActionPropertySet.java +++ b/java/edu/cmu/cs/hcii/cogtool/view/ActionPropertySet.java @@ -1169,7 +1169,7 @@ protected void onFocus() { super.onFocus(); - view.getTransmuter().setLIDEnabledState(); + ActionPropertySet.this.view.getTransmuter().setLIDEnabledState(); } @Override @@ -1182,7 +1182,7 @@ protected boolean doChangeAction() labelSelection = null; } - if (view.performAction(DesignEditorLID.ChangeDelay)) { + if (ActionPropertySet.this.view.performAction(DesignEditorLID.ChangeDelay)) { if (labelSelection != null) { setSelection(labelSelection); } @@ -1208,7 +1208,7 @@ protected void onFocus() { super.onFocus(); - view.getTransmuter().setLIDEnabledState(); + ActionPropertySet.this.view.getTransmuter().setLIDEnabledState(); } @Override @@ -1229,7 +1229,7 @@ protected boolean doChangeAction() delaySelection = null; } - if (view.performAction(DesignEditorLID.ChangeDelay)) { + if (ActionPropertySet.this.view.performAction(DesignEditorLID.ChangeDelay)) { if (delaySelection != null) { setSelection(delaySelection); } @@ -1340,7 +1340,7 @@ protected void onFocus() { super.onFocus(); - view.getTransmuter().setLIDEnabledState(); + ActionPropertySet.this.view.getTransmuter().setLIDEnabledState(); } @Override @@ -1351,7 +1351,7 @@ protected boolean doChangeAction() DesignEditorUI.DesignRenameParameters parms = new DesignEditorUI.DesignRenameParameters(design, designName.getText()); - boolean changed = view.performAction(ProjectLID.RenameDesign, + boolean changed = ActionPropertySet.this.view.performAction(ProjectLID.RenameDesign, parms, true); diff --git a/java/edu/cmu/cs/hcii/cogtool/view/FramePropertiesPane.java b/java/edu/cmu/cs/hcii/cogtool/view/FramePropertiesPane.java index dabe5f18..9dad9961 100644 --- a/java/edu/cmu/cs/hcii/cogtool/view/FramePropertiesPane.java +++ b/java/edu/cmu/cs/hcii/cogtool/view/FramePropertiesPane.java @@ -155,13 +155,17 @@ public class FramePropertiesPane extends Composite private TreeItemUpdater eltGroupUpdater; private TreeItemUpdater implicitGroupUpdater; + protected View view; + public FramePropertiesPane(Composite parent, int style, View view) { super(parent, style); setLayout(new FormLayout()); - createWidgets(view); + this.view = view; + + createWidgets(); layOutWidgets(); } @@ -234,7 +238,7 @@ protected void layOutWidgets() } } - protected void createWidgets(final View view) + protected void createWidgets() { ListenerIdentifierMap lidMap = view.getLIDMap(); @@ -249,7 +253,7 @@ protected void onFocus() { super.onFocus(); - view.getTransmuter().setLIDEnabledState(); + FramePropertiesPane.this.view.getTransmuter().setLIDEnabledState(); } @Override @@ -259,7 +263,7 @@ protected boolean doChangeAction() DesignEditorUI.FrameRenameParameters evt = new DesignEditorUI.FrameRenameParameters(frame, getText()); boolean changed = - view.performAction(DesignEditorLID.RenameFrame, + FramePropertiesPane.this.view.performAction(DesignEditorLID.RenameFrame, evt, true); diff --git a/java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java b/java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java index 7c98f291..25e35583 100644 --- a/java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java +++ b/java/edu/cmu/cs/hcii/cogtool/view/WidgetPropertiesPane.java @@ -563,9 +563,9 @@ protected boolean doChangeAction() FrameEditorUI.SetRemoteLabelTypeParms setTypeParms = new FrameEditorUI.SetRemoteLabelTypeParms(widgetTypeChoices[selectedType], - view.selection.getSelectedIWidgets()[0]); + WidgetPropertiesPane.this.view.selection.getSelectedIWidgets()[0]); - return view.performAction(FrameEditorLID.SetRemoteLabelType, + return WidgetPropertiesPane.this.view.performAction(FrameEditorLID.SetRemoteLabelType, setTypeParms, true); } From 07dc45fdb1a035af8b6e79da6e8a02923fe30b43 Mon Sep 17 00:00:00 2001 From: Justin Geeslin Date: Wed, 21 Oct 2020 07:23:59 -0500 Subject: [PATCH 3/6] Hopefully, helpful intellij settings --- .idea/.gitignore | 3 +++ .idea/ant.xml | 6 ++++++ .idea/cogtool-intellij2.iml | 16 ++++++++++++++++ .idea/libraries/build.xml | 9 +++++++++ .idea/libraries/lib.xml | 19 +++++++++++++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 8 files changed, 73 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/ant.xml create mode 100644 .idea/cogtool-intellij2.iml create mode 100644 .idea/libraries/build.xml create mode 100644 .idea/libraries/lib.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/ant.xml b/.idea/ant.xml new file mode 100644 index 00000000..a2a47698 --- /dev/null +++ b/.idea/ant.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/cogtool-intellij2.iml b/.idea/cogtool-intellij2.iml new file mode 100644 index 00000000..2e474d82 --- /dev/null +++ b/.idea/cogtool-intellij2.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/build.xml b/.idea/libraries/build.xml new file mode 100644 index 00000000..d0ee7741 --- /dev/null +++ b/.idea/libraries/build.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml new file mode 100644 index 00000000..422f135a --- /dev/null +++ b/.idea/libraries/lib.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..e6bd007b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..901751d0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 007dd0bd3c7350cd6edd24fe636cbbc00cbca930 Mon Sep 17 00:00:00 2001 From: Justin Geeslin Date: Wed, 21 Oct 2020 22:43:38 -0500 Subject: [PATCH 4/6] Correcting out of date javadoc comments about parameters --- java/edu/cmu/cs/hcii/cogtool/model/Design.java | 2 +- java/edu/cmu/cs/hcii/cogtool/ui/UI.java | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/java/edu/cmu/cs/hcii/cogtool/model/Design.java b/java/edu/cmu/cs/hcii/cogtool/model/Design.java index 700a9ff2..ff1be3ba 100644 --- a/java/edu/cmu/cs/hcii/cogtool/model/Design.java +++ b/java/edu/cmu/cs/hcii/cogtool/model/Design.java @@ -666,7 +666,7 @@ public static class FrameSetChange extends EventObject * Initialize the semantic change representing an add or a remove. * * @param design the design that was modified - * @param frames the frames added or removed + * @param frameChg the frames added or removed * @param add a flag indicating whether the change is an add * or a remove * @author mlh diff --git a/java/edu/cmu/cs/hcii/cogtool/ui/UI.java b/java/edu/cmu/cs/hcii/cogtool/ui/UI.java index 008b3b4c..861fea37 100644 --- a/java/edu/cmu/cs/hcii/cogtool/ui/UI.java +++ b/java/edu/cmu/cs/hcii/cogtool/ui/UI.java @@ -671,7 +671,6 @@ public void setEnabled(CogToolLID id, Boolean availability, boolean enable) * @param newLabel if not null, the new label to use for the user interface * widgets associated with the given id that support labels * @author mlh - * @see ListenerIdentifierMap.getWidgets */ public void setEnabled(CogToolLID id, @@ -700,7 +699,6 @@ public void setEnabled(CogToolLID id, * widgets associated with the given id that support labels * @param selected for all associated widgets that are MenuItems set * their selection state to this - * @see ListenerIdentifierMap.getWidgets */ public void setEnabled(CogToolLID id, Boolean availability, @@ -1250,8 +1248,6 @@ protected boolean doesIDCommitChanges(ListenerIdentifier lid) * from the appropriate IUndoableEdit from the given undo manager. * * @param lid the CogTool command being queried - * @param undoMgr the window's undo manager in case the given LID is - * CogToolLID.Undo or CogToolLID.Redo * @return whether the given LID is a CogToolLID that * can cause selection */ From 2ac03e37692dfe53cbc7cd172106b1d4307332e5 Mon Sep 17 00:00:00 2001 From: Justin Geeslin Date: Wed, 21 Oct 2020 22:48:02 -0500 Subject: [PATCH 5/6] The very first CogTool test. Design class. --- .idea/cogtool-intellij2.iml | 10 +++++++ .../cmu/cs/hcii/cogtool/model/DesignTest.java | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 java/edu/cmu/cs/hcii/cogtool/model/DesignTest.java diff --git a/.idea/cogtool-intellij2.iml b/.idea/cogtool-intellij2.iml index 2e474d82..a63dc2dc 100644 --- a/.idea/cogtool-intellij2.iml +++ b/.idea/cogtool-intellij2.iml @@ -12,5 +12,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/java/edu/cmu/cs/hcii/cogtool/model/DesignTest.java b/java/edu/cmu/cs/hcii/cogtool/model/DesignTest.java new file mode 100644 index 00000000..23029aee --- /dev/null +++ b/java/edu/cmu/cs/hcii/cogtool/model/DesignTest.java @@ -0,0 +1,27 @@ +package edu.cmu.cs.hcii.cogtool.model; + +import org.junit.Test; + +import java.util.HashSet; +import java.util.Set; + +import static org.junit.Assert.*; + +public class DesignTest { + + private String designName = "My First Design"; + Set deviceTypeSet = new HashSet(); + private Design aDesign = new Design(designName, deviceTypeSet); + + @Test + public void getName() { + assertEquals(designName, aDesign.getName()); + } + + @Test + public void setName() { + String designName = "My Second Design"; + aDesign.setName(designName); + assertEquals(designName, aDesign.name); + } +} \ No newline at end of file From ae3ffb21168f5e68ee86adc7753f9cf2ed595fc8 Mon Sep 17 00:00:00 2001 From: Justin Geeslin Date: Wed, 21 Oct 2020 22:52:34 -0500 Subject: [PATCH 6/6] Second test, one method in DesignEditorUI --- .../hcii/cogtool/ui/DesignEditorUITest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUITest.java diff --git a/java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUITest.java b/java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUITest.java new file mode 100644 index 00000000..8bdda76c --- /dev/null +++ b/java/edu/cmu/cs/hcii/cogtool/ui/DesignEditorUITest.java @@ -0,0 +1,26 @@ +package edu.cmu.cs.hcii.cogtool.ui; + +import edu.cmu.cs.hcii.cogtool.model.Design; +import edu.cmu.cs.hcii.cogtool.model.DeviceType; +import edu.cmu.cs.hcii.cogtool.model.Project; +import org.junit.Test; + +import java.util.HashSet; +import java.util.Set; + +import static org.junit.Assert.*; + +public class DesignEditorUITest { + + @Test + public void buildWindowMenuLabel() { + Project aProject = new Project("My First Project"); + + String designName = "My First Design"; + Set deviceTypeSet = new HashSet(); + Design aDesign = new Design(designName, deviceTypeSet); + + DesignEditorUI anEditorUI = new DesignEditorUI(aDesign,aProject, null); + assertEquals("Design: " + designName, anEditorUI.buildWindowMenuLabel(aDesign)); + } +} \ No newline at end of file