Normand Briere
2019-08-16 83d0c2fa0bd2e96448f776144e1a89cdb1bb6998
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,129 @@
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 void AllocProjectedVertices(Object3D object)
47
+ {
48
+ assert (object.projectedVertices != null);
49
+
50
+ if (object.projectedVertices.length <= 2)
51
+ {
52
+ // Side effect...
53
+ Object3D.cVector2[] keep = object.projectedVertices;
54
+ object.projectedVertices = new Object3D.cVector2[3];
55
+ for (int i = 0; i < 3; i++)
56
+ {
57
+ if (i < keep.length)
58
+ {
59
+ object.projectedVertices[i] = keep[i];
60
+ } else
61
+ {
62
+ object.projectedVertices[i] = new Object3D.cVector2();
63
+ }
64
+ /*
65
+ if(keep.length == 0)
66
+ object.projectedVertices[0] = new Object3D.cVector2();
67
+ else
68
+ object.projectedVertices[0] = keep[0];
69
+ object.projectedVertices[1] = new Object3D.cVector2();
70
+ */
71
+ }
72
+ }
73
+ }
74
+
75
+ public cGridBag GetSeparator()
76
+ {
77
+ cGridBag separator = new cGridBag();
78
+ separator.add(new JSeparator());
79
+ separator.preferredHeight = 5;
80
+ return separator;
81
+ }
82
+
83
+ cButton GetButton(String name, boolean border)
84
+ {
85
+ ImageIcon icon = GetIcon(name);
86
+ return new cButton(icon, border);
87
+ }
88
+
89
+ cLabel GetLabel(String name, boolean border)
90
+ {
91
+ //ImageIcon icon = GetIcon(name);
92
+ return new cLabel(GetImage(name), border);
93
+ }
94
+
95
+ cToggleButton GetToggleButton(String name, boolean border)
96
+ {
97
+ ImageIcon icon = GetIcon(name);
98
+ return new cToggleButton(icon, border);
99
+ }
100
+
101
+ cCheckBox GetCheckBox(String name, boolean border)
102
+ {
103
+ ImageIcon icon = GetIcon(name);
104
+ return new cCheckBox(icon, border);
105
+ }
106
+
107
+ static java.util.Hashtable<String, javax.swing.ImageIcon> icons = new java.util.Hashtable<String, javax.swing.ImageIcon>();
108
+
109
+ ImageIcon GetIcon(String name)
110
+ {
111
+ javax.swing.ImageIcon iconCache = icons.get(name);
112
+ if (iconCache != null)
113
+ {
114
+ return iconCache;
115
+ }
116
+
117
+ try
118
+ {
119
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
120
+
121
+// if (image.getWidth() > 48 && image.getHeight() > 48)
122
+// {
123
+// BufferedImage resized = new BufferedImage(48, 48, image.getType());
124
+// Graphics2D g = resized.createGraphics();
125
+// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
126
+// //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
127
+// g.drawImage(image, 0, 0, 48, 48, 0, 0, image.getWidth(), image.getHeight(), null);
128
+// g.dispose();
129
+//
130
+// image = resized;
131
+// }
132
+
133
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
134
+
135
+ icons.put(name, icon);
136
+
137
+ return icon;
138
+ }
139
+ catch (Exception e)
140
+ {
141
+ //icons.put(name, null);
142
+ return null;
143
+ }
144
+ }
145
+
146
+ BufferedImage GetImage(String name)
147
+ {
148
+ try
149
+ {
150
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
151
+
152
+ return image;
153
+ }
154
+ catch (Exception e)
155
+ {
156
+ return null;
157
+ }
158
+ }
159
+
32160 // SCRIPT
33161
34162 transient JFrame textpanel = null;
....@@ -119,51 +247,62 @@
119247 void keyPressed(int key, int modifiers)
120248 {
121249 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
250
+ Globals.theRenderer.keyPressed(key, modifiers);
123251 }
124252 */
125253
126254 static GridBagConstraints aConstraints;
127255 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
256
+
130257 static int GRIDWIDTH = 100; // 4;
131258
132259 public void closeUI()
133260 {
134261 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
262
+// System.out.println("this = " + this);
263
+// System.out.println("objEditor = " + objEditor);
137264 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
265
+// objEditor.ctrlPanel.remove(nameField);
139266
140
- if (!GroupEditor.allparams)
267
+ objEditor.ctrlPanel.remove(namePanel);
268
+
269
+ if (!allparams)
141270 return;
142271
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);
272
+// objEditor.ctrlPanel.remove(liveCB);
273
+// objEditor.ctrlPanel.remove(hideCB);
274
+// objEditor.ctrlPanel.remove(markCB);
275
+//
276
+// objEditor.ctrlPanel.remove(randomCB);
277
+// objEditor.ctrlPanel.remove(speedupCB);
278
+// objEditor.ctrlPanel.remove(rewindCB);
279
+//
280
+// objEditor.ctrlPanel.remove(resetButton);
281
+// objEditor.ctrlPanel.remove(stepButton);
282
+//// objEditor.ctrlPanel.remove(stepAllButton);
283
+//// objEditor.ctrlPanel.remove(resetAllButton);
284
+// objEditor.ctrlPanel.remove(link2masterCB);
285
+// //objEditor.ctrlPanel.remove(flipVCB);
286
+// //objEditor.ctrlPanel.remove(texresMenu);
287
+// objEditor.ctrlPanel.remove(slowerButton);
288
+// objEditor.ctrlPanel.remove(fasterButton);
289
+// objEditor.ctrlPanel.remove(remarkButton);
290
+
291
+ objEditor.ctrlPanel.remove(setupPanel);
292
+ objEditor.ctrlPanel.remove(setupPanel2);
293
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
294
+ objEditor.ctrlPanel.remove(pushPanel);
295
+ //objEditor.ctrlPanel.remove(fillPanel);
296
+
297
+ //Remove(normalpushField);
161298 }
162299
163300 public ObjEditor GetEditor()
164301 {
165302 return objEditor; //.GetEditor();
166303 }
304
+
305
+ // Sometimes myself, sometimes my callee's.
167306 ObjEditor objEditor;
168307
169308 /*
....@@ -199,6 +338,14 @@
199338 client = inClient;
200339 copy = client;
201340
341
+// if (copy.versionlist == null)
342
+// {
343
+// copy.versionlist = new Object3D[100];
344
+// copy.versionindex = -1;
345
+//
346
+// callee.Save(true);
347
+// }
348
+
202349 // "this" is not called: SetupUI2(objEditor);
203350 }
204351
....@@ -212,6 +359,14 @@
212359 client = inClient;
213360 copy = client;
214361
362
+ if (copy.versionlist == null)
363
+ {
364
+ copy.versionlist = new Object3D[100];
365
+ copy.versionindex = -1;
366
+
367
+// Save(true);
368
+ }
369
+
215370 SetupUI2(callee.GetEditor());
216371 }
217372
....@@ -226,23 +381,33 @@
226381 //localCopy.parent = null;
227382
228383 frame = new JFrame();
384
+ frame.setUndecorated(false);
229385 objEditor = this;
230386 this.callee = callee;
231387
232388 //parent = p;
233389
234390 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
235
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
391
+ if (Globals.DEBUG)
392
+ System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
236393 //gd.setFullScreenWindow(this);
237394 //setResizable(false);
238395 //if (!isDisplayable())
239396 //setUndecorated(true);
240397
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
398
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242399 client = inClient;
243400 copy = localCopy;
244401 copy.editWindow = this;
245402
403
+// if (copy.versionlist == null)
404
+// {
405
+// copy.versionlist = new Object3D[100];
406
+// copy.versionindex = -1;
407
+//
408
+// Save(true);
409
+// }
410
+
246411 SetupMenu();
247412
248413 //SetupName(objEditor); // new
....@@ -256,28 +421,49 @@
256421 return frame.action(event, obj);
257422 }
258423
424
+ // Cannot work without static
425
+ static boolean allparams = true;
426
+
427
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
428
+
259429 void SetupMenu()
260430 {
261431 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..."));
432
+ menuBar.add(fileMenu = new Menu("File"));
433
+ fileMenu.add(newItem = new MenuItem("New"));
434
+ fileMenu.add(openItem = new MenuItem("Open..."));
435
+
436
+ //oe.menuBar.add(menu = new Menu("Include"));
437
+ Menu menu = new Menu("Import");
438
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
439
+ importOBJItem.addActionListener(this);
440
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
441
+ import3DSItem.addActionListener(this);
442
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
443
+ importVRMLX3DItem.addActionListener(this);
444
+ menu.add("-");
445
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
446
+ importGFDItem.addActionListener(this);
447
+ fileMenu.add(menu);
448
+ fileMenu.add("-");
449
+
450
+ fileMenu.add(saveItem = new MenuItem("Save"));
451
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
267452 //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("-");
453
+ fileMenu.add("-");
454
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
455
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
456
+ fileMenu.add("-");
272457 if (client.parent != null)
273458 {
274
- windowMenu.add(closeItem = new MenuItem("Close"));
459
+ fileMenu.add(closeItem = new MenuItem("Close"));
275460 } else
276461 {
277
- windowMenu.add(closeItem = new MenuItem("Exit"));
462
+ fileMenu.add(closeItem = new MenuItem("Exit"));
278463 }
279464
280
- loadItem.addActionListener(this);
465
+ newItem.addActionListener(this);
466
+ openItem.addActionListener(this);
281467 saveItem.addActionListener(this);
282468 saveAsItem.addActionListener(this);
283469 exportAsItem.addActionListener(this);
....@@ -285,80 +471,103 @@
285471 //povItem.addActionListener(this);
286472 closeItem.addActionListener(this);
287473
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
-
341474 objectPanel = new JTabbedPane();
475
+
476
+ ChangeListener changeListener = new ChangeListener()
477
+ {
478
+ //String name;
479
+
480
+ public void stateChanged(ChangeEvent changeEvent)
481
+ {
482
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
483
+// {
484
+// if (latestObject != null)
485
+// {
486
+// refreshContents(true);
487
+// SetMaterial(latestObject);
488
+// }
489
+//
490
+// materialFlushed = true;
491
+// }
492
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
493
+// {
494
+// if (listUI.size() == 0)
495
+// EditSelection(false);
496
+// }
497
+
498
+// if (objectPanel.getSelectedIndex() == 4)
499
+// {
500
+// name = copy.skyboxname;
501
+//
502
+// if (name == null)
503
+// {
504
+// name = "";
505
+// }
506
+//
507
+// copy.skyboxname = "cubemaps/default-skyboxes/rgb";
508
+// copy.skyboxext = "jpg";
509
+// }
510
+// else
511
+// {
512
+// if (name != null)
513
+// {
514
+// if (name.equals(""))
515
+// {
516
+// copy.skyboxname = null;
517
+// copy.skyboxext = null;
518
+// }
519
+// else
520
+// {
521
+// copy.skyboxname = name;
522
+// }
523
+// }
524
+// }
525
+ cameraView.transformMode = objectPanel.getSelectedIndex() == 4;
526
+
527
+// refreshContents(false); // To refresh Info tab
528
+ cameraView.repaint();
529
+ }
530
+ };
531
+ objectPanel.addChangeListener(changeListener);
532
+
342533 toolbarPanel = new JPanel();
343534 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
535
+
536
+ treePanel = new cGridBag();
345537 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
347
- ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
349
- materialPanel.setName("Material");
538
+
539
+ editPanel = new cGridBag().setVertical(true);
540
+ //editPanel.setName("Edit");
541
+
542
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
543
+
544
+ editCommandsPanel = new cGridBag();
545
+ editPanel.add(editCommandsPanel);
546
+ editPanel.add(ctrlPanel);
547
+
548
+ toolboxPanel = new cGridBag().setVertical(true);
549
+ //toolboxPanel.setName("Toolbox");
550
+
551
+ skyboxPanel = new cGridBag().setVertical(true);
552
+
553
+ materialPanel = new cGridBag().setVertical(false);
554
+ //materialPanel.setName("Material");
555
+
350556 /*JTextPane*/
351557 infoarea = createTextPane();
558
+ doc = infoarea.getStyledDocument();
559
+
352560 infoarea.setEditable(true);
353561 SetText();
562
+
354563 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355564 // infoarea.setOpaque(false);
356565 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
566
+// TEXTAREA infoarea.setLineWrap(true);
567
+// TEXTAREA infoarea.setWrapStyleWord(true);
359568 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");
569
+ infoPanel.setPreferredSize(new Dimension(1, 1));
570
+ //infoPanel.setName("Info");
362571 //infoPanel.setLayout(new BorderLayout());
363572 //infoPanel.add(createTextPane());
364573
....@@ -366,16 +575,23 @@
366575 mainPanel.setName("Main");
367576 mainPanel.setContinuousLayout(true);
368577 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370578 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
372
-
579
+ mainPanel.setDividerLocation(0.5); //1.0);
580
+ mainPanel.setResizeWeight(0.5);
581
+
582
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
583
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
584
+ divider.setDividerSize(15);
585
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
586
+
587
+ mainPanel.setUI(new BasicSplitPaneUI());
588
+
373589 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374590 //mainPanel.setLayout(new GridBagLayout());
375591 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
592
+// treePanel.setLayout(new GridBagLayout());
593
+ //ctrlPanel.setLayout(new GridBagLayout());
594
+ //materialPanel.setLayout(new GridBagLayout());
379595
380596 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381597 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +630,7 @@
414630 static String newline = "\n";
415631 protected static final String buttonString = "JButton";
416632 StyledDocument doc;
417
- JTextArea infoarea;
633
+ JTextPane infoarea;
418634
419635 void ClearInfo()
420636 {
....@@ -437,10 +653,10 @@
437653 e.printStackTrace();
438654 }
439655
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();
656
+// String selection = infoarea.getText();
657
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
658
+// java.awt.datatransfer.Clipboard clipboard =
659
+// Toolkit.getDefaultToolkit().getSystemClipboard();
444660 //clipboard.setContents(data, data);
445661 }
446662
....@@ -463,13 +679,13 @@
463679 //SendInfo("Name:", "bold");
464680 if (sel.GetTextures() != null || debug)
465681 {
466
- si.SendInfo(sel.toString(), "bold");
682
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
467683 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
468684 if (sel.Size() > 0)
469685 {
470686 si.SendInfo("#children = " + sel.Size(), "regular");
471687 }
472
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
688
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
473689 if (debug)
474690 {
475691 try
....@@ -481,7 +697,10 @@
481697 }
482698
483699 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
700
+ {
701
+ si.SendInfo(" BBox min: " + minima, "regular");
702
+ si.SendInfo(" BBox max: " + maxima, "regular");
703
+ }
485704
486705 if (sel.bRep != null)
487706 {
....@@ -508,7 +727,7 @@
508727 }
509728 if (sel.support != null)
510729 {
511
- si.SendInfo(" support: " + sel.support, "regular");
730
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
512731 }
513732 if (sel.scriptnode != null)
514733 {
....@@ -579,6 +798,9 @@
579798 {
580799 CameraPane.pointflow = (PointFlow) sel;
581800 }
801
+
802
+ si.SendInfo("_____________________", "regular");
803
+ si.SendInfo("", "regular");
582804 }
583805 }
584806
....@@ -594,52 +816,211 @@
594816 }
595817 }
596818
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
- };
819
+//static GraphicsDevice device = GraphicsEnvironment
820
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
614821
615
- String[] initStyles =
616
- {
617
- "regular", "italic", "bold", "small", "large",
618
- "regular", "button", "regular", "icon",
619
- "regular"
620
- };
822
+ Rectangle keeprect;
823
+ cRadio radio;
824
+
825
+cButton keepButton;
826
+ cButton twoButton; // Full 3D
827
+ cButton sixButton;
828
+ cButton threeButton;
829
+ cButton sevenButton;
830
+ cButton fourButton; // full panel
831
+ cButton oneButton; // full XYZ
832
+ //cButton currentLayout;
833
+
834
+ boolean maximized;
835
+
836
+ cButton fullscreenLayout;
837
+ cButton expandedLayout;
621838
622
- JTextPane textPane = new JTextPane();
623
- textPane.setEditable(true);
624
- /*StyledDocument*/ doc = textPane.getStyledDocument();
625
- addStylesToDocument(doc);
626
-
627
- try
839
+ void Minimize()
628840 {
629
- for (int j = 0; j < 2; j++)
841
+ frame.setState(Frame.ICONIFIED);
842
+ frame.validate();
843
+ }
844
+
845
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
846
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
847
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
848
+ void Maximize()
849
+ {
850
+ if (CameraPane.FULLSCREEN)
630851 {
631
- for (int i = 0; i < initString.length; i++)
632
- {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
635
- }
852
+ ToggleFullScreen();
636853 }
637
- } catch (BadLocationException ble)
854
+
855
+ if (maximized)
856
+ {
857
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
858
+ }
859
+ else
860
+ {
861
+ keeprect = frame.getBounds();
862
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
863
+// Dimension rect2 = frame.getToolkit().getScreenSize();
864
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
865
+// frame.setState(Frame.MAXIMIZED_BOTH);
866
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
867
+ }
868
+
869
+ maximized ^= true;
870
+
871
+ frame.validate();
872
+ }
873
+
874
+ cButton minButton;
875
+ cButton maxButton;
876
+ cButton fullButton;
877
+ cButton collapseButton;
878
+ cButton maximize3DButton;
879
+
880
+ void ToggleFullScreen()
638881 {
639
- System.err.println("Couldn't insert initial text into text pane.");
882
+ GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
883
+
884
+ cameraView.ToggleFullScreen();
885
+
886
+ if (!CameraPane.FULLSCREEN)
887
+ {
888
+ device.setFullScreenWindow(null);
889
+ frame.dispose();
890
+ frame.setUndecorated(false);
891
+ frame.validate();
892
+ frame.setVisible(true);
893
+
894
+ //frame.setVisible(false);
895
+// frame.removeNotify();
896
+// frame.setUndecorated(false);
897
+// frame.addNotify();
898
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
899
+
900
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
901
+// X framePanel.add(bigThree);
902
+// X frame.getContentPane().add(/*"Center",*/framePanel);
903
+// framePanel.setDividerLocation(46); // icons are 24x24
904
+
905
+ //frame.setVisible(true);
906
+// radio.layout = keepButton;
907
+ //theFrame = null;
908
+ keepButton = null;
909
+// radio.layout.doClick();
910
+
911
+ } else
912
+ {
913
+ keepButton = radio.layout;
914
+ //keeprect = frame.getBounds();
915
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
916
+// frame.getToolkit().getScreenSize().height);
917
+ //frame.setVisible(false);
918
+
919
+ frame.dispose();
920
+ frame.setUndecorated(true);
921
+ device.setFullScreenWindow(frame);
922
+ frame.validate();
923
+ frame.setVisible(true);
924
+// frame.removeNotify();
925
+// frame.setUndecorated(true);
926
+// frame.addNotify();
927
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
928
+// X framePanel.remove(bigThree);
929
+// X frame.getContentPane().add(/*"Center",*/bigThree);
930
+// framePanel.setDividerLocation(0);
931
+
932
+// radio.layout = fullscreenLayout;
933
+// radio.layout.doClick();
934
+ //frame.setVisible(true);
935
+ }
936
+ frame.validate();
937
+
938
+ cameraView.requestFocusInWindow();
640939 }
641940
642
- return new JTextArea(); // textPane;
941
+ void CollapseToolbar()
942
+ {
943
+ framePanel.setDividerLocation(0);
944
+ //frame.validate();
945
+
946
+ cameraView.requestFocusInWindow();
947
+ }
948
+
949
+ private Object3D Duplicate(Object3D object)
950
+ {
951
+ boolean temp = CameraPane.SWITCH;
952
+ CameraPane.SWITCH = false;
953
+
954
+ if (Grafreed.grafreed.universe.versiontable == null)
955
+ Grafreed.grafreed.universe.versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
956
+
957
+ object.ExtractBigData(Grafreed.grafreed.universe.versiontable);
958
+ // if (copy == client)
959
+
960
+ Object3D versions[] = object.versionlist;
961
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = object.versiontable; // if Grafreed.grafreed.universe
962
+ object.versionlist = null;
963
+ object.versiontable = null;
964
+
965
+ //byte[] compress = Compress(copy);
966
+ Object3D compress = (Object3D)Grafreed.clone(object);
967
+
968
+ object.versionlist = versions;
969
+ object.versiontable = versiontable; // if Grafreed.grafreed.universe
970
+
971
+ object.RestoreBigData(Grafreed.grafreed.universe.versiontable);
972
+
973
+ CameraPane.SWITCH = temp;
974
+
975
+ return compress;
976
+ }
977
+
978
+ private JTextPane createTextPane()
979
+ {
980
+// TEXTAREA String[] initString =
981
+// {
982
+// "This is an editable JTextPane, ", //regular
983
+// "another ", //italic
984
+// "styled ", //bold
985
+// "text ", //small
986
+// "component, ", //large
987
+// "which supports embedded components..." + newline,//regular
988
+// " " + newline, //button
989
+// "...and embedded icons..." + newline, //regular
990
+// " ", //icon
991
+// newline + "JTextPane is a subclass of JEditorPane that "
992
+// + "uses a StyledEditorKit and StyledDocument, and provides "
993
+// + "cover methods for interacting with those objects."
994
+// };
995
+//
996
+// String[] initStyles =
997
+// {
998
+// "regular", "italic", "bold", "small", "large",
999
+// "regular", "button", "regular", "icon",
1000
+// "regular"
1001
+// };
1002
+//
1003
+// JTextPane textPane = new JTextPane();
1004
+// textPane.setEditable(true);
1005
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
1006
+// addStylesToDocument(doc);
1007
+//
1008
+// try
1009
+// {
1010
+// for (int j = 0; j < 2; j++)
1011
+// {
1012
+// for (int i = 0; i < initString.length; i++)
1013
+// {
1014
+// doc.insertString(doc.getLength(), initString[i],
1015
+// doc.getStyle(initStyles[i]));
1016
+// }
1017
+// }
1018
+// } catch (BadLocationException ble)
1019
+// {
1020
+// System.err.println("Couldn't insert initial text into text pane.");
1021
+// }
1022
+
1023
+ return new JTextPane(); // textPane;
6431024 }
6441025
6451026 protected void addStylesToDocument(StyledDocument doc)
....@@ -692,7 +1073,7 @@
6921073 protected static ImageIcon createImageIcon(String path,
6931074 String description)
6941075 {
695
- java.net.URL imgURL = GrafreeD.class.getResource(path);
1076
+ java.net.URL imgURL = Grafreed.class.getResource(path);
6961077 if (imgURL != null)
6971078 {
6981079 return new ImageIcon(imgURL, description);
....@@ -715,6 +1096,7 @@
7151096 {
7161097 SetupMaterial(materialPanel);
7171098 }
1099
+
7181100 //SetupName();
7191101 //SetupViews();
7201102 }
....@@ -724,6 +1106,7 @@
7241106 // NumberSlider vDivsField;
7251107 // JCheckBox endcaps;
7261108 JCheckBox liveCB;
1109
+ JCheckBox selectableCB;
7271110 JCheckBox hideCB;
7281111 JCheckBox link2masterCB;
7291112 JCheckBox markCB;
....@@ -731,7 +1114,12 @@
7311114 JCheckBox speedupCB;
7321115 JCheckBox rewindCB;
7331116 JCheckBox flipVCB;
1117
+
1118
+ cCheckBox toggleTextureCB;
1119
+ cCheckBox toggleSwitchCB;
1120
+
7341121 JComboBox texresMenu;
1122
+
7351123 JButton resetButton;
7361124 JButton stepButton;
7371125 JButton stepAllButton;
....@@ -739,115 +1127,87 @@
7391127 JButton slowerButton;
7401128 JButton fasterButton;
7411129 JButton remarkButton;
1130
+
1131
+ cGridBag editPanel;
1132
+ cGridBag editCommandsPanel;
1133
+
1134
+ cGridBag namePanel;
1135
+ cGridBag setupPanel;
1136
+ cGridBag setupPanel2;
1137
+ cGridBag objectCommandsPanel;
1138
+ cGridBag pushPanel;
1139
+ cGridBag fillPanel;
7421140
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
1141
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
7441142 {
7451143 JCheckBox cb;
7461144
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);
1145
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7521146 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
7561147
7571148 return cb;
7581149 }
7591150
760
- cButton AddButton(ObjEditor oe, String label)
1151
+ cButton AddButton(cGridBag panel, String label)
7611152 {
7621153 cButton cb;
7631154
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);
1155
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
7691156 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
7731157
7741158 return cb;
7751159 }
7761160
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
1161
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
7781162 {
7791163 JComboBox combo;
7801164
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;
1165
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7841166 combo.addActionListener(this);
7851167
7861168 return combo;
7871169 }
7881170
789
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
1171
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
7901172 {
791
- NumberSlider combo;
1173
+ cGridBag control = new cGridBag();
1174
+
1175
+ cNumberSlider combo;
7921176
7931177 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
7961178 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
-
1179
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1180
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8061181 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
1182
+
1183
+ panel.add(control);
1184
+
1185
+ return control;
8131186 }
8141187
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
1188
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
8161189 {
817
- NumberSlider combo;
1190
+ cGridBag control = new cGridBag();
1191
+
1192
+ cNumberSlider combo;
8181193
8191194 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
8221195 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
-
1196
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1197
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8321198 combo.setInteger(current);
8331199
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
1200
+ panel.add(control);
1201
+
1202
+ return control;
8391203 }
8401204
841
- JTextArea AddText(JPanel ctrlPanel, String name)
1205
+ JTextArea AddText(cGridBag ctrlPanel, String name)
8421206 {
8431207 JTextArea text;
8441208
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1209
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8481210 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
8511211
8521212 return text;
8531213 }
....@@ -877,9 +1237,16 @@
8771237 objEditor.ctrlPanel.remove(j);
8781238 }
8791239
1240
+ void Remove(cNumberSlider j)
1241
+ {
1242
+ j.removeChangeListener(this);
1243
+ //objEditor.ctrlPanel.remove(j.label);
1244
+ objEditor.ctrlPanel.remove(j);
1245
+ }
1246
+
8801247 /*
8811248 */
882
- void Return() // ObjEditor oe)
1249
+ void Return0() // ObjEditor oe)
8831250 {
8841251 aConstraints.gridy += 1;
8851252 aConstraints.gridx = 0;
....@@ -934,35 +1301,93 @@
9341301
9351302 void SetupUI2(ObjEditor oe)
9361303 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- SetupName(oe);
1304
+ //SetupName(oe);
9421305
943
- if (!GroupEditor.allparams)
1306
+ namePanel = new cGridBag();
1307
+
1308
+ //if (copy.pinned)
1309
+ {
1310
+ pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1311
+ pinButton.setSelected(copy.pinned);
1312
+ cGridBag t = new cGridBag();
1313
+ t.preferredWidth = 2;
1314
+ t.add(pinButton);
1315
+ namePanel.add(t);
1316
+
1317
+ pinButton.addItemListener(this);
1318
+ }
1319
+
1320
+ nameField = AddText(namePanel, copy.GetName());
1321
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
1322
+ oe.ctrlPanel.add(namePanel);
1323
+
1324
+ oe.ctrlPanel.Return();
1325
+
1326
+ if (!allparams)
9441327 return;
9451328
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1329
+ setupPanel = new cGridBag().setVertical(false);
1330
+
1331
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1332
+ liveCB.setToolTipText("Animate object");
1333
+ markCB = AddCheckBox(setupPanel, "Anim", copy.marked);
1334
+ markCB.setToolTipText("Set target transform");
1335
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1336
+ selectableCB.setToolTipText("Make object selectable");
9491337 // 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");
1338
+
1339
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1340
+ hideCB.setToolTipText("Hide object");
1341
+
1342
+ ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
1343
+
1344
+ setupPanel2 = new cGridBag().setVertical(false);
1345
+
1346
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1347
+ rewindCB.setToolTipText("Rewind animation");
1348
+
1349
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1350
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1351
+
1352
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1353
+ link2masterCB.setToolTipText("Attach to support");
1354
+
1355
+ if (Globals.ADVANCED)
1356
+ {
1357
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1358
+ speedupCB.setToolTipText("Option motion capture");
1359
+ }
1360
+
1361
+ oe.ctrlPanel.add(setupPanel);
1362
+ oe.ctrlPanel.Return();
1363
+ oe.ctrlPanel.add(setupPanel2);
1364
+ oe.ctrlPanel.Return();
1365
+
1366
+ objectCommandsPanel = new cGridBag().setVertical(false);
1367
+
1368
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1369
+ resetButton.setToolTipText("Jump to frame zero");
1370
+ stepButton = AddButton(objectCommandsPanel, "Step");
1371
+ stepButton.setToolTipText("Step one frame");
9561372 // resetAllButton = AddButton(oe, "Reset All");
9571373 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9591374 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- remarkButton = AddButton(oe, "Rem");
1375
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1376
+ slowerButton.setToolTipText("Decrease animation speed");
1377
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1378
+ fasterButton.setToolTipText("Increase animation speed");
1379
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1380
+ remarkButton.setToolTipText("Set the current transform as the target");
9631381
964
- Return();
1382
+ oe.ctrlPanel.add(objectCommandsPanel);
1383
+ oe.ctrlPanel.Return();
9651384
1385
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1386
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1387
+ //Return();
1388
+
1389
+ oe.ctrlPanel.Return();
1390
+
9661391 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671392 // ObjEditor.aConstraints.gridx += 1;
9681393
....@@ -1056,7 +1481,7 @@
10561481 oe.aConstraints.gridwidth = 1;
10571482 /**/
10581483 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1484
+ oe.ctrlPanel.Return();
10601485
10611486 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621487 //textureButton.setEnabled(false);
....@@ -1114,6 +1539,7 @@
11141539
11151540 if (cam == null || !(copy.get(0) instanceof cGroup))
11161541 {
1542
+ if (Globals.DEBUG)
11171543 System.out.println("CREATE CAMERAS");
11181544 cams = new cTemplate();
11191545 cams.name = "Cameras";
....@@ -1158,10 +1584,28 @@
11581584 //JPanel worldPanel =
11591585 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601586 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1587
+ centralPanel = new cGridBag();
1588
+ centralPanel.preferredWidth = 20;
1589
+
1590
+ if (Globals.ADVANCED)
1591
+ {
1592
+ timelinePanel = new JPanel(new BorderLayout());
1593
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11641594
1595
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1596
+ cameraPanel.setContinuousLayout(true);
1597
+ cameraPanel.setOneTouchExpandable(true);
1598
+// cameraPanel.setDividerLocation(0.9);
1599
+// cameraPanel.setDividerSize(9);
1600
+ cameraPanel.setResizeWeight(1.0);
1601
+
1602
+ }
1603
+
1604
+ centralPanel.add(cameraView);
1605
+ centralPanel.setFocusable(true);
1606
+ //frame.setJMenuBar(timelineMenubar);
1607
+ //centralPanel.add(timelinePanel);
1608
+
11651609 //topView.camera = ;
11661610 //frontView.camera = new Camera(2);
11671611 //sideView.camera = new Camera(3);
....@@ -1177,12 +1621,14 @@
11771621 //frontView.object = copy;
11781622 //sideView.object = copy;
11791623
1180
- XYZPanel = new JPanel();
1181
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1624
+ XYZPanel = new cGridBag().setVertical(true);
1625
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11821626
1183
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1184
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1627
+ XYZPanel.preferredWidth = 5;
1628
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1629
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1630
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1631
+ //XYZPanel.setName("XYZ");
11861632
11871633 /*
11881634 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1191,7 +1637,7 @@
11911637 gridPanel.add(cameraView);
11921638 gridPanel.add(XYZPanel);
11931639 */
1194
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1640
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11951641 gridPanel.setContinuousLayout(true);
11961642 gridPanel.setOneTouchExpandable(true);
11971643 gridPanel.setDividerLocation(1.0);
....@@ -1219,13 +1665,30 @@
12191665
12201666 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12211667 //tmp.setName("Edit");
1222
- 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);
1668
+ objectPanel.add(toolboxPanel);
1669
+ objectPanel.setIconAt(0, GetIcon("icons/primitives.png"));
1670
+ objectPanel.setToolTipTextAt(0, "Objects & textures");
12281671
1672
+ objectPanel.add(materialPanel);
1673
+ objectPanel.setIconAt(1, GetIcon("icons/material.png"));
1674
+ objectPanel.setToolTipTextAt(1, "Material");
1675
+
1676
+ objectPanel.add(skyboxPanel);
1677
+ objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1678
+ objectPanel.setToolTipTextAt(2, "Backgrounds");
1679
+
1680
+// JPanel north = new JPanel(new BorderLayout());
1681
+// north.setName("Edit");
1682
+// north.add(ctrlPanel, BorderLayout.NORTH);
1683
+// objectPanel.add(north);
1684
+ objectPanel.add(editPanel);
1685
+ objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1686
+ objectPanel.setToolTipTextAt(3, "Edit controls");
1687
+
1688
+ objectPanel.add(XYZPanel);
1689
+ objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
1690
+ objectPanel.setToolTipTextAt(4, "XYZ/RGB transform");
1691
+
12291692 /*
12301693 aConstraints.gridx = 0;
12311694 aConstraints.gridwidth = 1;
....@@ -1233,7 +1696,7 @@
12331696 aConstraints.gridy += 1;
12341697 aConstraints.gridwidth = 1;
12351698 mainPanel.add(objectPanel, aConstraints);
1236
- */
1699
+ */
12371700
12381701 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12391702 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1244,17 +1707,29 @@
12441707 scrollpane.setWheelScrollingEnabled(true);
12451708 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461709
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1710
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1711
+ scenePanel.preferredWidth = 5;
1712
+
1713
+ JTabbedPane tabbedPane = new JTabbedPane();
1714
+ tabbedPane.add(scrollpane);
12491715
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1251
-
1252
- optionsPanel = new JPanel(new GridBagLayout());
1716
+ optionsPanel = new cGridBag().setVertical(false);
12531717
12541718 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1719
+
1720
+ AddOptions(optionsPanel); //, aConstraints);
1721
+
1722
+ tabbedPane.add(optionsPanel);
1723
+
1724
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12561725
1726
+ scenePanel.add(tabbedPane);
12571727
1728
+ //if (Globals.ADVANCED)
1729
+// tabbedPane.add(infoPanel);
1730
+// tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1731
+// tabbedPane.setToolTipTextAt(3, "Information");
1732
+
12581733 /*
12591734 cTree jTree = new cTree(null);
12601735 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1275,7 +1750,7 @@
12751750 jtp.add(tree);
12761751 */
12771752
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1753
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791754 bigPanel.setContinuousLayout(true);
12801755 bigPanel.setOneTouchExpandable(true);
12811756 bigPanel.setDividerLocation(0.8);
....@@ -1287,6 +1762,7 @@
12871762 //bigPanel.setSize(new Dimension(10,10));
12881763 //bigPanel.add(ctrlPanel);
12891764 //bigPanel.add(gridPanel);
1765
+ /**
12901766 bigThree = new JPanel();
12911767 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12921768 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1297,20 +1773,26 @@
12971773 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981774 aWindowConstraints.weightx = 0;
12991775 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1776
+ bigThree.add(scenePanel, aWindowConstraints);
13011777 aWindowConstraints.weightx = 1;
13021778 aWindowConstraints.gridwidth = 3;
13031779 // aConstraints.gridheight = 3;
13041780 aWindowConstraints.gridx = 1;
13051781 aWindowConstraints.fill = GridBagConstraints.BOTH;
1306
- bigThree.add(cameraPanel, aWindowConstraints);
1782
+ bigThree.add(centralPanel, aWindowConstraints);
13071783 aWindowConstraints.weightx = 0;
13081784 aWindowConstraints.gridx = 4;
13091785 aWindowConstraints.gridwidth = 1;
13101786 // aConstraints.gridheight = 3;
13111787 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13121788 bigThree.add(XYZPanel, aWindowConstraints);
1789
+ /**/
13131790
1791
+ bigThree = new cGridBag();
1792
+ bigThree.addComponent(scenePanel);
1793
+ bigThree.addComponent(centralPanel);
1794
+ //bigThree.addComponent(XYZPanel);
1795
+
13141796 // // SIDE EFFECT!!!
13151797 // aConstraints.gridx = 0;
13161798 // aConstraints.gridy = 0;
....@@ -1318,33 +1800,55 @@
13181800 // aConstraints.gridheight = 1;
13191801
13201802 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1321
- framePanel.setContinuousLayout(true);
1322
- framePanel.setOneTouchExpandable(true);
1323
- framePanel.setDividerLocation(0.8);
1803
+
1804
+ framePanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY,
1805
+ new java.beans.PropertyChangeListener()
1806
+ {
1807
+ public void propertyChange(java.beans.PropertyChangeEvent pce)
1808
+ {
1809
+ if ((Integer)pce.getOldValue() == 1)
1810
+ {
1811
+ if (radio.layout != expandedLayout)
1812
+ {
1813
+ radio.layout = expandedLayout;
1814
+ radio.layout.doClick();
1815
+ }
1816
+ }
1817
+ }
1818
+ });
1819
+
1820
+ framePanel.setContinuousLayout(false);
1821
+ framePanel.setOneTouchExpandable(false);
1822
+ //.setDividerLocation(0.8);
13241823 //framePanel.setDividerSize(15);
13251824 //framePanel.setResizeWeight(0.15);
13261825 framePanel.setName("Frame");
13271826
13281827 frame.getContentPane().setLayout(new BorderLayout());
13291828 /**/
1330
- JTabbedPane worldPane = new JTabbedPane();
1829
+ //JTabbedPane worldPane = new JTabbedPane();
13311830 //worldPane.add(bigPanel);
13321831 //worldPane.add(worldPanel);
13331832 /**/
1334
- frame.getContentPane().add(/*"Center",*/framePanel);
1833
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1834
+ frame.add(/*"Center",*/framePanel);
13351835 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361836
13371837 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13381838
1339
- frame.setSize(1024, 768);
1340
- frame.show();
1341
-
1839
+ frame.setSize(1280, 860);
1840
+
1841
+ cameraView.requestFocusInWindow();
1842
+
13421843 gridPanel.setDividerLocation(1.0);
1844
+
1845
+ frame.validate();
1846
+
1847
+ frame.setVisible(true);
13431848
13441849 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13451850 frame.addWindowListener(new WindowAdapter()
13461851 {
1347
-
13481852 public void windowClosing(WindowEvent e)
13491853 {
13501854 Close();
....@@ -1352,6 +1856,10 @@
13521856 });
13531857 }
13541858
1859
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1860
+ {
1861
+ }
1862
+
13551863 JTree GetTree()
13561864 {
13571865 return objEditor.jTree;
....@@ -1363,260 +1871,601 @@
13631871 ctrlPanel.removeAll();
13641872 }
13651873
1366
- void SetupMaterial(JPanel ctrlPanel)
1874
+ void SetupMaterial(cGridBag materialpanel)
13671875 {
1368
- aConstraints.weighty = 0;
1369
- //aConstraints.weightx = 1;
1370
- /*
1876
+ cGridBag presetpanel = new cGridBag().setVertical(true);
1877
+
1878
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
1879
+ skin.setToolTipText("Skin");
1880
+ skin.addMouseListener(new MouseAdapter()
1881
+ {
1882
+ public void mouseClicked(MouseEvent e)
1883
+ {
1884
+ Object3D object = Grafreed.materials.versionlist[0].get(0);
1885
+ cMaterial material = object.material;
1886
+
1887
+ // Skin
1888
+ colorField.setFloat(material.color);
1889
+ saturationField.setFloat(material.modulation);
1890
+ subsurfaceField.setFloat(material.subsurface);
1891
+ selfshadowField.setFloat(material.diffuseness);
1892
+ diffusenessField.setFloat(material.factor);
1893
+ shininessField.setFloat(material.shininess);
1894
+ shadowbiasField.setFloat(material.shadowbias);
1895
+ diffuseField.setFloat(material.diffuse);
1896
+ specularField.setFloat(material.specular);
1897
+
1898
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
1899
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
1900
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
1901
+
1902
+ materialtouched = true;
1903
+ applySelf();
1904
+ }
1905
+ });
1906
+ presetpanel.add(skin);
1907
+
1908
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
1909
+ lambert.setToolTipText("Diffuse");
1910
+ lambert.addMouseListener(new MouseAdapter()
1911
+ {
1912
+ public void mouseClicked(MouseEvent e)
1913
+ {
1914
+ Object3D object = Grafreed.materials.versionlist[2].get(0);
1915
+ cMaterial material = object.material;
1916
+
1917
+ diffusenessField.setFloat(material.factor);
1918
+ selfshadowField.setFloat(material.diffuseness);
1919
+
1920
+ materialtouched = true;
1921
+ applySelf();
1922
+ }
1923
+ });
1924
+ presetpanel.add(lambert);
1925
+
1926
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
1927
+ diffuse2.setToolTipText("Diffuse2");
1928
+ diffuse2.addMouseListener(new MouseAdapter()
1929
+ {
1930
+ public void mouseClicked(MouseEvent e)
1931
+ {
1932
+ Object3D object = Grafreed.materials.versionlist[3].get(0);
1933
+ cMaterial material = object.material;
1934
+
1935
+ diffusenessField.setFloat(material.factor);
1936
+ selfshadowField.setFloat(material.diffuseness);
1937
+
1938
+ materialtouched = true;
1939
+ applySelf();
1940
+ }
1941
+ });
1942
+ presetpanel.add(diffuse2);
1943
+
1944
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
1945
+ diffusemoon.setToolTipText("Moon");
1946
+ diffusemoon.addMouseListener(new MouseAdapter()
1947
+ {
1948
+ public void mouseClicked(MouseEvent e)
1949
+ {
1950
+ Object3D object = Grafreed.materials.versionlist[4].get(0);
1951
+ cMaterial material = object.material;
1952
+
1953
+ diffusenessField.setFloat(material.factor);
1954
+ selfshadowField.setFloat(material.diffuseness);
1955
+
1956
+ materialtouched = true;
1957
+ applySelf();
1958
+ }
1959
+ });
1960
+ presetpanel.add(diffusemoon);
1961
+
1962
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
1963
+ diffusemoon2.setToolTipText("Moon2");
1964
+ diffusemoon2.addMouseListener(new MouseAdapter()
1965
+ {
1966
+ public void mouseClicked(MouseEvent e)
1967
+ {
1968
+ Object3D object = Grafreed.materials.versionlist[5].get(0);
1969
+ cMaterial material = object.material;
1970
+
1971
+ diffusenessField.setFloat(material.factor);
1972
+ selfshadowField.setFloat(material.diffuseness);
1973
+
1974
+ materialtouched = true;
1975
+ applySelf();
1976
+ }
1977
+ });
1978
+ presetpanel.add(diffusemoon2);
1979
+
1980
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
1981
+ diffusemoon3.setToolTipText("Moon3");
1982
+ diffusemoon3.addMouseListener(new MouseAdapter()
1983
+ {
1984
+ public void mouseClicked(MouseEvent e)
1985
+ {
1986
+ Object3D object = Grafreed.materials.versionlist[6].get(0);
1987
+ cMaterial material = object.material;
1988
+
1989
+ diffusenessField.setFloat(material.factor);
1990
+ selfshadowField.setFloat(material.diffuseness);
1991
+
1992
+ materialtouched = true;
1993
+ applySelf();
1994
+ }
1995
+ });
1996
+ presetpanel.add(diffusemoon3);
1997
+
1998
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
1999
+ diffusesheen.setToolTipText("Sheen");
2000
+ diffusesheen.addMouseListener(new MouseAdapter()
2001
+ {
2002
+ public void mouseClicked(MouseEvent e)
2003
+ {
2004
+ Object3D object = Grafreed.materials.versionlist[7].get(0);
2005
+ cMaterial material = object.material;
2006
+
2007
+ sheenField.setFloat(material.sheen);
2008
+
2009
+ materialtouched = true;
2010
+ applySelf();
2011
+ }
2012
+ });
2013
+ presetpanel.add(diffusesheen);
2014
+
2015
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
2016
+ rough.setToolTipText("Rough metal");
2017
+ rough.addMouseListener(new MouseAdapter()
2018
+ {
2019
+ public void mouseClicked(MouseEvent e)
2020
+ {
2021
+ Object3D object = Grafreed.materials.versionlist[1].get(0);
2022
+ cMaterial material = object.material;
2023
+
2024
+ shininessField.setFloat(material.shininess);
2025
+ velvetField.setFloat(material.velvet);
2026
+
2027
+ materialtouched = true;
2028
+ applySelf();
2029
+ }
2030
+ });
2031
+ presetpanel.add(rough);
2032
+
2033
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
2034
+ rough2.setToolTipText("Medium metal");
2035
+ rough2.addMouseListener(new MouseAdapter()
2036
+ {
2037
+ public void mouseClicked(MouseEvent e)
2038
+ {
2039
+ Object3D object = Grafreed.materials.versionlist[13].get(0);
2040
+ cMaterial material = object.material;
2041
+
2042
+ shininessField.setFloat(material.shininess);
2043
+ lightareaField.setFloat(material.lightarea);
2044
+
2045
+ materialtouched = true;
2046
+ applySelf();
2047
+ }
2048
+ });
2049
+ presetpanel.add(rough2);
2050
+
2051
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
2052
+ shini0.setToolTipText("Shiny");
2053
+ shini0.addMouseListener(new MouseAdapter()
2054
+ {
2055
+ public void mouseClicked(MouseEvent e)
2056
+ {
2057
+ Object3D object = Grafreed.materials.versionlist[14].get(0);
2058
+ cMaterial material = object.material;
2059
+
2060
+ shininessField.setFloat(material.shininess);
2061
+ lightareaField.setFloat(material.lightarea);
2062
+
2063
+ materialtouched = true;
2064
+ applySelf();
2065
+ }
2066
+ });
2067
+ presetpanel.add(shini0);
2068
+
2069
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
2070
+ shini1.setToolTipText("Shiny2");
2071
+ shini1.addMouseListener(new MouseAdapter()
2072
+ {
2073
+ public void mouseClicked(MouseEvent e)
2074
+ {
2075
+ Object3D object = Grafreed.materials.versionlist[11].get(0);
2076
+ cMaterial material = object.material;
2077
+
2078
+ shininessField.setFloat(material.shininess);
2079
+ lightareaField.setFloat(material.lightarea);
2080
+
2081
+ materialtouched = true;
2082
+ applySelf();
2083
+ }
2084
+ });
2085
+ presetpanel.add(shini1);
2086
+
2087
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2088
+ shini2.setToolTipText("Shiny3");
2089
+ shini2.addMouseListener(new MouseAdapter()
2090
+ {
2091
+ public void mouseClicked(MouseEvent e)
2092
+ {
2093
+ Object3D object = Grafreed.materials.versionlist[12].get(0);
2094
+ cMaterial material = object.material;
2095
+
2096
+ shininessField.setFloat(material.shininess);
2097
+ lightareaField.setFloat(material.lightarea);
2098
+
2099
+ materialtouched = true;
2100
+ applySelf();
2101
+ }
2102
+ });
2103
+ presetpanel.add(shini2);
2104
+
2105
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2106
+ aniso.setToolTipText("AnisoU");
2107
+ aniso.addMouseListener(new MouseAdapter()
2108
+ {
2109
+ public void mouseClicked(MouseEvent e)
2110
+ {
2111
+ Object3D object = Grafreed.materials.versionlist[8].get(0);
2112
+ cMaterial material = object.material;
2113
+
2114
+ anisoField.setFloat(material.aniso);
2115
+ anisoVField.setFloat(material.anisoV);
2116
+
2117
+ materialtouched = true;
2118
+ applySelf();
2119
+ }
2120
+ });
2121
+ presetpanel.add(aniso);
2122
+
2123
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2124
+ aniso2.setToolTipText("AnisoV");
2125
+ aniso2.addMouseListener(new MouseAdapter()
2126
+ {
2127
+ public void mouseClicked(MouseEvent e)
2128
+ {
2129
+ Object3D object = Grafreed.materials.versionlist[9].get(0);
2130
+ cMaterial material = object.material;
2131
+
2132
+ anisoField.setFloat(material.aniso);
2133
+ anisoVField.setFloat(material.anisoV);
2134
+
2135
+ materialtouched = true;
2136
+ applySelf();
2137
+ }
2138
+ });
2139
+ presetpanel.add(aniso2);
2140
+
2141
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2142
+ aniso3.setToolTipText("AnisoUV");
2143
+ aniso3.addMouseListener(new MouseAdapter()
2144
+ {
2145
+ public void mouseClicked(MouseEvent e)
2146
+ {
2147
+ Object3D object = Grafreed.materials.versionlist[10].get(0);
2148
+ cMaterial material = object.material;
2149
+
2150
+ anisoField.setFloat(material.aniso);
2151
+ anisoVField.setFloat(material.anisoV);
2152
+
2153
+ materialtouched = true;
2154
+ applySelf();
2155
+ }
2156
+ });
2157
+ presetpanel.add(aniso3);
2158
+
2159
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2160
+ velvet0.setToolTipText("Velvet");
2161
+ velvet0.addMouseListener(new MouseAdapter()
2162
+ {
2163
+ public void mouseClicked(MouseEvent e)
2164
+ {
2165
+ Object3D object = Grafreed.materials.versionlist[15].get(0);
2166
+ cMaterial material = object.material;
2167
+
2168
+ diffusenessField.setFloat(material.factor);
2169
+ selfshadowField.setFloat(material.diffuseness);
2170
+ sheenField.setFloat(material.sheen);
2171
+ shininessField.setFloat(material.shininess);
2172
+ velvetField.setFloat(material.velvet);
2173
+ shiftField.setFloat(material.shift);
2174
+
2175
+ materialtouched = true;
2176
+ applySelf();
2177
+ }
2178
+ });
2179
+ presetpanel.add(velvet0);
2180
+
2181
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2182
+ bump0.setToolTipText("Bump texture");
2183
+ bump0.addMouseListener(new MouseAdapter()
2184
+ {
2185
+ public void mouseClicked(MouseEvent e)
2186
+ {
2187
+ Object3D object = Grafreed.materials.versionlist[16].get(0);
2188
+ cMaterial material = object.material;
2189
+
2190
+ bumpField.setFloat(object.projectedVertices[0].x / 1000.0);
2191
+ noiseField.setFloat(object.projectedVertices[0].y / 1000.0);
2192
+ powerField.setFloat(object.projectedVertices[2].x / 1000.0);
2193
+
2194
+ materialtouched = true;
2195
+ applySelf();
2196
+ }
2197
+ });
2198
+ presetpanel.add(bump0);
2199
+
2200
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF);
2201
+ borderShader.setToolTipText("Border fade");
2202
+ borderShader.addMouseListener(new MouseAdapter()
2203
+ {
2204
+ public void mouseClicked(MouseEvent e)
2205
+ {
2206
+ borderfadeField.setFloat(0.5);
2207
+ opacityField.setFloat(0.75);
2208
+
2209
+ materialtouched = true;
2210
+ applySelf();
2211
+ }
2212
+ });
2213
+ presetpanel.add(borderShader);
2214
+
2215
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2216
+ halo.setToolTipText("Halo");
2217
+ halo.addMouseListener(new MouseAdapter()
2218
+ {
2219
+ public void mouseClicked(MouseEvent e)
2220
+ {
2221
+ Object3D object = Grafreed.materials.versionlist[17].get(0);
2222
+ cMaterial material = object.material;
2223
+
2224
+ opacityPowerField.setFloat(object.projectedVertices[2].y / 1000.0);
2225
+
2226
+ materialtouched = true;
2227
+ applySelf();
2228
+ }
2229
+ });
2230
+ presetpanel.add(halo);
2231
+
2232
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2233
+ candle.setToolTipText("Candle");
2234
+ candle.addMouseListener(new MouseAdapter()
2235
+ {
2236
+ public void mouseClicked(MouseEvent e)
2237
+ {
2238
+ Object3D object = Grafreed.materials.versionlist[18].get(0);
2239
+ cMaterial material = object.material;
2240
+
2241
+ subsurfaceField.setFloat(material.subsurface);
2242
+ shadowbiasField.setFloat(material.shadowbias);
2243
+ ambientField.setFloat(material.ambient);
2244
+ specularField.setFloat(material.specular);
2245
+ lightareaField.setFloat(material.lightarea);
2246
+ shininessField.setFloat(material.shininess);
2247
+
2248
+ materialtouched = true;
2249
+ applySelf();
2250
+ }
2251
+ });
2252
+ presetpanel.add(candle);
2253
+
2254
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2255
+ shadowShader.setToolTipText("Shadow");
2256
+ shadowShader.addMouseListener(new MouseAdapter()
2257
+ {
2258
+ public void mouseClicked(MouseEvent e)
2259
+ {
2260
+ diffuseField.setFloat(0.001);
2261
+ ambientField.setFloat(0.001);
2262
+ cameraField.setFloat(0.001);
2263
+ specularField.setFloat(0.001);
2264
+ fakedepthField.setFloat(0.001);
2265
+ opacityField.setFloat(0.6);
2266
+
2267
+ materialtouched = true;
2268
+ applySelf();
2269
+ }
2270
+ });
2271
+ presetpanel.add(shadowShader);
2272
+
2273
+ cGridBag panel = new cGridBag().setVertical(true);
2274
+
2275
+ presetpanel.preferredWidth = 1;
2276
+
2277
+ materialpanel.add(presetpanel);
2278
+ materialpanel.add(panel);
2279
+
2280
+ panel.preferredWidth = 8;
2281
+
2282
+ /*
13712283 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13722284 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1373
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1374
- aConstraints.gridx += 1;
1375
- */
2285
+ */
13762286
1377
- aConstraints.gridwidth = 1;
1378
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1379
- aConstraints.gridx += 1;
1380
- aConstraints.weighty = 0;
1381
- aConstraints.gridwidth = 1;
2287
+ cGridBag editBar = new cGridBag().setVertical(false);
2288
+
2289
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2290
+ createMaterialButton.setToolTipText("Create material");
13822291
13832292 /*
13842293 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
13882294 */
13892295
1390
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1391
- aConstraints.gridx += 1;
2296
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2297
+ clearMaterialButton.setToolTipText("Clear material");
2298
+
2299
+ if (Globals.ADVANCED)
2300
+ {
2301
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2302
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
2303
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
2304
+ }
13922305
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;
2306
+ editBar.preferredHeight = 15;
2307
+
2308
+ panel.add(editBar);
2309
+
14072310 /**/
14082311 //aConstraints.weighty = 0;
14092312 ////aConstraints.weightx = 1;
14102313 //aConstraints.weighty = 1;
14112314 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14122315 //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;
2316
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14182317
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;
2318
+ cGridBag colorSection = new cGridBag().setVertical(true);
14292319
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;
2320
+ cGridBag huepanel = new cGridBag();
2321
+ cGridBag huelabel = new cGridBag();
2322
+ cLabel hue = GetLabel("icons/hue.png", false);
2323
+ hue.fit = true;
2324
+
2325
+ hue.addMouseListener(new MouseAdapter()
2326
+ {
2327
+ public void mousePressed(MouseEvent e)
2328
+ {
2329
+ int x = e.getX();
2330
+
2331
+ colorField.setFloat((double)x / ((cLabel)e.getSource()).getWidth());
2332
+ }
2333
+ });
2334
+
2335
+ huelabel.add(hue);
2336
+ huelabel.preferredWidth = 20;
2337
+ huepanel.add(new cGridBag()); // Label
2338
+ huepanel.add(huelabel); // Field/slider
2339
+
2340
+ huepanel.preferredHeight = 7;
14392341
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;
2342
+ colorSection.add(huepanel);
2343
+
2344
+ cGridBag color = new cGridBag();
2345
+
2346
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
2347
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2348
+ color.add(colorField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
14492349
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;
2350
+ //colorField.preferredWidth = 200;
2351
+ colorSection.add(color);
14592352
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;
2353
+ cGridBag modulation = new cGridBag();
2354
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
2355
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2356
+ modulation.add(saturationField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2357
+ colorSection.add(modulation);
14692358
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;
2359
+ cGridBag opacity = new cGridBag();
2360
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
2361
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2362
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1)); // , aConstraints);
2363
+ colorSection.add(opacity);
14792364
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;
2365
+ colorSection.add(GetSeparator());
2366
+
2367
+ cGridBag texture = new cGridBag();
2368
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
2369
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2370
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2371
+ colorSection.add(texture);
14882372
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;
2373
+ panel.add(GetSeparator());
2374
+
2375
+ panel.add(colorSection);
2376
+
2377
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
2378
+
2379
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
2380
+
2381
+ cGridBag diffuse = new cGridBag();
2382
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
2383
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2384
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2385
+ diffuseSection.add(diffuse);
14982386
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;
2387
+ cGridBag diffuseness = new cGridBag();
2388
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
2389
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2390
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2391
+ diffuseSection.add(diffuseness);
15082392
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;
2393
+ cGridBag selfshadow = new cGridBag();
2394
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
2395
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2396
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2397
+ diffuseSection.add(selfshadow);
15182398
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;
2399
+ cGridBag sheen = new cGridBag();
2400
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
2401
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2402
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2403
+ diffuseSection.add(sheen);
15282404
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;
2405
+ cGridBag subsurface = new cGridBag();
2406
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
2407
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2408
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2409
+ diffuseSection.add(subsurface);
15382410
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;
2411
+ cGridBag shadow = new cGridBag();
2412
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
2413
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2414
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2415
+ diffuseSection.add(shadow);
15482416
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;
2417
+ cGridBag fakedepth = new cGridBag();
2418
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
2419
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2420
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2421
+ diffuseSection.add(fakedepth);
15582422
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;
2423
+ cGridBag shadowbias = new cGridBag();
2424
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
2425
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2426
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2427
+ diffuseSection.add(shadowbias);
15672428
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;
2429
+ panel.add(GetSeparator());
2430
+
2431
+ panel.add(diffuseSection);
2432
+
2433
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
2434
+
2435
+ cGridBag specularSection = new cGridBag().setVertical(true);
15772436
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;
2437
+ cGridBag specular = new cGridBag();
2438
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
2439
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2440
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2441
+ specularSection.add(specular);
15872442
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;
2443
+ cGridBag lightarea = new cGridBag();
2444
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
2445
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2446
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2447
+ specularSection.add(lightarea);
15972448
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;
2449
+ cGridBag shininess = new cGridBag();
2450
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
2451
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2452
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2453
+ specularSection.add(shininess);
16072454
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;
2455
+ cGridBag metalness = new cGridBag();
2456
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
2457
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2458
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2459
+ specularSection.add(metalness);
16172460
1618
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1619
- Return();
2461
+ cGridBag velvet = new cGridBag();
2462
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
2463
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2464
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2465
+ specularSection.add(velvet);
2466
+
2467
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
2468
+ //Return();
16202469 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16212470 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16222471 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1627,130 +2476,99 @@
16272476 // aConstraints.gridy += 1;
16282477 // aConstraints.gridwidth = 1;
16292478
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;
2479
+ cGridBag anisoU = new cGridBag();
2480
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
2481
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2482
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2483
+ specularSection.add(anisoU);
16382484
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;
2485
+ cGridBag anisoV = new cGridBag();
2486
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
2487
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2488
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
2489
+ specularSection.add(anisoV);
16482490
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;
16582491
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;
2492
+ panel.add(GetSeparator());
2493
+
2494
+ panel.add(specularSection);
2495
+
2496
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
2497
+
2498
+ //cGridBag globalSection = new cGridBag().setVertical(true);
16682499
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;
2500
+ cGridBag camera = new cGridBag();
2501
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
2502
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2503
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2504
+ colorSection.add(camera);
16792505
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;
2506
+ cGridBag ambient = new cGridBag();
2507
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
2508
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2509
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2510
+ colorSection.add(ambient);
16892511
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;
2512
+ cGridBag backlit = new cGridBag();
2513
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
2514
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2515
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
2516
+ colorSection.add(backlit);
16992517
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;
2518
+ //panel.add(new JSeparator());
2519
+
2520
+ //panel.add(globalSection);
2521
+
2522
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
2523
+
2524
+ cGridBag textureSection = new cGridBag().setVertical(true);
17092525
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;
2526
+ cGridBag bump = new cGridBag();
2527
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
2528
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2529
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
2530
+ textureSection.add(bump);
17192531
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;
2532
+ cGridBag noise = new cGridBag();
2533
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
2534
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2535
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
2536
+ textureSection.add(noise);
17292537
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;
2538
+ cGridBag power = new cGridBag();
2539
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
2540
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2541
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
2542
+ textureSection.add(power);
17392543
1740
- //aConstraints.weighty = 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1742
- //aConstraints.gridx += 1;
1743
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1744
- aConstraints.weighty = 0;
2544
+ cGridBag borderfade = new cGridBag();
2545
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
2546
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2547
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
2548
+ textureSection.add(borderfade);
17452549
1746
- aConstraints.gridx = 0;
1747
- aConstraints.gridy = 0;
1748
- aConstraints.gridwidth = 1;
2550
+ cGridBag fog = new cGridBag();
2551
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
2552
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2553
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
2554
+ textureSection.add(fog);
2555
+
2556
+ cGridBag opacityPower = new cGridBag();
2557
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
2558
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
2559
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
2560
+ textureSection.add(opacityPower);
2561
+
2562
+ panel.add(GetSeparator());
2563
+
2564
+ panel.add(textureSection);
2565
+
2566
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17492567
17502568 SetMaterial(copy); // .GetMaterial());
17512569
1752
- colorField.addChangeListener(this);
1753
- modulationField.addChangeListener(this);
2570
+ //colorField.addChangeListener(this);
2571
+// modulationField.addChangeListener(this);
17542572 metalnessField.addChangeListener(this);
17552573 diffuseField.addChangeListener(this);
17562574 specularField.addChangeListener(this);
....@@ -1780,12 +2598,15 @@
17802598 opacityPowerField.addChangeListener(this);
17812599 /**/
17822600
1783
- resetSlidersButton.addActionListener(this);
17842601 clearMaterialButton.addActionListener(this);
17852602 createMaterialButton.addActionListener(this);
1786
-
1787
- propagateToggle.addItemListener(this);
1788
- multiplyToggle.addItemListener(this);
2603
+
2604
+ if (Globals.ADVANCED)
2605
+ {
2606
+ resetSlidersButton.addActionListener(this);
2607
+ propagateToggle.addItemListener(this);
2608
+ multiplyToggle.addItemListener(this);
2609
+ }
17892610 }
17902611
17912612 void DropFile(java.io.File[] files, boolean textures)
....@@ -1803,8 +2624,9 @@
18032624 // 3D models
18042625 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
18052626 {
1806
- lastConverter = new com.jmex.model.converters.MaxToJme();
1807
- LoadFile(filename, lastConverter);
2627
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2628
+ //LoadFile(filename, lastConverter);
2629
+ LoadObjFile(filename); // New 3ds loader
18082630 continue;
18092631 }
18102632 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1956,7 +2778,7 @@
19562778
19572779 //? flashIt = false;
19582780 CameraPane pane = (CameraPane) cameraView;
1959
- pane.clickStart(location.x, location.y, 0);
2781
+ pane.clickStart(location.x, location.y, 0, 0);
19602782 pane.clickEnd(location.x, location.y, 0, true);
19612783
19622784 if (group.selection.size() == 1)
....@@ -2005,6 +2827,7 @@
20052827 e2.printStackTrace();
20062828 }
20072829 }
2830
+
20082831 LoadJMEThread loadThread;
20092832
20102833 class LoadJMEThread extends Thread
....@@ -2062,6 +2885,7 @@
20622885 //LoadFile0(filename, converter);
20632886 }
20642887 }
2888
+
20652889 LoadOBJThread loadObjThread;
20662890
20672891 class LoadOBJThread extends Thread
....@@ -2140,19 +2964,19 @@
21402964
21412965 void LoadObjFile(String fullname)
21422966 {
2143
- /*
2967
+ System.out.println("Loading " + fullname);
2968
+ /**/
21442969 //lastFilename = fullname;
21452970 if(loadObjThread == null)
21462971 {
2147
- loadObjThread = new LoadOBJThread();
2148
- loadObjThread.start();
2972
+ loadObjThread = new LoadOBJThread();
2973
+ loadObjThread.start();
21492974 }
21502975
21512976 loadObjThread.add(fullname);
2152
- */
2977
+ /**/
21532978
2154
- System.out.println("Loading " + fullname);
2155
- makeSomething(new FileObject(fullname, true), true);
2979
+ //makeSomething(new FileObject(fullname, true), true);
21562980 }
21572981
21582982 void LoadGFDFile(String fullname)
....@@ -2413,11 +3237,11 @@
24133237
24143238 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24153239 {
2416
- if (GrafreeD.standAlone)
3240
+ if (Grafreed.standAlone)
24173241 {
24183242 /**/
24193243 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2420
- browser.show();
3244
+ browser.setVisible(true);
24213245 String filename = browser.getFile();
24223246 if (filename != null && filename.length() > 0)
24233247 {
....@@ -2528,6 +3352,7 @@
25283352 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
25293353 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
25303354 }
3355
+
25313356 //cJME.count++;
25323357 //cJME.count %= 12;
25333358 if (gc)
....@@ -2562,6 +3387,7 @@
25623387 }
25633388 if (input == null)
25643389 {
3390
+ new Exception().printStackTrace();
25653391 System.exit(0);
25663392 }
25673393
....@@ -2710,6 +3536,7 @@
27103536 }
27113537 }
27123538 }
3539
+
27133540 cFileSystemPane FSPane;
27143541
27153542 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2719,7 +3546,7 @@
27193546
27203547 freezematerial = true;
27213548 colorField.setFloat(mat.color);
2722
- modulationField.setFloat(mat.modulation);
3549
+ saturationField.setFloat(mat.modulation);
27233550 metalnessField.setFloat(mat.metalness);
27243551 diffuseField.setFloat(mat.diffuse);
27253552 specularField.setFloat(mat.specular);
....@@ -2763,11 +3590,14 @@
27633590 }
27643591 }
27653592 }
3593
+
27663594 freezematerial = false;
27673595 }
27683596
27693597 void SetMaterial(Object3D object)
27703598 {
3599
+ latestObject = object;
3600
+
27713601 cMaterial mat = object.material;
27723602
27733603 if (mat == null)
....@@ -2776,33 +3606,10 @@
27763606 return;
27773607 }
27783608
2779
- multiplyToggle.setSelected(mat.multiply);
2780
-
2781
- assert (object.projectedVertices != null);
2782
-
2783
- if (object.projectedVertices.length <= 2)
2784
- {
2785
- // Side effect...
2786
- Object3D.cVector2[] keep = object.projectedVertices;
2787
- object.projectedVertices = new Object3D.cVector2[3];
2788
- for (int i = 0; i < 3; i++)
2789
- {
2790
- if (i < keep.length)
2791
- {
2792
- object.projectedVertices[i] = keep[i];
2793
- } else
2794
- {
2795
- object.projectedVertices[i] = new Object3D.cVector2();
2796
- }
2797
- /*
2798
- if(keep.length == 0)
2799
- object.projectedVertices[0] = new Object3D.cVector2();
2800
- else
2801
- object.projectedVertices[0] = keep[0];
2802
- object.projectedVertices[1] = new Object3D.cVector2();
2803
- */
2804
- }
2805
- }
3609
+ if (multiplyToggle != null)
3610
+ multiplyToggle.setSelected(mat.multiply);
3611
+
3612
+ AllocProjectedVertices(object);
28063613
28073614 SetMaterial(mat, object.projectedVertices);
28083615 }
....@@ -2878,12 +3685,17 @@
28783685 // }
28793686
28803687 /**/
2881
- if (deselect)
3688
+ if (deselect || child == null)
28823689 {
28833690 //group.deselectAll();
28843691 //freeze = true;
28853692 GetTree().clearSelection();
28863693 //freeze = false;
3694
+
3695
+ if (child == null)
3696
+ {
3697
+ return;
3698
+ }
28873699 }
28883700
28893701 //group.addSelectee(child);
....@@ -2917,6 +3729,17 @@
29173729 public void itemStateChanged(ItemEvent event)
29183730 {
29193731 // System.out.println("Propagate = " + propagate);
3732
+ if (event.getSource() == pinButton)
3733
+ {
3734
+ copy.pinned ^= true;
3735
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
3736
+ {
3737
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
3738
+ copy.CloseUI();
3739
+ //copy.editWindow.refreshContents();
3740
+ }
3741
+ }
3742
+ else
29203743 if (event.getSource() == propagateToggle)
29213744 {
29223745 propagate ^= true;
....@@ -2952,31 +3775,48 @@
29523775 cameraView.ToggleDL();
29533776 cameraView.repaint();
29543777 return;
2955
- } else if (event.getSource() == toggleTextureItem)
3778
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29563779 {
29573780 cameraView.ToggleTexture();
29583781 // june 2013 copy.HardTouch();
29593782 cameraView.repaint();
29603783 return;
2961
- } else if (event.getSource() == toggleFullItem)
3784
+ } else if (event.getSource() == toggleTimelineItem)
29623785 {
2963
- if (CameraPane.FULLSCREEN)
3786
+ timeline ^= true;
3787
+
3788
+ if (timeline)
29643789 {
2965
- frame.getContentPane().remove(/*"Center",*/bigThree);
2966
- framePanel.add(bigThree);
2967
- frame.getContentPane().add(/*"Center",*/framePanel);
2968
- } else
2969
- {
2970
- frame.getContentPane().remove(/*"Center",*/framePanel);
2971
- frame.getContentPane().add(/*"Center",*/bigThree);
3790
+ centralPanel.remove(cameraView);
3791
+ cameraPanel.add(cameraView);
3792
+ centralPanel.add(cameraPanel);
3793
+ frame.setJMenuBar(timelineMenubar);
3794
+ wasFullScreen = CameraPane.FULLSCREEN;
3795
+ if (!CameraPane.FULLSCREEN)
3796
+ ToggleFullScreen();
3797
+ toggleFullScreenItem.setEnabled(false);
29723798 }
3799
+ else
3800
+ {
3801
+ centralPanel.remove(cameraPanel);
3802
+ centralPanel.add(cameraView);
3803
+ frame.setJMenuBar(null);
3804
+ if (!wasFullScreen)
3805
+ ToggleFullScreen();
3806
+ toggleFullScreenItem.setEnabled(true);
3807
+ }
3808
+
29733809 frame.validate();
2974
- cameraView.ToggleFullScreen();
3810
+ return;
3811
+ } else if (event.getSource() == toggleFullScreenItem)
3812
+ {
3813
+ ToggleFullScreen();
3814
+ frame.validate();
29753815
29763816 return;
2977
- } else if (event.getSource() == toggleRandomItem)
3817
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29783818 {
2979
- cameraView.ToggleRandom();
3819
+ cameraView.ToggleSwitch();
29803820 cameraView.repaint();
29813821 return;
29823822 } else if (event.getSource() == toggleHandleItem)
....@@ -3004,12 +3844,17 @@
30043844 } else if (event.getSource() == liveCB)
30053845 {
30063846 copy.live ^= true;
3847
+ objEditor.refreshContents(true); // To show item colors
3848
+ return;
3849
+ } else if (event.getSource() == selectableCB)
3850
+ {
3851
+ copy.dontselect ^= true;
30073852 return;
30083853 } else if (event.getSource() == hideCB)
30093854 {
30103855 copy.hide ^= true;
30113856 copy.Touch(); // display list issue
3012
- objEditor.refreshContents();
3857
+ objEditor.refreshContents(true); // To show item colors
30133858 return;
30143859 } else if (event.getSource() == link2masterCB)
30153860 {
....@@ -3019,6 +3864,7 @@
30193864 if (event.getSource() == randomCB)
30203865 {
30213866 copy.random ^= true;
3867
+ objEditor.refreshContents();
30223868 return;
30233869 }
30243870 if (event.getSource() == speedupCB)
....@@ -3042,8 +3888,9 @@
30423888
30433889 public void actionPerformed(ActionEvent event)
30443890 {
3891
+ Object source = event.getSource();
30453892 // SCRIPT DIALOG
3046
- if (event.getSource() == okbutton)
3893
+ if (source == okbutton)
30473894 {
30483895 textpanel.setVisible(false);
30493896 textpanel.remove(textarea);
....@@ -3055,7 +3902,7 @@
30553902 textarea = null;
30563903 textpanel = null;
30573904 }
3058
- if (event.getSource() == cancelbutton)
3905
+ if (source == cancelbutton)
30593906 {
30603907 textpanel.setVisible(false);
30613908 textpanel.remove(textarea);
....@@ -3067,49 +3914,50 @@
30673914 //applySelf();
30683915 //client.refreshEditWindow();
30693916 //refreshContents();
3070
- if (event.getSource() == nameField)
3917
+ if (source == nameField)
30713918 {
30723919 //System.out.println("ObjEditor " + event);
30733920 applySelf0(true);
30743921 //parent.applySelf();
3075
- objEditor.refreshContents();
3076
- } else if (event.getSource() == resetButton)
3922
+ // conflicts with requestFocus objEditor.refreshContents();
3923
+ } else if (source == resetButton)
30773924 {
30783925 CameraPane.fullreset = true;
30793926 copy.Reset(); // ResetMeshes();
30803927 copy.Touch();
30813928 objEditor.refreshContents();
3082
- } else if (event.getSource() == stepItem)
3929
+ } else if (source == stepItem)
30833930 {
3084
- cameraView.ONESTEP = true;
3931
+ //cameraView.ONESTEP = true;
3932
+ Globals.ONESTEP = true;
30853933 cameraView.repaint();
30863934 return;
3087
- } else if (event.getSource() == stepButton)
3935
+ } else if (source == stepButton)
30883936 {
30893937 copy.Step();
30903938 copy.Touch();
30913939 objEditor.refreshContents();
3092
- } else if (event.getSource() == slowerButton)
3940
+ } else if (source == slowerButton)
30933941 {
30943942 copy.Slower();
30953943 copy.Touch();
30963944 objEditor.refreshContents();
3097
- } else if (event.getSource() == fasterButton)
3945
+ } else if (source == fasterButton)
30983946 {
30993947 copy.Faster();
31003948 copy.Touch();
31013949 objEditor.refreshContents();
3102
- } else if (event.getSource() == remarkButton)
3950
+ } else if (source == remarkButton)
31033951 {
31043952 copy.Remark();
31053953 copy.Touch();
31063954 objEditor.refreshContents();
3107
- } else if (event.getSource() == stepAllButton)
3955
+ } else if (source == stepAllButton)
31083956 {
31093957 copy.StepAll();
31103958 copy.Touch();
31113959 objEditor.refreshContents();
3112
- } else if (event.getSource() == resetAllButton)
3960
+ } else if (source == resetAllButton)
31133961 {
31143962 //CameraPane.fullreset = true;
31153963 copy.ResetAll(); // ResetMeshes();
....@@ -3142,53 +3990,79 @@
31423990 // Close();
31433991 // }
31443992 // else
3145
- if (event.getSource() == resetSlidersButton)
3993
+ if (source == resetSlidersButton)
31463994 {
31473995 ResetSliders();
3148
- } else if (event.getSource() == clearMaterialButton)
3996
+ } else if (source == clearMaterialButton)
31493997 {
31503998 ClearMaterial();
3151
- } else if (event.getSource() == createMaterialButton)
3999
+ } else if (source == createMaterialButton)
31524000 {
31534001 CreateMaterial();
3154
- } else if (event.getSource() == clearPanelButton)
4002
+ } else if (source == clearPanelButton)
31554003 {
31564004 copy.ClearUI();
31574005 refreshContents(true);
3158
- } /*
3159
- }
3160
-
3161
- public boolean action(Event event, Object arg)
3162
- {
3163
- */ else if (event.getSource() == closeItem)
4006
+ } else if (source == importGFDItem)
4007
+ {
4008
+ ImportGFD();
4009
+ } else
4010
+ if (source == importVRMLX3DItem)
4011
+ {
4012
+ ImportVRMLX3D();
4013
+ } else
4014
+ if (source == import3DSItem)
4015
+ {
4016
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
4017
+ } else
4018
+ if (source == importOBJItem)
4019
+ {
4020
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
4021
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
4022
+ browser.setVisible(true);
4023
+ String filename = browser.getFile();
4024
+ if (filename != null && filename.length() > 0)
4025
+ {
4026
+ String fullname = browser.getDirectory() + filename;
4027
+ makeSomething(ReadOBJ(fullname), true);
4028
+ }
4029
+ } else
4030
+ if (source == closeItem)
31644031 {
31654032 Close();
31664033 //return true;
3167
- } else if (event.getSource() == loadItem)
4034
+ } else if (source == openItem)
31684035 {
3169
- load();
4036
+ Open();
31704037 //return true;
3171
- } else if (event.getSource() == saveItem)
4038
+ } else if (source == newItem)
4039
+ {
4040
+ New();
4041
+ } else if (source == saveItem)
31724042 {
31734043 save();
31744044 //return true;
3175
- } else if (event.getSource() == saveAsItem)
4045
+ } else if (source == saveAsItem)
31764046 {
31774047 saveAs();
31784048 //return true;
3179
- } else if (event.getSource() == reexportItem)
4049
+ } else if (source == reexportItem)
31804050 {
31814051 reexport();
31824052 //return true;
3183
- } else if (event.getSource() == exportAsItem)
4053
+ } else if (source == exportAsItem)
31844054 {
31854055 export();
31864056 //return true;
3187
- } else if (event.getSource() == povItem)
4057
+ } else if (source == povItem)
31884058 {
31894059 generatePOV();
31904060 //return true;
3191
- } else if (event.getSource() == zBufferItem)
4061
+ } else if (event.getSource() == archiveItem)
4062
+ {
4063
+ cTools.Archive(frame);
4064
+ return;
4065
+ } else if (source == zBufferItem)
31924066 {
31934067 try
31944068 {
....@@ -3210,21 +4084,8 @@
32104084 cameraView.repaint();
32114085 //return true;
32124086 }
3213
- */ else if (event.getSource() == editCameraItem)
3214
- {
3215
- cameraView.ProtectCamera();
3216
- cameraView.repaint();
3217
- return;
3218
- } else if (event.getSource() == revertCameraItem)
3219
- {
3220
- cameraView.RevertCamera();
3221
- cameraView.repaint();
3222
- return;
3223
- } else if (event.getSource() == textureButton)
3224
- {
3225
- return; // true;
3226
- } else // combos...
3227
- if (event.getSource() == texresMenu)
4087
+ */ else // combos...
4088
+ if (source == texresMenu)
32284089 {
32294090 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32304091 copy.texres = texresMenu.getSelectedIndex();
....@@ -3236,27 +4097,494 @@
32364097 }
32374098 }
32384099
3239
- void ToggleAnimation()
4100
+ void New()
32404101 {
3241
- if (!CameraPane.ANIMATION)
4102
+ while (copy.Size() > 1)
32424103 {
3243
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
4104
+ copy.remove(1);
4105
+ }
4106
+
4107
+ ResetModel();
4108
+ objEditor.refreshContents();
4109
+ }
4110
+
4111
+ static public byte[] Compress(Object3D o)
4112
+ {
4113
+ // Slower to actually compress.
4114
+ try
4115
+ {
4116
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4117
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
4118
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
4119
+
4120
+ Object3D parent = o.parent;
4121
+ o.parent = null;
4122
+
4123
+ out.writeObject(o);
4124
+
4125
+ o.parent = parent;
4126
+
4127
+ out.flush();
4128
+
4129
+ baos //zstream
4130
+ .close();
4131
+ out.close();
4132
+
4133
+ byte[] bytes = baos.toByteArray();
4134
+
4135
+ System.out.println("save #bytes = " + bytes.length);
4136
+ return bytes;
4137
+ } catch (Exception e)
4138
+ {
4139
+ System.err.println(e);
4140
+ return null;
4141
+ }
4142
+ }
4143
+
4144
+ static public Object Uncompress(byte[] bytes)
4145
+ {
4146
+ System.out.println("restore #bytes = " + bytes.length);
4147
+ try
4148
+ {
4149
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4150
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
4151
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
4152
+ Object obj = in.readObject();
4153
+
4154
+ bais //istream
4155
+ .close();
4156
+ in.close();
4157
+
4158
+ return obj;
4159
+ } catch (Exception e)
4160
+ {
4161
+ System.err.println(e);
4162
+ return null;
4163
+ }
4164
+ }
4165
+
4166
+ static public Object clone(Object o)
4167
+ {
4168
+ try
4169
+ {
4170
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
4171
+ ObjectOutputStream out = new ObjectOutputStream(baos);
4172
+
4173
+ out.writeObject(o);
4174
+
4175
+ out.flush();
4176
+ out.close();
4177
+
4178
+ byte[] bytes = baos.toByteArray();
4179
+
4180
+ System.out.println("clone = " + bytes.length);
4181
+
4182
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
4183
+ ObjectInputStream in = new ObjectInputStream(bais);
4184
+ Object obj = in.readObject();
4185
+ in.close();
4186
+
4187
+ return obj;
4188
+ } catch (Exception e)
4189
+ {
4190
+ System.err.println(e);
4191
+ return null;
4192
+ }
4193
+ }
4194
+
4195
+ cRadio GetCurrentTab()
4196
+ {
4197
+ cRadio ab;
4198
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4199
+ {
4200
+ ab = (cRadio)e.nextElement();
4201
+ if(ab.GetObject() == copy)
4202
+ {
4203
+ return ab;
4204
+ }
4205
+ }
4206
+
4207
+ return null;
4208
+ }
4209
+
4210
+
4211
+ public void Save()
4212
+ {
4213
+ //Save(true);
4214
+ Replace();
4215
+ SetVersionStates();
4216
+ }
4217
+
4218
+ private boolean Equal(byte[] compress, byte[] name)
4219
+ {
4220
+ if (compress.length != name.length)
4221
+ {
4222
+ return false;
4223
+ }
4224
+
4225
+ for (int i=compress.length; --i>=0;)
4226
+ {
4227
+ if (compress[i] != name[i])
4228
+ return false;
4229
+ }
4230
+
4231
+ return true;
4232
+ }
4233
+
4234
+ void DeleteVersion()
4235
+ {
4236
+ for (int i = copy.versionindex; i < copy.versionlist.length-1; i++)
4237
+ {
4238
+ copy.versionlist[i] = copy.versionlist[i+1];
4239
+ }
4240
+
4241
+ if (copy.versionlist[copy.versionindex] == null)
4242
+ copy.versionindex -= 1;
4243
+
4244
+ if (copy.versionindex != -1)
4245
+ CopyChanged();
4246
+
4247
+ SetVersionStates();
4248
+ }
4249
+
4250
+ public boolean Save(boolean user)
4251
+ {
4252
+ System.err.println("Save");
4253
+ Replace();
4254
+
4255
+ //cRadio tab = GetCurrentTab();
4256
+
4257
+ Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"?
4258
+
4259
+ boolean thesame = false;
4260
+
4261
+// if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
4262
+// {
4263
+// thesame = true;
4264
+// }
4265
+
4266
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
4267
+ if (!thesame)
4268
+ {
4269
+ for (int i = copy.versionlist.length; --i > copy.versionindex+1;)
4270
+ {
4271
+ copy.versionlist[i] = copy.versionlist[i-1];
4272
+ }
4273
+
4274
+ //tab.user[tab.versionindex] = user;
4275
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
4276
+
4277
+ copy.versionlist[++copy.versionindex] = compress;
4278
+
4279
+ // if (increment)
4280
+ // tab.versionindex++;
4281
+ }
4282
+
4283
+ //copy.RestoreBigData(versiontable);
4284
+
4285
+ //assert(hashtable.isEmpty());
4286
+
4287
+// for (int i = copy.versionindex+1; i < copy.versionlist.length; i++)
4288
+// {
4289
+// //tab.user[i] = false;
4290
+// copy.versionlist[i] = null;
4291
+// }
4292
+
4293
+ SetVersionStates();
4294
+
4295
+ // test save
4296
+ if (false)
4297
+ {
4298
+ try
4299
+ {
4300
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
4301
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
4302
+
4303
+ p.writeObject(copy);
4304
+
4305
+ p.flush();
4306
+
4307
+ ostream.close();
4308
+ } catch (Exception e)
4309
+ {
4310
+ e.printStackTrace();
4311
+ }
4312
+ }
4313
+
4314
+ return !thesame;
4315
+ }
4316
+
4317
+ boolean flashIt = true;
4318
+
4319
+ void RefreshSelection()
4320
+ {
4321
+ Object3D selection = new Object3D();
4322
+
4323
+ for (int i = 0; i < copy.selection.size(); i++)
4324
+ {
4325
+ Object3D elem = copy.selection.elementAt(i);
4326
+
4327
+ Object3D obj = copy.GetObject(elem.GetUUID());
4328
+
4329
+ if (obj == null)
4330
+ {
4331
+ copy.selection.remove(i--);
4332
+ }
4333
+ else
4334
+ {
4335
+ selection.add(obj);
4336
+ copy.selection.setElementAt(obj, i);
4337
+ }
4338
+ }
4339
+
4340
+ flashIt = false;
4341
+ GetTree().clearSelection();
4342
+ for (int i = 0; i < selection.size(); i++)
4343
+ GetTree().addSelectionPath(selection.elementAt(i).GetTreePath().GetTreePath());
4344
+ flashIt = true;
4345
+
4346
+ //refreshContents(false);
4347
+ }
4348
+
4349
+ void CopyChanged()
4350
+ {
4351
+ Object3D obj = (Object3D)Grafreed.clone(copy.versionlist[copy.versionindex]);
4352
+
4353
+ SetVersionStates();
4354
+
4355
+ boolean temp = CameraPane.SWITCH;
4356
+ CameraPane.SWITCH = false;
4357
+
4358
+ copy.ExtractBigData(Grafreed.grafreed.universe.versiontable);
4359
+
4360
+ copy.clear();
4361
+
4362
+ copy.skyboxname = obj.skyboxname;
4363
+ copy.skyboxext = obj.skyboxext;
4364
+
4365
+ for (int i=0; i<obj.Size(); i++)
4366
+ {
4367
+ copy.add(obj.get(i));
4368
+ }
4369
+
4370
+ copy.RestoreBigData(Grafreed.grafreed.universe.versiontable);
4371
+
4372
+ CameraPane.SWITCH = temp;
4373
+
4374
+ RefreshSelection();
4375
+ //assert(hashtable.isEmpty());
4376
+
4377
+ copy.Touch();
4378
+
4379
+ ResetModel();
4380
+ copy.HardTouch(); // recompile?
4381
+
4382
+ cRadio ab;
4383
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
4384
+ {
4385
+ ab = (cRadio)e.nextElement();
4386
+ Object3D test = copy.GetObject(ab.object.GetUUID());
4387
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
4388
+ if (test != null)
4389
+ {
4390
+ test.editWindow = ab.object.editWindow;
4391
+ ab.object = test;
4392
+ }
4393
+ }
4394
+
4395
+ refreshContents(true);
4396
+ }
4397
+
4398
+ cButton previousVersionButton;
4399
+ cButton restoreButton;
4400
+ cButton replaceButton;
4401
+ cButton nextVersionButton;
4402
+ cButton saveVersionButton;
4403
+ cButton deleteVersionButton;
4404
+
4405
+ boolean muteSlider;
4406
+
4407
+ int VersionCount()
4408
+ {
4409
+ int count = 0;
4410
+
4411
+ for (int i = copy.versionlist.length; --i >= 0;)
4412
+ {
4413
+ if (copy.versionlist[i] != null)
4414
+ count++;
4415
+ }
4416
+
4417
+ return count;
4418
+ }
4419
+
4420
+ void SetVersionStates()
4421
+ {
4422
+ //if (true)
4423
+ // return;
4424
+
4425
+ //cRadio tab = GetCurrentTab();
4426
+
4427
+ restoreButton.setEnabled(copy.versionindex != -1);
4428
+ replaceButton.setEnabled(copy.versionindex != -1);
4429
+
4430
+ previousVersionButton.setEnabled(copy.versionindex > 0);
4431
+ nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null);
4432
+
4433
+ deleteVersionButton.setEnabled(copy.versionindex != -1);
4434
+ //copy.versionlist[copy.versionindex + 1] != null);
4435
+
4436
+ muteSlider = true;
4437
+ versionSlider.setMinimum(0);
4438
+ versionSlider.setMaximum(VersionCount() - 1);
4439
+ versionSlider.setInteger(copy.versionindex);
4440
+ versionSlider.setEnabled(copy.versionindex != -1);
4441
+ muteSlider = false;
4442
+ }
4443
+
4444
+ public boolean PreviousVersion()
4445
+ {
4446
+ // Option?
4447
+ Replace();
4448
+
4449
+ System.err.println("Undo");
4450
+
4451
+ //cRadio tab = GetCurrentTab();
4452
+
4453
+ if (copy.versionindex == 0)
4454
+ {
4455
+ java.awt.Toolkit.getDefaultToolkit().beep();
4456
+ return false;
4457
+ }
4458
+
4459
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
4460
+// {
4461
+// if (Save(false))
4462
+// tab.versionindex -= 1;
4463
+// else
4464
+// {
4465
+// if (tab.versionindex <= 0)
4466
+// return false;
4467
+// else
4468
+// tab.versionindex -= 1;
4469
+// }
4470
+// }
4471
+
4472
+ copy.versionindex -= 1;
4473
+
4474
+ CopyChanged();
4475
+
4476
+ return true;
4477
+ }
4478
+
4479
+ public boolean Restore()
4480
+ {
4481
+ System.err.println("Restore");
4482
+
4483
+ //cRadio tab = GetCurrentTab();
4484
+
4485
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4486
+ {
4487
+ java.awt.Toolkit.getDefaultToolkit().beep();
4488
+ return false;
4489
+ }
4490
+
4491
+ //CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
4492
+ CopyChanged();
4493
+
4494
+ return true;
4495
+ }
4496
+
4497
+ public boolean Replace()
4498
+ {
4499
+ //System.err.println("Replace");
4500
+
4501
+ //cRadio tab = GetCurrentTab();
4502
+
4503
+ if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
4504
+ {
4505
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
4506
+ return false;
4507
+ }
4508
+
4509
+ copy.versionlist[copy.versionindex] = Duplicate(copy);
4510
+
4511
+ return true;
4512
+ }
4513
+
4514
+ public void NextVersion()
4515
+ {
4516
+ // Option?
4517
+ Replace();
4518
+
4519
+ //cRadio tab = GetCurrentTab();
4520
+
4521
+ if (copy.versionlist[copy.versionindex + 1] == null)
4522
+ {
4523
+ java.awt.Toolkit.getDefaultToolkit().beep();
4524
+ return;
4525
+ }
4526
+
4527
+ copy.versionindex += 1;
4528
+
4529
+ CopyChanged();
4530
+
4531
+ //if (!tab.user[tab.versionindex])
4532
+ // tab.graphs[tab.versionindex] = null;
4533
+ }
4534
+
4535
+ void ImportGFD()
4536
+ {
4537
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32444538 browser.show();
32454539 String filename = browser.getFile();
32464540 if (filename != null && filename.length() > 0)
32474541 {
3248
- CameraPane.filename = browser.getDirectory() + filename;
4542
+ String fullname = browser.getDirectory() + filename;
4543
+
4544
+ //Object3D readobj =
4545
+ objEditor.ReadGFD(fullname, objEditor);
4546
+ //makeSomething(readobj);
4547
+ }
4548
+ }
4549
+
4550
+ void ImportVRMLX3D()
4551
+ {
4552
+ if (Grafreed.standAlone)
4553
+ {
4554
+ /**/
4555
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4556
+ browser.show();
4557
+ String filename = browser.getFile();
4558
+ if (filename != null && filename.length() > 0)
4559
+ {
4560
+ String fullname = browser.getDirectory() + filename;
4561
+ LoadVRMLX3D(fullname);
4562
+ }
4563
+ /**/
4564
+ }
4565
+ }
4566
+
4567
+ void ToggleAnimation()
4568
+ {
4569
+ if (!Globals.ANIMATION)
4570
+ {
4571
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
4572
+ browser.setVisible(true);
4573
+ String filename = browser.getFile();
4574
+ if (filename != null && filename.length() > 0)
4575
+ {
4576
+ Globals.filename = browser.getDirectory() + filename;
32494577 //CameraPane.framecount = 0;
3250
- CameraPane.imagecount = 0;
4578
+ Globals.imagecount = 0;
32514579
3252
- CameraPane.ANIMATION ^= true;
4580
+ Globals.ANIMATION ^= true;
32534581
3254
- GrafreeD.wav.cursor = 0;
3255
- GrafreeD.wav.loop = 0;
4582
+ Grafreed.wav.cursor = 0;
4583
+ Grafreed.wav.loop = 0;
32564584 }
32574585 } else
32584586 {
3259
- CameraPane.ANIMATION ^= true;
4587
+ Globals.ANIMATION ^= true;
32604588 }
32614589 }
32624590
....@@ -3302,7 +4630,7 @@
33024630 void CreateMaterial()
33034631 {
33044632 //copy.ClearMaterial(); // PATCH
3305
- copy.CreateMaterialS(multiplyToggle.isSelected());
4633
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
33064634 if (copy.selection.size() > 0)
33074635 //SetMaterial(copy);
33084636 {
....@@ -3353,7 +4681,7 @@
33534681 assert false;
33544682 }
33554683
3356
- void EditSelection()
4684
+ void EditSelection(boolean newWindow)
33574685 {
33584686 }
33594687
....@@ -3361,11 +4689,11 @@
33614689 {
33624690 copy.ResetBlockLoop(); // temporary problem
33634691
3364
- boolean random = CameraPane.RANDOM;
3365
- CameraPane.RANDOM = false; // parse everything
4692
+ boolean random = CameraPane.SWITCH;
4693
+ CameraPane.SWITCH = false; // parse everything
33664694 copy.ResetDisplayList();
33674695 copy.HardTouch();
3368
- CameraPane.RANDOM = random;
4696
+ CameraPane.SWITCH = random;
33694697 }
33704698
33714699 // public void applySelf()
....@@ -3412,7 +4740,7 @@
34124740 //copy.material = new cMaterial(copy.GetMaterial());
34134741
34144742 current.color = (float) colorField.getFloat();
3415
- current.modulation = (float) modulationField.getFloat();
4743
+ current.modulation = (float) saturationField.getFloat();
34164744 current.metalness = (float) metalnessField.getFloat();
34174745 current.diffuse = (float) diffuseField.getFloat();
34184746 current.specular = (float) specularField.getFloat();
....@@ -3435,10 +4763,40 @@
34354763 current.fakedepth = (float) fakedepthField.getFloat();
34364764 current.shadowbias = (float) shadowbiasField.getFloat();
34374765
3438
- if (!NumberSlider.frozen)
4766
+ if (!cNumberSlider.frozen)
34394767 {
34404768 //System.out.println("Propagate = " + propagate);
34414769 copy.UpdateMaterial(anchor, current, propagate);
4770
+
4771
+ if (copy.material != null)
4772
+ {
4773
+ cMaterial mat = copy.material;
4774
+
4775
+ colorField.SetToolTipValue((mat.color));
4776
+ saturationField.SetToolTipValue((mat.modulation));
4777
+ metalnessField.SetToolTipValue((mat.metalness));
4778
+ diffuseField.SetToolTipValue((mat.diffuse));
4779
+ specularField.SetToolTipValue((mat.specular));
4780
+ shininessField.SetToolTipValue((mat.shininess));
4781
+ shiftField.SetToolTipValue((mat.shift));
4782
+ ambientField.SetToolTipValue((mat.ambient));
4783
+ lightareaField.SetToolTipValue((mat.lightarea));
4784
+ diffusenessField.SetToolTipValue((mat.factor));
4785
+ velvetField.SetToolTipValue((mat.velvet));
4786
+ sheenField.SetToolTipValue((mat.sheen));
4787
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4788
+ backlitField.SetToolTipValue((mat.bump));
4789
+ anisoField.SetToolTipValue((mat.aniso));
4790
+ anisoVField.SetToolTipValue((mat.anisoV));
4791
+ cameraField.SetToolTipValue((mat.cameralight));
4792
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4793
+ shadowField.SetToolTipValue((mat.shadow));
4794
+ textureField.SetToolTipValue((mat.texture));
4795
+ opacityField.SetToolTipValue((mat.opacity));
4796
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4797
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
4798
+ }
4799
+
34424800 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34434801 {
34444802 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3467,9 +4825,28 @@
34674825 //copy.Touch();
34684826 }
34694827
4828
+ cNumberSlider versionSlider;
4829
+
34704830 public void stateChanged(ChangeEvent e)
34714831 {
34724832 // assert(false);
4833
+ if (e.getSource() == versionSlider)
4834
+ {
4835
+ if (muteSlider)
4836
+ return;
4837
+
4838
+ Replace();
4839
+
4840
+ int version = versionSlider.getInteger();
4841
+
4842
+ if (version != -1 && copy.versionlist[version] != null)
4843
+ {
4844
+ copy.versionindex = version;
4845
+ CopyChanged();
4846
+ }
4847
+
4848
+ return;
4849
+ }
34734850
34744851 if (freezematerial)
34754852 {
....@@ -3483,6 +4860,7 @@
34834860 || e.getSource() == apertureField
34844861 || e.getSource() == shadowblurField)
34854862 {
4863
+ new Exception().printStackTrace();
34864864 System.exit(0);
34874865 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34884866 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3504,12 +4882,24 @@
35044882 {
35054883 //System.out.println("stateChanged = " + this);
35064884 materialtouched = true;
4885
+
4886
+ if (Globals.AUTOSATURATE && e.getSource() == colorField && saturationField.getFloat() == 0.001)
4887
+ {
4888
+ saturationField.setFloat(1);
4889
+ }
4890
+
35074891 applySelf();
35084892 //System.out.println("this = " + this);
35094893 //System.out.println("PARENT = " + parent);
35104894 //if (parent != null)
35114895 // parent.applySelf();
3512
- refreshContents();
4896
+ if (e.getSource() == normalpushField)
4897
+ {
4898
+ objEditor.refreshContents();
4899
+ //Refresh();
4900
+ }
4901
+ else
4902
+ refreshContents();
35134903 // ??? client.refreshEditWindow();
35144904 }
35154905 //else
....@@ -3521,7 +4911,7 @@
35214911 //group.name = nameField.getText();
35224912 //objEditor.applySelf();
35234913
3524
- assert (objEditor == this);
4914
+ // OCT2018: assert (objEditor == this);
35254915 if (copy.selection == null || copy.selection.size() == 0)
35264916 //super.applySelf()
35274917 ; else
....@@ -3545,12 +4935,18 @@
35454935 objEditor.copy = keep;
35464936 }
35474937 }
4938
+
4939
+ if (normalpushField != null)
4940
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35484941 }
35494942
35504943 void SnapObject()
35514944 {
3552
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3553
- SnapObject(obj);
4945
+ if (copy.selection.size() > 0)
4946
+ {
4947
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
4948
+ SnapObject(obj);
4949
+ }
35544950 }
35554951
35564952 void SnapObject(Object3D obj)
....@@ -3791,20 +5187,28 @@
37915187 {
37925188 if (GetTree() != null)
37935189 {
5190
+ GetTree().revalidate();
37945191 GetTree().repaint();
37955192 }
37965193
37975194 radioPanel.revalidate();
37985195 radioPanel.repaint();
3799
- ctrlPanel.revalidate(); // ? new
5196
+ ctrlPanel.validate(); // ? new
38005197 ctrlPanel.repaint();
38015198 }
5199
+
5200
+ if (previousVersionButton != null && copy.versionlist != null)
5201
+ SetVersionStates();
5202
+
5203
+ cameraView.requestFocusInWindow();
38025204 }
38035205
38045206 static TweenManager tweenManager = new TweenManager();
38055207
38065208 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
38075209 {
5210
+ if (Globals.REPLACEONMAKE) // && resetmodel)
5211
+ Save();
38085212 //Tween.set(thing, 0).target(1).start(tweenManager);
38095213 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
38105214 // if (thing instanceof GenericJointDemo)
....@@ -3828,7 +5232,7 @@
38285232 // group = (Composite) group.get(0);
38295233 // }
38305234
3831
- System.out.println("makeSomething of " + thing);
5235
+ //System.out.println("makeSomething of " + thing);
38325236
38335237 /*
38345238 if (deselect && jList != null)
....@@ -3891,6 +5295,12 @@
38915295 {
38925296 ResetModel();
38935297 Select(thing.GetTreePath(), true, false); // unselect... false);
5298
+
5299
+ if (thing.Size() == 0)
5300
+ {
5301
+ //EditSelection(false);
5302
+ }
5303
+
38945304 refreshContents();
38955305 }
38965306
....@@ -4008,6 +5418,7 @@
40085418 }
40095419 }
40105420 }
5421
+
40115422 LoadGFDThread loadGFDThread;
40125423
40135424 void ReadGFD(String fullname, iCallBack cb)
....@@ -4027,8 +5438,10 @@
40275438
40285439 try
40295440 {
5441
+ // Try compressed version first.
40305442 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4031
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5443
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
5444
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40325445
40335446 readobj = (Object3D) p.readObject();
40345447 istream.close();
....@@ -4036,7 +5449,22 @@
40365449 readobj.ResetDisplayList();
40375450 } catch (Exception e)
40385451 {
4039
- e.printStackTrace();
5452
+ if (!e.toString().contains("GZIP"))
5453
+ e.printStackTrace();
5454
+
5455
+ try
5456
+ {
5457
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
5458
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
5459
+
5460
+ readobj = (Object3D) p.readObject();
5461
+ istream.close();
5462
+
5463
+ readobj.ResetDisplayList();
5464
+ } catch (Exception e2)
5465
+ {
5466
+ e2.printStackTrace();
5467
+ }
40405468 }
40415469 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40425470 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4082,6 +5510,12 @@
40825510
40835511 void LoadIt(Object obj)
40845512 {
5513
+ if (obj == null)
5514
+ {
5515
+ // Invalid file
5516
+ return;
5517
+ }
5518
+
40855519 System.out.println("Loaded " + obj);
40865520 //new Exception().printStackTrace();
40875521 Object3D readobj = (Object3D) obj;
....@@ -4091,10 +5525,14 @@
40915525
40925526 if (readobj != null)
40935527 {
5528
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
5529
+ // Save();
40945530 try
40955531 {
40965532 //readobj.deepCopySelf(copy);
40975533 copy.clear(); // june 2014
5534
+ copy.skyboxname = readobj.skyboxname;
5535
+ copy.skyboxext = readobj.skyboxext;
40985536 for (int i = 0; i < readobj.size(); i++)
40995537 {
41005538 Object3D child = readobj.get(i); // reserve(i);
....@@ -4135,6 +5573,7 @@
41355573 }
41365574 } catch (ClassCastException e)
41375575 {
5576
+ e.printStackTrace();
41385577 assert (false);
41395578 Composite c = (Composite) copy;
41405579 c.children.clear();
....@@ -4145,17 +5584,32 @@
41455584 c.addChild(csg);
41465585 }
41475586
5587
+ copy.versionlist = readobj.versionlist;
5588
+ copy.versionindex = readobj.versionindex;
5589
+ copy.versiontable = readobj.versiontable;
5590
+
5591
+ if (copy.versionlist == null)
5592
+ {
5593
+ // Backward compatibility
5594
+ copy.versionlist = new Object3D[100];
5595
+ copy.versionindex = -1;
5596
+
5597
+ //Save(true);
5598
+ }
5599
+
5600
+ //? SetUndoStates();
5601
+
41485602 ResetModel();
41495603 copy.HardTouch(); // recompile?
41505604 refreshContents();
41515605 }
41525606 }
41535607
4154
- void load() // throws ClassNotFoundException
5608
+ void Open() // throws ClassNotFoundException
41555609 {
4156
- if (GrafreeD.standAlone)
5610
+ if (Grafreed.standAlone)
41575611 {
4158
- FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
5612
+ FileDialog browser = new FileDialog(frame, "Open", FileDialog.LOAD);
41595613 browser.show();
41605614 String filename = browser.getFile();
41615615 if (filename != null && filename.length() > 0)
....@@ -4232,6 +5686,8 @@
42325686
42335687 void save()
42345688 {
5689
+ Replace();
5690
+
42355691 if (lastname == null)
42365692 {
42375693 return;
....@@ -4240,11 +5696,13 @@
42405696 try
42415697 {
42425698 FileOutputStream ostream = new FileOutputStream(lastname);
4243
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5699
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5700
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42445701
42455702 p.writeObject(copy);
42465703 p.flush();
42475704
5705
+ zstream.close();
42485706 ostream.close();
42495707
42505708 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4252,19 +5710,23 @@
42525710 //ps.print(buffer.toString());
42535711 } catch (IOException e)
42545712 {
5713
+ e.printStackTrace();
42555714 }
42565715 }
5716
+
42575717 String lastname;
42585718
42595719 void saveAs()
42605720 {
4261
- if (GrafreeD.standAlone)
5721
+ if (Grafreed.standAlone)
42625722 {
42635723 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42645724 browser.setVisible(true);
42655725 String filename = browser.getFile();
42665726 if (filename != null && filename.length() > 0)
42675727 {
5728
+ if (!filename.endsWith(".gfd"))
5729
+ filename += ".gfd";
42685730 lastname = browser.getDirectory() + filename;
42695731 save();
42705732 }
....@@ -4363,13 +5825,13 @@
43635825 try
43645826 {
43655827 FileOutputStream ostream = new FileOutputStream(filename);
4366
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4367
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5828
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5829
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43685830
43695831 Object3D objectparent = obj.parent;
43705832 obj.parent = null;
43715833
4372
- Object3D object = (Object3D) GrafreeD.clone(obj);
5834
+ Object3D object = (Object3D) Grafreed.clone(obj);
43735835
43745836 obj.parent = objectparent;
43755837
....@@ -4381,8 +5843,8 @@
43815843 p.writeObject(object);
43825844 p.flush();
43835845
5846
+ zstream.close();
43845847 ostream.close();
4385
- // zstream.close();
43865848
43875849 // group.selection.get(0).parent = parent;
43885850 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4403,7 +5865,7 @@
44035865 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
44045866 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
44055867 copy.generatePOV(buffer);
4406
- if (GrafreeD.standAlone)
5868
+ if (Grafreed.standAlone)
44075869 {
44085870 FileDialog browser = new FileDialog(frame, "Export POV", 1);
44095871 browser.show();
....@@ -4429,53 +5891,71 @@
44295891 Object3D client;
44305892 Object3D copy;
44315893 MenuBar menuBar;
4432
- Menu windowMenu;
4433
- MenuItem loadItem;
5894
+ Menu fileMenu;
5895
+ MenuItem newItem;
5896
+ MenuItem openItem;
44345897 MenuItem saveItem;
44355898 MenuItem saveAsItem;
44365899 MenuItem exportAsItem;
44375900 MenuItem reexportItem;
44385901 MenuItem povItem;
44395902 MenuItem closeItem;
4440
- Menu cameraMenu;
5903
+
44415904 CheckboxMenuItem zBufferItem;
44425905 //MenuItem normalLensItem;
4443
- MenuItem editCameraItem;
4444
- MenuItem revertCameraItem;
4445
- CheckboxMenuItem toggleLiveItem;
44465906 MenuItem stepItem;
4447
- CheckboxMenuItem toggleFullItem;
5907
+ CheckboxMenuItem toggleLiveItem;
5908
+ CheckboxMenuItem toggleFullScreenItem;
5909
+ CheckboxMenuItem toggleTimelineItem;
44485910 CheckboxMenuItem toggleRenderItem;
44495911 CheckboxMenuItem toggleDebugItem;
44505912 CheckboxMenuItem toggleFrustumItem;
44515913 CheckboxMenuItem toggleFootContactItem;
44525914 CheckboxMenuItem toggleDLItem;
44535915 CheckboxMenuItem toggleTextureItem;
4454
- CheckboxMenuItem toggleRandomItem;
5916
+ CheckboxMenuItem toggleSwitchItem;
44555917 CheckboxMenuItem toggleRootItem;
44565918 CheckboxMenuItem animationItem;
5919
+ MenuItem archiveItem;
44575920 CheckboxMenuItem toggleHandleItem;
44585921 CheckboxMenuItem togglePaintItem;
44595922 JSplitPane mainPanel;
44605923 JScrollPane scrollpane;
5924
+
44615925 JPanel toolbarPanel;
4462
- JPanel treePanel;
5926
+
5927
+ cGridBag treePanel;
5928
+
44635929 JPanel radioPanel;
44645930 ButtonGroup buttonGroup;
4465
- JPanel ctrlPanel;
4466
- JPanel materialPanel;
5931
+
5932
+ cGridBag toolboxPanel;
5933
+ cGridBag skyboxPanel;
5934
+ cGridBag materialPanel;
5935
+ cGridBag ctrlPanel;
5936
+
44675937 JScrollPane infoPanel;
4468
- JPanel optionsPanel;
5938
+
5939
+ cGridBag optionsPanel;
5940
+
44695941 JTabbedPane objectPanel;
4470
- JPanel XYZPanel;
5942
+ boolean materialFlushed;
5943
+ Object3D latestObject;
5944
+
5945
+ cGridBag XYZPanel;
5946
+
44715947 JSplitPane gridPanel;
44725948 JSplitPane bigPanel;
4473
- JPanel bigThree;
4474
- JTabbedPane jtp;
4475
- JPanel cameraPanel;
5949
+
5950
+ cGridBag bigThree;
5951
+ cGridBag scenePanel;
5952
+ cGridBag centralPanel;
5953
+ JSplitPane cameraPanel;
5954
+ JPanel timelinePanel;
5955
+ JMenuBar timelineMenubar;
44765956 JSplitPane framePanel;
44775957 JTextArea/*Field*/ nameField;
4478
- cButton textureButton;
5958
+ //cButton textureButton;
44795959 cButton okButton;
44805960 cButton applyButton;
44815961 cButton cancelButton;
....@@ -4522,65 +6002,74 @@
45226002 // MATERIAL
45236003 JLabel materialLabel;
45246004 JLabel colorLabel;
4525
- NumberSlider colorField;
6005
+ cNumberSlider colorField;
45266006 JLabel modulationLabel;
4527
- NumberSlider modulationField;
6007
+ cNumberSlider saturationField;
45286008 JLabel metalnessLabel;
4529
- NumberSlider metalnessField;
6009
+ cNumberSlider metalnessField;
45306010 JLabel diffuseLabel;
4531
- NumberSlider diffuseField;
6011
+ cNumberSlider diffuseField;
45326012 JLabel specularLabel;
4533
- NumberSlider specularField;
6013
+ cNumberSlider specularField;
45346014 JLabel shininessLabel;
4535
- NumberSlider shininessField;
6015
+ cNumberSlider shininessField;
45366016 JLabel shiftLabel;
4537
- NumberSlider shiftField;
6017
+ cNumberSlider shiftField;
45386018 JLabel ambientLabel;
4539
- NumberSlider ambientField;
6019
+ cNumberSlider ambientField;
45406020 JLabel lightareaLabel;
4541
- NumberSlider lightareaField;
6021
+ cNumberSlider lightareaField;
45426022 JLabel diffusenessLabel;
4543
- NumberSlider diffusenessField;
6023
+ cNumberSlider diffusenessField;
45446024 JLabel velvetLabel;
4545
- NumberSlider velvetField;
6025
+ cNumberSlider velvetField;
45466026 JLabel sheenLabel;
4547
- NumberSlider sheenField;
6027
+ cNumberSlider sheenField;
45486028 JLabel subsurfaceLabel;
4549
- NumberSlider subsurfaceField;
6029
+ cNumberSlider subsurfaceField;
45506030 //JLabel bumpLabel;
45516031 //NumberSlider bumpField;
45526032 JLabel backlitLabel;
4553
- NumberSlider backlitField;
6033
+ cNumberSlider backlitField;
45546034 JLabel anisoLabel;
4555
- NumberSlider anisoField;
6035
+ cNumberSlider anisoField;
45566036 JLabel anisoVLabel;
4557
- NumberSlider anisoVField;
6037
+ cNumberSlider anisoVField;
6038
+
45586039 JLabel cameraLabel;
4559
- NumberSlider cameraField;
6040
+ cNumberSlider cameraField;
45606041 JLabel selfshadowLabel;
4561
- NumberSlider selfshadowField;
6042
+ cNumberSlider selfshadowField;
45626043 JLabel shadowLabel;
4563
- NumberSlider shadowField;
6044
+ cNumberSlider shadowField;
45646045 JLabel textureLabel;
4565
- NumberSlider textureField;
6046
+ cNumberSlider textureField;
45666047 JLabel opacityLabel;
4567
- NumberSlider opacityField;
6048
+ cNumberSlider opacityField;
45686049 JLabel fakedepthLabel;
4569
- NumberSlider fakedepthField;
6050
+ cNumberSlider fakedepthField;
45706051 JLabel shadowbiasLabel;
4571
- NumberSlider shadowbiasField;
6052
+ cNumberSlider shadowbiasField;
6053
+
45726054 JLabel bumpLabel;
4573
- NumberSlider bumpField;
6055
+ cNumberSlider bumpField;
45746056 JLabel noiseLabel;
4575
- NumberSlider noiseField;
6057
+ cNumberSlider noiseField;
45766058 JLabel powerLabel;
4577
- NumberSlider powerField;
6059
+ cNumberSlider powerField;
45786060 JLabel borderfadeLabel;
4579
- NumberSlider borderfadeField;
6061
+ cNumberSlider borderfadeField;
45806062 JLabel fogLabel;
4581
- NumberSlider fogField;
6063
+ cNumberSlider fogField;
45826064 JLabel opacityPowerLabel;
4583
- NumberSlider opacityPowerField;
4584
- JTree jTree;
6065
+ cNumberSlider opacityPowerField;
6066
+ cTree jTree;
45856067 //ObjectUI parent;
6068
+
6069
+ cNumberSlider normalpushField;
6070
+
6071
+ private MenuItem importGFDItem;
6072
+ private MenuItem importVRMLX3DItem;
6073
+ private MenuItem import3DSItem;
6074
+ private MenuItem importOBJItem;
45866075 }