Merge lp:~yrke/tapaal/tapaal-fixes-1 into lp:tapaal

Proposed by Kenneth Yrke Jørgensen
Status: Merged
Approved by: Jiri Srba
Approved revision: 973
Merged at revision: 973
Proposed branch: lp:~yrke/tapaal/tapaal-fixes-1
Merge into: lp:tapaal
Diff against target: 131 lines (+14/-32)
5 files modified
src/pipe/gui/DrawingSurfaceImpl.java (+1/-12)
src/pipe/gui/FileFinder.java (+8/-2)
src/pipe/gui/GuiFrame.java (+2/-15)
src/pipe/gui/Pipe.java (+1/-1)
src/pipe/gui/VersionChecker.java (+2/-2)
To merge this branch: bzr merge lp:~yrke/tapaal/tapaal-fixes-1
Reviewer Review Type Date Requested Status
Jiri Srba Approve
TAPAAL Reviewers Pending
Review via email: mp+352324@code.launchpad.net

Commit message

Code cleanup

Removed unused element type,
GuiFrame and Drawingsurface no longer implements observer,
code formatting
depricated usage of ShowFileBrowserDialog

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) :
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/DrawingSurfaceImpl.java'
2--- src/pipe/gui/DrawingSurfaceImpl.java 2018-06-24 14:44:34 +0000
3+++ src/pipe/gui/DrawingSurfaceImpl.java 2018-08-03 18:03:55 +0000
4@@ -39,8 +39,7 @@
5 /**
6 * The petrinet is drawn onto this frame.
7 */
8-public class DrawingSurfaceImpl extends JLayeredPane implements Observer,
9-Printable {
10+public class DrawingSurfaceImpl extends JLayeredPane implements Printable {
11 private static final long serialVersionUID = 4434596266503933386L;
12 private boolean netChanged = false;
13 private boolean animationmode = false;
14@@ -222,16 +221,6 @@
15 repaint();
16 }
17
18- public void update(Observable o, Object diffObj) {
19- if ((diffObj instanceof PetriNetObject) && (diffObj != null)) {
20- if (CreateGui.getAppGui().getMode() == ElementType.CREATING) {
21-
22- addNewPetriNetObject((PetriNetObject) diffObj);
23- }
24- repaint();
25- }
26- }
27-
28 public int print(Graphics g, PageFormat pageFormat, int pageIndex)
29 throws PrinterException {
30 if (pageIndex > 0) {
31
32=== modified file 'src/pipe/gui/FileFinder.java'
33--- src/pipe/gui/FileFinder.java 2018-05-02 06:58:39 +0000
34+++ src/pipe/gui/FileFinder.java 2018-08-03 18:03:55 +0000
35@@ -4,11 +4,17 @@
36
37 import java.io.File;
38
39-
40+/**
41+ * @deprecated use FileBrowser.constructor instead
42+ */
43+@Deprecated
44 public class FileFinder {
45
46 public File ShowFileBrowserDialog(String description, String extension, String path) {
47- if (path==null || path=="") { path= System.getProperty("user.home"); }
48+ if (path==null || path=="") {
49+ path= System.getProperty("user.home");
50+ }
51+
52 FileBrowser fileBrowser = FileBrowser.constructor(description, extension, path);
53 return fileBrowser.openFile();
54 }
55
56=== modified file 'src/pipe/gui/GuiFrame.java'
57--- src/pipe/gui/GuiFrame.java 2018-07-08 17:36:25 +0000
58+++ src/pipe/gui/GuiFrame.java 2018-08-03 18:03:55 +0000
59@@ -72,7 +72,7 @@
60 import dk.aau.cs.verification.VerifyTAPN.VerifyTAPNDiscreteVerification;
61
62
63-public class GuiFrame extends JFrame implements Observer {
64+public class GuiFrame extends JFrame {
65
66 private static final long serialVersionUID = 7509589834941127217L;
67 // for zoom combobox and dropdown
68@@ -1494,12 +1494,7 @@
69 }
70
71
72- // HAK Method called by netModel object when it changes
73- public void update(Observable o, Object obj) {
74- if ((mode != ElementType.CREATING) && (!appView.isInAnimationMode())) {
75- appView.setNetChanged(true);
76- }
77- }
78+
79
80 private void showQueries(boolean enable){
81 showQueries = enable;
82@@ -1716,10 +1711,6 @@
83
84
85 try {
86- if (CreateGui.getApp() != null) {
87- // Notifies used to indicate new instances.
88- CreateGui.getApp().setMode(ElementType.CREATING);
89- }
90
91 ModelLoader loader = new ModelLoader(tab.drawingSurface());
92 LoadedModel loadedModel = loader.load(file);
93@@ -1777,10 +1768,6 @@
94
95 if (file != null) {
96 try {
97- if (CreateGui.getApp() != null) {
98- // Notifies used to indicate new instances.
99- CreateGui.getApp().setMode(ElementType.CREATING);
100- }
101
102 LoadedModel loadedModel;
103
104
105=== modified file 'src/pipe/gui/Pipe.java'
106--- src/pipe/gui/Pipe.java 2018-07-06 10:33:18 +0000
107+++ src/pipe/gui/Pipe.java 2018-08-03 18:03:55 +0000
108@@ -10,7 +10,7 @@
109 //TAPN Elements
110 TAPNPLACE, TAPNTRANS, TAPNARC, TRANSPORTARC, TAPNINHIBITOR_ARC,
111 //Others (might refactore)
112- ADDTOKEN, DELTOKEN, SELECT, DRAW, DRAG, CREATING,
113+ ADDTOKEN, DELTOKEN, SELECT, DRAW, DRAG,
114 //Fast modes
115 FAST_TRANSITION, FAST_PLACE
116 }
117
118=== modified file 'src/pipe/gui/VersionChecker.java'
119--- src/pipe/gui/VersionChecker.java 2012-03-31 20:29:51 +0000
120+++ src/pipe/gui/VersionChecker.java 2018-08-03 18:03:55 +0000
121@@ -47,8 +47,8 @@
122 }
123 return result;
124 }
125- else if (forcecheck)
126- {JOptionPane.showMessageDialog(null, "It is impossible to establish a connection to the server. Try again later.", "No Update for " + TAPAAL.getProgramName(),
127+ else if (forcecheck){
128+ JOptionPane.showMessageDialog(null, "It is impossible to establish a connection to the server. Try again later.", "No Update for " + TAPAAL.getProgramName(),
129 JOptionPane.INFORMATION_MESSAGE, ResourceManager.appIcon());
130 }
131 }

Subscribers

People subscribed via source and target branches