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
=== modified file 'src/pipe/gui/DrawingSurfaceImpl.java'
--- src/pipe/gui/DrawingSurfaceImpl.java 2018-06-24 14:44:34 +0000
+++ src/pipe/gui/DrawingSurfaceImpl.java 2018-08-03 18:03:55 +0000
@@ -39,8 +39,7 @@
39/**39/**
40 * The petrinet is drawn onto this frame.40 * The petrinet is drawn onto this frame.
41 */41 */
42public class DrawingSurfaceImpl extends JLayeredPane implements Observer,42public class DrawingSurfaceImpl extends JLayeredPane implements Printable {
43Printable {
44 private static final long serialVersionUID = 4434596266503933386L;43 private static final long serialVersionUID = 4434596266503933386L;
45 private boolean netChanged = false;44 private boolean netChanged = false;
46 private boolean animationmode = false;45 private boolean animationmode = false;
@@ -222,16 +221,6 @@
222 repaint();221 repaint();
223 }222 }
224223
225 public void update(Observable o, Object diffObj) {
226 if ((diffObj instanceof PetriNetObject) && (diffObj != null)) {
227 if (CreateGui.getAppGui().getMode() == ElementType.CREATING) {
228
229 addNewPetriNetObject((PetriNetObject) diffObj);
230 }
231 repaint();
232 }
233 }
234
235 public int print(Graphics g, PageFormat pageFormat, int pageIndex)224 public int print(Graphics g, PageFormat pageFormat, int pageIndex)
236 throws PrinterException {225 throws PrinterException {
237 if (pageIndex > 0) {226 if (pageIndex > 0) {
238227
=== modified file 'src/pipe/gui/FileFinder.java'
--- src/pipe/gui/FileFinder.java 2018-05-02 06:58:39 +0000
+++ src/pipe/gui/FileFinder.java 2018-08-03 18:03:55 +0000
@@ -4,11 +4,17 @@
44
5import java.io.File;5import java.io.File;
66
77/**
8 * @deprecated use FileBrowser.constructor instead
9 */
10@Deprecated
8public class FileFinder {11public class FileFinder {
912
10 public File ShowFileBrowserDialog(String description, String extension, String path) {13 public File ShowFileBrowserDialog(String description, String extension, String path) {
11 if (path==null || path=="") { path= System.getProperty("user.home"); }14 if (path==null || path=="") {
15 path= System.getProperty("user.home");
16 }
17
12 FileBrowser fileBrowser = FileBrowser.constructor(description, extension, path);18 FileBrowser fileBrowser = FileBrowser.constructor(description, extension, path);
13 return fileBrowser.openFile();19 return fileBrowser.openFile();
14 }20 }
1521
=== modified file 'src/pipe/gui/GuiFrame.java'
--- src/pipe/gui/GuiFrame.java 2018-07-08 17:36:25 +0000
+++ src/pipe/gui/GuiFrame.java 2018-08-03 18:03:55 +0000
@@ -72,7 +72,7 @@
72import dk.aau.cs.verification.VerifyTAPN.VerifyTAPNDiscreteVerification;72import dk.aau.cs.verification.VerifyTAPN.VerifyTAPNDiscreteVerification;
7373
7474
75public class GuiFrame extends JFrame implements Observer {75public class GuiFrame extends JFrame {
7676
77 private static final long serialVersionUID = 7509589834941127217L;77 private static final long serialVersionUID = 7509589834941127217L;
78 // for zoom combobox and dropdown78 // for zoom combobox and dropdown
@@ -1494,12 +1494,7 @@
1494 }1494 }
14951495
14961496
1497 // HAK Method called by netModel object when it changes1497
1498 public void update(Observable o, Object obj) {
1499 if ((mode != ElementType.CREATING) && (!appView.isInAnimationMode())) {
1500 appView.setNetChanged(true);
1501 }
1502 }
15031498
1504 private void showQueries(boolean enable){1499 private void showQueries(boolean enable){
1505 showQueries = enable;1500 showQueries = enable;
@@ -1716,10 +1711,6 @@
17161711
17171712
1718 try {1713 try {
1719 if (CreateGui.getApp() != null) {
1720 // Notifies used to indicate new instances.
1721 CreateGui.getApp().setMode(ElementType.CREATING);
1722 }
17231714
1724 ModelLoader loader = new ModelLoader(tab.drawingSurface());1715 ModelLoader loader = new ModelLoader(tab.drawingSurface());
1725 LoadedModel loadedModel = loader.load(file);1716 LoadedModel loadedModel = loader.load(file);
@@ -1777,10 +1768,6 @@
17771768
1778 if (file != null) {1769 if (file != null) {
1779 try {1770 try {
1780 if (CreateGui.getApp() != null) {
1781 // Notifies used to indicate new instances.
1782 CreateGui.getApp().setMode(ElementType.CREATING);
1783 }
17841771
1785 LoadedModel loadedModel;1772 LoadedModel loadedModel;
17861773
17871774
=== modified file 'src/pipe/gui/Pipe.java'
--- src/pipe/gui/Pipe.java 2018-07-06 10:33:18 +0000
+++ src/pipe/gui/Pipe.java 2018-08-03 18:03:55 +0000
@@ -10,7 +10,7 @@
10 //TAPN Elements10 //TAPN Elements
11 TAPNPLACE, TAPNTRANS, TAPNARC, TRANSPORTARC, TAPNINHIBITOR_ARC,11 TAPNPLACE, TAPNTRANS, TAPNARC, TRANSPORTARC, TAPNINHIBITOR_ARC,
12 //Others (might refactore)12 //Others (might refactore)
13 ADDTOKEN, DELTOKEN, SELECT, DRAW, DRAG, CREATING,13 ADDTOKEN, DELTOKEN, SELECT, DRAW, DRAG,
14 //Fast modes14 //Fast modes
15 FAST_TRANSITION, FAST_PLACE15 FAST_TRANSITION, FAST_PLACE
16 }16 }
1717
=== modified file 'src/pipe/gui/VersionChecker.java'
--- src/pipe/gui/VersionChecker.java 2012-03-31 20:29:51 +0000
+++ src/pipe/gui/VersionChecker.java 2018-08-03 18:03:55 +0000
@@ -47,8 +47,8 @@
47 }47 }
48 return result;48 return result;
49 }49 }
50 else if (forcecheck)50 else if (forcecheck){
51 {JOptionPane.showMessageDialog(null, "It is impossible to establish a connection to the server. Try again later.", "No Update for " + TAPAAL.getProgramName(),51 JOptionPane.showMessageDialog(null, "It is impossible to establish a connection to the server. Try again later.", "No Update for " + TAPAAL.getProgramName(),
52 JOptionPane.INFORMATION_MESSAGE, ResourceManager.appIcon()); 52 JOptionPane.INFORMATION_MESSAGE, ResourceManager.appIcon());
53 }53 }
54 }54 }

Subscribers

People subscribed via source and target branches