~tapaal-contributor/tapaal/autodetect-lens-check2

« back to all changes in this revision

Viewing changes to src/pipe/gui/widgets/PlaceEditorPanel.java

merged in lp:~yrke/tapaal/evenMore-gui-cleanup doing GUI cleanup and fixing memory access check, about menu in Mac, exception in verification and reenabled quick draw

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import javax.swing.event.ChangeListener;
24
24
 
25
25
import net.tapaal.swinghelpers.CustomJSpinner;
 
26
import net.tapaal.swinghelpers.GridBagHelper;
26
27
import net.tapaal.swinghelpers.WidthAdjustingComboBox;
27
28
import pipe.dataLayer.Template;
28
29
import pipe.gui.CreateGui;
51
52
import dk.aau.cs.model.tapn.TransportArc;
52
53
import dk.aau.cs.util.RequireException;
53
54
 
 
55
import static net.tapaal.swinghelpers.GridBagHelper.Anchor.*;
 
56
import static net.tapaal.swinghelpers.GridBagHelper.Fill.HORIZONTAL;
 
57
 
54
58
public class PlaceEditorPanel extends javax.swing.JPanel {
55
59
 
56
60
        private final JRootPane rootPane;
57
61
        
58
62
        private JCheckBox sharedCheckBox;
59
63
        private JCheckBox makeNewSharedCheckBox;
60
 
        private WidthAdjustingComboBox sharedPlacesComboBox;
 
64
        private WidthAdjustingComboBox<TimedPlace> sharedPlacesComboBox;
61
65
 
62
66
        private final TimedPlaceComponent place;
63
67
        private final Context context;
78
82
                setLayout(new java.awt.GridBagLayout());
79
83
 
80
84
                initBasicPropertiesPanel();
81
 
                GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
82
 
                gridBagConstraints.gridx = 0;
83
 
                gridBagConstraints.gridy = 0;
84
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
85
 
                gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
86
 
                gridBagConstraints.insets = new Insets(5, 8, 0, 8);
 
85
                GridBagConstraints gridBagConstraints = GridBagHelper.as(0,0, WEST, HORIZONTAL, new Insets(5, 8, 0, 8));
87
86
                add(basicPropertiesPanel, gridBagConstraints);
88
87
 
89
88
                initTimeInvariantPanel();
90
 
                gridBagConstraints = new java.awt.GridBagConstraints();
91
 
                gridBagConstraints.gridx = 0;
92
 
                gridBagConstraints.gridy = 1;
93
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
94
 
                gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
95
 
                gridBagConstraints.insets = new Insets(0, 8, 0, 8);
 
89
 
 
90
                gridBagConstraints = GridBagHelper.as(0,1, WEST, HORIZONTAL, new Insets(0, 8, 0, 8));
96
91
                add(timeInvariantPanel, gridBagConstraints);
97
92
 
98
93
                initButtonPanel();
99
 
                gridBagConstraints = new java.awt.GridBagConstraints();
100
 
                gridBagConstraints.gridx = 0;
101
 
                gridBagConstraints.gridy = 2;
 
94
 
 
95
                gridBagConstraints = GridBagHelper.as(0,2, new Insets(0, 8, 5, 8));
102
96
                gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
103
 
                //      gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
104
 
                gridBagConstraints.insets = new Insets(0, 8, 5, 8);
 
97
                //gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
105
98
                add(buttonPanel, gridBagConstraints);
106
99
        }
107
100
 
130
123
                cancelButton.setPreferredSize(new java.awt.Dimension(100, 25));
131
124
                cancelButton.addActionListener(evt -> exit());
132
125
 
133
 
                gridBagConstraints = new java.awt.GridBagConstraints();
134
 
                gridBagConstraints.gridx = 0;
135
 
                gridBagConstraints.gridy = 0;
 
126
                gridBagConstraints = GridBagHelper.as(0,0,EAST, new Insets(5, 5, 5, 5));
136
127
                gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE;
137
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
138
 
                gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
 
128
 
139
129
                buttonPanel.add(cancelButton, gridBagConstraints);
140
130
 
141
131
 
142
132
 
143
 
                gridBagConstraints = new java.awt.GridBagConstraints();
144
 
                gridBagConstraints.gridx = 1;
145
 
                gridBagConstraints.gridy = 0;
146
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
147
 
                gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
 
133
                gridBagConstraints = GridBagHelper.as(1,0, WEST, new Insets(5, 5, 5, 5));
148
134
                buttonPanel.add(okButton, gridBagConstraints);
149
135
 
150
136
                setupInitialState();
166
152
                }
167
153
 
168
154
                sharedPlaces.sort((o1, o2) -> o1.name().compareToIgnoreCase(o2.name()));
169
 
                sharedPlacesComboBox.setModel(new DefaultComboBoxModel(sharedPlaces));
 
155
                sharedPlacesComboBox.setModel(new DefaultComboBoxModel<>(sharedPlaces));
170
156
                if(place.underlyingPlace().isShared()) {
171
157
 
172
158
                        sharedPlacesComboBox.setSelectedItem(place.underlyingPlace());
224
210
                        }
225
211
                });
226
212
 
227
 
                GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
228
 
                gridBagConstraints.gridx = 2;
229
 
                gridBagConstraints.gridy = 1;
230
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
231
 
                gridBagConstraints.insets = new java.awt.Insets(0, 3, 3, 3);
 
213
                GridBagConstraints gridBagConstraints = GridBagHelper.as(2,1, WEST, new Insets(0, 3, 3, 3));
232
214
                basicPropertiesPanel.add(sharedCheckBox, gridBagConstraints);
233
215
 
234
216
                makeSharedButton = new javax.swing.JButton();
250
232
                        makeNewShared = false;
251
233
                });
252
234
                
253
 
                gridBagConstraints = new java.awt.GridBagConstraints();
254
 
                gridBagConstraints.gridx = 3;
255
 
                gridBagConstraints.gridy = 1;
256
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
257
 
                gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
 
235
                gridBagConstraints = GridBagHelper.as(3,1, WEST, new Insets(5, 5, 5, 5));
258
236
                basicPropertiesPanel.add(makeSharedButton, gridBagConstraints);
259
237
                
260
238
                nameLabel = new javax.swing.JLabel("Name:");
261
 
                gridBagConstraints = new java.awt.GridBagConstraints();
262
 
                gridBagConstraints.gridx = 0;
263
 
                gridBagConstraints.gridy = 1;
264
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
265
 
                gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
 
239
                gridBagConstraints = GridBagHelper.as(0,1, EAST, new Insets(3, 3, 3, 3));
266
240
                basicPropertiesPanel.add(nameLabel, gridBagConstraints);
267
241
 
268
242
                nameTextField = new javax.swing.JTextField();
281
255
                });
282
256
 
283
257
                markingLabel = new javax.swing.JLabel("Marking:");
284
 
                gridBagConstraints = new java.awt.GridBagConstraints();
285
 
                gridBagConstraints.gridx = 0;
286
 
                gridBagConstraints.gridy = 2;
287
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
288
 
                gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
 
258
                gridBagConstraints = GridBagHelper.as(0,2, EAST, new Insets(3, 3, 3, 3));
289
259
                basicPropertiesPanel.add(markingLabel, gridBagConstraints);
290
260
 
291
 
                //              markingSpinner = new javax.swing.JSpinner();
292
 
                //              markingSpinner.setModel(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
293
 
                //              markingSpinner.setPreferredSize(new Dimension(75,27));
294
261
                markingSpinner = new CustomJSpinner(0, okButton);
295
 
                gridBagConstraints = new java.awt.GridBagConstraints();
296
 
                gridBagConstraints.gridx = 1;
297
 
                gridBagConstraints.gridy = 2;
298
 
                gridBagConstraints.anchor = GridBagConstraints.WEST;
299
 
                gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
 
262
                gridBagConstraints = GridBagHelper.as(1,2, WEST, new Insets(3, 3, 3, 3));
300
263
                basicPropertiesPanel.add(markingSpinner, gridBagConstraints);
301
264
 
302
265
                attributesCheckBox = new javax.swing.JCheckBox("Show place name");
303
266
                attributesCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
304
 
                attributesCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
305
 
                gridBagConstraints = new java.awt.GridBagConstraints();
306
 
                gridBagConstraints.gridx = 1;
307
 
                gridBagConstraints.gridy = 3;
308
 
                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
309
 
                gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
 
267
                attributesCheckBox.setMargin(new Insets(0, 0, 0, 0));
 
268
 
 
269
                gridBagConstraints = GridBagHelper.as(1,3,WEST, new Insets(3, 3, 3, 3));
310
270
                basicPropertiesPanel.add(attributesCheckBox, gridBagConstraints);
311
271
        }
312
272
 
336
296
                timeInvariantPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Age Invariant"));
337
297
 
338
298
                invariantGroup = new JPanel(new GridBagLayout());
339
 
                invRelationNormal = new JComboBox(new String[] { "<=", "<" });
340
 
                invRelationConstant = new JComboBox(new String[] { "<=", "<" });
 
299
                invRelationNormal = new JComboBox<>(new String[] { "<=", "<" });
 
300
                invRelationConstant = new JComboBox<>(new String[] { "<=", "<" });
341
301
                //invariantSpinner = new JSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
342
302
                invariantSpinner = new CustomJSpinner(0, okButton);
343
303
                invariantSpinner.addChangeListener(e -> {
351
311
                        }
352
312
                });
353
313
 
354
 
                GridBagConstraints gbc = new GridBagConstraints();
355
 
                gbc.gridx = 1;
356
 
                gbc.gridy = 0;
357
 
                gbc.insets = new Insets(3, 3, 3, 3);
358
 
                gbc.fill = GridBagConstraints.HORIZONTAL;
 
314
                GridBagConstraints gbc = GridBagHelper.as(1,0, HORIZONTAL, new Insets(3, 3, 3, 3));
359
315
                invariantGroup.add(invRelationNormal, gbc);
360
316
 
361
 
                gbc = new GridBagConstraints();
362
 
                gbc.gridx = 1;
363
 
                gbc.gridy = 1;
364
 
                gbc.insets = new Insets(3, 3, 3, 3);
365
 
                gbc.fill = GridBagConstraints.HORIZONTAL;
366
 
                invariantGroup.add(invRelationConstant, gbc);
367
 
 
368
 
                //      invariantSpinner.setMaximumSize(new Dimension(100, 30));
369
 
                //  invariantSpinner.setMinimumSize(new Dimension(230, 30));
370
 
                //invariantSpinner.setPreferredSize(new Dimension(230, 30));
371
 
 
372
 
                gbc = new GridBagConstraints();
373
 
                gbc.gridx = 2;
374
 
                gbc.gridy = 0;
375
 
                gbc.insets = new Insets(3, 3, 3, 3);
 
317
                gbc = GridBagHelper.as(1,1, HORIZONTAL, new Insets(3, 3, 3, 3));
 
318
        invariantGroup.add(invRelationConstant, gbc);
 
319
 
 
320
                gbc = GridBagHelper.as(2,0, new Insets(3, 3, 3, 3));
376
321
                invariantGroup.add(invariantSpinner, gbc);
377
322
 
378
323
                invariantInf = new JCheckBox("inf");
386
331
                                invariantSpinner.setEnabled(true);
387
332
                                invRelationNormal.setSelectedItem("<=");
388
333
                                if ((Integer) invariantSpinner.getValue() < 1) {
389
 
                                        invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<=" }));
 
334
                                        invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<=" }));
390
335
                                } else {
391
 
                                        invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<=", "<" }));
 
336
                                        invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<=", "<" }));
392
337
                                }
393
338
                        } else {
394
339
                                invRelationNormal.setEnabled(false);
395
340
                                invariantSpinner.setEnabled(false);
396
341
                                invRelationNormal.setSelectedItem("<");
397
 
                                invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<" }));
 
342
                                invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<" }));
398
343
                        }
399
344
 
400
345
                });
401
 
                gbc = new GridBagConstraints();
402
 
                gbc.gridx = 3;
403
 
                gbc.gridy = 0;
 
346
                gbc = GridBagHelper.as(3,0);
404
347
                invariantGroup.add(invariantInf, gbc);
405
348
 
406
349
                Set<String> constants = context.network().getConstantNames();
407
350
                String[] constantArray = constants.toArray(new String[constants.size()]);
408
351
                Arrays.sort(constantArray, String.CASE_INSENSITIVE_ORDER);
409
352
 
410
 
                invConstantsComboBox = new WidthAdjustingComboBox(maxNumberOfPlacesToShowAtOnce);
411
 
                invConstantsComboBox.setModel(new DefaultComboBoxModel(constantArray));
 
353
                invConstantsComboBox = new WidthAdjustingComboBox<>(maxNumberOfPlacesToShowAtOnce);
 
354
                invConstantsComboBox.setModel(new DefaultComboBoxModel<>(constantArray));
412
355
                //      invConstantsComboBox = new JComboBox(constants.toArray());
413
356
                invConstantsComboBox.setMaximumRowCount(20);
414
357
                //      invConstantsComboBox.setMinimumSize(new Dimension(100, 30));
419
362
                        }
420
363
                });
421
364
 
422
 
                gbc = new GridBagConstraints();
423
 
                gbc.gridx = 2;
424
 
                gbc.gridy = 1;
425
 
                gbc.anchor = GridBagConstraints.WEST;
 
365
                gbc = GridBagHelper.as(2,1, WEST);
426
366
                invariantGroup.add(invConstantsComboBox, gbc);
427
367
 
428
368
                normalInvRadioButton = new JRadioButton("Normal");
443
383
                btnGroup.add(normalInvRadioButton);
444
384
                btnGroup.add(constantInvRadioButton);
445
385
 
446
 
                gbc = new GridBagConstraints();
447
 
                gbc.gridx = 0;
448
 
                gbc.gridy = 0;
449
 
                gbc.anchor = GridBagConstraints.WEST;
 
386
                gbc = GridBagHelper.as(0,0, WEST);
450
387
                invariantGroup.add(normalInvRadioButton, gbc);
451
388
 
452
 
                gbc = new GridBagConstraints();
453
 
                gbc.gridx = 0;
454
 
                gbc.gridy = 1;
455
 
                gbc.anchor = GridBagConstraints.WEST;
 
389
                gbc = GridBagHelper.as(0,1, WEST);
456
390
                invariantGroup.add(constantInvRadioButton, gbc);
457
391
 
458
392
                TimeInvariant invariantToSet = place.getInvariant();
465
399
 
466
400
                if (invariantToSet.upperBound() instanceof InfBound) {
467
401
                        invariantSpinner.setEnabled(false);
468
 
                        invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<" }));
 
402
                        invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<" }));
469
403
                        invariantInf.setSelected(true);
470
404
                        invRelationNormal.setSelectedItem("<");
471
405
                }
481
415
                        normalInvRadioButton.setSelected(true);
482
416
                        if (invariantToSet.upperBound() instanceof IntBound) {
483
417
                                if ((Integer) invariantSpinner.getValue() < 1) {
484
 
                                        invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<=" }));
 
418
                                        invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<=" }));
485
419
                                } else {
486
 
                                        invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<=", "<" }));
 
420
                                        invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<=", "<" }));
487
421
                                }
488
422
                                invariantSpinner.setValue(invariantToSet.upperBound().value());
489
423
                                invariantSpinner.setEnabled(true);
492
426
                        }
493
427
                }
494
428
 
495
 
                GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
496
 
                gridBagConstraints.gridx = 1;
497
 
                gridBagConstraints.gridy = 4;
498
 
                gridBagConstraints.gridwidth = 2;
499
 
                gridBagConstraints.anchor = GridBagConstraints.WEST;
500
 
                gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
 
429
                GridBagConstraints gridBagConstraints = GridBagHelper.as(1,4,2, WEST, new Insets(3, 3, 3, 3));
501
430
                timeInvariantPanel.add(invariantGroup, gridBagConstraints);
502
431
        }
503
432
 
506
435
 
507
436
                String selected = invRelationConstant.getSelectedItem().toString();
508
437
                if (value == 0) {
509
 
                        invRelationConstant.setModel(new DefaultComboBoxModel(new String[] { "<=" }));
 
438
                        invRelationConstant.setModel(new DefaultComboBoxModel<>(new String[] { "<=" }));
510
439
                } else {
511
 
                        invRelationConstant.setModel(new DefaultComboBoxModel(new String[] { "<=", "<" }));
 
440
                        invRelationConstant.setModel(new DefaultComboBoxModel<>(new String[] { "<=", "<" }));
512
441
                }
513
442
                invRelationConstant.setSelectedItem(selected);
514
443
        }
524
453
                invariantInf.setEnabled(true);
525
454
                invariantSpinner.setValue(0);
526
455
                invariantInf.setSelected(true);
527
 
                invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<" }));
 
456
                invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<" }));
528
457
        }
529
458
 
530
459
        protected void disableInvariantComponents() {
535
464
                invariantInf.setEnabled(false);
536
465
        }
537
466
 
538
 
        ChangeListener changeListener = new javax.swing.event.ChangeListener() {
539
 
                public void stateChanged(javax.swing.event.ChangeEvent evt) {
540
 
                        JSpinner spinner = (JSpinner) evt.getSource();
541
 
                        JSpinner.NumberEditor numberEditor = ((JSpinner.NumberEditor) spinner.getEditor());
542
 
                        numberEditor.getTextField().setBackground(new Color(255, 255, 255));
543
 
                        spinner.removeChangeListener(this);
544
 
                }
545
 
        };
546
 
 
547
467
        private void switchToNameTextField() {
548
468
                basicPropertiesPanel.remove(sharedPlacesComboBox);
549
 
                GridBagConstraints gbc = new java.awt.GridBagConstraints();
550
 
                gbc.gridx = 1;
551
 
                gbc.gridy = 1;
552
 
                gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
553
 
                gbc.insets = new java.awt.Insets(3, 3, 3, 3);
554
 
                basicPropertiesPanel.add(nameTextField, gbc);   
 
469
                GridBagConstraints gbc = GridBagHelper.as(1,1, HORIZONTAL, new Insets(3, 3, 3, 3));
 
470
                basicPropertiesPanel.add(nameTextField, gbc);
 
471
 
555
472
                basicPropertiesPanel.validate();
556
473
                basicPropertiesPanel.repaint();
557
474
        }
558
475
 
559
476
        private void switchToNameDropDown() {
560
477
                basicPropertiesPanel.remove(nameTextField);
561
 
                GridBagConstraints gbc = new java.awt.GridBagConstraints();
562
 
                gbc.gridx = 1;
563
 
                gbc.gridy = 1;
564
 
                gbc.fill = java.awt.GridBagConstraints.HORIZONTAL;
565
 
                gbc.insets = new java.awt.Insets(3, 3, 3, 3);
566
 
                basicPropertiesPanel.add(sharedPlacesComboBox, gbc);            
 
478
                GridBagConstraints gbc = GridBagHelper.as(1,1, HORIZONTAL, new Insets(3, 3, 3, 3));
 
479
                basicPropertiesPanel.add(sharedPlacesComboBox, gbc);
 
480
 
567
481
                basicPropertiesPanel.validate();
568
482
                basicPropertiesPanel.repaint();
569
483
 
587
501
        private void setInvariantControlsBasedOn(TimeInvariant invariant) {
588
502
                if(invariant.upperBound() instanceof ConstantBound){
589
503
                        constantInvRadioButton.setSelected(true);
590
 
                        invRelationConstant.setModel(new DefaultComboBoxModel(invariant.upperBound().value() == 0 ? new String[] { "<=" } : new String[] { "<", "<=" }));
 
504
                        invRelationConstant.setModel(new DefaultComboBoxModel<>(invariant.upperBound().value() == 0 ? new String[] { "<=" } : new String[] { "<", "<=" }));
591
505
                        invRelationConstant.setSelectedItem(invariant.isUpperNonstrict() ? "<=" : "<");
592
506
                        invRelationConstant.setEnabled(true);
593
507
                        invConstantsComboBox.setEnabled(true);
595
509
                }else{
596
510
                        normalInvRadioButton.setSelected(true);
597
511
                        if(invariant.upperBound() instanceof InfBound){
598
 
                                invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<" }));
 
512
                                invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<" }));
599
513
                                invariantSpinner.setValue(0);
600
514
                                invRelationNormal.setEnabled(false);
601
515
                                invariantSpinner.setEnabled(false);
602
516
                                invariantInf.setSelected(true);
603
517
                        }else{
604
518
                                if(invariant.upperBound().value() == 0 && !invariantInf.isSelected()){
605
 
                                        invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<=" }));
 
519
                                        invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<=" }));
606
520
                                }else{
607
 
                                        invRelationNormal.setModel(new DefaultComboBoxModel(new String[] { "<", "<=" }));
 
521
                                        invRelationNormal.setModel(new DefaultComboBoxModel<>(new String[] { "<", "<=" }));
608
522
                                }
609
523
                                invRelationNormal.setSelectedItem(invariant.isUpperNonstrict() ? "<=" : "<");
610
524
                                invariantSpinner.setValue(invariant.upperBound().value());
689
603
                                                        return false;
690
604
                                                }
691
605
                                        } else {
692
 
                                                JOptionPane.showMessageDialog(this, "A transition with the specified name already exists in one or more components, or the specified name is invalid.\n\nAcceptable names for places are defined by the regular expression:\n[a-zA-Z][_a-zA-Z0-9]*\n\nNote that \"true\" and \"false\" are reserved keywords.", "Error", JOptionPane.OK_OPTION);
 
606
                                                JOptionPane.showMessageDialog(this, "A transition with the specified name already exists in one or more components, or the specified name is invalid.\n\nAcceptable names for places are defined by the regular expression:\n[a-zA-Z][_a-zA-Z0-9]*\n\nNote that \"true\" and \"false\" are reserved keywords.", "Error", JOptionPane.ERROR_MESSAGE);
693
607
                                                return false;
694
608
                                        }
695
609
                                }