01: //Copyright (c) Hans-Joachim Daniels 2005
02: //
03: //This program is free software; you can redistribute it and/or modify
04: //it under the terms of the GNU General Public License as published by
05: //the Free Software Foundation; either version 2 of the License, or
06: //(at your option) any later version.
07: //
08: //This program is distributed in the hope that it will be useful,
09: //but WITHOUT ANY WARRANTY; without even the implied warranty of
10: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: //GNU General Public License for more details.
12: //
13: //You can either finde the file LICENSE or LICENSE.TXT in the source
14: //distribution or in the .jar file of this application
15:
16: package de.uka.ilkd.key.ocl.gf;
17:
18: import javax.swing.tree.DefaultMutableTreeNode;
19:
20: /**
21: * A class to store the result of the tree analysis done in formTree
22: * @author daniels
23: */
24: class TreeAnalysisResult {
25: /**
26: * The command, that is to be executed next automatically
27: */
28: String command;
29: /**
30: * the number of undo steps needed to undo command
31: */
32: int undoSteps;
33: /**
34: * reduceCoerce Whether the mechanism to produce a reduced
35: * refinement menu for coerce's 4th argument should kick in or not.
36: */
37: boolean reduceCoerce;
38: /**
39: * If the editor should ask GF if self an result are applicable here or not
40: */
41: boolean probeSelfResult;
42: /**
43: * If we at the the Instance Argument of a hidden
44: * coerce, we mark that (to change the d command)
45: */
46: boolean deleteAlsoAbove;
47: /**
48: * if the attributes of self should be added to the refinement menu.
49: */
50: boolean easyAttributes;
51: DefaultMutableTreeNode selectedNode = null;
52: /**
53: * The currently selected node
54: */
55: GfAstNode currentNode;
56: /**
57: * Where the cursor in GF is.
58: * Correct is not yet known and thus always true.
59: */
60: LinPosition focusPosition;
61:
62: /**
63: * Just sets both values.
64: * @param command The command, that is to be executed next automatically
65: * @param undoSteps the number of undo steps needed to undo command
66: * @param reduceCoerce Whether the mechanism to produce a reduced
67: * refinement menu for coerce's 4th argument should kick in or not.
68: * @param probeSelfResult If the editor should ask GF if self an result
69: * are applicable here or not
70: * @param deleteAlsoAbove If we at the the Instance Argument of a hidden
71: * coerce, we mark that (to change the d command)
72: * @param easyAttributes if the attributes of self should be added to the
73: * refinement menu.
74: * @param currentNode The currently selected node
75: * @param focusPosition Where the cursor in GF is.
76: * Correct is not yet known and thus always true.
77: */
78: public TreeAnalysisResult(String command, int undoSteps,
79: boolean reduceCoerce, boolean probeSelfResult,
80: boolean deleteAlsoAbove, boolean easyAttributes,
81: GfAstNode currentNode, LinPosition focusPosition) {
82: this .command = command;
83: this .undoSteps = undoSteps;
84: this .reduceCoerce = reduceCoerce;
85: this .probeSelfResult = probeSelfResult;
86: this .deleteAlsoAbove = deleteAlsoAbove;
87: this .currentNode = currentNode;
88: this .easyAttributes = easyAttributes;
89: this .focusPosition = focusPosition;
90: }
91:
92: public String toString() {
93: return this .command + "|" + this .reduceCoerce + "|"
94: + this .undoSteps + "|" + this.probeSelfResult;
95: }
96: }
|