Normand Briere
2019-08-12 8f1afe25ea8fc8801aab66331c32a50859a758c2
ObjEditor.java
....@@ -4,6 +4,7 @@
44
55 import java.awt.*;
66 import java.awt.event.*;
7
+import java.awt.image.BufferedImage;
78 import javax.swing.*;
89 import javax.swing.event.*;
910 import javax.swing.text.*;
....@@ -14,10 +15,15 @@
1415 //import javax.swing.plaf.ColorUIResource;
1516 //import javax.swing.plaf.metal.DefaultMetalTheme;
1617
18
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
19
+import javax.swing.plaf.basic.BasicSplitPaneUI;
20
+
1721 //import javax.media.opengl.GLCanvas;
1822
1923 import //weka.core.
2024 matrix.Matrix;
25
+
26
+import grafeme.ui.*;
2127
2228 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2329 ActionListener, ChangeListener,
....@@ -28,7 +34,88 @@
2834 iSendInfo
2935 //KeyListener
3036 {
37
+ public cToggleButton pinButton;
38
+ boolean timeline;
39
+ boolean wasFullScreen;
3140
41
+ GroupEditor callee;
42
+ JFrame frame;
43
+
44
+ static ObjEditor theFrame;
45
+
46
+ public cGridBag GetSeparator()
47
+ {
48
+ cGridBag separator = new cGridBag();
49
+ separator.add(new JSeparator());
50
+ separator.preferredHeight = 5;
51
+ return separator;
52
+ }
53
+
54
+ cButton GetButton(String name, boolean border)
55
+ {
56
+ ImageIcon icon = GetIcon(name);
57
+ return new cButton(icon, border);
58
+ }
59
+
60
+ cLabel GetLabel(String name, boolean border)
61
+ {
62
+ //ImageIcon icon = GetIcon(name);
63
+ return new cLabel(GetImage(name), border);
64
+ }
65
+
66
+ cToggleButton GetToggleButton(String name, boolean border)
67
+ {
68
+ ImageIcon icon = GetIcon(name);
69
+ return new cToggleButton(icon, border);
70
+ }
71
+
72
+ cCheckBox GetCheckBox(String name, boolean border)
73
+ {
74
+ ImageIcon icon = GetIcon(name);
75
+ return new cCheckBox(icon, border);
76
+ }
77
+
78
+ ImageIcon GetIcon(String name)
79
+ {
80
+ try
81
+ {
82
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
83
+
84
+// if (image.getWidth() > 48 && image.getHeight() > 48)
85
+// {
86
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
87
+// Graphics2D g = resized.createGraphics();
88
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
89
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
90
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
91
+// g.dispose();
92
+//
93
+// image = resized;
94
+// }
95
+
96
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
97
+ return icon;
98
+ }
99
+ catch (Exception e)
100
+ {
101
+ return null;
102
+ }
103
+ }
104
+
105
+ BufferedImage GetImage(String name)
106
+ {
107
+ try
108
+ {
109
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
110
+
111
+ return image;
112
+ }
113
+ catch (Exception e)
114
+ {
115
+ return null;
116
+ }
117
+ }
118
+
32119 // SCRIPT
33120
34121 transient JFrame textpanel = null;
....@@ -119,51 +206,62 @@
119206 void keyPressed(int key, int modifiers)
120207 {
121208 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
209
+ Globals.theRenderer.keyPressed(key, modifiers);
123210 }
124211 */
125212
126213 static GridBagConstraints aConstraints;
127214 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
215
+
130216 static int GRIDWIDTH = 100; // 4;
131217
132218 public void closeUI()
133219 {
134220 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
221
+// System.out.println("this = " + this);
222
+// System.out.println("objEditor = " + objEditor);
137223 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
224
+// objEditor.ctrlPanel.remove(nameField);
139225
140
- if (!GroupEditor.allparams)
226
+ objEditor.ctrlPanel.remove(namePanel);
227
+
228
+ if (!allparams)
141229 return;
142230
143
- objEditor.ctrlPanel.remove(liveCB);
144
- objEditor.ctrlPanel.remove(hideCB);
145
- objEditor.ctrlPanel.remove(markCB);
146
-
147
- objEditor.ctrlPanel.remove(randomCB);
148
- objEditor.ctrlPanel.remove(speedupCB);
149
- objEditor.ctrlPanel.remove(rewindCB);
150
-
151
- objEditor.ctrlPanel.remove(resetButton);
152
- objEditor.ctrlPanel.remove(stepButton);
153
-// objEditor.ctrlPanel.remove(stepAllButton);
154
-// objEditor.ctrlPanel.remove(resetAllButton);
155
- objEditor.ctrlPanel.remove(link2masterCB);
156
- //objEditor.ctrlPanel.remove(flipVCB);
157
- //objEditor.ctrlPanel.remove(texresMenu);
158
- objEditor.ctrlPanel.remove(slowerButton);
159
- objEditor.ctrlPanel.remove(fasterButton);
160
- objEditor.ctrlPanel.remove(remarkButton);
231
+// objEditor.ctrlPanel.remove(liveCB);
232
+// objEditor.ctrlPanel.remove(hideCB);
233
+// objEditor.ctrlPanel.remove(markCB);
234
+//
235
+// objEditor.ctrlPanel.remove(randomCB);
236
+// objEditor.ctrlPanel.remove(speedupCB);
237
+// objEditor.ctrlPanel.remove(rewindCB);
238
+//
239
+// objEditor.ctrlPanel.remove(resetButton);
240
+// objEditor.ctrlPanel.remove(stepButton);
241
+//// objEditor.ctrlPanel.remove(stepAllButton);
242
+//// objEditor.ctrlPanel.remove(resetAllButton);
243
+// objEditor.ctrlPanel.remove(link2masterCB);
244
+// //objEditor.ctrlPanel.remove(flipVCB);
245
+// //objEditor.ctrlPanel.remove(texresMenu);
246
+// objEditor.ctrlPanel.remove(slowerButton);
247
+// objEditor.ctrlPanel.remove(fasterButton);
248
+// objEditor.ctrlPanel.remove(remarkButton);
249
+
250
+ objEditor.ctrlPanel.remove(setupPanel);
251
+ objEditor.ctrlPanel.remove(setupPanel2);
252
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
253
+ objEditor.ctrlPanel.remove(pushPanel);
254
+ //objEditor.ctrlPanel.remove(fillPanel);
255
+
256
+ //Remove(normalpushField);
161257 }
162258
163259 public ObjEditor GetEditor()
164260 {
165261 return objEditor; //.GetEditor();
166262 }
263
+
264
+ // Sometimes myself, sometimes my callee's.
167265 ObjEditor objEditor;
168266
169267 /*
....@@ -199,6 +297,14 @@
199297 client = inClient;
200298 copy = client;
201299
300
+// if (copy.versionlist == null)
301
+// {
302
+// copy.versionlist = new Object3D[100];
303
+// copy.versionindex = -1;
304
+//
305
+// callee.Save(true);
306
+// }
307
+
202308 // "this" is not called: SetupUI2(objEditor);
203309 }
204310
....@@ -212,6 +318,14 @@
212318 client = inClient;
213319 copy = client;
214320
321
+ if (copy.versionlist == null)
322
+ {
323
+ copy.versionlist = new Object3D[100];
324
+ copy.versionindex = -1;
325
+
326
+// Save(true);
327
+ }
328
+
215329 SetupUI2(callee.GetEditor());
216330 }
217331
....@@ -226,6 +340,7 @@
226340 //localCopy.parent = null;
227341
228342 frame = new JFrame();
343
+ frame.setUndecorated(false);
229344 objEditor = this;
230345 this.callee = callee;
231346
....@@ -238,11 +353,19 @@
238353 //if (!isDisplayable())
239354 //setUndecorated(true);
240355
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
356
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242357 client = inClient;
243358 copy = localCopy;
244359 copy.editWindow = this;
245360
361
+// if (copy.versionlist == null)
362
+// {
363
+// copy.versionlist = new Object3D[100];
364
+// copy.versionindex = -1;
365
+//
366
+// Save(true);
367
+// }
368
+
246369 SetupMenu();
247370
248371 //SetupName(objEditor); // new
....@@ -256,28 +379,49 @@
256379 return frame.action(event, obj);
257380 }
258381
382
+ // Cannot work without static
383
+ static boolean allparams = true;
384
+
385
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
386
+
259387 void SetupMenu()
260388 {
261389 frame.setMenuBar(menuBar = new MenuBar());
262
- menuBar.add(windowMenu = new Menu("File"));
263
- windowMenu.add(loadItem = new MenuItem("Load..."));
264
- windowMenu.add("-");
265
- windowMenu.add(saveItem = new MenuItem("Save"));
266
- windowMenu.add(saveAsItem = new MenuItem("Save As..."));
390
+ menuBar.add(fileMenu = new Menu("File"));
391
+ fileMenu.add(newItem = new MenuItem("New"));
392
+ fileMenu.add(openItem = new MenuItem("Open..."));
393
+
394
+ //oe.menuBar.add(menu = new Menu("Include"));
395
+ Menu menu = new Menu("Import");
396
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
397
+ importOBJItem.addActionListener(this);
398
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
399
+ import3DSItem.addActionListener(this);
400
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
401
+ importVRMLX3DItem.addActionListener(this);
402
+ menu.add("-");
403
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
404
+ importGFDItem.addActionListener(this);
405
+ fileMenu.add(menu);
406
+ fileMenu.add("-");
407
+
408
+ fileMenu.add(saveItem = new MenuItem("Save"));
409
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
267410 //windowMenu.add(povItem = new MenuItem("Emit POV-Ray..."));
268
- windowMenu.add("-");
269
- windowMenu.add(exportAsItem = new MenuItem("Export Selection..."));
270
- windowMenu.add(reexportItem = new MenuItem("Re-export"));
271
- windowMenu.add("-");
411
+ fileMenu.add("-");
412
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
413
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
414
+ fileMenu.add("-");
272415 if (client.parent != null)
273416 {
274
- windowMenu.add(closeItem = new MenuItem("Close"));
417
+ fileMenu.add(closeItem = new MenuItem("Close"));
275418 } else
276419 {
277
- windowMenu.add(closeItem = new MenuItem("Exit"));
420
+ fileMenu.add(closeItem = new MenuItem("Exit"));
278421 }
279422
280
- loadItem.addActionListener(this);
423
+ newItem.addActionListener(this);
424
+ openItem.addActionListener(this);
281425 saveItem.addActionListener(this);
282426 saveAsItem.addActionListener(this);
283427 exportAsItem.addActionListener(this);
....@@ -285,80 +429,71 @@
285429 //povItem.addActionListener(this);
286430 closeItem.addActionListener(this);
287431
288
- menuBar.add(cameraMenu = new Menu("View"));
289
- //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
290
- //zBufferItem.addActionListener(this);
291
- //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
292
- //normalLensItem.addActionListener(this);
293
- cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
294
- revertCameraItem.addActionListener(this);
295
- cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen"));
296
- toggleFullItem.addItemListener(this);
297
- toggleFullItem.setState(CameraPane.FULLSCREEN);
298
- cameraMenu.add("-");
299
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
300
- toggleTextureItem.addItemListener(this);
301
- toggleTextureItem.setState(CameraPane.textureon);
302
- cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
303
- toggleLiveItem.addItemListener(this);
304
- toggleLiveItem.setState(CameraPane.isLIVE());
305
- cameraMenu.add(stepItem = new MenuItem("Step"));
306
- stepItem.addActionListener(this);
307
-// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
308
-// toggleDLItem.addItemListener(this);
309
-// toggleDLItem.setState(false);
310
- cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
311
- toggleRenderItem.addItemListener(this);
312
- toggleRenderItem.setState(!CameraPane.frozen);
313
- cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
314
- toggleDebugItem.addItemListener(this);
315
- toggleDebugItem.setState(CameraPane.DEBUG);
316
- cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
317
- toggleFrustumItem.addItemListener(this);
318
- toggleFrustumItem.setState(CameraPane.FRUSTUM);
319
- cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
320
- toggleFootContactItem.addItemListener(this);
321
- toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
322
- cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random"));
323
- toggleRandomItem.addItemListener(this);
324
- toggleRandomItem.setState(CameraPane.RANDOM);
325
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
326
- toggleHandleItem.addItemListener(this);
327
- toggleHandleItem.setState(CameraPane.HANDLES);
328
- cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
329
- togglePaintItem.addItemListener(this);
330
- togglePaintItem.setState(CameraPane.PAINTMODE);
331
-// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
332
-// toggleRootItem.addItemListener(this);
333
-// toggleRootItem.setState(false);
334
-// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
335
-// animationItem.addItemListener(this);
336
-// animationItem.setState(CameraPane.ANIMATION);
337
- cameraMenu.add("-");
338
- cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
339
- editCameraItem.addActionListener(this);
340
-
341432 objectPanel = new JTabbedPane();
433
+
434
+ ChangeListener changeListener = new ChangeListener()
435
+ {
436
+ public void stateChanged(ChangeEvent changeEvent)
437
+ {
438
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
439
+// {
440
+// if (latestObject != null)
441
+// {
442
+// refreshContents(true);
443
+// SetMaterial(latestObject);
444
+// }
445
+//
446
+// materialFlushed = true;
447
+// }
448
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
449
+// {
450
+// if (listUI.size() == 0)
451
+// EditSelection(false);
452
+// }
453
+
454
+// refreshContents(false); // To refresh Info tab
455
+ }
456
+ };
457
+ objectPanel.addChangeListener(changeListener);
458
+
342459 toolbarPanel = new JPanel();
343460 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
461
+
462
+ treePanel = new cGridBag();
345463 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
347
- ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
349
- materialPanel.setName("Material");
464
+
465
+ editPanel = new cGridBag().setVertical(true);
466
+ //editPanel.setName("Edit");
467
+
468
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
469
+
470
+ editCommandsPanel = new cGridBag();
471
+ editPanel.add(editCommandsPanel);
472
+ editPanel.add(ctrlPanel);
473
+
474
+ toolboxPanel = new cGridBag().setVertical(true);
475
+ //toolboxPanel.setName("Toolbox");
476
+
477
+ skyboxPanel = new cGridBag().setVertical(true);
478
+
479
+ materialPanel = new cGridBag().setVertical(false);
480
+ //materialPanel.setName("Material");
481
+
350482 /*JTextPane*/
351483 infoarea = createTextPane();
484
+ doc = infoarea.getStyledDocument();
485
+
352486 infoarea.setEditable(true);
353487 SetText();
488
+
354489 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355490 // infoarea.setOpaque(false);
356491 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
492
+// TEXTAREA infoarea.setLineWrap(true);
493
+// TEXTAREA infoarea.setWrapStyleWord(true);
359494 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
360
- infoPanel.setPreferredSize(new Dimension(50, 200));
361
- infoPanel.setName("Info");
495
+ infoPanel.setPreferredSize(new Dimension(1, 1));
496
+ //infoPanel.setName("Info");
362497 //infoPanel.setLayout(new BorderLayout());
363498 //infoPanel.add(createTextPane());
364499
....@@ -366,16 +501,23 @@
366501 mainPanel.setName("Main");
367502 mainPanel.setContinuousLayout(true);
368503 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370504 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
372
-
505
+ mainPanel.setDividerLocation(0.5); //1.0);
506
+ mainPanel.setResizeWeight(0.5);
507
+
508
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
509
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
510
+ divider.setDividerSize(15);
511
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
512
+
513
+ mainPanel.setUI(new BasicSplitPaneUI());
514
+
373515 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374516 //mainPanel.setLayout(new GridBagLayout());
375517 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
518
+// treePanel.setLayout(new GridBagLayout());
519
+ //ctrlPanel.setLayout(new GridBagLayout());
520
+ //materialPanel.setLayout(new GridBagLayout());
379521
380522 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381523 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +556,7 @@
414556 static String newline = "\n";
415557 protected static final String buttonString = "JButton";
416558 StyledDocument doc;
417
- JTextArea infoarea;
559
+ JTextPane infoarea;
418560
419561 void ClearInfo()
420562 {
....@@ -437,10 +579,10 @@
437579 e.printStackTrace();
438580 }
439581
440
- String selection = infoarea.getText();
441
- java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
442
- java.awt.datatransfer.Clipboard clipboard =
443
- Toolkit.getDefaultToolkit().getSystemClipboard();
582
+// String selection = infoarea.getText();
583
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
584
+// java.awt.datatransfer.Clipboard clipboard =
585
+// Toolkit.getDefaultToolkit().getSystemClipboard();
444586 //clipboard.setContents(data, data);
445587 }
446588
....@@ -463,13 +605,13 @@
463605 //SendInfo("Name:", "bold");
464606 if (sel.GetTextures() != null || debug)
465607 {
466
- si.SendInfo(sel.toString(), "bold");
608
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
467609 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
468610 if (sel.Size() > 0)
469611 {
470612 si.SendInfo("#children = " + sel.Size(), "regular");
471613 }
472
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
614
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
473615 if (debug)
474616 {
475617 try
....@@ -481,7 +623,10 @@
481623 }
482624
483625 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
626
+ {
627
+ si.SendInfo(" BBox min: " + minima, "regular");
628
+ si.SendInfo(" BBox max: " + maxima, "regular");
629
+ }
485630
486631 if (sel.bRep != null)
487632 {
....@@ -508,7 +653,7 @@
508653 }
509654 if (sel.support != null)
510655 {
511
- si.SendInfo(" support: " + sel.support, "regular");
656
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
512657 }
513658 if (sel.scriptnode != null)
514659 {
....@@ -522,18 +667,18 @@
522667 maxima.y = sel.toParent[3][1];
523668 maxima.z = sel.toParent[3][2];
524669 si.SendInfo(" Orig: " + maxima, "regular");
525
- maxima.x = sel.globalTransform[3][0];
526
- maxima.y = sel.globalTransform[3][1];
527
- maxima.z = sel.globalTransform[3][2];
528
- if (full)
529
- si.SendInfo(" Global Orig: " + maxima, "regular");
530670 maxima.x = sel.toParent[0][0];
531671 maxima.y = sel.toParent[1][1];
532672 maxima.z = sel.toParent[2][2];
533673 si.SendInfo(" Scale: " + maxima, "regular");
534
- maxima.x = sel.globalTransform[0][0];
535
- maxima.y = sel.globalTransform[1][1];
536
- maxima.z = sel.globalTransform[2][2];
674
+ maxima.x = sel.globalTransform[3][0];
675
+ maxima.y = sel.globalTransform[3][1];
676
+ maxima.z = sel.globalTransform[3][2];
677
+ if (full)
678
+ si.SendInfo(" Global Orig: " + maxima, "regular");
679
+ maxima.x = sel.globalTransform[0][0];
680
+ maxima.y = sel.globalTransform[1][1];
681
+ maxima.z = sel.globalTransform[2][2];
537682 if (full)
538683 si.SendInfo(" Global Scale: " + maxima, "regular");
539684 }
....@@ -579,6 +724,9 @@
579724 {
580725 CameraPane.pointflow = (PointFlow) sel;
581726 }
727
+
728
+ si.SendInfo("_____________________", "regular");
729
+ si.SendInfo("", "regular");
582730 }
583731 }
584732
....@@ -594,52 +742,205 @@
594742 }
595743 }
596744
597
- private JTextArea createTextPane()
598
- {
599
- String[] initString =
600
- {
601
- "This is an editable JTextPane, ", //regular
602
- "another ", //italic
603
- "styled ", //bold
604
- "text ", //small
605
- "component, ", //large
606
- "which supports embedded components..." + newline,//regular
607
- " " + newline, //button
608
- "...and embedded icons..." + newline, //regular
609
- " ", //icon
610
- newline + "JTextPane is a subclass of JEditorPane that "
611
- + "uses a StyledEditorKit and StyledDocument, and provides "
612
- + "cover methods for interacting with those objects."
613
- };
745
+//static GraphicsDevice device = GraphicsEnvironment
746
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
614747
615
- String[] initStyles =
616
- {
617
- "regular", "italic", "bold", "small", "large",
618
- "regular", "button", "regular", "icon",
619
- "regular"
620
- };
748
+ Rectangle keeprect;
749
+ cRadio radio;
750
+
751
+cButton keepButton;
752
+ cButton twoButton; // Full 3D
753
+ cButton sixButton;
754
+ cButton threeButton;
755
+ cButton sevenButton;
756
+ cButton fourButton; // full panel
757
+ cButton oneButton; // full XYZ
758
+ //cButton currentLayout;
759
+
760
+ boolean maximized;
761
+
762
+ cButton fullscreenLayout;
763
+ cButton expandedLayout;
621764
622
- JTextPane textPane = new JTextPane();
623
- textPane.setEditable(true);
624
- /*StyledDocument*/ doc = textPane.getStyledDocument();
625
- addStylesToDocument(doc);
626
-
627
- try
765
+ void Minimize()
628766 {
629
- for (int j = 0; j < 2; j++)
767
+ frame.setState(Frame.ICONIFIED);
768
+ frame.validate();
769
+ }
770
+
771
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
772
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
773
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
774
+ void Maximize()
775
+ {
776
+ if (CameraPane.FULLSCREEN)
630777 {
631
- for (int i = 0; i < initString.length; i++)
632
- {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
635
- }
778
+ ToggleFullScreen();
636779 }
637
- } catch (BadLocationException ble)
780
+
781
+ if (maximized)
782
+ {
783
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
784
+ }
785
+ else
786
+ {
787
+ keeprect = frame.getBounds();
788
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
789
+// Dimension rect2 = frame.getToolkit().getScreenSize();
790
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
791
+// frame.setState(Frame.MAXIMIZED_BOTH);
792
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
793
+ }
794
+
795
+ maximized ^= true;
796
+
797
+ frame.validate();
798
+ }
799
+
800
+ cButton minButton;
801
+ cButton maxButton;
802
+ cButton fullButton;
803
+ cButton collapseButton;
804
+ cButton maximize3DButton;
805
+
806
+ void ToggleFullScreen()
638807 {
639
- System.err.println("Couldn't insert initial text into text pane.");
808
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
809
+
810
+ cameraView.ToggleFullScreen();
811
+
812
+ if (!CameraPane.FULLSCREEN)
813
+ {
814
+ device.setFullScreenWindow(null);
815
+ frame.dispose();
816
+ frame.setUndecorated(false);
817
+ frame.validate();
818
+ frame.setVisible(true);
819
+
820
+ //frame.setVisible(false);
821
+// frame.removeNotify();
822
+// frame.setUndecorated(false);
823
+// frame.addNotify();
824
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
825
+
826
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
827
+// X framePanel.add(bigThree);
828
+// X frame.getContentPane().add(/*"Center",*/framePanel);
829
+// framePanel.setDividerLocation(46); // icons are 24x24
830
+
831
+ //frame.setVisible(true);
832
+// radio.layout = keepButton;
833
+ //theFrame = null;
834
+ keepButton = null;
835
+// radio.layout.doClick();
836
+
837
+ } else
838
+ {
839
+ keepButton = radio.layout;
840
+ //keeprect = frame.getBounds();
841
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
842
+// frame.getToolkit().getScreenSize().height);
843
+ //frame.setVisible(false);
844
+
845
+ frame.dispose();
846
+ frame.setUndecorated(true);
847
+ device.setFullScreenWindow(frame);
848
+ frame.validate();
849
+ frame.setVisible(true);
850
+// frame.removeNotify();
851
+// frame.setUndecorated(true);
852
+// frame.addNotify();
853
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
854
+// X framePanel.remove(bigThree);
855
+// X frame.getContentPane().add(/*"Center",*/bigThree);
856
+// framePanel.setDividerLocation(0);
857
+
858
+// radio.layout = fullscreenLayout;
859
+// radio.layout.doClick();
860
+ //frame.setVisible(true);
861
+ }
862
+ frame.validate();
863
+
864
+ cameraView.requestFocusInWindow();
640865 }
641866
642
- return new JTextArea(); // textPane;
867
+ void CollapseToolbar()
868
+ {
869
+ framePanel.setDividerLocation(0);
870
+ //frame.validate();
871
+
872
+ cameraView.requestFocusInWindow();
873
+ }
874
+
875
+ private Object3D Duplicate(Object3D object)
876
+ {
877
+ boolean temp = CameraPane.SWITCH;
878
+ CameraPane.SWITCH = false;
879
+
880
+ object.ExtractBigData(versiontable);
881
+ // if (copy == client)
882
+
883
+ Object3D versions[] = object.versionlist;
884
+ object.versionlist = null;
885
+
886
+ //byte[] compress = Compress(copy);
887
+ Object3D compress = (Object3D)Grafreed.clone(object);
888
+
889
+ object.versionlist = versions;
890
+
891
+ object.RestoreBigData(versiontable);
892
+
893
+ CameraPane.SWITCH = temp;
894
+
895
+ return compress;
896
+ }
897
+
898
+ private JTextPane createTextPane()
899
+ {
900
+// TEXTAREA String[] initString =
901
+// {
902
+// "This is an editable JTextPane, ", //regular
903
+// "another ", //italic
904
+// "styled ", //bold
905
+// "text ", //small
906
+// "component, ", //large
907
+// "which supports embedded components..." + newline,//regular
908
+// " " + newline, //button
909
+// "...and embedded icons..." + newline, //regular
910
+// " ", //icon
911
+// newline + "JTextPane is a subclass of JEditorPane that "
912
+// + "uses a StyledEditorKit and StyledDocument, and provides "
913
+// + "cover methods for interacting with those objects."
914
+// };
915
+//
916
+// String[] initStyles =
917
+// {
918
+// "regular", "italic", "bold", "small", "large",
919
+// "regular", "button", "regular", "icon",
920
+// "regular"
921
+// };
922
+//
923
+// JTextPane textPane = new JTextPane();
924
+// textPane.setEditable(true);
925
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
926
+// addStylesToDocument(doc);
927
+//
928
+// try
929
+// {
930
+// for (int j = 0; j < 2; j++)
931
+// {
932
+// for (int i = 0; i < initString.length; i++)
933
+// {
934
+// doc.insertString(doc.getLength(), initString[i],
935
+// doc.getStyle(initStyles[i]));
936
+// }
937
+// }
938
+// } catch (BadLocationException ble)
939
+// {
940
+// System.err.println("Couldn't insert initial text into text pane.");
941
+// }
942
+
943
+ return new JTextPane(); // textPane;
643944 }
644945
645946 protected void addStylesToDocument(StyledDocument doc)
....@@ -692,7 +993,7 @@
692993 protected static ImageIcon createImageIcon(String path,
693994 String description)
694995 {
695
- java.net.URL imgURL = GrafreeD.class.getResource(path);
996
+ java.net.URL imgURL = Grafreed.class.getResource(path);
696997 if (imgURL != null)
697998 {
698999 return new ImageIcon(imgURL, description);
....@@ -715,6 +1016,7 @@
7151016 {
7161017 SetupMaterial(materialPanel);
7171018 }
1019
+
7181020 //SetupName();
7191021 //SetupViews();
7201022 }
....@@ -724,6 +1026,7 @@
7241026 // NumberSlider vDivsField;
7251027 // JCheckBox endcaps;
7261028 JCheckBox liveCB;
1029
+ JCheckBox selectableCB;
7271030 JCheckBox hideCB;
7281031 JCheckBox link2masterCB;
7291032 JCheckBox markCB;
....@@ -731,7 +1034,12 @@
7311034 JCheckBox speedupCB;
7321035 JCheckBox rewindCB;
7331036 JCheckBox flipVCB;
1037
+
1038
+ cCheckBox toggleTextureCB;
1039
+ cCheckBox toggleSwitchCB;
1040
+
7341041 JComboBox texresMenu;
1042
+
7351043 JButton resetButton;
7361044 JButton stepButton;
7371045 JButton stepAllButton;
....@@ -739,115 +1047,87 @@
7391047 JButton slowerButton;
7401048 JButton fasterButton;
7411049 JButton remarkButton;
1050
+
1051
+ cGridBag editPanel;
1052
+ cGridBag editCommandsPanel;
1053
+
1054
+ cGridBag namePanel;
1055
+ cGridBag setupPanel;
1056
+ cGridBag setupPanel2;
1057
+ cGridBag objectCommandsPanel;
1058
+ cGridBag pushPanel;
1059
+ cGridBag fillPanel;
7421060
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
1061
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
7441062 {
7451063 JCheckBox cb;
7461064
747
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
748
- oe.aConstraints.gridwidth = 1; // 3;
749
-// oe.aConstraints.weightx = 1;
750
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
751
- oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1065
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7521066 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
7561067
7571068 return cb;
7581069 }
7591070
760
- cButton AddButton(ObjEditor oe, String label)
1071
+ cButton AddButton(cGridBag panel, String label)
7611072 {
7621073 cButton cb;
7631074
764
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
765
- oe.aConstraints.gridwidth = 1;
766
-// oe.aConstraints.weightx = 1;
767
-// oe.aConstraints.anchor = GridBagConstraints.WEST;
768
- oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
1075
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
7691076 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
7731077
7741078 return cb;
7751079 }
7761080
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
1081
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
7781082 {
7791083 JComboBox combo;
7801084
781
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
782
- oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
783
- oe.aConstraints.gridx += 1;
1085
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7841086 combo.addActionListener(this);
7851087
7861088 return combo;
7871089 }
7881090
789
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
1091
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
7901092 {
791
- NumberSlider combo;
1093
+ cGridBag control = new cGridBag();
1094
+
1095
+ cNumberSlider combo;
7921096
7931097 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
7961098 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
797
- aConstraints.gridwidth = 2;
798
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
799
- aConstraints.gridx += 1;
800
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
801
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
802
- ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
803
- aConstraints.gridx += 1;
804
- aConstraints.gridwidth = 1;
805
-
1099
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1100
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8061101 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
1102
+
1103
+ panel.add(control);
1104
+
1105
+ return control;
8131106 }
8141107
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
1108
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
8161109 {
817
- NumberSlider combo;
1110
+ cGridBag control = new cGridBag();
1111
+
1112
+ cNumberSlider combo;
8181113
8191114 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
8221115 jlabel.setHorizontalAlignment(SwingConstants.TRAILING);
823
- aConstraints.gridwidth = 2;
824
- ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
825
- aConstraints.gridx += 1;
826
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
827
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
828
- ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
829
- aConstraints.gridx += 1;
830
- aConstraints.gridwidth = 1;
831
-
1116
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1117
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8321118 combo.setInteger(current);
8331119
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
1120
+ panel.add(control);
1121
+
1122
+ return control;
8391123 }
8401124
841
- JTextArea AddText(JPanel ctrlPanel, String name)
1125
+ JTextArea AddText(cGridBag ctrlPanel, String name)
8421126 {
8431127 JTextArea text;
8441128
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1129
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8481130 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
8511131
8521132 return text;
8531133 }
....@@ -877,9 +1157,16 @@
8771157 objEditor.ctrlPanel.remove(j);
8781158 }
8791159
1160
+ void Remove(cNumberSlider j)
1161
+ {
1162
+ j.removeChangeListener(this);
1163
+ //objEditor.ctrlPanel.remove(j.label);
1164
+ objEditor.ctrlPanel.remove(j);
1165
+ }
1166
+
8801167 /*
8811168 */
882
- void Return() // ObjEditor oe)
1169
+ void Return0() // ObjEditor oe)
8831170 {
8841171 aConstraints.gridy += 1;
8851172 aConstraints.gridx = 0;
....@@ -934,35 +1221,93 @@
9341221
9351222 void SetupUI2(ObjEditor oe)
9361223 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- SetupName(oe);
1224
+ //SetupName(oe);
9421225
943
- if (!GroupEditor.allparams)
1226
+ namePanel = new cGridBag();
1227
+
1228
+ //if (copy.pinned)
1229
+ {
1230
+ pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1231
+ pinButton.setSelected(copy.pinned);
1232
+ cGridBag t = new cGridBag();
1233
+ t.preferredWidth = 2;
1234
+ t.add(pinButton);
1235
+ namePanel.add(t);
1236
+
1237
+ pinButton.addItemListener(this);
1238
+ }
1239
+
1240
+ nameField = AddText(namePanel, copy.GetName());
1241
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
1242
+ oe.ctrlPanel.add(namePanel);
1243
+
1244
+ oe.ctrlPanel.Return();
1245
+
1246
+ if (!allparams)
9441247 return;
9451248
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1249
+ setupPanel = new cGridBag().setVertical(false);
1250
+
1251
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1252
+ liveCB.setToolTipText("Animate object");
1253
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1254
+ selectableCB.setToolTipText("Make object selectable");
9491255 // Return();
950
- markCB = AddCheckBox(oe, "Mark", copy.marked);
951
- rewindCB = AddCheckBox(oe, "Rew", copy.rewind);
952
- randomCB = AddCheckBox(oe, "Rand", copy.random);
953
- Return();
954
- resetButton = AddButton(oe, "Reset");
955
- stepButton = AddButton(oe, "Step");
1256
+
1257
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1258
+ hideCB.setToolTipText("Hide object");
1259
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1260
+ markCB.setToolTipText("As animation target transform");
1261
+
1262
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
1263
+
1264
+ setupPanel2 = new cGridBag().setVertical(false);
1265
+
1266
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1267
+ rewindCB.setToolTipText("Rewind animation");
1268
+
1269
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1270
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1271
+
1272
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1273
+ link2masterCB.setToolTipText("Attach to support");
1274
+
1275
+ if (Globals.ADVANCED)
1276
+ {
1277
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1278
+ speedupCB.setToolTipText("Option motion capture");
1279
+ }
1280
+
1281
+ oe.ctrlPanel.add(setupPanel);
1282
+ oe.ctrlPanel.Return();
1283
+ oe.ctrlPanel.add(setupPanel2);
1284
+ oe.ctrlPanel.Return();
1285
+
1286
+ objectCommandsPanel = new cGridBag().setVertical(false);
1287
+
1288
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1289
+ resetButton.setToolTipText("Jump to frame zero");
1290
+ stepButton = AddButton(objectCommandsPanel, "Step");
1291
+ stepButton.setToolTipText("Step one frame");
9561292 // resetAllButton = AddButton(oe, "Reset All");
9571293 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9591294 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- remarkButton = AddButton(oe, "Rem");
1295
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1296
+ slowerButton.setToolTipText("Decrease animation speed");
1297
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1298
+ fasterButton.setToolTipText("Increase animation speed");
1299
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1300
+ remarkButton.setToolTipText("Set the current transform as the target");
9631301
964
- Return();
1302
+ oe.ctrlPanel.add(objectCommandsPanel);
1303
+ oe.ctrlPanel.Return();
9651304
1305
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1306
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1307
+ //Return();
1308
+
1309
+ oe.ctrlPanel.Return();
1310
+
9661311 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671312 // ObjEditor.aConstraints.gridx += 1;
9681313
....@@ -1056,7 +1401,7 @@
10561401 oe.aConstraints.gridwidth = 1;
10571402 /**/
10581403 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1404
+ oe.ctrlPanel.Return();
10601405
10611406 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621407 //textureButton.setEnabled(false);
....@@ -1158,10 +1503,28 @@
11581503 //JPanel worldPanel =
11591504 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601505 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1506
+ centralPanel = new cGridBag();
1507
+ centralPanel.preferredWidth = 20;
1508
+
1509
+ if (Globals.ADVANCED)
1510
+ {
1511
+ timelinePanel = new JPanel(new BorderLayout());
1512
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11641513
1514
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1515
+ cameraPanel.setContinuousLayout(true);
1516
+ cameraPanel.setOneTouchExpandable(true);
1517
+// cameraPanel.setDividerLocation(0.9);
1518
+// cameraPanel.setDividerSize(9);
1519
+ cameraPanel.setResizeWeight(1.0);
1520
+
1521
+ }
1522
+
1523
+ centralPanel.add(cameraView);
1524
+ centralPanel.setFocusable(true);
1525
+ //frame.setJMenuBar(timelineMenubar);
1526
+ //centralPanel.add(timelinePanel);
1527
+
11651528 //topView.camera = ;
11661529 //frontView.camera = new Camera(2);
11671530 //sideView.camera = new Camera(3);
....@@ -1177,12 +1540,14 @@
11771540 //frontView.object = copy;
11781541 //sideView.object = copy;
11791542
1180
- XYZPanel = new JPanel();
1181
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1543
+ XYZPanel = new cGridBag().setVertical(true);
1544
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11821545
1183
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1184
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1546
+ XYZPanel.preferredWidth = 5;
1547
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1548
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1549
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1550
+ //XYZPanel.setName("XYZ");
11861551
11871552 /*
11881553 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1191,7 +1556,7 @@
11911556 gridPanel.add(cameraView);
11921557 gridPanel.add(XYZPanel);
11931558 */
1194
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1559
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11951560 gridPanel.setContinuousLayout(true);
11961561 gridPanel.setOneTouchExpandable(true);
11971562 gridPanel.setDividerLocation(1.0);
....@@ -1220,12 +1585,29 @@
12201585 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12211586 //tmp.setName("Edit");
12221587 objectPanel.add(materialPanel);
1223
- JPanel north = new JPanel(new BorderLayout());
1224
- north.setName("Edit");
1225
- north.add(ctrlPanel, BorderLayout.NORTH);
1226
- objectPanel.add(north);
1227
- objectPanel.add(infoPanel);
1588
+ objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1589
+ objectPanel.setToolTipTextAt(0, "Material");
1590
+
1591
+ objectPanel.add(toolboxPanel);
1592
+ objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1593
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
12281594
1595
+ objectPanel.add(skyboxPanel);
1596
+ objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1597
+ objectPanel.setToolTipTextAt(2, "Backgrounds");
1598
+
1599
+// JPanel north = new JPanel(new BorderLayout());
1600
+// north.setName("Edit");
1601
+// north.add(ctrlPanel, BorderLayout.NORTH);
1602
+// objectPanel.add(north);
1603
+ objectPanel.add(editPanel);
1604
+ objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1605
+ objectPanel.setToolTipTextAt(3, "Edit controls");
1606
+
1607
+ objectPanel.add(XYZPanel);
1608
+ objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1609
+ objectPanel.setToolTipTextAt(4, "XYZ/RGB transform");
1610
+
12291611 /*
12301612 aConstraints.gridx = 0;
12311613 aConstraints.gridwidth = 1;
....@@ -1233,7 +1615,7 @@
12331615 aConstraints.gridy += 1;
12341616 aConstraints.gridwidth = 1;
12351617 mainPanel.add(objectPanel, aConstraints);
1236
- */
1618
+ */
12371619
12381620 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12391621 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1244,17 +1626,29 @@
12441626 scrollpane.setWheelScrollingEnabled(true);
12451627 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461628
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1629
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1630
+ scenePanel.preferredWidth = 5;
1631
+
1632
+ JTabbedPane tabbedPane = new JTabbedPane();
1633
+ tabbedPane.add(scrollpane);
12491634
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1251
-
1252
- optionsPanel = new JPanel(new GridBagLayout());
1635
+ optionsPanel = new cGridBag().setVertical(false);
12531636
12541637 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1638
+
1639
+ AddOptions(optionsPanel); //, aConstraints);
1640
+
1641
+ tabbedPane.add(optionsPanel);
1642
+
1643
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12561644
1645
+ scenePanel.add(tabbedPane);
12571646
1647
+ //if (Globals.ADVANCED)
1648
+ tabbedPane.add(infoPanel);
1649
+ tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1650
+ tabbedPane.setToolTipTextAt(3, "Information");
1651
+
12581652 /*
12591653 cTree jTree = new cTree(null);
12601654 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1275,7 +1669,7 @@
12751669 jtp.add(tree);
12761670 */
12771671
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1672
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791673 bigPanel.setContinuousLayout(true);
12801674 bigPanel.setOneTouchExpandable(true);
12811675 bigPanel.setDividerLocation(0.8);
....@@ -1287,6 +1681,7 @@
12871681 //bigPanel.setSize(new Dimension(10,10));
12881682 //bigPanel.add(ctrlPanel);
12891683 //bigPanel.add(gridPanel);
1684
+ /**
12901685 bigThree = new JPanel();
12911686 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12921687 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1297,20 +1692,26 @@
12971692 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981693 aWindowConstraints.weightx = 0;
12991694 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1695
+ bigThree.add(scenePanel, aWindowConstraints);
13011696 aWindowConstraints.weightx = 1;
13021697 aWindowConstraints.gridwidth = 3;
13031698 // aConstraints.gridheight = 3;
13041699 aWindowConstraints.gridx = 1;
13051700 aWindowConstraints.fill = GridBagConstraints.BOTH;
1306
- bigThree.add(cameraPanel, aWindowConstraints);
1701
+ bigThree.add(centralPanel, aWindowConstraints);
13071702 aWindowConstraints.weightx = 0;
13081703 aWindowConstraints.gridx = 4;
13091704 aWindowConstraints.gridwidth = 1;
13101705 // aConstraints.gridheight = 3;
13111706 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13121707 bigThree.add(XYZPanel, aWindowConstraints);
1708
+ /**/
13131709
1710
+ bigThree = new cGridBag();
1711
+ bigThree.addComponent(scenePanel);
1712
+ bigThree.addComponent(centralPanel);
1713
+ //bigThree.addComponent(XYZPanel);
1714
+
13141715 // // SIDE EFFECT!!!
13151716 // aConstraints.gridx = 0;
13161717 // aConstraints.gridy = 0;
....@@ -1318,9 +1719,26 @@
13181719 // aConstraints.gridheight = 1;
13191720
13201721 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1321
- framePanel.setContinuousLayout(true);
1322
- framePanel.setOneTouchExpandable(true);
1323
- framePanel.setDividerLocation(0.8);
1722
+
1723
+ framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
1724
+ new java.beans.PropertyChangeListener()
1725
+ {
1726
+ public void propertyChange(java.beans.PropertyChangeEvent pce)
1727
+ {
1728
+ if ((Integer)pce.getOldValue() == 1)
1729
+ {
1730
+ if (radio.layout != expandedLayout)
1731
+ {
1732
+ radio.layout = expandedLayout;
1733
+ radio.layout.doClick();
1734
+ }
1735
+ }
1736
+ }
1737
+ });
1738
+
1739
+ framePanel.setContinuousLayout(false);
1740
+ framePanel.setOneTouchExpandable(false);
1741
+ //.setDividerLocation(0.8);
13241742 //framePanel.setDividerSize(15);
13251743 //framePanel.setResizeWeight(0.15);
13261744 framePanel.setName("Frame");
....@@ -1331,20 +1749,25 @@
13311749 //worldPane.add(bigPanel);
13321750 //worldPane.add(worldPanel);
13331751 /**/
1334
- frame.getContentPane().add(/*"Center",*/framePanel);
1752
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1753
+ frame.add(/*"Center",*/framePanel);
13351754 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361755
13371756 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13381757
1339
- frame.setSize(1024, 768);
1340
- frame.show();
1341
-
1758
+ frame.setSize(1280, 860);
1759
+
1760
+ cameraView.requestFocusInWindow();
1761
+
13421762 gridPanel.setDividerLocation(1.0);
1763
+
1764
+ frame.validate();
1765
+
1766
+ frame.setVisible(true);
13431767
13441768 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13451769 frame.addWindowListener(new WindowAdapter()
13461770 {
1347
-
13481771 public void windowClosing(WindowEvent e)
13491772 {
13501773 Close();
....@@ -1352,6 +1775,10 @@
13521775 });
13531776 }
13541777
1778
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1779
+ {
1780
+ }
1781
+
13551782 JTree GetTree()
13561783 {
13571784 return objEditor.jTree;
....@@ -1363,260 +1790,575 @@
13631790 ctrlPanel.removeAll();
13641791 }
13651792
1366
- void SetupMaterial(JPanel ctrlPanel)
1793
+ void SetupMaterial(cGridBag materialpanel)
13671794 {
1368
- aConstraints.weighty = 0;
1369
- //aConstraints.weightx = 1;
1370
- /*
1795
+ cGridBag presetpanel = new cGridBag().setVertical(true);
1796
+
1797
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
1798
+ skin.setToolTipText("Skin");
1799
+ skin.addMouseListener(new MouseAdapter()
1800
+ {
1801
+ public void mouseClicked(MouseEvent e)
1802
+ {
1803
+ Object3D object = Grafreed.materials.versionlist[0].get(0);
1804
+ cMaterial material = object.material;
1805
+
1806
+ // Skin
1807
+ colorField.setFloat(material.color);
1808
+ saturationField.setFloat(material.modulation);
1809
+ subsurfaceField.setFloat(material.subsurface);
1810
+ selfshadowField.setFloat(material.diffuseness);
1811
+ diffusenessField.setFloat(material.factor);
1812
+ shininessField.setFloat(material.shininess);
1813
+ shadowbiasField.setFloat(material.shadowbias);
1814
+ diffuseField.setFloat(material.diffuse);
1815
+ specularField.setFloat(material.specular);
1816
+
1817
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
1818
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
1819
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
1820
+
1821
+ materialtouched = true;
1822
+ applySelf();
1823
+ }
1824
+ });
1825
+ presetpanel.add(skin);
1826
+
1827
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
1828
+ lambert.setToolTipText("Diffuse");
1829
+ lambert.addMouseListener(new MouseAdapter()
1830
+ {
1831
+ public void mouseClicked(MouseEvent e)
1832
+ {
1833
+ Object3D object = Grafreed.materials.versionlist[2].get(0);
1834
+ cMaterial material = object.material;
1835
+
1836
+ diffusenessField.setFloat(material.factor);
1837
+ selfshadowField.setFloat(material.diffuseness);
1838
+
1839
+ materialtouched = true;
1840
+ applySelf();
1841
+ }
1842
+ });
1843
+ presetpanel.add(lambert);
1844
+
1845
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
1846
+ diffuse2.setToolTipText("Diffuse2");
1847
+ diffuse2.addMouseListener(new MouseAdapter()
1848
+ {
1849
+ public void mouseClicked(MouseEvent e)
1850
+ {
1851
+ Object3D object = Grafreed.materials.versionlist[3].get(0);
1852
+ cMaterial material = object.material;
1853
+
1854
+ diffusenessField.setFloat(material.factor);
1855
+ selfshadowField.setFloat(material.diffuseness);
1856
+
1857
+ materialtouched = true;
1858
+ applySelf();
1859
+ }
1860
+ });
1861
+ presetpanel.add(diffuse2);
1862
+
1863
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
1864
+ diffusemoon.setToolTipText("Moon");
1865
+ diffusemoon.addMouseListener(new MouseAdapter()
1866
+ {
1867
+ public void mouseClicked(MouseEvent e)
1868
+ {
1869
+ Object3D object = Grafreed.materials.versionlist[4].get(0);
1870
+ cMaterial material = object.material;
1871
+
1872
+ diffusenessField.setFloat(material.factor);
1873
+ selfshadowField.setFloat(material.diffuseness);
1874
+
1875
+ materialtouched = true;
1876
+ applySelf();
1877
+ }
1878
+ });
1879
+ presetpanel.add(diffusemoon);
1880
+
1881
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
1882
+ diffusemoon2.setToolTipText("Moon2");
1883
+ diffusemoon2.addMouseListener(new MouseAdapter()
1884
+ {
1885
+ public void mouseClicked(MouseEvent e)
1886
+ {
1887
+ Object3D object = Grafreed.materials.versionlist[5].get(0);
1888
+ cMaterial material = object.material;
1889
+
1890
+ diffusenessField.setFloat(material.factor);
1891
+ selfshadowField.setFloat(material.diffuseness);
1892
+
1893
+ materialtouched = true;
1894
+ applySelf();
1895
+ }
1896
+ });
1897
+ presetpanel.add(diffusemoon2);
1898
+
1899
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
1900
+ diffusemoon3.setToolTipText("Moon3");
1901
+ diffusemoon3.addMouseListener(new MouseAdapter()
1902
+ {
1903
+ public void mouseClicked(MouseEvent e)
1904
+ {
1905
+ Object3D object = Grafreed.materials.versionlist[6].get(0);
1906
+ cMaterial material = object.material;
1907
+
1908
+ diffusenessField.setFloat(material.factor);
1909
+ selfshadowField.setFloat(material.diffuseness);
1910
+
1911
+ materialtouched = true;
1912
+ applySelf();
1913
+ }
1914
+ });
1915
+ presetpanel.add(diffusemoon3);
1916
+
1917
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
1918
+ diffusesheen.setToolTipText("Sheen");
1919
+ diffusesheen.addMouseListener(new MouseAdapter()
1920
+ {
1921
+ public void mouseClicked(MouseEvent e)
1922
+ {
1923
+ Object3D object = Grafreed.materials.versionlist[7].get(0);
1924
+ cMaterial material = object.material;
1925
+
1926
+ sheenField.setFloat(material.sheen);
1927
+
1928
+ materialtouched = true;
1929
+ applySelf();
1930
+ }
1931
+ });
1932
+ presetpanel.add(diffusesheen);
1933
+
1934
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
1935
+ rough.setToolTipText("Rough metal");
1936
+ rough.addMouseListener(new MouseAdapter()
1937
+ {
1938
+ public void mouseClicked(MouseEvent e)
1939
+ {
1940
+ Object3D object = Grafreed.materials.versionlist[1].get(0);
1941
+ cMaterial material = object.material;
1942
+
1943
+ shininessField.setFloat(material.shininess);
1944
+ velvetField.setFloat(material.velvet);
1945
+
1946
+ materialtouched = true;
1947
+ applySelf();
1948
+ }
1949
+ });
1950
+ presetpanel.add(rough);
1951
+
1952
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
1953
+ rough2.setToolTipText("Medium metal");
1954
+ rough2.addMouseListener(new MouseAdapter()
1955
+ {
1956
+ public void mouseClicked(MouseEvent e)
1957
+ {
1958
+ Object3D object = Grafreed.materials.versionlist[13].get(0);
1959
+ cMaterial material = object.material;
1960
+
1961
+ shininessField.setFloat(material.shininess);
1962
+ lightareaField.setFloat(material.lightarea);
1963
+
1964
+ materialtouched = true;
1965
+ applySelf();
1966
+ }
1967
+ });
1968
+ presetpanel.add(rough2);
1969
+
1970
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
1971
+ shini0.setToolTipText("Shiny");
1972
+ shini0.addMouseListener(new MouseAdapter()
1973
+ {
1974
+ public void mouseClicked(MouseEvent e)
1975
+ {
1976
+ Object3D object = Grafreed.materials.versionlist[14].get(0);
1977
+ cMaterial material = object.material;
1978
+
1979
+ shininessField.setFloat(material.shininess);
1980
+ lightareaField.setFloat(material.lightarea);
1981
+
1982
+ materialtouched = true;
1983
+ applySelf();
1984
+ }
1985
+ });
1986
+ presetpanel.add(shini0);
1987
+
1988
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
1989
+ shini1.setToolTipText("Shiny2");
1990
+ shini1.addMouseListener(new MouseAdapter()
1991
+ {
1992
+ public void mouseClicked(MouseEvent e)
1993
+ {
1994
+ Object3D object = Grafreed.materials.versionlist[11].get(0);
1995
+ cMaterial material = object.material;
1996
+
1997
+ shininessField.setFloat(material.shininess);
1998
+ lightareaField.setFloat(material.lightarea);
1999
+
2000
+ materialtouched = true;
2001
+ applySelf();
2002
+ }
2003
+ });
2004
+ presetpanel.add(shini1);
2005
+
2006
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2007
+ shini2.setToolTipText("Shiny3");
2008
+ shini2.addMouseListener(new MouseAdapter()
2009
+ {
2010
+ public void mouseClicked(MouseEvent e)
2011
+ {
2012
+ Object3D object = Grafreed.materials.versionlist[12].get(0);
2013
+ cMaterial material = object.material;
2014
+
2015
+ shininessField.setFloat(material.shininess);
2016
+ lightareaField.setFloat(material.lightarea);
2017
+
2018
+ materialtouched = true;
2019
+ applySelf();
2020
+ }
2021
+ });
2022
+ presetpanel.add(shini2);
2023
+
2024
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2025
+ aniso.setToolTipText("AnisoU");
2026
+ aniso.addMouseListener(new MouseAdapter()
2027
+ {
2028
+ public void mouseClicked(MouseEvent e)
2029
+ {
2030
+ Object3D object = Grafreed.materials.versionlist[8].get(0);
2031
+ cMaterial material = object.material;
2032
+
2033
+ anisoField.setFloat(material.aniso);
2034
+ anisoVField.setFloat(material.anisoV);
2035
+
2036
+ materialtouched = true;
2037
+ applySelf();
2038
+ }
2039
+ });
2040
+ presetpanel.add(aniso);
2041
+
2042
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2043
+ aniso2.setToolTipText("AnisoV");
2044
+ aniso2.addMouseListener(new MouseAdapter()
2045
+ {
2046
+ public void mouseClicked(MouseEvent e)
2047
+ {
2048
+ Object3D object = Grafreed.materials.versionlist[9].get(0);
2049
+ cMaterial material = object.material;
2050
+
2051
+ anisoField.setFloat(material.aniso);
2052
+ anisoVField.setFloat(material.anisoV);
2053
+
2054
+ materialtouched = true;
2055
+ applySelf();
2056
+ }
2057
+ });
2058
+ presetpanel.add(aniso2);
2059
+
2060
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2061
+ aniso3.setToolTipText("AnisoUV");
2062
+ aniso3.addMouseListener(new MouseAdapter()
2063
+ {
2064
+ public void mouseClicked(MouseEvent e)
2065
+ {
2066
+ Object3D object = Grafreed.materials.versionlist[10].get(0);
2067
+ cMaterial material = object.material;
2068
+
2069
+ anisoField.setFloat(material.aniso);
2070
+ anisoVField.setFloat(material.anisoV);
2071
+
2072
+ materialtouched = true;
2073
+ applySelf();
2074
+ }
2075
+ });
2076
+ presetpanel.add(aniso3);
2077
+
2078
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2079
+ velvet0.setToolTipText("Velvet");
2080
+ velvet0.addMouseListener(new MouseAdapter()
2081
+ {
2082
+ public void mouseClicked(MouseEvent e)
2083
+ {
2084
+ Object3D object = Grafreed.materials.versionlist[15].get(0);
2085
+ cMaterial material = object.material;
2086
+
2087
+ diffusenessField.setFloat(material.factor);
2088
+ selfshadowField.setFloat(material.diffuseness);
2089
+ sheenField.setFloat(material.sheen);
2090
+ shininessField.setFloat(material.shininess);
2091
+ velvetField.setFloat(material.velvet);
2092
+ shiftField.setFloat(material.shift);
2093
+
2094
+ materialtouched = true;
2095
+ applySelf();
2096
+ }
2097
+ });
2098
+ presetpanel.add(velvet0);
2099
+
2100
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2101
+ bump0.setToolTipText("Bump texture");
2102
+ bump0.addMouseListener(new MouseAdapter()
2103
+ {
2104
+ public void mouseClicked(MouseEvent e)
2105
+ {
2106
+ Object3D object = Grafreed.materials.versionlist[16].get(0);
2107
+ cMaterial material = object.material;
2108
+
2109
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2110
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2111
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2112
+
2113
+ materialtouched = true;
2114
+ applySelf();
2115
+ }
2116
+ });
2117
+ presetpanel.add(bump0);
2118
+
2119
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2120
+ halo.setToolTipText("Halo");
2121
+ halo.addMouseListener(new MouseAdapter()
2122
+ {
2123
+ public void mouseClicked(MouseEvent e)
2124
+ {
2125
+ Object3D object = Grafreed.materials.versionlist[17].get(0);
2126
+ cMaterial material = object.material;
2127
+
2128
+ opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0);
2129
+
2130
+ materialtouched = true;
2131
+ applySelf();
2132
+ }
2133
+ });
2134
+ presetpanel.add(halo);
2135
+
2136
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2137
+ candle.setToolTipText("Candle");
2138
+ candle.addMouseListener(new MouseAdapter()
2139
+ {
2140
+ public void mouseClicked(MouseEvent e)
2141
+ {
2142
+ Object3D object = Grafreed.materials.versionlist[18].get(0);
2143
+ cMaterial material = object.material;
2144
+
2145
+ subsurfaceField.setFloat(material.subsurface);
2146
+ shadowbiasField.setFloat(material.shadowbias);
2147
+ ambientField.setFloat(material.ambient);
2148
+ specularField.setFloat(material.specular);
2149
+ lightareaField.setFloat(material.lightarea);
2150
+ shininessField.setFloat(material.shininess);
2151
+
2152
+ materialtouched = true;
2153
+ applySelf();
2154
+ }
2155
+ });
2156
+ presetpanel.add(candle);
2157
+
2158
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2159
+ shadowShader.setToolTipText("Shadow");
2160
+ shadowShader.addMouseListener(new MouseAdapter()
2161
+ {
2162
+ public void mouseClicked(MouseEvent e)
2163
+ {
2164
+ diffuseField.setFloat(0.001);
2165
+ ambientField.setFloat(0.001);
2166
+ cameraField.setFloat(0.001);
2167
+ specularField.setFloat(0.001);
2168
+ fakedepthField.setFloat(0.001);
2169
+ opacityField.setFloat(0.6);
2170
+
2171
+ materialtouched = true;
2172
+ applySelf();
2173
+ }
2174
+ });
2175
+ presetpanel.add(shadowShader);
2176
+
2177
+ cGridBag panel = new cGridBag().setVertical(true);
2178
+
2179
+ presetpanel.preferredWidth = 1;
2180
+
2181
+ materialpanel.add(presetpanel);
2182
+ materialpanel.add(panel);
2183
+
2184
+ panel.preferredWidth = 8;
2185
+
2186
+ /*
13712187 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13722188 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1373
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1374
- aConstraints.gridx += 1;
1375
- */
2189
+ */
13762190
1377
- aConstraints.gridwidth = 1;
1378
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1379
- aConstraints.gridx += 1;
1380
- aConstraints.weighty = 0;
1381
- aConstraints.gridwidth = 1;
2191
+ cGridBag editBar = new cGridBag().setVertical(false);
2192
+
2193
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2194
+ createMaterialButton.setToolTipText("Create material");
13822195
13832196 /*
13842197 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
13882198 */
13892199
1390
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1391
- aConstraints.gridx += 1;
2200
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2201
+ clearMaterialButton.setToolTipText("Clear material");
2202
+
2203
+ if (Globals.ADVANCED)
2204
+ {
2205
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2206
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
2207
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
2208
+ }
13922209
1393
- ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints);
1394
-
1395
- aConstraints.gridx += 1;
1396
-
1397
- ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints);
1398
-
1399
- aConstraints.gridx += 1;
1400
-
1401
- ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints);
1402
-
1403
- aConstraints.gridx = 0;
1404
- aConstraints.gridy += 1;
1405
- aConstraints.weighty = 0;
1406
- aConstraints.gridwidth = 1;
2210
+ editBar.preferredHeight = 15;
2211
+
2212
+ panel.add(editBar);
2213
+
14072214 /**/
14082215 //aConstraints.weighty = 0;
14092216 ////aConstraints.weightx = 1;
14102217 //aConstraints.weighty = 1;
14112218 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14122219 //aConstraints.gridx += 1;
1413
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1414
- aConstraints.weighty = 0;
1415
- aConstraints.gridx = 0;
1416
- aConstraints.gridy += 1;
1417
- aConstraints.gridwidth = 1;
2220
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14182221
1419
- ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints);
1420
- colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1421
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1422
- aConstraints.gridx += 1;
1423
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1424
- //aConstraints.weightx = 0;
1425
- ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1426
- aConstraints.gridx = 0;
1427
- aConstraints.gridy += 1;
1428
- aConstraints.gridwidth = 1;
2222
+ cGridBag colorSection = new cGridBag().setVertical(true);
14292223
1430
- ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints);
1431
- modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1432
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1433
- aConstraints.gridx += 1;
1434
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1435
- ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1436
- aConstraints.gridx = 0;
1437
- aConstraints.gridy += 1;
1438
- aConstraints.gridwidth = 1;
2224
+ cGridBag huepanel = new cGridBag();
2225
+ cGridBag huelabel = new cGridBag();
2226
+ skin = GetLabel("icons/hue.png", false);
2227
+ skin.fit = true;
2228
+ huelabel.add(skin);
2229
+ huelabel.preferredWidth = 20;
2230
+ huepanel.add(new cGridBag()); // Label
2231
+ huepanel.add(huelabel); // Field/slider
2232
+
2233
+ huepanel.preferredHeight = 7;
14392234
1440
- ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints);
1441
- textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1442
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1443
- aConstraints.gridx += 1;
1444
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1445
- ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1446
- aConstraints.gridx = 0;
1447
- aConstraints.gridy += 1;
1448
- aConstraints.gridwidth = 1;
2235
+ colorSection.add(huepanel);
2236
+
2237
+ cGridBag color = new cGridBag();
2238
+
2239
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
2240
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2241
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
14492242
1450
- ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints);
1451
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1452
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1453
- aConstraints.gridx += 1;
1454
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1455
- ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1456
- aConstraints.gridx = 0;
1457
- aConstraints.gridy += 1;
1458
- aConstraints.gridwidth = 1;
2243
+ //colorField.preferredWidth = 200;
2244
+ colorSection.add(color);
14592245
1460
- ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints);
1461
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1462
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1463
- aConstraints.gridx += 1;
1464
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1465
- ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1466
- aConstraints.gridx = 0;
1467
- aConstraints.gridy += 1;
1468
- aConstraints.gridwidth = 1;
2246
+ cGridBag modulation = new cGridBag();
2247
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
2248
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2249
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2250
+ colorSection.add(modulation);
14692251
1470
- ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints);
1471
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1472
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1473
- aConstraints.gridx += 1;
1474
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1475
- ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints);
1476
- aConstraints.gridx = 0;
1477
- aConstraints.gridy += 1;
1478
- aConstraints.gridwidth = 1;
2252
+ cGridBag opacity = new cGridBag();
2253
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
2254
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2255
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2256
+ colorSection.add(opacity);
14792257
1480
- //aConstraints.weighty = 1;
1481
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1482
- //aConstraints.gridx += 1;
1483
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1484
- aConstraints.weighty = 0;
1485
- aConstraints.gridx = 0;
1486
- aConstraints.gridy += 1;
1487
- aConstraints.gridwidth = 1;
2258
+ colorSection.add(GetSeparator());
2259
+
2260
+ cGridBag texture = new cGridBag();
2261
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
2262
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2263
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2264
+ colorSection.add(texture);
14882265
1489
- ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints);
1490
- diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1491
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1492
- aConstraints.gridx += 1;
1493
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1494
- ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints);
1495
- aConstraints.gridx = 0;
1496
- aConstraints.gridy += 1;
1497
- aConstraints.gridwidth = 1;
2266
+ panel.add(GetSeparator());
2267
+
2268
+ panel.add(colorSection);
2269
+
2270
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
2271
+
2272
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
2273
+
2274
+ cGridBag diffuse = new cGridBag();
2275
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
2276
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2277
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2278
+ diffuseSection.add(diffuse);
14982279
1499
- ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints);
1500
- diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1501
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1502
- aConstraints.gridx += 1;
1503
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1504
- ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints);
1505
- aConstraints.gridx = 0;
1506
- aConstraints.gridy += 1;
1507
- aConstraints.gridwidth = 1;
2280
+ cGridBag diffuseness = new cGridBag();
2281
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
2282
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2283
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2284
+ diffuseSection.add(diffuseness);
15082285
1509
- ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints);
1510
- selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1511
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1512
- aConstraints.gridx += 1;
1513
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1514
- ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1515
- aConstraints.gridx = 0;
1516
- aConstraints.gridy += 1;
1517
- aConstraints.gridwidth = 1;
2286
+ cGridBag selfshadow = new cGridBag();
2287
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
2288
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2289
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2290
+ diffuseSection.add(selfshadow);
15182291
1519
- ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints);
1520
- sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1521
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1522
- aConstraints.gridx += 1;
1523
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1524
- ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints);
1525
- aConstraints.gridx = 0;
1526
- aConstraints.gridy += 1;
1527
- aConstraints.gridwidth = 1;
2292
+ cGridBag sheen = new cGridBag();
2293
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
2294
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2295
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2296
+ diffuseSection.add(sheen);
15282297
1529
- ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints);
1530
- subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1531
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1532
- aConstraints.gridx += 1;
1533
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1534
- ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1535
- aConstraints.gridx = 0;
1536
- aConstraints.gridy += 1;
1537
- aConstraints.gridwidth = 1;
2298
+ cGridBag subsurface = new cGridBag();
2299
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
2300
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2301
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2302
+ diffuseSection.add(subsurface);
15382303
1539
- ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints);
1540
- shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1541
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1542
- aConstraints.gridx += 1;
1543
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1544
- ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints);
1545
- aConstraints.gridx = 0;
1546
- aConstraints.gridy += 1;
1547
- aConstraints.gridwidth = 1;
2304
+ cGridBag shadow = new cGridBag();
2305
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
2306
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2307
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2308
+ diffuseSection.add(shadow);
15482309
1549
- ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints);
1550
- fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1551
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1552
- aConstraints.gridx += 1;
1553
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1554
- ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints);
1555
- aConstraints.gridx = 0;
1556
- aConstraints.gridy += 1;
1557
- aConstraints.gridwidth = 1;
2310
+ cGridBag fakedepth = new cGridBag();
2311
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
2312
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2313
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2314
+ diffuseSection.add(fakedepth);
15582315
1559
- //aConstraints.weighty = 1;
1560
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1561
- //aConstraints.gridx += 1;
1562
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1563
- aConstraints.weighty = 0;
1564
- aConstraints.gridx = 0;
1565
- aConstraints.gridy += 1;
1566
- aConstraints.gridwidth = 1;
2316
+ cGridBag shadowbias = new cGridBag();
2317
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
2318
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2319
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2320
+ diffuseSection.add(shadowbias);
15672321
1568
- ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints);
1569
- specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1570
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1571
- aConstraints.gridx += 1;
1572
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1573
- ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints);
1574
- aConstraints.gridx = 0;
1575
- aConstraints.gridy += 1;
1576
- aConstraints.gridwidth = 1;
2322
+ panel.add(GetSeparator());
2323
+
2324
+ panel.add(diffuseSection);
2325
+
2326
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
2327
+
2328
+ cGridBag specularSection = new cGridBag().setVertical(true);
15772329
1578
- ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints);
1579
- lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1580
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1581
- aConstraints.gridx += 1;
1582
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1583
- ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints);
1584
- aConstraints.gridx = 0;
1585
- aConstraints.gridy += 1;
1586
- aConstraints.gridwidth = 1;
2330
+ cGridBag specular = new cGridBag();
2331
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
2332
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2333
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2334
+ specularSection.add(specular);
15872335
1588
- ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints);
1589
- shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1590
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1591
- aConstraints.gridx += 1;
1592
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1593
- ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints);
1594
- aConstraints.gridx = 0;
1595
- aConstraints.gridy += 1;
1596
- aConstraints.gridwidth = 1;
2336
+ cGridBag lightarea = new cGridBag();
2337
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
2338
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2339
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2340
+ specularSection.add(lightarea);
15972341
1598
- ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints);
1599
- metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1600
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1601
- aConstraints.gridx += 1;
1602
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1603
- ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1604
- aConstraints.gridx = 0;
1605
- aConstraints.gridy += 1;
1606
- aConstraints.gridwidth = 1;
2342
+ cGridBag shininess = new cGridBag();
2343
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
2344
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2345
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2346
+ specularSection.add(shininess);
16072347
1608
- ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints);
1609
- velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1610
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1611
- aConstraints.gridx += 1;
1612
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1613
- ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints);
1614
- aConstraints.gridx = 0;
1615
- aConstraints.gridy += 1;
1616
- aConstraints.gridwidth = 1;
2348
+ cGridBag metalness = new cGridBag();
2349
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
2350
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2351
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2352
+ specularSection.add(metalness);
16172353
1618
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1619
- Return();
2354
+ cGridBag velvet = new cGridBag();
2355
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
2356
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2357
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2358
+ specularSection.add(velvet);
2359
+
2360
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
2361
+ //Return();
16202362 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16212363 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16222364 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1627,130 +2369,99 @@
16272369 // aConstraints.gridy += 1;
16282370 // aConstraints.gridwidth = 1;
16292371
1630
- //aConstraints.weighty = 1;
1631
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1632
- //aConstraints.gridx += 1;
1633
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1634
- aConstraints.weighty = 0;
1635
- aConstraints.gridx = 0;
1636
- aConstraints.gridy += 1;
1637
- aConstraints.gridwidth = 1;
2372
+ cGridBag anisoU = new cGridBag();
2373
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
2374
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2375
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2376
+ specularSection.add(anisoU);
16382377
1639
- ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints);
1640
- cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1641
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1642
- aConstraints.gridx += 1;
1643
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1644
- ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints);
1645
- aConstraints.gridx = 0;
1646
- aConstraints.gridy += 1;
1647
- aConstraints.gridwidth = 1;
2378
+ cGridBag anisoV = new cGridBag();
2379
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
2380
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2381
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2382
+ specularSection.add(anisoV);
16482383
1649
- ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints);
1650
- ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1651
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1652
- aConstraints.gridx += 1;
1653
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1654
- ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints);
1655
- aConstraints.gridx = 0;
1656
- aConstraints.gridy += 1;
1657
- aConstraints.gridwidth = 1;
16582384
1659
- ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints);
1660
- backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1661
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1662
- aConstraints.gridx += 1;
1663
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1664
- ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints);
1665
- aConstraints.gridx = 0;
1666
- aConstraints.gridy += 1;
1667
- aConstraints.gridwidth = 1;
2385
+ panel.add(GetSeparator());
2386
+
2387
+ panel.add(specularSection);
2388
+
2389
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
2390
+
2391
+ //cGridBag globalSection = new cGridBag().setVertical(true);
16682392
1669
- ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints);
1670
- opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1671
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1672
- aConstraints.gridx += 1;
1673
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1674
- ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints);
1675
- aConstraints.gridx = 0;
1676
- aConstraints.gridy += 1;
1677
- aConstraints.gridwidth = 1;
1678
- aConstraints.weighty = 0;
2393
+ cGridBag camera = new cGridBag();
2394
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
2395
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2396
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2397
+ colorSection.add(camera);
16792398
1680
- ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints);
1681
- bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1682
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1683
- aConstraints.gridx += 1;
1684
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1685
- ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints);
1686
- aConstraints.gridx = 0;
1687
- aConstraints.gridy += 1;
1688
- aConstraints.gridwidth = 1;
2399
+ cGridBag ambient = new cGridBag();
2400
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
2401
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2402
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2403
+ colorSection.add(ambient);
16892404
1690
- ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints);
1691
- noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1693
- aConstraints.gridx += 1;
1694
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1695
- ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints);
1696
- aConstraints.gridx = 0;
1697
- aConstraints.gridy += 1;
1698
- aConstraints.gridwidth = 1;
2405
+ cGridBag backlit = new cGridBag();
2406
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
2407
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2408
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2409
+ colorSection.add(backlit);
16992410
1700
- ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints);
1701
- powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1702
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1703
- aConstraints.gridx += 1;
1704
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1705
- ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints);
1706
- aConstraints.gridx = 0;
1707
- aConstraints.gridy += 1;
1708
- aConstraints.gridwidth = 1;
2411
+ //panel.add(new JSeparator());
2412
+
2413
+ //panel.add(globalSection);
2414
+
2415
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
2416
+
2417
+ cGridBag textureSection = new cGridBag().setVertical(true);
17092418
1710
- ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints);
1711
- borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1712
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1713
- aConstraints.gridx += 1;
1714
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1715
- ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints);
1716
- aConstraints.gridx = 0;
1717
- aConstraints.gridy += 1;
1718
- aConstraints.gridwidth = 1;
2419
+ cGridBag bump = new cGridBag();
2420
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
2421
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2422
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
2423
+ textureSection.add(bump);
17192424
1720
- ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints);
1721
- fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1722
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1723
- aConstraints.gridx += 1;
1724
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1725
- ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints);
1726
- aConstraints.gridx = 0;
1727
- aConstraints.gridy += 1;
1728
- aConstraints.gridwidth = 1;
2425
+ cGridBag noise = new cGridBag();
2426
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
2427
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2428
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
2429
+ textureSection.add(noise);
17292430
1730
- ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints);
1731
- opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1732
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1733
- aConstraints.gridx += 1;
1734
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
1735
- ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints);
1736
- aConstraints.gridx = 0;
1737
- aConstraints.gridy += 1;
1738
- aConstraints.gridwidth = 1;
2431
+ cGridBag power = new cGridBag();
2432
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
2433
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2434
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
2435
+ textureSection.add(power);
17392436
1740
- //aConstraints.weighty = 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1742
- //aConstraints.gridx += 1;
1743
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1744
- aConstraints.weighty = 0;
2437
+ cGridBag borderfade = new cGridBag();
2438
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
2439
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2440
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
2441
+ textureSection.add(borderfade);
17452442
1746
- aConstraints.gridx = 0;
1747
- aConstraints.gridy = 0;
1748
- aConstraints.gridwidth = 1;
2443
+ cGridBag fog = new cGridBag();
2444
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
2445
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2446
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
2447
+ textureSection.add(fog);
2448
+
2449
+ cGridBag opacityPower = new cGridBag();
2450
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
2451
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2452
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
2453
+ textureSection.add(opacityPower);
2454
+
2455
+ panel.add(GetSeparator());
2456
+
2457
+ panel.add(textureSection);
2458
+
2459
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17492460
17502461 SetMaterial(copy); // .GetMaterial());
17512462
1752
- colorField.addChangeListener(this);
1753
- modulationField.addChangeListener(this);
2463
+ //colorField.addChangeListener(this);
2464
+// modulationField.addChangeListener(this);
17542465 metalnessField.addChangeListener(this);
17552466 diffuseField.addChangeListener(this);
17562467 specularField.addChangeListener(this);
....@@ -1780,12 +2491,15 @@
17802491 opacityPowerField.addChangeListener(this);
17812492 /**/
17822493
1783
- resetSlidersButton.addActionListener(this);
17842494 clearMaterialButton.addActionListener(this);
17852495 createMaterialButton.addActionListener(this);
1786
-
1787
- propagateToggle.addItemListener(this);
1788
- multiplyToggle.addItemListener(this);
2496
+
2497
+ if (Globals.ADVANCED)
2498
+ {
2499
+ resetSlidersButton.addActionListener(this);
2500
+ propagateToggle.addItemListener(this);
2501
+ multiplyToggle.addItemListener(this);
2502
+ }
17892503 }
17902504
17912505 void DropFile(java.io.File[] files, boolean textures)
....@@ -1803,8 +2517,9 @@
18032517 // 3D models
18042518 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
18052519 {
1806
- lastConverter = new com.jmex.model.converters.MaxToJme();
1807
- LoadFile(filename, lastConverter);
2520
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2521
+ //LoadFile(filename, lastConverter);
2522
+ LoadObjFile(filename); // New 3ds loader
18082523 continue;
18092524 }
18102525 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1859,19 +2574,21 @@
18592574 }
18602575
18612576 // Images/textures
1862
- if (textures
1863
- && (filename.toLowerCase().endsWith(".jpg")
1864
- || filename.toLowerCase().endsWith(".jpeg")
1865
- || filename.toLowerCase().endsWith(".gif")
1866
- || filename.toLowerCase().endsWith(".png")
1867
- || filename.toLowerCase().endsWith(".tre")
1868
- || filename.toLowerCase().endsWith(".bmp")
1869
- || filename.toLowerCase().endsWith(".tga")
1870
- || filename.toLowerCase().endsWith(".sgi")
1871
- || filename.toLowerCase().endsWith(".tif")
1872
- || filename.toLowerCase().endsWith(".tiff")))
2577
+ if (filename.toLowerCase().endsWith(".jpg")
2578
+ || filename.toLowerCase().endsWith(".jpeg")
2579
+ || filename.toLowerCase().endsWith(".gif")
2580
+ || filename.toLowerCase().endsWith(".png")
2581
+ || filename.toLowerCase().endsWith(".tre")
2582
+ || filename.toLowerCase().endsWith(".bmp")
2583
+ || filename.toLowerCase().endsWith(".tga")
2584
+ || filename.toLowerCase().endsWith(".sgi")
2585
+ || filename.toLowerCase().endsWith(".tif")
2586
+ || filename.toLowerCase().endsWith(".tiff"))
18732587 {
1874
- DropTexture(filename);
2588
+ if (textures)
2589
+ DropTexture(filename);
2590
+ else
2591
+ CreateBillboard(filename);
18752592 continue;
18762593 }
18772594
....@@ -1880,6 +2597,60 @@
18802597 }
18812598
18822599 ResetModel();
2600
+ }
2601
+
2602
+ void CreateBillboard(String filename)
2603
+ {
2604
+ Object3D source = null;
2605
+ Object3D group = copy;
2606
+
2607
+ if (group.selection.size() > 0)
2608
+ {
2609
+ source = group.selection.get(0);
2610
+ }
2611
+
2612
+ Grid grid = new Grid(1,1);
2613
+ grid.material = null;
2614
+
2615
+ grid.toParent = LA.newMatrix();
2616
+ grid.fromParent = LA.newMatrix();
2617
+ LA.matYRotate(grid.toParent, Math.PI/2);
2618
+ LA.matXRotate(grid.toParent, -Math.PI/2);
2619
+ LA.matXRotate(grid.fromParent, Math.PI/2);
2620
+ LA.matYRotate(grid.fromParent, -Math.PI/2);
2621
+
2622
+ BillboardNode bb = new BillboardNode();
2623
+ bb.addChild(grid);
2624
+
2625
+ Object3D newgroup = new Object3D();
2626
+ newgroup.CreateMaterial();
2627
+
2628
+ File file = new File(filename);
2629
+ newgroup.name = file.getName();
2630
+ newgroup.addChild(bb);
2631
+
2632
+ Object3D main = newgroup;
2633
+
2634
+ main.SetPigmentTexture(filename);
2635
+
2636
+ if (source != null)
2637
+ {
2638
+ main.material = new cMaterial(source.material);
2639
+ if (main.projectedVertices.length < source.projectedVertices.length)
2640
+ {
2641
+ main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length];
2642
+ }
2643
+
2644
+ for (int i=0; i<source.projectedVertices.length; i++)
2645
+ {
2646
+ main.projectedVertices[i].x = source.projectedVertices[i].x;
2647
+ main.projectedVertices[i].y = source.projectedVertices[i].y;
2648
+ }
2649
+
2650
+ main.texres = source.texres;
2651
+ }
2652
+
2653
+ makeSomething(newgroup, false);
18832654 }
18842655
18852656 Point location;
....@@ -1900,7 +2671,7 @@
19002671
19012672 //? flashIt = false;
19022673 CameraPane pane = (CameraPane) cameraView;
1903
- pane.clickStart(location.x, location.y, 0);
2674
+ pane.clickStart(location.x, location.y, 0, 0);
19042675 pane.clickEnd(location.x, location.y, 0, true);
19052676
19062677 if (group.selection.size() == 1)
....@@ -1949,6 +2720,7 @@
19492720 e2.printStackTrace();
19502721 }
19512722 }
2723
+
19522724 LoadJMEThread loadThread;
19532725
19542726 class LoadJMEThread extends Thread
....@@ -2006,6 +2778,7 @@
20062778 //LoadFile0(filename, converter);
20072779 }
20082780 }
2781
+
20092782 LoadOBJThread loadObjThread;
20102783
20112784 class LoadOBJThread extends Thread
....@@ -2084,19 +2857,19 @@
20842857
20852858 void LoadObjFile(String fullname)
20862859 {
2087
- /*
2860
+ System.out.println("Loading " + fullname);
2861
+ /**/
20882862 //lastFilename = fullname;
20892863 if(loadObjThread == null)
20902864 {
2091
- loadObjThread = new LoadOBJThread();
2092
- loadObjThread.start();
2865
+ loadObjThread = new LoadOBJThread();
2866
+ loadObjThread.start();
20932867 }
20942868
20952869 loadObjThread.add(fullname);
2096
- */
2870
+ /**/
20972871
2098
- System.out.println("Loading " + fullname);
2099
- makeSomething(new FileObject(fullname, true), true);
2872
+ //makeSomething(new FileObject(fullname, true), true);
21002873 }
21012874
21022875 void LoadGFDFile(String fullname)
....@@ -2138,6 +2911,8 @@
21382911 {
21392912 Mocap sel = (Mocap) copy.selection.get(0);
21402913
2914
+ sel.SetCurrentBones(sel.frame);
2915
+
21412916 sel.fullname = fullname;
21422917
21432918 if (changename)
....@@ -2151,14 +2926,18 @@
21512926 sel.smoothed = false;
21522927
21532928 // if (!changename)
2154
- sel.SetPositionDelta(false, true, true, true/*?*/); // false
2929
+ //sel.SetPositionDelta(false, true, true, true/*?*/); // false
2930
+ sel.SetGlobalTransform();
2931
+ sel.LoadData();
2932
+ sel.Rewind();
2933
+ sel.Fade();
21552934 // sel.setPose(0);
21562935 refreshContents();
21572936 } else
21582937 {
21592938 mocap.Reset();
21602939 // new skeleton
2161
- makeSomething(mocap, false); // true);
2940
+ makeSomething(mocap, true); // true);
21622941 }
21632942 } catch (Exception e)
21642943 {
....@@ -2185,6 +2964,8 @@
21852964 {
21862965 Mocap sel = (Mocap) select;
21872966
2967
+ sel.SetCurrentBones(sel.frame);
2968
+
21882969 File file = new File(fullname);
21892970
21902971 // Mocap mocap = new Mocap("Mocap" + file.getName());
....@@ -2251,7 +3032,11 @@
22513032
22523033 if (!changename)
22533034 {
2254
- sel.SetPositionDelta(false, true, true, true/*?*/);
3035
+ //sel.SetPositionDelta(false, true, true, true/*?*/);
3036
+ sel.SetGlobalTransform();
3037
+ sel.LoadData();
3038
+ sel.Rewind();
3039
+ sel.Fade();
22553040 }
22563041
22573042 // sel.setPose(0);
....@@ -2345,11 +3130,11 @@
23453130
23463131 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23473132 {
2348
- if (GrafreeD.standAlone)
3133
+ if (Grafreed.standAlone)
23493134 {
23503135 /**/
23513136 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2352
- browser.show();
3137
+ browser.setVisible(true);
23533138 String filename = browser.getFile();
23543139 if (filename != null && filename.length() > 0)
23553140 {
....@@ -2460,6 +3245,7 @@
24603245 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24613246 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24623247 }
3248
+
24633249 //cJME.count++;
24643250 //cJME.count %= 12;
24653251 if (gc)
....@@ -2494,6 +3280,7 @@
24943280 }
24953281 if (input == null)
24963282 {
3283
+ new Exception().printStackTrace();
24973284 System.exit(0);
24983285 }
24993286
....@@ -2642,6 +3429,7 @@
26423429 }
26433430 }
26443431 }
3432
+
26453433 cFileSystemPane FSPane;
26463434
26473435 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2651,7 +3439,7 @@
26513439
26523440 freezematerial = true;
26533441 colorField.setFloat(mat.color);
2654
- modulationField.setFloat(mat.modulation);
3442
+ saturationField.setFloat(mat.modulation);
26553443 metalnessField.setFloat(mat.metalness);
26563444 diffuseField.setFloat(mat.diffuse);
26573445 specularField.setFloat(mat.specular);
....@@ -2695,11 +3483,14 @@
26953483 }
26963484 }
26973485 }
3486
+
26983487 freezematerial = false;
26993488 }
27003489
27013490 void SetMaterial(Object3D object)
27023491 {
3492
+ latestObject = object;
3493
+
27033494 cMaterial mat = object.material;
27043495
27053496 if (mat == null)
....@@ -2708,7 +3499,8 @@
27083499 return;
27093500 }
27103501
2711
- multiplyToggle.setSelected(mat.multiply);
3502
+ if (multiplyToggle != null)
3503
+ multiplyToggle.setSelected(mat.multiply);
27123504
27133505 assert (object.projectedVertices != null);
27143506
....@@ -2810,12 +3602,17 @@
28103602 // }
28113603
28123604 /**/
2813
- if (deselect)
3605
+ if (deselect || child == null)
28143606 {
28153607 //group.deselectAll();
28163608 //freeze = true;
28173609 GetTree().clearSelection();
28183610 //freeze = false;
3611
+
3612
+ if (child == null)
3613
+ {
3614
+ return;
3615
+ }
28193616 }
28203617
28213618 //group.addSelectee(child);
....@@ -2849,6 +3646,17 @@
28493646 public void itemStateChanged(ItemEvent event)
28503647 {
28513648 // System.out.println("Propagate = " + propagate);
3649
+ if (event.getSource() == pinButton)
3650
+ {
3651
+ copy.pinned ^= true;
3652
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
3653
+ {
3654
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
3655
+ copy.CloseUI();
3656
+ //copy.editWindow.refreshContents();
3657
+ }
3658
+ }
3659
+ else
28523660 if (event.getSource() == propagateToggle)
28533661 {
28543662 propagate ^= true;
....@@ -2884,31 +3692,48 @@
28843692 cameraView.ToggleDL();
28853693 cameraView.repaint();
28863694 return;
2887
- } else if (event.getSource() == toggleTextureItem)
3695
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
28883696 {
28893697 cameraView.ToggleTexture();
28903698 // june 2013 copy.HardTouch();
28913699 cameraView.repaint();
28923700 return;
2893
- } else if (event.getSource() == toggleFullItem)
3701
+ } else if (event.getSource() == toggleTimelineItem)
28943702 {
2895
- if (CameraPane.FULLSCREEN)
3703
+ timeline ^= true;
3704
+
3705
+ if (timeline)
28963706 {
2897
- frame.getContentPane().remove(/*"Center",*/bigThree);
2898
- framePanel.add(bigThree);
2899
- frame.getContentPane().add(/*"Center",*/framePanel);
2900
- } else
2901
- {
2902
- frame.getContentPane().remove(/*"Center",*/framePanel);
2903
- frame.getContentPane().add(/*"Center",*/bigThree);
3707
+ centralPanel.remove(cameraView);
3708
+ cameraPanel.add(cameraView);
3709
+ centralPanel.add(cameraPanel);
3710
+ frame.setJMenuBar(timelineMenubar);
3711
+ wasFullScreen = CameraPane.FULLSCREEN;
3712
+ if (!CameraPane.FULLSCREEN)
3713
+ ToggleFullScreen();
3714
+ toggleFullScreenItem.setEnabled(false);
29043715 }
3716
+ else
3717
+ {
3718
+ centralPanel.remove(cameraPanel);
3719
+ centralPanel.add(cameraView);
3720
+ frame.setJMenuBar(null);
3721
+ if (!wasFullScreen)
3722
+ ToggleFullScreen();
3723
+ toggleFullScreenItem.setEnabled(true);
3724
+ }
3725
+
29053726 frame.validate();
2906
- cameraView.ToggleFullScreen();
3727
+ return;
3728
+ } else if (event.getSource() == toggleFullScreenItem)
3729
+ {
3730
+ ToggleFullScreen();
3731
+ frame.validate();
29073732
29083733 return;
2909
- } else if (event.getSource() == toggleRandomItem)
3734
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29103735 {
2911
- cameraView.ToggleRandom();
3736
+ cameraView.ToggleSwitch();
29123737 cameraView.repaint();
29133738 return;
29143739 } else if (event.getSource() == toggleHandleItem)
....@@ -2936,12 +3761,17 @@
29363761 } else if (event.getSource() == liveCB)
29373762 {
29383763 copy.live ^= true;
3764
+ objEditor.refreshContents(true); // To show item colors
3765
+ return;
3766
+ } else if (event.getSource() == selectableCB)
3767
+ {
3768
+ copy.dontselect ^= true;
29393769 return;
29403770 } else if (event.getSource() == hideCB)
29413771 {
29423772 copy.hide ^= true;
29433773 copy.Touch(); // display list issue
2944
- objEditor.refreshContents();
3774
+ objEditor.refreshContents(true); // To show item colors
29453775 return;
29463776 } else if (event.getSource() == link2masterCB)
29473777 {
....@@ -2951,6 +3781,7 @@
29513781 if (event.getSource() == randomCB)
29523782 {
29533783 copy.random ^= true;
3784
+ objEditor.refreshContents();
29543785 return;
29553786 }
29563787 if (event.getSource() == speedupCB)
....@@ -2974,8 +3805,9 @@
29743805
29753806 public void actionPerformed(ActionEvent event)
29763807 {
3808
+ Object source = event.getSource();
29773809 // SCRIPT DIALOG
2978
- if (event.getSource() == okbutton)
3810
+ if (source == okbutton)
29793811 {
29803812 textpanel.setVisible(false);
29813813 textpanel.remove(textarea);
....@@ -2987,7 +3819,7 @@
29873819 textarea = null;
29883820 textpanel = null;
29893821 }
2990
- if (event.getSource() == cancelbutton)
3822
+ if (source == cancelbutton)
29913823 {
29923824 textpanel.setVisible(false);
29933825 textpanel.remove(textarea);
....@@ -2999,49 +3831,50 @@
29993831 //applySelf();
30003832 //client.refreshEditWindow();
30013833 //refreshContents();
3002
- if (event.getSource() == nameField)
3834
+ if (source == nameField)
30033835 {
30043836 //System.out.println("ObjEditor " + event);
30053837 applySelf0(true);
30063838 //parent.applySelf();
30073839 objEditor.refreshContents();
3008
- } else if (event.getSource() == resetButton)
3840
+ } else if (source == resetButton)
30093841 {
30103842 CameraPane.fullreset = true;
30113843 copy.Reset(); // ResetMeshes();
30123844 copy.Touch();
30133845 objEditor.refreshContents();
3014
- } else if (event.getSource() == stepItem)
3846
+ } else if (source == stepItem)
30153847 {
3016
- cameraView.ONESTEP = true;
3848
+ //cameraView.ONESTEP = true;
3849
+ Globals.ONESTEP = true;
30173850 cameraView.repaint();
30183851 return;
3019
- } else if (event.getSource() == stepButton)
3852
+ } else if (source == stepButton)
30203853 {
30213854 copy.Step();
30223855 copy.Touch();
30233856 objEditor.refreshContents();
3024
- } else if (event.getSource() == slowerButton)
3857
+ } else if (source == slowerButton)
30253858 {
30263859 copy.Slower();
30273860 copy.Touch();
30283861 objEditor.refreshContents();
3029
- } else if (event.getSource() == fasterButton)
3862
+ } else if (source == fasterButton)
30303863 {
30313864 copy.Faster();
30323865 copy.Touch();
30333866 objEditor.refreshContents();
3034
- } else if (event.getSource() == remarkButton)
3867
+ } else if (source == remarkButton)
30353868 {
30363869 copy.Remark();
30373870 copy.Touch();
30383871 objEditor.refreshContents();
3039
- } else if (event.getSource() == stepAllButton)
3872
+ } else if (source == stepAllButton)
30403873 {
30413874 copy.StepAll();
30423875 copy.Touch();
30433876 objEditor.refreshContents();
3044
- } else if (event.getSource() == resetAllButton)
3877
+ } else if (source == resetAllButton)
30453878 {
30463879 //CameraPane.fullreset = true;
30473880 copy.ResetAll(); // ResetMeshes();
....@@ -3074,53 +3907,79 @@
30743907 // Close();
30753908 // }
30763909 // else
3077
- if (event.getSource() == resetSlidersButton)
3910
+ if (source == resetSlidersButton)
30783911 {
30793912 ResetSliders();
3080
- } else if (event.getSource() == clearMaterialButton)
3913
+ } else if (source == clearMaterialButton)
30813914 {
30823915 ClearMaterial();
3083
- } else if (event.getSource() == createMaterialButton)
3916
+ } else if (source == createMaterialButton)
30843917 {
30853918 CreateMaterial();
3086
- } else if (event.getSource() == clearPanelButton)
3919
+ } else if (source == clearPanelButton)
30873920 {
30883921 copy.ClearUI();
30893922 refreshContents(true);
3090
- } /*
3091
- }
3092
-
3093
- public boolean action(Event event, Object arg)
3094
- {
3095
- */ else if (event.getSource() == closeItem)
3923
+ } else if (source == importGFDItem)
3924
+ {
3925
+ ImportGFD();
3926
+ } else
3927
+ if (source == importVRMLX3DItem)
3928
+ {
3929
+ ImportVRMLX3D();
3930
+ } else
3931
+ if (source == import3DSItem)
3932
+ {
3933
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3934
+ } else
3935
+ if (source == importOBJItem)
3936
+ {
3937
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3938
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3939
+ browser.setVisible(true);
3940
+ String filename = browser.getFile();
3941
+ if (filename != null && filename.length() > 0)
3942
+ {
3943
+ String fullname = browser.getDirectory() + filename;
3944
+ makeSomething(ReadOBJ(fullname), true);
3945
+ }
3946
+ } else
3947
+ if (source == closeItem)
30963948 {
30973949 Close();
30983950 //return true;
3099
- } else if (event.getSource() == loadItem)
3951
+ } else if (source == openItem)
31003952 {
3101
- load();
3953
+ Open();
31023954 //return true;
3103
- } else if (event.getSource() == saveItem)
3955
+ } else if (source == newItem)
3956
+ {
3957
+ New();
3958
+ } else if (source == saveItem)
31043959 {
31053960 save();
31063961 //return true;
3107
- } else if (event.getSource() == saveAsItem)
3962
+ } else if (source == saveAsItem)
31083963 {
31093964 saveAs();
31103965 //return true;
3111
- } else if (event.getSource() == reexportItem)
3966
+ } else if (source == reexportItem)
31123967 {
31133968 reexport();
31143969 //return true;
3115
- } else if (event.getSource() == exportAsItem)
3970
+ } else if (source == exportAsItem)
31163971 {
31173972 export();
31183973 //return true;
3119
- } else if (event.getSource() == povItem)
3974
+ } else if (source == povItem)
31203975 {
31213976 generatePOV();
31223977 //return true;
3123
- } else if (event.getSource() == zBufferItem)
3978
+ } else if (event.getSource() == archiveItem)
3979
+ {
3980
+ cTools.Archive(frame);
3981
+ return;
3982
+ } else if (source == zBufferItem)
31243983 {
31253984 try
31263985 {
....@@ -3142,21 +4001,8 @@
31424001 cameraView.repaint();
31434002 //return true;
31444003 }
3145
- */ else if (event.getSource() == editCameraItem)
3146
- {
3147
- cameraView.ProtectCamera();
3148
- cameraView.repaint();
3149
- return;
3150
- } else if (event.getSource() == revertCameraItem)
3151
- {
3152
- cameraView.RevertCamera();
3153
- cameraView.repaint();
3154
- return;
3155
- } else if (event.getSource() == textureButton)
3156
- {
3157
- return; // true;
3158
- } else // combos...
3159
- if (event.getSource() == texresMenu)
4004
+ */ else // combos...
4005
+ if (source == texresMenu)
31604006 {
31614007 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31624008 copy.texres = texresMenu.getSelectedIndex();
....@@ -3168,27 +4014,492 @@
31684014 }
31694015 }
31704016
3171
- void ToggleAnimation()
4017
+ void New()
31724018 {
3173
- if (!CameraPane.ANIMATION)
4019
+ while (copy.Size() > 1)
31744020 {
3175
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
4021
+ copy.remove(1);
4022
+ }
4023
+
4024
+ ResetModel();
4025
+ objEditor.refreshContents();
4026
+ }
4027
+
4028
+ static public byte[] Compress(Object3D o)
4029
+ {
4030
+ // Slower to actually compress.
4031
+ try
4032
+ {
4033
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4034
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
4035
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
4036
+
4037
+ Object3D parent = o.parent;
4038
+ o.parent = null;
4039
+
4040
+ out.writeObject(o);
4041
+
4042
+ o.parent = parent;
4043
+
4044
+ out.flush();
4045
+
4046
+ baos //zstream
4047
+ .close();
4048
+ out.close();
4049
+
4050
+ byte[] bytes = baos.toByteArray();
4051
+
4052
+ System.out.println("save #bytes = " + bytes.length);
4053
+ return bytes;
4054
+ } catch (Exception e)
4055
+ {
4056
+ System.err.println(e);
4057
+ return null;
4058
+ }
4059
+ }
4060
+
4061
+ static public Object Uncompress(byte[] bytes)
4062
+ {
4063
+ System.out.println("restore #bytes = " + bytes.length);
4064
+ try
4065
+ {
4066
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4067
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
4068
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
4069
+ Object obj = in.readObject();
4070
+
4071
+ bais //istream
4072
+ .close();
4073
+ in.close();
4074
+
4075
+ return obj;
4076
+ } catch (Exception e)
4077
+ {
4078
+ System.err.println(e);
4079
+ return null;
4080
+ }
4081
+ }
4082
+
4083
+ static public Object clone(Object o)
4084
+ {
4085
+ try
4086
+ {
4087
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4088
+ ObjectOutputStream out = new ObjectOutputStream(baos);
4089
+
4090
+ out.writeObject(o);
4091
+
4092
+ out.flush();
4093
+ out.close();
4094
+
4095
+ byte[] bytes = baos.toByteArray();
4096
+
4097
+ System.out.println("clone = " + bytes.length);
4098
+
4099
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4100
+ ObjectInputStream in = new ObjectInputStream(bais);
4101
+ Object obj = in.readObject();
4102
+ in.close();
4103
+
4104
+ return obj;
4105
+ } catch (Exception e)
4106
+ {
4107
+ System.err.println(e);
4108
+ return null;
4109
+ }
4110
+ }
4111
+
4112
+ cRadio GetCurrentTab()
4113
+ {
4114
+ cRadio ab;
4115
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4116
+ {
4117
+ ab = (cRadio)e.nextElement();
4118
+ if(ab.GetObject() == copy)
4119
+ {
4120
+ return ab;
4121
+ }
4122
+ }
4123
+
4124
+ return null;
4125
+ }
4126
+
4127
+
4128
+ public void Save()
4129
+ {
4130
+ //Save(true);
4131
+ Replace();
4132
+ SetUndoStates();
4133
+ }
4134
+
4135
+ private boolean Equal(byte[] compress, byte[] name)
4136
+ {
4137
+ if (compress.length != name.length)
4138
+ {
4139
+ return false;
4140
+ }
4141
+
4142
+ for (int i=compress.length; --i>=0;)
4143
+ {
4144
+ if (compress[i] != name[i])
4145
+ return false;
4146
+ }
4147
+
4148
+ return true;
4149
+ }
4150
+
4151
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
4152
+
4153
+ void DeleteVersion()
4154
+ {
4155
+ for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
4156
+ {
4157
+ copy.versionlist[i] = copy.versionlist[i+1];
4158
+ }
4159
+
4160
+ CopyChanged();
4161
+
4162
+ SetUndoStates();
4163
+ }
4164
+
4165
+ public boolean Save(boolean user)
4166
+ {
4167
+ System.err.println("Save");
4168
+ Replace();
4169
+
4170
+ //cRadio tab = GetCurrentTab();
4171
+
4172
+ Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
4173
+
4174
+ boolean thesame = false;
4175
+
4176
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
4177
+// {
4178
+// thesame = true;
4179
+// }
4180
+
4181
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
4182
+ if (!thesame)
4183
+ {
4184
+ for (int i = copy.versionlist.length; --i > copy.versionindex+1;)
4185
+ {
4186
+ copy.versionlist[i] = copy.versionlist[i-1];
4187
+ }
4188
+
4189
+ //tab.user[tab.versionindex] = user;
4190
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
4191
+
4192
+ copy.versionlist[++copy.versionindex] = compress;
4193
+
4194
+ // if (increment)
4195
+ // tab.versionindex++;
4196
+ }
4197
+
4198
+ //copy.RestoreBigData(versiontable);
4199
+
4200
+ //assert(hashtable.isEmpty());
4201
+
4202
+// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
4203
+// {
4204
+// //tab.user[i] = false;
4205
+// copy.versionlist[i] = null;
4206
+// }
4207
+
4208
+ SetUndoStates();
4209
+
4210
+ // test save
4211
+ if (false)
4212
+ {
4213
+ try
4214
+ {
4215
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
4216
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
4217
+
4218
+ p.writeObject(copy);
4219
+
4220
+ p.flush();
4221
+
4222
+ ostream.close();
4223
+ } catch (Exception e)
4224
+ {
4225
+ e.printStackTrace();
4226
+ }
4227
+ }
4228
+
4229
+ return !thesame;
4230
+ }
4231
+
4232
+ boolean flashIt = true;
4233
+
4234
+ void RefreshSelection()
4235
+ {
4236
+ Object3D selection = new Object3D();
4237
+
4238
+ for (int i = 0; i < copy.selection.size(); i++)
4239
+ {
4240
+ Object3D elem = copy.selection.elementAt(i);
4241
+
4242
+ Object3D obj = copy.GetObject(elem.GetUUID());
4243
+
4244
+ if (obj == null)
4245
+ {
4246
+ copy.selection.remove(i--);
4247
+ }
4248
+ else
4249
+ {
4250
+ selection.add(obj);
4251
+ copy.selection.setElementAt(obj, i);
4252
+ }
4253
+ }
4254
+
4255
+ flashIt = false;
4256
+ GetTree().clearSelection();
4257
+ for (int i = 0; i < selection.size(); i++)
4258
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
4259
+ flashIt = true;
4260
+
4261
+ //refreshContents(false);
4262
+ }
4263
+
4264
+ void CopyChanged()
4265
+ {
4266
+ Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4267
+
4268
+ SetUndoStates();
4269
+
4270
+ boolean temp = CameraPane.SWITCH;
4271
+ CameraPane.SWITCH = false;
4272
+
4273
+ copy.ExtractBigData(versiontable);
4274
+
4275
+ copy.clear();
4276
+
4277
+ copy.skyboxname = obj.skyboxname;
4278
+ copy.skyboxext = obj.skyboxext;
4279
+
4280
+ for (int i=0; i<obj.Size(); i++)
4281
+ {
4282
+ copy.add(obj.get(i));
4283
+ }
4284
+
4285
+ copy.RestoreBigData(versiontable);
4286
+
4287
+ CameraPane.SWITCH = temp;
4288
+
4289
+ RefreshSelection();
4290
+ //assert(hashtable.isEmpty());
4291
+
4292
+ copy.Touch();
4293
+
4294
+ ResetModel();
4295
+ copy.HardTouch(); // recompile?
4296
+
4297
+ cRadio ab;
4298
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4299
+ {
4300
+ ab = (cRadio)e.nextElement();
4301
+ Object3D test = copy.GetObject(ab.object.GetUUID());
4302
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
4303
+ if (test != null)
4304
+ {
4305
+ test.editWindow = ab.object.editWindow;
4306
+ ab.object = test;
4307
+ }
4308
+ }
4309
+
4310
+ refreshContents(true);
4311
+ }
4312
+
4313
+ cButton previousVersionButton;
4314
+ cButton restoreButton;
4315
+ cButton replaceButton;
4316
+ cButton nextVersionButton;
4317
+ cButton saveVersionButton;
4318
+ cButton deleteVersionButton;
4319
+
4320
+ boolean muteSlider;
4321
+
4322
+ int VersionCount()
4323
+ {
4324
+ int count = 0;
4325
+
4326
+ for (int i = copy.versionlist.length; --i >= 0;)
4327
+ {
4328
+ if (copy.versionlist[i] != null)
4329
+ count++;
4330
+ }
4331
+
4332
+ return count;
4333
+ }
4334
+
4335
+ void SetUndoStates()
4336
+ {
4337
+ //if (true)
4338
+ // return;
4339
+
4340
+ //cRadio tab = GetCurrentTab();
4341
+
4342
+ restoreButton.setEnabled(copy.versionindex != -1);
4343
+ replaceButton.setEnabled(copy.versionindex != -1);
4344
+
4345
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4346
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4347
+
4348
+ deleteVersionButton.setEnabled(//copy.versionindex > 0 &&
4349
+ copy.versionlist[copy.versionindex + 1] != null);
4350
+
4351
+ muteSlider = true;
4352
+ versionSlider.setMinimum(0);
4353
+ versionSlider.setMaximum(VersionCount() - 1);
4354
+ versionSlider.setInteger(copy.versionindex);
4355
+ versionSlider.setEnabled(copy.versionindex != -1);
4356
+ muteSlider = false;
4357
+ }
4358
+
4359
+ public boolean PreviousVersion()
4360
+ {
4361
+ // Option?
4362
+ Replace();
4363
+
4364
+ System.err.println("Undo");
4365
+
4366
+ //cRadio tab = GetCurrentTab();
4367
+
4368
+ if (copy.versionindex == 0)
4369
+ {
4370
+ java.awt.Toolkit.getDefaultToolkit().beep();
4371
+ return false;
4372
+ }
4373
+
4374
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
4375
+// {
4376
+// if (Save(false))
4377
+// tab.versionindex -= 1;
4378
+// else
4379
+// {
4380
+// if (tab.versionindex <= 0)
4381
+// return false;
4382
+// else
4383
+// tab.versionindex -= 1;
4384
+// }
4385
+// }
4386
+
4387
+ copy.versionindex -= 1;
4388
+
4389
+ CopyChanged();
4390
+
4391
+ return true;
4392
+ }
4393
+
4394
+ public boolean Restore()
4395
+ {
4396
+ System.err.println("Restore");
4397
+
4398
+ //cRadio tab = GetCurrentTab();
4399
+
4400
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4401
+ {
4402
+ java.awt.Toolkit.getDefaultToolkit().beep();
4403
+ return false;
4404
+ }
4405
+
4406
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4407
+ CopyChanged();
4408
+
4409
+ return true;
4410
+ }
4411
+
4412
+ public boolean Replace()
4413
+ {
4414
+ System.err.println("Replace");
4415
+
4416
+ //cRadio tab = GetCurrentTab();
4417
+
4418
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4419
+ {
4420
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
4421
+ return false;
4422
+ }
4423
+
4424
+ copy.versionlist[copy.versionindex] = Duplicate(copy);
4425
+
4426
+ return true;
4427
+ }
4428
+
4429
+ public void NextVersion()
4430
+ {
4431
+ // Option?
4432
+ Replace();
4433
+
4434
+ //cRadio tab = GetCurrentTab();
4435
+
4436
+ if (copy.versionlist[copy.versionindex + 1] == null)
4437
+ {
4438
+ java.awt.Toolkit.getDefaultToolkit().beep();
4439
+ return;
4440
+ }
4441
+
4442
+ copy.versionindex += 1;
4443
+
4444
+ CopyChanged();
4445
+
4446
+ //if (!tab.user[tab.versionindex])
4447
+ // tab.graphs[tab.versionindex] = null;
4448
+ }
4449
+
4450
+ void ImportGFD()
4451
+ {
4452
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
31764453 browser.show();
31774454 String filename = browser.getFile();
31784455 if (filename != null && filename.length() > 0)
31794456 {
3180
- CameraPane.filename = browser.getDirectory() + filename;
4457
+ String fullname = browser.getDirectory() + filename;
4458
+
4459
+ //Object3D readobj =
4460
+ objEditor.ReadGFD(fullname, objEditor);
4461
+ //makeSomething(readobj);
4462
+ }
4463
+ }
4464
+
4465
+ void ImportVRMLX3D()
4466
+ {
4467
+ if (Grafreed.standAlone)
4468
+ {
4469
+ /**/
4470
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4471
+ browser.show();
4472
+ String filename = browser.getFile();
4473
+ if (filename != null && filename.length() > 0)
4474
+ {
4475
+ String fullname = browser.getDirectory() + filename;
4476
+ LoadVRMLX3D(fullname);
4477
+ }
4478
+ /**/
4479
+ }
4480
+ }
4481
+
4482
+ void ToggleAnimation()
4483
+ {
4484
+ if (!Globals.ANIMATION)
4485
+ {
4486
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
4487
+ browser.setVisible(true);
4488
+ String filename = browser.getFile();
4489
+ if (filename != null && filename.length() > 0)
4490
+ {
4491
+ Globals.filename = browser.getDirectory() + filename;
31814492 //CameraPane.framecount = 0;
3182
- CameraPane.imagecount = 0;
4493
+ Globals.imagecount = 0;
31834494
3184
- CameraPane.ANIMATION ^= true;
4495
+ Globals.ANIMATION ^= true;
31854496
3186
- GrafreeD.wav.cursor = 0;
3187
- GrafreeD.wav.loop = 0;
4497
+ Grafreed.wav.cursor = 0;
4498
+ Grafreed.wav.loop = 0;
31884499 }
31894500 } else
31904501 {
3191
- CameraPane.ANIMATION ^= true;
4502
+ Globals.ANIMATION ^= true;
31924503 }
31934504 }
31944505
....@@ -3234,7 +4545,7 @@
32344545 void CreateMaterial()
32354546 {
32364547 //copy.ClearMaterial(); // PATCH
3237
- copy.CreateMaterialS(multiplyToggle.isSelected());
4548
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32384549 if (copy.selection.size() > 0)
32394550 //SetMaterial(copy);
32404551 {
....@@ -3285,7 +4596,7 @@
32854596 assert false;
32864597 }
32874598
3288
- void EditSelection()
4599
+ void EditSelection(boolean newWindow)
32894600 {
32904601 }
32914602
....@@ -3293,11 +4604,11 @@
32934604 {
32944605 copy.ResetBlockLoop(); // temporary problem
32954606
3296
- boolean random = CameraPane.RANDOM;
3297
- CameraPane.RANDOM = false; // parse everything
4607
+ boolean random = CameraPane.SWITCH;
4608
+ CameraPane.SWITCH = false; // parse everything
32984609 copy.ResetDisplayList();
32994610 copy.HardTouch();
3300
- CameraPane.RANDOM = random;
4611
+ CameraPane.SWITCH = random;
33014612 }
33024613
33034614 // public void applySelf()
....@@ -3344,7 +4655,7 @@
33444655 //copy.material = new cMaterial(copy.GetMaterial());
33454656
33464657 current.color = (float) colorField.getFloat();
3347
- current.modulation = (float) modulationField.getFloat();
4658
+ current.modulation = (float) saturationField.getFloat();
33484659 current.metalness = (float) metalnessField.getFloat();
33494660 current.diffuse = (float) diffuseField.getFloat();
33504661 current.specular = (float) specularField.getFloat();
....@@ -3367,10 +4678,40 @@
33674678 current.fakedepth = (float) fakedepthField.getFloat();
33684679 current.shadowbias = (float) shadowbiasField.getFloat();
33694680
3370
- if (!NumberSlider.frozen)
4681
+ if (!cNumberSlider.frozen)
33714682 {
33724683 //System.out.println("Propagate = " + propagate);
33734684 copy.UpdateMaterial(anchor, current, propagate);
4685
+
4686
+ if (copy.material != null)
4687
+ {
4688
+ cMaterial mat = copy.material;
4689
+
4690
+ colorField.SetToolTipValue((mat.color));
4691
+ saturationField.SetToolTipValue((mat.modulation));
4692
+ metalnessField.SetToolTipValue((mat.metalness));
4693
+ diffuseField.SetToolTipValue((mat.diffuse));
4694
+ specularField.SetToolTipValue((mat.specular));
4695
+ shininessField.SetToolTipValue((mat.shininess));
4696
+ shiftField.SetToolTipValue((mat.shift));
4697
+ ambientField.SetToolTipValue((mat.ambient));
4698
+ lightareaField.SetToolTipValue((mat.lightarea));
4699
+ diffusenessField.SetToolTipValue((mat.factor));
4700
+ velvetField.SetToolTipValue((mat.velvet));
4701
+ sheenField.SetToolTipValue((mat.sheen));
4702
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4703
+ backlitField.SetToolTipValue((mat.bump));
4704
+ anisoField.SetToolTipValue((mat.aniso));
4705
+ anisoVField.SetToolTipValue((mat.anisoV));
4706
+ cameraField.SetToolTipValue((mat.cameralight));
4707
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4708
+ shadowField.SetToolTipValue((mat.shadow));
4709
+ textureField.SetToolTipValue((mat.texture));
4710
+ opacityField.SetToolTipValue((mat.opacity));
4711
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4712
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
4713
+ }
4714
+
33744715 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
33754716 {
33764717 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3399,9 +4740,26 @@
33994740 //copy.Touch();
34004741 }
34014742
4743
+ cNumberSlider versionSlider;
4744
+
34024745 public void stateChanged(ChangeEvent e)
34034746 {
34044747 // assert(false);
4748
+ if (e.getSource() == versionSlider)
4749
+ {
4750
+ if (muteSlider)
4751
+ return;
4752
+
4753
+ int version = versionSlider.getInteger();
4754
+
4755
+ if (version != -1 && copy.versionlist[version] != null)
4756
+ {
4757
+ copy.versionindex = version;
4758
+ CopyChanged();
4759
+ }
4760
+
4761
+ return;
4762
+ }
34054763
34064764 if (freezematerial)
34074765 {
....@@ -3415,6 +4773,7 @@
34154773 || e.getSource() == apertureField
34164774 || e.getSource() == shadowblurField)
34174775 {
4776
+ new Exception().printStackTrace();
34184777 System.exit(0);
34194778 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34204779 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3436,12 +4795,24 @@
34364795 {
34374796 //System.out.println("stateChanged = " + this);
34384797 materialtouched = true;
4798
+
4799
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
4800
+ {
4801
+ saturationField.setFloat(1);
4802
+ }
4803
+
34394804 applySelf();
34404805 //System.out.println("this = " + this);
34414806 //System.out.println("PARENT = " + parent);
34424807 //if (parent != null)
34434808 // parent.applySelf();
3444
- refreshContents();
4809
+ if (e.getSource() == normalpushField)
4810
+ {
4811
+ objEditor.refreshContents();
4812
+ //Refresh();
4813
+ }
4814
+ else
4815
+ refreshContents();
34454816 // ??? client.refreshEditWindow();
34464817 }
34474818 //else
....@@ -3453,7 +4824,7 @@
34534824 //group.name = nameField.getText();
34544825 //objEditor.applySelf();
34554826
3456
- assert (objEditor == this);
4827
+ // OCT2018: assert (objEditor == this);
34574828 if (copy.selection == null || copy.selection.size() == 0)
34584829 //super.applySelf()
34594830 ; else
....@@ -3477,12 +4848,18 @@
34774848 objEditor.copy = keep;
34784849 }
34794850 }
4851
+
4852
+ if (normalpushField != null)
4853
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
34804854 }
34814855
34824856 void SnapObject()
34834857 {
3484
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3485
- SnapObject(obj);
4858
+ if (copy.selection.size() > 0)
4859
+ {
4860
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
4861
+ SnapObject(obj);
4862
+ }
34864863 }
34874864
34884865 void SnapObject(Object3D obj)
....@@ -3596,7 +4973,7 @@
35964973
35974974 if (obj.parent != null)
35984975 {
3599
- obj.parent.TransformToWorld(interest);
4976
+// obj.parent.TransformToWorld(interest);
36004977 }
36014978
36024979 if (!CameraPane.TRACK)
....@@ -3723,20 +5100,26 @@
37235100 {
37245101 if (GetTree() != null)
37255102 {
5103
+ GetTree().revalidate();
37265104 GetTree().repaint();
37275105 }
37285106
37295107 radioPanel.revalidate();
37305108 radioPanel.repaint();
3731
- ctrlPanel.revalidate(); // ? new
5109
+ ctrlPanel.validate(); // ? new
37325110 ctrlPanel.repaint();
37335111 }
5112
+
5113
+ if (previousVersionButton != null && copy.versionlist != null)
5114
+ SetUndoStates();
37345115 }
37355116
37365117 static TweenManager tweenManager = new TweenManager();
37375118
37385119 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37395120 {
5121
+ if (Globals.REPLACEONMAKE) // && resetmodel)
5122
+ Save();
37405123 //Tween.set(thing, 0).target(1).start(tweenManager);
37415124 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37425125 // if (thing instanceof GenericJointDemo)
....@@ -3823,6 +5206,12 @@
38235206 {
38245207 ResetModel();
38255208 Select(thing.GetTreePath(), true, false); // unselect... false);
5209
+
5210
+ if (thing.Size() == 0)
5211
+ {
5212
+ //EditSelection(false);
5213
+ }
5214
+
38265215 refreshContents();
38275216 }
38285217
....@@ -3940,6 +5329,7 @@
39405329 }
39415330 }
39425331 }
5332
+
39435333 LoadGFDThread loadGFDThread;
39445334
39455335 void ReadGFD(String fullname, iCallBack cb)
....@@ -3959,8 +5349,10 @@
39595349
39605350 try
39615351 {
5352
+ // Try compressed version first.
39625353 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
3963
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5354
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
5355
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
39645356
39655357 readobj = (Object3D) p.readObject();
39665358 istream.close();
....@@ -3968,7 +5360,22 @@
39685360 readobj.ResetDisplayList();
39695361 } catch (Exception e)
39705362 {
3971
- e.printStackTrace();
5363
+ if (!e.toString().contains("GZIP"))
5364
+ e.printStackTrace();
5365
+
5366
+ try
5367
+ {
5368
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
5369
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5370
+
5371
+ readobj = (Object3D) p.readObject();
5372
+ istream.close();
5373
+
5374
+ readobj.ResetDisplayList();
5375
+ } catch (Exception e2)
5376
+ {
5377
+ e2.printStackTrace();
5378
+ }
39725379 }
39735380 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
39745381 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4014,6 +5421,12 @@
40145421
40155422 void LoadIt(Object obj)
40165423 {
5424
+ if (obj == null)
5425
+ {
5426
+ // Invalid file
5427
+ return;
5428
+ }
5429
+
40175430 System.out.println("Loaded " + obj);
40185431 //new Exception().printStackTrace();
40195432 Object3D readobj = (Object3D) obj;
....@@ -4023,10 +5436,14 @@
40235436
40245437 if (readobj != null)
40255438 {
5439
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
5440
+ // Save();
40265441 try
40275442 {
40285443 //readobj.deepCopySelf(copy);
40295444 copy.clear(); // june 2014
5445
+ copy.skyboxname = readobj.skyboxname;
5446
+ copy.skyboxext = readobj.skyboxext;
40305447 for (int i = 0; i < readobj.size(); i++)
40315448 {
40325449 Object3D child = readobj.get(i); // reserve(i);
....@@ -4067,6 +5484,7 @@
40675484 }
40685485 } catch (ClassCastException e)
40695486 {
5487
+ e.printStackTrace();
40705488 assert (false);
40715489 Composite c = (Composite) copy;
40725490 c.children.clear();
....@@ -4077,17 +5495,31 @@
40775495 c.addChild(csg);
40785496 }
40795497
5498
+ copy.versionlist = readobj.versionlist;
5499
+ copy.versionindex = readobj.versionindex;
5500
+
5501
+ if (copy.versionlist == null)
5502
+ {
5503
+ // Backward compatibility
5504
+ copy.versionlist = new Object3D[100];
5505
+ copy.versionindex = -1;
5506
+
5507
+ Save(true);
5508
+ }
5509
+
5510
+ //? SetUndoStates();
5511
+
40805512 ResetModel();
40815513 copy.HardTouch(); // recompile?
40825514 refreshContents();
40835515 }
40845516 }
40855517
4086
- void load() // throws ClassNotFoundException
5518
+ void Open() // throws ClassNotFoundException
40875519 {
4088
- if (GrafreeD.standAlone)
5520
+ if (Grafreed.standAlone)
40895521 {
4090
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
5522
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
40915523 browser.show();
40925524 String filename = browser.getFile();
40935525 if (filename != null && filename.length() > 0)
....@@ -4172,11 +5604,13 @@
41725604 try
41735605 {
41745606 FileOutputStream ostream = new FileOutputStream(lastname);
4175
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5607
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5608
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
41765609
41775610 p.writeObject(copy);
41785611 p.flush();
41795612
5613
+ zstream.close();
41805614 ostream.close();
41815615
41825616 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4184,19 +5618,23 @@
41845618 //ps.print(buffer.toString());
41855619 } catch (IOException e)
41865620 {
5621
+ e.printStackTrace();
41875622 }
41885623 }
5624
+
41895625 String lastname;
41905626
41915627 void saveAs()
41925628 {
4193
- if (GrafreeD.standAlone)
5629
+ if (Grafreed.standAlone)
41945630 {
41955631 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
41965632 browser.setVisible(true);
41975633 String filename = browser.getFile();
41985634 if (filename != null && filename.length() > 0)
41995635 {
5636
+ if (!filename.endsWith(".gfd"))
5637
+ filename += ".gfd";
42005638 lastname = browser.getDirectory() + filename;
42015639 save();
42025640 }
....@@ -4295,13 +5733,13 @@
42955733 try
42965734 {
42975735 FileOutputStream ostream = new FileOutputStream(filename);
4298
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4299
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5736
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5737
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43005738
43015739 Object3D objectparent = obj.parent;
43025740 obj.parent = null;
43035741
4304
- Object3D object = (Object3D) GrafreeD.clone(obj);
5742
+ Object3D object = (Object3D) Grafreed.clone(obj);
43055743
43065744 obj.parent = objectparent;
43075745
....@@ -4313,8 +5751,8 @@
43135751 p.writeObject(object);
43145752 p.flush();
43155753
5754
+ zstream.close();
43165755 ostream.close();
4317
- // zstream.close();
43185756
43195757 // group.selection.get(0).parent = parent;
43205758 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4335,7 +5773,7 @@
43355773 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43365774 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43375775 copy.generatePOV(buffer);
4338
- if (GrafreeD.standAlone)
5776
+ if (Grafreed.standAlone)
43395777 {
43405778 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43415779 browser.show();
....@@ -4361,53 +5799,71 @@
43615799 Object3D client;
43625800 Object3D copy;
43635801 MenuBar menuBar;
4364
- Menu windowMenu;
4365
- MenuItem loadItem;
5802
+ Menu fileMenu;
5803
+ MenuItem newItem;
5804
+ MenuItem openItem;
43665805 MenuItem saveItem;
43675806 MenuItem saveAsItem;
43685807 MenuItem exportAsItem;
43695808 MenuItem reexportItem;
43705809 MenuItem povItem;
43715810 MenuItem closeItem;
4372
- Menu cameraMenu;
5811
+
43735812 CheckboxMenuItem zBufferItem;
43745813 //MenuItem normalLensItem;
4375
- MenuItem editCameraItem;
4376
- MenuItem revertCameraItem;
4377
- CheckboxMenuItem toggleLiveItem;
43785814 MenuItem stepItem;
4379
- CheckboxMenuItem toggleFullItem;
5815
+ CheckboxMenuItem toggleLiveItem;
5816
+ CheckboxMenuItem toggleFullScreenItem;
5817
+ CheckboxMenuItem toggleTimelineItem;
43805818 CheckboxMenuItem toggleRenderItem;
43815819 CheckboxMenuItem toggleDebugItem;
43825820 CheckboxMenuItem toggleFrustumItem;
43835821 CheckboxMenuItem toggleFootContactItem;
43845822 CheckboxMenuItem toggleDLItem;
43855823 CheckboxMenuItem toggleTextureItem;
4386
- CheckboxMenuItem toggleRandomItem;
5824
+ CheckboxMenuItem toggleSwitchItem;
43875825 CheckboxMenuItem toggleRootItem;
43885826 CheckboxMenuItem animationItem;
5827
+ MenuItem archiveItem;
43895828 CheckboxMenuItem toggleHandleItem;
43905829 CheckboxMenuItem togglePaintItem;
43915830 JSplitPane mainPanel;
43925831 JScrollPane scrollpane;
5832
+
43935833 JPanel toolbarPanel;
4394
- JPanel treePanel;
5834
+
5835
+ cGridBag treePanel;
5836
+
43955837 JPanel radioPanel;
43965838 ButtonGroup buttonGroup;
4397
- JPanel ctrlPanel;
4398
- JPanel materialPanel;
5839
+
5840
+ cGridBag toolboxPanel;
5841
+ cGridBag skyboxPanel;
5842
+ cGridBag materialPanel;
5843
+ cGridBag ctrlPanel;
5844
+
43995845 JScrollPane infoPanel;
4400
- JPanel optionsPanel;
5846
+
5847
+ cGridBag optionsPanel;
5848
+
44015849 JTabbedPane objectPanel;
4402
- JPanel XYZPanel;
5850
+ boolean materialFlushed;
5851
+ Object3D latestObject;
5852
+
5853
+ cGridBag XYZPanel;
5854
+
44035855 JSplitPane gridPanel;
44045856 JSplitPane bigPanel;
4405
- JPanel bigThree;
4406
- JTabbedPane jtp;
4407
- JPanel cameraPanel;
5857
+
5858
+ cGridBag bigThree;
5859
+ cGridBag scenePanel;
5860
+ cGridBag centralPanel;
5861
+ JSplitPane cameraPanel;
5862
+ JPanel timelinePanel;
5863
+ JMenuBar timelineMenubar;
44085864 JSplitPane framePanel;
44095865 JTextArea/*Field*/ nameField;
4410
- cButton textureButton;
5866
+ //cButton textureButton;
44115867 cButton okButton;
44125868 cButton applyButton;
44135869 cButton cancelButton;
....@@ -4454,65 +5910,74 @@
44545910 // MATERIAL
44555911 JLabel materialLabel;
44565912 JLabel colorLabel;
4457
- NumberSlider colorField;
5913
+ cNumberSlider colorField;
44585914 JLabel modulationLabel;
4459
- NumberSlider modulationField;
5915
+ cNumberSlider saturationField;
44605916 JLabel metalnessLabel;
4461
- NumberSlider metalnessField;
5917
+ cNumberSlider metalnessField;
44625918 JLabel diffuseLabel;
4463
- NumberSlider diffuseField;
5919
+ cNumberSlider diffuseField;
44645920 JLabel specularLabel;
4465
- NumberSlider specularField;
5921
+ cNumberSlider specularField;
44665922 JLabel shininessLabel;
4467
- NumberSlider shininessField;
5923
+ cNumberSlider shininessField;
44685924 JLabel shiftLabel;
4469
- NumberSlider shiftField;
5925
+ cNumberSlider shiftField;
44705926 JLabel ambientLabel;
4471
- NumberSlider ambientField;
5927
+ cNumberSlider ambientField;
44725928 JLabel lightareaLabel;
4473
- NumberSlider lightareaField;
5929
+ cNumberSlider lightareaField;
44745930 JLabel diffusenessLabel;
4475
- NumberSlider diffusenessField;
5931
+ cNumberSlider diffusenessField;
44765932 JLabel velvetLabel;
4477
- NumberSlider velvetField;
5933
+ cNumberSlider velvetField;
44785934 JLabel sheenLabel;
4479
- NumberSlider sheenField;
5935
+ cNumberSlider sheenField;
44805936 JLabel subsurfaceLabel;
4481
- NumberSlider subsurfaceField;
5937
+ cNumberSlider subsurfaceField;
44825938 //JLabel bumpLabel;
44835939 //NumberSlider bumpField;
44845940 JLabel backlitLabel;
4485
- NumberSlider backlitField;
5941
+ cNumberSlider backlitField;
44865942 JLabel anisoLabel;
4487
- NumberSlider anisoField;
5943
+ cNumberSlider anisoField;
44885944 JLabel anisoVLabel;
4489
- NumberSlider anisoVField;
5945
+ cNumberSlider anisoVField;
5946
+
44905947 JLabel cameraLabel;
4491
- NumberSlider cameraField;
5948
+ cNumberSlider cameraField;
44925949 JLabel selfshadowLabel;
4493
- NumberSlider selfshadowField;
5950
+ cNumberSlider selfshadowField;
44945951 JLabel shadowLabel;
4495
- NumberSlider shadowField;
5952
+ cNumberSlider shadowField;
44965953 JLabel textureLabel;
4497
- NumberSlider textureField;
5954
+ cNumberSlider textureField;
44985955 JLabel opacityLabel;
4499
- NumberSlider opacityField;
5956
+ cNumberSlider opacityField;
45005957 JLabel fakedepthLabel;
4501
- NumberSlider fakedepthField;
5958
+ cNumberSlider fakedepthField;
45025959 JLabel shadowbiasLabel;
4503
- NumberSlider shadowbiasField;
5960
+ cNumberSlider shadowbiasField;
5961
+
45045962 JLabel bumpLabel;
4505
- NumberSlider bumpField;
5963
+ cNumberSlider bumpField;
45065964 JLabel noiseLabel;
4507
- NumberSlider noiseField;
5965
+ cNumberSlider noiseField;
45085966 JLabel powerLabel;
4509
- NumberSlider powerField;
5967
+ cNumberSlider powerField;
45105968 JLabel borderfadeLabel;
4511
- NumberSlider borderfadeField;
5969
+ cNumberSlider borderfadeField;
45125970 JLabel fogLabel;
4513
- NumberSlider fogField;
5971
+ cNumberSlider fogField;
45145972 JLabel opacityPowerLabel;
4515
- NumberSlider opacityPowerField;
4516
- JTree jTree;
5973
+ cNumberSlider opacityPowerField;
5974
+ cTree jTree;
45175975 //ObjectUI parent;
5976
+
5977
+ cNumberSlider normalpushField;
5978
+
5979
+ private MenuItem importGFDItem;
5980
+ private MenuItem importVRMLX3DItem;
5981
+ private MenuItem import3DSItem;
5982
+ private MenuItem importOBJItem;
45185983 }