Merge lp:~tapaal-contributor/tapaal/queryDialogToolTips into lp:tapaal
- queryDialogToolTips
- Merge into trunk
Proposed by
Jakob Taankvist
Status: | Merged |
---|---|
Approved by: | Kenneth Yrke Jørgensen |
Approved revision: | 634 |
Merged at revision: | 628 |
Proposed branch: | lp:~tapaal-contributor/tapaal/queryDialogToolTips |
Merge into: | lp:tapaal |
Diff against target: |
583 lines (+218/-47) 1 file modified
src/pipe/gui/widgets/QueryDialog.java (+218/-47) |
To merge this branch: | bzr merge lp:~tapaal-contributor/tapaal/queryDialogToolTips |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kenneth Yrke Jørgensen | Approve | ||
Jiri Srba | Approve | ||
Review via email: mp+82310@code.launchpad.net |
Commit message
Added tooltips to the query dialog, and created an advanced/simple view option in the query dialog
Description of the change
Added tooltips to the query dialog, and created an advanced/simple view option in the query dialog
To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) : | # |
review:
Approve
Revision history for this message
Kenneth Yrke Jørgensen (yrke) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/pipe/gui/widgets/QueryDialog.java' |
2 | --- src/pipe/gui/widgets/QueryDialog.java 2011-10-14 12:03:06 +0000 |
3 | +++ src/pipe/gui/widgets/QueryDialog.java 2011-11-16 01:52:24 +0000 |
4 | @@ -9,6 +9,7 @@ |
5 | import java.awt.GridBagConstraints; |
6 | import java.awt.GridBagLayout; |
7 | import java.awt.Insets; |
8 | +import java.awt.Point; |
9 | import java.awt.event.ActionEvent; |
10 | import java.awt.event.ActionListener; |
11 | import java.awt.event.ItemEvent; |
12 | @@ -40,6 +41,7 @@ |
13 | import javax.swing.JScrollPane; |
14 | import javax.swing.JSeparator; |
15 | import javax.swing.JSpinner; |
16 | +import javax.swing.JSplitPane; |
17 | import javax.swing.JTextField; |
18 | import javax.swing.JTextPane; |
19 | import javax.swing.ScrollPaneConstants; |
20 | @@ -103,11 +105,11 @@ |
21 | import dk.aau.cs.verification.VerifyTAPN.VerifyTAPNExporter; |
22 | |
23 | public class QueryDialog extends JPanel { |
24 | - |
25 | + |
26 | private static final String NO_UPPAAL_XML_FILE_SAVED = "No Uppaal XML file saved."; |
27 | private static final String NO_VERIFYTAPN_XML_FILE_SAVED = "No verifytapn XML file saved."; |
28 | - private static final String UNSUPPORTED_MODEL_TEXT = "The model is not supported chosen reduction"; |
29 | - private static final String UNSUPPPORTED_QUERY_TEXT = "The chosen query property is not supported by the chosen reduction"; |
30 | + private static final String UNSUPPORTED_MODEL_TEXT = "The model is not supported by the chosen reduction."; |
31 | + private static final String UNSUPPPORTED_QUERY_TEXT = "The query is not supported by the chosen reduction."; |
32 | private static final String EXPORT_UPPAAL_BTN_TEXT = "Export UPPAAL XML"; |
33 | private static final String EXPORT_VERIFYTAPN_BTN_TEXT = "Export TAPAAL XML"; |
34 | |
35 | @@ -126,9 +128,11 @@ |
36 | private boolean querySaved = false; |
37 | |
38 | private JRootPane rootPane; |
39 | + private static EscapableDialog guiDialog; |
40 | |
41 | // Query Name Panel; |
42 | private JPanel namePanel; |
43 | + private JButton advancedButton; |
44 | |
45 | // Boundedness check panel |
46 | private JPanel boundednessCheckPanel; |
47 | @@ -220,6 +224,77 @@ |
48 | private TCTLAbstractProperty newProperty; |
49 | private JTextField queryName; |
50 | |
51 | + private Boolean advancedView = false; |
52 | + |
53 | + //Strings for tool tips |
54 | + //Tool tips for top panel |
55 | + private static final String TOOL_TIP_QUERYNAME = "Enter the name of the query."; |
56 | + private static final String TOOL_TIP_INFO_BUTTON = "Get help on the different verification options."; |
57 | + private static final String TOOL_TIP_ADVANCED_VIEW_BUTTON = "Switch to the advanced view."; |
58 | + private static final String TOOL_TIP_SIMPLE_VIEW_BUTTON = "Switch to the simple view."; |
59 | + |
60 | + //Tool tip for query field |
61 | + private final static String TOOL_TIP_QUERY_FIELD = "<html>Click on a part of the query you want to edit.<br />" + |
62 | + "(Queries can be edited also manually by pressing the \"Edit Query\" button.)</html>"; |
63 | + |
64 | + //Tool tips for quantification panel |
65 | + private static final String TOOL_TIP_EXISTS_DIAMOND = "Check if the given marking is reachable in the net."; |
66 | + private static final String TOOL_TIP_EXISTS_BOX = "Check if there is a trace on which all markings satisfy the given property. (Available only for some verification engines.)"; |
67 | + private static final String TOOL_TIP_FORALL_DIAMOND = "Check if on any maxiaml trace there is marking that satisfies the given property. (Available only for some verification engines.)"; |
68 | + |
69 | + private static final String TOOL_TIP_FORALL_BOX = "Check if every reachable marking in the net satifies the given property."; |
70 | + |
71 | + //Tool tips for logic panel |
72 | + private static final String TOOL_TIP_CONJUNCTIONBUTTON = "Expand the currently marked part of the query with a conjunction."; |
73 | + private static final String TOOL_TIP_DISJUNCTIONBUTTON = "Expand the currently marked part of the query with a disjunction."; |
74 | + private static final String TOOL_TIP_NEGATIONBUTTON = "Negate the currently marked part of the query."; |
75 | + |
76 | + //Tool tips for query panel |
77 | + private static final String TOOL_TIP_PLACESBOX = "Choose a place for the predicate."; |
78 | + private static final String TOOL_TIP_TEMPLATEBOX = "Choose a component considered for this predicate."; |
79 | + private static final String TOOL_TIP_RELATIONALOPERATORBOX = "Choose a relational operator comparing the number of tokens in the chosen place."; |
80 | + private static final String TOOL_TIP_PLACEMARKING = "Choose a number of tokens."; |
81 | + private static final String TOOL_TIP_ADDPREDICATEBUTTON = "Add the predicate specified above to the query."; |
82 | + private static final String TOOL_TIP_TRUEPREDICATEBUTTON = "Add the value true to the query."; |
83 | + private static final String TOOL_TIP_FALSEPREDICATEBUTTON = "Add the value false to the query."; |
84 | + |
85 | + //Tool tips for editing panel |
86 | + private static final String TOOL_TIP_DELETEBUTTON = "Delete the currently selected part of the query."; |
87 | + private static final String TOOL_TIP_RESETBUTTON = "Completely reset the query."; |
88 | + private static final String TOOL_TIP_UNDOBUTTON = "Undo the last action."; |
89 | + private static final String TOOL_TIP_REDOBUTTON = "Redo the last undone action."; |
90 | + private static final String TOOL_TIP_EDITQUERYBUTTON = "Edit the query manually."; |
91 | + private final static String TOOL_TIP_PARSE_QUERY = "Parse the manually edited query."; |
92 | + private final static String TOOL_TIP_CANCEL_QUERY = "Cancel manual query creating."; |
93 | + |
94 | + //Tool tips for boundedness check panel |
95 | + private static final String TOOL_TIP_NUMBEROFEXTRATOKENSINNET = "A number of extra tokens allowed in the net."; |
96 | + private static final String TOOL_TIP_KBOUNDED = "Check wheather the net is bounded for the given number of extra tokens."; |
97 | + |
98 | + //Tool tips for reduction options panel |
99 | + private final static String TOOL_TIP_REDUCTION_OPTION = "Choose a verification engine."; |
100 | + private final static String TOOL_TIP_SYMMETRY_REDUCTION = "Apply automatic symmetry reduction."; |
101 | + private final static String TOOL_TIP_DISCRETE_INCLUSION = "<html>This optimization will perform a more advanced inclusion check."; |
102 | + private final static String TOOL_TIP_SELECT_INCLUSION_PLACES = "Manually select places considered for the inclusion check."; |
103 | + |
104 | + //Tool tips for search options panel |
105 | + private final static String TOOL_TIP_HEURISTIC_SEARCH = "<html>Uses a heuiristic method in state space exploration.<br />" + |
106 | + "If heuristic search is not applicable, BFS is used instead.<br/>Click the button <em>Help on the query options</em> to get more info.</html>"; |
107 | + private final static String TOOL_TIP_BREADTH_FIRST_SEARCH = "Explores markings in a breadth first manner."; |
108 | + private final static String TOOL_TIP_DEPTH_FIRST_SEARCH = "Explores markings in a depth first manner."; |
109 | + private final static String TOOL_TIP_RANDOM_SEARCH = "Performs a random exploration of the state space."; |
110 | + |
111 | + //Tool tips for trace options panel |
112 | + private final static String TOOL_TIP_SOME_TRACE = "Show a concrete trace whenever applicable."; |
113 | + private final static String TOOL_TIP_NO_TRACE = "Do not display any trace information."; |
114 | + |
115 | + //Tool tips for buttom panel |
116 | + private final static String TOOL_TIP_SAVE_BUTTON = "Save the query."; |
117 | + private final static String TOOL_TIP_SAVE_AND_VERIFY_BUTTON = "Save and verify the query."; |
118 | + private final static String TOOL_TIP_CANCEL_BUTTON = "Cancel the changes made in this dialog."; |
119 | + private final static String TOOL_TIP_SAVE_UPPAAL_BUTTON = "Export an xml file that can be opened in UPPAAL GUI."; |
120 | + private final static String TOOL_TIP_SAVE_TAPAAL_BUTTON = "Export an xml file that can be used as input for the TAPAAL engine."; |
121 | + |
122 | public QueryDialog(EscapableDialog me, QueryDialogueOption option, |
123 | TAPNQuery queryToCreateFrom, TimedArcPetriNetNetwork tapnNetwork) { |
124 | this.tapnNetwork = tapnNetwork; |
125 | @@ -250,6 +325,7 @@ |
126 | |
127 | private void setQueryFieldEditable(boolean isEditable) { |
128 | queryField.setEditable(isEditable); |
129 | + queryField.setToolTipText(isEditable ? null : TOOL_TIP_QUERY_FIELD); |
130 | } |
131 | |
132 | public TAPNQuery getQuery() { |
133 | @@ -394,24 +470,23 @@ |
134 | } |
135 | |
136 | public static TAPNQuery showQueryDialogue(QueryDialogueOption option, TAPNQuery queryToRepresent, TimedArcPetriNetNetwork tapnNetwork) { |
137 | - EscapableDialog guiDialog = new EscapableDialog(CreateGui.getApp(), "Edit Query", true); |
138 | + guiDialog = new EscapableDialog(CreateGui.getApp(), "Edit Query", true); |
139 | |
140 | Container contentPane = guiDialog.getContentPane(); |
141 | - |
142 | + |
143 | // 1 Set layout |
144 | - contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS)); |
145 | + //contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.PAGE_AXIS)); |
146 | + contentPane.setLayout(new GridBagLayout()); |
147 | |
148 | // 2 Add query editor |
149 | QueryDialog queryDialogue = new QueryDialog(guiDialog, option, queryToRepresent, tapnNetwork); |
150 | contentPane.add(queryDialogue); |
151 | |
152 | guiDialog.setResizable(false); |
153 | - |
154 | - guiDialog.setMinimumSize(new Dimension(885,585)); |
155 | |
156 | // Make window fit contents' preferred size |
157 | guiDialog.pack(); |
158 | - |
159 | + |
160 | // Move window to the middle of the screen |
161 | guiDialog.setLocationRelativeTo(null); |
162 | guiDialog.setVisible(true); |
163 | @@ -670,6 +745,9 @@ |
164 | updateSelection(newProperty); |
165 | resetButton.setText("Reset Query"); |
166 | editQueryButton.setText("Edit Query"); |
167 | + |
168 | + resetButton.setToolTipText(TOOL_TIP_RESETBUTTON); |
169 | + editQueryButton.setToolTipText(TOOL_TIP_EDITQUERYBUTTON); |
170 | enableEditingButtons(); |
171 | |
172 | setEnabledReductionOptions(); |
173 | @@ -679,6 +757,8 @@ |
174 | setQueryFieldEditable(true); |
175 | resetButton.setText("Parse query"); |
176 | editQueryButton.setText("Cancel"); |
177 | + resetButton.setToolTipText(TOOL_TIP_PARSE_QUERY); |
178 | + editQueryButton.setToolTipText(TOOL_TIP_CANCEL_QUERY); |
179 | clearSelection(); |
180 | disableAllQueryButtons(); |
181 | disableEditingButtons(); |
182 | @@ -805,7 +885,7 @@ |
183 | forAllBox.setSelected(true); |
184 | } |
185 | } |
186 | - |
187 | + |
188 | private void initQueryNamePanel() { |
189 | |
190 | JPanel splitter = new JPanel(new BorderLayout()); |
191 | @@ -815,7 +895,8 @@ |
192 | namePanel.add(new JLabel("Query name: ")); |
193 | |
194 | queryName = new JTextField("Query Comment/Name Here", 25); |
195 | - |
196 | + queryName.setToolTipText(TOOL_TIP_QUERYNAME); |
197 | + |
198 | namePanel.add(queryName); |
199 | |
200 | queryName.getDocument().addDocumentListener(new DocumentListener() { |
201 | @@ -835,9 +916,43 @@ |
202 | |
203 | } |
204 | }); |
205 | - |
206 | + advancedButton = new JButton("Advanced view"); |
207 | + advancedButton.setToolTipText(TOOL_TIP_ADVANCED_VIEW_BUTTON); |
208 | + advancedButton.addActionListener(new ActionListener() { |
209 | + |
210 | + @Override |
211 | + public void actionPerformed(ActionEvent arg0) { |
212 | + if(advancedView){ |
213 | + Point location = guiDialog.getLocation(); |
214 | + advancedView = false; |
215 | + advancedButton.setText("Advanced view"); |
216 | + advancedButton.setToolTipText(TOOL_TIP_ADVANCED_VIEW_BUTTON); |
217 | + searchOptionsPanel.setVisible(false); |
218 | + reductionOptionsPanel.setVisible(false); |
219 | + saveUppaalXMLButton.setVisible(false); |
220 | + |
221 | + guiDialog.pack(); |
222 | + guiDialog.setLocation(location); |
223 | + |
224 | + |
225 | + } else { |
226 | + Point location = guiDialog.getLocation(); |
227 | + advancedView = true; |
228 | + advancedButton.setText("Simple view"); |
229 | + advancedButton.setToolTipText(TOOL_TIP_SIMPLE_VIEW_BUTTON); |
230 | + searchOptionsPanel.setVisible(true); |
231 | + reductionOptionsPanel.setVisible(true); |
232 | + saveUppaalXMLButton.setVisible(true); |
233 | + |
234 | + guiDialog.pack(); |
235 | + guiDialog.setLocation(location); |
236 | + } |
237 | + |
238 | + } |
239 | + }); |
240 | |
241 | JButton infoButton = new JButton("Help on the query options"); |
242 | + infoButton.setToolTipText(TOOL_TIP_INFO_BUTTON); |
243 | infoButton.addActionListener(new ActionListener(){ |
244 | public void actionPerformed(ActionEvent arg0) { |
245 | JOptionPane.showMessageDialog(QueryDialog.this, getMessageComponent(), "Help", JOptionPane.INFORMATION_MESSAGE); |
246 | @@ -890,25 +1005,26 @@ |
247 | buffer.append("all query types, while standard and optimized standard support only EF and AG queries but can be often faster."); |
248 | buffer.append("<br/>"); |
249 | buffer.append("</html>"); |
250 | - return buffer.toString(); |
251 | + return buffer.toString(); |
252 | } |
253 | }); |
254 | - JPanel helpPanel = new JPanel(new FlowLayout()); |
255 | - helpPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); |
256 | - helpPanel.add(infoButton); |
257 | + JPanel topButtonPanel = new JPanel(new FlowLayout()); |
258 | + topButtonPanel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); |
259 | + topButtonPanel.add(advancedButton); |
260 | + topButtonPanel.add(infoButton); |
261 | |
262 | splitter.add(namePanel, BorderLayout.LINE_START); |
263 | - splitter.add(helpPanel, BorderLayout.LINE_END); |
264 | + splitter.add(topButtonPanel, BorderLayout.LINE_END); |
265 | |
266 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
267 | gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
268 | gridBagConstraints.gridx = 0; |
269 | gridBagConstraints.gridy = 0; |
270 | - gridBagConstraints.insets = new Insets(0,10,0,10); |
271 | + gridBagConstraints.insets = new Insets(5,10,0,10); |
272 | gridBagConstraints.anchor = GridBagConstraints.WEST; |
273 | add(splitter, gridBagConstraints); |
274 | } |
275 | - |
276 | + |
277 | private void initBoundednessCheckPanel() { |
278 | |
279 | // Number of extra tokens field |
280 | @@ -921,12 +1037,14 @@ |
281 | numberOfExtraTokensInNet.setMaximumSize(new Dimension(55, 30)); |
282 | numberOfExtraTokensInNet.setMinimumSize(new Dimension(55, 30)); |
283 | numberOfExtraTokensInNet.setPreferredSize(new Dimension(55, 30)); |
284 | + numberOfExtraTokensInNet.setToolTipText(TOOL_TIP_NUMBEROFEXTRATOKENSINNET); |
285 | boundednessCheckPanel.add(numberOfExtraTokensInNet); |
286 | |
287 | boundednessCheckPanel.add(new JLabel(" ")); |
288 | |
289 | // Boundedness button |
290 | kbounded = new JButton("Check boundedness"); |
291 | + kbounded.setToolTipText(TOOL_TIP_KBOUNDED); |
292 | kbounded.addActionListener(new ActionListener() { |
293 | public void actionPerformed(ActionEvent evt) { |
294 | Verifier.analyzeKBound(tapnNetwork, getCapacity(), numberOfExtraTokensInNet); |
295 | @@ -940,7 +1058,7 @@ |
296 | gridBagConstraints.anchor = GridBagConstraints.WEST; |
297 | gridBagConstraints.gridx = 0; |
298 | gridBagConstraints.gridy = 0; |
299 | - gridBagConstraints.weightx = 1; |
300 | + gridBagConstraints.weightx = 0; |
301 | gridBagConstraints.fill = GridBagConstraints.VERTICAL; |
302 | uppaalOptionsPanel.add(boundednessCheckPanel, gridBagConstraints); |
303 | } |
304 | @@ -979,6 +1097,7 @@ |
305 | queryField.setBackground(Color.white); |
306 | queryField.setText(newProperty.toString()); |
307 | queryField.setEditable(false); |
308 | + queryField.setToolTipText(TOOL_TIP_QUERY_FIELD); |
309 | |
310 | // Put the text pane in a scroll pane. |
311 | JScrollPane queryScrollPane = new JScrollPane(queryField); |
312 | @@ -1051,6 +1170,12 @@ |
313 | existsBox = new JRadioButton("(EG) There exists a trace on which every marking satisfies:"); |
314 | forAllDiamond = new JRadioButton("(AF) On all traces there is eventually a marking that satisfies:"); |
315 | forAllBox = new JRadioButton("(AG) All reachable markings satisfy:"); |
316 | + |
317 | + //Add tool tips |
318 | + existsDiamond.setToolTipText(TOOL_TIP_EXISTS_DIAMOND); |
319 | + existsBox.setToolTipText(TOOL_TIP_EXISTS_BOX); |
320 | + forAllDiamond.setToolTipText(TOOL_TIP_FORALL_DIAMOND); |
321 | + forAllBox.setToolTipText(TOOL_TIP_FORALL_BOX); |
322 | |
323 | quantificationRadioButtonGroup.add(existsDiamond); |
324 | quantificationRadioButtonGroup.add(existsBox); |
325 | @@ -1141,6 +1266,11 @@ |
326 | conjunctionButton = new JButton("and"); |
327 | disjunctionButton = new JButton("or"); |
328 | negationButton = new JButton("not"); |
329 | + |
330 | + //Add tool tips |
331 | + conjunctionButton.setToolTipText(TOOL_TIP_CONJUNCTIONBUTTON); |
332 | + disjunctionButton.setToolTipText(TOOL_TIP_DISJUNCTIONBUTTON); |
333 | + negationButton.setToolTipText(TOOL_TIP_NEGATIONBUTTON); |
334 | |
335 | logicButtonGroup.add(conjunctionButton); |
336 | logicButtonGroup.add(disjunctionButton); |
337 | @@ -1275,6 +1405,7 @@ |
338 | Dimension d = new Dimension(125, 27); |
339 | placesBox.setMaximumSize(d); |
340 | placesBox.setPreferredSize(d); |
341 | + |
342 | |
343 | Vector<Object> items = new Vector<Object>(tapnNetwork.activeTemplates().size()+1); |
344 | items.addAll(tapnNetwork.activeTemplates()); |
345 | @@ -1357,10 +1488,10 @@ |
346 | placeMarking.setMaximumSize(new Dimension(60, 30)); |
347 | placeMarking.setMinimumSize(new Dimension(60, 30)); |
348 | placeMarking.setPreferredSize(new Dimension(60, 30)); |
349 | - |
350 | + |
351 | gbc.gridx = 2; |
352 | predicatePanel.add(placeMarking, gbc); |
353 | - |
354 | + |
355 | addPredicateButton = new JButton("Add predicate to the query"); |
356 | gbc.gridx = 0; |
357 | gbc.gridy = 2; |
358 | @@ -1395,6 +1526,15 @@ |
359 | gbc.fill = GridBagConstraints.VERTICAL; |
360 | queryPanel.add(predicatePanel, gbc); |
361 | |
362 | + //Add tool tips for predicate panel |
363 | + placesBox.setToolTipText(TOOL_TIP_PLACESBOX); |
364 | + templateBox.setToolTipText(TOOL_TIP_TEMPLATEBOX); |
365 | + relationalOperatorBox.setToolTipText(TOOL_TIP_RELATIONALOPERATORBOX); |
366 | + placeMarking.setToolTipText(TOOL_TIP_PLACEMARKING); |
367 | + addPredicateButton.setToolTipText(TOOL_TIP_ADDPREDICATEBUTTON); |
368 | + truePredicateButton.setToolTipText(TOOL_TIP_TRUEPREDICATEBUTTON); |
369 | + falsePredicateButton.setToolTipText(TOOL_TIP_FALSEPREDICATEBUTTON); |
370 | + |
371 | // Action listeners for predicate panel |
372 | addPredicateButton.addActionListener(new ActionListener() { |
373 | |
374 | @@ -1477,6 +1617,13 @@ |
375 | undoButton = new JButton("Undo"); |
376 | redoButton = new JButton("Redo"); |
377 | editQueryButton = new JButton("Edit query"); |
378 | + |
379 | + //Add tool tips |
380 | + deleteButton.setToolTipText(TOOL_TIP_DELETEBUTTON); |
381 | + resetButton.setToolTipText(TOOL_TIP_RESETBUTTON); |
382 | + undoButton.setToolTipText(TOOL_TIP_UNDOBUTTON); |
383 | + redoButton.setToolTipText(TOOL_TIP_REDOBUTTON); |
384 | + editQueryButton.setToolTipText(TOOL_TIP_EDITQUERYBUTTON); |
385 | |
386 | editingButtonsGroup.add(deleteButton); |
387 | editingButtonsGroup.add(resetButton); |
388 | @@ -1627,7 +1774,7 @@ |
389 | } |
390 | } |
391 | }); |
392 | - |
393 | + |
394 | editQueryButton.addActionListener(new ActionListener() { |
395 | |
396 | public void actionPerformed(ActionEvent arg0) { |
397 | @@ -1657,14 +1804,16 @@ |
398 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
399 | gridBagConstraints.gridx = 0; |
400 | gridBagConstraints.gridy = 3; |
401 | + gridBagConstraints.anchor = GridBagConstraints.WEST; |
402 | gridBagConstraints.insets = new Insets(5,10,5,10); |
403 | - //gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
404 | + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
405 | add(uppaalOptionsPanel, gridBagConstraints); |
406 | |
407 | } |
408 | |
409 | private void initSearchOptionsPanel() { |
410 | searchOptionsPanel = new JPanel(new GridBagLayout()); |
411 | + searchOptionsPanel.setVisible(false); |
412 | |
413 | searchOptionsPanel.setBorder(BorderFactory.createTitledBorder("Search Strategy Options")); |
414 | searchRadioButtonGroup = new ButtonGroup(); |
415 | @@ -1672,6 +1821,12 @@ |
416 | depthFirstSearch = new JRadioButton("Depth first search "); |
417 | randomSearch = new JRadioButton("Random search "); |
418 | heuristicSearch = new JRadioButton("Heuristic search "); |
419 | + |
420 | + breadthFirstSearch.setToolTipText(TOOL_TIP_BREADTH_FIRST_SEARCH); |
421 | + depthFirstSearch.setToolTipText(TOOL_TIP_DEPTH_FIRST_SEARCH); |
422 | + randomSearch.setToolTipText(TOOL_TIP_RANDOM_SEARCH); |
423 | + heuristicSearch.setToolTipText(TOOL_TIP_HEURISTIC_SEARCH); |
424 | + |
425 | searchRadioButtonGroup.add(heuristicSearch); |
426 | searchRadioButtonGroup.add(breadthFirstSearch); |
427 | searchRadioButtonGroup.add(depthFirstSearch); |
428 | @@ -1692,20 +1847,23 @@ |
429 | gridBagConstraints.gridy = 1; |
430 | searchOptionsPanel.add(randomSearch, gridBagConstraints); |
431 | gridBagConstraints = new GridBagConstraints(); |
432 | - gridBagConstraints.anchor = GridBagConstraints.EAST; |
433 | + gridBagConstraints.anchor = GridBagConstraints.WEST; |
434 | gridBagConstraints.gridx = 2; |
435 | gridBagConstraints.gridy = 0; |
436 | - gridBagConstraints.fill = GridBagConstraints.VERTICAL; |
437 | + gridBagConstraints.insets = new Insets(0, 5, 0, 0); |
438 | + gridBagConstraints.fill = GridBagConstraints.BOTH; |
439 | uppaalOptionsPanel.add(searchOptionsPanel, gridBagConstraints); |
440 | |
441 | } |
442 | - |
443 | + |
444 | private void initTraceOptionsPanel() { |
445 | traceOptionsPanel = new JPanel(new GridBagLayout()); |
446 | traceOptionsPanel.setBorder(BorderFactory.createTitledBorder("Trace Options")); |
447 | traceRadioButtonGroup = new ButtonGroup(); |
448 | someTraceRadioButton = new JRadioButton(UPPAAL_SOME_TRACE_STRING); |
449 | noTraceRadioButton = new JRadioButton("No trace"); |
450 | + someTraceRadioButton.setToolTipText(TOOL_TIP_SOME_TRACE); |
451 | + noTraceRadioButton.setToolTipText(TOOL_TIP_NO_TRACE); |
452 | traceRadioButtonGroup.add(someTraceRadioButton); |
453 | traceRadioButtonGroup.add(noTraceRadioButton); |
454 | |
455 | @@ -1735,12 +1893,14 @@ |
456 | |
457 | private void initReductionOptionsPanel() { |
458 | reductionOptionsPanel = new JPanel(new GridBagLayout()); |
459 | + reductionOptionsPanel.setVisible(false); |
460 | reductionOptionsPanel.setBorder(BorderFactory.createTitledBorder("Verification Options")); |
461 | Dimension d = new Dimension(898, 100); |
462 | reductionOptionsPanel.setPreferredSize(d); |
463 | reductionOption = new JComboBox(); |
464 | setEnabledReductionOptions(); |
465 | - |
466 | + reductionOption.setToolTipText(TOOL_TIP_REDUCTION_OPTION); |
467 | + |
468 | reductionOption.addActionListener(new ActionListener() { |
469 | public void actionPerformed(ActionEvent e) { |
470 | JComboBox source = (JComboBox)e.getSource(); |
471 | @@ -1766,6 +1926,7 @@ |
472 | |
473 | symmetryReduction = new JCheckBox("Use symmetry reduction"); |
474 | symmetryReduction.setSelected(true); |
475 | + symmetryReduction.setToolTipText(TOOL_TIP_SYMMETRY_REDUCTION); |
476 | symmetryReduction.addItemListener(new ItemListener() { |
477 | public void itemStateChanged(ItemEvent e) { |
478 | refreshTraceOptions(); |
479 | @@ -1781,9 +1942,7 @@ |
480 | |
481 | discreteInclusion = new JCheckBox("Use discrete inclusion"); |
482 | discreteInclusion.setVisible(true); |
483 | - discreteInclusion.setToolTipText("<html>This optimization will perform more advanced inclusion check<br/>" + |
484 | - "in an attempt to reduce the number of explored states.<br/>" + |
485 | - "<b>Note:</b> This may have an adverse affect on performance on some models!</html>"); |
486 | + discreteInclusion.setToolTipText(TOOL_TIP_DISCRETE_INCLUSION); |
487 | discreteInclusion.addActionListener(new ActionListener() { |
488 | public void actionPerformed(ActionEvent e) { |
489 | selectInclusionPlacesButton.setEnabled(discreteInclusion.isSelected()); |
490 | @@ -1799,6 +1958,7 @@ |
491 | |
492 | selectInclusionPlacesButton = new JButton("Select Inclusion Places"); |
493 | selectInclusionPlacesButton.setEnabled(false); |
494 | + selectInclusionPlacesButton.setToolTipText(TOOL_TIP_SELECT_INCLUSION_PLACES); |
495 | selectInclusionPlacesButton.addActionListener(new ActionListener() { |
496 | public void actionPerformed(ActionEvent e) { |
497 | inclusionPlaces = ChooseInclusionPlacesDialog.showInclusionPlacesDialog(tapnNetwork, inclusionPlaces); |
498 | @@ -1815,6 +1975,8 @@ |
499 | gbc = new GridBagConstraints(); |
500 | gbc.gridx = 0; |
501 | gbc.gridy = 4; |
502 | + gbc.fill = GridBagConstraints.HORIZONTAL; |
503 | + gbc.insets = new Insets(0, 10, 0, 10); |
504 | add(reductionOptionsPanel, gbc); |
505 | } |
506 | |
507 | @@ -1843,6 +2005,7 @@ |
508 | ReductionOption reduction = getReductionOption(); |
509 | |
510 | saveUppaalXMLButton.setText(reduction == ReductionOption.VerifyTAPN ? EXPORT_VERIFYTAPN_BTN_TEXT : EXPORT_UPPAAL_BTN_TEXT); |
511 | + saveUppaalXMLButton.setToolTipText(reduction == ReductionOption.VerifyTAPN ? TOOL_TIP_SAVE_TAPAAL_BUTTON : TOOL_TIP_SAVE_UPPAAL_BUTTON); |
512 | } |
513 | |
514 | private void refreshQueryEditingButtons() { |
515 | @@ -1879,15 +2042,21 @@ |
516 | discreteInclusion.setSelected(isUpwardClosed ? discreteInclusion.isSelected() : false); |
517 | } |
518 | |
519 | - |
520 | private void initButtonPanel(QueryDialogueOption option) { |
521 | - buttonPanel = new JPanel(new FlowLayout()); |
522 | + buttonPanel = new JPanel(new BorderLayout()); |
523 | if (option == QueryDialogueOption.Save) { |
524 | saveButton = new JButton("Save"); |
525 | saveAndVerifyButton = new JButton("Save and Verify"); |
526 | cancelButton = new JButton("Cancel"); |
527 | saveUppaalXMLButton = new JButton(EXPORT_UPPAAL_BTN_TEXT); |
528 | - |
529 | + //Only show in advanced mode |
530 | + saveUppaalXMLButton.setVisible(false); |
531 | + |
532 | + //Add tool tips |
533 | + saveButton.setToolTipText(TOOL_TIP_SAVE_BUTTON); |
534 | + saveAndVerifyButton.setToolTipText(TOOL_TIP_SAVE_AND_VERIFY_BUTTON); |
535 | + cancelButton.setToolTipText(TOOL_TIP_CANCEL_BUTTON); |
536 | + saveUppaalXMLButton.setToolTipText(TOOL_TIP_SAVE_UPPAAL_BUTTON); |
537 | |
538 | saveButton.addActionListener(new ActionListener() { |
539 | public void actionPerformed(ActionEvent evt) { |
540 | @@ -1991,20 +2160,20 @@ |
541 | } |
542 | }); |
543 | } |
544 | + |
545 | if (option == QueryDialogueOption.Save) { |
546 | - buttonPanel.add(saveUppaalXMLButton); |
547 | + JPanel leftButtomPanel = new JPanel(new FlowLayout()); |
548 | + JPanel rightButtomPanel = new JPanel(new FlowLayout()); |
549 | + leftButtomPanel.add(saveUppaalXMLButton, FlowLayout.LEFT); |
550 | + |
551 | + rightButtomPanel.add(cancelButton); |
552 | + |
553 | + rightButtomPanel.add(saveButton); |
554 | + |
555 | + rightButtomPanel.add(saveAndVerifyButton); |
556 | |
557 | - Dimension minSize = new Dimension(400, 5); |
558 | - Dimension prefSize = new Dimension(400, 5); |
559 | - Dimension maxSize = new Dimension(Short.MAX_VALUE, 400); |
560 | - buttonPanel.add(new Box.Filler(minSize, prefSize, maxSize)); |
561 | - |
562 | - |
563 | - buttonPanel.add(cancelButton); |
564 | - |
565 | - buttonPanel.add(saveButton); |
566 | - |
567 | - buttonPanel.add(saveAndVerifyButton); |
568 | + buttonPanel.add(leftButtomPanel, BorderLayout.LINE_START); |
569 | + buttonPanel.add(rightButtomPanel, BorderLayout.LINE_END); |
570 | |
571 | } else { |
572 | buttonPanel.add(cancelButton); |
573 | @@ -2015,7 +2184,9 @@ |
574 | GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
575 | gridBagConstraints.gridx = 0; |
576 | gridBagConstraints.gridy = 5; |
577 | - gridBagConstraints.anchor = GridBagConstraints.CENTER; |
578 | + gridBagConstraints.anchor = GridBagConstraints.WEST; |
579 | + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; |
580 | + gridBagConstraints.insets = new Insets(0, 10, 5, 10); |
581 | add(buttonPanel, gridBagConstraints); |
582 | |
583 | } |