.. | .. |
---|
4 | 4 | |
---|
5 | 5 | import java.awt.*; |
---|
6 | 6 | import java.awt.event.*; |
---|
| 7 | +import java.awt.image.BufferedImage; |
---|
7 | 8 | import javax.swing.*; |
---|
8 | 9 | import javax.swing.event.*; |
---|
9 | 10 | import javax.swing.text.*; |
---|
.. | .. |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
16 | 17 | |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
| 20 | + |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
19 | 23 | import //weka.core. |
---|
20 | 24 | matrix.Matrix; |
---|
| 25 | + |
---|
| 26 | +import grafeme.ui.*; |
---|
21 | 27 | |
---|
22 | 28 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 29 | ActionListener, ChangeListener, |
---|
.. | .. |
---|
28 | 34 | iSendInfo |
---|
29 | 35 | //KeyListener |
---|
30 | 36 | { |
---|
| 37 | + boolean timeline; |
---|
| 38 | + boolean wasFullScreen; |
---|
31 | 39 | |
---|
| 40 | + GroupEditor callee; |
---|
| 41 | + JFrame frame; |
---|
| 42 | + |
---|
| 43 | + static ObjEditor theFrame; |
---|
| 44 | + |
---|
| 45 | + cButton GetButton(String name, boolean border) |
---|
| 46 | + { |
---|
| 47 | + try |
---|
| 48 | + { |
---|
| 49 | + ImageIcon icon = GetIcon(name); |
---|
| 50 | + return new cButton(icon, border); |
---|
| 51 | + } |
---|
| 52 | + catch (Exception e) |
---|
| 53 | + { |
---|
| 54 | + return new cButton(name, border); |
---|
| 55 | + } |
---|
| 56 | + } |
---|
| 57 | + |
---|
| 58 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 59 | + { |
---|
| 60 | + try |
---|
| 61 | + { |
---|
| 62 | + ImageIcon icon = GetIcon(name); |
---|
| 63 | + return new cToggleButton(icon, border); |
---|
| 64 | + } |
---|
| 65 | + catch (Exception e) |
---|
| 66 | + { |
---|
| 67 | + return new cToggleButton(name, border); |
---|
| 68 | + } |
---|
| 69 | + } |
---|
| 70 | + |
---|
| 71 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 72 | + { |
---|
| 73 | + try |
---|
| 74 | + { |
---|
| 75 | + ImageIcon icon = GetIcon(name); |
---|
| 76 | + return new cCheckBox(icon, border); |
---|
| 77 | + } |
---|
| 78 | + catch (Exception e) |
---|
| 79 | + { |
---|
| 80 | + return new cCheckBox(name, border); |
---|
| 81 | + } |
---|
| 82 | + } |
---|
| 83 | + |
---|
| 84 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 85 | + { |
---|
| 86 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 87 | + |
---|
| 88 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 89 | + { |
---|
| 90 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 91 | + Graphics2D g = resized.createGraphics(); |
---|
| 92 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 93 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 94 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 95 | + g.dispose(); |
---|
| 96 | + |
---|
| 97 | + image = resized; |
---|
| 98 | + } |
---|
| 99 | + |
---|
| 100 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 101 | + return icon; |
---|
| 102 | + } |
---|
| 103 | + |
---|
32 | 104 | // SCRIPT |
---|
33 | 105 | |
---|
34 | 106 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
119 | 191 | void keyPressed(int key, int modifiers) |
---|
120 | 192 | { |
---|
121 | 193 | System.out.println("KEY PRESSED"); |
---|
122 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 194 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
123 | 195 | } |
---|
124 | 196 | */ |
---|
125 | 197 | |
---|
126 | 198 | static GridBagConstraints aConstraints; |
---|
127 | 199 | static GridBagConstraints aWindowConstraints; |
---|
128 | | - GroupEditor callee; |
---|
129 | | - JFrame frame; |
---|
| 200 | + |
---|
130 | 201 | static int GRIDWIDTH = 100; // 4; |
---|
131 | 202 | |
---|
132 | 203 | public void closeUI() |
---|
133 | 204 | { |
---|
134 | 205 | //new Exception().printStackTrace(); |
---|
135 | | - System.out.println("this = " + this); |
---|
136 | | - System.out.println("objEditor = " + objEditor); |
---|
| 206 | +// System.out.println("this = " + this); |
---|
| 207 | +// System.out.println("objEditor = " + objEditor); |
---|
137 | 208 | //nameField.removeActionListener(this); |
---|
138 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 209 | +// objEditor.ctrlPanel.remove(nameField); |
---|
139 | 210 | |
---|
140 | | - if (!GroupEditor.allparams) |
---|
| 211 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 212 | + |
---|
| 213 | + if (!allparams) |
---|
141 | 214 | return; |
---|
142 | 215 | |
---|
143 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
144 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
145 | | - objEditor.ctrlPanel.remove(markCB); |
---|
146 | | - |
---|
147 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
148 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
149 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
150 | | - |
---|
151 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
152 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
153 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
154 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
155 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
156 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
157 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
158 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
159 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
160 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 216 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 217 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 218 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 219 | +// |
---|
| 220 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 221 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 222 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 223 | +// |
---|
| 224 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 225 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 226 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 227 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 228 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 229 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 230 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 231 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 232 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 233 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
| 234 | + |
---|
| 235 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 236 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 237 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 238 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 239 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 240 | + |
---|
| 241 | + //Remove(normalpushField); |
---|
161 | 242 | } |
---|
162 | 243 | |
---|
163 | 244 | public ObjEditor GetEditor() |
---|
164 | 245 | { |
---|
165 | 246 | return objEditor; //.GetEditor(); |
---|
166 | 247 | } |
---|
| 248 | + |
---|
| 249 | + // Sometimes myself, sometimes my callee's. |
---|
167 | 250 | ObjEditor objEditor; |
---|
168 | 251 | |
---|
169 | 252 | /* |
---|
.. | .. |
---|
199 | 282 | client = inClient; |
---|
200 | 283 | copy = client; |
---|
201 | 284 | |
---|
| 285 | + if (copy.versions == null) |
---|
| 286 | + { |
---|
| 287 | + copy.versions = new byte[100][]; |
---|
| 288 | + copy.versionindex = -1; |
---|
| 289 | + } |
---|
| 290 | + |
---|
202 | 291 | // "this" is not called: SetupUI2(objEditor); |
---|
203 | 292 | } |
---|
204 | 293 | |
---|
.. | .. |
---|
212 | 301 | client = inClient; |
---|
213 | 302 | copy = client; |
---|
214 | 303 | |
---|
| 304 | + if (copy.versions == null) |
---|
| 305 | + { |
---|
| 306 | + copy.versions = new byte[100][]; |
---|
| 307 | + copy.versionindex = -1; |
---|
| 308 | + } |
---|
| 309 | + |
---|
215 | 310 | SetupUI2(callee.GetEditor()); |
---|
216 | 311 | } |
---|
217 | 312 | |
---|
.. | .. |
---|
226 | 321 | //localCopy.parent = null; |
---|
227 | 322 | |
---|
228 | 323 | frame = new JFrame(); |
---|
| 324 | + frame.setUndecorated(false); |
---|
229 | 325 | objEditor = this; |
---|
230 | 326 | this.callee = callee; |
---|
231 | 327 | |
---|
.. | .. |
---|
238 | 334 | //if (!isDisplayable()) |
---|
239 | 335 | //setUndecorated(true); |
---|
240 | 336 | |
---|
241 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 337 | + //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
242 | 338 | client = inClient; |
---|
243 | 339 | copy = localCopy; |
---|
244 | 340 | copy.editWindow = this; |
---|
245 | 341 | |
---|
| 342 | + if (copy.versions == null) |
---|
| 343 | + { |
---|
| 344 | + copy.versions = new byte[100][]; |
---|
| 345 | + copy.versionindex = -1; |
---|
| 346 | + } |
---|
| 347 | + |
---|
246 | 348 | SetupMenu(); |
---|
247 | 349 | |
---|
248 | 350 | //SetupName(objEditor); // new |
---|
.. | .. |
---|
256 | 358 | return frame.action(event, obj); |
---|
257 | 359 | } |
---|
258 | 360 | |
---|
| 361 | + // Cannot work without static |
---|
| 362 | + static boolean allparams = true; |
---|
| 363 | + |
---|
| 364 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 365 | + |
---|
259 | 366 | void SetupMenu() |
---|
260 | 367 | { |
---|
261 | 368 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
262 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
263 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
264 | | - windowMenu.add("-"); |
---|
265 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
266 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 369 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 370 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 371 | + fileMenu.add(openItem = new MenuItem("Open...")); |
---|
| 372 | + |
---|
| 373 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 374 | + Menu menu = new Menu("Import"); |
---|
| 375 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 376 | + importOBJItem.addActionListener(this); |
---|
| 377 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 378 | + import3DSItem.addActionListener(this); |
---|
| 379 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 380 | + importVRMLX3DItem.addActionListener(this); |
---|
| 381 | + menu.add("-"); |
---|
| 382 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 383 | + importGFDItem.addActionListener(this); |
---|
| 384 | + fileMenu.add(menu); |
---|
| 385 | + fileMenu.add("-"); |
---|
| 386 | + |
---|
| 387 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 388 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
267 | 389 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
268 | | - windowMenu.add("-"); |
---|
269 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
270 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
271 | | - windowMenu.add("-"); |
---|
| 390 | + fileMenu.add("-"); |
---|
| 391 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 392 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 393 | + fileMenu.add("-"); |
---|
272 | 394 | if (client.parent != null) |
---|
273 | 395 | { |
---|
274 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 396 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
275 | 397 | } else |
---|
276 | 398 | { |
---|
277 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 399 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
278 | 400 | } |
---|
279 | 401 | |
---|
280 | | - loadItem.addActionListener(this); |
---|
| 402 | + newItem.addActionListener(this); |
---|
| 403 | + openItem.addActionListener(this); |
---|
281 | 404 | saveItem.addActionListener(this); |
---|
282 | 405 | saveAsItem.addActionListener(this); |
---|
283 | 406 | exportAsItem.addActionListener(this); |
---|
.. | .. |
---|
285 | 408 | //povItem.addActionListener(this); |
---|
286 | 409 | closeItem.addActionListener(this); |
---|
287 | 410 | |
---|
288 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
289 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
290 | | - //zBufferItem.addActionListener(this); |
---|
291 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
292 | | - //normalLensItem.addActionListener(this); |
---|
293 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
294 | | - revertCameraItem.addActionListener(this); |
---|
295 | | - cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen")); |
---|
296 | | - toggleFullItem.addItemListener(this); |
---|
297 | | - toggleFullItem.setState(CameraPane.FULLSCREEN); |
---|
298 | | - cameraMenu.add("-"); |
---|
299 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
300 | | - toggleTextureItem.addItemListener(this); |
---|
301 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
302 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
303 | | - toggleLiveItem.addItemListener(this); |
---|
304 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
305 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
306 | | - stepItem.addActionListener(this); |
---|
307 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
308 | | -// toggleDLItem.addItemListener(this); |
---|
309 | | -// toggleDLItem.setState(false); |
---|
310 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
311 | | - toggleRenderItem.addItemListener(this); |
---|
312 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
313 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
314 | | - toggleDebugItem.addItemListener(this); |
---|
315 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
316 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
317 | | - toggleFrustumItem.addItemListener(this); |
---|
318 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
319 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
320 | | - toggleFootContactItem.addItemListener(this); |
---|
321 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
322 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
323 | | - toggleRandomItem.addItemListener(this); |
---|
324 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
325 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
326 | | - toggleHandleItem.addItemListener(this); |
---|
327 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
328 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
329 | | - togglePaintItem.addItemListener(this); |
---|
330 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
331 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
332 | | -// toggleRootItem.addItemListener(this); |
---|
333 | | -// toggleRootItem.setState(false); |
---|
334 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
335 | | -// animationItem.addItemListener(this); |
---|
336 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
337 | | - cameraMenu.add("-"); |
---|
338 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
339 | | - editCameraItem.addActionListener(this); |
---|
340 | | - |
---|
341 | 411 | objectPanel = new JTabbedPane(); |
---|
| 412 | + |
---|
| 413 | + ChangeListener changeListener = new ChangeListener() |
---|
| 414 | + { |
---|
| 415 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 416 | + { |
---|
| 417 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 418 | +// { |
---|
| 419 | +// if (latestObject != null) |
---|
| 420 | +// { |
---|
| 421 | +// refreshContents(true); |
---|
| 422 | +// SetMaterial(latestObject); |
---|
| 423 | +// } |
---|
| 424 | +// |
---|
| 425 | +// materialFlushed = true; |
---|
| 426 | +// } |
---|
| 427 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 428 | +// { |
---|
| 429 | +// if (listUI.size() == 0) |
---|
| 430 | +// EditSelection(false); |
---|
| 431 | +// } |
---|
| 432 | + |
---|
| 433 | + refreshContents(false); // To refresh Info tab |
---|
| 434 | + } |
---|
| 435 | + }; |
---|
| 436 | + objectPanel.addChangeListener(changeListener); |
---|
| 437 | + |
---|
342 | 438 | toolbarPanel = new JPanel(); |
---|
343 | 439 | toolbarPanel.setName("Toolbar"); |
---|
344 | | - treePanel = new JPanel(); |
---|
| 440 | + treePanel = new cGridBag(); |
---|
345 | 441 | treePanel.setName("Tree"); |
---|
346 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
347 | | - ctrlPanel.setName("Edit"); |
---|
348 | | - materialPanel = new JPanel(); |
---|
| 442 | + |
---|
| 443 | + editPanel = new cGridBag().setVertical(true); |
---|
| 444 | + editPanel.setName("Edit"); |
---|
| 445 | + |
---|
| 446 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 447 | + |
---|
| 448 | + editCommandsPanel = new cGridBag(); |
---|
| 449 | + editPanel.add(editCommandsPanel); |
---|
| 450 | + editPanel.add(ctrlPanel); |
---|
| 451 | + |
---|
| 452 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 453 | + toolboxPanel.setName("Toolbox"); |
---|
| 454 | + |
---|
| 455 | + materialPanel = new cGridBag().setVertical(true); |
---|
349 | 456 | materialPanel.setName("Material"); |
---|
| 457 | + |
---|
350 | 458 | /*JTextPane*/ |
---|
351 | 459 | infoarea = createTextPane(); |
---|
| 460 | + doc = infoarea.getStyledDocument(); |
---|
| 461 | + |
---|
352 | 462 | infoarea.setEditable(true); |
---|
353 | 463 | SetText(); |
---|
354 | 464 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
355 | 465 | // infoarea.setOpaque(false); |
---|
356 | 466 | // //infoarea.setForeground(textcolor); |
---|
357 | | - infoarea.setLineWrap(true); |
---|
358 | | - infoarea.setWrapStyleWord(true); |
---|
| 467 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 468 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
359 | 469 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
360 | | - infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
| 470 | + infoPanel.setPreferredSize(new Dimension(1, 1)); |
---|
361 | 471 | infoPanel.setName("Info"); |
---|
362 | 472 | //infoPanel.setLayout(new BorderLayout()); |
---|
363 | 473 | //infoPanel.add(createTextPane()); |
---|
.. | .. |
---|
366 | 476 | mainPanel.setName("Main"); |
---|
367 | 477 | mainPanel.setContinuousLayout(true); |
---|
368 | 478 | mainPanel.setOneTouchExpandable(true); |
---|
369 | | - mainPanel.setDividerLocation(1.0); |
---|
370 | 479 | mainPanel.setDividerSize(9); |
---|
371 | | - mainPanel.setResizeWeight(0); |
---|
372 | | - |
---|
| 480 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 481 | + mainPanel.setResizeWeight(0.5); |
---|
| 482 | + |
---|
| 483 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 484 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 485 | + divider.setDividerSize(15); |
---|
| 486 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 487 | + |
---|
| 488 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 489 | + |
---|
373 | 490 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
374 | 491 | //mainPanel.setLayout(new GridBagLayout()); |
---|
375 | 492 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
376 | | - treePanel.setLayout(new GridBagLayout()); |
---|
377 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
378 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 493 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 494 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 495 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
379 | 496 | |
---|
380 | 497 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
381 | 498 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
414 | 531 | static String newline = "\n"; |
---|
415 | 532 | protected static final String buttonString = "JButton"; |
---|
416 | 533 | StyledDocument doc; |
---|
417 | | - JTextArea infoarea; |
---|
| 534 | + JTextPane infoarea; |
---|
418 | 535 | |
---|
419 | 536 | void ClearInfo() |
---|
420 | 537 | { |
---|
.. | .. |
---|
437 | 554 | e.printStackTrace(); |
---|
438 | 555 | } |
---|
439 | 556 | |
---|
440 | | - String selection = infoarea.getText(); |
---|
441 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
442 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
443 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 557 | +// String selection = infoarea.getText(); |
---|
| 558 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 559 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 560 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
444 | 561 | //clipboard.setContents(data, data); |
---|
445 | 562 | } |
---|
446 | 563 | |
---|
.. | .. |
---|
463 | 580 | //SendInfo("Name:", "bold"); |
---|
464 | 581 | if (sel.GetTextures() != null || debug) |
---|
465 | 582 | { |
---|
466 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 583 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
467 | 584 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
468 | 585 | if (sel.Size() > 0) |
---|
469 | 586 | { |
---|
470 | 587 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
471 | 588 | } |
---|
472 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 589 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
473 | 590 | if (debug) |
---|
474 | 591 | { |
---|
475 | 592 | try |
---|
.. | .. |
---|
481 | 598 | } |
---|
482 | 599 | |
---|
483 | 600 | if (full) |
---|
484 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 601 | + { |
---|
| 602 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 603 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 604 | + } |
---|
485 | 605 | |
---|
486 | 606 | if (sel.bRep != null) |
---|
487 | 607 | { |
---|
.. | .. |
---|
508 | 628 | } |
---|
509 | 629 | if (sel.support != null) |
---|
510 | 630 | { |
---|
511 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 631 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
512 | 632 | } |
---|
513 | 633 | if (sel.scriptnode != null) |
---|
514 | 634 | { |
---|
.. | .. |
---|
579 | 699 | { |
---|
580 | 700 | CameraPane.pointflow = (PointFlow) sel; |
---|
581 | 701 | } |
---|
| 702 | + |
---|
| 703 | + si.SendInfo("_____________________", "regular"); |
---|
| 704 | + si.SendInfo("", "regular"); |
---|
582 | 705 | } |
---|
583 | 706 | } |
---|
584 | 707 | |
---|
.. | .. |
---|
594 | 717 | } |
---|
595 | 718 | } |
---|
596 | 719 | |
---|
597 | | - private JTextArea createTextPane() |
---|
598 | | - { |
---|
599 | | - String[] initString = |
---|
600 | | - { |
---|
601 | | - "This is an editable JTextPane, ", //regular |
---|
602 | | - "another ", //italic |
---|
603 | | - "styled ", //bold |
---|
604 | | - "text ", //small |
---|
605 | | - "component, ", //large |
---|
606 | | - "which supports embedded components..." + newline,//regular |
---|
607 | | - " " + newline, //button |
---|
608 | | - "...and embedded icons..." + newline, //regular |
---|
609 | | - " ", //icon |
---|
610 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
611 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
612 | | - + "cover methods for interacting with those objects." |
---|
613 | | - }; |
---|
| 720 | +//static GraphicsDevice device = GraphicsEnvironment |
---|
| 721 | +// .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
614 | 722 | |
---|
615 | | - String[] initStyles = |
---|
616 | | - { |
---|
617 | | - "regular", "italic", "bold", "small", "large", |
---|
618 | | - "regular", "button", "regular", "icon", |
---|
619 | | - "regular" |
---|
620 | | - }; |
---|
| 723 | + Rectangle keeprect; |
---|
| 724 | + cRadio radio; |
---|
| 725 | + |
---|
| 726 | +cButton keepButton; |
---|
| 727 | + cButton twoButton; // Full 3D |
---|
| 728 | + cButton sixButton; |
---|
| 729 | + cButton threeButton; |
---|
| 730 | + cButton sevenButton; |
---|
| 731 | + cButton fourButton; // full panel |
---|
| 732 | + cButton oneButton; // full XYZ |
---|
| 733 | + //cButton currentLayout; |
---|
| 734 | + |
---|
| 735 | + boolean maximized; |
---|
| 736 | + |
---|
| 737 | + cButton fullscreenLayout; |
---|
621 | 738 | |
---|
622 | | - JTextPane textPane = new JTextPane(); |
---|
623 | | - textPane.setEditable(true); |
---|
624 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
625 | | - addStylesToDocument(doc); |
---|
626 | | - |
---|
627 | | - try |
---|
| 739 | + void Minimize() |
---|
628 | 740 | { |
---|
629 | | - for (int j = 0; j < 2; j++) |
---|
| 741 | + frame.setState(Frame.ICONIFIED); |
---|
| 742 | + frame.validate(); |
---|
| 743 | + } |
---|
| 744 | + |
---|
| 745 | +// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={} |
---|
| 746 | +// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={} |
---|
| 747 | +// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={} |
---|
| 748 | + void Maximize() |
---|
| 749 | + { |
---|
| 750 | + if (CameraPane.FULLSCREEN) |
---|
630 | 751 | { |
---|
631 | | - for (int i = 0; i < initString.length; i++) |
---|
632 | | - { |
---|
633 | | - doc.insertString(doc.getLength(), initString[i], |
---|
634 | | - doc.getStyle(initStyles[i])); |
---|
635 | | - } |
---|
| 752 | + ToggleFullScreen(); |
---|
636 | 753 | } |
---|
637 | | - } catch (BadLocationException ble) |
---|
| 754 | + |
---|
| 755 | + if (maximized) |
---|
| 756 | + { |
---|
| 757 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 758 | + } |
---|
| 759 | + else |
---|
| 760 | + { |
---|
| 761 | + keeprect = frame.getBounds(); |
---|
| 762 | +// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 763 | +// Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 764 | +// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 765 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 766 | + frame.setBounds(frame.getGraphicsConfiguration().getBounds()); |
---|
| 767 | + } |
---|
| 768 | + |
---|
| 769 | + maximized ^= true; |
---|
| 770 | + |
---|
| 771 | + frame.validate(); |
---|
| 772 | + } |
---|
| 773 | + |
---|
| 774 | + cButton minButton; |
---|
| 775 | + cButton maxButton; |
---|
| 776 | + cButton fullButton; |
---|
| 777 | + |
---|
| 778 | + void ToggleFullScreen() |
---|
638 | 779 | { |
---|
639 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
| 780 | +GraphicsDevice device = frame.getGraphicsConfiguration().getDevice(); |
---|
| 781 | + |
---|
| 782 | + cameraView.ToggleFullScreen(); |
---|
| 783 | + |
---|
| 784 | + if (!CameraPane.FULLSCREEN) |
---|
| 785 | + { |
---|
| 786 | + device.setFullScreenWindow(null); |
---|
| 787 | + frame.dispose(); |
---|
| 788 | + frame.setUndecorated(false); |
---|
| 789 | + frame.validate(); |
---|
| 790 | + frame.setVisible(true); |
---|
| 791 | + |
---|
| 792 | + //frame.setVisible(false); |
---|
| 793 | +// frame.removeNotify(); |
---|
| 794 | +// frame.setUndecorated(false); |
---|
| 795 | +// frame.addNotify(); |
---|
| 796 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 797 | + |
---|
| 798 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 799 | +// X framePanel.add(bigThree); |
---|
| 800 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 801 | + framePanel.setDividerLocation(46); |
---|
| 802 | + |
---|
| 803 | + //frame.setVisible(true); |
---|
| 804 | + radio.layout = keepButton; |
---|
| 805 | + //theFrame = null; |
---|
| 806 | + keepButton = null; |
---|
| 807 | + radio.layout.doClick(); |
---|
| 808 | + |
---|
| 809 | + } else |
---|
| 810 | + { |
---|
| 811 | + keepButton = radio.layout; |
---|
| 812 | + //keeprect = frame.getBounds(); |
---|
| 813 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 814 | +// frame.getToolkit().getScreenSize().height); |
---|
| 815 | + //frame.setVisible(false); |
---|
| 816 | + |
---|
| 817 | + frame.dispose(); |
---|
| 818 | + frame.setUndecorated(true); |
---|
| 819 | + device.setFullScreenWindow(frame); |
---|
| 820 | + frame.validate(); |
---|
| 821 | + frame.setVisible(true); |
---|
| 822 | +// frame.removeNotify(); |
---|
| 823 | +// frame.setUndecorated(true); |
---|
| 824 | +// frame.addNotify(); |
---|
| 825 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 826 | +// X framePanel.remove(bigThree); |
---|
| 827 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 828 | + framePanel.setDividerLocation(0); |
---|
| 829 | + |
---|
| 830 | + radio.layout = fullscreenLayout; |
---|
| 831 | + radio.layout.doClick(); |
---|
| 832 | + //frame.setVisible(true); |
---|
| 833 | + } |
---|
| 834 | + frame.validate(); |
---|
640 | 835 | } |
---|
641 | 836 | |
---|
642 | | - return new JTextArea(); // textPane; |
---|
| 837 | + private byte[] CompressCopy() |
---|
| 838 | + { |
---|
| 839 | + boolean temp = CameraPane.SWITCH; |
---|
| 840 | + CameraPane.SWITCH = false; |
---|
| 841 | + |
---|
| 842 | + copy.ExtractBigData(versiontable); |
---|
| 843 | + // if (copy == client) |
---|
| 844 | + |
---|
| 845 | + byte[] versions[] = copy.versions; |
---|
| 846 | + copy.versions = null; |
---|
| 847 | + |
---|
| 848 | + byte[] compress = Compress(copy); |
---|
| 849 | + |
---|
| 850 | + copy.versions = versions; |
---|
| 851 | + |
---|
| 852 | + copy.RestoreBigData(versiontable); |
---|
| 853 | + |
---|
| 854 | + CameraPane.SWITCH = temp; |
---|
| 855 | + |
---|
| 856 | + return compress; |
---|
| 857 | + } |
---|
| 858 | + |
---|
| 859 | + private JTextPane createTextPane() |
---|
| 860 | + { |
---|
| 861 | +// TEXTAREA String[] initString = |
---|
| 862 | +// { |
---|
| 863 | +// "This is an editable JTextPane, ", //regular |
---|
| 864 | +// "another ", //italic |
---|
| 865 | +// "styled ", //bold |
---|
| 866 | +// "text ", //small |
---|
| 867 | +// "component, ", //large |
---|
| 868 | +// "which supports embedded components..." + newline,//regular |
---|
| 869 | +// " " + newline, //button |
---|
| 870 | +// "...and embedded icons..." + newline, //regular |
---|
| 871 | +// " ", //icon |
---|
| 872 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 873 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 874 | +// + "cover methods for interacting with those objects." |
---|
| 875 | +// }; |
---|
| 876 | +// |
---|
| 877 | +// String[] initStyles = |
---|
| 878 | +// { |
---|
| 879 | +// "regular", "italic", "bold", "small", "large", |
---|
| 880 | +// "regular", "button", "regular", "icon", |
---|
| 881 | +// "regular" |
---|
| 882 | +// }; |
---|
| 883 | +// |
---|
| 884 | +// JTextPane textPane = new JTextPane(); |
---|
| 885 | +// textPane.setEditable(true); |
---|
| 886 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 887 | +// addStylesToDocument(doc); |
---|
| 888 | +// |
---|
| 889 | +// try |
---|
| 890 | +// { |
---|
| 891 | +// for (int j = 0; j < 2; j++) |
---|
| 892 | +// { |
---|
| 893 | +// for (int i = 0; i < initString.length; i++) |
---|
| 894 | +// { |
---|
| 895 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 896 | +// doc.getStyle(initStyles[i])); |
---|
| 897 | +// } |
---|
| 898 | +// } |
---|
| 899 | +// } catch (BadLocationException ble) |
---|
| 900 | +// { |
---|
| 901 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 902 | +// } |
---|
| 903 | + |
---|
| 904 | + return new JTextPane(); // textPane; |
---|
643 | 905 | } |
---|
644 | 906 | |
---|
645 | 907 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
692 | 954 | protected static ImageIcon createImageIcon(String path, |
---|
693 | 955 | String description) |
---|
694 | 956 | { |
---|
695 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 957 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
696 | 958 | if (imgURL != null) |
---|
697 | 959 | { |
---|
698 | 960 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
724 | 986 | // NumberSlider vDivsField; |
---|
725 | 987 | // JCheckBox endcaps; |
---|
726 | 988 | JCheckBox liveCB; |
---|
| 989 | + JCheckBox selectCB; |
---|
727 | 990 | JCheckBox hideCB; |
---|
728 | 991 | JCheckBox link2masterCB; |
---|
729 | 992 | JCheckBox markCB; |
---|
.. | .. |
---|
731 | 994 | JCheckBox speedupCB; |
---|
732 | 995 | JCheckBox rewindCB; |
---|
733 | 996 | JCheckBox flipVCB; |
---|
| 997 | + |
---|
| 998 | + cCheckBox toggleTextureCB; |
---|
| 999 | + cCheckBox toggleSwitchCB; |
---|
| 1000 | + |
---|
734 | 1001 | JComboBox texresMenu; |
---|
| 1002 | + |
---|
735 | 1003 | JButton resetButton; |
---|
736 | 1004 | JButton stepButton; |
---|
737 | 1005 | JButton stepAllButton; |
---|
.. | .. |
---|
739 | 1007 | JButton slowerButton; |
---|
740 | 1008 | JButton fasterButton; |
---|
741 | 1009 | JButton remarkButton; |
---|
| 1010 | + |
---|
| 1011 | + cGridBag editPanel; |
---|
| 1012 | + cGridBag editCommandsPanel; |
---|
| 1013 | + |
---|
| 1014 | + cGridBag namePanel; |
---|
| 1015 | + cGridBag setupPanel; |
---|
| 1016 | + cGridBag setupPanel2; |
---|
| 1017 | + cGridBag objectCommandsPanel; |
---|
| 1018 | + cGridBag pushPanel; |
---|
| 1019 | + cGridBag fillPanel; |
---|
742 | 1020 | |
---|
743 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 1021 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
744 | 1022 | { |
---|
745 | 1023 | JCheckBox cb; |
---|
746 | 1024 | |
---|
747 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
748 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
749 | | -// oe.aConstraints.weightx = 1; |
---|
750 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
751 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1025 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
752 | 1026 | cb.addItemListener(this); |
---|
753 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
754 | | - oe.aConstraints.gridwidth = 1; |
---|
755 | | - oe.aConstraints.gridx += 1; |
---|
756 | 1027 | |
---|
757 | 1028 | return cb; |
---|
758 | 1029 | } |
---|
759 | 1030 | |
---|
760 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 1031 | + cButton AddButton(cGridBag panel, String label) |
---|
761 | 1032 | { |
---|
762 | 1033 | cButton cb; |
---|
763 | 1034 | |
---|
764 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
765 | | - oe.aConstraints.gridwidth = 1; |
---|
766 | | -// oe.aConstraints.weightx = 1; |
---|
767 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
768 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 1035 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
769 | 1036 | cb.addActionListener(this); |
---|
770 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
771 | | - oe.aConstraints.gridwidth = 1; |
---|
772 | | - oe.aConstraints.gridx += 1; |
---|
773 | 1037 | |
---|
774 | 1038 | return cb; |
---|
775 | 1039 | } |
---|
776 | 1040 | |
---|
777 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 1041 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
778 | 1042 | { |
---|
779 | 1043 | JComboBox combo; |
---|
780 | 1044 | |
---|
781 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
782 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
| 1045 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
784 | 1046 | combo.addActionListener(this); |
---|
785 | 1047 | |
---|
786 | 1048 | return combo; |
---|
787 | 1049 | } |
---|
788 | 1050 | |
---|
789 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 1051 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
790 | 1052 | { |
---|
791 | | - NumberSlider combo; |
---|
| 1053 | + cGridBag control = new cGridBag(); |
---|
| 1054 | + |
---|
| 1055 | + cNumberSlider combo; |
---|
792 | 1056 | |
---|
793 | 1057 | JLabel jlabel = new JLabel(label); |
---|
794 | | - |
---|
795 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
796 | 1058 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
797 | | - aConstraints.gridwidth = 2; |
---|
798 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
799 | | - aConstraints.gridx += 1; |
---|
800 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
801 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
802 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
803 | | - aConstraints.gridx += 1; |
---|
804 | | - aConstraints.gridwidth = 1; |
---|
805 | | - |
---|
| 1059 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1060 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
806 | 1061 | combo.setFloat(current); |
---|
807 | | - |
---|
808 | | - combo.label = jlabel; |
---|
809 | | - |
---|
810 | | - combo.addChangeListener(this); |
---|
811 | | - |
---|
812 | | - return combo; |
---|
| 1062 | + |
---|
| 1063 | + panel.add(control); |
---|
| 1064 | + |
---|
| 1065 | + return control; |
---|
813 | 1066 | } |
---|
814 | 1067 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 1068 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
816 | 1069 | { |
---|
817 | | - NumberSlider combo; |
---|
| 1070 | + cGridBag control = new cGridBag(); |
---|
| 1071 | + |
---|
| 1072 | + cNumberSlider combo; |
---|
818 | 1073 | |
---|
819 | 1074 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 1075 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
823 | | - aConstraints.gridwidth = 2; |
---|
824 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
825 | | - aConstraints.gridx += 1; |
---|
826 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
827 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
828 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
829 | | - aConstraints.gridx += 1; |
---|
830 | | - aConstraints.gridwidth = 1; |
---|
831 | | - |
---|
| 1076 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1077 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 1078 | combo.setInteger(current); |
---|
833 | 1079 | |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 1080 | + panel.add(control); |
---|
| 1081 | + |
---|
| 1082 | + return control; |
---|
839 | 1083 | } |
---|
840 | 1084 | |
---|
841 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 1085 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
842 | 1086 | { |
---|
843 | 1087 | JTextArea text; |
---|
844 | 1088 | |
---|
845 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
846 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
847 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1089 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
848 | 1090 | text.addCaretListener(this); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.gridwidth = 1; |
---|
851 | 1091 | |
---|
852 | 1092 | return text; |
---|
853 | 1093 | } |
---|
.. | .. |
---|
877 | 1117 | objEditor.ctrlPanel.remove(j); |
---|
878 | 1118 | } |
---|
879 | 1119 | |
---|
| 1120 | + void Remove(cNumberSlider j) |
---|
| 1121 | + { |
---|
| 1122 | + j.removeChangeListener(this); |
---|
| 1123 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1124 | + objEditor.ctrlPanel.remove(j); |
---|
| 1125 | + } |
---|
| 1126 | + |
---|
880 | 1127 | /* |
---|
881 | 1128 | */ |
---|
882 | | - void Return() // ObjEditor oe) |
---|
| 1129 | + void Return0() // ObjEditor oe) |
---|
883 | 1130 | { |
---|
884 | 1131 | aConstraints.gridy += 1; |
---|
885 | 1132 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
934 | 1181 | |
---|
935 | 1182 | void SetupUI2(ObjEditor oe) |
---|
936 | 1183 | { |
---|
937 | | -// oe.aConstraints.weightx = 0; |
---|
938 | | -// oe.aConstraints.weighty = 0; |
---|
939 | | -// oe.aConstraints.gridx = 0; |
---|
940 | | -// oe.aConstraints.gridy = 0; |
---|
941 | | - SetupName(oe); |
---|
| 1184 | + //SetupName(oe); |
---|
942 | 1185 | |
---|
943 | | - if (!GroupEditor.allparams) |
---|
| 1186 | + namePanel = new cGridBag(); |
---|
| 1187 | + |
---|
| 1188 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1189 | + namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); |
---|
| 1190 | + oe.ctrlPanel.add(namePanel); |
---|
| 1191 | + |
---|
| 1192 | + oe.ctrlPanel.Return(); |
---|
| 1193 | + |
---|
| 1194 | + if (!allparams) |
---|
944 | 1195 | return; |
---|
945 | 1196 | |
---|
946 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
947 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
948 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1197 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1198 | + |
---|
| 1199 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1200 | + liveCB.setToolTipText("Animate object"); |
---|
| 1201 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1202 | + selectCB.setToolTipText("Make object selectable"); |
---|
949 | 1203 | // Return(); |
---|
950 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
951 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
952 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
953 | | - Return(); |
---|
954 | | - resetButton = AddButton(oe, "Reset"); |
---|
955 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1204 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1205 | + hideCB.setToolTipText("Hide object"); |
---|
| 1206 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1207 | + markCB.setToolTipText("As animation target transform"); |
---|
| 1208 | + |
---|
| 1209 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1210 | + |
---|
| 1211 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1212 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1213 | + |
---|
| 1214 | + randomCB = AddCheckBox(setupPanel2, "Random", copy.random); |
---|
| 1215 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
| 1216 | + |
---|
| 1217 | + link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master); |
---|
| 1218 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1219 | + |
---|
| 1220 | + if (Globals.ADVANCED) |
---|
| 1221 | + { |
---|
| 1222 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1223 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1224 | + } |
---|
| 1225 | + |
---|
| 1226 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1227 | + oe.ctrlPanel.Return(); |
---|
| 1228 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1229 | + oe.ctrlPanel.Return(); |
---|
| 1230 | + |
---|
| 1231 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1232 | + |
---|
| 1233 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1234 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1235 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1236 | + stepButton.setToolTipText("Step one frame"); |
---|
956 | 1237 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
957 | 1238 | // stepAllButton = AddButton(oe, "Step All"); |
---|
958 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
959 | 1239 | // Return(); |
---|
960 | | - slowerButton = AddButton(oe, "Slow"); |
---|
961 | | - fasterButton = AddButton(oe, "Fast"); |
---|
962 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1240 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1241 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1242 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1243 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1244 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1245 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
963 | 1246 | |
---|
964 | | - Return(); |
---|
| 1247 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1248 | + oe.ctrlPanel.Return(); |
---|
965 | 1249 | |
---|
| 1250 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1251 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1252 | + //Return(); |
---|
| 1253 | + |
---|
| 1254 | + oe.ctrlPanel.Return(); |
---|
| 1255 | + |
---|
966 | 1256 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
967 | 1257 | // ObjEditor.aConstraints.gridx += 1; |
---|
968 | 1258 | |
---|
.. | .. |
---|
1056 | 1346 | oe.aConstraints.gridwidth = 1; |
---|
1057 | 1347 | /**/ |
---|
1058 | 1348 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1059 | | - Return(); |
---|
| 1349 | + oe.ctrlPanel.Return(); |
---|
1060 | 1350 | |
---|
1061 | 1351 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1062 | 1352 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1158 | 1448 | //JPanel worldPanel = |
---|
1159 | 1449 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1160 | 1450 | //worldPanel.setName("World"); |
---|
1161 | | - /*JPanel*/ cameraPanel = |
---|
1162 | | - new JPanel(new BorderLayout()); |
---|
1163 | | - cameraPanel.add(cameraView); |
---|
1164 | | - //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame); |
---|
| 1451 | + centralPanel = new cGridBag(); |
---|
| 1452 | + centralPanel.preferredWidth = 20; |
---|
| 1453 | + |
---|
| 1454 | + if (Globals.ADVANCED) |
---|
| 1455 | + { |
---|
| 1456 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1457 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1165 | 1458 | |
---|
| 1459 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1460 | + cameraPanel.setContinuousLayout(true); |
---|
| 1461 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1462 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1463 | +// cameraPanel.setDividerSize(9); |
---|
| 1464 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1465 | + |
---|
| 1466 | + } |
---|
| 1467 | + |
---|
| 1468 | + centralPanel.add(cameraView); |
---|
| 1469 | + centralPanel.setFocusable(true); |
---|
| 1470 | + //frame.setJMenuBar(timelineMenubar); |
---|
| 1471 | + //centralPanel.add(timelinePanel); |
---|
| 1472 | + |
---|
1166 | 1473 | //topView.camera = ; |
---|
1167 | 1474 | //frontView.camera = new Camera(2); |
---|
1168 | 1475 | //sideView.camera = new Camera(3); |
---|
.. | .. |
---|
1178 | 1485 | //frontView.object = copy; |
---|
1179 | 1486 | //sideView.object = copy; |
---|
1180 | 1487 | |
---|
1181 | | - XYZPanel = new JPanel(); |
---|
1182 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1488 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1489 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1183 | 1490 | |
---|
1184 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1185 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1186 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1491 | + XYZPanel.preferredWidth = 5; |
---|
| 1492 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1493 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1494 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1187 | 1495 | |
---|
1188 | 1496 | /* |
---|
1189 | 1497 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1192 | 1500 | gridPanel.add(cameraView); |
---|
1193 | 1501 | gridPanel.add(XYZPanel); |
---|
1194 | 1502 | */ |
---|
1195 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout()); |
---|
| 1503 | + gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1196 | 1504 | gridPanel.setContinuousLayout(true); |
---|
1197 | 1505 | gridPanel.setOneTouchExpandable(true); |
---|
1198 | 1506 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1221 | 1529 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1222 | 1530 | //tmp.setName("Edit"); |
---|
1223 | 1531 | objectPanel.add(materialPanel); |
---|
1224 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1225 | | - north.setName("Edit"); |
---|
1226 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1227 | | - objectPanel.add(north); |
---|
1228 | | - objectPanel.add(infoPanel); |
---|
| 1532 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1533 | +// north.setName("Edit"); |
---|
| 1534 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1535 | +// objectPanel.add(north); |
---|
| 1536 | + objectPanel.add(editPanel); |
---|
| 1537 | + |
---|
| 1538 | + //if (Globals.ADVANCED) |
---|
| 1539 | + objectPanel.add(infoPanel); |
---|
| 1540 | + |
---|
| 1541 | + objectPanel.add(toolboxPanel); |
---|
1229 | 1542 | |
---|
1230 | 1543 | /* |
---|
1231 | 1544 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1234 | 1547 | aConstraints.gridy += 1; |
---|
1235 | 1548 | aConstraints.gridwidth = 1; |
---|
1236 | 1549 | mainPanel.add(objectPanel, aConstraints); |
---|
1237 | | - */ |
---|
| 1550 | + */ |
---|
1238 | 1551 | |
---|
1239 | 1552 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1240 | 1553 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1245 | 1558 | scrollpane.setWheelScrollingEnabled(true); |
---|
1246 | 1559 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1247 | 1560 | |
---|
1248 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1249 | | - scenePanel.add(scrollpane); |
---|
| 1561 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1562 | + scenePanel.preferredWidth = 6; |
---|
| 1563 | + |
---|
| 1564 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1565 | + tabbedPane.add(scrollpane); |
---|
1250 | 1566 | |
---|
1251 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1252 | | - |
---|
1253 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1567 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1254 | 1568 | |
---|
1255 | 1569 | optionsPanel.setName("Options"); |
---|
1256 | | - scenePanel.add(optionsPanel); |
---|
| 1570 | + |
---|
| 1571 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1572 | + |
---|
| 1573 | + tabbedPane.add(optionsPanel); |
---|
| 1574 | + |
---|
| 1575 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1257 | 1576 | |
---|
| 1577 | + scenePanel.add(tabbedPane); |
---|
1258 | 1578 | |
---|
1259 | 1579 | /* |
---|
1260 | 1580 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1288 | 1608 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1289 | 1609 | //bigPanel.add(ctrlPanel); |
---|
1290 | 1610 | //bigPanel.add(gridPanel); |
---|
| 1611 | + /** |
---|
1291 | 1612 | bigThree = new JPanel(); |
---|
1292 | 1613 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1293 | 1614 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1304 | 1625 | // aConstraints.gridheight = 3; |
---|
1305 | 1626 | aWindowConstraints.gridx = 1; |
---|
1306 | 1627 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
1307 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 1628 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
1308 | 1629 | aWindowConstraints.weightx = 0; |
---|
1309 | 1630 | aWindowConstraints.gridx = 4; |
---|
1310 | 1631 | aWindowConstraints.gridwidth = 1; |
---|
1311 | 1632 | // aConstraints.gridheight = 3; |
---|
1312 | 1633 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1313 | 1634 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1635 | + /**/ |
---|
1314 | 1636 | |
---|
| 1637 | + bigThree = new cGridBag(); |
---|
| 1638 | + bigThree.addComponent(scenePanel); |
---|
| 1639 | + bigThree.addComponent(centralPanel); |
---|
| 1640 | + bigThree.addComponent(XYZPanel); |
---|
| 1641 | + |
---|
1315 | 1642 | // // SIDE EFFECT!!! |
---|
1316 | 1643 | // aConstraints.gridx = 0; |
---|
1317 | 1644 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1319 | 1646 | // aConstraints.gridheight = 1; |
---|
1320 | 1647 | |
---|
1321 | 1648 | framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree); |
---|
1322 | | - framePanel.setContinuousLayout(true); |
---|
1323 | | - framePanel.setOneTouchExpandable(true); |
---|
1324 | | - framePanel.setDividerLocation(0.8); |
---|
| 1649 | + framePanel.setContinuousLayout(false); |
---|
| 1650 | + framePanel.setOneTouchExpandable(false); |
---|
| 1651 | + //.setDividerLocation(0.8); |
---|
1325 | 1652 | //framePanel.setDividerSize(15); |
---|
1326 | 1653 | //framePanel.setResizeWeight(0.15); |
---|
1327 | 1654 | framePanel.setName("Frame"); |
---|
.. | .. |
---|
1332 | 1659 | //worldPane.add(bigPanel); |
---|
1333 | 1660 | //worldPane.add(worldPanel); |
---|
1334 | 1661 | /**/ |
---|
1335 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1662 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1663 | + frame.add(/*"Center",*/framePanel); |
---|
1336 | 1664 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1337 | 1665 | |
---|
1338 | 1666 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1339 | 1667 | |
---|
1340 | | - frame.setSize(1024, 768); |
---|
1341 | | - frame.show(); |
---|
1342 | | - |
---|
| 1668 | + frame.setSize(1280, 860); |
---|
| 1669 | + |
---|
| 1670 | + cameraView.requestFocusInWindow(); |
---|
| 1671 | + |
---|
1343 | 1672 | gridPanel.setDividerLocation(1.0); |
---|
| 1673 | + |
---|
| 1674 | + frame.validate(); |
---|
| 1675 | + |
---|
| 1676 | + frame.setVisible(true); |
---|
1344 | 1677 | |
---|
1345 | 1678 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
1346 | 1679 | frame.addWindowListener(new WindowAdapter() |
---|
.. | .. |
---|
1353 | 1686 | }); |
---|
1354 | 1687 | } |
---|
1355 | 1688 | |
---|
| 1689 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1690 | + { |
---|
| 1691 | + } |
---|
| 1692 | + |
---|
1356 | 1693 | JTree GetTree() |
---|
1357 | 1694 | { |
---|
1358 | 1695 | return objEditor.jTree; |
---|
.. | .. |
---|
1364 | 1701 | ctrlPanel.removeAll(); |
---|
1365 | 1702 | } |
---|
1366 | 1703 | |
---|
1367 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1704 | + void SetupMaterial(cGridBag panel) |
---|
1368 | 1705 | { |
---|
1369 | | - aConstraints.weighty = 0; |
---|
1370 | | - //aConstraints.weightx = 1; |
---|
1371 | | - /* |
---|
| 1706 | + /* |
---|
1372 | 1707 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1373 | 1708 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1374 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1375 | | - aConstraints.gridx += 1; |
---|
1376 | 1709 | */ |
---|
1377 | 1710 | |
---|
1378 | | - aConstraints.gridwidth = 1; |
---|
1379 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1380 | | - aConstraints.gridx += 1; |
---|
1381 | | - aConstraints.weighty = 0; |
---|
1382 | | - aConstraints.gridwidth = 1; |
---|
| 1711 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1712 | + |
---|
| 1713 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1714 | + createMaterialButton.setToolTipText("Create material"); |
---|
1383 | 1715 | |
---|
1384 | 1716 | /* |
---|
1385 | 1717 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1386 | | - aConstraints.gridx += 1; |
---|
1387 | | - aConstraints.weighty = 0; |
---|
1388 | | - aConstraints.gridwidth = 1; |
---|
1389 | 1718 | */ |
---|
1390 | 1719 | |
---|
1391 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1392 | | - aConstraints.gridx += 1; |
---|
| 1720 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1721 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1722 | + |
---|
| 1723 | + if (Globals.ADVANCED) |
---|
| 1724 | + { |
---|
| 1725 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1726 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1727 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1728 | + } |
---|
1393 | 1729 | |
---|
1394 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1395 | | - |
---|
1396 | | - aConstraints.gridx += 1; |
---|
1397 | | - |
---|
1398 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1399 | | - |
---|
1400 | | - aConstraints.gridx += 1; |
---|
1401 | | - |
---|
1402 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1403 | | - |
---|
1404 | | - aConstraints.gridx = 0; |
---|
1405 | | - aConstraints.gridy += 1; |
---|
1406 | | - aConstraints.weighty = 0; |
---|
1407 | | - aConstraints.gridwidth = 1; |
---|
| 1730 | + editBar.preferredHeight = 15; |
---|
| 1731 | + |
---|
| 1732 | + panel.add(editBar); |
---|
| 1733 | + |
---|
1408 | 1734 | /**/ |
---|
1409 | 1735 | //aConstraints.weighty = 0; |
---|
1410 | 1736 | ////aConstraints.weightx = 1; |
---|
1411 | 1737 | //aConstraints.weighty = 1; |
---|
1412 | 1738 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1413 | 1739 | //aConstraints.gridx += 1; |
---|
1414 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1415 | | - aConstraints.weighty = 0; |
---|
1416 | | - aConstraints.gridx = 0; |
---|
1417 | | - aConstraints.gridy += 1; |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
| 1740 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1419 | 1741 | |
---|
1420 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1421 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1422 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1423 | | - aConstraints.gridx += 1; |
---|
1424 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1425 | | - //aConstraints.weightx = 0; |
---|
1426 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1427 | | - aConstraints.gridx = 0; |
---|
1428 | | - aConstraints.gridy += 1; |
---|
1429 | | - aConstraints.gridwidth = 1; |
---|
| 1742 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1743 | + |
---|
| 1744 | + cGridBag color = new cGridBag(); |
---|
| 1745 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1746 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1747 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1748 | + //colorField.preferredWidth = 200; |
---|
| 1749 | + colorSection.add(color); |
---|
1430 | 1750 | |
---|
1431 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1432 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1433 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1434 | | - aConstraints.gridx += 1; |
---|
1435 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1436 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1437 | | - aConstraints.gridx = 0; |
---|
1438 | | - aConstraints.gridy += 1; |
---|
1439 | | - aConstraints.gridwidth = 1; |
---|
| 1751 | + cGridBag modulation = new cGridBag(); |
---|
| 1752 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1753 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1754 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1755 | + colorSection.add(modulation); |
---|
1440 | 1756 | |
---|
1441 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1442 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1443 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1444 | | - aConstraints.gridx += 1; |
---|
1445 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1446 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1447 | | - aConstraints.gridx = 0; |
---|
1448 | | - aConstraints.gridy += 1; |
---|
1449 | | - aConstraints.gridwidth = 1; |
---|
| 1757 | + cGridBag texture = new cGridBag(); |
---|
| 1758 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1759 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1760 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1761 | + colorSection.add(texture); |
---|
1450 | 1762 | |
---|
1451 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1452 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1453 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1454 | | - aConstraints.gridx += 1; |
---|
1455 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1456 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1457 | | - aConstraints.gridx = 0; |
---|
1458 | | - aConstraints.gridy += 1; |
---|
1459 | | - aConstraints.gridwidth = 1; |
---|
| 1763 | + panel.add(new JSeparator()); |
---|
| 1764 | + |
---|
| 1765 | + panel.add(colorSection); |
---|
| 1766 | + |
---|
| 1767 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1768 | + |
---|
| 1769 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1770 | + |
---|
| 1771 | + cGridBag diffuse = new cGridBag(); |
---|
| 1772 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1773 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1774 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1775 | + diffuseSection.add(diffuse); |
---|
1460 | 1776 | |
---|
1461 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1462 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1463 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1464 | | - aConstraints.gridx += 1; |
---|
1465 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1466 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1467 | | - aConstraints.gridx = 0; |
---|
1468 | | - aConstraints.gridy += 1; |
---|
1469 | | - aConstraints.gridwidth = 1; |
---|
| 1777 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1778 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1779 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1780 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1781 | + diffuseSection.add(diffuseness); |
---|
1470 | 1782 | |
---|
1471 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1472 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1473 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1474 | | - aConstraints.gridx += 1; |
---|
1475 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1476 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1477 | | - aConstraints.gridx = 0; |
---|
1478 | | - aConstraints.gridy += 1; |
---|
1479 | | - aConstraints.gridwidth = 1; |
---|
| 1783 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1784 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1785 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1786 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1787 | + diffuseSection.add(selfshadow); |
---|
1480 | 1788 | |
---|
1481 | | - //aConstraints.weighty = 1; |
---|
1482 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1483 | | - //aConstraints.gridx += 1; |
---|
1484 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1485 | | - aConstraints.weighty = 0; |
---|
1486 | | - aConstraints.gridx = 0; |
---|
1487 | | - aConstraints.gridy += 1; |
---|
1488 | | - aConstraints.gridwidth = 1; |
---|
| 1789 | + cGridBag sheen = new cGridBag(); |
---|
| 1790 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1791 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1792 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1793 | + diffuseSection.add(sheen); |
---|
1489 | 1794 | |
---|
1490 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1491 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1492 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1493 | | - aConstraints.gridx += 1; |
---|
1494 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1495 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1496 | | - aConstraints.gridx = 0; |
---|
1497 | | - aConstraints.gridy += 1; |
---|
1498 | | - aConstraints.gridwidth = 1; |
---|
| 1795 | + cGridBag subsurface = new cGridBag(); |
---|
| 1796 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1797 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1798 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1799 | + diffuseSection.add(subsurface); |
---|
1499 | 1800 | |
---|
1500 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1501 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1502 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1503 | | - aConstraints.gridx += 1; |
---|
1504 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1505 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1506 | | - aConstraints.gridx = 0; |
---|
1507 | | - aConstraints.gridy += 1; |
---|
1508 | | - aConstraints.gridwidth = 1; |
---|
| 1801 | + cGridBag shadow = new cGridBag(); |
---|
| 1802 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1803 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1804 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1805 | + diffuseSection.add(shadow); |
---|
1509 | 1806 | |
---|
1510 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1511 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1512 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1513 | | - aConstraints.gridx += 1; |
---|
1514 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1515 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1516 | | - aConstraints.gridx = 0; |
---|
1517 | | - aConstraints.gridy += 1; |
---|
1518 | | - aConstraints.gridwidth = 1; |
---|
| 1807 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1808 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1809 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1810 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1811 | + diffuseSection.add(fakedepth); |
---|
1519 | 1812 | |
---|
1520 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1521 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1522 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1523 | | - aConstraints.gridx += 1; |
---|
1524 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1525 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1526 | | - aConstraints.gridx = 0; |
---|
1527 | | - aConstraints.gridy += 1; |
---|
1528 | | - aConstraints.gridwidth = 1; |
---|
| 1813 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1814 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1815 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1816 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1817 | + diffuseSection.add(shadowbias); |
---|
1529 | 1818 | |
---|
1530 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1531 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1532 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1533 | | - aConstraints.gridx += 1; |
---|
1534 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1535 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1536 | | - aConstraints.gridx = 0; |
---|
1537 | | - aConstraints.gridy += 1; |
---|
1538 | | - aConstraints.gridwidth = 1; |
---|
| 1819 | + panel.add(new JSeparator()); |
---|
| 1820 | + |
---|
| 1821 | + panel.add(diffuseSection); |
---|
| 1822 | + |
---|
| 1823 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1824 | + |
---|
| 1825 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1539 | 1826 | |
---|
1540 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1541 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1542 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1543 | | - aConstraints.gridx += 1; |
---|
1544 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1545 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1546 | | - aConstraints.gridx = 0; |
---|
1547 | | - aConstraints.gridy += 1; |
---|
1548 | | - aConstraints.gridwidth = 1; |
---|
| 1827 | + cGridBag specular = new cGridBag(); |
---|
| 1828 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1829 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1830 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1831 | + specularSection.add(specular); |
---|
1549 | 1832 | |
---|
1550 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1551 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1552 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1553 | | - aConstraints.gridx += 1; |
---|
1554 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1555 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1556 | | - aConstraints.gridx = 0; |
---|
1557 | | - aConstraints.gridy += 1; |
---|
1558 | | - aConstraints.gridwidth = 1; |
---|
| 1833 | + cGridBag lightarea = new cGridBag(); |
---|
| 1834 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1835 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1836 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1837 | + specularSection.add(lightarea); |
---|
1559 | 1838 | |
---|
1560 | | - //aConstraints.weighty = 1; |
---|
1561 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1562 | | - //aConstraints.gridx += 1; |
---|
1563 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1564 | | - aConstraints.weighty = 0; |
---|
1565 | | - aConstraints.gridx = 0; |
---|
1566 | | - aConstraints.gridy += 1; |
---|
1567 | | - aConstraints.gridwidth = 1; |
---|
| 1839 | + cGridBag shininess = new cGridBag(); |
---|
| 1840 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1841 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1842 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1843 | + specularSection.add(shininess); |
---|
1568 | 1844 | |
---|
1569 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1570 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1571 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1572 | | - aConstraints.gridx += 1; |
---|
1573 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1574 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1575 | | - aConstraints.gridx = 0; |
---|
1576 | | - aConstraints.gridy += 1; |
---|
1577 | | - aConstraints.gridwidth = 1; |
---|
| 1845 | + cGridBag metalness = new cGridBag(); |
---|
| 1846 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1847 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1848 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1849 | + specularSection.add(metalness); |
---|
1578 | 1850 | |
---|
1579 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1580 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1581 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1582 | | - aConstraints.gridx += 1; |
---|
1583 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1584 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1585 | | - aConstraints.gridx = 0; |
---|
1586 | | - aConstraints.gridy += 1; |
---|
1587 | | - aConstraints.gridwidth = 1; |
---|
| 1851 | + cGridBag velvet = new cGridBag(); |
---|
| 1852 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1853 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1854 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1855 | + specularSection.add(velvet); |
---|
1588 | 1856 | |
---|
1589 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1590 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1591 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1592 | | - aConstraints.gridx += 1; |
---|
1593 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1594 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1595 | | - aConstraints.gridx = 0; |
---|
1596 | | - aConstraints.gridy += 1; |
---|
1597 | | - aConstraints.gridwidth = 1; |
---|
1598 | | - |
---|
1599 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1600 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1601 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1602 | | - aConstraints.gridx += 1; |
---|
1603 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1604 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1605 | | - aConstraints.gridx = 0; |
---|
1606 | | - aConstraints.gridy += 1; |
---|
1607 | | - aConstraints.gridwidth = 1; |
---|
1608 | | - |
---|
1609 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1610 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1611 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1612 | | - aConstraints.gridx += 1; |
---|
1613 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1614 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1615 | | - aConstraints.gridx = 0; |
---|
1616 | | - aConstraints.gridy += 1; |
---|
1617 | | - aConstraints.gridwidth = 1; |
---|
1618 | | - |
---|
1619 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1620 | | - Return(); |
---|
| 1857 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1858 | + //Return(); |
---|
1621 | 1859 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1622 | 1860 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1623 | 1861 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1628 | 1866 | // aConstraints.gridy += 1; |
---|
1629 | 1867 | // aConstraints.gridwidth = 1; |
---|
1630 | 1868 | |
---|
1631 | | - //aConstraints.weighty = 1; |
---|
1632 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1633 | | - //aConstraints.gridx += 1; |
---|
1634 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1635 | | - aConstraints.weighty = 0; |
---|
1636 | | - aConstraints.gridx = 0; |
---|
1637 | | - aConstraints.gridy += 1; |
---|
1638 | | - aConstraints.gridwidth = 1; |
---|
| 1869 | + cGridBag anisoU = new cGridBag(); |
---|
| 1870 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1871 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1872 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1873 | + specularSection.add(anisoU); |
---|
1639 | 1874 | |
---|
1640 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1641 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1642 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1643 | | - aConstraints.gridx += 1; |
---|
1644 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1645 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1646 | | - aConstraints.gridx = 0; |
---|
1647 | | - aConstraints.gridy += 1; |
---|
1648 | | - aConstraints.gridwidth = 1; |
---|
| 1875 | + cGridBag anisoV = new cGridBag(); |
---|
| 1876 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1877 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1878 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1879 | + specularSection.add(anisoV); |
---|
1649 | 1880 | |
---|
1650 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1651 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1652 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1653 | | - aConstraints.gridx += 1; |
---|
1654 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1655 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1656 | | - aConstraints.gridx = 0; |
---|
1657 | | - aConstraints.gridy += 1; |
---|
1658 | | - aConstraints.gridwidth = 1; |
---|
1659 | 1881 | |
---|
1660 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1661 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1662 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1663 | | - aConstraints.gridx += 1; |
---|
1664 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1665 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1666 | | - aConstraints.gridx = 0; |
---|
1667 | | - aConstraints.gridy += 1; |
---|
1668 | | - aConstraints.gridwidth = 1; |
---|
| 1882 | + panel.add(new JSeparator()); |
---|
| 1883 | + |
---|
| 1884 | + panel.add(specularSection); |
---|
| 1885 | + |
---|
| 1886 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1887 | + |
---|
| 1888 | + //cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1669 | 1889 | |
---|
1670 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1671 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1672 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1673 | | - aConstraints.gridx += 1; |
---|
1674 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1675 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1676 | | - aConstraints.gridx = 0; |
---|
1677 | | - aConstraints.gridy += 1; |
---|
1678 | | - aConstraints.gridwidth = 1; |
---|
1679 | | - aConstraints.weighty = 0; |
---|
| 1890 | + cGridBag camera = new cGridBag(); |
---|
| 1891 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1892 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1893 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1894 | + colorSection.add(camera); |
---|
1680 | 1895 | |
---|
1681 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1682 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1683 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1684 | | - aConstraints.gridx += 1; |
---|
1685 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1686 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1687 | | - aConstraints.gridx = 0; |
---|
1688 | | - aConstraints.gridy += 1; |
---|
1689 | | - aConstraints.gridwidth = 1; |
---|
| 1896 | + cGridBag ambient = new cGridBag(); |
---|
| 1897 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1898 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1899 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1900 | + colorSection.add(ambient); |
---|
1690 | 1901 | |
---|
1691 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1692 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1693 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1694 | | - aConstraints.gridx += 1; |
---|
1695 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1696 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1697 | | - aConstraints.gridx = 0; |
---|
1698 | | - aConstraints.gridy += 1; |
---|
1699 | | - aConstraints.gridwidth = 1; |
---|
| 1902 | + cGridBag backlit = new cGridBag(); |
---|
| 1903 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1904 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1905 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1906 | + colorSection.add(backlit); |
---|
1700 | 1907 | |
---|
1701 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1702 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1703 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1704 | | - aConstraints.gridx += 1; |
---|
1705 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1706 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1707 | | - aConstraints.gridx = 0; |
---|
1708 | | - aConstraints.gridy += 1; |
---|
1709 | | - aConstraints.gridwidth = 1; |
---|
| 1908 | + cGridBag opacity = new cGridBag(); |
---|
| 1909 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1910 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1911 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1912 | + colorSection.add(opacity); |
---|
1710 | 1913 | |
---|
1711 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1712 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1713 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1714 | | - aConstraints.gridx += 1; |
---|
1715 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1716 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1717 | | - aConstraints.gridx = 0; |
---|
1718 | | - aConstraints.gridy += 1; |
---|
1719 | | - aConstraints.gridwidth = 1; |
---|
| 1914 | + //panel.add(new JSeparator()); |
---|
| 1915 | + |
---|
| 1916 | + //panel.add(globalSection); |
---|
| 1917 | + |
---|
| 1918 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1919 | + |
---|
| 1920 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1720 | 1921 | |
---|
1721 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1722 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1723 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1724 | | - aConstraints.gridx += 1; |
---|
1725 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1726 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1727 | | - aConstraints.gridx = 0; |
---|
1728 | | - aConstraints.gridy += 1; |
---|
1729 | | - aConstraints.gridwidth = 1; |
---|
| 1922 | + cGridBag bump = new cGridBag(); |
---|
| 1923 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1924 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1925 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1926 | + textureSection.add(bump); |
---|
1730 | 1927 | |
---|
1731 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1732 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1733 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1734 | | - aConstraints.gridx += 1; |
---|
1735 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1736 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1737 | | - aConstraints.gridx = 0; |
---|
1738 | | - aConstraints.gridy += 1; |
---|
1739 | | - aConstraints.gridwidth = 1; |
---|
| 1928 | + cGridBag noise = new cGridBag(); |
---|
| 1929 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1930 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1931 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1932 | + textureSection.add(noise); |
---|
1740 | 1933 | |
---|
1741 | | - //aConstraints.weighty = 1; |
---|
1742 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1743 | | - //aConstraints.gridx += 1; |
---|
1744 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1745 | | - aConstraints.weighty = 0; |
---|
| 1934 | + cGridBag power = new cGridBag(); |
---|
| 1935 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1936 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1937 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1938 | + textureSection.add(power); |
---|
1746 | 1939 | |
---|
1747 | | - aConstraints.gridx = 0; |
---|
1748 | | - aConstraints.gridy = 0; |
---|
1749 | | - aConstraints.gridwidth = 1; |
---|
| 1940 | + cGridBag borderfade = new cGridBag(); |
---|
| 1941 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1942 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1943 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1944 | + textureSection.add(borderfade); |
---|
| 1945 | + |
---|
| 1946 | + cGridBag fog = new cGridBag(); |
---|
| 1947 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1948 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1949 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1950 | + textureSection.add(fog); |
---|
| 1951 | + |
---|
| 1952 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1953 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1954 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1955 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1956 | + textureSection.add(opacityPower); |
---|
| 1957 | + |
---|
| 1958 | + panel.add(new JSeparator()); |
---|
| 1959 | + |
---|
| 1960 | + panel.add(textureSection); |
---|
| 1961 | + |
---|
| 1962 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1750 | 1963 | |
---|
1751 | 1964 | SetMaterial(copy); // .GetMaterial()); |
---|
1752 | 1965 | |
---|
1753 | | - colorField.addChangeListener(this); |
---|
1754 | | - modulationField.addChangeListener(this); |
---|
| 1966 | + //colorField.addChangeListener(this); |
---|
| 1967 | +// modulationField.addChangeListener(this); |
---|
1755 | 1968 | metalnessField.addChangeListener(this); |
---|
1756 | 1969 | diffuseField.addChangeListener(this); |
---|
1757 | 1970 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1781 | 1994 | opacityPowerField.addChangeListener(this); |
---|
1782 | 1995 | /**/ |
---|
1783 | 1996 | |
---|
1784 | | - resetSlidersButton.addActionListener(this); |
---|
1785 | 1997 | clearMaterialButton.addActionListener(this); |
---|
1786 | 1998 | createMaterialButton.addActionListener(this); |
---|
1787 | | - |
---|
1788 | | - propagateToggle.addItemListener(this); |
---|
1789 | | - multiplyToggle.addItemListener(this); |
---|
| 1999 | + |
---|
| 2000 | + if (Globals.ADVANCED) |
---|
| 2001 | + { |
---|
| 2002 | + resetSlidersButton.addActionListener(this); |
---|
| 2003 | + propagateToggle.addItemListener(this); |
---|
| 2004 | + multiplyToggle.addItemListener(this); |
---|
| 2005 | + } |
---|
1790 | 2006 | } |
---|
1791 | 2007 | |
---|
1792 | 2008 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1804 | 2020 | // 3D models |
---|
1805 | 2021 | if (filename.endsWith(".3ds") || filename.endsWith(".3DS")) |
---|
1806 | 2022 | { |
---|
1807 | | - lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
1808 | | - LoadFile(filename, lastConverter); |
---|
| 2023 | + //lastConverter = new com.jmex.model.converters.MaxToJme(); |
---|
| 2024 | + //LoadFile(filename, lastConverter); |
---|
| 2025 | + LoadObjFile(filename); // New 3ds loader |
---|
1809 | 2026 | continue; |
---|
1810 | 2027 | } |
---|
1811 | 2028 | if (filename.endsWith(".dae") || filename.endsWith(".DAE")) |
---|
.. | .. |
---|
1957 | 2174 | |
---|
1958 | 2175 | //? flashIt = false; |
---|
1959 | 2176 | CameraPane pane = (CameraPane) cameraView; |
---|
1960 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2177 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1961 | 2178 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1962 | 2179 | |
---|
1963 | 2180 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2006 | 2223 | e2.printStackTrace(); |
---|
2007 | 2224 | } |
---|
2008 | 2225 | } |
---|
| 2226 | + |
---|
2009 | 2227 | LoadJMEThread loadThread; |
---|
2010 | 2228 | |
---|
2011 | 2229 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2063 | 2281 | //LoadFile0(filename, converter); |
---|
2064 | 2282 | } |
---|
2065 | 2283 | } |
---|
| 2284 | + |
---|
2066 | 2285 | LoadOBJThread loadObjThread; |
---|
2067 | 2286 | |
---|
2068 | 2287 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2141 | 2360 | |
---|
2142 | 2361 | void LoadObjFile(String fullname) |
---|
2143 | 2362 | { |
---|
2144 | | - /* |
---|
| 2363 | + System.out.println("Loading " + fullname); |
---|
| 2364 | + /**/ |
---|
2145 | 2365 | //lastFilename = fullname; |
---|
2146 | 2366 | if(loadObjThread == null) |
---|
2147 | 2367 | { |
---|
2148 | | - loadObjThread = new LoadOBJThread(); |
---|
2149 | | - loadObjThread.start(); |
---|
| 2368 | + loadObjThread = new LoadOBJThread(); |
---|
| 2369 | + loadObjThread.start(); |
---|
2150 | 2370 | } |
---|
2151 | 2371 | |
---|
2152 | 2372 | loadObjThread.add(fullname); |
---|
2153 | | - */ |
---|
| 2373 | + /**/ |
---|
2154 | 2374 | |
---|
2155 | | - System.out.println("Loading " + fullname); |
---|
2156 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2375 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2157 | 2376 | } |
---|
2158 | 2377 | |
---|
2159 | 2378 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2414 | 2633 | |
---|
2415 | 2634 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2416 | 2635 | { |
---|
2417 | | - if (GrafreeD.standAlone) |
---|
| 2636 | + if (Grafreed.standAlone) |
---|
2418 | 2637 | { |
---|
2419 | 2638 | /**/ |
---|
2420 | 2639 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2421 | | - browser.show(); |
---|
| 2640 | + browser.setVisible(true); |
---|
2422 | 2641 | String filename = browser.getFile(); |
---|
2423 | 2642 | if (filename != null && filename.length() > 0) |
---|
2424 | 2643 | { |
---|
.. | .. |
---|
2529 | 2748 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2); |
---|
2530 | 2749 | LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2); |
---|
2531 | 2750 | } |
---|
| 2751 | + |
---|
2532 | 2752 | //cJME.count++; |
---|
2533 | 2753 | //cJME.count %= 12; |
---|
2534 | 2754 | if (gc) |
---|
.. | .. |
---|
2563 | 2783 | } |
---|
2564 | 2784 | if (input == null) |
---|
2565 | 2785 | { |
---|
| 2786 | + new Exception().printStackTrace(); |
---|
2566 | 2787 | System.exit(0); |
---|
2567 | 2788 | } |
---|
2568 | 2789 | |
---|
.. | .. |
---|
2711 | 2932 | } |
---|
2712 | 2933 | } |
---|
2713 | 2934 | } |
---|
| 2935 | + |
---|
2714 | 2936 | cFileSystemPane FSPane; |
---|
2715 | 2937 | |
---|
2716 | 2938 | void SetMaterial(cMaterial mat, Object3D.cVector2[] others) |
---|
.. | .. |
---|
2764 | 2986 | } |
---|
2765 | 2987 | } |
---|
2766 | 2988 | } |
---|
| 2989 | + |
---|
2767 | 2990 | freezematerial = false; |
---|
2768 | 2991 | } |
---|
2769 | 2992 | |
---|
2770 | 2993 | void SetMaterial(Object3D object) |
---|
2771 | 2994 | { |
---|
| 2995 | + latestObject = object; |
---|
| 2996 | + |
---|
2772 | 2997 | cMaterial mat = object.material; |
---|
2773 | 2998 | |
---|
2774 | 2999 | if (mat == null) |
---|
.. | .. |
---|
2777 | 3002 | return; |
---|
2778 | 3003 | } |
---|
2779 | 3004 | |
---|
2780 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 3005 | + if (multiplyToggle != null) |
---|
| 3006 | + multiplyToggle.setSelected(mat.multiply); |
---|
2781 | 3007 | |
---|
2782 | 3008 | assert (object.projectedVertices != null); |
---|
2783 | 3009 | |
---|
.. | .. |
---|
2879 | 3105 | // } |
---|
2880 | 3106 | |
---|
2881 | 3107 | /**/ |
---|
2882 | | - if (deselect) |
---|
| 3108 | + if (deselect || child == null) |
---|
2883 | 3109 | { |
---|
2884 | 3110 | //group.deselectAll(); |
---|
2885 | 3111 | //freeze = true; |
---|
2886 | 3112 | GetTree().clearSelection(); |
---|
2887 | 3113 | //freeze = false; |
---|
| 3114 | + |
---|
| 3115 | + if (child == null) |
---|
| 3116 | + { |
---|
| 3117 | + return; |
---|
| 3118 | + } |
---|
2888 | 3119 | } |
---|
2889 | 3120 | |
---|
2890 | 3121 | //group.addSelectee(child); |
---|
.. | .. |
---|
2953 | 3184 | cameraView.ToggleDL(); |
---|
2954 | 3185 | cameraView.repaint(); |
---|
2955 | 3186 | return; |
---|
2956 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3187 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2957 | 3188 | { |
---|
2958 | 3189 | cameraView.ToggleTexture(); |
---|
2959 | 3190 | // june 2013 copy.HardTouch(); |
---|
2960 | 3191 | cameraView.repaint(); |
---|
2961 | 3192 | return; |
---|
2962 | | - } else if (event.getSource() == toggleFullItem) |
---|
| 3193 | + } else if (event.getSource() == toggleTimelineItem) |
---|
2963 | 3194 | { |
---|
2964 | | - if (CameraPane.FULLSCREEN) |
---|
| 3195 | + timeline ^= true; |
---|
| 3196 | + |
---|
| 3197 | + if (timeline) |
---|
2965 | 3198 | { |
---|
2966 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
2967 | | - framePanel.add(bigThree); |
---|
2968 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
2969 | | - } else |
---|
2970 | | - { |
---|
2971 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
2972 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 3199 | + centralPanel.remove(cameraView); |
---|
| 3200 | + cameraPanel.add(cameraView); |
---|
| 3201 | + centralPanel.add(cameraPanel); |
---|
| 3202 | + frame.setJMenuBar(timelineMenubar); |
---|
| 3203 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3204 | + if (!CameraPane.FULLSCREEN) |
---|
| 3205 | + ToggleFullScreen(); |
---|
| 3206 | + toggleFullScreenItem.setEnabled(false); |
---|
2973 | 3207 | } |
---|
| 3208 | + else |
---|
| 3209 | + { |
---|
| 3210 | + centralPanel.remove(cameraPanel); |
---|
| 3211 | + centralPanel.add(cameraView); |
---|
| 3212 | + frame.setJMenuBar(null); |
---|
| 3213 | + if (!wasFullScreen) |
---|
| 3214 | + ToggleFullScreen(); |
---|
| 3215 | + toggleFullScreenItem.setEnabled(true); |
---|
| 3216 | + } |
---|
| 3217 | + |
---|
2974 | 3218 | frame.validate(); |
---|
2975 | | - cameraView.ToggleFullScreen(); |
---|
| 3219 | + return; |
---|
| 3220 | + } else if (event.getSource() == toggleFullScreenItem) |
---|
| 3221 | + { |
---|
| 3222 | + ToggleFullScreen(); |
---|
| 3223 | + frame.validate(); |
---|
2976 | 3224 | |
---|
2977 | 3225 | return; |
---|
2978 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3226 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2979 | 3227 | { |
---|
2980 | | - cameraView.ToggleRandom(); |
---|
| 3228 | + cameraView.ToggleSwitch(); |
---|
2981 | 3229 | cameraView.repaint(); |
---|
2982 | 3230 | return; |
---|
2983 | 3231 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3006 | 3254 | { |
---|
3007 | 3255 | copy.live ^= true; |
---|
3008 | 3256 | return; |
---|
| 3257 | + } else if (event.getSource() == selectCB) |
---|
| 3258 | + { |
---|
| 3259 | + copy.dontselect ^= true; |
---|
| 3260 | + return; |
---|
3009 | 3261 | } else if (event.getSource() == hideCB) |
---|
3010 | 3262 | { |
---|
3011 | 3263 | copy.hide ^= true; |
---|
.. | .. |
---|
3020 | 3272 | if (event.getSource() == randomCB) |
---|
3021 | 3273 | { |
---|
3022 | 3274 | copy.random ^= true; |
---|
| 3275 | + objEditor.refreshContents(); |
---|
3023 | 3276 | return; |
---|
3024 | 3277 | } |
---|
3025 | 3278 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3043 | 3296 | |
---|
3044 | 3297 | public void actionPerformed(ActionEvent event) |
---|
3045 | 3298 | { |
---|
| 3299 | + Object source = event.getSource(); |
---|
3046 | 3300 | // SCRIPT DIALOG |
---|
3047 | | - if (event.getSource() == okbutton) |
---|
| 3301 | + if (source == okbutton) |
---|
3048 | 3302 | { |
---|
3049 | 3303 | textpanel.setVisible(false); |
---|
3050 | 3304 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3056 | 3310 | textarea = null; |
---|
3057 | 3311 | textpanel = null; |
---|
3058 | 3312 | } |
---|
3059 | | - if (event.getSource() == cancelbutton) |
---|
| 3313 | + if (source == cancelbutton) |
---|
3060 | 3314 | { |
---|
3061 | 3315 | textpanel.setVisible(false); |
---|
3062 | 3316 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3068 | 3322 | //applySelf(); |
---|
3069 | 3323 | //client.refreshEditWindow(); |
---|
3070 | 3324 | //refreshContents(); |
---|
3071 | | - if (event.getSource() == nameField) |
---|
| 3325 | + if (source == nameField) |
---|
3072 | 3326 | { |
---|
3073 | 3327 | //System.out.println("ObjEditor " + event); |
---|
3074 | 3328 | applySelf0(true); |
---|
3075 | 3329 | //parent.applySelf(); |
---|
3076 | 3330 | objEditor.refreshContents(); |
---|
3077 | | - } else if (event.getSource() == resetButton) |
---|
| 3331 | + } else if (source == resetButton) |
---|
3078 | 3332 | { |
---|
3079 | 3333 | CameraPane.fullreset = true; |
---|
3080 | 3334 | copy.Reset(); // ResetMeshes(); |
---|
3081 | 3335 | copy.Touch(); |
---|
3082 | 3336 | objEditor.refreshContents(); |
---|
3083 | | - } else if (event.getSource() == stepItem) |
---|
| 3337 | + } else if (source == stepItem) |
---|
3084 | 3338 | { |
---|
3085 | | - cameraView.ONESTEP = true; |
---|
| 3339 | + //cameraView.ONESTEP = true; |
---|
| 3340 | + Globals.ONESTEP = true; |
---|
3086 | 3341 | cameraView.repaint(); |
---|
3087 | 3342 | return; |
---|
3088 | | - } else if (event.getSource() == stepButton) |
---|
| 3343 | + } else if (source == stepButton) |
---|
3089 | 3344 | { |
---|
3090 | 3345 | copy.Step(); |
---|
3091 | 3346 | copy.Touch(); |
---|
3092 | 3347 | objEditor.refreshContents(); |
---|
3093 | | - } else if (event.getSource() == slowerButton) |
---|
| 3348 | + } else if (source == slowerButton) |
---|
3094 | 3349 | { |
---|
3095 | 3350 | copy.Slower(); |
---|
3096 | 3351 | copy.Touch(); |
---|
3097 | 3352 | objEditor.refreshContents(); |
---|
3098 | | - } else if (event.getSource() == fasterButton) |
---|
| 3353 | + } else if (source == fasterButton) |
---|
3099 | 3354 | { |
---|
3100 | 3355 | copy.Faster(); |
---|
3101 | 3356 | copy.Touch(); |
---|
3102 | 3357 | objEditor.refreshContents(); |
---|
3103 | | - } else if (event.getSource() == remarkButton) |
---|
| 3358 | + } else if (source == remarkButton) |
---|
3104 | 3359 | { |
---|
3105 | 3360 | copy.Remark(); |
---|
3106 | 3361 | copy.Touch(); |
---|
3107 | 3362 | objEditor.refreshContents(); |
---|
3108 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3363 | + } else if (source == stepAllButton) |
---|
3109 | 3364 | { |
---|
3110 | 3365 | copy.StepAll(); |
---|
3111 | 3366 | copy.Touch(); |
---|
3112 | 3367 | objEditor.refreshContents(); |
---|
3113 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3368 | + } else if (source == resetAllButton) |
---|
3114 | 3369 | { |
---|
3115 | 3370 | //CameraPane.fullreset = true; |
---|
3116 | 3371 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3143 | 3398 | // Close(); |
---|
3144 | 3399 | // } |
---|
3145 | 3400 | // else |
---|
3146 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3401 | + if (source == resetSlidersButton) |
---|
3147 | 3402 | { |
---|
3148 | 3403 | ResetSliders(); |
---|
3149 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3404 | + } else if (source == clearMaterialButton) |
---|
3150 | 3405 | { |
---|
3151 | 3406 | ClearMaterial(); |
---|
3152 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3407 | + } else if (source == createMaterialButton) |
---|
3153 | 3408 | { |
---|
3154 | 3409 | CreateMaterial(); |
---|
3155 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3410 | + } else if (source == clearPanelButton) |
---|
3156 | 3411 | { |
---|
3157 | 3412 | copy.ClearUI(); |
---|
3158 | 3413 | refreshContents(true); |
---|
3159 | | - } /* |
---|
3160 | | - } |
---|
3161 | | - |
---|
3162 | | - public boolean action(Event event, Object arg) |
---|
3163 | | - { |
---|
3164 | | - */ else if (event.getSource() == closeItem) |
---|
| 3414 | + } else if (source == importGFDItem) |
---|
| 3415 | + { |
---|
| 3416 | + ImportGFD(); |
---|
| 3417 | + } else |
---|
| 3418 | + if (source == importVRMLX3DItem) |
---|
| 3419 | + { |
---|
| 3420 | + ImportVRMLX3D(); |
---|
| 3421 | + } else |
---|
| 3422 | + if (source == import3DSItem) |
---|
| 3423 | + { |
---|
| 3424 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3425 | + } else |
---|
| 3426 | + if (source == importOBJItem) |
---|
| 3427 | + { |
---|
| 3428 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3429 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3430 | + browser.setVisible(true); |
---|
| 3431 | + String filename = browser.getFile(); |
---|
| 3432 | + if (filename != null && filename.length() > 0) |
---|
| 3433 | + { |
---|
| 3434 | + String fullname = browser.getDirectory() + filename; |
---|
| 3435 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3436 | + } |
---|
| 3437 | + } else |
---|
| 3438 | + if (source == closeItem) |
---|
3165 | 3439 | { |
---|
3166 | 3440 | Close(); |
---|
3167 | 3441 | //return true; |
---|
3168 | | - } else if (event.getSource() == loadItem) |
---|
| 3442 | + } else if (source == openItem) |
---|
3169 | 3443 | { |
---|
3170 | | - load(); |
---|
| 3444 | + Open(); |
---|
3171 | 3445 | //return true; |
---|
3172 | | - } else if (event.getSource() == saveItem) |
---|
| 3446 | + } else if (source == newItem) |
---|
| 3447 | + { |
---|
| 3448 | + New(); |
---|
| 3449 | + } else if (source == saveItem) |
---|
3173 | 3450 | { |
---|
3174 | 3451 | save(); |
---|
3175 | 3452 | //return true; |
---|
3176 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3453 | + } else if (source == saveAsItem) |
---|
3177 | 3454 | { |
---|
3178 | 3455 | saveAs(); |
---|
3179 | 3456 | //return true; |
---|
3180 | | - } else if (event.getSource() == reexportItem) |
---|
| 3457 | + } else if (source == reexportItem) |
---|
3181 | 3458 | { |
---|
3182 | 3459 | reexport(); |
---|
3183 | 3460 | //return true; |
---|
3184 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3461 | + } else if (source == exportAsItem) |
---|
3185 | 3462 | { |
---|
3186 | 3463 | export(); |
---|
3187 | 3464 | //return true; |
---|
3188 | | - } else if (event.getSource() == povItem) |
---|
| 3465 | + } else if (source == povItem) |
---|
3189 | 3466 | { |
---|
3190 | 3467 | generatePOV(); |
---|
3191 | 3468 | //return true; |
---|
3192 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3469 | + } else if (event.getSource() == archiveItem) |
---|
| 3470 | + { |
---|
| 3471 | + cTools.Archive(frame); |
---|
| 3472 | + return; |
---|
| 3473 | + } else if (source == zBufferItem) |
---|
3193 | 3474 | { |
---|
3194 | 3475 | try |
---|
3195 | 3476 | { |
---|
.. | .. |
---|
3211 | 3492 | cameraView.repaint(); |
---|
3212 | 3493 | //return true; |
---|
3213 | 3494 | } |
---|
3214 | | - */ else if (event.getSource() == editCameraItem) |
---|
3215 | | - { |
---|
3216 | | - cameraView.ProtectCamera(); |
---|
3217 | | - cameraView.repaint(); |
---|
3218 | | - return; |
---|
3219 | | - } else if (event.getSource() == revertCameraItem) |
---|
3220 | | - { |
---|
3221 | | - cameraView.RevertCamera(); |
---|
3222 | | - cameraView.repaint(); |
---|
3223 | | - return; |
---|
3224 | | - } else if (event.getSource() == textureButton) |
---|
3225 | | - { |
---|
3226 | | - return; // true; |
---|
3227 | | - } else // combos... |
---|
3228 | | - if (event.getSource() == texresMenu) |
---|
| 3495 | + */ else // combos... |
---|
| 3496 | + if (source == texresMenu) |
---|
3229 | 3497 | { |
---|
3230 | 3498 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3231 | 3499 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3237 | 3505 | } |
---|
3238 | 3506 | } |
---|
3239 | 3507 | |
---|
3240 | | - void ToggleAnimation() |
---|
| 3508 | + void New() |
---|
3241 | 3509 | { |
---|
3242 | | - if (!CameraPane.ANIMATION) |
---|
| 3510 | + while (copy.Size() > 1) |
---|
3243 | 3511 | { |
---|
3244 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3512 | + copy.remove(1); |
---|
| 3513 | + } |
---|
| 3514 | + |
---|
| 3515 | + ResetModel(); |
---|
| 3516 | + objEditor.refreshContents(); |
---|
| 3517 | + } |
---|
| 3518 | + |
---|
| 3519 | + static public byte[] Compress(Object3D o) |
---|
| 3520 | + { |
---|
| 3521 | + try |
---|
| 3522 | + { |
---|
| 3523 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3524 | +// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3525 | + ObjectOutputStream out = new ObjectOutputStream(baos); //zstream); |
---|
| 3526 | + |
---|
| 3527 | + Object3D parent = o.parent; |
---|
| 3528 | + o.parent = null; |
---|
| 3529 | + |
---|
| 3530 | + out.writeObject(o); |
---|
| 3531 | + |
---|
| 3532 | + o.parent = parent; |
---|
| 3533 | + |
---|
| 3534 | + out.flush(); |
---|
| 3535 | + |
---|
| 3536 | + baos //zstream |
---|
| 3537 | + .close(); |
---|
| 3538 | + out.close(); |
---|
| 3539 | + |
---|
| 3540 | + byte[] bytes = baos.toByteArray(); |
---|
| 3541 | + |
---|
| 3542 | + System.out.println("save #bytes = " + bytes.length); |
---|
| 3543 | + return bytes; |
---|
| 3544 | + } catch (Exception e) |
---|
| 3545 | + { |
---|
| 3546 | + System.err.println(e); |
---|
| 3547 | + return null; |
---|
| 3548 | + } |
---|
| 3549 | + } |
---|
| 3550 | + |
---|
| 3551 | + static public Object Uncompress(byte[] bytes) |
---|
| 3552 | + { |
---|
| 3553 | + System.out.println("restore #bytes = " + bytes.length); |
---|
| 3554 | + try |
---|
| 3555 | + { |
---|
| 3556 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3557 | + //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3558 | + ObjectInputStream in = new ObjectInputStream(bais); // istream); |
---|
| 3559 | + Object obj = in.readObject(); |
---|
| 3560 | + |
---|
| 3561 | + bais //istream |
---|
| 3562 | + .close(); |
---|
| 3563 | + in.close(); |
---|
| 3564 | + |
---|
| 3565 | + return obj; |
---|
| 3566 | + } catch (Exception e) |
---|
| 3567 | + { |
---|
| 3568 | + System.err.println(e); |
---|
| 3569 | + return null; |
---|
| 3570 | + } |
---|
| 3571 | + } |
---|
| 3572 | + |
---|
| 3573 | + static public Object clone(Object o) |
---|
| 3574 | + { |
---|
| 3575 | + try |
---|
| 3576 | + { |
---|
| 3577 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3578 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3579 | + |
---|
| 3580 | + out.writeObject(o); |
---|
| 3581 | + |
---|
| 3582 | + out.flush(); |
---|
| 3583 | + out.close(); |
---|
| 3584 | + |
---|
| 3585 | + byte[] bytes = baos.toByteArray(); |
---|
| 3586 | + |
---|
| 3587 | + System.out.println("clone = " + bytes.length); |
---|
| 3588 | + |
---|
| 3589 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3590 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3591 | + Object obj = in.readObject(); |
---|
| 3592 | + in.close(); |
---|
| 3593 | + |
---|
| 3594 | + return obj; |
---|
| 3595 | + } catch (Exception e) |
---|
| 3596 | + { |
---|
| 3597 | + System.err.println(e); |
---|
| 3598 | + return null; |
---|
| 3599 | + } |
---|
| 3600 | + } |
---|
| 3601 | + |
---|
| 3602 | + cRadio GetCurrentTab() |
---|
| 3603 | + { |
---|
| 3604 | + cRadio ab; |
---|
| 3605 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3606 | + { |
---|
| 3607 | + ab = (cRadio)e.nextElement(); |
---|
| 3608 | + if(ab.GetObject() == copy) |
---|
| 3609 | + { |
---|
| 3610 | + return ab; |
---|
| 3611 | + } |
---|
| 3612 | + } |
---|
| 3613 | + |
---|
| 3614 | + return null; |
---|
| 3615 | + } |
---|
| 3616 | + |
---|
| 3617 | + |
---|
| 3618 | + public void Save() |
---|
| 3619 | + { |
---|
| 3620 | + //Save(true); |
---|
| 3621 | + Replace(); |
---|
| 3622 | + } |
---|
| 3623 | + |
---|
| 3624 | + private boolean Equal(byte[] compress, byte[] name) |
---|
| 3625 | + { |
---|
| 3626 | + if (compress.length != name.length) |
---|
| 3627 | + { |
---|
| 3628 | + return false; |
---|
| 3629 | + } |
---|
| 3630 | + |
---|
| 3631 | + for (int i=compress.length; --i>=0;) |
---|
| 3632 | + { |
---|
| 3633 | + if (compress[i] != name[i]) |
---|
| 3634 | + return false; |
---|
| 3635 | + } |
---|
| 3636 | + |
---|
| 3637 | + return true; |
---|
| 3638 | + } |
---|
| 3639 | + |
---|
| 3640 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3641 | + |
---|
| 3642 | + public boolean Save(boolean user) |
---|
| 3643 | + { |
---|
| 3644 | + System.err.println("Save"); |
---|
| 3645 | + |
---|
| 3646 | + cRadio tab = GetCurrentTab(); |
---|
| 3647 | + |
---|
| 3648 | + byte[] compress = CompressCopy(); |
---|
| 3649 | + |
---|
| 3650 | + boolean thesame = false; |
---|
| 3651 | + |
---|
| 3652 | + // Quick heuristic using length. Works only when stream is compressed. |
---|
| 3653 | + if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1])) |
---|
| 3654 | + { |
---|
| 3655 | + thesame = true; |
---|
| 3656 | + } |
---|
| 3657 | + |
---|
| 3658 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3659 | + if (!thesame) |
---|
| 3660 | + { |
---|
| 3661 | + //tab.user[tab.versionindex] = user; |
---|
| 3662 | + //boolean increment = true; // tab.graphs[tab.versionindex] == null; |
---|
| 3663 | + |
---|
| 3664 | + copy.versions[++copy.versionindex] = compress; |
---|
| 3665 | + |
---|
| 3666 | + // if (increment) |
---|
| 3667 | + // tab.versionindex++; |
---|
| 3668 | + } |
---|
| 3669 | + |
---|
| 3670 | + //copy.RestoreBigData(versiontable); |
---|
| 3671 | + |
---|
| 3672 | + //assert(hashtable.isEmpty()); |
---|
| 3673 | + |
---|
| 3674 | + for (int i = copy.versionindex+1; i < copy.versions.length; i++) |
---|
| 3675 | + { |
---|
| 3676 | + //tab.user[i] = false; |
---|
| 3677 | + copy.versions[i] = null; |
---|
| 3678 | + } |
---|
| 3679 | + |
---|
| 3680 | + SetUndoStates(); |
---|
| 3681 | + |
---|
| 3682 | + // test save |
---|
| 3683 | + if (false) |
---|
| 3684 | + { |
---|
| 3685 | + try |
---|
| 3686 | + { |
---|
| 3687 | + FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex); |
---|
| 3688 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3689 | + |
---|
| 3690 | + p.writeObject(copy); |
---|
| 3691 | + |
---|
| 3692 | + p.flush(); |
---|
| 3693 | + |
---|
| 3694 | + ostream.close(); |
---|
| 3695 | + } catch (Exception e) |
---|
| 3696 | + { |
---|
| 3697 | + e.printStackTrace(); |
---|
| 3698 | + } |
---|
| 3699 | + } |
---|
| 3700 | + |
---|
| 3701 | + return !thesame; |
---|
| 3702 | + } |
---|
| 3703 | + |
---|
| 3704 | + void CopyChanged(Object3D obj) |
---|
| 3705 | + { |
---|
| 3706 | + SetUndoStates(); |
---|
| 3707 | + |
---|
| 3708 | + boolean temp = CameraPane.SWITCH; |
---|
| 3709 | + CameraPane.SWITCH = false; |
---|
| 3710 | + |
---|
| 3711 | + copy.ExtractBigData(versiontable); |
---|
| 3712 | + |
---|
| 3713 | + copy.clear(); |
---|
| 3714 | + |
---|
| 3715 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3716 | + { |
---|
| 3717 | + copy.add(obj.get(i)); |
---|
| 3718 | + } |
---|
| 3719 | + |
---|
| 3720 | + copy.RestoreBigData(versiontable); |
---|
| 3721 | + |
---|
| 3722 | + CameraPane.SWITCH = temp; |
---|
| 3723 | + |
---|
| 3724 | + //assert(hashtable.isEmpty()); |
---|
| 3725 | + |
---|
| 3726 | + copy.Touch(); |
---|
| 3727 | + |
---|
| 3728 | + ResetModel(); |
---|
| 3729 | + copy.HardTouch(); // recompile? |
---|
| 3730 | + |
---|
| 3731 | + cRadio ab; |
---|
| 3732 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3733 | + { |
---|
| 3734 | + ab = (cRadio)e.nextElement(); |
---|
| 3735 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3736 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3737 | + if (test != null) |
---|
| 3738 | + { |
---|
| 3739 | + test.editWindow = ab.object.editWindow; |
---|
| 3740 | + ab.object = test; |
---|
| 3741 | + } |
---|
| 3742 | + } |
---|
| 3743 | + |
---|
| 3744 | + refreshContents(); |
---|
| 3745 | + } |
---|
| 3746 | + |
---|
| 3747 | + cButton undoButton; |
---|
| 3748 | + cButton restoreButton; |
---|
| 3749 | + cButton replaceButton; |
---|
| 3750 | + cButton redoButton; |
---|
| 3751 | + |
---|
| 3752 | + boolean muteSlider; |
---|
| 3753 | + |
---|
| 3754 | + int VersionCount() |
---|
| 3755 | + { |
---|
| 3756 | + int count = 0; |
---|
| 3757 | + |
---|
| 3758 | + for (int i = copy.versions.length; --i >= 0;) |
---|
| 3759 | + { |
---|
| 3760 | + if (copy.versions[i] != null) |
---|
| 3761 | + count++; |
---|
| 3762 | + } |
---|
| 3763 | + |
---|
| 3764 | + return count; |
---|
| 3765 | + } |
---|
| 3766 | + |
---|
| 3767 | + void SetUndoStates() |
---|
| 3768 | + { |
---|
| 3769 | + cRadio tab = GetCurrentTab(); |
---|
| 3770 | + |
---|
| 3771 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 3772 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
| 3773 | + |
---|
| 3774 | + undoButton.setEnabled(copy.versionindex > 0); |
---|
| 3775 | + redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null); |
---|
| 3776 | + |
---|
| 3777 | + muteSlider = true; |
---|
| 3778 | + versionSlider.setMaximum(VersionCount() - 1); |
---|
| 3779 | + versionSlider.setInteger(copy.versionindex); |
---|
| 3780 | + muteSlider = false; |
---|
| 3781 | + } |
---|
| 3782 | + |
---|
| 3783 | + public boolean Undo() |
---|
| 3784 | + { |
---|
| 3785 | + // Option? |
---|
| 3786 | + Replace(); |
---|
| 3787 | + |
---|
| 3788 | + System.err.println("Undo"); |
---|
| 3789 | + |
---|
| 3790 | + cRadio tab = GetCurrentTab(); |
---|
| 3791 | + |
---|
| 3792 | + if (copy.versionindex == 0) |
---|
| 3793 | + { |
---|
| 3794 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3795 | + return false; |
---|
| 3796 | + } |
---|
| 3797 | + |
---|
| 3798 | +// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex]) |
---|
| 3799 | +// { |
---|
| 3800 | +// if (Save(false)) |
---|
| 3801 | +// tab.versionindex -= 1; |
---|
| 3802 | +// else |
---|
| 3803 | +// { |
---|
| 3804 | +// if (tab.versionindex <= 0) |
---|
| 3805 | +// return false; |
---|
| 3806 | +// else |
---|
| 3807 | +// tab.versionindex -= 1; |
---|
| 3808 | +// } |
---|
| 3809 | +// } |
---|
| 3810 | + |
---|
| 3811 | + copy.versionindex -= 1; |
---|
| 3812 | + |
---|
| 3813 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3814 | + |
---|
| 3815 | + return true; |
---|
| 3816 | + } |
---|
| 3817 | + |
---|
| 3818 | + public boolean Restore() |
---|
| 3819 | + { |
---|
| 3820 | + System.err.println("Restore"); |
---|
| 3821 | + |
---|
| 3822 | + cRadio tab = GetCurrentTab(); |
---|
| 3823 | + |
---|
| 3824 | + if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 3825 | + { |
---|
| 3826 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3827 | + return false; |
---|
| 3828 | + } |
---|
| 3829 | + |
---|
| 3830 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3831 | + |
---|
| 3832 | + return true; |
---|
| 3833 | + } |
---|
| 3834 | + |
---|
| 3835 | + public boolean Replace() |
---|
| 3836 | + { |
---|
| 3837 | + System.err.println("Replace"); |
---|
| 3838 | + |
---|
| 3839 | + cRadio tab = GetCurrentTab(); |
---|
| 3840 | + |
---|
| 3841 | + if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null) |
---|
| 3842 | + { |
---|
| 3843 | + // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3844 | + return false; |
---|
| 3845 | + } |
---|
| 3846 | + |
---|
| 3847 | + copy.versions[copy.versionindex] = CompressCopy(); |
---|
| 3848 | + |
---|
| 3849 | + return true; |
---|
| 3850 | + } |
---|
| 3851 | + |
---|
| 3852 | + public void Redo() |
---|
| 3853 | + { |
---|
| 3854 | + // Option? |
---|
| 3855 | + Replace(); |
---|
| 3856 | + |
---|
| 3857 | + cRadio tab = GetCurrentTab(); |
---|
| 3858 | + |
---|
| 3859 | + if (copy.versions[copy.versionindex + 1] == null) |
---|
| 3860 | + { |
---|
| 3861 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3862 | + return; |
---|
| 3863 | + } |
---|
| 3864 | + |
---|
| 3865 | + copy.versionindex += 1; |
---|
| 3866 | + |
---|
| 3867 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex])); |
---|
| 3868 | + |
---|
| 3869 | + //if (!tab.user[tab.versionindex]) |
---|
| 3870 | + // tab.graphs[tab.versionindex] = null; |
---|
| 3871 | + } |
---|
| 3872 | + |
---|
| 3873 | + void ImportGFD() |
---|
| 3874 | + { |
---|
| 3875 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3245 | 3876 | browser.show(); |
---|
3246 | 3877 | String filename = browser.getFile(); |
---|
3247 | 3878 | if (filename != null && filename.length() > 0) |
---|
3248 | 3879 | { |
---|
3249 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3880 | + String fullname = browser.getDirectory() + filename; |
---|
| 3881 | + |
---|
| 3882 | + //Object3D readobj = |
---|
| 3883 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3884 | + //makeSomething(readobj); |
---|
| 3885 | + } |
---|
| 3886 | + } |
---|
| 3887 | + |
---|
| 3888 | + void ImportVRMLX3D() |
---|
| 3889 | + { |
---|
| 3890 | + if (Grafreed.standAlone) |
---|
| 3891 | + { |
---|
| 3892 | + /**/ |
---|
| 3893 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3894 | + browser.show(); |
---|
| 3895 | + String filename = browser.getFile(); |
---|
| 3896 | + if (filename != null && filename.length() > 0) |
---|
| 3897 | + { |
---|
| 3898 | + String fullname = browser.getDirectory() + filename; |
---|
| 3899 | + LoadVRMLX3D(fullname); |
---|
| 3900 | + } |
---|
| 3901 | + /**/ |
---|
| 3902 | + } |
---|
| 3903 | + } |
---|
| 3904 | + |
---|
| 3905 | + void ToggleAnimation() |
---|
| 3906 | + { |
---|
| 3907 | + if (!Globals.ANIMATION) |
---|
| 3908 | + { |
---|
| 3909 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3910 | + browser.setVisible(true); |
---|
| 3911 | + String filename = browser.getFile(); |
---|
| 3912 | + if (filename != null && filename.length() > 0) |
---|
| 3913 | + { |
---|
| 3914 | + Globals.filename = browser.getDirectory() + filename; |
---|
3250 | 3915 | //CameraPane.framecount = 0; |
---|
3251 | | - CameraPane.imagecount = 0; |
---|
| 3916 | + Globals.imagecount = 0; |
---|
3252 | 3917 | |
---|
3253 | | - CameraPane.ANIMATION ^= true; |
---|
| 3918 | + Globals.ANIMATION ^= true; |
---|
3254 | 3919 | |
---|
3255 | | - GrafreeD.wav.cursor = 0; |
---|
3256 | | - GrafreeD.wav.loop = 0; |
---|
| 3920 | + Grafreed.wav.cursor = 0; |
---|
| 3921 | + Grafreed.wav.loop = 0; |
---|
3257 | 3922 | } |
---|
3258 | 3923 | } else |
---|
3259 | 3924 | { |
---|
3260 | | - CameraPane.ANIMATION ^= true; |
---|
| 3925 | + Globals.ANIMATION ^= true; |
---|
3261 | 3926 | } |
---|
3262 | 3927 | } |
---|
3263 | 3928 | |
---|
.. | .. |
---|
3303 | 3968 | void CreateMaterial() |
---|
3304 | 3969 | { |
---|
3305 | 3970 | //copy.ClearMaterial(); // PATCH |
---|
3306 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3971 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3307 | 3972 | if (copy.selection.size() > 0) |
---|
3308 | 3973 | //SetMaterial(copy); |
---|
3309 | 3974 | { |
---|
.. | .. |
---|
3354 | 4019 | assert false; |
---|
3355 | 4020 | } |
---|
3356 | 4021 | |
---|
3357 | | - void EditSelection() |
---|
| 4022 | + void EditSelection(boolean newWindow) |
---|
3358 | 4023 | { |
---|
3359 | 4024 | } |
---|
3360 | 4025 | |
---|
.. | .. |
---|
3362 | 4027 | { |
---|
3363 | 4028 | copy.ResetBlockLoop(); // temporary problem |
---|
3364 | 4029 | |
---|
3365 | | - boolean random = CameraPane.RANDOM; |
---|
3366 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 4030 | + boolean random = CameraPane.SWITCH; |
---|
| 4031 | + CameraPane.SWITCH = false; // parse everything |
---|
3367 | 4032 | copy.ResetDisplayList(); |
---|
3368 | 4033 | copy.HardTouch(); |
---|
3369 | | - CameraPane.RANDOM = random; |
---|
| 4034 | + CameraPane.SWITCH = random; |
---|
3370 | 4035 | } |
---|
3371 | 4036 | |
---|
3372 | 4037 | // public void applySelf() |
---|
.. | .. |
---|
3436 | 4101 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3437 | 4102 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3438 | 4103 | |
---|
3439 | | - if (!NumberSlider.frozen) |
---|
| 4104 | + if (!cNumberSlider.frozen) |
---|
3440 | 4105 | { |
---|
3441 | 4106 | //System.out.println("Propagate = " + propagate); |
---|
3442 | 4107 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 4108 | + |
---|
| 4109 | + if (copy.material != null) |
---|
| 4110 | + { |
---|
| 4111 | + cMaterial mat = copy.material; |
---|
| 4112 | + |
---|
| 4113 | + colorField.SetToolTipValue((mat.color)); |
---|
| 4114 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 4115 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 4116 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 4117 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 4118 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 4119 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 4120 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 4121 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 4122 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 4123 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 4124 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 4125 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 4126 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 4127 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 4128 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 4129 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 4130 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 4131 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 4132 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 4133 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 4134 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 4135 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 4136 | + } |
---|
| 4137 | + |
---|
3443 | 4138 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3444 | 4139 | { |
---|
3445 | 4140 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3468 | 4163 | //copy.Touch(); |
---|
3469 | 4164 | } |
---|
3470 | 4165 | |
---|
| 4166 | + cNumberSlider versionSlider; |
---|
| 4167 | + |
---|
3471 | 4168 | public void stateChanged(ChangeEvent e) |
---|
3472 | 4169 | { |
---|
3473 | 4170 | // assert(false); |
---|
| 4171 | + if (e.getSource() == versionSlider) |
---|
| 4172 | + { |
---|
| 4173 | + if (muteSlider) |
---|
| 4174 | + return; |
---|
| 4175 | + |
---|
| 4176 | + int version = versionSlider.getInteger(); |
---|
| 4177 | + |
---|
| 4178 | + if (copy.versions[version] != null) |
---|
| 4179 | + { |
---|
| 4180 | + CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version])); |
---|
| 4181 | + } |
---|
| 4182 | + |
---|
| 4183 | + return; |
---|
| 4184 | + } |
---|
3474 | 4185 | |
---|
3475 | 4186 | if (freezematerial) |
---|
3476 | 4187 | { |
---|
.. | .. |
---|
3484 | 4195 | || e.getSource() == apertureField |
---|
3485 | 4196 | || e.getSource() == shadowblurField) |
---|
3486 | 4197 | { |
---|
| 4198 | + new Exception().printStackTrace(); |
---|
3487 | 4199 | System.exit(0); |
---|
3488 | 4200 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3489 | 4201 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3510 | 4222 | //System.out.println("PARENT = " + parent); |
---|
3511 | 4223 | //if (parent != null) |
---|
3512 | 4224 | // parent.applySelf(); |
---|
3513 | | - refreshContents(); |
---|
| 4225 | + if (e.getSource() == normalpushField) |
---|
| 4226 | + { |
---|
| 4227 | + objEditor.refreshContents(); |
---|
| 4228 | + //Refresh(); |
---|
| 4229 | + } |
---|
| 4230 | + else |
---|
| 4231 | + refreshContents(); |
---|
3514 | 4232 | // ??? client.refreshEditWindow(); |
---|
3515 | 4233 | } |
---|
3516 | 4234 | //else |
---|
.. | .. |
---|
3522 | 4240 | //group.name = nameField.getText(); |
---|
3523 | 4241 | //objEditor.applySelf(); |
---|
3524 | 4242 | |
---|
3525 | | - assert (objEditor == this); |
---|
| 4243 | + // OCT2018: assert (objEditor == this); |
---|
3526 | 4244 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3527 | 4245 | //super.applySelf() |
---|
3528 | 4246 | ; else |
---|
.. | .. |
---|
3546 | 4264 | objEditor.copy = keep; |
---|
3547 | 4265 | } |
---|
3548 | 4266 | } |
---|
| 4267 | + |
---|
| 4268 | + if (normalpushField != null) |
---|
| 4269 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3549 | 4270 | } |
---|
3550 | 4271 | |
---|
3551 | 4272 | void SnapObject() |
---|
3552 | 4273 | { |
---|
3553 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3554 | | - SnapObject(obj); |
---|
| 4274 | + if (copy.selection.size() > 0) |
---|
| 4275 | + { |
---|
| 4276 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 4277 | + SnapObject(obj); |
---|
| 4278 | + } |
---|
3555 | 4279 | } |
---|
3556 | 4280 | |
---|
3557 | 4281 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
3797 | 4521 | |
---|
3798 | 4522 | radioPanel.revalidate(); |
---|
3799 | 4523 | radioPanel.repaint(); |
---|
3800 | | - ctrlPanel.revalidate(); // ? new |
---|
| 4524 | + ctrlPanel.validate(); // ? new |
---|
3801 | 4525 | ctrlPanel.repaint(); |
---|
3802 | 4526 | } |
---|
3803 | 4527 | } |
---|
.. | .. |
---|
3806 | 4530 | |
---|
3807 | 4531 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3808 | 4532 | { |
---|
| 4533 | + if (Globals.REPLACEONMAKE) // && resetmodel) |
---|
| 4534 | + Save(); |
---|
3809 | 4535 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3810 | 4536 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3811 | 4537 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3892 | 4618 | { |
---|
3893 | 4619 | ResetModel(); |
---|
3894 | 4620 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4621 | + |
---|
| 4622 | + if (thing.Size() == 0) |
---|
| 4623 | + { |
---|
| 4624 | + //EditSelection(false); |
---|
| 4625 | + } |
---|
| 4626 | + |
---|
3895 | 4627 | refreshContents(); |
---|
3896 | 4628 | } |
---|
3897 | 4629 | |
---|
.. | .. |
---|
4009 | 4741 | } |
---|
4010 | 4742 | } |
---|
4011 | 4743 | } |
---|
| 4744 | + |
---|
4012 | 4745 | LoadGFDThread loadGFDThread; |
---|
4013 | 4746 | |
---|
4014 | 4747 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4028 | 4761 | |
---|
4029 | 4762 | try |
---|
4030 | 4763 | { |
---|
| 4764 | + // Try compressed version first. |
---|
4031 | 4765 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4032 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4766 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4767 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4033 | 4768 | |
---|
4034 | 4769 | readobj = (Object3D) p.readObject(); |
---|
4035 | 4770 | istream.close(); |
---|
.. | .. |
---|
4037 | 4772 | readobj.ResetDisplayList(); |
---|
4038 | 4773 | } catch (Exception e) |
---|
4039 | 4774 | { |
---|
4040 | | - e.printStackTrace(); |
---|
| 4775 | + //e.printStackTrace(); |
---|
| 4776 | + try |
---|
| 4777 | + { |
---|
| 4778 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4779 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4780 | + |
---|
| 4781 | + readobj = (Object3D) p.readObject(); |
---|
| 4782 | + istream.close(); |
---|
| 4783 | + |
---|
| 4784 | + readobj.ResetDisplayList(); |
---|
| 4785 | + } catch (Exception e2) |
---|
| 4786 | + { |
---|
| 4787 | + e2.printStackTrace(); |
---|
| 4788 | + } |
---|
4041 | 4789 | } |
---|
4042 | 4790 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4043 | 4791 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4083 | 4831 | |
---|
4084 | 4832 | void LoadIt(Object obj) |
---|
4085 | 4833 | { |
---|
| 4834 | + if (obj == null) |
---|
| 4835 | + { |
---|
| 4836 | + // Invalid file |
---|
| 4837 | + return; |
---|
| 4838 | + } |
---|
| 4839 | + |
---|
4086 | 4840 | System.out.println("Loaded " + obj); |
---|
4087 | 4841 | //new Exception().printStackTrace(); |
---|
4088 | 4842 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4092 | 4846 | |
---|
4093 | 4847 | if (readobj != null) |
---|
4094 | 4848 | { |
---|
| 4849 | + //if (Globals.SAVEONMAKE) // A new object cannot share meshes |
---|
| 4850 | + // Save(); |
---|
4095 | 4851 | try |
---|
4096 | 4852 | { |
---|
4097 | 4853 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4146 | 4902 | c.addChild(csg); |
---|
4147 | 4903 | } |
---|
4148 | 4904 | |
---|
| 4905 | + copy.versions = readobj.versions; |
---|
| 4906 | + copy.versionindex = readobj.versionindex; |
---|
| 4907 | + |
---|
| 4908 | + if (copy.versions == null) |
---|
| 4909 | + { |
---|
| 4910 | + copy.versions = new byte[100][]; |
---|
| 4911 | + copy.versionindex = -1; |
---|
| 4912 | + } |
---|
| 4913 | + |
---|
| 4914 | + //? SetUndoStates(); |
---|
| 4915 | + |
---|
4149 | 4916 | ResetModel(); |
---|
4150 | 4917 | copy.HardTouch(); // recompile? |
---|
4151 | 4918 | refreshContents(); |
---|
4152 | 4919 | } |
---|
4153 | 4920 | } |
---|
4154 | 4921 | |
---|
4155 | | - void load() // throws ClassNotFoundException |
---|
| 4922 | + void Open() // throws ClassNotFoundException |
---|
4156 | 4923 | { |
---|
4157 | | - if (GrafreeD.standAlone) |
---|
| 4924 | + if (Grafreed.standAlone) |
---|
4158 | 4925 | { |
---|
4159 | 4926 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4160 | 4927 | browser.show(); |
---|
.. | .. |
---|
4241 | 5008 | try |
---|
4242 | 5009 | { |
---|
4243 | 5010 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4244 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 5011 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5012 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4245 | 5013 | |
---|
4246 | 5014 | p.writeObject(copy); |
---|
4247 | 5015 | p.flush(); |
---|
4248 | 5016 | |
---|
| 5017 | + zstream.close(); |
---|
4249 | 5018 | ostream.close(); |
---|
4250 | 5019 | |
---|
4251 | 5020 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4255 | 5024 | { |
---|
4256 | 5025 | } |
---|
4257 | 5026 | } |
---|
| 5027 | + |
---|
4258 | 5028 | String lastname; |
---|
4259 | 5029 | |
---|
4260 | 5030 | void saveAs() |
---|
4261 | 5031 | { |
---|
4262 | | - if (GrafreeD.standAlone) |
---|
| 5032 | + if (Grafreed.standAlone) |
---|
4263 | 5033 | { |
---|
4264 | 5034 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4265 | 5035 | browser.setVisible(true); |
---|
4266 | 5036 | String filename = browser.getFile(); |
---|
4267 | 5037 | if (filename != null && filename.length() > 0) |
---|
4268 | 5038 | { |
---|
| 5039 | + if (!filename.endsWith(".gfd")) |
---|
| 5040 | + filename += ".gfd"; |
---|
4269 | 5041 | lastname = browser.getDirectory() + filename; |
---|
4270 | 5042 | save(); |
---|
4271 | 5043 | } |
---|
.. | .. |
---|
4364 | 5136 | try |
---|
4365 | 5137 | { |
---|
4366 | 5138 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4367 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4368 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 5139 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 5140 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4369 | 5141 | |
---|
4370 | 5142 | Object3D objectparent = obj.parent; |
---|
4371 | 5143 | obj.parent = null; |
---|
4372 | 5144 | |
---|
4373 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 5145 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4374 | 5146 | |
---|
4375 | 5147 | obj.parent = objectparent; |
---|
4376 | 5148 | |
---|
.. | .. |
---|
4382 | 5154 | p.writeObject(object); |
---|
4383 | 5155 | p.flush(); |
---|
4384 | 5156 | |
---|
| 5157 | + zstream.close(); |
---|
4385 | 5158 | ostream.close(); |
---|
4386 | | - // zstream.close(); |
---|
4387 | 5159 | |
---|
4388 | 5160 | // group.selection.get(0).parent = parent; |
---|
4389 | 5161 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4404 | 5176 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4405 | 5177 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4406 | 5178 | copy.generatePOV(buffer); |
---|
4407 | | - if (GrafreeD.standAlone) |
---|
| 5179 | + if (Grafreed.standAlone) |
---|
4408 | 5180 | { |
---|
4409 | 5181 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4410 | 5182 | browser.show(); |
---|
.. | .. |
---|
4430 | 5202 | Object3D client; |
---|
4431 | 5203 | Object3D copy; |
---|
4432 | 5204 | MenuBar menuBar; |
---|
4433 | | - Menu windowMenu; |
---|
4434 | | - MenuItem loadItem; |
---|
| 5205 | + Menu fileMenu; |
---|
| 5206 | + MenuItem newItem; |
---|
| 5207 | + MenuItem openItem; |
---|
4435 | 5208 | MenuItem saveItem; |
---|
4436 | 5209 | MenuItem saveAsItem; |
---|
4437 | 5210 | MenuItem exportAsItem; |
---|
4438 | 5211 | MenuItem reexportItem; |
---|
4439 | 5212 | MenuItem povItem; |
---|
4440 | 5213 | MenuItem closeItem; |
---|
4441 | | - Menu cameraMenu; |
---|
| 5214 | + |
---|
4442 | 5215 | CheckboxMenuItem zBufferItem; |
---|
4443 | 5216 | //MenuItem normalLensItem; |
---|
4444 | | - MenuItem editCameraItem; |
---|
4445 | | - MenuItem revertCameraItem; |
---|
4446 | | - CheckboxMenuItem toggleLiveItem; |
---|
4447 | 5217 | MenuItem stepItem; |
---|
4448 | | - CheckboxMenuItem toggleFullItem; |
---|
| 5218 | + CheckboxMenuItem toggleLiveItem; |
---|
| 5219 | + CheckboxMenuItem toggleFullScreenItem; |
---|
| 5220 | + CheckboxMenuItem toggleTimelineItem; |
---|
4449 | 5221 | CheckboxMenuItem toggleRenderItem; |
---|
4450 | 5222 | CheckboxMenuItem toggleDebugItem; |
---|
4451 | 5223 | CheckboxMenuItem toggleFrustumItem; |
---|
4452 | 5224 | CheckboxMenuItem toggleFootContactItem; |
---|
4453 | 5225 | CheckboxMenuItem toggleDLItem; |
---|
4454 | 5226 | CheckboxMenuItem toggleTextureItem; |
---|
4455 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 5227 | + CheckboxMenuItem toggleSwitchItem; |
---|
4456 | 5228 | CheckboxMenuItem toggleRootItem; |
---|
4457 | 5229 | CheckboxMenuItem animationItem; |
---|
| 5230 | + MenuItem archiveItem; |
---|
4458 | 5231 | CheckboxMenuItem toggleHandleItem; |
---|
4459 | 5232 | CheckboxMenuItem togglePaintItem; |
---|
4460 | 5233 | JSplitPane mainPanel; |
---|
4461 | 5234 | JScrollPane scrollpane; |
---|
| 5235 | + |
---|
4462 | 5236 | JPanel toolbarPanel; |
---|
4463 | | - JPanel treePanel; |
---|
| 5237 | + |
---|
| 5238 | + cGridBag treePanel; |
---|
| 5239 | + |
---|
4464 | 5240 | JPanel radioPanel; |
---|
4465 | 5241 | ButtonGroup buttonGroup; |
---|
4466 | | - JPanel ctrlPanel; |
---|
4467 | | - JPanel materialPanel; |
---|
| 5242 | + |
---|
| 5243 | + cGridBag toolboxPanel; |
---|
| 5244 | + cGridBag materialPanel; |
---|
| 5245 | + cGridBag ctrlPanel; |
---|
| 5246 | + |
---|
4468 | 5247 | JScrollPane infoPanel; |
---|
4469 | | - JPanel optionsPanel; |
---|
| 5248 | + |
---|
| 5249 | + cGridBag optionsPanel; |
---|
| 5250 | + |
---|
4470 | 5251 | JTabbedPane objectPanel; |
---|
4471 | | - JPanel XYZPanel; |
---|
| 5252 | + boolean materialFlushed; |
---|
| 5253 | + Object3D latestObject; |
---|
| 5254 | + |
---|
| 5255 | + cGridBag XYZPanel; |
---|
| 5256 | + |
---|
4472 | 5257 | JSplitPane gridPanel; |
---|
4473 | 5258 | JSplitPane bigPanel; |
---|
4474 | | - JPanel bigThree; |
---|
4475 | | - JTabbedPane scenePanel; |
---|
4476 | | - JPanel cameraPanel; |
---|
| 5259 | + |
---|
| 5260 | + cGridBag bigThree; |
---|
| 5261 | + cGridBag scenePanel; |
---|
| 5262 | + cGridBag centralPanel; |
---|
| 5263 | + JSplitPane cameraPanel; |
---|
| 5264 | + JPanel timelinePanel; |
---|
| 5265 | + JMenuBar timelineMenubar; |
---|
4477 | 5266 | JSplitPane framePanel; |
---|
4478 | 5267 | JTextArea/*Field*/ nameField; |
---|
4479 | | - cButton textureButton; |
---|
| 5268 | + //cButton textureButton; |
---|
4480 | 5269 | cButton okButton; |
---|
4481 | 5270 | cButton applyButton; |
---|
4482 | 5271 | cButton cancelButton; |
---|
.. | .. |
---|
4523 | 5312 | // MATERIAL |
---|
4524 | 5313 | JLabel materialLabel; |
---|
4525 | 5314 | JLabel colorLabel; |
---|
4526 | | - NumberSlider colorField; |
---|
| 5315 | + cNumberSlider colorField; |
---|
4527 | 5316 | JLabel modulationLabel; |
---|
4528 | | - NumberSlider modulationField; |
---|
| 5317 | + cNumberSlider modulationField; |
---|
4529 | 5318 | JLabel metalnessLabel; |
---|
4530 | | - NumberSlider metalnessField; |
---|
| 5319 | + cNumberSlider metalnessField; |
---|
4531 | 5320 | JLabel diffuseLabel; |
---|
4532 | | - NumberSlider diffuseField; |
---|
| 5321 | + cNumberSlider diffuseField; |
---|
4533 | 5322 | JLabel specularLabel; |
---|
4534 | | - NumberSlider specularField; |
---|
| 5323 | + cNumberSlider specularField; |
---|
4535 | 5324 | JLabel shininessLabel; |
---|
4536 | | - NumberSlider shininessField; |
---|
| 5325 | + cNumberSlider shininessField; |
---|
4537 | 5326 | JLabel shiftLabel; |
---|
4538 | | - NumberSlider shiftField; |
---|
| 5327 | + cNumberSlider shiftField; |
---|
4539 | 5328 | JLabel ambientLabel; |
---|
4540 | | - NumberSlider ambientField; |
---|
| 5329 | + cNumberSlider ambientField; |
---|
4541 | 5330 | JLabel lightareaLabel; |
---|
4542 | | - NumberSlider lightareaField; |
---|
| 5331 | + cNumberSlider lightareaField; |
---|
4543 | 5332 | JLabel diffusenessLabel; |
---|
4544 | | - NumberSlider diffusenessField; |
---|
| 5333 | + cNumberSlider diffusenessField; |
---|
4545 | 5334 | JLabel velvetLabel; |
---|
4546 | | - NumberSlider velvetField; |
---|
| 5335 | + cNumberSlider velvetField; |
---|
4547 | 5336 | JLabel sheenLabel; |
---|
4548 | | - NumberSlider sheenField; |
---|
| 5337 | + cNumberSlider sheenField; |
---|
4549 | 5338 | JLabel subsurfaceLabel; |
---|
4550 | | - NumberSlider subsurfaceField; |
---|
| 5339 | + cNumberSlider subsurfaceField; |
---|
4551 | 5340 | //JLabel bumpLabel; |
---|
4552 | 5341 | //NumberSlider bumpField; |
---|
4553 | 5342 | JLabel backlitLabel; |
---|
4554 | | - NumberSlider backlitField; |
---|
| 5343 | + cNumberSlider backlitField; |
---|
4555 | 5344 | JLabel anisoLabel; |
---|
4556 | | - NumberSlider anisoField; |
---|
| 5345 | + cNumberSlider anisoField; |
---|
4557 | 5346 | JLabel anisoVLabel; |
---|
4558 | | - NumberSlider anisoVField; |
---|
| 5347 | + cNumberSlider anisoVField; |
---|
4559 | 5348 | JLabel cameraLabel; |
---|
4560 | | - NumberSlider cameraField; |
---|
| 5349 | + cNumberSlider cameraField; |
---|
4561 | 5350 | JLabel selfshadowLabel; |
---|
4562 | | - NumberSlider selfshadowField; |
---|
| 5351 | + cNumberSlider selfshadowField; |
---|
4563 | 5352 | JLabel shadowLabel; |
---|
4564 | | - NumberSlider shadowField; |
---|
| 5353 | + cNumberSlider shadowField; |
---|
4565 | 5354 | JLabel textureLabel; |
---|
4566 | | - NumberSlider textureField; |
---|
| 5355 | + cNumberSlider textureField; |
---|
4567 | 5356 | JLabel opacityLabel; |
---|
4568 | | - NumberSlider opacityField; |
---|
| 5357 | + cNumberSlider opacityField; |
---|
4569 | 5358 | JLabel fakedepthLabel; |
---|
4570 | | - NumberSlider fakedepthField; |
---|
| 5359 | + cNumberSlider fakedepthField; |
---|
4571 | 5360 | JLabel shadowbiasLabel; |
---|
4572 | | - NumberSlider shadowbiasField; |
---|
| 5361 | + cNumberSlider shadowbiasField; |
---|
4573 | 5362 | JLabel bumpLabel; |
---|
4574 | | - NumberSlider bumpField; |
---|
| 5363 | + cNumberSlider bumpField; |
---|
4575 | 5364 | JLabel noiseLabel; |
---|
4576 | | - NumberSlider noiseField; |
---|
| 5365 | + cNumberSlider noiseField; |
---|
4577 | 5366 | JLabel powerLabel; |
---|
4578 | | - NumberSlider powerField; |
---|
| 5367 | + cNumberSlider powerField; |
---|
4579 | 5368 | JLabel borderfadeLabel; |
---|
4580 | | - NumberSlider borderfadeField; |
---|
| 5369 | + cNumberSlider borderfadeField; |
---|
4581 | 5370 | JLabel fogLabel; |
---|
4582 | | - NumberSlider fogField; |
---|
| 5371 | + cNumberSlider fogField; |
---|
4583 | 5372 | JLabel opacityPowerLabel; |
---|
4584 | | - NumberSlider opacityPowerField; |
---|
4585 | | - JTree jTree; |
---|
| 5373 | + cNumberSlider opacityPowerField; |
---|
| 5374 | + cTree jTree; |
---|
4586 | 5375 | //ObjectUI parent; |
---|
| 5376 | + |
---|
| 5377 | + cNumberSlider normalpushField; |
---|
| 5378 | + |
---|
| 5379 | + private MenuItem importGFDItem; |
---|
| 5380 | + private MenuItem importVRMLX3DItem; |
---|
| 5381 | + private MenuItem import3DSItem; |
---|
| 5382 | + private MenuItem importOBJItem; |
---|
4587 | 5383 | } |
---|