.. | .. |
---|
19 | 19 | import //weka.core. |
---|
20 | 20 | matrix.Matrix; |
---|
21 | 21 | |
---|
| 22 | +import grafeme.ui.*; |
---|
| 23 | + |
---|
22 | 24 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 25 | ActionListener, ChangeListener, |
---|
24 | 26 | InputMethodListener, |
---|
.. | .. |
---|
31 | 33 | boolean timeline; |
---|
32 | 34 | boolean wasFullScreen; |
---|
33 | 35 | |
---|
| 36 | + GroupEditor callee; |
---|
| 37 | + JFrame frame; |
---|
| 38 | + |
---|
34 | 39 | // SCRIPT |
---|
35 | 40 | |
---|
36 | 41 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
121 | 126 | void keyPressed(int key, int modifiers) |
---|
122 | 127 | { |
---|
123 | 128 | System.out.println("KEY PRESSED"); |
---|
124 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 129 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
125 | 130 | } |
---|
126 | 131 | */ |
---|
127 | 132 | |
---|
128 | 133 | static GridBagConstraints aConstraints; |
---|
129 | 134 | static GridBagConstraints aWindowConstraints; |
---|
130 | | - GroupEditor callee; |
---|
131 | | - JFrame frame; |
---|
| 135 | + |
---|
132 | 136 | static int GRIDWIDTH = 100; // 4; |
---|
133 | 137 | |
---|
134 | 138 | public void closeUI() |
---|
135 | 139 | { |
---|
136 | 140 | //new Exception().printStackTrace(); |
---|
137 | | - System.out.println("this = " + this); |
---|
138 | | - System.out.println("objEditor = " + objEditor); |
---|
| 141 | +// System.out.println("this = " + this); |
---|
| 142 | +// System.out.println("objEditor = " + objEditor); |
---|
139 | 143 | //nameField.removeActionListener(this); |
---|
140 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 144 | +// objEditor.ctrlPanel.remove(nameField); |
---|
| 145 | + |
---|
| 146 | + objEditor.ctrlPanel.remove(namePanel); |
---|
141 | 147 | |
---|
142 | 148 | if (!GroupEditor.allparams) |
---|
143 | 149 | return; |
---|
144 | 150 | |
---|
145 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
146 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
147 | | - objEditor.ctrlPanel.remove(markCB); |
---|
148 | | - |
---|
149 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
150 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
151 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
152 | | - |
---|
153 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
154 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
155 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
156 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
157 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
158 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
159 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
160 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
161 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
162 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 151 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 152 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 153 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 154 | +// |
---|
| 155 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 156 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 157 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 158 | +// |
---|
| 159 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 160 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 161 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 162 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 163 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 164 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 165 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 166 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 167 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 168 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
163 | 169 | |
---|
164 | | - Remove(normalpushField); |
---|
| 170 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 171 | + objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 172 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 173 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 174 | + |
---|
| 175 | + //Remove(normalpushField); |
---|
165 | 176 | } |
---|
166 | 177 | |
---|
167 | 178 | public ObjEditor GetEditor() |
---|
.. | .. |
---|
265 | 276 | void SetupMenu() |
---|
266 | 277 | { |
---|
267 | 278 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
268 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
269 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
270 | | - windowMenu.add("-"); |
---|
271 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
272 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 279 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 280 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 281 | + fileMenu.add(loadItem = new MenuItem("Load...")); |
---|
| 282 | + |
---|
| 283 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 284 | + Menu menu = new Menu("Import"); |
---|
| 285 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 286 | + importOBJItem.addActionListener(this); |
---|
| 287 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 288 | + import3DSItem.addActionListener(this); |
---|
| 289 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 290 | + importVRMLX3DItem.addActionListener(this); |
---|
| 291 | + menu.add("-"); |
---|
| 292 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 293 | + importGFDItem.addActionListener(this); |
---|
| 294 | + fileMenu.add(menu); |
---|
| 295 | + fileMenu.add("-"); |
---|
| 296 | + |
---|
| 297 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 298 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
273 | 299 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
274 | | - windowMenu.add("-"); |
---|
275 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
276 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
277 | | - windowMenu.add("-"); |
---|
| 300 | + fileMenu.add("-"); |
---|
| 301 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 302 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 303 | + fileMenu.add("-"); |
---|
278 | 304 | if (client.parent != null) |
---|
279 | 305 | { |
---|
280 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 306 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
281 | 307 | } else |
---|
282 | 308 | { |
---|
283 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 309 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
284 | 310 | } |
---|
285 | 311 | |
---|
| 312 | + newItem.addActionListener(this); |
---|
286 | 313 | loadItem.addActionListener(this); |
---|
287 | 314 | saveItem.addActionListener(this); |
---|
288 | 315 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
291 | 318 | //povItem.addActionListener(this); |
---|
292 | 319 | closeItem.addActionListener(this); |
---|
293 | 320 | |
---|
294 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
295 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
296 | | - //zBufferItem.addActionListener(this); |
---|
297 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
298 | | - //normalLensItem.addActionListener(this); |
---|
299 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
300 | | - revertCameraItem.addActionListener(this); |
---|
301 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
302 | | - toggleTimelineItem.addItemListener(this); |
---|
303 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
304 | | - toggleFullScreenItem.addItemListener(this); |
---|
305 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
306 | | - cameraMenu.add("-"); |
---|
307 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
308 | | - toggleTextureItem.addItemListener(this); |
---|
309 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
310 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
311 | | - toggleLiveItem.addItemListener(this); |
---|
312 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
313 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
314 | | - stepItem.addActionListener(this); |
---|
315 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
316 | | -// toggleDLItem.addItemListener(this); |
---|
317 | | -// toggleDLItem.setState(false); |
---|
318 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
319 | | - toggleRenderItem.addItemListener(this); |
---|
320 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
321 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
322 | | - toggleDebugItem.addItemListener(this); |
---|
323 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
324 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
325 | | - toggleFrustumItem.addItemListener(this); |
---|
326 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
327 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
328 | | - toggleFootContactItem.addItemListener(this); |
---|
329 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
330 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
331 | | - toggleRandomItem.addItemListener(this); |
---|
332 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
333 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
334 | | - toggleHandleItem.addItemListener(this); |
---|
335 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
336 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
337 | | - togglePaintItem.addItemListener(this); |
---|
338 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
339 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
340 | | -// toggleRootItem.addItemListener(this); |
---|
341 | | -// toggleRootItem.setState(false); |
---|
342 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
343 | | -// animationItem.addItemListener(this); |
---|
344 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
345 | | - cameraMenu.add("-"); |
---|
346 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
347 | | - editCameraItem.addActionListener(this); |
---|
348 | | - |
---|
349 | 321 | objectPanel = new JTabbedPane(); |
---|
350 | 322 | toolbarPanel = new JPanel(); |
---|
351 | 323 | toolbarPanel.setName("Toolbar"); |
---|
352 | | - treePanel = new JPanel(); |
---|
| 324 | + treePanel = new cGridBag(); |
---|
353 | 325 | treePanel.setName("Tree"); |
---|
354 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
| 326 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
355 | 327 | ctrlPanel.setName("Edit"); |
---|
356 | | - materialPanel = new JPanel(); |
---|
| 328 | + materialPanel = new cGridBag().setVertical(true); |
---|
357 | 329 | materialPanel.setName("Material"); |
---|
358 | 330 | /*JTextPane*/ |
---|
359 | 331 | infoarea = createTextPane(); |
---|
| 332 | + doc = infoarea.getStyledDocument(); |
---|
| 333 | + |
---|
360 | 334 | infoarea.setEditable(true); |
---|
361 | 335 | SetText(); |
---|
362 | 336 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
363 | 337 | // infoarea.setOpaque(false); |
---|
364 | 338 | // //infoarea.setForeground(textcolor); |
---|
365 | | - infoarea.setLineWrap(true); |
---|
366 | | - infoarea.setWrapStyleWord(true); |
---|
| 339 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 340 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
367 | 341 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
368 | 342 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
369 | 343 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
374 | 348 | mainPanel.setName("Main"); |
---|
375 | 349 | mainPanel.setContinuousLayout(true); |
---|
376 | 350 | mainPanel.setOneTouchExpandable(true); |
---|
377 | | - mainPanel.setDividerLocation(1.0); |
---|
378 | 351 | mainPanel.setDividerSize(9); |
---|
379 | | - mainPanel.setResizeWeight(0); |
---|
| 352 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 353 | + mainPanel.setResizeWeight(0.5); |
---|
380 | 354 | |
---|
381 | 355 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
382 | 356 | //mainPanel.setLayout(new GridBagLayout()); |
---|
383 | 357 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
384 | | - treePanel.setLayout(new GridBagLayout()); |
---|
385 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
386 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 358 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 359 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 360 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
387 | 361 | |
---|
388 | 362 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
389 | 363 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
422 | 396 | static String newline = "\n"; |
---|
423 | 397 | protected static final String buttonString = "JButton"; |
---|
424 | 398 | StyledDocument doc; |
---|
425 | | - JTextArea infoarea; |
---|
| 399 | + JTextPane infoarea; |
---|
426 | 400 | |
---|
427 | 401 | void ClearInfo() |
---|
428 | 402 | { |
---|
.. | .. |
---|
471 | 445 | //SendInfo("Name:", "bold"); |
---|
472 | 446 | if (sel.GetTextures() != null || debug) |
---|
473 | 447 | { |
---|
474 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 448 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
475 | 449 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
476 | 450 | if (sel.Size() > 0) |
---|
477 | 451 | { |
---|
478 | 452 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
479 | 453 | } |
---|
480 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 454 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
481 | 455 | if (debug) |
---|
482 | 456 | { |
---|
483 | 457 | try |
---|
.. | .. |
---|
489 | 463 | } |
---|
490 | 464 | |
---|
491 | 465 | if (full) |
---|
492 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 466 | + { |
---|
| 467 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 468 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 469 | + } |
---|
493 | 470 | |
---|
494 | 471 | if (sel.bRep != null) |
---|
495 | 472 | { |
---|
.. | .. |
---|
516 | 493 | } |
---|
517 | 494 | if (sel.support != null) |
---|
518 | 495 | { |
---|
519 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 496 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
520 | 497 | } |
---|
521 | 498 | if (sel.scriptnode != null) |
---|
522 | 499 | { |
---|
.. | .. |
---|
587 | 564 | { |
---|
588 | 565 | CameraPane.pointflow = (PointFlow) sel; |
---|
589 | 566 | } |
---|
| 567 | + |
---|
| 568 | + si.SendInfo("_____________________", "regular"); |
---|
| 569 | + si.SendInfo("", "regular"); |
---|
590 | 570 | } |
---|
591 | 571 | } |
---|
592 | 572 | |
---|
.. | .. |
---|
618 | 598 | cameraView.ToggleFullScreen(); |
---|
619 | 599 | } |
---|
620 | 600 | |
---|
621 | | - private JTextArea createTextPane() |
---|
| 601 | + private JTextPane createTextPane() |
---|
622 | 602 | { |
---|
623 | | - String[] initString = |
---|
624 | | - { |
---|
625 | | - "This is an editable JTextPane, ", //regular |
---|
626 | | - "another ", //italic |
---|
627 | | - "styled ", //bold |
---|
628 | | - "text ", //small |
---|
629 | | - "component, ", //large |
---|
630 | | - "which supports embedded components..." + newline,//regular |
---|
631 | | - " " + newline, //button |
---|
632 | | - "...and embedded icons..." + newline, //regular |
---|
633 | | - " ", //icon |
---|
634 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
635 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
636 | | - + "cover methods for interacting with those objects." |
---|
637 | | - }; |
---|
| 603 | +// TEXTAREA String[] initString = |
---|
| 604 | +// { |
---|
| 605 | +// "This is an editable JTextPane, ", //regular |
---|
| 606 | +// "another ", //italic |
---|
| 607 | +// "styled ", //bold |
---|
| 608 | +// "text ", //small |
---|
| 609 | +// "component, ", //large |
---|
| 610 | +// "which supports embedded components..." + newline,//regular |
---|
| 611 | +// " " + newline, //button |
---|
| 612 | +// "...and embedded icons..." + newline, //regular |
---|
| 613 | +// " ", //icon |
---|
| 614 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 615 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 616 | +// + "cover methods for interacting with those objects." |
---|
| 617 | +// }; |
---|
| 618 | +// |
---|
| 619 | +// String[] initStyles = |
---|
| 620 | +// { |
---|
| 621 | +// "regular", "italic", "bold", "small", "large", |
---|
| 622 | +// "regular", "button", "regular", "icon", |
---|
| 623 | +// "regular" |
---|
| 624 | +// }; |
---|
| 625 | +// |
---|
| 626 | +// JTextPane textPane = new JTextPane(); |
---|
| 627 | +// textPane.setEditable(true); |
---|
| 628 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 629 | +// addStylesToDocument(doc); |
---|
| 630 | +// |
---|
| 631 | +// try |
---|
| 632 | +// { |
---|
| 633 | +// for (int j = 0; j < 2; j++) |
---|
| 634 | +// { |
---|
| 635 | +// for (int i = 0; i < initString.length; i++) |
---|
| 636 | +// { |
---|
| 637 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 638 | +// doc.getStyle(initStyles[i])); |
---|
| 639 | +// } |
---|
| 640 | +// } |
---|
| 641 | +// } catch (BadLocationException ble) |
---|
| 642 | +// { |
---|
| 643 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 644 | +// } |
---|
638 | 645 | |
---|
639 | | - String[] initStyles = |
---|
640 | | - { |
---|
641 | | - "regular", "italic", "bold", "small", "large", |
---|
642 | | - "regular", "button", "regular", "icon", |
---|
643 | | - "regular" |
---|
644 | | - }; |
---|
645 | | - |
---|
646 | | - JTextPane textPane = new JTextPane(); |
---|
647 | | - textPane.setEditable(true); |
---|
648 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
649 | | - addStylesToDocument(doc); |
---|
650 | | - |
---|
651 | | - try |
---|
652 | | - { |
---|
653 | | - for (int j = 0; j < 2; j++) |
---|
654 | | - { |
---|
655 | | - for (int i = 0; i < initString.length; i++) |
---|
656 | | - { |
---|
657 | | - doc.insertString(doc.getLength(), initString[i], |
---|
658 | | - doc.getStyle(initStyles[i])); |
---|
659 | | - } |
---|
660 | | - } |
---|
661 | | - } catch (BadLocationException ble) |
---|
662 | | - { |
---|
663 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
664 | | - } |
---|
665 | | - |
---|
666 | | - return new JTextArea(); // textPane; |
---|
| 646 | + return new JTextPane(); // textPane; |
---|
667 | 647 | } |
---|
668 | 648 | |
---|
669 | 649 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
716 | 696 | protected static ImageIcon createImageIcon(String path, |
---|
717 | 697 | String description) |
---|
718 | 698 | { |
---|
719 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 699 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
720 | 700 | if (imgURL != null) |
---|
721 | 701 | { |
---|
722 | 702 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
748 | 728 | // NumberSlider vDivsField; |
---|
749 | 729 | // JCheckBox endcaps; |
---|
750 | 730 | JCheckBox liveCB; |
---|
| 731 | + JCheckBox selectCB; |
---|
751 | 732 | JCheckBox hideCB; |
---|
752 | 733 | JCheckBox link2masterCB; |
---|
753 | 734 | JCheckBox markCB; |
---|
.. | .. |
---|
763 | 744 | JButton slowerButton; |
---|
764 | 745 | JButton fasterButton; |
---|
765 | 746 | JButton remarkButton; |
---|
| 747 | + |
---|
| 748 | + cGridBag namePanel; |
---|
| 749 | + cGridBag setupPanel; |
---|
| 750 | + cGridBag commandsPanel; |
---|
| 751 | + cGridBag pushPanel; |
---|
| 752 | + cGridBag fillPanel; |
---|
766 | 753 | |
---|
767 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 754 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
768 | 755 | { |
---|
769 | 756 | JCheckBox cb; |
---|
770 | 757 | |
---|
771 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
772 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
773 | | -// oe.aConstraints.weightx = 1; |
---|
774 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
775 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 758 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
776 | 759 | cb.addItemListener(this); |
---|
777 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
778 | | - oe.aConstraints.gridwidth = 1; |
---|
779 | | - oe.aConstraints.gridx += 1; |
---|
780 | 760 | |
---|
781 | 761 | return cb; |
---|
782 | 762 | } |
---|
783 | 763 | |
---|
784 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 764 | + cButton AddButton(cGridBag panel, String label) |
---|
785 | 765 | { |
---|
786 | 766 | cButton cb; |
---|
787 | 767 | |
---|
788 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
789 | | - oe.aConstraints.gridwidth = 1; |
---|
790 | | -// oe.aConstraints.weightx = 1; |
---|
791 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
792 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 768 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
793 | 769 | cb.addActionListener(this); |
---|
794 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
795 | | - oe.aConstraints.gridwidth = 1; |
---|
796 | | - oe.aConstraints.gridx += 1; |
---|
797 | 770 | |
---|
798 | 771 | return cb; |
---|
799 | 772 | } |
---|
800 | 773 | |
---|
801 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 774 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
802 | 775 | { |
---|
803 | 776 | JComboBox combo; |
---|
804 | 777 | |
---|
805 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
806 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
807 | | - oe.aConstraints.gridx += 1; |
---|
| 778 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
808 | 779 | combo.addActionListener(this); |
---|
809 | 780 | |
---|
810 | 781 | return combo; |
---|
811 | 782 | } |
---|
812 | 783 | |
---|
813 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 784 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
814 | 785 | { |
---|
815 | | - NumberSlider combo; |
---|
| 786 | + cGridBag control = new cGridBag(); |
---|
| 787 | + |
---|
| 788 | + cNumberSlider combo; |
---|
816 | 789 | |
---|
817 | 790 | JLabel jlabel = new JLabel(label); |
---|
818 | | - |
---|
819 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
820 | 791 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
821 | | - aConstraints.gridwidth = 1; |
---|
822 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
823 | | - aConstraints.gridx += 1; |
---|
824 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
825 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
826 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
827 | | - aConstraints.gridx += 1; |
---|
828 | | - aConstraints.gridwidth = 1; |
---|
829 | | - |
---|
| 792 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 793 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
830 | 794 | combo.setFloat(current); |
---|
831 | | - |
---|
832 | | - combo.label = jlabel; |
---|
833 | | - |
---|
834 | | - combo.addChangeListener(this); |
---|
835 | | - |
---|
836 | | - return combo; |
---|
| 795 | + |
---|
| 796 | + panel.add(control); |
---|
| 797 | + |
---|
| 798 | + return control; |
---|
837 | 799 | } |
---|
838 | 800 | |
---|
839 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 801 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
840 | 802 | { |
---|
841 | | - NumberSlider combo; |
---|
| 803 | + cGridBag control = new cGridBag(); |
---|
| 804 | + |
---|
| 805 | + cNumberSlider combo; |
---|
842 | 806 | |
---|
843 | 807 | JLabel jlabel = new JLabel(label); |
---|
844 | | - |
---|
845 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
846 | 808 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
847 | | - aConstraints.gridwidth = 2; |
---|
848 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
851 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
852 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
853 | | - aConstraints.gridx += 1; |
---|
854 | | - aConstraints.gridwidth = 1; |
---|
855 | | - |
---|
| 809 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 810 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
856 | 811 | combo.setInteger(current); |
---|
857 | 812 | |
---|
858 | | - combo.label = jlabel; |
---|
859 | | - |
---|
860 | | - combo.addChangeListener(this); |
---|
861 | | - |
---|
862 | | - return combo; |
---|
| 813 | + panel.add(control); |
---|
| 814 | + |
---|
| 815 | + return control; |
---|
863 | 816 | } |
---|
864 | 817 | |
---|
865 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 818 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
866 | 819 | { |
---|
867 | 820 | JTextArea text; |
---|
868 | 821 | |
---|
869 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
870 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
871 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 822 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
872 | 823 | text.addCaretListener(this); |
---|
873 | | - aConstraints.gridx += 1; |
---|
874 | | - aConstraints.gridwidth = 1; |
---|
875 | 824 | |
---|
876 | 825 | return text; |
---|
877 | 826 | } |
---|
.. | .. |
---|
901 | 850 | objEditor.ctrlPanel.remove(j); |
---|
902 | 851 | } |
---|
903 | 852 | |
---|
| 853 | + void Remove(cNumberSlider j) |
---|
| 854 | + { |
---|
| 855 | + j.removeChangeListener(this); |
---|
| 856 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 857 | + objEditor.ctrlPanel.remove(j); |
---|
| 858 | + } |
---|
| 859 | + |
---|
904 | 860 | /* |
---|
905 | 861 | */ |
---|
906 | | - void Return() // ObjEditor oe) |
---|
| 862 | + void Return0() // ObjEditor oe) |
---|
907 | 863 | { |
---|
908 | 864 | aConstraints.gridy += 1; |
---|
909 | 865 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
958 | 914 | |
---|
959 | 915 | void SetupUI2(ObjEditor oe) |
---|
960 | 916 | { |
---|
961 | | -// oe.aConstraints.weightx = 0; |
---|
962 | | -// oe.aConstraints.weighty = 0; |
---|
963 | | -// oe.aConstraints.gridx = 0; |
---|
964 | | -// oe.aConstraints.gridy = 0; |
---|
965 | | - SetupName(oe); |
---|
| 917 | + //SetupName(oe); |
---|
| 918 | + |
---|
| 919 | + namePanel = new cGridBag(); |
---|
| 920 | + |
---|
| 921 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 922 | + namePanel.add(nameField); |
---|
| 923 | + oe.ctrlPanel.add(namePanel); |
---|
| 924 | + |
---|
| 925 | + oe.ctrlPanel.Return(); |
---|
966 | 926 | |
---|
967 | 927 | if (!GroupEditor.allparams) |
---|
968 | 928 | return; |
---|
969 | 929 | |
---|
970 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
971 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
972 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 930 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 931 | + |
---|
| 932 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 933 | + liveCB.setToolTipText("Animate object"); |
---|
| 934 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 935 | + selectCB.setToolTipText("Make object selectable"); |
---|
973 | 936 | // Return(); |
---|
974 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
975 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
976 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
977 | | - Return(); |
---|
978 | | - resetButton = AddButton(oe, "Reset"); |
---|
979 | | - stepButton = AddButton(oe, "Step"); |
---|
| 937 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 938 | + hideCB.setToolTipText("Hide object"); |
---|
| 939 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 940 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 941 | + |
---|
| 942 | + rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind); |
---|
| 943 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 944 | + |
---|
| 945 | + randomCB = AddCheckBox(setupPanel, "Random", copy.random); |
---|
| 946 | + randomCB.setToolTipText("Option for switch node"); |
---|
| 947 | + |
---|
| 948 | + if (Globals.ADVANCED) |
---|
| 949 | + { |
---|
| 950 | + link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master); |
---|
| 951 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 952 | + speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup); |
---|
| 953 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 954 | + } |
---|
| 955 | + |
---|
| 956 | + oe.ctrlPanel.add(setupPanel); |
---|
| 957 | + oe.ctrlPanel.Return(); |
---|
| 958 | + |
---|
| 959 | + commandsPanel = new cGridBag().setVertical(false); |
---|
| 960 | + |
---|
| 961 | + resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 962 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 963 | + stepButton = AddButton(commandsPanel, "Step"); |
---|
| 964 | + stepButton.setToolTipText("Step one frame"); |
---|
980 | 965 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
981 | 966 | // stepAllButton = AddButton(oe, "Step All"); |
---|
982 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
983 | 967 | // Return(); |
---|
984 | | - slowerButton = AddButton(oe, "Slow"); |
---|
985 | | - fasterButton = AddButton(oe, "Fast"); |
---|
986 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 968 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 969 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 970 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 971 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 972 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 973 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
987 | 974 | |
---|
988 | | - Return(); |
---|
| 975 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 976 | + oe.ctrlPanel.Return(); |
---|
989 | 977 | |
---|
990 | | - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); |
---|
991 | | - Return(); |
---|
| 978 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 979 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 980 | + //Return(); |
---|
| 981 | + |
---|
| 982 | + oe.ctrlPanel.Return(); |
---|
992 | 983 | |
---|
993 | 984 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
994 | 985 | // ObjEditor.aConstraints.gridx += 1; |
---|
.. | .. |
---|
1083 | 1074 | oe.aConstraints.gridwidth = 1; |
---|
1084 | 1075 | /**/ |
---|
1085 | 1076 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1086 | | - Return(); |
---|
| 1077 | + oe.ctrlPanel.Return(); |
---|
1087 | 1078 | |
---|
1088 | 1079 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1089 | 1080 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1185 | 1176 | //JPanel worldPanel = |
---|
1186 | 1177 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1187 | 1178 | //worldPanel.setName("World"); |
---|
1188 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
| 1179 | + centralPanel = new cGridBag(); |
---|
| 1180 | + centralPanel.preferredWidth = 20; |
---|
1189 | 1181 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1190 | 1182 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1191 | 1183 | |
---|
.. | .. |
---|
1215 | 1207 | //frontView.object = copy; |
---|
1216 | 1208 | //sideView.object = copy; |
---|
1217 | 1209 | |
---|
1218 | | - XYZPanel = new JPanel(); |
---|
1219 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1210 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1211 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1220 | 1212 | |
---|
1221 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1222 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1223 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1213 | + XYZPanel.preferredWidth = 5; |
---|
| 1214 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1215 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1216 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1224 | 1217 | |
---|
1225 | 1218 | /* |
---|
1226 | 1219 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1258 | 1251 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1259 | 1252 | //tmp.setName("Edit"); |
---|
1260 | 1253 | objectPanel.add(materialPanel); |
---|
1261 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1262 | | - north.setName("Edit"); |
---|
1263 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1264 | | - objectPanel.add(north); |
---|
| 1254 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1255 | +// north.setName("Edit"); |
---|
| 1256 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1257 | +// objectPanel.add(north); |
---|
| 1258 | + objectPanel.add(ctrlPanel); |
---|
1265 | 1259 | objectPanel.add(infoPanel); |
---|
1266 | 1260 | |
---|
1267 | 1261 | /* |
---|
.. | .. |
---|
1282 | 1276 | scrollpane.setWheelScrollingEnabled(true); |
---|
1283 | 1277 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1284 | 1278 | |
---|
1285 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1286 | | - scenePanel.add(scrollpane); |
---|
| 1279 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1280 | + scenePanel.preferredWidth = 6; |
---|
| 1281 | + |
---|
| 1282 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1283 | + tabbedPane.add(scrollpane); |
---|
1287 | 1284 | |
---|
1288 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
| 1285 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1289 | 1286 | |
---|
1290 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1287 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1291 | 1288 | |
---|
1292 | 1289 | optionsPanel.setName("Options"); |
---|
1293 | | - scenePanel.add(optionsPanel); |
---|
1294 | | - |
---|
| 1290 | + |
---|
| 1291 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1292 | + |
---|
| 1293 | + tabbedPane.add(optionsPanel); |
---|
| 1294 | + |
---|
| 1295 | + scenePanel.add(tabbedPane); |
---|
1295 | 1296 | |
---|
1296 | 1297 | /* |
---|
1297 | 1298 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1325 | 1326 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1326 | 1327 | //bigPanel.add(ctrlPanel); |
---|
1327 | 1328 | //bigPanel.add(gridPanel); |
---|
| 1329 | + /** |
---|
1328 | 1330 | bigThree = new JPanel(); |
---|
1329 | 1331 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1330 | 1332 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1348 | 1350 | // aConstraints.gridheight = 3; |
---|
1349 | 1351 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1350 | 1352 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1353 | + /**/ |
---|
1351 | 1354 | |
---|
| 1355 | + bigThree = new cGridBag(); |
---|
| 1356 | + bigThree.addComponent(scenePanel); |
---|
| 1357 | + bigThree.addComponent(centralPanel); |
---|
| 1358 | + bigThree.addComponent(XYZPanel); |
---|
| 1359 | + |
---|
1352 | 1360 | // // SIDE EFFECT!!! |
---|
1353 | 1361 | // aConstraints.gridx = 0; |
---|
1354 | 1362 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1369 | 1377 | //worldPane.add(bigPanel); |
---|
1370 | 1378 | //worldPane.add(worldPanel); |
---|
1371 | 1379 | /**/ |
---|
1372 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1380 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1381 | + frame.add(/*"Center",*/framePanel); |
---|
1373 | 1382 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1374 | 1383 | |
---|
1375 | 1384 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1376 | 1385 | |
---|
1377 | | - frame.setSize(1024, 768); |
---|
1378 | | - frame.show(); |
---|
| 1386 | + frame.setSize(1280, 860); |
---|
| 1387 | + frame.setVisible(true); |
---|
1379 | 1388 | |
---|
1380 | 1389 | gridPanel.setDividerLocation(1.0); |
---|
1381 | 1390 | |
---|
.. | .. |
---|
1390 | 1399 | }); |
---|
1391 | 1400 | } |
---|
1392 | 1401 | |
---|
| 1402 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1403 | + { |
---|
| 1404 | + } |
---|
| 1405 | + |
---|
1393 | 1406 | JTree GetTree() |
---|
1394 | 1407 | { |
---|
1395 | 1408 | return objEditor.jTree; |
---|
.. | .. |
---|
1401 | 1414 | ctrlPanel.removeAll(); |
---|
1402 | 1415 | } |
---|
1403 | 1416 | |
---|
1404 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1417 | + void SetupMaterial(cGridBag panel) |
---|
1405 | 1418 | { |
---|
1406 | | - aConstraints.weighty = 0; |
---|
1407 | | - //aConstraints.weightx = 1; |
---|
1408 | | - /* |
---|
| 1419 | + /* |
---|
1409 | 1420 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1410 | 1421 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1411 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1412 | | - aConstraints.gridx += 1; |
---|
1413 | 1422 | */ |
---|
1414 | 1423 | |
---|
1415 | | - aConstraints.gridwidth = 1; |
---|
1416 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1417 | | - aConstraints.gridx += 1; |
---|
1418 | | - aConstraints.weighty = 0; |
---|
1419 | | - aConstraints.gridwidth = 1; |
---|
| 1424 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1425 | + |
---|
| 1426 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1427 | + createMaterialButton.setToolTipText("Create material"); |
---|
1420 | 1428 | |
---|
1421 | 1429 | /* |
---|
1422 | 1430 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1423 | | - aConstraints.gridx += 1; |
---|
1424 | | - aConstraints.weighty = 0; |
---|
1425 | | - aConstraints.gridwidth = 1; |
---|
1426 | 1431 | */ |
---|
1427 | 1432 | |
---|
1428 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1429 | | - aConstraints.gridx += 1; |
---|
| 1433 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1434 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1435 | + |
---|
| 1436 | + if (Globals.ADVANCED) |
---|
| 1437 | + { |
---|
| 1438 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1439 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1440 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1441 | + } |
---|
1430 | 1442 | |
---|
1431 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1432 | | - |
---|
1433 | | - aConstraints.gridx += 1; |
---|
1434 | | - |
---|
1435 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1436 | | - |
---|
1437 | | - aConstraints.gridx += 1; |
---|
1438 | | - |
---|
1439 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1440 | | - |
---|
1441 | | - aConstraints.gridx = 0; |
---|
1442 | | - aConstraints.gridy += 1; |
---|
1443 | | - aConstraints.weighty = 0; |
---|
1444 | | - aConstraints.gridwidth = 1; |
---|
| 1443 | + editBar.preferredHeight = 15; |
---|
| 1444 | + |
---|
| 1445 | + panel.add(editBar); |
---|
| 1446 | + |
---|
1445 | 1447 | /**/ |
---|
1446 | 1448 | //aConstraints.weighty = 0; |
---|
1447 | 1449 | ////aConstraints.weightx = 1; |
---|
1448 | 1450 | //aConstraints.weighty = 1; |
---|
1449 | 1451 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1450 | 1452 | //aConstraints.gridx += 1; |
---|
1451 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1452 | | - aConstraints.weighty = 0; |
---|
1453 | | - aConstraints.gridx = 0; |
---|
1454 | | - aConstraints.gridy += 1; |
---|
1455 | | - aConstraints.gridwidth = 1; |
---|
| 1453 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1456 | 1454 | |
---|
1457 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1458 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1459 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1460 | | - aConstraints.gridx += 1; |
---|
1461 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1462 | | - //aConstraints.weightx = 0; |
---|
1463 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1464 | | - aConstraints.gridx = 0; |
---|
1465 | | - aConstraints.gridy += 1; |
---|
1466 | | - aConstraints.gridwidth = 1; |
---|
| 1455 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1456 | + |
---|
| 1457 | + cGridBag color = new cGridBag(); |
---|
| 1458 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1459 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1460 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1461 | + //colorField.preferredWidth = 200; |
---|
| 1462 | + colorSection.add(color); |
---|
1467 | 1463 | |
---|
1468 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1469 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1470 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1471 | | - aConstraints.gridx += 1; |
---|
1472 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1473 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1474 | | - aConstraints.gridx = 0; |
---|
1475 | | - aConstraints.gridy += 1; |
---|
1476 | | - aConstraints.gridwidth = 1; |
---|
| 1464 | + cGridBag modulation = new cGridBag(); |
---|
| 1465 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1466 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1467 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1468 | + colorSection.add(modulation); |
---|
1477 | 1469 | |
---|
1478 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1479 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1480 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1481 | | - aConstraints.gridx += 1; |
---|
1482 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1483 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1484 | | - aConstraints.gridx = 0; |
---|
1485 | | - aConstraints.gridy += 1; |
---|
1486 | | - aConstraints.gridwidth = 1; |
---|
| 1470 | + cGridBag texture = new cGridBag(); |
---|
| 1471 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1472 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1473 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1474 | + colorSection.add(texture); |
---|
1487 | 1475 | |
---|
1488 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1489 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1490 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1491 | | - aConstraints.gridx += 1; |
---|
1492 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1493 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1494 | | - aConstraints.gridx = 0; |
---|
1495 | | - aConstraints.gridy += 1; |
---|
1496 | | - aConstraints.gridwidth = 1; |
---|
| 1476 | + cGridBag anisoU = new cGridBag(); |
---|
| 1477 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1478 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1479 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1480 | + colorSection.add(anisoU); |
---|
1497 | 1481 | |
---|
1498 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1499 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1500 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1501 | | - aConstraints.gridx += 1; |
---|
1502 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1503 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1504 | | - aConstraints.gridx = 0; |
---|
1505 | | - aConstraints.gridy += 1; |
---|
1506 | | - aConstraints.gridwidth = 1; |
---|
| 1482 | + cGridBag anisoV = new cGridBag(); |
---|
| 1483 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1484 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1485 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1486 | + colorSection.add(anisoV); |
---|
1507 | 1487 | |
---|
1508 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1509 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1510 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1511 | | - aConstraints.gridx += 1; |
---|
1512 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1513 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1514 | | - aConstraints.gridx = 0; |
---|
1515 | | - aConstraints.gridy += 1; |
---|
1516 | | - aConstraints.gridwidth = 1; |
---|
| 1488 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1489 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1490 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1491 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1492 | + colorSection.add(shadowbias); |
---|
1517 | 1493 | |
---|
1518 | | - //aConstraints.weighty = 1; |
---|
1519 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1520 | | - //aConstraints.gridx += 1; |
---|
1521 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1522 | | - aConstraints.weighty = 0; |
---|
1523 | | - aConstraints.gridx = 0; |
---|
1524 | | - aConstraints.gridy += 1; |
---|
1525 | | - aConstraints.gridwidth = 1; |
---|
| 1494 | + panel.add(new JSeparator()); |
---|
| 1495 | + |
---|
| 1496 | + panel.add(colorSection); |
---|
| 1497 | + |
---|
| 1498 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1499 | + |
---|
| 1500 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1501 | + |
---|
| 1502 | + cGridBag diffuse = new cGridBag(); |
---|
| 1503 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1504 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1505 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1506 | + diffuseSection.add(diffuse); |
---|
1526 | 1507 | |
---|
1527 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1528 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1529 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1530 | | - aConstraints.gridx += 1; |
---|
1531 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1532 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1533 | | - aConstraints.gridx = 0; |
---|
1534 | | - aConstraints.gridy += 1; |
---|
1535 | | - aConstraints.gridwidth = 1; |
---|
| 1508 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1509 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1510 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1511 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1512 | + diffuseSection.add(diffuseness); |
---|
1536 | 1513 | |
---|
1537 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1538 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1539 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1540 | | - aConstraints.gridx += 1; |
---|
1541 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1542 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1543 | | - aConstraints.gridx = 0; |
---|
1544 | | - aConstraints.gridy += 1; |
---|
1545 | | - aConstraints.gridwidth = 1; |
---|
| 1514 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1515 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1516 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1517 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1518 | + diffuseSection.add(selfshadow); |
---|
1546 | 1519 | |
---|
1547 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1548 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1549 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1550 | | - aConstraints.gridx += 1; |
---|
1551 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1552 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1553 | | - aConstraints.gridx = 0; |
---|
1554 | | - aConstraints.gridy += 1; |
---|
1555 | | - aConstraints.gridwidth = 1; |
---|
| 1520 | + cGridBag sheen = new cGridBag(); |
---|
| 1521 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1522 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1523 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1524 | + diffuseSection.add(sheen); |
---|
1556 | 1525 | |
---|
1557 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1558 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1559 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1560 | | - aConstraints.gridx += 1; |
---|
1561 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1562 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1563 | | - aConstraints.gridx = 0; |
---|
1564 | | - aConstraints.gridy += 1; |
---|
1565 | | - aConstraints.gridwidth = 1; |
---|
| 1526 | + cGridBag subsurface = new cGridBag(); |
---|
| 1527 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1528 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1529 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1530 | + diffuseSection.add(subsurface); |
---|
1566 | 1531 | |
---|
1567 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1568 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1569 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1570 | | - aConstraints.gridx += 1; |
---|
1571 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1572 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1573 | | - aConstraints.gridx = 0; |
---|
1574 | | - aConstraints.gridy += 1; |
---|
1575 | | - aConstraints.gridwidth = 1; |
---|
| 1532 | + cGridBag shadow = new cGridBag(); |
---|
| 1533 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1534 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1535 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1536 | + diffuseSection.add(shadow); |
---|
1576 | 1537 | |
---|
1577 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1578 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1579 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1580 | | - aConstraints.gridx += 1; |
---|
1581 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1582 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1583 | | - aConstraints.gridx = 0; |
---|
1584 | | - aConstraints.gridy += 1; |
---|
1585 | | - aConstraints.gridwidth = 1; |
---|
| 1538 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1539 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1540 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1541 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1542 | + diffuseSection.add(fakedepth); |
---|
1586 | 1543 | |
---|
1587 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1588 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1589 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1590 | | - aConstraints.gridx += 1; |
---|
1591 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1592 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1593 | | - aConstraints.gridx = 0; |
---|
1594 | | - aConstraints.gridy += 1; |
---|
1595 | | - aConstraints.gridwidth = 1; |
---|
| 1544 | + panel.add(new JSeparator()); |
---|
| 1545 | + |
---|
| 1546 | + panel.add(diffuseSection); |
---|
| 1547 | + |
---|
| 1548 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1549 | + |
---|
| 1550 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1596 | 1551 | |
---|
1597 | | - //aConstraints.weighty = 1; |
---|
1598 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1599 | | - //aConstraints.gridx += 1; |
---|
1600 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1601 | | - aConstraints.weighty = 0; |
---|
1602 | | - aConstraints.gridx = 0; |
---|
1603 | | - aConstraints.gridy += 1; |
---|
1604 | | - aConstraints.gridwidth = 1; |
---|
| 1552 | + cGridBag specular = new cGridBag(); |
---|
| 1553 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1554 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1555 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1556 | + specularSection.add(specular); |
---|
1605 | 1557 | |
---|
1606 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1607 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1608 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1609 | | - aConstraints.gridx += 1; |
---|
1610 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1611 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1612 | | - aConstraints.gridx = 0; |
---|
1613 | | - aConstraints.gridy += 1; |
---|
1614 | | - aConstraints.gridwidth = 1; |
---|
| 1558 | + cGridBag lightarea = new cGridBag(); |
---|
| 1559 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1560 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1561 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1562 | + specularSection.add(lightarea); |
---|
1615 | 1563 | |
---|
1616 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1617 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1618 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1619 | | - aConstraints.gridx += 1; |
---|
1620 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1621 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1622 | | - aConstraints.gridx = 0; |
---|
1623 | | - aConstraints.gridy += 1; |
---|
1624 | | - aConstraints.gridwidth = 1; |
---|
| 1564 | + cGridBag shininess = new cGridBag(); |
---|
| 1565 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1566 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1567 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1568 | + specularSection.add(shininess); |
---|
1625 | 1569 | |
---|
1626 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1627 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1628 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1629 | | - aConstraints.gridx += 1; |
---|
1630 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1631 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1632 | | - aConstraints.gridx = 0; |
---|
1633 | | - aConstraints.gridy += 1; |
---|
1634 | | - aConstraints.gridwidth = 1; |
---|
| 1570 | + cGridBag metalness = new cGridBag(); |
---|
| 1571 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1572 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1573 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1574 | + specularSection.add(metalness); |
---|
1635 | 1575 | |
---|
1636 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1637 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1638 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1639 | | - aConstraints.gridx += 1; |
---|
1640 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1641 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1642 | | - aConstraints.gridx = 0; |
---|
1643 | | - aConstraints.gridy += 1; |
---|
1644 | | - aConstraints.gridwidth = 1; |
---|
| 1576 | + cGridBag velvet = new cGridBag(); |
---|
| 1577 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1578 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1579 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1580 | + specularSection.add(velvet); |
---|
1645 | 1581 | |
---|
1646 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1647 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1648 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1649 | | - aConstraints.gridx += 1; |
---|
1650 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1651 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1652 | | - aConstraints.gridx = 0; |
---|
1653 | | - aConstraints.gridy += 1; |
---|
1654 | | - aConstraints.gridwidth = 1; |
---|
1655 | | - |
---|
1656 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1657 | | - Return(); |
---|
| 1582 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1583 | + //Return(); |
---|
1658 | 1584 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1659 | 1585 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1660 | 1586 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1665 | 1591 | // aConstraints.gridy += 1; |
---|
1666 | 1592 | // aConstraints.gridwidth = 1; |
---|
1667 | 1593 | |
---|
1668 | | - //aConstraints.weighty = 1; |
---|
1669 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1670 | | - //aConstraints.gridx += 1; |
---|
1671 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1672 | | - aConstraints.weighty = 0; |
---|
1673 | | - aConstraints.gridx = 0; |
---|
1674 | | - aConstraints.gridy += 1; |
---|
1675 | | - aConstraints.gridwidth = 1; |
---|
1676 | 1594 | |
---|
1677 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1678 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1679 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1680 | | - aConstraints.gridx += 1; |
---|
1681 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1682 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1683 | | - aConstraints.gridx = 0; |
---|
1684 | | - aConstraints.gridy += 1; |
---|
1685 | | - aConstraints.gridwidth = 1; |
---|
| 1595 | + panel.add(new JSeparator()); |
---|
| 1596 | + |
---|
| 1597 | + panel.add(specularSection); |
---|
| 1598 | + |
---|
| 1599 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1600 | + |
---|
| 1601 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1686 | 1602 | |
---|
1687 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1688 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1689 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1690 | | - aConstraints.gridx += 1; |
---|
1691 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1692 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1693 | | - aConstraints.gridx = 0; |
---|
1694 | | - aConstraints.gridy += 1; |
---|
1695 | | - aConstraints.gridwidth = 1; |
---|
| 1603 | + cGridBag camera = new cGridBag(); |
---|
| 1604 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1605 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1606 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1607 | + globalSection.add(camera); |
---|
1696 | 1608 | |
---|
1697 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1698 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1699 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1700 | | - aConstraints.gridx += 1; |
---|
1701 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1702 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1703 | | - aConstraints.gridx = 0; |
---|
1704 | | - aConstraints.gridy += 1; |
---|
1705 | | - aConstraints.gridwidth = 1; |
---|
| 1609 | + cGridBag ambient = new cGridBag(); |
---|
| 1610 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1611 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1612 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1613 | + globalSection.add(ambient); |
---|
1706 | 1614 | |
---|
1707 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1708 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1709 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1710 | | - aConstraints.gridx += 1; |
---|
1711 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1712 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); |
---|
1713 | | - aConstraints.gridx = 0; |
---|
1714 | | - aConstraints.gridy += 1; |
---|
1715 | | - aConstraints.gridwidth = 1; |
---|
1716 | | - aConstraints.weighty = 0; |
---|
| 1615 | + cGridBag backlit = new cGridBag(); |
---|
| 1616 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1617 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1618 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1619 | + globalSection.add(backlit); |
---|
1717 | 1620 | |
---|
1718 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1719 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1720 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1721 | | - aConstraints.gridx += 1; |
---|
1722 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1723 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1724 | | - aConstraints.gridx = 0; |
---|
1725 | | - aConstraints.gridy += 1; |
---|
1726 | | - aConstraints.gridwidth = 1; |
---|
| 1621 | + cGridBag opacity = new cGridBag(); |
---|
| 1622 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1623 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1624 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1625 | + globalSection.add(opacity); |
---|
1727 | 1626 | |
---|
1728 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1729 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1730 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1731 | | - aConstraints.gridx += 1; |
---|
1732 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1733 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1734 | | - aConstraints.gridx = 0; |
---|
1735 | | - aConstraints.gridy += 1; |
---|
1736 | | - aConstraints.gridwidth = 1; |
---|
| 1627 | + panel.add(new JSeparator()); |
---|
| 1628 | + |
---|
| 1629 | + panel.add(globalSection); |
---|
| 1630 | + |
---|
| 1631 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1632 | + |
---|
| 1633 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1737 | 1634 | |
---|
1738 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1739 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1740 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1741 | | - aConstraints.gridx += 1; |
---|
1742 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1743 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1744 | | - aConstraints.gridx = 0; |
---|
1745 | | - aConstraints.gridy += 1; |
---|
1746 | | - aConstraints.gridwidth = 1; |
---|
| 1635 | + cGridBag bump = new cGridBag(); |
---|
| 1636 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1637 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1638 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1639 | + textureSection.add(bump); |
---|
1747 | 1640 | |
---|
1748 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1749 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1750 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1751 | | - aConstraints.gridx += 1; |
---|
1752 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1753 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1754 | | - aConstraints.gridx = 0; |
---|
1755 | | - aConstraints.gridy += 1; |
---|
1756 | | - aConstraints.gridwidth = 1; |
---|
| 1641 | + cGridBag noise = new cGridBag(); |
---|
| 1642 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1643 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1644 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1645 | + textureSection.add(noise); |
---|
1757 | 1646 | |
---|
1758 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1759 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1760 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1761 | | - aConstraints.gridx += 1; |
---|
1762 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1763 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1764 | | - aConstraints.gridx = 0; |
---|
1765 | | - aConstraints.gridy += 1; |
---|
1766 | | - aConstraints.gridwidth = 1; |
---|
| 1647 | + cGridBag power = new cGridBag(); |
---|
| 1648 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1649 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1650 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1651 | + textureSection.add(power); |
---|
1767 | 1652 | |
---|
1768 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1769 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1770 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1771 | | - aConstraints.gridx += 1; |
---|
1772 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1773 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1774 | | - aConstraints.gridx = 0; |
---|
1775 | | - aConstraints.gridy += 1; |
---|
1776 | | - aConstraints.gridwidth = 1; |
---|
| 1653 | + cGridBag borderfade = new cGridBag(); |
---|
| 1654 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1655 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1656 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1657 | + textureSection.add(borderfade); |
---|
1777 | 1658 | |
---|
1778 | | - //aConstraints.weighty = 1; |
---|
1779 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1780 | | - //aConstraints.gridx += 1; |
---|
1781 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1782 | | - aConstraints.weighty = 0; |
---|
| 1659 | + cGridBag fog = new cGridBag(); |
---|
| 1660 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1661 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1662 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1663 | + textureSection.add(fog); |
---|
1783 | 1664 | |
---|
1784 | | - aConstraints.gridx = 0; |
---|
1785 | | - aConstraints.gridy = 0; |
---|
1786 | | - aConstraints.gridwidth = 1; |
---|
| 1665 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1666 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1667 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1668 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1669 | + textureSection.add(opacityPower); |
---|
| 1670 | + |
---|
| 1671 | + panel.add(new JSeparator()); |
---|
| 1672 | + |
---|
| 1673 | + panel.add(textureSection); |
---|
| 1674 | + |
---|
| 1675 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1787 | 1676 | |
---|
1788 | 1677 | SetMaterial(copy); // .GetMaterial()); |
---|
1789 | 1678 | |
---|
1790 | | - colorField.addChangeListener(this); |
---|
1791 | | - modulationField.addChangeListener(this); |
---|
| 1679 | + //colorField.addChangeListener(this); |
---|
| 1680 | +// modulationField.addChangeListener(this); |
---|
1792 | 1681 | metalnessField.addChangeListener(this); |
---|
1793 | 1682 | diffuseField.addChangeListener(this); |
---|
1794 | 1683 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1818 | 1707 | opacityPowerField.addChangeListener(this); |
---|
1819 | 1708 | /**/ |
---|
1820 | 1709 | |
---|
1821 | | - resetSlidersButton.addActionListener(this); |
---|
1822 | 1710 | clearMaterialButton.addActionListener(this); |
---|
1823 | 1711 | createMaterialButton.addActionListener(this); |
---|
1824 | | - |
---|
1825 | | - propagateToggle.addItemListener(this); |
---|
1826 | | - multiplyToggle.addItemListener(this); |
---|
| 1712 | + |
---|
| 1713 | + if (Globals.ADVANCED) |
---|
| 1714 | + { |
---|
| 1715 | + resetSlidersButton.addActionListener(this); |
---|
| 1716 | + propagateToggle.addItemListener(this); |
---|
| 1717 | + multiplyToggle.addItemListener(this); |
---|
| 1718 | + } |
---|
1827 | 1719 | } |
---|
1828 | 1720 | |
---|
1829 | 1721 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1994 | 1886 | |
---|
1995 | 1887 | //? flashIt = false; |
---|
1996 | 1888 | CameraPane pane = (CameraPane) cameraView; |
---|
1997 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 1889 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1998 | 1890 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1999 | 1891 | |
---|
2000 | 1892 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2043 | 1935 | e2.printStackTrace(); |
---|
2044 | 1936 | } |
---|
2045 | 1937 | } |
---|
| 1938 | + |
---|
2046 | 1939 | LoadJMEThread loadThread; |
---|
2047 | 1940 | |
---|
2048 | 1941 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2100 | 1993 | //LoadFile0(filename, converter); |
---|
2101 | 1994 | } |
---|
2102 | 1995 | } |
---|
| 1996 | + |
---|
2103 | 1997 | LoadOBJThread loadObjThread; |
---|
2104 | 1998 | |
---|
2105 | 1999 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2451 | 2345 | |
---|
2452 | 2346 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2453 | 2347 | { |
---|
2454 | | - if (GrafreeD.standAlone) |
---|
| 2348 | + if (Grafreed.standAlone) |
---|
2455 | 2349 | { |
---|
2456 | 2350 | /**/ |
---|
2457 | 2351 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2458 | | - browser.show(); |
---|
| 2352 | + browser.setVisible(true); |
---|
2459 | 2353 | String filename = browser.getFile(); |
---|
2460 | 2354 | if (filename != null && filename.length() > 0) |
---|
2461 | 2355 | { |
---|
.. | .. |
---|
2600 | 2494 | } |
---|
2601 | 2495 | if (input == null) |
---|
2602 | 2496 | { |
---|
| 2497 | + new Exception().printStackTrace(); |
---|
2603 | 2498 | System.exit(0); |
---|
2604 | 2499 | } |
---|
2605 | 2500 | |
---|
.. | .. |
---|
2814 | 2709 | return; |
---|
2815 | 2710 | } |
---|
2816 | 2711 | |
---|
2817 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2712 | + if (multiplyToggle != null) |
---|
| 2713 | + multiplyToggle.setSelected(mat.multiply); |
---|
2818 | 2714 | |
---|
2819 | 2715 | assert (object.projectedVertices != null); |
---|
2820 | 2716 | |
---|
.. | .. |
---|
3029 | 2925 | frame.validate(); |
---|
3030 | 2926 | |
---|
3031 | 2927 | return; |
---|
3032 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 2928 | + } else if (event.getSource() == toggleSwitchItem) |
---|
3033 | 2929 | { |
---|
3034 | 2930 | cameraView.ToggleRandom(); |
---|
3035 | 2931 | cameraView.repaint(); |
---|
.. | .. |
---|
3060 | 2956 | { |
---|
3061 | 2957 | copy.live ^= true; |
---|
3062 | 2958 | return; |
---|
| 2959 | + } else if (event.getSource() == selectCB) |
---|
| 2960 | + { |
---|
| 2961 | + copy.dontselect ^= true; |
---|
| 2962 | + return; |
---|
3063 | 2963 | } else if (event.getSource() == hideCB) |
---|
3064 | 2964 | { |
---|
3065 | 2965 | copy.hide ^= true; |
---|
.. | .. |
---|
3074 | 2974 | if (event.getSource() == randomCB) |
---|
3075 | 2975 | { |
---|
3076 | 2976 | copy.random ^= true; |
---|
| 2977 | + objEditor.refreshContents(); |
---|
3077 | 2978 | return; |
---|
3078 | 2979 | } |
---|
3079 | 2980 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3097 | 2998 | |
---|
3098 | 2999 | public void actionPerformed(ActionEvent event) |
---|
3099 | 3000 | { |
---|
| 3001 | + Object source = event.getSource(); |
---|
3100 | 3002 | // SCRIPT DIALOG |
---|
3101 | | - if (event.getSource() == okbutton) |
---|
| 3003 | + if (source == okbutton) |
---|
3102 | 3004 | { |
---|
3103 | 3005 | textpanel.setVisible(false); |
---|
3104 | 3006 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3110 | 3012 | textarea = null; |
---|
3111 | 3013 | textpanel = null; |
---|
3112 | 3014 | } |
---|
3113 | | - if (event.getSource() == cancelbutton) |
---|
| 3015 | + if (source == cancelbutton) |
---|
3114 | 3016 | { |
---|
3115 | 3017 | textpanel.setVisible(false); |
---|
3116 | 3018 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3122 | 3024 | //applySelf(); |
---|
3123 | 3025 | //client.refreshEditWindow(); |
---|
3124 | 3026 | //refreshContents(); |
---|
3125 | | - if (event.getSource() == nameField) |
---|
| 3027 | + if (source == nameField) |
---|
3126 | 3028 | { |
---|
3127 | 3029 | //System.out.println("ObjEditor " + event); |
---|
3128 | 3030 | applySelf0(true); |
---|
3129 | 3031 | //parent.applySelf(); |
---|
3130 | 3032 | objEditor.refreshContents(); |
---|
3131 | | - } else if (event.getSource() == resetButton) |
---|
| 3033 | + } else if (source == resetButton) |
---|
3132 | 3034 | { |
---|
3133 | 3035 | CameraPane.fullreset = true; |
---|
3134 | 3036 | copy.Reset(); // ResetMeshes(); |
---|
3135 | 3037 | copy.Touch(); |
---|
3136 | 3038 | objEditor.refreshContents(); |
---|
3137 | | - } else if (event.getSource() == stepItem) |
---|
| 3039 | + } else if (source == stepItem) |
---|
3138 | 3040 | { |
---|
3139 | | - cameraView.ONESTEP = true; |
---|
| 3041 | + //cameraView.ONESTEP = true; |
---|
| 3042 | + Globals.ONESTEP = true; |
---|
3140 | 3043 | cameraView.repaint(); |
---|
3141 | 3044 | return; |
---|
3142 | | - } else if (event.getSource() == stepButton) |
---|
| 3045 | + } else if (source == stepButton) |
---|
3143 | 3046 | { |
---|
3144 | 3047 | copy.Step(); |
---|
3145 | 3048 | copy.Touch(); |
---|
3146 | 3049 | objEditor.refreshContents(); |
---|
3147 | | - } else if (event.getSource() == slowerButton) |
---|
| 3050 | + } else if (source == slowerButton) |
---|
3148 | 3051 | { |
---|
3149 | 3052 | copy.Slower(); |
---|
3150 | 3053 | copy.Touch(); |
---|
3151 | 3054 | objEditor.refreshContents(); |
---|
3152 | | - } else if (event.getSource() == fasterButton) |
---|
| 3055 | + } else if (source == fasterButton) |
---|
3153 | 3056 | { |
---|
3154 | 3057 | copy.Faster(); |
---|
3155 | 3058 | copy.Touch(); |
---|
3156 | 3059 | objEditor.refreshContents(); |
---|
3157 | | - } else if (event.getSource() == remarkButton) |
---|
| 3060 | + } else if (source == remarkButton) |
---|
3158 | 3061 | { |
---|
3159 | 3062 | copy.Remark(); |
---|
3160 | 3063 | copy.Touch(); |
---|
3161 | 3064 | objEditor.refreshContents(); |
---|
3162 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3065 | + } else if (source == stepAllButton) |
---|
3163 | 3066 | { |
---|
3164 | 3067 | copy.StepAll(); |
---|
3165 | 3068 | copy.Touch(); |
---|
3166 | 3069 | objEditor.refreshContents(); |
---|
3167 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3070 | + } else if (source == resetAllButton) |
---|
3168 | 3071 | { |
---|
3169 | 3072 | //CameraPane.fullreset = true; |
---|
3170 | 3073 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3197 | 3100 | // Close(); |
---|
3198 | 3101 | // } |
---|
3199 | 3102 | // else |
---|
3200 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3103 | + if (source == resetSlidersButton) |
---|
3201 | 3104 | { |
---|
3202 | 3105 | ResetSliders(); |
---|
3203 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3106 | + } else if (source == clearMaterialButton) |
---|
3204 | 3107 | { |
---|
3205 | 3108 | ClearMaterial(); |
---|
3206 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3109 | + } else if (source == createMaterialButton) |
---|
3207 | 3110 | { |
---|
3208 | 3111 | CreateMaterial(); |
---|
3209 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3112 | + } else if (source == clearPanelButton) |
---|
3210 | 3113 | { |
---|
3211 | 3114 | copy.ClearUI(); |
---|
3212 | 3115 | refreshContents(true); |
---|
3213 | | - } /* |
---|
3214 | | - } |
---|
3215 | | - |
---|
3216 | | - public boolean action(Event event, Object arg) |
---|
3217 | | - { |
---|
3218 | | - */ else if (event.getSource() == closeItem) |
---|
| 3116 | + } else if (source == importGFDItem) |
---|
| 3117 | + { |
---|
| 3118 | + ImportGFD(); |
---|
| 3119 | + } else |
---|
| 3120 | + if (source == importVRMLX3DItem) |
---|
| 3121 | + { |
---|
| 3122 | + ImportVRMLX3D(); |
---|
| 3123 | + } else |
---|
| 3124 | + if (source == import3DSItem) |
---|
| 3125 | + { |
---|
| 3126 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3127 | + } else |
---|
| 3128 | + if (source == importOBJItem) |
---|
| 3129 | + { |
---|
| 3130 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3131 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3132 | + browser.setVisible(true); |
---|
| 3133 | + String filename = browser.getFile(); |
---|
| 3134 | + if (filename != null && filename.length() > 0) |
---|
| 3135 | + { |
---|
| 3136 | + String fullname = browser.getDirectory() + filename; |
---|
| 3137 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3138 | + } |
---|
| 3139 | + } else |
---|
| 3140 | + if (source == closeItem) |
---|
3219 | 3141 | { |
---|
3220 | 3142 | Close(); |
---|
3221 | 3143 | //return true; |
---|
3222 | | - } else if (event.getSource() == loadItem) |
---|
| 3144 | + } else if (source == loadItem) |
---|
3223 | 3145 | { |
---|
3224 | 3146 | load(); |
---|
3225 | 3147 | //return true; |
---|
3226 | | - } else if (event.getSource() == saveItem) |
---|
| 3148 | + } else if (source == newItem) |
---|
| 3149 | + { |
---|
| 3150 | + New(); |
---|
| 3151 | + } else if (source == saveItem) |
---|
3227 | 3152 | { |
---|
3228 | 3153 | save(); |
---|
3229 | 3154 | //return true; |
---|
3230 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3155 | + } else if (source == saveAsItem) |
---|
3231 | 3156 | { |
---|
3232 | 3157 | saveAs(); |
---|
3233 | 3158 | //return true; |
---|
3234 | | - } else if (event.getSource() == reexportItem) |
---|
| 3159 | + } else if (source == reexportItem) |
---|
3235 | 3160 | { |
---|
3236 | 3161 | reexport(); |
---|
3237 | 3162 | //return true; |
---|
3238 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3163 | + } else if (source == exportAsItem) |
---|
3239 | 3164 | { |
---|
3240 | 3165 | export(); |
---|
3241 | 3166 | //return true; |
---|
3242 | | - } else if (event.getSource() == povItem) |
---|
| 3167 | + } else if (source == povItem) |
---|
3243 | 3168 | { |
---|
3244 | 3169 | generatePOV(); |
---|
3245 | 3170 | //return true; |
---|
3246 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3171 | + } else if (source == zBufferItem) |
---|
3247 | 3172 | { |
---|
3248 | 3173 | try |
---|
3249 | 3174 | { |
---|
.. | .. |
---|
3265 | 3190 | cameraView.repaint(); |
---|
3266 | 3191 | //return true; |
---|
3267 | 3192 | } |
---|
3268 | | - */ else if (event.getSource() == editCameraItem) |
---|
3269 | | - { |
---|
3270 | | - cameraView.ProtectCamera(); |
---|
3271 | | - cameraView.repaint(); |
---|
3272 | | - return; |
---|
3273 | | - } else if (event.getSource() == revertCameraItem) |
---|
3274 | | - { |
---|
3275 | | - cameraView.RevertCamera(); |
---|
3276 | | - cameraView.repaint(); |
---|
3277 | | - return; |
---|
3278 | | -// } else if (event.getSource() == textureButton) |
---|
3279 | | -// { |
---|
3280 | | -// return; // true; |
---|
3281 | | - } else // combos... |
---|
3282 | | - if (event.getSource() == texresMenu) |
---|
| 3193 | + */ else // combos... |
---|
| 3194 | + if (source == texresMenu) |
---|
3283 | 3195 | { |
---|
3284 | 3196 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3285 | 3197 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3291 | 3203 | } |
---|
3292 | 3204 | } |
---|
3293 | 3205 | |
---|
3294 | | - void ToggleAnimation() |
---|
| 3206 | + void New() |
---|
3295 | 3207 | { |
---|
3296 | | - if (!CameraPane.ANIMATION) |
---|
| 3208 | + while (copy.Size() > 1) |
---|
3297 | 3209 | { |
---|
3298 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3210 | + copy.remove(1); |
---|
| 3211 | + } |
---|
| 3212 | + |
---|
| 3213 | + ResetModel(); |
---|
| 3214 | + objEditor.refreshContents(); |
---|
| 3215 | + } |
---|
| 3216 | + |
---|
| 3217 | + static public Object clone(Object o) |
---|
| 3218 | + { |
---|
| 3219 | + try |
---|
| 3220 | + { |
---|
| 3221 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3222 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3223 | + |
---|
| 3224 | + out.writeObject(o); |
---|
| 3225 | + |
---|
| 3226 | + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); |
---|
| 3227 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3228 | + Object obj = in.readObject(); |
---|
| 3229 | + in.close(); |
---|
| 3230 | + out.close(); |
---|
| 3231 | + return obj; |
---|
| 3232 | + } catch (Exception e) |
---|
| 3233 | + { |
---|
| 3234 | + System.err.println(e); |
---|
| 3235 | + return null; |
---|
| 3236 | + } |
---|
| 3237 | + } |
---|
| 3238 | + |
---|
| 3239 | + cRadio GetCurrentTab() |
---|
| 3240 | + { |
---|
| 3241 | + cRadio ab; |
---|
| 3242 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3243 | + { |
---|
| 3244 | + ab = (cRadio)e.nextElement(); |
---|
| 3245 | + if(ab.GetObject() == client) |
---|
| 3246 | + { |
---|
| 3247 | + return ab; |
---|
| 3248 | + } |
---|
| 3249 | + } |
---|
| 3250 | + |
---|
| 3251 | + return null; |
---|
| 3252 | + } |
---|
| 3253 | + |
---|
| 3254 | + public void Save() |
---|
| 3255 | + { |
---|
| 3256 | + cRadio tab = GetCurrentTab(); |
---|
| 3257 | + |
---|
| 3258 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3259 | + tab.graphs[tab.undoindex++] = (Object3D)clone(copy); |
---|
| 3260 | + |
---|
| 3261 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3262 | + { |
---|
| 3263 | + tab.graphs[i] = null; |
---|
| 3264 | + } |
---|
| 3265 | + |
---|
| 3266 | + // test save |
---|
| 3267 | + if (false) |
---|
| 3268 | + { |
---|
| 3269 | + try |
---|
| 3270 | + { |
---|
| 3271 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3272 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3273 | + |
---|
| 3274 | + p.writeObject(copy); |
---|
| 3275 | + |
---|
| 3276 | + p.flush(); |
---|
| 3277 | + |
---|
| 3278 | + ostream.close(); |
---|
| 3279 | + } catch (Exception e) |
---|
| 3280 | + { |
---|
| 3281 | + e.printStackTrace(); |
---|
| 3282 | + } |
---|
| 3283 | + } |
---|
| 3284 | + } |
---|
| 3285 | + |
---|
| 3286 | + void CopyChanged(Object3D obj) |
---|
| 3287 | + { |
---|
| 3288 | + copy.clear(); |
---|
| 3289 | + |
---|
| 3290 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3291 | + { |
---|
| 3292 | + copy.add(obj.get(i)); |
---|
| 3293 | + } |
---|
| 3294 | + |
---|
| 3295 | + copy.Touch(); |
---|
| 3296 | + |
---|
| 3297 | + ResetModel(); |
---|
| 3298 | + copy.HardTouch(); // recompile? |
---|
| 3299 | + |
---|
| 3300 | + cRadio ab; |
---|
| 3301 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3302 | + { |
---|
| 3303 | + ab = (cRadio)e.nextElement(); |
---|
| 3304 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3305 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3306 | + if (test != null) |
---|
| 3307 | + { |
---|
| 3308 | + test.editWindow = ab.object.editWindow; |
---|
| 3309 | + ab.object = test; |
---|
| 3310 | + } |
---|
| 3311 | + } |
---|
| 3312 | + |
---|
| 3313 | + refreshContents(); |
---|
| 3314 | + } |
---|
| 3315 | + |
---|
| 3316 | + public void Undo() |
---|
| 3317 | + { |
---|
| 3318 | + cRadio tab = GetCurrentTab(); |
---|
| 3319 | + |
---|
| 3320 | + if (tab.undoindex == 0) |
---|
| 3321 | + { |
---|
| 3322 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3323 | + return; |
---|
| 3324 | + } |
---|
| 3325 | + |
---|
| 3326 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3327 | + { |
---|
| 3328 | + Save(); |
---|
| 3329 | + tab.undoindex -= 1; |
---|
| 3330 | + } |
---|
| 3331 | + |
---|
| 3332 | + tab.undoindex -= 1; |
---|
| 3333 | + |
---|
| 3334 | + CopyChanged(tab.graphs[tab.undoindex]); |
---|
| 3335 | + } |
---|
| 3336 | + |
---|
| 3337 | + public void Redo() |
---|
| 3338 | + { |
---|
| 3339 | + cRadio tab = GetCurrentTab(); |
---|
| 3340 | + |
---|
| 3341 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3342 | + { |
---|
| 3343 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3344 | + return; |
---|
| 3345 | + } |
---|
| 3346 | + |
---|
| 3347 | + tab.undoindex += 1; |
---|
| 3348 | + |
---|
| 3349 | + CopyChanged(tab.graphs[tab.undoindex]); |
---|
| 3350 | + } |
---|
| 3351 | + |
---|
| 3352 | + void ImportGFD() |
---|
| 3353 | + { |
---|
| 3354 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3299 | 3355 | browser.show(); |
---|
3300 | 3356 | String filename = browser.getFile(); |
---|
3301 | 3357 | if (filename != null && filename.length() > 0) |
---|
3302 | 3358 | { |
---|
3303 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3359 | + String fullname = browser.getDirectory() + filename; |
---|
| 3360 | + |
---|
| 3361 | + //Object3D readobj = |
---|
| 3362 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3363 | + //makeSomething(readobj); |
---|
| 3364 | + } |
---|
| 3365 | + } |
---|
| 3366 | + |
---|
| 3367 | + void ImportVRMLX3D() |
---|
| 3368 | + { |
---|
| 3369 | + if (Grafreed.standAlone) |
---|
| 3370 | + { |
---|
| 3371 | + /**/ |
---|
| 3372 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3373 | + browser.show(); |
---|
| 3374 | + String filename = browser.getFile(); |
---|
| 3375 | + if (filename != null && filename.length() > 0) |
---|
| 3376 | + { |
---|
| 3377 | + String fullname = browser.getDirectory() + filename; |
---|
| 3378 | + LoadVRMLX3D(fullname); |
---|
| 3379 | + } |
---|
| 3380 | + /**/ |
---|
| 3381 | + } |
---|
| 3382 | + } |
---|
| 3383 | + |
---|
| 3384 | + void ToggleAnimation() |
---|
| 3385 | + { |
---|
| 3386 | + if (!Globals.ANIMATION) |
---|
| 3387 | + { |
---|
| 3388 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3389 | + browser.setVisible(true); |
---|
| 3390 | + String filename = browser.getFile(); |
---|
| 3391 | + if (filename != null && filename.length() > 0) |
---|
| 3392 | + { |
---|
| 3393 | + Globals.filename = browser.getDirectory() + filename; |
---|
3304 | 3394 | //CameraPane.framecount = 0; |
---|
3305 | | - CameraPane.imagecount = 0; |
---|
| 3395 | + Globals.imagecount = 0; |
---|
3306 | 3396 | |
---|
3307 | | - CameraPane.ANIMATION ^= true; |
---|
| 3397 | + Globals.ANIMATION ^= true; |
---|
3308 | 3398 | |
---|
3309 | | - GrafreeD.wav.cursor = 0; |
---|
3310 | | - GrafreeD.wav.loop = 0; |
---|
| 3399 | + Grafreed.wav.cursor = 0; |
---|
| 3400 | + Grafreed.wav.loop = 0; |
---|
3311 | 3401 | } |
---|
3312 | 3402 | } else |
---|
3313 | 3403 | { |
---|
3314 | | - CameraPane.ANIMATION ^= true; |
---|
| 3404 | + Globals.ANIMATION ^= true; |
---|
3315 | 3405 | } |
---|
3316 | 3406 | } |
---|
3317 | 3407 | |
---|
.. | .. |
---|
3357 | 3447 | void CreateMaterial() |
---|
3358 | 3448 | { |
---|
3359 | 3449 | //copy.ClearMaterial(); // PATCH |
---|
3360 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3450 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3361 | 3451 | if (copy.selection.size() > 0) |
---|
3362 | 3452 | //SetMaterial(copy); |
---|
3363 | 3453 | { |
---|
.. | .. |
---|
3416 | 3506 | { |
---|
3417 | 3507 | copy.ResetBlockLoop(); // temporary problem |
---|
3418 | 3508 | |
---|
3419 | | - boolean random = CameraPane.RANDOM; |
---|
3420 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3509 | + boolean random = CameraPane.SWITCH; |
---|
| 3510 | + CameraPane.SWITCH = false; // parse everything |
---|
3421 | 3511 | copy.ResetDisplayList(); |
---|
3422 | 3512 | copy.HardTouch(); |
---|
3423 | | - CameraPane.RANDOM = random; |
---|
| 3513 | + CameraPane.SWITCH = random; |
---|
3424 | 3514 | } |
---|
3425 | 3515 | |
---|
3426 | 3516 | // public void applySelf() |
---|
.. | .. |
---|
3490 | 3580 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3491 | 3581 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3492 | 3582 | |
---|
3493 | | - if (!NumberSlider.frozen) |
---|
| 3583 | + if (!cNumberSlider.frozen) |
---|
3494 | 3584 | { |
---|
3495 | 3585 | //System.out.println("Propagate = " + propagate); |
---|
3496 | 3586 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3587 | + |
---|
| 3588 | + if (copy.material != null) |
---|
| 3589 | + { |
---|
| 3590 | + cMaterial mat = copy.material; |
---|
| 3591 | + |
---|
| 3592 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3593 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3594 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3595 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3596 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3597 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3598 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3599 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3600 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3601 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3602 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3603 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3604 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3605 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3606 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3607 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3608 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3609 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3610 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3611 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3612 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3613 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3614 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3615 | + } |
---|
| 3616 | + |
---|
3497 | 3617 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3498 | 3618 | { |
---|
3499 | 3619 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3538 | 3658 | || e.getSource() == apertureField |
---|
3539 | 3659 | || e.getSource() == shadowblurField) |
---|
3540 | 3660 | { |
---|
| 3661 | + new Exception().printStackTrace(); |
---|
3541 | 3662 | System.exit(0); |
---|
3542 | 3663 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3543 | 3664 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3608 | 3729 | } |
---|
3609 | 3730 | |
---|
3610 | 3731 | if (normalpushField != null) |
---|
3611 | | - copy.NORMALPUSH = (float)normalpushField.getFloat()/1000; |
---|
| 3732 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3612 | 3733 | } |
---|
3613 | 3734 | |
---|
3614 | 3735 | void SnapObject() |
---|
.. | .. |
---|
3863 | 3984 | |
---|
3864 | 3985 | radioPanel.revalidate(); |
---|
3865 | 3986 | radioPanel.repaint(); |
---|
3866 | | - ctrlPanel.revalidate(); // ? new |
---|
| 3987 | + ctrlPanel.validate(); // ? new |
---|
3867 | 3988 | ctrlPanel.repaint(); |
---|
3868 | 3989 | } |
---|
3869 | 3990 | } |
---|
.. | .. |
---|
3872 | 3993 | |
---|
3873 | 3994 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3874 | 3995 | { |
---|
| 3996 | + Save(); |
---|
3875 | 3997 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3876 | 3998 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3877 | 3999 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4075 | 4197 | } |
---|
4076 | 4198 | } |
---|
4077 | 4199 | } |
---|
| 4200 | + |
---|
4078 | 4201 | LoadGFDThread loadGFDThread; |
---|
4079 | 4202 | |
---|
4080 | 4203 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4095 | 4218 | try |
---|
4096 | 4219 | { |
---|
4097 | 4220 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4098 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4221 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4222 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4099 | 4223 | |
---|
4100 | 4224 | readobj = (Object3D) p.readObject(); |
---|
4101 | 4225 | istream.close(); |
---|
.. | .. |
---|
4103 | 4227 | readobj.ResetDisplayList(); |
---|
4104 | 4228 | } catch (Exception e) |
---|
4105 | 4229 | { |
---|
4106 | | - e.printStackTrace(); |
---|
| 4230 | + //e.printStackTrace(); |
---|
| 4231 | + try |
---|
| 4232 | + { |
---|
| 4233 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4234 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4235 | + |
---|
| 4236 | + readobj = (Object3D) p.readObject(); |
---|
| 4237 | + istream.close(); |
---|
| 4238 | + |
---|
| 4239 | + readobj.ResetDisplayList(); |
---|
| 4240 | + } catch (Exception e2) |
---|
| 4241 | + { |
---|
| 4242 | + e2.printStackTrace(); |
---|
| 4243 | + } |
---|
4107 | 4244 | } |
---|
4108 | 4245 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4109 | 4246 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4220 | 4357 | |
---|
4221 | 4358 | void load() // throws ClassNotFoundException |
---|
4222 | 4359 | { |
---|
4223 | | - if (GrafreeD.standAlone) |
---|
| 4360 | + if (Grafreed.standAlone) |
---|
4224 | 4361 | { |
---|
4225 | 4362 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4226 | 4363 | browser.show(); |
---|
.. | .. |
---|
4307 | 4444 | try |
---|
4308 | 4445 | { |
---|
4309 | 4446 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4310 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4447 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4448 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4311 | 4449 | |
---|
4312 | 4450 | p.writeObject(copy); |
---|
4313 | 4451 | p.flush(); |
---|
4314 | 4452 | |
---|
| 4453 | + zstream.close(); |
---|
4315 | 4454 | ostream.close(); |
---|
4316 | 4455 | |
---|
4317 | 4456 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4321 | 4460 | { |
---|
4322 | 4461 | } |
---|
4323 | 4462 | } |
---|
| 4463 | + |
---|
4324 | 4464 | String lastname; |
---|
4325 | 4465 | |
---|
4326 | 4466 | void saveAs() |
---|
4327 | 4467 | { |
---|
4328 | | - if (GrafreeD.standAlone) |
---|
| 4468 | + if (Grafreed.standAlone) |
---|
4329 | 4469 | { |
---|
4330 | 4470 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4331 | 4471 | browser.setVisible(true); |
---|
.. | .. |
---|
4430 | 4570 | try |
---|
4431 | 4571 | { |
---|
4432 | 4572 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4433 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4434 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4573 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4574 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4435 | 4575 | |
---|
4436 | 4576 | Object3D objectparent = obj.parent; |
---|
4437 | 4577 | obj.parent = null; |
---|
4438 | 4578 | |
---|
4439 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4579 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4440 | 4580 | |
---|
4441 | 4581 | obj.parent = objectparent; |
---|
4442 | 4582 | |
---|
.. | .. |
---|
4448 | 4588 | p.writeObject(object); |
---|
4449 | 4589 | p.flush(); |
---|
4450 | 4590 | |
---|
| 4591 | + zstream.close(); |
---|
4451 | 4592 | ostream.close(); |
---|
4452 | | - // zstream.close(); |
---|
4453 | 4593 | |
---|
4454 | 4594 | // group.selection.get(0).parent = parent; |
---|
4455 | 4595 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4470 | 4610 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4471 | 4611 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4472 | 4612 | copy.generatePOV(buffer); |
---|
4473 | | - if (GrafreeD.standAlone) |
---|
| 4613 | + if (Grafreed.standAlone) |
---|
4474 | 4614 | { |
---|
4475 | 4615 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4476 | 4616 | browser.show(); |
---|
.. | .. |
---|
4496 | 4636 | Object3D client; |
---|
4497 | 4637 | Object3D copy; |
---|
4498 | 4638 | MenuBar menuBar; |
---|
4499 | | - Menu windowMenu; |
---|
| 4639 | + Menu fileMenu; |
---|
| 4640 | + MenuItem newItem; |
---|
4500 | 4641 | MenuItem loadItem; |
---|
4501 | 4642 | MenuItem saveItem; |
---|
4502 | 4643 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4504 | 4645 | MenuItem reexportItem; |
---|
4505 | 4646 | MenuItem povItem; |
---|
4506 | 4647 | MenuItem closeItem; |
---|
4507 | | - Menu cameraMenu; |
---|
| 4648 | + |
---|
4508 | 4649 | CheckboxMenuItem zBufferItem; |
---|
4509 | 4650 | //MenuItem normalLensItem; |
---|
4510 | | - MenuItem editCameraItem; |
---|
4511 | | - MenuItem revertCameraItem; |
---|
4512 | | - CheckboxMenuItem toggleLiveItem; |
---|
4513 | 4651 | MenuItem stepItem; |
---|
| 4652 | + CheckboxMenuItem toggleLiveItem; |
---|
4514 | 4653 | CheckboxMenuItem toggleFullScreenItem; |
---|
4515 | 4654 | CheckboxMenuItem toggleTimelineItem; |
---|
4516 | 4655 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4519 | 4658 | CheckboxMenuItem toggleFootContactItem; |
---|
4520 | 4659 | CheckboxMenuItem toggleDLItem; |
---|
4521 | 4660 | CheckboxMenuItem toggleTextureItem; |
---|
4522 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4661 | + CheckboxMenuItem toggleSwitchItem; |
---|
4523 | 4662 | CheckboxMenuItem toggleRootItem; |
---|
4524 | 4663 | CheckboxMenuItem animationItem; |
---|
4525 | 4664 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4527 | 4666 | JSplitPane mainPanel; |
---|
4528 | 4667 | JScrollPane scrollpane; |
---|
4529 | 4668 | JPanel toolbarPanel; |
---|
4530 | | - JPanel treePanel; |
---|
| 4669 | + cGridBag treePanel; |
---|
4531 | 4670 | JPanel radioPanel; |
---|
4532 | 4671 | ButtonGroup buttonGroup; |
---|
4533 | | - JPanel ctrlPanel; |
---|
4534 | | - JPanel materialPanel; |
---|
| 4672 | + cGridBag ctrlPanel; |
---|
| 4673 | + cGridBag materialPanel; |
---|
4535 | 4674 | JScrollPane infoPanel; |
---|
4536 | | - JPanel optionsPanel; |
---|
| 4675 | + cGridBag optionsPanel; |
---|
4537 | 4676 | JTabbedPane objectPanel; |
---|
4538 | | - JPanel XYZPanel; |
---|
| 4677 | + cGridBag XYZPanel; |
---|
4539 | 4678 | JSplitPane gridPanel; |
---|
4540 | 4679 | JSplitPane bigPanel; |
---|
4541 | | - JPanel bigThree; |
---|
4542 | | - JTabbedPane scenePanel; |
---|
4543 | | - JPanel centralPanel; |
---|
| 4680 | + cGridBag bigThree; |
---|
| 4681 | + cGridBag scenePanel; |
---|
| 4682 | + cGridBag centralPanel; |
---|
4544 | 4683 | JSplitPane cameraPanel; |
---|
4545 | 4684 | JPanel timelinePanel; |
---|
4546 | 4685 | JMenuBar timelineMenubar; |
---|
.. | .. |
---|
4593 | 4732 | // MATERIAL |
---|
4594 | 4733 | JLabel materialLabel; |
---|
4595 | 4734 | JLabel colorLabel; |
---|
4596 | | - NumberSlider colorField; |
---|
| 4735 | + cNumberSlider colorField; |
---|
4597 | 4736 | JLabel modulationLabel; |
---|
4598 | | - NumberSlider modulationField; |
---|
| 4737 | + cNumberSlider modulationField; |
---|
4599 | 4738 | JLabel metalnessLabel; |
---|
4600 | | - NumberSlider metalnessField; |
---|
| 4739 | + cNumberSlider metalnessField; |
---|
4601 | 4740 | JLabel diffuseLabel; |
---|
4602 | | - NumberSlider diffuseField; |
---|
| 4741 | + cNumberSlider diffuseField; |
---|
4603 | 4742 | JLabel specularLabel; |
---|
4604 | | - NumberSlider specularField; |
---|
| 4743 | + cNumberSlider specularField; |
---|
4605 | 4744 | JLabel shininessLabel; |
---|
4606 | | - NumberSlider shininessField; |
---|
| 4745 | + cNumberSlider shininessField; |
---|
4607 | 4746 | JLabel shiftLabel; |
---|
4608 | | - NumberSlider shiftField; |
---|
| 4747 | + cNumberSlider shiftField; |
---|
4609 | 4748 | JLabel ambientLabel; |
---|
4610 | | - NumberSlider ambientField; |
---|
| 4749 | + cNumberSlider ambientField; |
---|
4611 | 4750 | JLabel lightareaLabel; |
---|
4612 | | - NumberSlider lightareaField; |
---|
| 4751 | + cNumberSlider lightareaField; |
---|
4613 | 4752 | JLabel diffusenessLabel; |
---|
4614 | | - NumberSlider diffusenessField; |
---|
| 4753 | + cNumberSlider diffusenessField; |
---|
4615 | 4754 | JLabel velvetLabel; |
---|
4616 | | - NumberSlider velvetField; |
---|
| 4755 | + cNumberSlider velvetField; |
---|
4617 | 4756 | JLabel sheenLabel; |
---|
4618 | | - NumberSlider sheenField; |
---|
| 4757 | + cNumberSlider sheenField; |
---|
4619 | 4758 | JLabel subsurfaceLabel; |
---|
4620 | | - NumberSlider subsurfaceField; |
---|
| 4759 | + cNumberSlider subsurfaceField; |
---|
4621 | 4760 | //JLabel bumpLabel; |
---|
4622 | 4761 | //NumberSlider bumpField; |
---|
4623 | 4762 | JLabel backlitLabel; |
---|
4624 | | - NumberSlider backlitField; |
---|
| 4763 | + cNumberSlider backlitField; |
---|
4625 | 4764 | JLabel anisoLabel; |
---|
4626 | | - NumberSlider anisoField; |
---|
| 4765 | + cNumberSlider anisoField; |
---|
4627 | 4766 | JLabel anisoVLabel; |
---|
4628 | | - NumberSlider anisoVField; |
---|
| 4767 | + cNumberSlider anisoVField; |
---|
4629 | 4768 | JLabel cameraLabel; |
---|
4630 | | - NumberSlider cameraField; |
---|
| 4769 | + cNumberSlider cameraField; |
---|
4631 | 4770 | JLabel selfshadowLabel; |
---|
4632 | | - NumberSlider selfshadowField; |
---|
| 4771 | + cNumberSlider selfshadowField; |
---|
4633 | 4772 | JLabel shadowLabel; |
---|
4634 | | - NumberSlider shadowField; |
---|
| 4773 | + cNumberSlider shadowField; |
---|
4635 | 4774 | JLabel textureLabel; |
---|
4636 | | - NumberSlider textureField; |
---|
| 4775 | + cNumberSlider textureField; |
---|
4637 | 4776 | JLabel opacityLabel; |
---|
4638 | | - NumberSlider opacityField; |
---|
| 4777 | + cNumberSlider opacityField; |
---|
4639 | 4778 | JLabel fakedepthLabel; |
---|
4640 | | - NumberSlider fakedepthField; |
---|
| 4779 | + cNumberSlider fakedepthField; |
---|
4641 | 4780 | JLabel shadowbiasLabel; |
---|
4642 | | - NumberSlider shadowbiasField; |
---|
| 4781 | + cNumberSlider shadowbiasField; |
---|
4643 | 4782 | JLabel bumpLabel; |
---|
4644 | | - NumberSlider bumpField; |
---|
| 4783 | + cNumberSlider bumpField; |
---|
4645 | 4784 | JLabel noiseLabel; |
---|
4646 | | - NumberSlider noiseField; |
---|
| 4785 | + cNumberSlider noiseField; |
---|
4647 | 4786 | JLabel powerLabel; |
---|
4648 | | - NumberSlider powerField; |
---|
| 4787 | + cNumberSlider powerField; |
---|
4649 | 4788 | JLabel borderfadeLabel; |
---|
4650 | | - NumberSlider borderfadeField; |
---|
| 4789 | + cNumberSlider borderfadeField; |
---|
4651 | 4790 | JLabel fogLabel; |
---|
4652 | | - NumberSlider fogField; |
---|
| 4791 | + cNumberSlider fogField; |
---|
4653 | 4792 | JLabel opacityPowerLabel; |
---|
4654 | | - NumberSlider opacityPowerField; |
---|
| 4793 | + cNumberSlider opacityPowerField; |
---|
4655 | 4794 | JTree jTree; |
---|
4656 | 4795 | //ObjectUI parent; |
---|
4657 | 4796 | |
---|
4658 | | - NumberSlider normalpushField; |
---|
| 4797 | + cNumberSlider normalpushField; |
---|
| 4798 | + |
---|
| 4799 | + private MenuItem importGFDItem; |
---|
| 4800 | + private MenuItem importVRMLX3DItem; |
---|
| 4801 | + private MenuItem import3DSItem; |
---|
| 4802 | + private MenuItem importOBJItem; |
---|
4659 | 4803 | } |
---|