2121import com .google .gwt .user .client .ui .TabLayoutPanel ;
2222import com .google .gwt .user .client .ui .Widget ;
2323
24+ //TODO: do some basic testing of versioning of deleted top level nodes
25+ /* TODO transition ModeEdit to the new dummy node approach and get rid of ViewDummyVer */
26+
2427/* TODO: ModeVersions: for some reason child nodes of a deleted and re-added link are not showing up in the first attachement of the node
2528 * so you have to browse to a later point in time, and open up the link, and the go back in time, in order to open up the link node.
2629 * (Not sure if the problem is confined to links or not.)
2730 */
28- /*TODO: what happens in ModeVersions if I first link to a node as negated, then delete it, then link to it as non-negated and delete that
29- * (or vice-versa)? Nodes are stores by ID in the deletedNodes list. Since its stored in a hashmap, storing the same deleted node twice will
30- * result in only one copy. Will that work for storing the history? One thing I want to work out below is only storing the history for a
31- * link that is relevant to the time that it exists in the tree so there aren't a lot of extra changes in the change list. Will having
32- * only one copy complicate that? If so maybe I could save in a list or a hashmap keyed on date instead of ID (or ID and date, or something)...
33- *
34- * Regardless, as far as negation is concerned, if there is only one copy, I can't depend on it to have the right negated value when
35- * it is re-added to the tree for the first time.
36- */
37- /*TODO: test opening negated links in versions mode (probably won't work!!!); also make sure to
38- * test adding a link as negated, removing it, adding at not negated, (and the reverse order) and see if
39- * versions mode gets it right.
40- */
41-
4231/*TODO: client throws an exception when removing a link and re-adding it (at least if you make a single change to the link in the interim
4332 * I haven't tested other scenarios yet) */
44- /* TODO transition ModeEdit to the new dummy node approach and get rid of ViewDummyVer */
45- /* TODO when a root proposition is first added, program suggest using it instead (as a link) of itself! */
4633//TODO: fix versions mode formating of links
47- //TODO: versioning root node with no modifications/adds throws exception because of empty change list
48- //TODO: do some basic testing of versioning of deleted top level nodes
34+
4935/*TODO: fix exceptions when opening circular links in versions mode and continue testings version mode's handling of circular linking*/
5036/*TODO: track down exceptions in ModeVersion (unrelated to circular linking)*/
5137/*TODO: versions mode: update link coloring depending on whether a proposition is currently a link?
5844 * proposition it would update the props link status. If it was an argument it would just do what it currently does.
5945 * This way the system would work for propositions whose link coloring is changed by a linking/unlinking not within
6046 * the tree being viewed by the user...
47+ *
48+ * This seems to be related too: TO DO: ModeVersions: undoing unlinks does not restore the link's yellow color if the link *currently* is not
49+ * linked to by more than one argument because the server sends the current proposition which
50+ * indicates a link count of 1. This could be addressed by having a proposition's link/unlink
51+ * events also be owned by that proposition in VersionsMode, and hiding them probably (because
52+ * they may be interesting only in regards to the color of the node because the unlink/link
53+ * events may be with regards to arguments that are not currently opened) and treating
54+ * them as only coloring events when moving forwards and backwards (thus in some cases there
55+ * would be two link/unlink ViewChanges, one for the proposition whose link count is being updated
56+ * and one for the argument which needs to either display or hide the linked proposition). The forwards/backwards
57+ * methods could distinguish between links/unlinks that were to be treated only as coloring events versus
58+ * ones that would be treated as displaying/removing the linked proposition based on whether the ViewNodeVer
59+ * object contained in the ViewChange object was a ViewPropVer or a ViewArgVer. If it's a ViewArgVer
60+ * it would display/remove the linked proposition. If it's a ViewPropVer it would simply update the link
61+ * count and change the color from yellow to white if it falls below 2, and vice versa. This would require a
62+ * change on the server to return the coloring events for a proposition, and would require changes on the client
63+ * to insert the coloring events into the timeMachineMap and so forth.
6164 */
65+ /* TODO when a root proposition is first added, program suggest using it instead (as a link) of itself! */
6266//TODO: comment the hell out of versions mode!!!!!!! someday I'll need to change it...
6367
6468//TODO: add 'real' example arguments for demonstration (for instance my argument about legalizing unauthorized access)
8286//TODO: try running speed tracer
8387//TODO: make batch open icon visible, and open tree a few layers deep regardless of whether mouse over node is already loaded
8488//TODO: batch open icon not visible/clickable on props that reach right screen edge
85- /*TODO: ModeVersions: undoing unlinks does not restore the link's yellow color if the link *currently* is not
86- * linked to by more than one argument because the server sends the current proposition which
87- * indicates a link count of 1. This could be addressed by having a proposition's link/unlink
88- * events also be owned by that proposition in VersionsMode, and hiding them probably (because
89- * they may be interesting only in regards to the color of the node because the unlink/link
90- * events may be with regards to arguments that are not currently opened) and treating
91- * them as only coloring events when moving forwards and backwards (thus in some cases there
92- * would be two link/unlink ViewChanges, one for the proposition whose link count is being updated
93- * and one for the argument which needs to either display or hide the linked proposition). The forwards/backwards
94- * methods could distinguish between links/unlinks that were to be treated only as coloring events versus
95- * ones that would be treated as displaying/removing the linked proposition based on whether the ViewNodeVer
96- * object contained in the ViewChange object was a ViewPropVer or a ViewArgVer. If it's a ViewArgVer
97- * it would display/remove the linked proposition. If it's a ViewPropVer it would simply update the link
98- * count and change the color from yellow to white if it falls below 2, and vice versa. This would require a
99- * change on the server to return the coloring events for a proposition, and would require changes on the client
100- * to insert the coloring events into the timeMachineMap and so forth.
101- */
10289//TODO: figure out how to make server log more than info, warn and severe while in hosted mode...
10390
10491/*TODO: move changes from propID/argID to parentID/childID (this will make querying more efficient: want
148135public class ArgMap implements EntryPoint , UncaughtExceptionHandler ,
149136 SelectionHandler <Integer > {
150137
151- private ModeEdit editMode ;
138+ private ModeEdit modeEdit ;
152139
153140 private DockLayoutPanel mainPanel ;
154141 private TabLayoutPanel modePanel ;
155142 private HorizontalPanel loginPanel ;
156143
157144 private HTML messageArea ;
158145 private MultiMap <String , Message > messageMap ;
159- private ModeVersions versionsMode ;
146+ private ModeVersions modeVersions ;
160147 private static ArgMap argMap ;
161148 private boolean loggedIn ;
162149
163150 public void onModuleLoad () {
164151 argMap = this ;
165152 messageArea = new HTML ();
166153 messageMap = new MultiMap <String , Message >();
167- editMode = new ModeEdit (this );
154+ modeEdit = new ModeEdit (this );
168155
169156 GWT .runAsync (new AsyncRunCallback () {
170157
@@ -175,7 +162,7 @@ public void onSuccess() {
175162 loginPanel = new HorizontalPanel ();
176163
177164 GWT .setUncaughtExceptionHandler (ArgMap .this );
178- modePanel .add (editMode , "Find And Collaborate" );
165+ modePanel .add (modeEdit , "Find And Collaborate" );
179166
180167 modePanel .addSelectionHandler (ArgMap .this );
181168
@@ -258,29 +245,33 @@ public static boolean loggedIn() {
258245 return argMap .loggedIn ;
259246 }
260247
248+ public void gotoModeEdit () {
249+ modePanel .selectTab (modeEdit );
250+ }
251+
261252 public void showVersions () {
262253 if (!versionsIsDisplayed ()) {
263254 GWT .runAsync (new AsyncRunCallback () {
264255
265256 @ Override
266257 public void onSuccess () {
267- if (versionsMode == null ) {
268- versionsMode = new ModeVersions (editMode );
258+ if (modeVersions == null ) {
259+ modeVersions = new ModeVersions (ArgMap . this );
269260 }
270- modePanel .insert (versionsMode , "History" , 1 );
261+ modePanel .insert (modeVersions , "History" , 1 );
271262 }
272263 });
273264 }
274265 }
275266
276267 public void hideVersions () {
277268 if (versionsIsDisplayed ()) {
278- modePanel .remove (versionsMode );
269+ modePanel .remove (modeVersions );
279270 }
280271 }
281272
282273 private boolean versionsIsDisplayed () {
283- if (modePanel .getWidgetIndex (versionsMode ) == -1 ) {
274+ if (modePanel .getWidgetIndex (modeVersions ) == -1 ) {
284275 return false ;
285276 } else {
286277 return true ;
@@ -410,14 +401,14 @@ public void onUncaughtException(Throwable e) {
410401 }
411402
412403 public ModeEdit getModeEdit () {
413- return editMode ;
404+ return modeEdit ;
414405 }
415406
416407 @ Override
417408 public void onSelection (SelectionEvent <Integer > event ) {
418409 Widget widget = modePanel .getWidget (modePanel .getSelectedIndex ());
419- if (widget == versionsMode ) {
420- versionsMode .displayVersions ();
410+ if (widget == modeVersions ) {
411+ modeVersions .displayVersions ();
421412 }
422413 }
423414
0 commit comments