.. | .. |
---|
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); |
---|
| 169 | + |
---|
| 170 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 171 | + objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 172 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 173 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 174 | + |
---|
| 175 | + //Remove(normalpushField); |
---|
163 | 176 | } |
---|
164 | 177 | |
---|
165 | 178 | public ObjEditor GetEditor() |
---|
166 | 179 | { |
---|
167 | 180 | return objEditor; //.GetEditor(); |
---|
168 | 181 | } |
---|
| 182 | + |
---|
| 183 | + // Sometimes myself, sometimes my callee's. |
---|
169 | 184 | ObjEditor objEditor; |
---|
170 | 185 | |
---|
171 | 186 | /* |
---|
.. | .. |
---|
261 | 276 | void SetupMenu() |
---|
262 | 277 | { |
---|
263 | 278 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
264 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
265 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
266 | | - windowMenu.add("-"); |
---|
267 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
268 | | - 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...")); |
---|
269 | 299 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
270 | | - windowMenu.add("-"); |
---|
271 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
272 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
273 | | - windowMenu.add("-"); |
---|
| 300 | + fileMenu.add("-"); |
---|
| 301 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 302 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 303 | + fileMenu.add("-"); |
---|
274 | 304 | if (client.parent != null) |
---|
275 | 305 | { |
---|
276 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 306 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
277 | 307 | } else |
---|
278 | 308 | { |
---|
279 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 309 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
280 | 310 | } |
---|
281 | 311 | |
---|
| 312 | + newItem.addActionListener(this); |
---|
282 | 313 | loadItem.addActionListener(this); |
---|
283 | 314 | saveItem.addActionListener(this); |
---|
284 | 315 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
287 | 318 | //povItem.addActionListener(this); |
---|
288 | 319 | closeItem.addActionListener(this); |
---|
289 | 320 | |
---|
290 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
291 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
292 | | - //zBufferItem.addActionListener(this); |
---|
293 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
294 | | - //normalLensItem.addActionListener(this); |
---|
295 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
296 | | - revertCameraItem.addActionListener(this); |
---|
297 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
298 | | - toggleTimelineItem.addItemListener(this); |
---|
299 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
300 | | - toggleFullScreenItem.addItemListener(this); |
---|
301 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
302 | | - cameraMenu.add("-"); |
---|
303 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
304 | | - toggleTextureItem.addItemListener(this); |
---|
305 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
306 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
307 | | - toggleLiveItem.addItemListener(this); |
---|
308 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
309 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
310 | | - stepItem.addActionListener(this); |
---|
311 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
312 | | -// toggleDLItem.addItemListener(this); |
---|
313 | | -// toggleDLItem.setState(false); |
---|
314 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
315 | | - toggleRenderItem.addItemListener(this); |
---|
316 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
317 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
318 | | - toggleDebugItem.addItemListener(this); |
---|
319 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
320 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
321 | | - toggleFrustumItem.addItemListener(this); |
---|
322 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
323 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
324 | | - toggleFootContactItem.addItemListener(this); |
---|
325 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
326 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
327 | | - toggleRandomItem.addItemListener(this); |
---|
328 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
329 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
330 | | - toggleHandleItem.addItemListener(this); |
---|
331 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
332 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
333 | | - togglePaintItem.addItemListener(this); |
---|
334 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
335 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
336 | | -// toggleRootItem.addItemListener(this); |
---|
337 | | -// toggleRootItem.setState(false); |
---|
338 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
339 | | -// animationItem.addItemListener(this); |
---|
340 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
341 | | - cameraMenu.add("-"); |
---|
342 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
343 | | - editCameraItem.addActionListener(this); |
---|
344 | | - |
---|
345 | 321 | objectPanel = new JTabbedPane(); |
---|
346 | 322 | toolbarPanel = new JPanel(); |
---|
347 | 323 | toolbarPanel.setName("Toolbar"); |
---|
348 | | - treePanel = new JPanel(); |
---|
| 324 | + treePanel = new cGridBag(); |
---|
349 | 325 | treePanel.setName("Tree"); |
---|
350 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
| 326 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
351 | 327 | ctrlPanel.setName("Edit"); |
---|
352 | | - materialPanel = new JPanel(); |
---|
| 328 | + materialPanel = new cGridBag().setVertical(true); |
---|
353 | 329 | materialPanel.setName("Material"); |
---|
354 | 330 | /*JTextPane*/ |
---|
355 | 331 | infoarea = createTextPane(); |
---|
| 332 | + doc = infoarea.getStyledDocument(); |
---|
| 333 | + |
---|
356 | 334 | infoarea.setEditable(true); |
---|
357 | 335 | SetText(); |
---|
358 | 336 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
359 | 337 | // infoarea.setOpaque(false); |
---|
360 | 338 | // //infoarea.setForeground(textcolor); |
---|
361 | | - infoarea.setLineWrap(true); |
---|
362 | | - infoarea.setWrapStyleWord(true); |
---|
| 339 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 340 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
363 | 341 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
364 | 342 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
365 | 343 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
370 | 348 | mainPanel.setName("Main"); |
---|
371 | 349 | mainPanel.setContinuousLayout(true); |
---|
372 | 350 | mainPanel.setOneTouchExpandable(true); |
---|
373 | | - mainPanel.setDividerLocation(1.0); |
---|
374 | 351 | mainPanel.setDividerSize(9); |
---|
375 | | - mainPanel.setResizeWeight(0); |
---|
| 352 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 353 | + mainPanel.setResizeWeight(0.5); |
---|
376 | 354 | |
---|
377 | 355 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
378 | 356 | //mainPanel.setLayout(new GridBagLayout()); |
---|
379 | 357 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
380 | | - treePanel.setLayout(new GridBagLayout()); |
---|
381 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
382 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 358 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 359 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 360 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
383 | 361 | |
---|
384 | 362 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
385 | 363 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
418 | 396 | static String newline = "\n"; |
---|
419 | 397 | protected static final String buttonString = "JButton"; |
---|
420 | 398 | StyledDocument doc; |
---|
421 | | - JTextArea infoarea; |
---|
| 399 | + JTextPane infoarea; |
---|
422 | 400 | |
---|
423 | 401 | void ClearInfo() |
---|
424 | 402 | { |
---|
.. | .. |
---|
467 | 445 | //SendInfo("Name:", "bold"); |
---|
468 | 446 | if (sel.GetTextures() != null || debug) |
---|
469 | 447 | { |
---|
470 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 448 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
471 | 449 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
472 | 450 | if (sel.Size() > 0) |
---|
473 | 451 | { |
---|
474 | 452 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
475 | 453 | } |
---|
476 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 454 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
477 | 455 | if (debug) |
---|
478 | 456 | { |
---|
479 | 457 | try |
---|
.. | .. |
---|
485 | 463 | } |
---|
486 | 464 | |
---|
487 | 465 | if (full) |
---|
488 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 466 | + { |
---|
| 467 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 468 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 469 | + } |
---|
489 | 470 | |
---|
490 | 471 | if (sel.bRep != null) |
---|
491 | 472 | { |
---|
.. | .. |
---|
512 | 493 | } |
---|
513 | 494 | if (sel.support != null) |
---|
514 | 495 | { |
---|
515 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 496 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
516 | 497 | } |
---|
517 | 498 | if (sel.scriptnode != null) |
---|
518 | 499 | { |
---|
.. | .. |
---|
583 | 564 | { |
---|
584 | 565 | CameraPane.pointflow = (PointFlow) sel; |
---|
585 | 566 | } |
---|
| 567 | + |
---|
| 568 | + si.SendInfo("_____________________", "regular"); |
---|
| 569 | + si.SendInfo("", "regular"); |
---|
586 | 570 | } |
---|
587 | 571 | } |
---|
588 | 572 | |
---|
.. | .. |
---|
614 | 598 | cameraView.ToggleFullScreen(); |
---|
615 | 599 | } |
---|
616 | 600 | |
---|
617 | | - private JTextArea createTextPane() |
---|
| 601 | + private JTextPane createTextPane() |
---|
618 | 602 | { |
---|
619 | | - String[] initString = |
---|
620 | | - { |
---|
621 | | - "This is an editable JTextPane, ", //regular |
---|
622 | | - "another ", //italic |
---|
623 | | - "styled ", //bold |
---|
624 | | - "text ", //small |
---|
625 | | - "component, ", //large |
---|
626 | | - "which supports embedded components..." + newline,//regular |
---|
627 | | - " " + newline, //button |
---|
628 | | - "...and embedded icons..." + newline, //regular |
---|
629 | | - " ", //icon |
---|
630 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
631 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
632 | | - + "cover methods for interacting with those objects." |
---|
633 | | - }; |
---|
| 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 | +// } |
---|
634 | 645 | |
---|
635 | | - String[] initStyles = |
---|
636 | | - { |
---|
637 | | - "regular", "italic", "bold", "small", "large", |
---|
638 | | - "regular", "button", "regular", "icon", |
---|
639 | | - "regular" |
---|
640 | | - }; |
---|
641 | | - |
---|
642 | | - JTextPane textPane = new JTextPane(); |
---|
643 | | - textPane.setEditable(true); |
---|
644 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
645 | | - addStylesToDocument(doc); |
---|
646 | | - |
---|
647 | | - try |
---|
648 | | - { |
---|
649 | | - for (int j = 0; j < 2; j++) |
---|
650 | | - { |
---|
651 | | - for (int i = 0; i < initString.length; i++) |
---|
652 | | - { |
---|
653 | | - doc.insertString(doc.getLength(), initString[i], |
---|
654 | | - doc.getStyle(initStyles[i])); |
---|
655 | | - } |
---|
656 | | - } |
---|
657 | | - } catch (BadLocationException ble) |
---|
658 | | - { |
---|
659 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
660 | | - } |
---|
661 | | - |
---|
662 | | - return new JTextArea(); // textPane; |
---|
| 646 | + return new JTextPane(); // textPane; |
---|
663 | 647 | } |
---|
664 | 648 | |
---|
665 | 649 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
712 | 696 | protected static ImageIcon createImageIcon(String path, |
---|
713 | 697 | String description) |
---|
714 | 698 | { |
---|
715 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 699 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
716 | 700 | if (imgURL != null) |
---|
717 | 701 | { |
---|
718 | 702 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
744 | 728 | // NumberSlider vDivsField; |
---|
745 | 729 | // JCheckBox endcaps; |
---|
746 | 730 | JCheckBox liveCB; |
---|
| 731 | + JCheckBox selectCB; |
---|
747 | 732 | JCheckBox hideCB; |
---|
748 | 733 | JCheckBox link2masterCB; |
---|
749 | 734 | JCheckBox markCB; |
---|
.. | .. |
---|
759 | 744 | JButton slowerButton; |
---|
760 | 745 | JButton fasterButton; |
---|
761 | 746 | JButton remarkButton; |
---|
| 747 | + |
---|
| 748 | + cGridBag namePanel; |
---|
| 749 | + cGridBag setupPanel; |
---|
| 750 | + cGridBag commandsPanel; |
---|
| 751 | + cGridBag pushPanel; |
---|
| 752 | + cGridBag fillPanel; |
---|
762 | 753 | |
---|
763 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 754 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
764 | 755 | { |
---|
765 | 756 | JCheckBox cb; |
---|
766 | 757 | |
---|
767 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
768 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
769 | | -// oe.aConstraints.weightx = 1; |
---|
770 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
771 | | - 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); |
---|
772 | 759 | cb.addItemListener(this); |
---|
773 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
774 | | - oe.aConstraints.gridwidth = 1; |
---|
775 | | - oe.aConstraints.gridx += 1; |
---|
776 | 760 | |
---|
777 | 761 | return cb; |
---|
778 | 762 | } |
---|
779 | 763 | |
---|
780 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 764 | + cButton AddButton(cGridBag panel, String label) |
---|
781 | 765 | { |
---|
782 | 766 | cButton cb; |
---|
783 | 767 | |
---|
784 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
785 | | - oe.aConstraints.gridwidth = 1; |
---|
786 | | -// oe.aConstraints.weightx = 1; |
---|
787 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
788 | | - 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); |
---|
789 | 769 | cb.addActionListener(this); |
---|
790 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
791 | | - oe.aConstraints.gridwidth = 1; |
---|
792 | | - oe.aConstraints.gridx += 1; |
---|
793 | 770 | |
---|
794 | 771 | return cb; |
---|
795 | 772 | } |
---|
796 | 773 | |
---|
797 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 774 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
798 | 775 | { |
---|
799 | 776 | JComboBox combo; |
---|
800 | 777 | |
---|
801 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
802 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
803 | | - oe.aConstraints.gridx += 1; |
---|
| 778 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
804 | 779 | combo.addActionListener(this); |
---|
805 | 780 | |
---|
806 | 781 | return combo; |
---|
807 | 782 | } |
---|
808 | 783 | |
---|
809 | | - 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) |
---|
810 | 785 | { |
---|
811 | | - NumberSlider combo; |
---|
| 786 | + cGridBag control = new cGridBag(); |
---|
| 787 | + |
---|
| 788 | + cNumberSlider combo; |
---|
812 | 789 | |
---|
813 | 790 | JLabel jlabel = new JLabel(label); |
---|
814 | | - |
---|
815 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
816 | 791 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
817 | | - aConstraints.gridwidth = 2; |
---|
818 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
819 | | - aConstraints.gridx += 1; |
---|
820 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
821 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
822 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
823 | | - aConstraints.gridx += 1; |
---|
824 | | - aConstraints.gridwidth = 1; |
---|
825 | | - |
---|
| 792 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 793 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
826 | 794 | combo.setFloat(current); |
---|
827 | | - |
---|
828 | | - combo.label = jlabel; |
---|
829 | | - |
---|
830 | | - combo.addChangeListener(this); |
---|
831 | | - |
---|
832 | | - return combo; |
---|
| 795 | + |
---|
| 796 | + panel.add(control); |
---|
| 797 | + |
---|
| 798 | + return control; |
---|
833 | 799 | } |
---|
834 | 800 | |
---|
835 | | - 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) |
---|
836 | 802 | { |
---|
837 | | - NumberSlider combo; |
---|
| 803 | + cGridBag control = new cGridBag(); |
---|
| 804 | + |
---|
| 805 | + cNumberSlider combo; |
---|
838 | 806 | |
---|
839 | 807 | JLabel jlabel = new JLabel(label); |
---|
840 | | - |
---|
841 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
842 | 808 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
843 | | - aConstraints.gridwidth = 2; |
---|
844 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
845 | | - aConstraints.gridx += 1; |
---|
846 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
847 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
848 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.gridwidth = 1; |
---|
851 | | - |
---|
| 809 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 810 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
852 | 811 | combo.setInteger(current); |
---|
853 | 812 | |
---|
854 | | - combo.label = jlabel; |
---|
855 | | - |
---|
856 | | - combo.addChangeListener(this); |
---|
857 | | - |
---|
858 | | - return combo; |
---|
| 813 | + panel.add(control); |
---|
| 814 | + |
---|
| 815 | + return control; |
---|
859 | 816 | } |
---|
860 | 817 | |
---|
861 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 818 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
862 | 819 | { |
---|
863 | 820 | JTextArea text; |
---|
864 | 821 | |
---|
865 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
866 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
867 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 822 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
868 | 823 | text.addCaretListener(this); |
---|
869 | | - aConstraints.gridx += 1; |
---|
870 | | - aConstraints.gridwidth = 1; |
---|
871 | 824 | |
---|
872 | 825 | return text; |
---|
873 | 826 | } |
---|
.. | .. |
---|
897 | 850 | objEditor.ctrlPanel.remove(j); |
---|
898 | 851 | } |
---|
899 | 852 | |
---|
| 853 | + void Remove(cNumberSlider j) |
---|
| 854 | + { |
---|
| 855 | + j.removeChangeListener(this); |
---|
| 856 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 857 | + objEditor.ctrlPanel.remove(j); |
---|
| 858 | + } |
---|
| 859 | + |
---|
900 | 860 | /* |
---|
901 | 861 | */ |
---|
902 | | - void Return() // ObjEditor oe) |
---|
| 862 | + void Return0() // ObjEditor oe) |
---|
903 | 863 | { |
---|
904 | 864 | aConstraints.gridy += 1; |
---|
905 | 865 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
954 | 914 | |
---|
955 | 915 | void SetupUI2(ObjEditor oe) |
---|
956 | 916 | { |
---|
957 | | -// oe.aConstraints.weightx = 0; |
---|
958 | | -// oe.aConstraints.weighty = 0; |
---|
959 | | -// oe.aConstraints.gridx = 0; |
---|
960 | | -// oe.aConstraints.gridy = 0; |
---|
961 | | - 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(); |
---|
962 | 926 | |
---|
963 | 927 | if (!GroupEditor.allparams) |
---|
964 | 928 | return; |
---|
965 | 929 | |
---|
966 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
967 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
968 | | - 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"); |
---|
969 | 936 | // Return(); |
---|
970 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
971 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
972 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
973 | | - Return(); |
---|
974 | | - resetButton = AddButton(oe, "Reset"); |
---|
975 | | - 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"); |
---|
976 | 965 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
977 | 966 | // stepAllButton = AddButton(oe, "Step All"); |
---|
978 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
979 | 967 | // Return(); |
---|
980 | | - slowerButton = AddButton(oe, "Slow"); |
---|
981 | | - fasterButton = AddButton(oe, "Fast"); |
---|
982 | | - 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"); |
---|
983 | 974 | |
---|
984 | | - Return(); |
---|
| 975 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 976 | + oe.ctrlPanel.Return(); |
---|
985 | 977 | |
---|
| 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(); |
---|
| 983 | + |
---|
986 | 984 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
987 | 985 | // ObjEditor.aConstraints.gridx += 1; |
---|
988 | 986 | |
---|
.. | .. |
---|
1076 | 1074 | oe.aConstraints.gridwidth = 1; |
---|
1077 | 1075 | /**/ |
---|
1078 | 1076 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1079 | | - Return(); |
---|
| 1077 | + oe.ctrlPanel.Return(); |
---|
1080 | 1078 | |
---|
1081 | 1079 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1082 | 1080 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1178 | 1176 | //JPanel worldPanel = |
---|
1179 | 1177 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1180 | 1178 | //worldPanel.setName("World"); |
---|
1181 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
| 1179 | + centralPanel = new cGridBag(); |
---|
| 1180 | + centralPanel.preferredWidth = 20; |
---|
1182 | 1181 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1183 | 1182 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1184 | 1183 | |
---|
| 1184 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1185 | + cameraPanel.setContinuousLayout(true); |
---|
| 1186 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1187 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1188 | +// cameraPanel.setDividerSize(9); |
---|
| 1189 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1190 | + |
---|
1185 | 1191 | centralPanel.add(cameraView); |
---|
1186 | 1192 | //frame.setJMenuBar(timelineMenubar); |
---|
1187 | 1193 | //centralPanel.add(timelinePanel); |
---|
.. | .. |
---|
1201 | 1207 | //frontView.object = copy; |
---|
1202 | 1208 | //sideView.object = copy; |
---|
1203 | 1209 | |
---|
1204 | | - XYZPanel = new JPanel(); |
---|
1205 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1210 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1211 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1206 | 1212 | |
---|
1207 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1208 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1209 | | - 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); |
---|
1210 | 1217 | |
---|
1211 | 1218 | /* |
---|
1212 | 1219 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1244 | 1251 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1245 | 1252 | //tmp.setName("Edit"); |
---|
1246 | 1253 | objectPanel.add(materialPanel); |
---|
1247 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1248 | | - north.setName("Edit"); |
---|
1249 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1250 | | - 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); |
---|
1251 | 1259 | objectPanel.add(infoPanel); |
---|
1252 | 1260 | |
---|
1253 | 1261 | /* |
---|
.. | .. |
---|
1268 | 1276 | scrollpane.setWheelScrollingEnabled(true); |
---|
1269 | 1277 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1270 | 1278 | |
---|
1271 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1272 | | - scenePanel.add(scrollpane); |
---|
| 1279 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1280 | + scenePanel.preferredWidth = 6; |
---|
| 1281 | + |
---|
| 1282 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1283 | + tabbedPane.add(scrollpane); |
---|
1273 | 1284 | |
---|
1274 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
| 1285 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1275 | 1286 | |
---|
1276 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1287 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1277 | 1288 | |
---|
1278 | 1289 | optionsPanel.setName("Options"); |
---|
1279 | | - scenePanel.add(optionsPanel); |
---|
1280 | | - |
---|
| 1290 | + |
---|
| 1291 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1292 | + |
---|
| 1293 | + tabbedPane.add(optionsPanel); |
---|
| 1294 | + |
---|
| 1295 | + scenePanel.add(tabbedPane); |
---|
1281 | 1296 | |
---|
1282 | 1297 | /* |
---|
1283 | 1298 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1311 | 1326 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1312 | 1327 | //bigPanel.add(ctrlPanel); |
---|
1313 | 1328 | //bigPanel.add(gridPanel); |
---|
| 1329 | + /** |
---|
1314 | 1330 | bigThree = new JPanel(); |
---|
1315 | 1331 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1316 | 1332 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1334 | 1350 | // aConstraints.gridheight = 3; |
---|
1335 | 1351 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1336 | 1352 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1353 | + /**/ |
---|
1337 | 1354 | |
---|
| 1355 | + bigThree = new cGridBag(); |
---|
| 1356 | + bigThree.addComponent(scenePanel); |
---|
| 1357 | + bigThree.addComponent(centralPanel); |
---|
| 1358 | + bigThree.addComponent(XYZPanel); |
---|
| 1359 | + |
---|
1338 | 1360 | // // SIDE EFFECT!!! |
---|
1339 | 1361 | // aConstraints.gridx = 0; |
---|
1340 | 1362 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1355 | 1377 | //worldPane.add(bigPanel); |
---|
1356 | 1378 | //worldPane.add(worldPanel); |
---|
1357 | 1379 | /**/ |
---|
1358 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1380 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1381 | + frame.add(/*"Center",*/framePanel); |
---|
1359 | 1382 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1360 | 1383 | |
---|
1361 | 1384 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1362 | 1385 | |
---|
1363 | | - frame.setSize(1024, 768); |
---|
1364 | | - frame.show(); |
---|
| 1386 | + frame.setSize(1280, 860); |
---|
| 1387 | + frame.setVisible(true); |
---|
1365 | 1388 | |
---|
1366 | 1389 | gridPanel.setDividerLocation(1.0); |
---|
1367 | 1390 | |
---|
.. | .. |
---|
1376 | 1399 | }); |
---|
1377 | 1400 | } |
---|
1378 | 1401 | |
---|
| 1402 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1403 | + { |
---|
| 1404 | + } |
---|
| 1405 | + |
---|
1379 | 1406 | JTree GetTree() |
---|
1380 | 1407 | { |
---|
1381 | 1408 | return objEditor.jTree; |
---|
.. | .. |
---|
1387 | 1414 | ctrlPanel.removeAll(); |
---|
1388 | 1415 | } |
---|
1389 | 1416 | |
---|
1390 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1417 | + void SetupMaterial(cGridBag panel) |
---|
1391 | 1418 | { |
---|
1392 | | - aConstraints.weighty = 0; |
---|
1393 | | - //aConstraints.weightx = 1; |
---|
1394 | | - /* |
---|
| 1419 | + /* |
---|
1395 | 1420 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1396 | 1421 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1397 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1398 | | - aConstraints.gridx += 1; |
---|
1399 | 1422 | */ |
---|
1400 | 1423 | |
---|
1401 | | - aConstraints.gridwidth = 1; |
---|
1402 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1403 | | - aConstraints.gridx += 1; |
---|
1404 | | - aConstraints.weighty = 0; |
---|
1405 | | - 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"); |
---|
1406 | 1428 | |
---|
1407 | 1429 | /* |
---|
1408 | 1430 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1409 | | - aConstraints.gridx += 1; |
---|
1410 | | - aConstraints.weighty = 0; |
---|
1411 | | - aConstraints.gridwidth = 1; |
---|
1412 | 1431 | */ |
---|
1413 | 1432 | |
---|
1414 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1415 | | - 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 | + } |
---|
1416 | 1442 | |
---|
1417 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1418 | | - |
---|
1419 | | - aConstraints.gridx += 1; |
---|
1420 | | - |
---|
1421 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1422 | | - |
---|
1423 | | - aConstraints.gridx += 1; |
---|
1424 | | - |
---|
1425 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1426 | | - |
---|
1427 | | - aConstraints.gridx = 0; |
---|
1428 | | - aConstraints.gridy += 1; |
---|
1429 | | - aConstraints.weighty = 0; |
---|
1430 | | - aConstraints.gridwidth = 1; |
---|
| 1443 | + editBar.preferredHeight = 15; |
---|
| 1444 | + |
---|
| 1445 | + panel.add(editBar); |
---|
| 1446 | + |
---|
1431 | 1447 | /**/ |
---|
1432 | 1448 | //aConstraints.weighty = 0; |
---|
1433 | 1449 | ////aConstraints.weightx = 1; |
---|
1434 | 1450 | //aConstraints.weighty = 1; |
---|
1435 | 1451 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1436 | 1452 | //aConstraints.gridx += 1; |
---|
1437 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1438 | | - aConstraints.weighty = 0; |
---|
1439 | | - aConstraints.gridx = 0; |
---|
1440 | | - aConstraints.gridy += 1; |
---|
1441 | | - aConstraints.gridwidth = 1; |
---|
| 1453 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1442 | 1454 | |
---|
1443 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1444 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1445 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1446 | | - aConstraints.gridx += 1; |
---|
1447 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1448 | | - //aConstraints.weightx = 0; |
---|
1449 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1450 | | - aConstraints.gridx = 0; |
---|
1451 | | - aConstraints.gridy += 1; |
---|
1452 | | - 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); |
---|
1453 | 1463 | |
---|
1454 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1455 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1456 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1457 | | - aConstraints.gridx += 1; |
---|
1458 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1459 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1460 | | - aConstraints.gridx = 0; |
---|
1461 | | - aConstraints.gridy += 1; |
---|
1462 | | - 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); |
---|
1463 | 1469 | |
---|
1464 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1465 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1466 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1467 | | - aConstraints.gridx += 1; |
---|
1468 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1469 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1470 | | - aConstraints.gridx = 0; |
---|
1471 | | - aConstraints.gridy += 1; |
---|
1472 | | - 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); |
---|
1473 | 1475 | |
---|
1474 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1475 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1476 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1477 | | - aConstraints.gridx += 1; |
---|
1478 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1479 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1480 | | - aConstraints.gridx = 0; |
---|
1481 | | - aConstraints.gridy += 1; |
---|
1482 | | - 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); |
---|
1483 | 1481 | |
---|
1484 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1485 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1486 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1487 | | - aConstraints.gridx += 1; |
---|
1488 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1489 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1490 | | - aConstraints.gridx = 0; |
---|
1491 | | - aConstraints.gridy += 1; |
---|
1492 | | - 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); |
---|
1493 | 1487 | |
---|
1494 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1495 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1496 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1497 | | - aConstraints.gridx += 1; |
---|
1498 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1499 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1500 | | - aConstraints.gridx = 0; |
---|
1501 | | - aConstraints.gridy += 1; |
---|
1502 | | - 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); |
---|
1503 | 1493 | |
---|
1504 | | - //aConstraints.weighty = 1; |
---|
1505 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1506 | | - //aConstraints.gridx += 1; |
---|
1507 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1508 | | - aConstraints.weighty = 0; |
---|
1509 | | - aConstraints.gridx = 0; |
---|
1510 | | - aConstraints.gridy += 1; |
---|
1511 | | - 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); |
---|
1512 | 1507 | |
---|
1513 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1514 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1515 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1516 | | - aConstraints.gridx += 1; |
---|
1517 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1518 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1519 | | - aConstraints.gridx = 0; |
---|
1520 | | - aConstraints.gridy += 1; |
---|
1521 | | - 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); |
---|
1522 | 1513 | |
---|
1523 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1524 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1525 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1526 | | - aConstraints.gridx += 1; |
---|
1527 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1528 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1529 | | - aConstraints.gridx = 0; |
---|
1530 | | - aConstraints.gridy += 1; |
---|
1531 | | - 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); |
---|
1532 | 1519 | |
---|
1533 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1534 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1535 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1536 | | - aConstraints.gridx += 1; |
---|
1537 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1538 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1539 | | - aConstraints.gridx = 0; |
---|
1540 | | - aConstraints.gridy += 1; |
---|
1541 | | - 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); |
---|
1542 | 1525 | |
---|
1543 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1544 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1545 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1546 | | - aConstraints.gridx += 1; |
---|
1547 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1548 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1549 | | - aConstraints.gridx = 0; |
---|
1550 | | - aConstraints.gridy += 1; |
---|
1551 | | - 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); |
---|
1552 | 1531 | |
---|
1553 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1554 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1555 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1556 | | - aConstraints.gridx += 1; |
---|
1557 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1558 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1559 | | - aConstraints.gridx = 0; |
---|
1560 | | - aConstraints.gridy += 1; |
---|
1561 | | - 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); |
---|
1562 | 1537 | |
---|
1563 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1564 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1565 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1566 | | - aConstraints.gridx += 1; |
---|
1567 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1568 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1569 | | - aConstraints.gridx = 0; |
---|
1570 | | - aConstraints.gridy += 1; |
---|
1571 | | - 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); |
---|
1572 | 1543 | |
---|
1573 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1574 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1575 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1576 | | - aConstraints.gridx += 1; |
---|
1577 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1578 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1579 | | - aConstraints.gridx = 0; |
---|
1580 | | - aConstraints.gridy += 1; |
---|
1581 | | - 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); |
---|
1582 | 1551 | |
---|
1583 | | - //aConstraints.weighty = 1; |
---|
1584 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1585 | | - //aConstraints.gridx += 1; |
---|
1586 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1587 | | - aConstraints.weighty = 0; |
---|
1588 | | - aConstraints.gridx = 0; |
---|
1589 | | - aConstraints.gridy += 1; |
---|
1590 | | - 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); |
---|
1591 | 1557 | |
---|
1592 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1593 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1594 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1595 | | - aConstraints.gridx += 1; |
---|
1596 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1597 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1598 | | - aConstraints.gridx = 0; |
---|
1599 | | - aConstraints.gridy += 1; |
---|
1600 | | - 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); |
---|
1601 | 1563 | |
---|
1602 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1603 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1604 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1605 | | - aConstraints.gridx += 1; |
---|
1606 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1607 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1608 | | - aConstraints.gridx = 0; |
---|
1609 | | - aConstraints.gridy += 1; |
---|
1610 | | - 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); |
---|
1611 | 1569 | |
---|
1612 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1613 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1614 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1615 | | - aConstraints.gridx += 1; |
---|
1616 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1617 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1618 | | - aConstraints.gridx = 0; |
---|
1619 | | - aConstraints.gridy += 1; |
---|
1620 | | - 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); |
---|
1621 | 1575 | |
---|
1622 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1623 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1624 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1625 | | - aConstraints.gridx += 1; |
---|
1626 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1627 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1628 | | - aConstraints.gridx = 0; |
---|
1629 | | - aConstraints.gridy += 1; |
---|
1630 | | - 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); |
---|
1631 | 1581 | |
---|
1632 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1633 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1634 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1635 | | - aConstraints.gridx += 1; |
---|
1636 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1637 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1638 | | - aConstraints.gridx = 0; |
---|
1639 | | - aConstraints.gridy += 1; |
---|
1640 | | - aConstraints.gridwidth = 1; |
---|
1641 | | - |
---|
1642 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1643 | | - Return(); |
---|
| 1582 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1583 | + //Return(); |
---|
1644 | 1584 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1645 | 1585 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1646 | 1586 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1651 | 1591 | // aConstraints.gridy += 1; |
---|
1652 | 1592 | // aConstraints.gridwidth = 1; |
---|
1653 | 1593 | |
---|
1654 | | - //aConstraints.weighty = 1; |
---|
1655 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1656 | | - //aConstraints.gridx += 1; |
---|
1657 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1658 | | - aConstraints.weighty = 0; |
---|
1659 | | - aConstraints.gridx = 0; |
---|
1660 | | - aConstraints.gridy += 1; |
---|
1661 | | - aConstraints.gridwidth = 1; |
---|
1662 | 1594 | |
---|
1663 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1664 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1665 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1666 | | - aConstraints.gridx += 1; |
---|
1667 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1668 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1669 | | - aConstraints.gridx = 0; |
---|
1670 | | - aConstraints.gridy += 1; |
---|
1671 | | - 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); |
---|
1672 | 1602 | |
---|
1673 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1674 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1675 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1676 | | - aConstraints.gridx += 1; |
---|
1677 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1678 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1679 | | - aConstraints.gridx = 0; |
---|
1680 | | - aConstraints.gridy += 1; |
---|
1681 | | - 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); |
---|
1682 | 1608 | |
---|
1683 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1684 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1685 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1686 | | - aConstraints.gridx += 1; |
---|
1687 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1688 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1689 | | - aConstraints.gridx = 0; |
---|
1690 | | - aConstraints.gridy += 1; |
---|
1691 | | - 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); |
---|
1692 | 1614 | |
---|
1693 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1694 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1695 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1696 | | - aConstraints.gridx += 1; |
---|
1697 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1698 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1699 | | - aConstraints.gridx = 0; |
---|
1700 | | - aConstraints.gridy += 1; |
---|
1701 | | - aConstraints.gridwidth = 1; |
---|
1702 | | - 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); |
---|
1703 | 1620 | |
---|
1704 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1705 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1706 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1707 | | - aConstraints.gridx += 1; |
---|
1708 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1709 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1710 | | - aConstraints.gridx = 0; |
---|
1711 | | - aConstraints.gridy += 1; |
---|
1712 | | - 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); |
---|
1713 | 1626 | |
---|
1714 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1715 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1716 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1717 | | - aConstraints.gridx += 1; |
---|
1718 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1719 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1720 | | - aConstraints.gridx = 0; |
---|
1721 | | - aConstraints.gridy += 1; |
---|
1722 | | - 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); |
---|
1723 | 1634 | |
---|
1724 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1725 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1726 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1727 | | - aConstraints.gridx += 1; |
---|
1728 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1729 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1730 | | - aConstraints.gridx = 0; |
---|
1731 | | - aConstraints.gridy += 1; |
---|
1732 | | - 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); |
---|
1733 | 1640 | |
---|
1734 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1735 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1736 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1737 | | - aConstraints.gridx += 1; |
---|
1738 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1739 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1740 | | - aConstraints.gridx = 0; |
---|
1741 | | - aConstraints.gridy += 1; |
---|
1742 | | - 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); |
---|
1743 | 1646 | |
---|
1744 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1745 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1746 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1747 | | - aConstraints.gridx += 1; |
---|
1748 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1749 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1750 | | - aConstraints.gridx = 0; |
---|
1751 | | - aConstraints.gridy += 1; |
---|
1752 | | - 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); |
---|
1753 | 1652 | |
---|
1754 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1755 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1756 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1757 | | - aConstraints.gridx += 1; |
---|
1758 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1759 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1760 | | - aConstraints.gridx = 0; |
---|
1761 | | - aConstraints.gridy += 1; |
---|
1762 | | - 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); |
---|
1763 | 1658 | |
---|
1764 | | - //aConstraints.weighty = 1; |
---|
1765 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1766 | | - //aConstraints.gridx += 1; |
---|
1767 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1768 | | - 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); |
---|
1769 | 1664 | |
---|
1770 | | - aConstraints.gridx = 0; |
---|
1771 | | - aConstraints.gridy = 0; |
---|
1772 | | - 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); |
---|
1773 | 1676 | |
---|
1774 | 1677 | SetMaterial(copy); // .GetMaterial()); |
---|
1775 | 1678 | |
---|
1776 | | - colorField.addChangeListener(this); |
---|
1777 | | - modulationField.addChangeListener(this); |
---|
| 1679 | + //colorField.addChangeListener(this); |
---|
| 1680 | +// modulationField.addChangeListener(this); |
---|
1778 | 1681 | metalnessField.addChangeListener(this); |
---|
1779 | 1682 | diffuseField.addChangeListener(this); |
---|
1780 | 1683 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1804 | 1707 | opacityPowerField.addChangeListener(this); |
---|
1805 | 1708 | /**/ |
---|
1806 | 1709 | |
---|
1807 | | - resetSlidersButton.addActionListener(this); |
---|
1808 | 1710 | clearMaterialButton.addActionListener(this); |
---|
1809 | 1711 | createMaterialButton.addActionListener(this); |
---|
1810 | | - |
---|
1811 | | - propagateToggle.addItemListener(this); |
---|
1812 | | - multiplyToggle.addItemListener(this); |
---|
| 1712 | + |
---|
| 1713 | + if (Globals.ADVANCED) |
---|
| 1714 | + { |
---|
| 1715 | + resetSlidersButton.addActionListener(this); |
---|
| 1716 | + propagateToggle.addItemListener(this); |
---|
| 1717 | + multiplyToggle.addItemListener(this); |
---|
| 1718 | + } |
---|
1813 | 1719 | } |
---|
1814 | 1720 | |
---|
1815 | 1721 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1980 | 1886 | |
---|
1981 | 1887 | //? flashIt = false; |
---|
1982 | 1888 | CameraPane pane = (CameraPane) cameraView; |
---|
1983 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 1889 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1984 | 1890 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1985 | 1891 | |
---|
1986 | 1892 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2437 | 2343 | |
---|
2438 | 2344 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2439 | 2345 | { |
---|
2440 | | - if (GrafreeD.standAlone) |
---|
| 2346 | + if (Grafreed.standAlone) |
---|
2441 | 2347 | { |
---|
2442 | 2348 | /**/ |
---|
2443 | 2349 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2444 | | - browser.show(); |
---|
| 2350 | + browser.setVisible(true); |
---|
2445 | 2351 | String filename = browser.getFile(); |
---|
2446 | 2352 | if (filename != null && filename.length() > 0) |
---|
2447 | 2353 | { |
---|
.. | .. |
---|
2586 | 2492 | } |
---|
2587 | 2493 | if (input == null) |
---|
2588 | 2494 | { |
---|
| 2495 | + new Exception().printStackTrace(); |
---|
2589 | 2496 | System.exit(0); |
---|
2590 | 2497 | } |
---|
2591 | 2498 | |
---|
.. | .. |
---|
2800 | 2707 | return; |
---|
2801 | 2708 | } |
---|
2802 | 2709 | |
---|
2803 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2710 | + if (multiplyToggle != null) |
---|
| 2711 | + multiplyToggle.setSelected(mat.multiply); |
---|
2804 | 2712 | |
---|
2805 | 2713 | assert (object.projectedVertices != null); |
---|
2806 | 2714 | |
---|
.. | .. |
---|
2989 | 2897 | if (timeline) |
---|
2990 | 2898 | { |
---|
2991 | 2899 | centralPanel.remove(cameraView); |
---|
2992 | | - centralPanel.add(timelinePanel); |
---|
| 2900 | + cameraPanel.add(cameraView); |
---|
| 2901 | + centralPanel.add(cameraPanel); |
---|
2993 | 2902 | frame.setJMenuBar(timelineMenubar); |
---|
2994 | 2903 | wasFullScreen = CameraPane.FULLSCREEN; |
---|
2995 | 2904 | if (!CameraPane.FULLSCREEN) |
---|
.. | .. |
---|
2998 | 2907 | } |
---|
2999 | 2908 | else |
---|
3000 | 2909 | { |
---|
3001 | | - centralPanel.remove(timelinePanel); |
---|
| 2910 | + centralPanel.remove(cameraPanel); |
---|
3002 | 2911 | centralPanel.add(cameraView); |
---|
3003 | 2912 | frame.setJMenuBar(null); |
---|
3004 | 2913 | if (!wasFullScreen) |
---|
.. | .. |
---|
3014 | 2923 | frame.validate(); |
---|
3015 | 2924 | |
---|
3016 | 2925 | return; |
---|
3017 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 2926 | + } else if (event.getSource() == toggleSwitchItem) |
---|
3018 | 2927 | { |
---|
3019 | 2928 | cameraView.ToggleRandom(); |
---|
3020 | 2929 | cameraView.repaint(); |
---|
.. | .. |
---|
3045 | 2954 | { |
---|
3046 | 2955 | copy.live ^= true; |
---|
3047 | 2956 | return; |
---|
| 2957 | + } else if (event.getSource() == selectCB) |
---|
| 2958 | + { |
---|
| 2959 | + copy.dontselect ^= true; |
---|
| 2960 | + return; |
---|
3048 | 2961 | } else if (event.getSource() == hideCB) |
---|
3049 | 2962 | { |
---|
3050 | 2963 | copy.hide ^= true; |
---|
.. | .. |
---|
3059 | 2972 | if (event.getSource() == randomCB) |
---|
3060 | 2973 | { |
---|
3061 | 2974 | copy.random ^= true; |
---|
| 2975 | + objEditor.refreshContents(); |
---|
3062 | 2976 | return; |
---|
3063 | 2977 | } |
---|
3064 | 2978 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3082 | 2996 | |
---|
3083 | 2997 | public void actionPerformed(ActionEvent event) |
---|
3084 | 2998 | { |
---|
| 2999 | + Object source = event.getSource(); |
---|
3085 | 3000 | // SCRIPT DIALOG |
---|
3086 | | - if (event.getSource() == okbutton) |
---|
| 3001 | + if (source == okbutton) |
---|
3087 | 3002 | { |
---|
3088 | 3003 | textpanel.setVisible(false); |
---|
3089 | 3004 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3095 | 3010 | textarea = null; |
---|
3096 | 3011 | textpanel = null; |
---|
3097 | 3012 | } |
---|
3098 | | - if (event.getSource() == cancelbutton) |
---|
| 3013 | + if (source == cancelbutton) |
---|
3099 | 3014 | { |
---|
3100 | 3015 | textpanel.setVisible(false); |
---|
3101 | 3016 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3107 | 3022 | //applySelf(); |
---|
3108 | 3023 | //client.refreshEditWindow(); |
---|
3109 | 3024 | //refreshContents(); |
---|
3110 | | - if (event.getSource() == nameField) |
---|
| 3025 | + if (source == nameField) |
---|
3111 | 3026 | { |
---|
3112 | 3027 | //System.out.println("ObjEditor " + event); |
---|
3113 | 3028 | applySelf0(true); |
---|
3114 | 3029 | //parent.applySelf(); |
---|
3115 | 3030 | objEditor.refreshContents(); |
---|
3116 | | - } else if (event.getSource() == resetButton) |
---|
| 3031 | + } else if (source == resetButton) |
---|
3117 | 3032 | { |
---|
3118 | 3033 | CameraPane.fullreset = true; |
---|
3119 | 3034 | copy.Reset(); // ResetMeshes(); |
---|
3120 | 3035 | copy.Touch(); |
---|
3121 | 3036 | objEditor.refreshContents(); |
---|
3122 | | - } else if (event.getSource() == stepItem) |
---|
| 3037 | + } else if (source == stepItem) |
---|
3123 | 3038 | { |
---|
3124 | | - cameraView.ONESTEP = true; |
---|
| 3039 | + //cameraView.ONESTEP = true; |
---|
| 3040 | + Globals.ONESTEP = true; |
---|
3125 | 3041 | cameraView.repaint(); |
---|
3126 | 3042 | return; |
---|
3127 | | - } else if (event.getSource() == stepButton) |
---|
| 3043 | + } else if (source == stepButton) |
---|
3128 | 3044 | { |
---|
3129 | 3045 | copy.Step(); |
---|
3130 | 3046 | copy.Touch(); |
---|
3131 | 3047 | objEditor.refreshContents(); |
---|
3132 | | - } else if (event.getSource() == slowerButton) |
---|
| 3048 | + } else if (source == slowerButton) |
---|
3133 | 3049 | { |
---|
3134 | 3050 | copy.Slower(); |
---|
3135 | 3051 | copy.Touch(); |
---|
3136 | 3052 | objEditor.refreshContents(); |
---|
3137 | | - } else if (event.getSource() == fasterButton) |
---|
| 3053 | + } else if (source == fasterButton) |
---|
3138 | 3054 | { |
---|
3139 | 3055 | copy.Faster(); |
---|
3140 | 3056 | copy.Touch(); |
---|
3141 | 3057 | objEditor.refreshContents(); |
---|
3142 | | - } else if (event.getSource() == remarkButton) |
---|
| 3058 | + } else if (source == remarkButton) |
---|
3143 | 3059 | { |
---|
3144 | 3060 | copy.Remark(); |
---|
3145 | 3061 | copy.Touch(); |
---|
3146 | 3062 | objEditor.refreshContents(); |
---|
3147 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3063 | + } else if (source == stepAllButton) |
---|
3148 | 3064 | { |
---|
3149 | 3065 | copy.StepAll(); |
---|
3150 | 3066 | copy.Touch(); |
---|
3151 | 3067 | objEditor.refreshContents(); |
---|
3152 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3068 | + } else if (source == resetAllButton) |
---|
3153 | 3069 | { |
---|
3154 | 3070 | //CameraPane.fullreset = true; |
---|
3155 | 3071 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3182 | 3098 | // Close(); |
---|
3183 | 3099 | // } |
---|
3184 | 3100 | // else |
---|
3185 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3101 | + if (source == resetSlidersButton) |
---|
3186 | 3102 | { |
---|
3187 | 3103 | ResetSliders(); |
---|
3188 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3104 | + } else if (source == clearMaterialButton) |
---|
3189 | 3105 | { |
---|
3190 | 3106 | ClearMaterial(); |
---|
3191 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3107 | + } else if (source == createMaterialButton) |
---|
3192 | 3108 | { |
---|
3193 | 3109 | CreateMaterial(); |
---|
3194 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3110 | + } else if (source == clearPanelButton) |
---|
3195 | 3111 | { |
---|
3196 | 3112 | copy.ClearUI(); |
---|
3197 | 3113 | refreshContents(true); |
---|
3198 | | - } /* |
---|
3199 | | - } |
---|
3200 | | - |
---|
3201 | | - public boolean action(Event event, Object arg) |
---|
3202 | | - { |
---|
3203 | | - */ else if (event.getSource() == closeItem) |
---|
| 3114 | + } else if (source == importGFDItem) |
---|
| 3115 | + { |
---|
| 3116 | + ImportGFD(); |
---|
| 3117 | + } else |
---|
| 3118 | + if (source == importVRMLX3DItem) |
---|
| 3119 | + { |
---|
| 3120 | + ImportVRMLX3D(); |
---|
| 3121 | + } else |
---|
| 3122 | + if (source == import3DSItem) |
---|
| 3123 | + { |
---|
| 3124 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3125 | + } else |
---|
| 3126 | + if (source == importOBJItem) |
---|
| 3127 | + { |
---|
| 3128 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3129 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3130 | + browser.setVisible(true); |
---|
| 3131 | + String filename = browser.getFile(); |
---|
| 3132 | + if (filename != null && filename.length() > 0) |
---|
| 3133 | + { |
---|
| 3134 | + String fullname = browser.getDirectory() + filename; |
---|
| 3135 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3136 | + } |
---|
| 3137 | + } else |
---|
| 3138 | + if (source == closeItem) |
---|
3204 | 3139 | { |
---|
3205 | 3140 | Close(); |
---|
3206 | 3141 | //return true; |
---|
3207 | | - } else if (event.getSource() == loadItem) |
---|
| 3142 | + } else if (source == loadItem) |
---|
3208 | 3143 | { |
---|
3209 | 3144 | load(); |
---|
3210 | 3145 | //return true; |
---|
3211 | | - } else if (event.getSource() == saveItem) |
---|
| 3146 | + } else if (source == newItem) |
---|
| 3147 | + { |
---|
| 3148 | + New(); |
---|
| 3149 | + } else if (source == saveItem) |
---|
3212 | 3150 | { |
---|
3213 | 3151 | save(); |
---|
3214 | 3152 | //return true; |
---|
3215 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3153 | + } else if (source == saveAsItem) |
---|
3216 | 3154 | { |
---|
3217 | 3155 | saveAs(); |
---|
3218 | 3156 | //return true; |
---|
3219 | | - } else if (event.getSource() == reexportItem) |
---|
| 3157 | + } else if (source == reexportItem) |
---|
3220 | 3158 | { |
---|
3221 | 3159 | reexport(); |
---|
3222 | 3160 | //return true; |
---|
3223 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3161 | + } else if (source == exportAsItem) |
---|
3224 | 3162 | { |
---|
3225 | 3163 | export(); |
---|
3226 | 3164 | //return true; |
---|
3227 | | - } else if (event.getSource() == povItem) |
---|
| 3165 | + } else if (source == povItem) |
---|
3228 | 3166 | { |
---|
3229 | 3167 | generatePOV(); |
---|
3230 | 3168 | //return true; |
---|
3231 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3169 | + } else if (source == zBufferItem) |
---|
3232 | 3170 | { |
---|
3233 | 3171 | try |
---|
3234 | 3172 | { |
---|
.. | .. |
---|
3250 | 3188 | cameraView.repaint(); |
---|
3251 | 3189 | //return true; |
---|
3252 | 3190 | } |
---|
3253 | | - */ else if (event.getSource() == editCameraItem) |
---|
3254 | | - { |
---|
3255 | | - cameraView.ProtectCamera(); |
---|
3256 | | - cameraView.repaint(); |
---|
3257 | | - return; |
---|
3258 | | - } else if (event.getSource() == revertCameraItem) |
---|
3259 | | - { |
---|
3260 | | - cameraView.RevertCamera(); |
---|
3261 | | - cameraView.repaint(); |
---|
3262 | | - return; |
---|
3263 | | -// } else if (event.getSource() == textureButton) |
---|
3264 | | -// { |
---|
3265 | | -// return; // true; |
---|
3266 | | - } else // combos... |
---|
3267 | | - if (event.getSource() == texresMenu) |
---|
| 3191 | + */ else // combos... |
---|
| 3192 | + if (source == texresMenu) |
---|
3268 | 3193 | { |
---|
3269 | 3194 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3270 | 3195 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3276 | 3201 | } |
---|
3277 | 3202 | } |
---|
3278 | 3203 | |
---|
3279 | | - void ToggleAnimation() |
---|
| 3204 | + void New() |
---|
3280 | 3205 | { |
---|
3281 | | - if (!CameraPane.ANIMATION) |
---|
| 3206 | + while (copy.Size() > 1) |
---|
3282 | 3207 | { |
---|
3283 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3208 | + copy.remove(1); |
---|
| 3209 | + } |
---|
| 3210 | + ResetModel(); |
---|
| 3211 | + objEditor.refreshContents(); |
---|
| 3212 | + } |
---|
| 3213 | + |
---|
| 3214 | + void ImportGFD() |
---|
| 3215 | + { |
---|
| 3216 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3284 | 3217 | browser.show(); |
---|
3285 | 3218 | String filename = browser.getFile(); |
---|
3286 | 3219 | if (filename != null && filename.length() > 0) |
---|
3287 | 3220 | { |
---|
3288 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3221 | + String fullname = browser.getDirectory() + filename; |
---|
| 3222 | + |
---|
| 3223 | + //Object3D readobj = |
---|
| 3224 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3225 | + //makeSomething(readobj); |
---|
| 3226 | + } |
---|
| 3227 | + } |
---|
| 3228 | + |
---|
| 3229 | + void ImportVRMLX3D() |
---|
| 3230 | + { |
---|
| 3231 | + if (Grafreed.standAlone) |
---|
| 3232 | + { |
---|
| 3233 | + /**/ |
---|
| 3234 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3235 | + browser.show(); |
---|
| 3236 | + String filename = browser.getFile(); |
---|
| 3237 | + if (filename != null && filename.length() > 0) |
---|
| 3238 | + { |
---|
| 3239 | + String fullname = browser.getDirectory() + filename; |
---|
| 3240 | + LoadVRMLX3D(fullname); |
---|
| 3241 | + } |
---|
| 3242 | + /**/ |
---|
| 3243 | + } |
---|
| 3244 | + } |
---|
| 3245 | + |
---|
| 3246 | + void ToggleAnimation() |
---|
| 3247 | + { |
---|
| 3248 | + if (!Globals.ANIMATION) |
---|
| 3249 | + { |
---|
| 3250 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3251 | + browser.setVisible(true); |
---|
| 3252 | + String filename = browser.getFile(); |
---|
| 3253 | + if (filename != null && filename.length() > 0) |
---|
| 3254 | + { |
---|
| 3255 | + Globals.filename = browser.getDirectory() + filename; |
---|
3289 | 3256 | //CameraPane.framecount = 0; |
---|
3290 | | - CameraPane.imagecount = 0; |
---|
| 3257 | + Globals.imagecount = 0; |
---|
3291 | 3258 | |
---|
3292 | | - CameraPane.ANIMATION ^= true; |
---|
| 3259 | + Globals.ANIMATION ^= true; |
---|
3293 | 3260 | |
---|
3294 | | - GrafreeD.wav.cursor = 0; |
---|
3295 | | - GrafreeD.wav.loop = 0; |
---|
| 3261 | + Grafreed.wav.cursor = 0; |
---|
| 3262 | + Grafreed.wav.loop = 0; |
---|
3296 | 3263 | } |
---|
3297 | 3264 | } else |
---|
3298 | 3265 | { |
---|
3299 | | - CameraPane.ANIMATION ^= true; |
---|
| 3266 | + Globals.ANIMATION ^= true; |
---|
3300 | 3267 | } |
---|
3301 | 3268 | } |
---|
3302 | 3269 | |
---|
.. | .. |
---|
3342 | 3309 | void CreateMaterial() |
---|
3343 | 3310 | { |
---|
3344 | 3311 | //copy.ClearMaterial(); // PATCH |
---|
3345 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3312 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3346 | 3313 | if (copy.selection.size() > 0) |
---|
3347 | 3314 | //SetMaterial(copy); |
---|
3348 | 3315 | { |
---|
.. | .. |
---|
3401 | 3368 | { |
---|
3402 | 3369 | copy.ResetBlockLoop(); // temporary problem |
---|
3403 | 3370 | |
---|
3404 | | - boolean random = CameraPane.RANDOM; |
---|
3405 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3371 | + boolean random = CameraPane.SWITCH; |
---|
| 3372 | + CameraPane.SWITCH = false; // parse everything |
---|
3406 | 3373 | copy.ResetDisplayList(); |
---|
3407 | 3374 | copy.HardTouch(); |
---|
3408 | | - CameraPane.RANDOM = random; |
---|
| 3375 | + CameraPane.SWITCH = random; |
---|
3409 | 3376 | } |
---|
3410 | 3377 | |
---|
3411 | 3378 | // public void applySelf() |
---|
.. | .. |
---|
3475 | 3442 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3476 | 3443 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3477 | 3444 | |
---|
3478 | | - if (!NumberSlider.frozen) |
---|
| 3445 | + if (!cNumberSlider.frozen) |
---|
3479 | 3446 | { |
---|
3480 | 3447 | //System.out.println("Propagate = " + propagate); |
---|
3481 | 3448 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3449 | + |
---|
| 3450 | + if (copy.material != null) |
---|
| 3451 | + { |
---|
| 3452 | + cMaterial mat = copy.material; |
---|
| 3453 | + |
---|
| 3454 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3455 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3456 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3457 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3458 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3459 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3460 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3461 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3462 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3463 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3464 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3465 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3466 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3467 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3468 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3469 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3470 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3471 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3472 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3473 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3474 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3475 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3476 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3477 | + } |
---|
| 3478 | + |
---|
3482 | 3479 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3483 | 3480 | { |
---|
3484 | 3481 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3523 | 3520 | || e.getSource() == apertureField |
---|
3524 | 3521 | || e.getSource() == shadowblurField) |
---|
3525 | 3522 | { |
---|
| 3523 | + new Exception().printStackTrace(); |
---|
3526 | 3524 | System.exit(0); |
---|
3527 | 3525 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3528 | 3526 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3549 | 3547 | //System.out.println("PARENT = " + parent); |
---|
3550 | 3548 | //if (parent != null) |
---|
3551 | 3549 | // parent.applySelf(); |
---|
3552 | | - refreshContents(); |
---|
| 3550 | + if (e.getSource() == normalpushField) |
---|
| 3551 | + { |
---|
| 3552 | + objEditor.refreshContents(); |
---|
| 3553 | + //Refresh(); |
---|
| 3554 | + } |
---|
| 3555 | + else |
---|
| 3556 | + refreshContents(); |
---|
3553 | 3557 | // ??? client.refreshEditWindow(); |
---|
3554 | 3558 | } |
---|
3555 | 3559 | //else |
---|
.. | .. |
---|
3561 | 3565 | //group.name = nameField.getText(); |
---|
3562 | 3566 | //objEditor.applySelf(); |
---|
3563 | 3567 | |
---|
3564 | | - assert (objEditor == this); |
---|
| 3568 | + // OCT2018: assert (objEditor == this); |
---|
3565 | 3569 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3566 | 3570 | //super.applySelf() |
---|
3567 | 3571 | ; else |
---|
.. | .. |
---|
3585 | 3589 | objEditor.copy = keep; |
---|
3586 | 3590 | } |
---|
3587 | 3591 | } |
---|
| 3592 | + |
---|
| 3593 | + if (normalpushField != null) |
---|
| 3594 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3588 | 3595 | } |
---|
3589 | 3596 | |
---|
3590 | 3597 | void SnapObject() |
---|
.. | .. |
---|
3839 | 3846 | |
---|
3840 | 3847 | radioPanel.revalidate(); |
---|
3841 | 3848 | radioPanel.repaint(); |
---|
3842 | | - ctrlPanel.revalidate(); // ? new |
---|
| 3849 | + ctrlPanel.validate(); // ? new |
---|
3843 | 3850 | ctrlPanel.repaint(); |
---|
3844 | 3851 | } |
---|
3845 | 3852 | } |
---|
.. | .. |
---|
4051 | 4058 | } |
---|
4052 | 4059 | } |
---|
4053 | 4060 | } |
---|
| 4061 | + |
---|
4054 | 4062 | LoadGFDThread loadGFDThread; |
---|
4055 | 4063 | |
---|
4056 | 4064 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4071 | 4079 | try |
---|
4072 | 4080 | { |
---|
4073 | 4081 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4074 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4082 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4083 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4075 | 4084 | |
---|
4076 | 4085 | readobj = (Object3D) p.readObject(); |
---|
4077 | 4086 | istream.close(); |
---|
.. | .. |
---|
4079 | 4088 | readobj.ResetDisplayList(); |
---|
4080 | 4089 | } catch (Exception e) |
---|
4081 | 4090 | { |
---|
4082 | | - e.printStackTrace(); |
---|
| 4091 | + //e.printStackTrace(); |
---|
| 4092 | + try |
---|
| 4093 | + { |
---|
| 4094 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4095 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4096 | + |
---|
| 4097 | + readobj = (Object3D) p.readObject(); |
---|
| 4098 | + istream.close(); |
---|
| 4099 | + |
---|
| 4100 | + readobj.ResetDisplayList(); |
---|
| 4101 | + } catch (Exception e2) |
---|
| 4102 | + { |
---|
| 4103 | + e2.printStackTrace(); |
---|
| 4104 | + } |
---|
4083 | 4105 | } |
---|
4084 | 4106 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4085 | 4107 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4196 | 4218 | |
---|
4197 | 4219 | void load() // throws ClassNotFoundException |
---|
4198 | 4220 | { |
---|
4199 | | - if (GrafreeD.standAlone) |
---|
| 4221 | + if (Grafreed.standAlone) |
---|
4200 | 4222 | { |
---|
4201 | 4223 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4202 | 4224 | browser.show(); |
---|
.. | .. |
---|
4283 | 4305 | try |
---|
4284 | 4306 | { |
---|
4285 | 4307 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4286 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4308 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4309 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4287 | 4310 | |
---|
4288 | 4311 | p.writeObject(copy); |
---|
4289 | 4312 | p.flush(); |
---|
4290 | 4313 | |
---|
| 4314 | + zstream.close(); |
---|
4291 | 4315 | ostream.close(); |
---|
4292 | 4316 | |
---|
4293 | 4317 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4297 | 4321 | { |
---|
4298 | 4322 | } |
---|
4299 | 4323 | } |
---|
| 4324 | + |
---|
4300 | 4325 | String lastname; |
---|
4301 | 4326 | |
---|
4302 | 4327 | void saveAs() |
---|
4303 | 4328 | { |
---|
4304 | | - if (GrafreeD.standAlone) |
---|
| 4329 | + if (Grafreed.standAlone) |
---|
4305 | 4330 | { |
---|
4306 | 4331 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4307 | 4332 | browser.setVisible(true); |
---|
.. | .. |
---|
4406 | 4431 | try |
---|
4407 | 4432 | { |
---|
4408 | 4433 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4409 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4410 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4434 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4435 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4411 | 4436 | |
---|
4412 | 4437 | Object3D objectparent = obj.parent; |
---|
4413 | 4438 | obj.parent = null; |
---|
4414 | 4439 | |
---|
4415 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4440 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4416 | 4441 | |
---|
4417 | 4442 | obj.parent = objectparent; |
---|
4418 | 4443 | |
---|
.. | .. |
---|
4424 | 4449 | p.writeObject(object); |
---|
4425 | 4450 | p.flush(); |
---|
4426 | 4451 | |
---|
| 4452 | + zstream.close(); |
---|
4427 | 4453 | ostream.close(); |
---|
4428 | | - // zstream.close(); |
---|
4429 | 4454 | |
---|
4430 | 4455 | // group.selection.get(0).parent = parent; |
---|
4431 | 4456 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4446 | 4471 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4447 | 4472 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4448 | 4473 | copy.generatePOV(buffer); |
---|
4449 | | - if (GrafreeD.standAlone) |
---|
| 4474 | + if (Grafreed.standAlone) |
---|
4450 | 4475 | { |
---|
4451 | 4476 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4452 | 4477 | browser.show(); |
---|
.. | .. |
---|
4472 | 4497 | Object3D client; |
---|
4473 | 4498 | Object3D copy; |
---|
4474 | 4499 | MenuBar menuBar; |
---|
4475 | | - Menu windowMenu; |
---|
| 4500 | + Menu fileMenu; |
---|
| 4501 | + MenuItem newItem; |
---|
4476 | 4502 | MenuItem loadItem; |
---|
4477 | 4503 | MenuItem saveItem; |
---|
4478 | 4504 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4480 | 4506 | MenuItem reexportItem; |
---|
4481 | 4507 | MenuItem povItem; |
---|
4482 | 4508 | MenuItem closeItem; |
---|
4483 | | - Menu cameraMenu; |
---|
| 4509 | + |
---|
4484 | 4510 | CheckboxMenuItem zBufferItem; |
---|
4485 | 4511 | //MenuItem normalLensItem; |
---|
4486 | | - MenuItem editCameraItem; |
---|
4487 | | - MenuItem revertCameraItem; |
---|
4488 | | - CheckboxMenuItem toggleLiveItem; |
---|
4489 | 4512 | MenuItem stepItem; |
---|
| 4513 | + CheckboxMenuItem toggleLiveItem; |
---|
4490 | 4514 | CheckboxMenuItem toggleFullScreenItem; |
---|
4491 | 4515 | CheckboxMenuItem toggleTimelineItem; |
---|
4492 | 4516 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4495 | 4519 | CheckboxMenuItem toggleFootContactItem; |
---|
4496 | 4520 | CheckboxMenuItem toggleDLItem; |
---|
4497 | 4521 | CheckboxMenuItem toggleTextureItem; |
---|
4498 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4522 | + CheckboxMenuItem toggleSwitchItem; |
---|
4499 | 4523 | CheckboxMenuItem toggleRootItem; |
---|
4500 | 4524 | CheckboxMenuItem animationItem; |
---|
4501 | 4525 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4503 | 4527 | JSplitPane mainPanel; |
---|
4504 | 4528 | JScrollPane scrollpane; |
---|
4505 | 4529 | JPanel toolbarPanel; |
---|
4506 | | - JPanel treePanel; |
---|
| 4530 | + cGridBag treePanel; |
---|
4507 | 4531 | JPanel radioPanel; |
---|
4508 | 4532 | ButtonGroup buttonGroup; |
---|
4509 | | - JPanel ctrlPanel; |
---|
4510 | | - JPanel materialPanel; |
---|
| 4533 | + cGridBag ctrlPanel; |
---|
| 4534 | + cGridBag materialPanel; |
---|
4511 | 4535 | JScrollPane infoPanel; |
---|
4512 | | - JPanel optionsPanel; |
---|
| 4536 | + cGridBag optionsPanel; |
---|
4513 | 4537 | JTabbedPane objectPanel; |
---|
4514 | | - JPanel XYZPanel; |
---|
| 4538 | + cGridBag XYZPanel; |
---|
4515 | 4539 | JSplitPane gridPanel; |
---|
4516 | 4540 | JSplitPane bigPanel; |
---|
4517 | | - JPanel bigThree; |
---|
4518 | | - JTabbedPane scenePanel; |
---|
4519 | | - JPanel centralPanel; |
---|
| 4541 | + cGridBag bigThree; |
---|
| 4542 | + cGridBag scenePanel; |
---|
| 4543 | + cGridBag centralPanel; |
---|
| 4544 | + JSplitPane cameraPanel; |
---|
4520 | 4545 | JPanel timelinePanel; |
---|
4521 | 4546 | JMenuBar timelineMenubar; |
---|
4522 | 4547 | JSplitPane framePanel; |
---|
.. | .. |
---|
4568 | 4593 | // MATERIAL |
---|
4569 | 4594 | JLabel materialLabel; |
---|
4570 | 4595 | JLabel colorLabel; |
---|
4571 | | - NumberSlider colorField; |
---|
| 4596 | + cNumberSlider colorField; |
---|
4572 | 4597 | JLabel modulationLabel; |
---|
4573 | | - NumberSlider modulationField; |
---|
| 4598 | + cNumberSlider modulationField; |
---|
4574 | 4599 | JLabel metalnessLabel; |
---|
4575 | | - NumberSlider metalnessField; |
---|
| 4600 | + cNumberSlider metalnessField; |
---|
4576 | 4601 | JLabel diffuseLabel; |
---|
4577 | | - NumberSlider diffuseField; |
---|
| 4602 | + cNumberSlider diffuseField; |
---|
4578 | 4603 | JLabel specularLabel; |
---|
4579 | | - NumberSlider specularField; |
---|
| 4604 | + cNumberSlider specularField; |
---|
4580 | 4605 | JLabel shininessLabel; |
---|
4581 | | - NumberSlider shininessField; |
---|
| 4606 | + cNumberSlider shininessField; |
---|
4582 | 4607 | JLabel shiftLabel; |
---|
4583 | | - NumberSlider shiftField; |
---|
| 4608 | + cNumberSlider shiftField; |
---|
4584 | 4609 | JLabel ambientLabel; |
---|
4585 | | - NumberSlider ambientField; |
---|
| 4610 | + cNumberSlider ambientField; |
---|
4586 | 4611 | JLabel lightareaLabel; |
---|
4587 | | - NumberSlider lightareaField; |
---|
| 4612 | + cNumberSlider lightareaField; |
---|
4588 | 4613 | JLabel diffusenessLabel; |
---|
4589 | | - NumberSlider diffusenessField; |
---|
| 4614 | + cNumberSlider diffusenessField; |
---|
4590 | 4615 | JLabel velvetLabel; |
---|
4591 | | - NumberSlider velvetField; |
---|
| 4616 | + cNumberSlider velvetField; |
---|
4592 | 4617 | JLabel sheenLabel; |
---|
4593 | | - NumberSlider sheenField; |
---|
| 4618 | + cNumberSlider sheenField; |
---|
4594 | 4619 | JLabel subsurfaceLabel; |
---|
4595 | | - NumberSlider subsurfaceField; |
---|
| 4620 | + cNumberSlider subsurfaceField; |
---|
4596 | 4621 | //JLabel bumpLabel; |
---|
4597 | 4622 | //NumberSlider bumpField; |
---|
4598 | 4623 | JLabel backlitLabel; |
---|
4599 | | - NumberSlider backlitField; |
---|
| 4624 | + cNumberSlider backlitField; |
---|
4600 | 4625 | JLabel anisoLabel; |
---|
4601 | | - NumberSlider anisoField; |
---|
| 4626 | + cNumberSlider anisoField; |
---|
4602 | 4627 | JLabel anisoVLabel; |
---|
4603 | | - NumberSlider anisoVField; |
---|
| 4628 | + cNumberSlider anisoVField; |
---|
4604 | 4629 | JLabel cameraLabel; |
---|
4605 | | - NumberSlider cameraField; |
---|
| 4630 | + cNumberSlider cameraField; |
---|
4606 | 4631 | JLabel selfshadowLabel; |
---|
4607 | | - NumberSlider selfshadowField; |
---|
| 4632 | + cNumberSlider selfshadowField; |
---|
4608 | 4633 | JLabel shadowLabel; |
---|
4609 | | - NumberSlider shadowField; |
---|
| 4634 | + cNumberSlider shadowField; |
---|
4610 | 4635 | JLabel textureLabel; |
---|
4611 | | - NumberSlider textureField; |
---|
| 4636 | + cNumberSlider textureField; |
---|
4612 | 4637 | JLabel opacityLabel; |
---|
4613 | | - NumberSlider opacityField; |
---|
| 4638 | + cNumberSlider opacityField; |
---|
4614 | 4639 | JLabel fakedepthLabel; |
---|
4615 | | - NumberSlider fakedepthField; |
---|
| 4640 | + cNumberSlider fakedepthField; |
---|
4616 | 4641 | JLabel shadowbiasLabel; |
---|
4617 | | - NumberSlider shadowbiasField; |
---|
| 4642 | + cNumberSlider shadowbiasField; |
---|
4618 | 4643 | JLabel bumpLabel; |
---|
4619 | | - NumberSlider bumpField; |
---|
| 4644 | + cNumberSlider bumpField; |
---|
4620 | 4645 | JLabel noiseLabel; |
---|
4621 | | - NumberSlider noiseField; |
---|
| 4646 | + cNumberSlider noiseField; |
---|
4622 | 4647 | JLabel powerLabel; |
---|
4623 | | - NumberSlider powerField; |
---|
| 4648 | + cNumberSlider powerField; |
---|
4624 | 4649 | JLabel borderfadeLabel; |
---|
4625 | | - NumberSlider borderfadeField; |
---|
| 4650 | + cNumberSlider borderfadeField; |
---|
4626 | 4651 | JLabel fogLabel; |
---|
4627 | | - NumberSlider fogField; |
---|
| 4652 | + cNumberSlider fogField; |
---|
4628 | 4653 | JLabel opacityPowerLabel; |
---|
4629 | | - NumberSlider opacityPowerField; |
---|
| 4654 | + cNumberSlider opacityPowerField; |
---|
4630 | 4655 | JTree jTree; |
---|
4631 | 4656 | //ObjectUI parent; |
---|
| 4657 | + |
---|
| 4658 | + cNumberSlider normalpushField; |
---|
| 4659 | + |
---|
| 4660 | + private MenuItem importGFDItem; |
---|
| 4661 | + private MenuItem importVRMLX3DItem; |
---|
| 4662 | + private MenuItem import3DSItem; |
---|
| 4663 | + private MenuItem importOBJItem; |
---|
4632 | 4664 | } |
---|