Merge lp:~danilovesky/workcraft/trunk-bug-1350787 into lp:workcraft
- trunk-bug-1350787
- Merge into trunk
Proposed by
Danil Sokolov
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 596 | ||||||||
Proposed branch: | lp:~danilovesky/workcraft/trunk-bug-1350787 | ||||||||
Merge into: | lp:workcraft | ||||||||
Diff against target: |
267 lines (+79/-56) 5 files modified
WorkcraftCore/src/org/workcraft/Info.java (+1/-1) WorkcraftCore/src/org/workcraft/gui/MainWindow.java (+76/-47) build_distr.sh (+0/-6) build_distr_linux.sh (+1/-1) build_distr_windows.sh (+1/-1) |
||||||||
To merge this branch: | bzr merge lp:~danilovesky/workcraft/trunk-bug-1350787 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Danil Sokolov | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Danil Sokolov (danilovesky) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'WorkcraftCore/src/org/workcraft/Info.java' | |||
2 | --- WorkcraftCore/src/org/workcraft/Info.java 2015-02-28 23:14:51 +0000 | |||
3 | +++ WorkcraftCore/src/org/workcraft/Info.java 2015-03-17 14:02:13 +0000 | |||
4 | @@ -13,7 +13,7 @@ | |||
5 | 13 | private static final int majorVersion = 3; | 13 | private static final int majorVersion = 3; |
6 | 14 | private static final int minorVersion = 0; | 14 | private static final int minorVersion = 0; |
7 | 15 | private static final int revisionVersion = 4; | 15 | private static final int revisionVersion = 4; |
9 | 16 | private static final String statusVersion = "alpha"; // alpha, beta, rc1, rc2 | 16 | private static final String statusVersion = null; // "alpha", "beta", "rc1", null (for release) |
10 | 17 | 17 | ||
11 | 18 | private static final int startYear = 2006; | 18 | private static final int startYear = 2006; |
12 | 19 | private static final int currentYear = Calendar.getInstance().get(Calendar.YEAR); | 19 | private static final int currentYear = Calendar.getInstance().get(Calendar.YEAR); |
13 | 20 | 20 | ||
14 | === modified file 'WorkcraftCore/src/org/workcraft/gui/MainWindow.java' | |||
15 | --- WorkcraftCore/src/org/workcraft/gui/MainWindow.java 2015-02-10 15:21:12 +0000 | |||
16 | +++ WorkcraftCore/src/org/workcraft/gui/MainWindow.java 2015-03-17 14:02:13 +0000 | |||
17 | @@ -23,8 +23,12 @@ | |||
18 | 23 | 23 | ||
19 | 24 | import java.awt.BorderLayout; | 24 | import java.awt.BorderLayout; |
20 | 25 | import java.awt.Color; | 25 | import java.awt.Color; |
21 | 26 | import java.awt.DisplayMode; | ||
22 | 26 | import java.awt.Font; | 27 | import java.awt.Font; |
23 | 28 | import java.awt.Insets; | ||
24 | 27 | import java.awt.Point; | 29 | import java.awt.Point; |
25 | 30 | import java.awt.Rectangle; | ||
26 | 31 | import java.awt.Toolkit; | ||
27 | 28 | import java.awt.event.WindowAdapter; | 32 | import java.awt.event.WindowAdapter; |
28 | 29 | import java.awt.event.WindowEvent; | 33 | import java.awt.event.WindowEvent; |
29 | 30 | import java.awt.font.FontRenderContext; | 34 | import java.awt.font.FontRenderContext; |
30 | @@ -346,6 +350,21 @@ | |||
31 | 346 | utilityWindows.add(dockableWindow); | 350 | utilityWindows.add(dockableWindow); |
32 | 347 | } | 351 | } |
33 | 348 | 352 | ||
34 | 353 | public void setWindowSize(boolean maximised, int width, int height){ | ||
35 | 354 | if(maximised){ | ||
36 | 355 | DisplayMode mode = this.getGraphicsConfiguration().getDevice().getDisplayMode(); | ||
37 | 356 | Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(this.getGraphicsConfiguration()); | ||
38 | 357 | this.setMaximizedBounds(new Rectangle( | ||
39 | 358 | mode.getWidth() - insets.right - insets.left, | ||
40 | 359 | mode.getHeight() - insets.top - insets.bottom | ||
41 | 360 | )); | ||
42 | 361 | this.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH); | ||
43 | 362 | this.setSize(mode.getWidth() - insets.right - insets.left, mode.getHeight() - insets.top - insets.bottom); | ||
44 | 363 | }else{ | ||
45 | 364 | this.setExtendedState(JFrame.NORMAL); | ||
46 | 365 | } | ||
47 | 366 | } | ||
48 | 367 | |||
49 | 349 | public void startup() { | 368 | public void startup() { |
50 | 350 | MainWindowIconManager.apply(this); | 369 | MainWindowIconManager.apply(this); |
51 | 351 | 370 | ||
52 | @@ -375,13 +394,6 @@ | |||
53 | 375 | rootDockingPort = new DefaultDockingPort("defaultDockingPort"); | 394 | rootDockingPort = new DefaultDockingPort("defaultDockingPort"); |
54 | 376 | content.add(rootDockingPort, BorderLayout.CENTER); | 395 | content.add(rootDockingPort, BorderLayout.CENTER); |
55 | 377 | 396 | ||
56 | 378 | boolean maximised = Boolean.parseBoolean(framework | ||
57 | 379 | .getConfigVar("gui.main.maximised")); | ||
58 | 380 | String w = framework.getConfigVar("gui.main.width"); | ||
59 | 381 | String h = framework.getConfigVar("gui.main.height"); | ||
60 | 382 | int width = (w == null) ? 800 : Integer.parseInt(w); | ||
61 | 383 | int height = (h == null) ? 600 : Integer.parseInt(h); | ||
62 | 384 | |||
63 | 385 | lastSavePath = framework.getConfigVar("gui.main.lastSavePath"); | 397 | lastSavePath = framework.getConfigVar("gui.main.lastSavePath"); |
64 | 386 | lastOpenPath = framework.getConfigVar("gui.main.lastOpenPath"); | 398 | lastOpenPath = framework.getConfigVar("gui.main.lastOpenPath"); |
65 | 387 | for (int i = 0; i < CommonEditorSettings.getRecentCount(); i++) { | 399 | for (int i = 0; i < CommonEditorSettings.getRecentCount(); i++) { |
66 | @@ -390,12 +402,23 @@ | |||
67 | 390 | } | 402 | } |
68 | 391 | mainMenu.setRecentMenu(new ArrayList<String>(recentFiles)); | 403 | mainMenu.setRecentMenu(new ArrayList<String>(recentFiles)); |
69 | 392 | 404 | ||
70 | 405 | String maximisedStr = framework.getConfigVar("gui.main.maximised"); | ||
71 | 406 | String widthStr = framework.getConfigVar("gui.main.width"); | ||
72 | 407 | String heightStr = framework.getConfigVar("gui.main.height"); | ||
73 | 408 | |||
74 | 409 | boolean maximised = (maximisedStr == null) ? true : Boolean.parseBoolean(maximisedStr); | ||
75 | 410 | this.setExtendedState(maximised ? JFrame.MAXIMIZED_BOTH : JFrame.NORMAL); | ||
76 | 411 | |||
77 | 412 | DisplayMode mode = this.getGraphicsConfiguration().getDevice().getDisplayMode(); | ||
78 | 413 | Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(this.getGraphicsConfiguration()); | ||
79 | 414 | int width = mode.getWidth() - insets.right - insets.left; | ||
80 | 415 | int height = mode.getHeight() - insets.top - insets.bottom; | ||
81 | 416 | if ((widthStr != null) && (heightStr != null)) { | ||
82 | 417 | width = Integer.parseInt(widthStr); | ||
83 | 418 | height = Integer.parseInt(heightStr); | ||
84 | 419 | } | ||
85 | 393 | this.setSize(width, height); | 420 | this.setSize(width, height); |
86 | 394 | 421 | ||
87 | 395 | if (maximised) { | ||
88 | 396 | setExtendedState(MAXIMIZED_BOTH); | ||
89 | 397 | } | ||
90 | 398 | |||
91 | 399 | createWindows(); | 422 | createWindows(); |
92 | 400 | 423 | ||
93 | 401 | outputWindow.captureStream(); | 424 | outputWindow.captureStream(); |
94 | @@ -404,44 +427,50 @@ | |||
95 | 404 | rootDockingPort.setBorderManager(new StandardBorderManager( | 427 | rootDockingPort.setBorderManager(new StandardBorderManager( |
96 | 405 | new ShadowBorder())); | 428 | new ShadowBorder())); |
97 | 406 | 429 | ||
113 | 407 | outputDockable = createDockableWindow(outputWindow, "Output", | 430 | float xSplit = 0.88f; |
114 | 408 | DockableWindowContentPanel.CLOSE_BUTTON, | 431 | float ySplit = 0.82f; |
115 | 409 | DockingManager.SOUTH_REGION, 0.8f); | 432 | outputDockable = createDockableWindow( |
116 | 410 | 433 | outputWindow, "Output", | |
117 | 411 | DockableWindow problems = createDockableWindow(errorWindow, "Problems", | 434 | DockableWindowContentPanel.CLOSE_BUTTON, |
118 | 412 | outputDockable, DockableWindowContentPanel.CLOSE_BUTTON); | 435 | DockingManager.SOUTH_REGION, ySplit); |
119 | 413 | 436 | ||
120 | 414 | 437 | DockableWindow problems = createDockableWindow( | |
121 | 415 | DockableWindow javaScript = createDockableWindow(jsWindow, | 438 | errorWindow, "Problems", outputDockable, |
122 | 416 | "Javascript", outputDockable, | 439 | DockableWindowContentPanel.CLOSE_BUTTON); |
123 | 417 | DockableWindowContentPanel.CLOSE_BUTTON); | 440 | |
124 | 418 | 441 | DockableWindow javaScript = createDockableWindow( | |
125 | 419 | DockableWindow wsvd = createDockableWindow(workspaceWindow, | 442 | jsWindow, "Javascript", outputDockable, |
126 | 420 | "Workspace", DockableWindowContentPanel.CLOSE_BUTTON, | 443 | DockableWindowContentPanel.CLOSE_BUTTON); |
127 | 421 | DockingManager.EAST_REGION, 0.8f); | 444 | |
128 | 445 | DockableWindow wsvd = createDockableWindow( | ||
129 | 446 | workspaceWindow, "Workspace", | ||
130 | 447 | DockableWindowContentPanel.CLOSE_BUTTON, | ||
131 | 448 | DockingManager.EAST_REGION, xSplit); | ||
132 | 449 | |||
133 | 422 | DockableWindow propertyEditor = createDockableWindow( | 450 | DockableWindow propertyEditor = createDockableWindow( |
134 | 423 | propertyEditorWindow, "Property editor", wsvd, | 451 | propertyEditorWindow, "Property editor", wsvd, |
135 | 424 | DockableWindowContentPanel.CLOSE_BUTTON, | 452 | DockableWindowContentPanel.CLOSE_BUTTON, |
144 | 425 | DockingManager.NORTH_REGION, 0.5f); | 453 | DockingManager.NORTH_REGION, ySplit); |
145 | 426 | DockableWindow toolbox = createDockableWindow(toolboxWindow, | 454 | |
146 | 427 | "Editor tools", propertyEditor, | 455 | DockableWindow tiw = createDockableWindow( |
147 | 428 | DockableWindowContentPanel.HEADER | 456 | toolInterfaceWindow, "Tool controls", propertyEditor, |
140 | 429 | | DockableWindowContentPanel.CLOSE_BUTTON, | ||
141 | 430 | DockingManager.SOUTH_REGION, 0.5f); | ||
142 | 431 | DockableWindow tiw = createDockableWindow(toolInterfaceWindow, | ||
143 | 432 | "Tool controls", toolbox, | ||
148 | 433 | DockableWindowContentPanel.CLOSE_BUTTON, | 457 | DockableWindowContentPanel.CLOSE_BUTTON, |
154 | 434 | DockingManager.SOUTH_REGION, 0.5f); | 458 | DockingManager.SOUTH_REGION, 0.4f); |
155 | 435 | 459 | ||
156 | 436 | documentPlaceholder = createDockableWindow(new DocumentPlaceholder(), | 460 | DockableWindow toolbox = createDockableWindow( |
157 | 437 | "", null, outputDockable, 0, DockingManager.NORTH_REGION, 0.8f, | 461 | toolboxWindow, "Editor tools", tiw, |
158 | 438 | "DocumentPlaceholder"); | 462 | DockableWindowContentPanel.HEADER | DockableWindowContentPanel.CLOSE_BUTTON, |
159 | 463 | DockingManager.SOUTH_REGION, 0.82f); | ||
160 | 464 | |||
161 | 465 | documentPlaceholder = createDockableWindow( | ||
162 | 466 | new DocumentPlaceholder(), "", null, outputDockable, | ||
163 | 467 | 0, DockingManager.NORTH_REGION, ySplit, "DocumentPlaceholder"); | ||
164 | 439 | 468 | ||
165 | 440 | DockingManager.display(outputDockable); | 469 | DockingManager.display(outputDockable); |
168 | 441 | EffectsManager.setPreview(new AlphaPreview(Color.BLACK, Color.GRAY, | 470 | EffectsManager.setPreview(new AlphaPreview(Color.BLACK, Color.GRAY, 0.5f)); |
167 | 442 | 0.5f)); | ||
169 | 443 | 471 | ||
171 | 444 | DockableWindow tasks = createDockableWindow(new TaskManagerWindow(), "Tasks", outputDockable, | 472 | DockableWindow tasks = createDockableWindow( |
172 | 473 | new TaskManagerWindow(), "Tasks", outputDockable, | ||
173 | 445 | DockableWindowContentPanel.CLOSE_BUTTON); | 474 | DockableWindowContentPanel.CLOSE_BUTTON); |
174 | 446 | 475 | ||
175 | 447 | setVisible(true); | 476 | setVisible(true); |
176 | @@ -718,8 +747,9 @@ | |||
177 | 718 | saveDockingLayout(); | 747 | saveDockingLayout(); |
178 | 719 | 748 | ||
179 | 720 | content.remove(rootDockingPort); | 749 | content.remove(rootDockingPort); |
182 | 721 | 750 | ||
183 | 722 | framework.setConfigVar("gui.main.maximised", Boolean.toString((getExtendedState() & JFrame.MAXIMIZED_BOTH) != 0)); | 751 | boolean maximised = ((getExtendedState() & JFrame.MAXIMIZED_BOTH) != 0); |
184 | 752 | framework.setConfigVar("gui.main.maximised", Boolean.toString(maximised)); | ||
185 | 723 | framework.setConfigVar("gui.main.width", Integer.toString(getWidth())); | 753 | framework.setConfigVar("gui.main.width", Integer.toString(getWidth())); |
186 | 724 | framework.setConfigVar("gui.main.height", Integer.toString(getHeight())); | 754 | framework.setConfigVar("gui.main.height", Integer.toString(getHeight())); |
187 | 725 | 755 | ||
188 | @@ -928,7 +958,6 @@ | |||
189 | 928 | } | 958 | } |
190 | 929 | openWork(f); | 959 | openWork(f); |
191 | 930 | } | 960 | } |
192 | 931 | lastOpenPath = fc.getCurrentDirectory().getPath(); | ||
193 | 932 | } else { | 961 | } else { |
194 | 933 | throw new OperationCancelledException("Open operation cancelled by user."); | 962 | throw new OperationCancelledException("Open operation cancelled by user."); |
195 | 934 | } | 963 | } |
196 | @@ -943,6 +972,7 @@ | |||
197 | 943 | createEditorWindow(we); | 972 | createEditorWindow(we); |
198 | 944 | } | 973 | } |
199 | 945 | pushRecentFile(f.getPath(), true); | 974 | pushRecentFile(f.getPath(), true); |
200 | 975 | lastOpenPath = f.getParent(); | ||
201 | 946 | } catch (DeserialisationException e) { | 976 | } catch (DeserialisationException e) { |
202 | 947 | JOptionPane.showMessageDialog(this, | 977 | JOptionPane.showMessageDialog(this, |
203 | 948 | "A problem was encountered while trying to load \"" + f.getPath() + "\".\n" | 978 | "A problem was encountered while trying to load \"" + f.getPath() + "\".\n" |
204 | @@ -964,7 +994,6 @@ | |||
205 | 964 | } | 994 | } |
206 | 965 | mergeWork(f); | 995 | mergeWork(f); |
207 | 966 | } | 996 | } |
208 | 967 | lastOpenPath = fc.getCurrentDirectory().getPath(); | ||
209 | 968 | } else { | 997 | } else { |
210 | 969 | throw new OperationCancelledException("Merge operation cancelled by user."); | 998 | throw new OperationCancelledException("Merge operation cancelled by user."); |
211 | 970 | } | 999 | } |
212 | @@ -1098,7 +1127,6 @@ | |||
213 | 1098 | for (File f : fc.getSelectedFiles()) { | 1127 | for (File f : fc.getSelectedFiles()) { |
214 | 1099 | importFrom(f, importers); | 1128 | importFrom(f, importers); |
215 | 1100 | } | 1129 | } |
216 | 1101 | lastOpenPath = fc.getCurrentDirectory().getPath(); | ||
217 | 1102 | } | 1130 | } |
218 | 1103 | } | 1131 | } |
219 | 1104 | 1132 | ||
220 | @@ -1111,6 +1139,7 @@ | |||
221 | 1111 | ModelEntry me = Import.importFromFile(importer, f); | 1139 | ModelEntry me = Import.importFromFile(importer, f); |
222 | 1112 | me.getModel().setTitle(FileUtils.getFileNameWithoutExtension(f)); | 1140 | me.getModel().setTitle(FileUtils.getFileNameWithoutExtension(f)); |
223 | 1113 | framework.getWorkspace().add(Path.<String> empty(), f.getName(), me, false, me.isVisual()); | 1141 | framework.getWorkspace().add(Path.<String> empty(), f.getName(), me, false, me.isVisual()); |
224 | 1142 | lastOpenPath = f.getParent(); | ||
225 | 1114 | break; | 1143 | break; |
226 | 1115 | } catch (IOException e) { | 1144 | } catch (IOException e) { |
227 | 1116 | e.printStackTrace(); | 1145 | e.printStackTrace(); |
228 | 1117 | 1146 | ||
229 | === modified file 'build_distr.sh' | |||
230 | --- build_distr.sh 2015-01-26 22:10:33 +0000 | |||
231 | +++ build_distr.sh 2015-03-17 14:02:13 +0000 | |||
232 | @@ -92,9 +92,3 @@ | |||
233 | 92 | do | 92 | do |
234 | 93 | cp -r $src_dir/$i $distr_dir/ | 93 | cp -r $src_dir/$i $distr_dir/ |
235 | 94 | done | 94 | done |
236 | 95 | |||
237 | 96 | # Copy config | ||
238 | 97 | if [ -e $src_dir/config ] | ||
239 | 98 | then | ||
240 | 99 | cp -r $src_dir/config $distr_dir/ | ||
241 | 100 | fi | ||
242 | 101 | 95 | ||
243 | === modified file 'build_distr_linux.sh' | |||
244 | --- build_distr_linux.sh 2015-02-28 23:14:51 +0000 | |||
245 | +++ build_distr_linux.sh 2015-03-17 14:02:13 +0000 | |||
246 | @@ -1,7 +1,7 @@ | |||
247 | 1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
248 | 2 | 2 | ||
249 | 3 | src_dir="." | 3 | src_dir="." |
251 | 4 | distr_dir="../../workcraft_3.0.4_alpha" | 4 | distr_dir="../../workcraft_3.0.4" |
252 | 5 | template_dir="../../distr-template-linux" | 5 | template_dir="../../distr-template-linux" |
253 | 6 | 6 | ||
254 | 7 | ./build_distr.sh -s $src_dir -d $distr_dir -t $template_dir | 7 | ./build_distr.sh -s $src_dir -d $distr_dir -t $template_dir |
255 | 8 | 8 | ||
256 | === modified file 'build_distr_windows.sh' | |||
257 | --- build_distr_windows.sh 2015-02-28 23:14:51 +0000 | |||
258 | +++ build_distr_windows.sh 2015-03-17 14:02:13 +0000 | |||
259 | @@ -1,7 +1,7 @@ | |||
260 | 1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
261 | 2 | 2 | ||
262 | 3 | src_dir="." | 3 | src_dir="." |
264 | 4 | distr_dir="../../workcraft_3.0.4_alpha" | 4 | distr_dir="../../workcraft_3.0.4" |
265 | 5 | template_dir="../../distr-template-windows" | 5 | template_dir="../../distr-template-windows" |
266 | 6 | 6 | ||
267 | 7 | ./build_distr.sh -s $src_dir -d $distr_dir -t $template_dir | 7 | ./build_distr.sh -s $src_dir -d $distr_dir -t $template_dir |