Normand Briere
2019-07-27 1af7d3700724834e40ad8636bc9a56cdc3b19b15
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,59 @@
2834 iSendInfo
2935 //KeyListener
3036 {
37
+ boolean timeline;
38
+ boolean wasFullScreen;
3139
40
+ GroupEditor callee;
41
+ JFrame frame;
42
+
43
+ static ObjEditor theFrame;
44
+
45
+ cButton GetButton(String name, boolean border)
46
+ {
47
+ ImageIcon icon = GetIcon(name);
48
+ return new cButton(icon, border);
49
+ }
50
+
51
+ cToggleButton GetToggleButton(String name, boolean border)
52
+ {
53
+ ImageIcon icon = GetIcon(name);
54
+ return new cToggleButton(icon, border);
55
+ }
56
+
57
+ cCheckBox GetCheckBox(String name, boolean border)
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cCheckBox(icon, border);
61
+ }
62
+
63
+ private ImageIcon GetIcon(String name)
64
+ {
65
+ try
66
+ {
67
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
68
+
69
+ if (image.getWidth() != 24 && image.getHeight() != 24)
70
+ {
71
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
72
+ Graphics2D g = resized.createGraphics();
73
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
74
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
75
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
76
+ g.dispose();
77
+
78
+ image = resized;
79
+ }
80
+
81
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
82
+ return icon;
83
+ }
84
+ catch (Exception e)
85
+ {
86
+ return null;
87
+ }
88
+ }
89
+
3290 // SCRIPT
3391
3492 transient JFrame textpanel = null;
....@@ -119,51 +177,62 @@
119177 void keyPressed(int key, int modifiers)
120178 {
121179 System.out.println("KEY PRESSED");
122
- CameraPane.theRenderer.keyPressed(key, modifiers);
180
+ Globals.theRenderer.keyPressed(key, modifiers);
123181 }
124182 */
125183
126184 static GridBagConstraints aConstraints;
127185 static GridBagConstraints aWindowConstraints;
128
- GroupEditor callee;
129
- JFrame frame;
186
+
130187 static int GRIDWIDTH = 100; // 4;
131188
132189 public void closeUI()
133190 {
134191 //new Exception().printStackTrace();
135
- System.out.println("this = " + this);
136
- System.out.println("objEditor = " + objEditor);
192
+// System.out.println("this = " + this);
193
+// System.out.println("objEditor = " + objEditor);
137194 //nameField.removeActionListener(this);
138
- objEditor.ctrlPanel.remove(nameField);
195
+// objEditor.ctrlPanel.remove(nameField);
139196
140
- if (!GroupEditor.allparams)
197
+ objEditor.ctrlPanel.remove(namePanel);
198
+
199
+ if (!allparams)
141200 return;
142201
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);
202
+// objEditor.ctrlPanel.remove(liveCB);
203
+// objEditor.ctrlPanel.remove(hideCB);
204
+// objEditor.ctrlPanel.remove(markCB);
205
+//
206
+// objEditor.ctrlPanel.remove(randomCB);
207
+// objEditor.ctrlPanel.remove(speedupCB);
208
+// objEditor.ctrlPanel.remove(rewindCB);
209
+//
210
+// objEditor.ctrlPanel.remove(resetButton);
211
+// objEditor.ctrlPanel.remove(stepButton);
212
+//// objEditor.ctrlPanel.remove(stepAllButton);
213
+//// objEditor.ctrlPanel.remove(resetAllButton);
214
+// objEditor.ctrlPanel.remove(link2masterCB);
215
+// //objEditor.ctrlPanel.remove(flipVCB);
216
+// //objEditor.ctrlPanel.remove(texresMenu);
217
+// objEditor.ctrlPanel.remove(slowerButton);
218
+// objEditor.ctrlPanel.remove(fasterButton);
219
+// objEditor.ctrlPanel.remove(remarkButton);
220
+
221
+ objEditor.ctrlPanel.remove(setupPanel);
222
+ objEditor.ctrlPanel.remove(setupPanel2);
223
+ objEditor.ctrlPanel.remove(objectCommandsPanel);
224
+ objEditor.ctrlPanel.remove(pushPanel);
225
+ //objEditor.ctrlPanel.remove(fillPanel);
226
+
227
+ //Remove(normalpushField);
161228 }
162229
163230 public ObjEditor GetEditor()
164231 {
165232 return objEditor; //.GetEditor();
166233 }
234
+
235
+ // Sometimes myself, sometimes my callee's.
167236 ObjEditor objEditor;
168237
169238 /*
....@@ -199,6 +268,12 @@
199268 client = inClient;
200269 copy = client;
201270
271
+ if (copy.versions == null)
272
+ {
273
+ copy.versions = new byte[100][];
274
+ copy.versionindex = -1;
275
+ }
276
+
202277 // "this" is not called: SetupUI2(objEditor);
203278 }
204279
....@@ -212,6 +287,12 @@
212287 client = inClient;
213288 copy = client;
214289
290
+ if (copy.versions == null)
291
+ {
292
+ copy.versions = new byte[100][];
293
+ copy.versionindex = -1;
294
+ }
295
+
215296 SetupUI2(callee.GetEditor());
216297 }
217298
....@@ -226,6 +307,7 @@
226307 //localCopy.parent = null;
227308
228309 frame = new JFrame();
310
+ frame.setUndecorated(false);
229311 objEditor = this;
230312 this.callee = callee;
231313
....@@ -238,11 +320,17 @@
238320 //if (!isDisplayable())
239321 //setUndecorated(true);
240322
241
- System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
323
+ //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow());
242324 client = inClient;
243325 copy = localCopy;
244326 copy.editWindow = this;
245327
328
+ if (copy.versions == null)
329
+ {
330
+// copy.versions = new byte[100][];
331
+// copy.versionindex = -1;
332
+ }
333
+
246334 SetupMenu();
247335
248336 //SetupName(objEditor); // new
....@@ -256,28 +344,49 @@
256344 return frame.action(event, obj);
257345 }
258346
347
+ // Cannot work without static
348
+ static boolean allparams = true;
349
+
350
+ static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>();
351
+
259352 void SetupMenu()
260353 {
261354 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..."));
355
+ menuBar.add(fileMenu = new Menu("File"));
356
+ fileMenu.add(newItem = new MenuItem("New"));
357
+ fileMenu.add(openItem = new MenuItem("Open..."));
358
+
359
+ //oe.menuBar.add(menu = new Menu("Include"));
360
+ Menu menu = new Menu("Import");
361
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
362
+ importOBJItem.addActionListener(this);
363
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
364
+ import3DSItem.addActionListener(this);
365
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
366
+ importVRMLX3DItem.addActionListener(this);
367
+ menu.add("-");
368
+ importGFDItem = menu.add(new MenuItem("Grafreed file..."));
369
+ importGFDItem.addActionListener(this);
370
+ fileMenu.add(menu);
371
+ fileMenu.add("-");
372
+
373
+ fileMenu.add(saveItem = new MenuItem("Save"));
374
+ fileMenu.add(saveAsItem = new MenuItem("Save As..."));
267375 //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("-");
376
+ fileMenu.add("-");
377
+ fileMenu.add(exportAsItem = new MenuItem("Export Selection..."));
378
+ fileMenu.add(reexportItem = new MenuItem("Re-export"));
379
+ fileMenu.add("-");
272380 if (client.parent != null)
273381 {
274
- windowMenu.add(closeItem = new MenuItem("Close"));
382
+ fileMenu.add(closeItem = new MenuItem("Close"));
275383 } else
276384 {
277
- windowMenu.add(closeItem = new MenuItem("Exit"));
385
+ fileMenu.add(closeItem = new MenuItem("Exit"));
278386 }
279387
280
- loadItem.addActionListener(this);
388
+ newItem.addActionListener(this);
389
+ openItem.addActionListener(this);
281390 saveItem.addActionListener(this);
282391 saveAsItem.addActionListener(this);
283392 exportAsItem.addActionListener(this);
....@@ -285,80 +394,69 @@
285394 //povItem.addActionListener(this);
286395 closeItem.addActionListener(this);
287396
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
-
341397 objectPanel = new JTabbedPane();
398
+
399
+ ChangeListener changeListener = new ChangeListener()
400
+ {
401
+ public void stateChanged(ChangeEvent changeEvent)
402
+ {
403
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed)
404
+// {
405
+// if (latestObject != null)
406
+// {
407
+// refreshContents(true);
408
+// SetMaterial(latestObject);
409
+// }
410
+//
411
+// materialFlushed = true;
412
+// }
413
+// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit"))
414
+// {
415
+// if (listUI.size() == 0)
416
+// EditSelection(false);
417
+// }
418
+
419
+ refreshContents(false); // To refresh Info tab
420
+ }
421
+ };
422
+ objectPanel.addChangeListener(changeListener);
423
+
342424 toolbarPanel = new JPanel();
343425 toolbarPanel.setName("Toolbar");
344
- treePanel = new JPanel();
426
+
427
+ treePanel = new cGridBag();
345428 treePanel.setName("Tree");
346
- ctrlPanel = new JPanel(); // new GridBagLayout());
347
- ctrlPanel.setName("Edit");
348
- materialPanel = new JPanel();
349
- materialPanel.setName("Material");
429
+
430
+ editPanel = new cGridBag().setVertical(true);
431
+ //editPanel.setName("Edit");
432
+
433
+ ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
434
+
435
+ editCommandsPanel = new cGridBag();
436
+ editPanel.add(editCommandsPanel);
437
+ editPanel.add(ctrlPanel);
438
+
439
+ toolboxPanel = new cGridBag().setVertical(false);
440
+ //toolboxPanel.setName("Toolbox");
441
+
442
+ materialPanel = new cGridBag().setVertical(true);
443
+ //materialPanel.setName("Material");
444
+
350445 /*JTextPane*/
351446 infoarea = createTextPane();
447
+ doc = infoarea.getStyledDocument();
448
+
352449 infoarea.setEditable(true);
353450 SetText();
451
+
354452 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
355453 // infoarea.setOpaque(false);
356454 // //infoarea.setForeground(textcolor);
357
- infoarea.setLineWrap(true);
358
- infoarea.setWrapStyleWord(true);
455
+// TEXTAREA infoarea.setLineWrap(true);
456
+// TEXTAREA infoarea.setWrapStyleWord(true);
359457 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");
458
+ infoPanel.setPreferredSize(new Dimension(1, 1));
459
+ //infoPanel.setName("Info");
362460 //infoPanel.setLayout(new BorderLayout());
363461 //infoPanel.add(createTextPane());
364462
....@@ -366,16 +464,23 @@
366464 mainPanel.setName("Main");
367465 mainPanel.setContinuousLayout(true);
368466 mainPanel.setOneTouchExpandable(true);
369
- mainPanel.setDividerLocation(1.0);
370467 mainPanel.setDividerSize(9);
371
- mainPanel.setResizeWeight(0);
372
-
468
+ mainPanel.setDividerLocation(0.5); //1.0);
469
+ mainPanel.setResizeWeight(0.5);
470
+
471
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
472
+ BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
473
+ divider.setDividerSize(15);
474
+ divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
475
+
476
+ mainPanel.setUI(new BasicSplitPaneUI());
477
+
373478 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
374479 //mainPanel.setLayout(new GridBagLayout());
375480 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
376
- treePanel.setLayout(new GridBagLayout());
377
- ctrlPanel.setLayout(new GridBagLayout());
378
- materialPanel.setLayout(new GridBagLayout());
481
+// treePanel.setLayout(new GridBagLayout());
482
+ //ctrlPanel.setLayout(new GridBagLayout());
483
+ //materialPanel.setLayout(new GridBagLayout());
379484
380485 aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0,
381486 GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0);
....@@ -414,7 +519,7 @@
414519 static String newline = "\n";
415520 protected static final String buttonString = "JButton";
416521 StyledDocument doc;
417
- JTextArea infoarea;
522
+ JTextPane infoarea;
418523
419524 void ClearInfo()
420525 {
....@@ -437,10 +542,10 @@
437542 e.printStackTrace();
438543 }
439544
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();
545
+// String selection = infoarea.getText();
546
+// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection);
547
+// java.awt.datatransfer.Clipboard clipboard =
548
+// Toolkit.getDefaultToolkit().getSystemClipboard();
444549 //clipboard.setContents(data, data);
445550 }
446551
....@@ -463,13 +568,13 @@
463568 //SendInfo("Name:", "bold");
464569 if (sel.GetTextures() != null || debug)
465570 {
466
- si.SendInfo(sel.toString(), "bold");
571
+ si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold");
467572 //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular");
468573 if (sel.Size() > 0)
469574 {
470575 si.SendInfo("#children = " + sel.Size(), "regular");
471576 }
472
- si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular");
577
+ si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular");
473578 if (debug)
474579 {
475580 try
....@@ -481,7 +586,10 @@
481586 }
482587
483588 if (full)
484
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
589
+ {
590
+ si.SendInfo(" BBox min: " + minima, "regular");
591
+ si.SendInfo(" BBox max: " + maxima, "regular");
592
+ }
485593
486594 if (sel.bRep != null)
487595 {
....@@ -508,7 +616,7 @@
508616 }
509617 if (sel.support != null)
510618 {
511
- si.SendInfo(" support: " + sel.support, "regular");
619
+ si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular");
512620 }
513621 if (sel.scriptnode != null)
514622 {
....@@ -522,18 +630,18 @@
522630 maxima.y = sel.toParent[3][1];
523631 maxima.z = sel.toParent[3][2];
524632 si.SendInfo(" Orig: " + maxima, "regular");
525
- maxima.x = sel.globalTransform[3][0];
526
- maxima.y = sel.globalTransform[3][1];
527
- maxima.z = sel.globalTransform[3][2];
528
- if (full)
529
- si.SendInfo(" Global Orig: " + maxima, "regular");
530633 maxima.x = sel.toParent[0][0];
531634 maxima.y = sel.toParent[1][1];
532635 maxima.z = sel.toParent[2][2];
533636 si.SendInfo(" Scale: " + maxima, "regular");
534
- maxima.x = sel.globalTransform[0][0];
535
- maxima.y = sel.globalTransform[1][1];
536
- maxima.z = sel.globalTransform[2][2];
637
+ maxima.x = sel.globalTransform[3][0];
638
+ maxima.y = sel.globalTransform[3][1];
639
+ maxima.z = sel.globalTransform[3][2];
640
+ if (full)
641
+ si.SendInfo(" Global Orig: " + maxima, "regular");
642
+ maxima.x = sel.globalTransform[0][0];
643
+ maxima.y = sel.globalTransform[1][1];
644
+ maxima.z = sel.globalTransform[2][2];
537645 if (full)
538646 si.SendInfo(" Global Scale: " + maxima, "regular");
539647 }
....@@ -579,6 +687,9 @@
579687 {
580688 CameraPane.pointflow = (PointFlow) sel;
581689 }
690
+
691
+ si.SendInfo("_____________________", "regular");
692
+ si.SendInfo("", "regular");
582693 }
583694 }
584695
....@@ -594,52 +705,191 @@
594705 }
595706 }
596707
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
- };
708
+//static GraphicsDevice device = GraphicsEnvironment
709
+// .getLocalGraphicsEnvironment().getScreenDevices()[0];
614710
615
- String[] initStyles =
616
- {
617
- "regular", "italic", "bold", "small", "large",
618
- "regular", "button", "regular", "icon",
619
- "regular"
620
- };
711
+ Rectangle keeprect;
712
+ cRadio radio;
713
+
714
+cButton keepButton;
715
+ cButton twoButton; // Full 3D
716
+ cButton sixButton;
717
+ cButton threeButton;
718
+ cButton sevenButton;
719
+ cButton fourButton; // full panel
720
+ cButton oneButton; // full XYZ
721
+ //cButton currentLayout;
722
+
723
+ boolean maximized;
724
+
725
+ cButton fullscreenLayout;
621726
622
- JTextPane textPane = new JTextPane();
623
- textPane.setEditable(true);
624
- /*StyledDocument*/ doc = textPane.getStyledDocument();
625
- addStylesToDocument(doc);
626
-
627
- try
727
+ void Minimize()
628728 {
629
- for (int j = 0; j < 2; j++)
729
+ frame.setState(Frame.ICONIFIED);
730
+ frame.validate();
731
+ }
732
+
733
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
734
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
735
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
736
+ void Maximize()
737
+ {
738
+ if (CameraPane.FULLSCREEN)
630739 {
631
- for (int i = 0; i < initString.length; i++)
632
- {
633
- doc.insertString(doc.getLength(), initString[i],
634
- doc.getStyle(initStyles[i]));
635
- }
740
+ ToggleFullScreen();
636741 }
637
- } catch (BadLocationException ble)
742
+
743
+ if (maximized)
744
+ {
745
+ frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
746
+ }
747
+ else
748
+ {
749
+ keeprect = frame.getBounds();
750
+// Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
751
+// Dimension rect2 = frame.getToolkit().getScreenSize();
752
+// frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height);
753
+// frame.setState(Frame.MAXIMIZED_BOTH);
754
+ frame.setBounds(frame.getGraphicsConfiguration().getBounds());
755
+ }
756
+
757
+ maximized ^= true;
758
+
759
+ frame.validate();
760
+ }
761
+
762
+ cButton minButton;
763
+ cButton maxButton;
764
+ cButton fullButton;
765
+
766
+ void ToggleFullScreen()
638767 {
639
- System.err.println("Couldn't insert initial text into text pane.");
768
+GraphicsDevice device = frame.getGraphicsConfiguration().getDevice();
769
+
770
+ cameraView.ToggleFullScreen();
771
+
772
+ if (!CameraPane.FULLSCREEN)
773
+ {
774
+ device.setFullScreenWindow(null);
775
+ frame.dispose();
776
+ frame.setUndecorated(false);
777
+ frame.validate();
778
+ frame.setVisible(true);
779
+
780
+ //frame.setVisible(false);
781
+// frame.removeNotify();
782
+// frame.setUndecorated(false);
783
+// frame.addNotify();
784
+ //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
785
+
786
+// X frame.getContentPane().remove(/*"Center",*/bigThree);
787
+// X framePanel.add(bigThree);
788
+// X frame.getContentPane().add(/*"Center",*/framePanel);
789
+ framePanel.setDividerLocation(46);
790
+
791
+ //frame.setVisible(true);
792
+ radio.layout = keepButton;
793
+ //theFrame = null;
794
+ keepButton = null;
795
+ radio.layout.doClick();
796
+
797
+ } else
798
+ {
799
+ keepButton = radio.layout;
800
+ //keeprect = frame.getBounds();
801
+// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width,
802
+// frame.getToolkit().getScreenSize().height);
803
+ //frame.setVisible(false);
804
+
805
+ frame.dispose();
806
+ frame.setUndecorated(true);
807
+ device.setFullScreenWindow(frame);
808
+ frame.validate();
809
+ frame.setVisible(true);
810
+// frame.removeNotify();
811
+// frame.setUndecorated(true);
812
+// frame.addNotify();
813
+// X frame.getContentPane().remove(/*"Center",*/framePanel);
814
+// X framePanel.remove(bigThree);
815
+// X frame.getContentPane().add(/*"Center",*/bigThree);
816
+ framePanel.setDividerLocation(0);
817
+
818
+ radio.layout = fullscreenLayout;
819
+ radio.layout.doClick();
820
+ //frame.setVisible(true);
821
+ }
822
+ frame.validate();
640823 }
641824
642
- return new JTextArea(); // textPane;
825
+ private byte[] CompressCopy()
826
+ {
827
+ boolean temp = CameraPane.SWITCH;
828
+ CameraPane.SWITCH = false;
829
+
830
+ copy.ExtractBigData(versiontable);
831
+ // if (copy == client)
832
+
833
+ byte[] versions[] = copy.versions;
834
+ copy.versions = null;
835
+
836
+ byte[] compress = Compress(copy);
837
+
838
+ copy.versions = versions;
839
+
840
+ copy.RestoreBigData(versiontable);
841
+
842
+ CameraPane.SWITCH = temp;
843
+
844
+ return compress;
845
+ }
846
+
847
+ private JTextPane createTextPane()
848
+ {
849
+// TEXTAREA String[] initString =
850
+// {
851
+// "This is an editable JTextPane, ", //regular
852
+// "another ", //italic
853
+// "styled ", //bold
854
+// "text ", //small
855
+// "component, ", //large
856
+// "which supports embedded components..." + newline,//regular
857
+// " " + newline, //button
858
+// "...and embedded icons..." + newline, //regular
859
+// " ", //icon
860
+// newline + "JTextPane is a subclass of JEditorPane that "
861
+// + "uses a StyledEditorKit and StyledDocument, and provides "
862
+// + "cover methods for interacting with those objects."
863
+// };
864
+//
865
+// String[] initStyles =
866
+// {
867
+// "regular", "italic", "bold", "small", "large",
868
+// "regular", "button", "regular", "icon",
869
+// "regular"
870
+// };
871
+//
872
+// JTextPane textPane = new JTextPane();
873
+// textPane.setEditable(true);
874
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
875
+// addStylesToDocument(doc);
876
+//
877
+// try
878
+// {
879
+// for (int j = 0; j < 2; j++)
880
+// {
881
+// for (int i = 0; i < initString.length; i++)
882
+// {
883
+// doc.insertString(doc.getLength(), initString[i],
884
+// doc.getStyle(initStyles[i]));
885
+// }
886
+// }
887
+// } catch (BadLocationException ble)
888
+// {
889
+// System.err.println("Couldn't insert initial text into text pane.");
890
+// }
891
+
892
+ return new JTextPane(); // textPane;
643893 }
644894
645895 protected void addStylesToDocument(StyledDocument doc)
....@@ -692,7 +942,7 @@
692942 protected static ImageIcon createImageIcon(String path,
693943 String description)
694944 {
695
- java.net.URL imgURL = GrafreeD.class.getResource(path);
945
+ java.net.URL imgURL = Grafreed.class.getResource(path);
696946 if (imgURL != null)
697947 {
698948 return new ImageIcon(imgURL, description);
....@@ -724,6 +974,7 @@
724974 // NumberSlider vDivsField;
725975 // JCheckBox endcaps;
726976 JCheckBox liveCB;
977
+ JCheckBox selectableCB;
727978 JCheckBox hideCB;
728979 JCheckBox link2masterCB;
729980 JCheckBox markCB;
....@@ -731,7 +982,12 @@
731982 JCheckBox speedupCB;
732983 JCheckBox rewindCB;
733984 JCheckBox flipVCB;
985
+
986
+ cCheckBox toggleTextureCB;
987
+ cCheckBox toggleSwitchCB;
988
+
734989 JComboBox texresMenu;
990
+
735991 JButton resetButton;
736992 JButton stepButton;
737993 JButton stepAllButton;
....@@ -739,115 +995,87 @@
739995 JButton slowerButton;
740996 JButton fasterButton;
741997 JButton remarkButton;
998
+
999
+ cGridBag editPanel;
1000
+ cGridBag editCommandsPanel;
1001
+
1002
+ cGridBag namePanel;
1003
+ cGridBag setupPanel;
1004
+ cGridBag setupPanel2;
1005
+ cGridBag objectCommandsPanel;
1006
+ cGridBag pushPanel;
1007
+ cGridBag fillPanel;
7421008
743
- JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on)
1009
+ JCheckBox AddCheckBox(cGridBag panel, String label, boolean on)
7441010 {
7451011 JCheckBox cb;
7461012
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);
1013
+ panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7521014 cb.addItemListener(this);
753
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
754
- oe.aConstraints.gridwidth = 1;
755
- oe.aConstraints.gridx += 1;
7561015
7571016 return cb;
7581017 }
7591018
760
- cButton AddButton(ObjEditor oe, String label)
1019
+ cButton AddButton(cGridBag panel, String label)
7611020 {
7621021 cButton cb;
7631022
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);
1023
+ panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1);
7691024 cb.addActionListener(this);
770
-// oe.aConstraints.anchor = GridBagConstraints.EAST;
771
- oe.aConstraints.gridwidth = 1;
772
- oe.aConstraints.gridx += 1;
7731025
7741026 return cb;
7751027 }
7761028
777
- JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item)
1029
+ JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item)
7781030 {
7791031 JComboBox combo;
7801032
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;
1033
+ panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
7841034 combo.addActionListener(this);
7851035
7861036 return combo;
7871037 }
7881038
789
- NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow)
1039
+ cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow)
7901040 {
791
- NumberSlider combo;
1041
+ cGridBag control = new cGridBag();
1042
+
1043
+ cNumberSlider combo;
7921044
7931045 JLabel jlabel = new JLabel(label);
794
-
795
- aConstraints.fill = GridBagConstraints.VERTICAL;
7961046 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
-
1047
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1048
+ control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8061049 combo.setFloat(current);
807
-
808
- combo.label = jlabel;
809
-
810
- combo.addChangeListener(this);
811
-
812
- return combo;
1050
+
1051
+ panel.add(control);
1052
+
1053
+ return control;
8131054 }
8141055
815
- NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current)
1056
+ cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current)
8161057 {
817
- NumberSlider combo;
1058
+ cGridBag control = new cGridBag();
1059
+
1060
+ cNumberSlider combo;
8181061
8191062 JLabel jlabel = new JLabel(label);
820
-
821
- aConstraints.fill = GridBagConstraints.VERTICAL;
8221063 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
-
1064
+ control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1065
+ control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8321066 combo.setInteger(current);
8331067
834
- combo.label = jlabel;
835
-
836
- combo.addChangeListener(this);
837
-
838
- return combo;
1068
+ panel.add(control);
1069
+
1070
+ return control;
8391071 }
8401072
841
- JTextArea AddText(JPanel ctrlPanel, String name)
1073
+ JTextArea AddText(cGridBag ctrlPanel, String name)
8421074 {
8431075 JTextArea text;
8441076
845
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
846
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH;
847
- ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
1077
+ ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1);
8481078 text.addCaretListener(this);
849
- aConstraints.gridx += 1;
850
- aConstraints.gridwidth = 1;
8511079
8521080 return text;
8531081 }
....@@ -877,9 +1105,16 @@
8771105 objEditor.ctrlPanel.remove(j);
8781106 }
8791107
1108
+ void Remove(cNumberSlider j)
1109
+ {
1110
+ j.removeChangeListener(this);
1111
+ //objEditor.ctrlPanel.remove(j.label);
1112
+ objEditor.ctrlPanel.remove(j);
1113
+ }
1114
+
8801115 /*
8811116 */
882
- void Return() // ObjEditor oe)
1117
+ void Return0() // ObjEditor oe)
8831118 {
8841119 aConstraints.gridy += 1;
8851120 aConstraints.gridx = 0;
....@@ -934,35 +1169,79 @@
9341169
9351170 void SetupUI2(ObjEditor oe)
9361171 {
937
-// oe.aConstraints.weightx = 0;
938
-// oe.aConstraints.weighty = 0;
939
-// oe.aConstraints.gridx = 0;
940
-// oe.aConstraints.gridy = 0;
941
- SetupName(oe);
1172
+ //SetupName(oe);
9421173
943
- if (!GroupEditor.allparams)
1174
+ namePanel = new cGridBag();
1175
+
1176
+ nameField = AddText(namePanel, copy.GetName());
1177
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
1178
+ oe.ctrlPanel.add(namePanel);
1179
+
1180
+ oe.ctrlPanel.Return();
1181
+
1182
+ if (!allparams)
9441183 return;
9451184
946
- liveCB = AddCheckBox(oe, "Live", copy.live);
947
- link2masterCB = AddCheckBox(oe, "Supp", copy.link2master);
948
- hideCB = AddCheckBox(oe, "Hide", copy.hide);
1185
+ setupPanel = new cGridBag().setVertical(false);
1186
+
1187
+ liveCB = AddCheckBox(setupPanel, "Live", copy.live);
1188
+ liveCB.setToolTipText("Animate object");
1189
+ selectableCB = AddCheckBox(setupPanel, "Select", !copy.dontselect);
1190
+ selectableCB.setToolTipText("Make object selectable");
9491191 // 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");
1192
+
1193
+ hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
1194
+ hideCB.setToolTipText("Hide object");
1195
+ markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1196
+ markCB.setToolTipText("As animation target transform");
1197
+
1198
+ setupPanel2 = new cGridBag().setVertical(false);
1199
+
1200
+ rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
1201
+ rewindCB.setToolTipText("Rewind animation");
1202
+
1203
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
1204
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
1205
+
1206
+ link2masterCB = AddCheckBox(setupPanel2, "Support", copy.link2master);
1207
+ link2masterCB.setToolTipText("Attach to support");
1208
+
1209
+ if (Globals.ADVANCED)
1210
+ {
1211
+ speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup);
1212
+ speedupCB.setToolTipText("Option motion capture");
1213
+ }
1214
+
1215
+ oe.ctrlPanel.add(setupPanel);
1216
+ oe.ctrlPanel.Return();
1217
+ oe.ctrlPanel.add(setupPanel2);
1218
+ oe.ctrlPanel.Return();
1219
+
1220
+ objectCommandsPanel = new cGridBag().setVertical(false);
1221
+
1222
+ resetButton = AddButton(objectCommandsPanel, "Reset");
1223
+ resetButton.setToolTipText("Jump to frame zero");
1224
+ stepButton = AddButton(objectCommandsPanel, "Step");
1225
+ stepButton.setToolTipText("Step one frame");
9561226 // resetAllButton = AddButton(oe, "Reset All");
9571227 // stepAllButton = AddButton(oe, "Step All");
958
- speedupCB = AddCheckBox(oe, "Speed", copy.speedup);
9591228 // Return();
960
- slowerButton = AddButton(oe, "Slow");
961
- fasterButton = AddButton(oe, "Fast");
962
- remarkButton = AddButton(oe, "Rem");
1229
+ slowerButton = AddButton(objectCommandsPanel, "Slow");
1230
+ slowerButton.setToolTipText("Decrease animation speed");
1231
+ fasterButton = AddButton(objectCommandsPanel, "Fast");
1232
+ fasterButton.setToolTipText("Increase animation speed");
1233
+ remarkButton = AddButton(objectCommandsPanel, "Remark");
1234
+ remarkButton.setToolTipText("Set the current transform as the target");
9631235
964
- Return();
1236
+ oe.ctrlPanel.add(objectCommandsPanel);
1237
+ oe.ctrlPanel.Return();
9651238
1239
+ pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons
1240
+ normalpushField = (cNumberSlider)pushPanel.getComponent(1);
1241
+ //Return();
1242
+
1243
+ oe.ctrlPanel.Return();
1244
+
9661245 // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2);
9671246 // ObjEditor.aConstraints.gridx += 1;
9681247
....@@ -1056,7 +1335,7 @@
10561335 oe.aConstraints.gridwidth = 1;
10571336 /**/
10581337 nameField = AddText(oe.ctrlPanel, copy.GetName());
1059
- Return();
1338
+ oe.ctrlPanel.Return();
10601339
10611340 //ctrlPanel.add(textureButton = new Button("Texture..."));
10621341 //textureButton.setEnabled(false);
....@@ -1158,10 +1437,28 @@
11581437 //JPanel worldPanel =
11591438 // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true);
11601439 //worldPanel.setName("World");
1161
- /*JPanel*/ cameraPanel =
1162
- new JPanel(new BorderLayout());
1163
- cameraPanel.add(cameraView);
1440
+ centralPanel = new cGridBag();
1441
+ centralPanel.preferredWidth = 20;
1442
+
1443
+ if (Globals.ADVANCED)
1444
+ {
1445
+ timelinePanel = new JPanel(new BorderLayout());
1446
+ timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11641447
1448
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1449
+ cameraPanel.setContinuousLayout(true);
1450
+ cameraPanel.setOneTouchExpandable(true);
1451
+// cameraPanel.setDividerLocation(0.9);
1452
+// cameraPanel.setDividerSize(9);
1453
+ cameraPanel.setResizeWeight(1.0);
1454
+
1455
+ }
1456
+
1457
+ centralPanel.add(cameraView);
1458
+ centralPanel.setFocusable(true);
1459
+ //frame.setJMenuBar(timelineMenubar);
1460
+ //centralPanel.add(timelinePanel);
1461
+
11651462 //topView.camera = ;
11661463 //frontView.camera = new Camera(2);
11671464 //sideView.camera = new Camera(3);
....@@ -1177,12 +1474,14 @@
11771474 //frontView.object = copy;
11781475 //sideView.object = copy;
11791476
1180
- XYZPanel = new JPanel();
1181
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1477
+ XYZPanel = new cGridBag().setVertical(true);
1478
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
11821479
1183
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1184
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1185
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1480
+ XYZPanel.preferredWidth = 5;
1481
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1482
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1483
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1484
+ //XYZPanel.setName("XYZ");
11861485
11871486 /*
11881487 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1191,7 +1490,7 @@
11911490 gridPanel.add(cameraView);
11921491 gridPanel.add(XYZPanel);
11931492 */
1194
- gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout());
1493
+ gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout());
11951494 gridPanel.setContinuousLayout(true);
11961495 gridPanel.setOneTouchExpandable(true);
11971496 gridPanel.setDividerLocation(1.0);
....@@ -1220,11 +1519,23 @@
12201519 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
12211520 //tmp.setName("Edit");
12221521 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);
1522
+ objectPanel.setIconAt(0, GetIcon("icons/material.png"));
1523
+// JPanel north = new JPanel(new BorderLayout());
1524
+// north.setName("Edit");
1525
+// north.add(ctrlPanel, BorderLayout.NORTH);
1526
+// objectPanel.add(north);
1527
+ objectPanel.add(editPanel);
1528
+ objectPanel.setIconAt(1, GetIcon("icons/write.png"));
1529
+
1530
+ //if (Globals.ADVANCED)
1531
+ objectPanel.add(infoPanel);
1532
+ objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1533
+
1534
+ objectPanel.add(XYZPanel);
1535
+ objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
1536
+
1537
+ objectPanel.add(toolboxPanel);
1538
+ objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
12281539
12291540 /*
12301541 aConstraints.gridx = 0;
....@@ -1233,7 +1544,7 @@
12331544 aConstraints.gridy += 1;
12341545 aConstraints.gridwidth = 1;
12351546 mainPanel.add(objectPanel, aConstraints);
1236
- */
1547
+ */
12371548
12381549 scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS,
12391550 VERTICAL_SCROLLBAR_AS_NEEDED,
....@@ -1244,16 +1555,23 @@
12441555 scrollpane.setWheelScrollingEnabled(true);
12451556 scrollpane.addMouseWheelListener(this); // Default not fast enough
12461557
1247
- /*JTabbedPane*/ jtp = new JTabbedPane();
1248
- jtp.add(scrollpane);
1558
+ /*JTabbedPane*/ scenePanel = new cGridBag();
1559
+ scenePanel.preferredWidth = 5;
1560
+
1561
+ JTabbedPane tabbedPane = new JTabbedPane();
1562
+ tabbedPane.add(scrollpane);
12491563
1250
- jtp.add(FSPane = new cFileSystemPane(this));
1251
-
1252
- optionsPanel = new JPanel(new GridBagLayout());
1564
+ optionsPanel = new cGridBag().setVertical(false);
12531565
12541566 optionsPanel.setName("Options");
1255
- jtp.add(optionsPanel);
1567
+
1568
+ AddOptions(optionsPanel); //, aConstraints);
1569
+
1570
+ tabbedPane.add(optionsPanel);
1571
+
1572
+ tabbedPane.add(FSPane = new cFileSystemPane(this));
12561573
1574
+ scenePanel.add(tabbedPane);
12571575
12581576 /*
12591577 cTree jTree = new cTree(null);
....@@ -1275,7 +1593,7 @@
12751593 jtp.add(tree);
12761594 */
12771595
1278
- bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtp, gridPanel);
1596
+ bigPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scenePanel, gridPanel);
12791597 bigPanel.setContinuousLayout(true);
12801598 bigPanel.setOneTouchExpandable(true);
12811599 bigPanel.setDividerLocation(0.8);
....@@ -1287,6 +1605,7 @@
12871605 //bigPanel.setSize(new Dimension(10,10));
12881606 //bigPanel.add(ctrlPanel);
12891607 //bigPanel.add(gridPanel);
1608
+ /**
12901609 bigThree = new JPanel();
12911610 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
12921611 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1297,20 +1616,26 @@
12971616 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
12981617 aWindowConstraints.weightx = 0;
12991618 aWindowConstraints.weighty = 1;
1300
- bigThree.add(jtp, aWindowConstraints);
1619
+ bigThree.add(scenePanel, aWindowConstraints);
13011620 aWindowConstraints.weightx = 1;
13021621 aWindowConstraints.gridwidth = 3;
13031622 // aConstraints.gridheight = 3;
13041623 aWindowConstraints.gridx = 1;
13051624 aWindowConstraints.fill = GridBagConstraints.BOTH;
1306
- bigThree.add(cameraPanel, aWindowConstraints);
1625
+ bigThree.add(centralPanel, aWindowConstraints);
13071626 aWindowConstraints.weightx = 0;
13081627 aWindowConstraints.gridx = 4;
13091628 aWindowConstraints.gridwidth = 1;
13101629 // aConstraints.gridheight = 3;
13111630 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13121631 bigThree.add(XYZPanel, aWindowConstraints);
1632
+ /**/
13131633
1634
+ bigThree = new cGridBag();
1635
+ bigThree.addComponent(centralPanel);
1636
+ bigThree.addComponent(scenePanel);
1637
+ //bigThree.addComponent(XYZPanel);
1638
+
13141639 // // SIDE EFFECT!!!
13151640 // aConstraints.gridx = 0;
13161641 // aConstraints.gridy = 0;
....@@ -1318,9 +1643,9 @@
13181643 // aConstraints.gridheight = 1;
13191644
13201645 framePanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolbarPanel, bigThree);
1321
- framePanel.setContinuousLayout(true);
1322
- framePanel.setOneTouchExpandable(true);
1323
- framePanel.setDividerLocation(0.8);
1646
+ framePanel.setContinuousLayout(false);
1647
+ framePanel.setOneTouchExpandable(false);
1648
+ //.setDividerLocation(0.8);
13241649 //framePanel.setDividerSize(15);
13251650 //framePanel.setResizeWeight(0.15);
13261651 framePanel.setName("Frame");
....@@ -1331,15 +1656,21 @@
13311656 //worldPane.add(bigPanel);
13321657 //worldPane.add(worldPanel);
13331658 /**/
1334
- frame.getContentPane().add(/*"Center",*/framePanel);
1659
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1660
+ frame.add(/*"Center",*/framePanel);
13351661 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361662
13371663 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13381664
1339
- frame.setSize(1024, 768);
1340
- frame.show();
1341
-
1665
+ frame.setSize(1280, 860);
1666
+
1667
+ cameraView.requestFocusInWindow();
1668
+
13421669 gridPanel.setDividerLocation(1.0);
1670
+
1671
+ frame.validate();
1672
+
1673
+ frame.setVisible(true);
13431674
13441675 frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
13451676 frame.addWindowListener(new WindowAdapter()
....@@ -1352,6 +1683,10 @@
13521683 });
13531684 }
13541685
1686
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1687
+ {
1688
+ }
1689
+
13551690 JTree GetTree()
13561691 {
13571692 return objEditor.jTree;
....@@ -1363,260 +1698,161 @@
13631698 ctrlPanel.removeAll();
13641699 }
13651700
1366
- void SetupMaterial(JPanel ctrlPanel)
1701
+ void SetupMaterial(cGridBag panel)
13671702 {
1368
- aConstraints.weighty = 0;
1369
- //aConstraints.weightx = 1;
1370
- /*
1703
+ /*
13711704 ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints);
13721705 materialLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1373
- aConstraints.fill = GridBagConstraints.HORIZONTAL;
1374
- aConstraints.gridx += 1;
13751706 */
13761707
1377
- aConstraints.gridwidth = 1;
1378
- ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints);
1379
- aConstraints.gridx += 1;
1380
- aConstraints.weighty = 0;
1381
- aConstraints.gridwidth = 1;
1708
+ cGridBag editBar = new cGridBag().setVertical(false);
1709
+
1710
+ editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
1711
+ createMaterialButton.setToolTipText("Create material");
13821712
13831713 /*
13841714 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
1385
- aConstraints.gridx += 1;
1386
- aConstraints.weighty = 0;
1387
- aConstraints.gridwidth = 1;
13881715 */
13891716
1390
- ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints);
1391
- aConstraints.gridx += 1;
1717
+ editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
1718
+ clearMaterialButton.setToolTipText("Clear material");
1719
+
1720
+ if (Globals.ADVANCED)
1721
+ {
1722
+ editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
1723
+ editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
1724
+ editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
1725
+ }
13921726
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;
1727
+ editBar.preferredHeight = 15;
1728
+
1729
+ panel.add(editBar);
1730
+
14071731 /**/
14081732 //aConstraints.weighty = 0;
14091733 ////aConstraints.weightx = 1;
14101734 //aConstraints.weighty = 1;
14111735 aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
14121736 //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;
1737
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
14181738
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;
1739
+ cGridBag colorSection = new cGridBag().setVertical(true);
1740
+
1741
+ cGridBag color = new cGridBag();
1742
+ color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints);
1743
+ colorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1744
+ color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1745
+ //colorField.preferredWidth = 200;
1746
+ colorSection.add(color);
14291747
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;
1748
+ cGridBag modulation = new cGridBag();
1749
+ modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints);
1750
+ modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1751
+ modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1752
+ colorSection.add(modulation);
14391753
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;
1754
+ cGridBag texture = new cGridBag();
1755
+ texture.add(textureLabel = new JLabel("Texture")); // , aConstraints);
1756
+ textureLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1757
+ texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1758
+ colorSection.add(texture);
14491759
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;
1760
+ panel.add(new JSeparator());
1761
+
1762
+ panel.add(colorSection);
1763
+
1764
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1765
+
1766
+ cGridBag diffuseSection = new cGridBag().setVertical(true);
1767
+
1768
+ cGridBag diffuse = new cGridBag();
1769
+ diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints);
1770
+ diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1771
+ diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1772
+ diffuseSection.add(diffuse);
14591773
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;
1774
+ cGridBag diffuseness = new cGridBag();
1775
+ diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints);
1776
+ diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1777
+ diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1778
+ diffuseSection.add(diffuseness);
14691779
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;
1780
+ cGridBag selfshadow = new cGridBag();
1781
+ selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints);
1782
+ selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1783
+ selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1784
+ diffuseSection.add(selfshadow);
14791785
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;
1786
+ cGridBag sheen = new cGridBag();
1787
+ sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints);
1788
+ sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1789
+ sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1790
+ diffuseSection.add(sheen);
14881791
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;
1792
+ cGridBag subsurface = new cGridBag();
1793
+ subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints);
1794
+ subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1795
+ subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1796
+ diffuseSection.add(subsurface);
14981797
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;
1798
+ cGridBag shadow = new cGridBag();
1799
+ shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints);
1800
+ shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1801
+ shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1802
+ diffuseSection.add(shadow);
15081803
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;
1804
+ cGridBag fakedepth = new cGridBag();
1805
+ fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints);
1806
+ fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1807
+ fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1808
+ diffuseSection.add(fakedepth);
15181809
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;
1810
+ cGridBag shadowbias = new cGridBag();
1811
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1812
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1813
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1814
+ diffuseSection.add(shadowbias);
15281815
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;
1816
+ panel.add(new JSeparator());
1817
+
1818
+ panel.add(diffuseSection);
1819
+
1820
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1821
+
1822
+ cGridBag specularSection = new cGridBag().setVertical(true);
15381823
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;
1824
+ cGridBag specular = new cGridBag();
1825
+ specular.add(specularLabel = new JLabel("Specular")); // , aConstraints);
1826
+ specularLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1827
+ specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1828
+ specularSection.add(specular);
15481829
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;
1830
+ cGridBag lightarea = new cGridBag();
1831
+ lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints);
1832
+ lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1833
+ lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1834
+ specularSection.add(lightarea);
15581835
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;
1836
+ cGridBag shininess = new cGridBag();
1837
+ shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints);
1838
+ shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1839
+ shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1840
+ specularSection.add(shininess);
15671841
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;
1842
+ cGridBag metalness = new cGridBag();
1843
+ metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints);
1844
+ metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1845
+ metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1846
+ specularSection.add(metalness);
15771847
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;
1848
+ cGridBag velvet = new cGridBag();
1849
+ velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints);
1850
+ velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1851
+ velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1852
+ specularSection.add(velvet);
15871853
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;
1597
-
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;
1607
-
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;
1617
-
1618
- shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1);
1619
- Return();
1854
+ shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1);
1855
+ //Return();
16201856 // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints);
16211857 // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING);
16221858 // aConstraints.fill = GridBagConstraints.HORIZONTAL;
....@@ -1627,130 +1863,105 @@
16271863 // aConstraints.gridy += 1;
16281864 // aConstraints.gridwidth = 1;
16291865
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;
1866
+ cGridBag anisoU = new cGridBag();
1867
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1868
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1869
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1870
+ specularSection.add(anisoU);
16381871
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;
1872
+ cGridBag anisoV = new cGridBag();
1873
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1874
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1875
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1876
+ specularSection.add(anisoV);
16481877
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;
16581878
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;
1879
+ panel.add(new JSeparator());
1880
+
1881
+ panel.add(specularSection);
1882
+
1883
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1884
+
1885
+ //cGridBag globalSection = new cGridBag().setVertical(true);
16681886
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;
1887
+ cGridBag camera = new cGridBag();
1888
+ camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
1889
+ cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1890
+ camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1891
+ colorSection.add(camera);
16791892
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;
1893
+ cGridBag ambient = new cGridBag();
1894
+ ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
1895
+ ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1896
+ ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1897
+ colorSection.add(ambient);
16891898
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;
1899
+ cGridBag backlit = new cGridBag();
1900
+ backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
1901
+ backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1902
+ backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1903
+ colorSection.add(backlit);
16991904
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;
1905
+ cGridBag opacity = new cGridBag();
1906
+ opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
1907
+ opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1908
+ opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1909
+ colorSection.add(opacity);
17091910
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;
1911
+ //panel.add(new JSeparator());
1912
+
1913
+ //panel.add(globalSection);
1914
+
1915
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
1916
+
1917
+ cGridBag textureSection = new cGridBag().setVertical(true);
17191918
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;
1919
+ cGridBag bump = new cGridBag();
1920
+ bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints);
1921
+ bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1922
+ bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1923
+ textureSection.add(bump);
17291924
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;
1925
+ cGridBag noise = new cGridBag();
1926
+ noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints);
1927
+ noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1928
+ noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints);
1929
+ textureSection.add(noise);
17391930
1740
- //aConstraints.weighty = 1;
1741
- aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100;
1742
- //aConstraints.gridx += 1;
1743
- ctrlPanel.add(new JLabel("----------------------------------"), aConstraints);
1744
- aConstraints.weighty = 0;
1931
+ cGridBag power = new cGridBag();
1932
+ power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints);
1933
+ powerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1934
+ power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints);
1935
+ textureSection.add(power);
17451936
1746
- aConstraints.gridx = 0;
1747
- aConstraints.gridy = 0;
1748
- aConstraints.gridwidth = 1;
1937
+ cGridBag borderfade = new cGridBag();
1938
+ borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints);
1939
+ borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1940
+ borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints);
1941
+ textureSection.add(borderfade);
1942
+
1943
+ cGridBag fog = new cGridBag();
1944
+ fog.add(fogLabel = new JLabel("Punch")); // , aConstraints);
1945
+ fogLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1946
+ fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints);
1947
+ textureSection.add(fog);
1948
+
1949
+ cGridBag opacityPower = new cGridBag();
1950
+ opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints);
1951
+ opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1952
+ opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints);
1953
+ textureSection.add(opacityPower);
1954
+
1955
+ panel.add(new JSeparator());
1956
+
1957
+ panel.add(textureSection);
1958
+
1959
+ //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
17491960
17501961 SetMaterial(copy); // .GetMaterial());
17511962
1752
- colorField.addChangeListener(this);
1753
- modulationField.addChangeListener(this);
1963
+ //colorField.addChangeListener(this);
1964
+// modulationField.addChangeListener(this);
17541965 metalnessField.addChangeListener(this);
17551966 diffuseField.addChangeListener(this);
17561967 specularField.addChangeListener(this);
....@@ -1780,12 +1991,15 @@
17801991 opacityPowerField.addChangeListener(this);
17811992 /**/
17821993
1783
- resetSlidersButton.addActionListener(this);
17841994 clearMaterialButton.addActionListener(this);
17851995 createMaterialButton.addActionListener(this);
1786
-
1787
- propagateToggle.addItemListener(this);
1788
- multiplyToggle.addItemListener(this);
1996
+
1997
+ if (Globals.ADVANCED)
1998
+ {
1999
+ resetSlidersButton.addActionListener(this);
2000
+ propagateToggle.addItemListener(this);
2001
+ multiplyToggle.addItemListener(this);
2002
+ }
17892003 }
17902004
17912005 void DropFile(java.io.File[] files, boolean textures)
....@@ -1803,8 +2017,9 @@
18032017 // 3D models
18042018 if (filename.endsWith(".3ds") || filename.endsWith(".3DS"))
18052019 {
1806
- lastConverter = new com.jmex.model.converters.MaxToJme();
1807
- LoadFile(filename, lastConverter);
2020
+ //lastConverter = new com.jmex.model.converters.MaxToJme();
2021
+ //LoadFile(filename, lastConverter);
2022
+ LoadObjFile(filename); // New 3ds loader
18082023 continue;
18092024 }
18102025 if (filename.endsWith(".dae") || filename.endsWith(".DAE"))
....@@ -1956,7 +2171,7 @@
19562171
19572172 //? flashIt = false;
19582173 CameraPane pane = (CameraPane) cameraView;
1959
- pane.clickStart(location.x, location.y, 0);
2174
+ pane.clickStart(location.x, location.y, 0, 0);
19602175 pane.clickEnd(location.x, location.y, 0, true);
19612176
19622177 if (group.selection.size() == 1)
....@@ -2005,6 +2220,7 @@
20052220 e2.printStackTrace();
20062221 }
20072222 }
2223
+
20082224 LoadJMEThread loadThread;
20092225
20102226 class LoadJMEThread extends Thread
....@@ -2062,6 +2278,7 @@
20622278 //LoadFile0(filename, converter);
20632279 }
20642280 }
2281
+
20652282 LoadOBJThread loadObjThread;
20662283
20672284 class LoadOBJThread extends Thread
....@@ -2140,19 +2357,19 @@
21402357
21412358 void LoadObjFile(String fullname)
21422359 {
2143
- /*
2360
+ System.out.println("Loading " + fullname);
2361
+ /**/
21442362 //lastFilename = fullname;
21452363 if(loadObjThread == null)
21462364 {
2147
- loadObjThread = new LoadOBJThread();
2148
- loadObjThread.start();
2365
+ loadObjThread = new LoadOBJThread();
2366
+ loadObjThread.start();
21492367 }
21502368
21512369 loadObjThread.add(fullname);
2152
- */
2370
+ /**/
21532371
2154
- System.out.println("Loading " + fullname);
2155
- makeSomething(new FileObject(fullname, true), true);
2372
+ //makeSomething(new FileObject(fullname, true), true);
21562373 }
21572374
21582375 void LoadGFDFile(String fullname)
....@@ -2194,6 +2411,8 @@
21942411 {
21952412 Mocap sel = (Mocap) copy.selection.get(0);
21962413
2414
+ sel.SetCurrentBones(sel.frame);
2415
+
21972416 sel.fullname = fullname;
21982417
21992418 if (changename)
....@@ -2207,14 +2426,18 @@
22072426 sel.smoothed = false;
22082427
22092428 // if (!changename)
2210
- sel.SetPositionDelta(false, true, true, true/*?*/); // false
2429
+ //sel.SetPositionDelta(false, true, true, true/*?*/); // false
2430
+ sel.SetGlobalTransform();
2431
+ sel.LoadData();
2432
+ sel.Rewind();
2433
+ sel.Fade();
22112434 // sel.setPose(0);
22122435 refreshContents();
22132436 } else
22142437 {
22152438 mocap.Reset();
22162439 // new skeleton
2217
- makeSomething(mocap, false); // true);
2440
+ makeSomething(mocap, true); // true);
22182441 }
22192442 } catch (Exception e)
22202443 {
....@@ -2241,6 +2464,8 @@
22412464 {
22422465 Mocap sel = (Mocap) select;
22432466
2467
+ sel.SetCurrentBones(sel.frame);
2468
+
22442469 File file = new File(fullname);
22452470
22462471 // Mocap mocap = new Mocap("Mocap" + file.getName());
....@@ -2307,7 +2532,11 @@
23072532
23082533 if (!changename)
23092534 {
2310
- sel.SetPositionDelta(false, true, true, true/*?*/);
2535
+ //sel.SetPositionDelta(false, true, true, true/*?*/);
2536
+ sel.SetGlobalTransform();
2537
+ sel.LoadData();
2538
+ sel.Rewind();
2539
+ sel.Fade();
23112540 }
23122541
23132542 // sel.setPose(0);
....@@ -2401,11 +2630,11 @@
24012630
24022631 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
24032632 {
2404
- if (GrafreeD.standAlone)
2633
+ if (Grafreed.standAlone)
24052634 {
24062635 /**/
24072636 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2408
- browser.show();
2637
+ browser.setVisible(true);
24092638 String filename = browser.getFile();
24102639 if (filename != null && filename.length() > 0)
24112640 {
....@@ -2516,6 +2745,7 @@
25162745 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
25172746 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
25182747 }
2748
+
25192749 //cJME.count++;
25202750 //cJME.count %= 12;
25212751 if (gc)
....@@ -2550,6 +2780,7 @@
25502780 }
25512781 if (input == null)
25522782 {
2783
+ new Exception().printStackTrace();
25532784 System.exit(0);
25542785 }
25552786
....@@ -2698,6 +2929,7 @@
26982929 }
26992930 }
27002931 }
2932
+
27012933 cFileSystemPane FSPane;
27022934
27032935 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2751,11 +2983,14 @@
27512983 }
27522984 }
27532985 }
2986
+
27542987 freezematerial = false;
27552988 }
27562989
27572990 void SetMaterial(Object3D object)
27582991 {
2992
+ latestObject = object;
2993
+
27592994 cMaterial mat = object.material;
27602995
27612996 if (mat == null)
....@@ -2764,7 +2999,8 @@
27642999 return;
27653000 }
27663001
2767
- multiplyToggle.setSelected(mat.multiply);
3002
+ if (multiplyToggle != null)
3003
+ multiplyToggle.setSelected(mat.multiply);
27683004
27693005 assert (object.projectedVertices != null);
27703006
....@@ -2866,12 +3102,17 @@
28663102 // }
28673103
28683104 /**/
2869
- if (deselect)
3105
+ if (deselect || child == null)
28703106 {
28713107 //group.deselectAll();
28723108 //freeze = true;
28733109 GetTree().clearSelection();
28743110 //freeze = false;
3111
+
3112
+ if (child == null)
3113
+ {
3114
+ return;
3115
+ }
28753116 }
28763117
28773118 //group.addSelectee(child);
....@@ -2940,31 +3181,48 @@
29403181 cameraView.ToggleDL();
29413182 cameraView.repaint();
29423183 return;
2943
- } else if (event.getSource() == toggleTextureItem)
3184
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
29443185 {
29453186 cameraView.ToggleTexture();
29463187 // june 2013 copy.HardTouch();
29473188 cameraView.repaint();
29483189 return;
2949
- } else if (event.getSource() == toggleFullItem)
3190
+ } else if (event.getSource() == toggleTimelineItem)
29503191 {
2951
- if (CameraPane.FULLSCREEN)
3192
+ timeline ^= true;
3193
+
3194
+ if (timeline)
29523195 {
2953
- frame.getContentPane().remove(/*"Center",*/bigThree);
2954
- framePanel.add(bigThree);
2955
- frame.getContentPane().add(/*"Center",*/framePanel);
2956
- } else
2957
- {
2958
- frame.getContentPane().remove(/*"Center",*/framePanel);
2959
- frame.getContentPane().add(/*"Center",*/bigThree);
3196
+ centralPanel.remove(cameraView);
3197
+ cameraPanel.add(cameraView);
3198
+ centralPanel.add(cameraPanel);
3199
+ frame.setJMenuBar(timelineMenubar);
3200
+ wasFullScreen = CameraPane.FULLSCREEN;
3201
+ if (!CameraPane.FULLSCREEN)
3202
+ ToggleFullScreen();
3203
+ toggleFullScreenItem.setEnabled(false);
29603204 }
3205
+ else
3206
+ {
3207
+ centralPanel.remove(cameraPanel);
3208
+ centralPanel.add(cameraView);
3209
+ frame.setJMenuBar(null);
3210
+ if (!wasFullScreen)
3211
+ ToggleFullScreen();
3212
+ toggleFullScreenItem.setEnabled(true);
3213
+ }
3214
+
29613215 frame.validate();
2962
- cameraView.ToggleFullScreen();
3216
+ return;
3217
+ } else if (event.getSource() == toggleFullScreenItem)
3218
+ {
3219
+ ToggleFullScreen();
3220
+ frame.validate();
29633221
29643222 return;
2965
- } else if (event.getSource() == toggleRandomItem)
3223
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29663224 {
2967
- cameraView.ToggleRandom();
3225
+ cameraView.ToggleSwitch();
29683226 cameraView.repaint();
29693227 return;
29703228 } else if (event.getSource() == toggleHandleItem)
....@@ -2993,6 +3251,10 @@
29933251 {
29943252 copy.live ^= true;
29953253 return;
3254
+ } else if (event.getSource() == selectableCB)
3255
+ {
3256
+ copy.dontselect ^= true;
3257
+ return;
29963258 } else if (event.getSource() == hideCB)
29973259 {
29983260 copy.hide ^= true;
....@@ -3007,6 +3269,7 @@
30073269 if (event.getSource() == randomCB)
30083270 {
30093271 copy.random ^= true;
3272
+ objEditor.refreshContents();
30103273 return;
30113274 }
30123275 if (event.getSource() == speedupCB)
....@@ -3030,8 +3293,9 @@
30303293
30313294 public void actionPerformed(ActionEvent event)
30323295 {
3296
+ Object source = event.getSource();
30333297 // SCRIPT DIALOG
3034
- if (event.getSource() == okbutton)
3298
+ if (source == okbutton)
30353299 {
30363300 textpanel.setVisible(false);
30373301 textpanel.remove(textarea);
....@@ -3043,7 +3307,7 @@
30433307 textarea = null;
30443308 textpanel = null;
30453309 }
3046
- if (event.getSource() == cancelbutton)
3310
+ if (source == cancelbutton)
30473311 {
30483312 textpanel.setVisible(false);
30493313 textpanel.remove(textarea);
....@@ -3055,49 +3319,50 @@
30553319 //applySelf();
30563320 //client.refreshEditWindow();
30573321 //refreshContents();
3058
- if (event.getSource() == nameField)
3322
+ if (source == nameField)
30593323 {
30603324 //System.out.println("ObjEditor " + event);
30613325 applySelf0(true);
30623326 //parent.applySelf();
30633327 objEditor.refreshContents();
3064
- } else if (event.getSource() == resetButton)
3328
+ } else if (source == resetButton)
30653329 {
30663330 CameraPane.fullreset = true;
30673331 copy.Reset(); // ResetMeshes();
30683332 copy.Touch();
30693333 objEditor.refreshContents();
3070
- } else if (event.getSource() == stepItem)
3334
+ } else if (source == stepItem)
30713335 {
3072
- cameraView.ONESTEP = true;
3336
+ //cameraView.ONESTEP = true;
3337
+ Globals.ONESTEP = true;
30733338 cameraView.repaint();
30743339 return;
3075
- } else if (event.getSource() == stepButton)
3340
+ } else if (source == stepButton)
30763341 {
30773342 copy.Step();
30783343 copy.Touch();
30793344 objEditor.refreshContents();
3080
- } else if (event.getSource() == slowerButton)
3345
+ } else if (source == slowerButton)
30813346 {
30823347 copy.Slower();
30833348 copy.Touch();
30843349 objEditor.refreshContents();
3085
- } else if (event.getSource() == fasterButton)
3350
+ } else if (source == fasterButton)
30863351 {
30873352 copy.Faster();
30883353 copy.Touch();
30893354 objEditor.refreshContents();
3090
- } else if (event.getSource() == remarkButton)
3355
+ } else if (source == remarkButton)
30913356 {
30923357 copy.Remark();
30933358 copy.Touch();
30943359 objEditor.refreshContents();
3095
- } else if (event.getSource() == stepAllButton)
3360
+ } else if (source == stepAllButton)
30963361 {
30973362 copy.StepAll();
30983363 copy.Touch();
30993364 objEditor.refreshContents();
3100
- } else if (event.getSource() == resetAllButton)
3365
+ } else if (source == resetAllButton)
31013366 {
31023367 //CameraPane.fullreset = true;
31033368 copy.ResetAll(); // ResetMeshes();
....@@ -3130,53 +3395,79 @@
31303395 // Close();
31313396 // }
31323397 // else
3133
- if (event.getSource() == resetSlidersButton)
3398
+ if (source == resetSlidersButton)
31343399 {
31353400 ResetSliders();
3136
- } else if (event.getSource() == clearMaterialButton)
3401
+ } else if (source == clearMaterialButton)
31373402 {
31383403 ClearMaterial();
3139
- } else if (event.getSource() == createMaterialButton)
3404
+ } else if (source == createMaterialButton)
31403405 {
31413406 CreateMaterial();
3142
- } else if (event.getSource() == clearPanelButton)
3407
+ } else if (source == clearPanelButton)
31433408 {
31443409 copy.ClearUI();
31453410 refreshContents(true);
3146
- } /*
3147
- }
3148
-
3149
- public boolean action(Event event, Object arg)
3150
- {
3151
- */ else if (event.getSource() == closeItem)
3411
+ } else if (source == importGFDItem)
3412
+ {
3413
+ ImportGFD();
3414
+ } else
3415
+ if (source == importVRMLX3DItem)
3416
+ {
3417
+ ImportVRMLX3D();
3418
+ } else
3419
+ if (source == import3DSItem)
3420
+ {
3421
+ objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
3422
+ } else
3423
+ if (source == importOBJItem)
3424
+ {
3425
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
3426
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
3427
+ browser.setVisible(true);
3428
+ String filename = browser.getFile();
3429
+ if (filename != null && filename.length() > 0)
3430
+ {
3431
+ String fullname = browser.getDirectory() + filename;
3432
+ makeSomething(ReadOBJ(fullname), true);
3433
+ }
3434
+ } else
3435
+ if (source == closeItem)
31523436 {
31533437 Close();
31543438 //return true;
3155
- } else if (event.getSource() == loadItem)
3439
+ } else if (source == openItem)
31563440 {
3157
- load();
3441
+ Open();
31583442 //return true;
3159
- } else if (event.getSource() == saveItem)
3443
+ } else if (source == newItem)
3444
+ {
3445
+ New();
3446
+ } else if (source == saveItem)
31603447 {
31613448 save();
31623449 //return true;
3163
- } else if (event.getSource() == saveAsItem)
3450
+ } else if (source == saveAsItem)
31643451 {
31653452 saveAs();
31663453 //return true;
3167
- } else if (event.getSource() == reexportItem)
3454
+ } else if (source == reexportItem)
31683455 {
31693456 reexport();
31703457 //return true;
3171
- } else if (event.getSource() == exportAsItem)
3458
+ } else if (source == exportAsItem)
31723459 {
31733460 export();
31743461 //return true;
3175
- } else if (event.getSource() == povItem)
3462
+ } else if (source == povItem)
31763463 {
31773464 generatePOV();
31783465 //return true;
3179
- } else if (event.getSource() == zBufferItem)
3466
+ } else if (event.getSource() == archiveItem)
3467
+ {
3468
+ cTools.Archive(frame);
3469
+ return;
3470
+ } else if (source == zBufferItem)
31803471 {
31813472 try
31823473 {
....@@ -3198,21 +3489,8 @@
31983489 cameraView.repaint();
31993490 //return true;
32003491 }
3201
- */ else if (event.getSource() == editCameraItem)
3202
- {
3203
- cameraView.ProtectCamera();
3204
- cameraView.repaint();
3205
- return;
3206
- } else if (event.getSource() == revertCameraItem)
3207
- {
3208
- cameraView.RevertCamera();
3209
- cameraView.repaint();
3210
- return;
3211
- } else if (event.getSource() == textureButton)
3212
- {
3213
- return; // true;
3214
- } else // combos...
3215
- if (event.getSource() == texresMenu)
3492
+ */ else // combos...
3493
+ if (source == texresMenu)
32163494 {
32173495 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
32183496 copy.texres = texresMenu.getSelectedIndex();
....@@ -3224,27 +3502,424 @@
32243502 }
32253503 }
32263504
3227
- void ToggleAnimation()
3505
+ void New()
32283506 {
3229
- if (!CameraPane.ANIMATION)
3507
+ while (copy.Size() > 1)
32303508 {
3231
- FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3509
+ copy.remove(1);
3510
+ }
3511
+
3512
+ ResetModel();
3513
+ objEditor.refreshContents();
3514
+ }
3515
+
3516
+ static public byte[] Compress(Object3D o)
3517
+ {
3518
+ try
3519
+ {
3520
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3521
+// java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos);
3522
+ ObjectOutputStream out = new ObjectOutputStream(baos); //zstream);
3523
+
3524
+ Object3D parent = o.parent;
3525
+ o.parent = null;
3526
+
3527
+ out.writeObject(o);
3528
+
3529
+ o.parent = parent;
3530
+
3531
+ out.flush();
3532
+
3533
+ baos //zstream
3534
+ .close();
3535
+ out.close();
3536
+
3537
+ byte[] bytes = baos.toByteArray();
3538
+
3539
+ System.out.println("save #bytes = " + bytes.length);
3540
+ return bytes;
3541
+ } catch (Exception e)
3542
+ {
3543
+ System.err.println(e);
3544
+ return null;
3545
+ }
3546
+ }
3547
+
3548
+ static public Object Uncompress(byte[] bytes)
3549
+ {
3550
+ System.out.println("restore #bytes = " + bytes.length);
3551
+ try
3552
+ {
3553
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3554
+ //java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais);
3555
+ ObjectInputStream in = new ObjectInputStream(bais); // istream);
3556
+ Object obj = in.readObject();
3557
+
3558
+ bais //istream
3559
+ .close();
3560
+ in.close();
3561
+
3562
+ return obj;
3563
+ } catch (Exception e)
3564
+ {
3565
+ System.err.println(e);
3566
+ return null;
3567
+ }
3568
+ }
3569
+
3570
+ static public Object clone(Object o)
3571
+ {
3572
+ try
3573
+ {
3574
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
3575
+ ObjectOutputStream out = new ObjectOutputStream(baos);
3576
+
3577
+ out.writeObject(o);
3578
+
3579
+ out.flush();
3580
+ out.close();
3581
+
3582
+ byte[] bytes = baos.toByteArray();
3583
+
3584
+ System.out.println("clone = " + bytes.length);
3585
+
3586
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
3587
+ ObjectInputStream in = new ObjectInputStream(bais);
3588
+ Object obj = in.readObject();
3589
+ in.close();
3590
+
3591
+ return obj;
3592
+ } catch (Exception e)
3593
+ {
3594
+ System.err.println(e);
3595
+ return null;
3596
+ }
3597
+ }
3598
+
3599
+ cRadio GetCurrentTab()
3600
+ {
3601
+ cRadio ab;
3602
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3603
+ {
3604
+ ab = (cRadio)e.nextElement();
3605
+ if(ab.GetObject() == copy)
3606
+ {
3607
+ return ab;
3608
+ }
3609
+ }
3610
+
3611
+ return null;
3612
+ }
3613
+
3614
+
3615
+ public void Save()
3616
+ {
3617
+ //Save(true);
3618
+ Replace();
3619
+ }
3620
+
3621
+ private boolean Equal(byte[] compress, byte[] name)
3622
+ {
3623
+ if (compress.length != name.length)
3624
+ {
3625
+ return false;
3626
+ }
3627
+
3628
+ for (int i=compress.length; --i>=0;)
3629
+ {
3630
+ if (compress[i] != name[i])
3631
+ return false;
3632
+ }
3633
+
3634
+ return true;
3635
+ }
3636
+
3637
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable = new java.util.Hashtable<java.util.UUID, Object3D>();
3638
+
3639
+ public boolean Save(boolean user)
3640
+ {
3641
+ System.err.println("Save");
3642
+
3643
+ cRadio tab = GetCurrentTab();
3644
+
3645
+ byte[] compress = CompressCopy();
3646
+
3647
+ boolean thesame = false;
3648
+
3649
+ // Quick heuristic using length. Works only when stream is compressed.
3650
+ if (copy.versionindex > 0 && copy.versions[copy.versionindex-1] != null && Equal(compress, copy.versions[copy.versionindex-1]))
3651
+ {
3652
+ thesame = true;
3653
+ }
3654
+
3655
+ //EditorFrame.m_MainFrame.requestFocusInWindow();
3656
+ if (!thesame)
3657
+ {
3658
+ //tab.user[tab.versionindex] = user;
3659
+ //boolean increment = true; // tab.graphs[tab.versionindex] == null;
3660
+
3661
+ copy.versions[++copy.versionindex] = compress;
3662
+
3663
+ // if (increment)
3664
+ // tab.versionindex++;
3665
+ }
3666
+
3667
+ //copy.RestoreBigData(versiontable);
3668
+
3669
+ //assert(hashtable.isEmpty());
3670
+
3671
+ for (int i = copy.versionindex+1; i < copy.versions.length; i++)
3672
+ {
3673
+ //tab.user[i] = false;
3674
+ copy.versions[i] = null;
3675
+ }
3676
+
3677
+ SetUndoStates();
3678
+
3679
+ // test save
3680
+ if (false)
3681
+ {
3682
+ try
3683
+ {
3684
+ FileOutputStream ostream = new FileOutputStream("save" + copy.versionindex);
3685
+ ObjectOutputStream p = new ObjectOutputStream(ostream);
3686
+
3687
+ p.writeObject(copy);
3688
+
3689
+ p.flush();
3690
+
3691
+ ostream.close();
3692
+ } catch (Exception e)
3693
+ {
3694
+ e.printStackTrace();
3695
+ }
3696
+ }
3697
+
3698
+ return !thesame;
3699
+ }
3700
+
3701
+ void CopyChanged(Object3D obj)
3702
+ {
3703
+ SetUndoStates();
3704
+
3705
+ boolean temp = CameraPane.SWITCH;
3706
+ CameraPane.SWITCH = false;
3707
+
3708
+ copy.ExtractBigData(versiontable);
3709
+
3710
+ copy.clear();
3711
+
3712
+ for (int i=0; i<obj.Size(); i++)
3713
+ {
3714
+ copy.add(obj.get(i));
3715
+ }
3716
+
3717
+ copy.RestoreBigData(versiontable);
3718
+
3719
+ CameraPane.SWITCH = temp;
3720
+
3721
+ //assert(hashtable.isEmpty());
3722
+
3723
+ copy.Touch();
3724
+
3725
+ ResetModel();
3726
+ copy.HardTouch(); // recompile?
3727
+
3728
+ cRadio ab;
3729
+ for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
3730
+ {
3731
+ ab = (cRadio)e.nextElement();
3732
+ Object3D test = copy.GetObject(ab.object.GetUUID());
3733
+ //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID());
3734
+ if (test != null)
3735
+ {
3736
+ test.editWindow = ab.object.editWindow;
3737
+ ab.object = test;
3738
+ }
3739
+ }
3740
+
3741
+ refreshContents();
3742
+ }
3743
+
3744
+ cButton undoButton;
3745
+ cButton restoreButton;
3746
+ cButton replaceButton;
3747
+ cButton redoButton;
3748
+
3749
+ boolean muteSlider;
3750
+
3751
+ int VersionCount()
3752
+ {
3753
+ int count = 0;
3754
+
3755
+ for (int i = copy.versions.length; --i >= 0;)
3756
+ {
3757
+ if (copy.versions[i] != null)
3758
+ count++;
3759
+ }
3760
+
3761
+ return count;
3762
+ }
3763
+
3764
+ void SetUndoStates()
3765
+ {
3766
+ cRadio tab = GetCurrentTab();
3767
+
3768
+ restoreButton.setEnabled(copy.versionindex != -1);
3769
+ replaceButton.setEnabled(copy.versionindex != -1);
3770
+
3771
+ undoButton.setEnabled(copy.versionindex > 0);
3772
+ redoButton.setEnabled(copy.versions[copy.versionindex + 1] != null);
3773
+
3774
+ muteSlider = true;
3775
+ versionSlider.setMaximum(VersionCount() - 1);
3776
+ versionSlider.setInteger(copy.versionindex);
3777
+ muteSlider = false;
3778
+ }
3779
+
3780
+ public boolean Undo()
3781
+ {
3782
+ // Option?
3783
+ Replace();
3784
+
3785
+ System.err.println("Undo");
3786
+
3787
+ cRadio tab = GetCurrentTab();
3788
+
3789
+ if (copy.versionindex == 0)
3790
+ {
3791
+ java.awt.Toolkit.getDefaultToolkit().beep();
3792
+ return false;
3793
+ }
3794
+
3795
+// if (tab.graphs[tab.versionindex] == null) // || !tab.user[tab.versionindex])
3796
+// {
3797
+// if (Save(false))
3798
+// tab.versionindex -= 1;
3799
+// else
3800
+// {
3801
+// if (tab.versionindex <= 0)
3802
+// return false;
3803
+// else
3804
+// tab.versionindex -= 1;
3805
+// }
3806
+// }
3807
+
3808
+ copy.versionindex -= 1;
3809
+
3810
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3811
+
3812
+ return true;
3813
+ }
3814
+
3815
+ public boolean Restore()
3816
+ {
3817
+ System.err.println("Restore");
3818
+
3819
+ cRadio tab = GetCurrentTab();
3820
+
3821
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3822
+ {
3823
+ java.awt.Toolkit.getDefaultToolkit().beep();
3824
+ return false;
3825
+ }
3826
+
3827
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3828
+
3829
+ return true;
3830
+ }
3831
+
3832
+ public boolean Replace()
3833
+ {
3834
+ System.err.println("Replace");
3835
+
3836
+ cRadio tab = GetCurrentTab();
3837
+
3838
+ if (copy.versionindex == -1 || copy.versions[copy.versionindex] == null)
3839
+ {
3840
+ // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
3841
+ return false;
3842
+ }
3843
+
3844
+ copy.versions[copy.versionindex] = CompressCopy();
3845
+
3846
+ return true;
3847
+ }
3848
+
3849
+ public void Redo()
3850
+ {
3851
+ // Option?
3852
+ Replace();
3853
+
3854
+ cRadio tab = GetCurrentTab();
3855
+
3856
+ if (copy.versions[copy.versionindex + 1] == null)
3857
+ {
3858
+ java.awt.Toolkit.getDefaultToolkit().beep();
3859
+ return;
3860
+ }
3861
+
3862
+ copy.versionindex += 1;
3863
+
3864
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex]));
3865
+
3866
+ //if (!tab.user[tab.versionindex])
3867
+ // tab.graphs[tab.versionindex] = null;
3868
+ }
3869
+
3870
+ void ImportGFD()
3871
+ {
3872
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
32323873 browser.show();
32333874 String filename = browser.getFile();
32343875 if (filename != null && filename.length() > 0)
32353876 {
3236
- CameraPane.filename = browser.getDirectory() + filename;
3877
+ String fullname = browser.getDirectory() + filename;
3878
+
3879
+ //Object3D readobj =
3880
+ objEditor.ReadGFD(fullname, objEditor);
3881
+ //makeSomething(readobj);
3882
+ }
3883
+ }
3884
+
3885
+ void ImportVRMLX3D()
3886
+ {
3887
+ if (Grafreed.standAlone)
3888
+ {
3889
+ /**/
3890
+ FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
3891
+ browser.show();
3892
+ String filename = browser.getFile();
3893
+ if (filename != null && filename.length() > 0)
3894
+ {
3895
+ String fullname = browser.getDirectory() + filename;
3896
+ LoadVRMLX3D(fullname);
3897
+ }
3898
+ /**/
3899
+ }
3900
+ }
3901
+
3902
+ void ToggleAnimation()
3903
+ {
3904
+ if (!Globals.ANIMATION)
3905
+ {
3906
+ FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3907
+ browser.setVisible(true);
3908
+ String filename = browser.getFile();
3909
+ if (filename != null && filename.length() > 0)
3910
+ {
3911
+ Globals.filename = browser.getDirectory() + filename;
32373912 //CameraPane.framecount = 0;
3238
- CameraPane.imagecount = 0;
3913
+ Globals.imagecount = 0;
32393914
3240
- CameraPane.ANIMATION ^= true;
3915
+ Globals.ANIMATION ^= true;
32413916
3242
- GrafreeD.wav.cursor = 0;
3243
- GrafreeD.wav.loop = 0;
3917
+ Grafreed.wav.cursor = 0;
3918
+ Grafreed.wav.loop = 0;
32443919 }
32453920 } else
32463921 {
3247
- CameraPane.ANIMATION ^= true;
3922
+ Globals.ANIMATION ^= true;
32483923 }
32493924 }
32503925
....@@ -3290,7 +3965,7 @@
32903965 void CreateMaterial()
32913966 {
32923967 //copy.ClearMaterial(); // PATCH
3293
- copy.CreateMaterialS(multiplyToggle.isSelected());
3968
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32943969 if (copy.selection.size() > 0)
32953970 //SetMaterial(copy);
32963971 {
....@@ -3341,7 +4016,7 @@
33414016 assert false;
33424017 }
33434018
3344
- void EditSelection()
4019
+ void EditSelection(boolean newWindow)
33454020 {
33464021 }
33474022
....@@ -3349,11 +4024,11 @@
33494024 {
33504025 copy.ResetBlockLoop(); // temporary problem
33514026
3352
- boolean random = CameraPane.RANDOM;
3353
- CameraPane.RANDOM = false; // parse everything
4027
+ boolean random = CameraPane.SWITCH;
4028
+ CameraPane.SWITCH = false; // parse everything
33544029 copy.ResetDisplayList();
33554030 copy.HardTouch();
3356
- CameraPane.RANDOM = random;
4031
+ CameraPane.SWITCH = random;
33574032 }
33584033
33594034 // public void applySelf()
....@@ -3423,10 +4098,40 @@
34234098 current.fakedepth = (float) fakedepthField.getFloat();
34244099 current.shadowbias = (float) shadowbiasField.getFloat();
34254100
3426
- if (!NumberSlider.frozen)
4101
+ if (!cNumberSlider.frozen)
34274102 {
34284103 //System.out.println("Propagate = " + propagate);
34294104 copy.UpdateMaterial(anchor, current, propagate);
4105
+
4106
+ if (copy.material != null)
4107
+ {
4108
+ cMaterial mat = copy.material;
4109
+
4110
+ colorField.SetToolTipValue((mat.color));
4111
+ modulationField.SetToolTipValue((mat.modulation));
4112
+ metalnessField.SetToolTipValue((mat.metalness));
4113
+ diffuseField.SetToolTipValue((mat.diffuse));
4114
+ specularField.SetToolTipValue((mat.specular));
4115
+ shininessField.SetToolTipValue((mat.shininess));
4116
+ shiftField.SetToolTipValue((mat.shift));
4117
+ ambientField.SetToolTipValue((mat.ambient));
4118
+ lightareaField.SetToolTipValue((mat.lightarea));
4119
+ diffusenessField.SetToolTipValue((mat.factor));
4120
+ velvetField.SetToolTipValue((mat.velvet));
4121
+ sheenField.SetToolTipValue((mat.sheen));
4122
+ subsurfaceField.SetToolTipValue((mat.subsurface));
4123
+ backlitField.SetToolTipValue((mat.bump));
4124
+ anisoField.SetToolTipValue((mat.aniso));
4125
+ anisoVField.SetToolTipValue((mat.anisoV));
4126
+ cameraField.SetToolTipValue((mat.cameralight));
4127
+ selfshadowField.SetToolTipValue((mat.diffuseness));
4128
+ shadowField.SetToolTipValue((mat.shadow));
4129
+ textureField.SetToolTipValue((mat.texture));
4130
+ opacityField.SetToolTipValue((mat.opacity));
4131
+ fakedepthField.SetToolTipValue((mat.fakedepth));
4132
+ shadowbiasField.SetToolTipValue((mat.shadowbias));
4133
+ }
4134
+
34304135 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
34314136 {
34324137 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3455,9 +4160,25 @@
34554160 //copy.Touch();
34564161 }
34574162
4163
+ cNumberSlider versionSlider;
4164
+
34584165 public void stateChanged(ChangeEvent e)
34594166 {
34604167 // assert(false);
4168
+ if (e.getSource() == versionSlider)
4169
+ {
4170
+ if (muteSlider)
4171
+ return;
4172
+
4173
+ int version = versionSlider.getInteger();
4174
+
4175
+ if (copy.versions[version] != null)
4176
+ {
4177
+ CopyChanged((Object3D)Uncompress(copy.versions[copy.versionindex = version]));
4178
+ }
4179
+
4180
+ return;
4181
+ }
34614182
34624183 if (freezematerial)
34634184 {
....@@ -3471,6 +4192,7 @@
34714192 || e.getSource() == apertureField
34724193 || e.getSource() == shadowblurField)
34734194 {
4195
+ new Exception().printStackTrace();
34744196 System.exit(0);
34754197 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34764198 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3497,7 +4219,13 @@
34974219 //System.out.println("PARENT = " + parent);
34984220 //if (parent != null)
34994221 // parent.applySelf();
3500
- refreshContents();
4222
+ if (e.getSource() == normalpushField)
4223
+ {
4224
+ objEditor.refreshContents();
4225
+ //Refresh();
4226
+ }
4227
+ else
4228
+ refreshContents();
35014229 // ??? client.refreshEditWindow();
35024230 }
35034231 //else
....@@ -3509,7 +4237,7 @@
35094237 //group.name = nameField.getText();
35104238 //objEditor.applySelf();
35114239
3512
- assert (objEditor == this);
4240
+ // OCT2018: assert (objEditor == this);
35134241 if (copy.selection == null || copy.selection.size() == 0)
35144242 //super.applySelf()
35154243 ; else
....@@ -3533,12 +4261,18 @@
35334261 objEditor.copy = keep;
35344262 }
35354263 }
4264
+
4265
+ if (normalpushField != null)
4266
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
35364267 }
35374268
35384269 void SnapObject()
35394270 {
3540
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3541
- SnapObject(obj);
4271
+ if (copy.selection.size() > 0)
4272
+ {
4273
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
4274
+ SnapObject(obj);
4275
+ }
35424276 }
35434277
35444278 void SnapObject(Object3D obj)
....@@ -3652,7 +4386,7 @@
36524386
36534387 if (obj.parent != null)
36544388 {
3655
- obj.parent.TransformToWorld(interest);
4389
+// obj.parent.TransformToWorld(interest);
36564390 }
36574391
36584392 if (!CameraPane.TRACK)
....@@ -3784,7 +4518,7 @@
37844518
37854519 radioPanel.revalidate();
37864520 radioPanel.repaint();
3787
- ctrlPanel.revalidate(); // ? new
4521
+ ctrlPanel.validate(); // ? new
37884522 ctrlPanel.repaint();
37894523 }
37904524 }
....@@ -3793,6 +4527,8 @@
37934527
37944528 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37954529 {
4530
+ if (Globals.REPLACEONMAKE) // && resetmodel)
4531
+ Save();
37964532 //Tween.set(thing, 0).target(1).start(tweenManager);
37974533 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37984534 // if (thing instanceof GenericJointDemo)
....@@ -3879,6 +4615,12 @@
38794615 {
38804616 ResetModel();
38814617 Select(thing.GetTreePath(), true, false); // unselect... false);
4618
+
4619
+ if (thing.Size() == 0)
4620
+ {
4621
+ //EditSelection(false);
4622
+ }
4623
+
38824624 refreshContents();
38834625 }
38844626
....@@ -3996,6 +4738,7 @@
39964738 }
39974739 }
39984740 }
4741
+
39994742 LoadGFDThread loadGFDThread;
40004743
40014744 void ReadGFD(String fullname, iCallBack cb)
....@@ -4015,8 +4758,10 @@
40154758
40164759 try
40174760 {
4761
+ // Try compressed version first.
40184762 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4019
- java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4763
+ java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream);
4764
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream);
40204765
40214766 readobj = (Object3D) p.readObject();
40224767 istream.close();
....@@ -4024,7 +4769,22 @@
40244769 readobj.ResetDisplayList();
40254770 } catch (Exception e)
40264771 {
4027
- e.printStackTrace();
4772
+ if (!e.toString().contains("GZIP"))
4773
+ e.printStackTrace();
4774
+
4775
+ try
4776
+ {
4777
+ java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
4778
+ java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream);
4779
+
4780
+ readobj = (Object3D) p.readObject();
4781
+ istream.close();
4782
+
4783
+ readobj.ResetDisplayList();
4784
+ } catch (Exception e2)
4785
+ {
4786
+ e2.printStackTrace();
4787
+ }
40284788 }
40294789 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
40304790 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4070,6 +4830,12 @@
40704830
40714831 void LoadIt(Object obj)
40724832 {
4833
+ if (obj == null)
4834
+ {
4835
+ // Invalid file
4836
+ return;
4837
+ }
4838
+
40734839 System.out.println("Loaded " + obj);
40744840 //new Exception().printStackTrace();
40754841 Object3D readobj = (Object3D) obj;
....@@ -4079,6 +4845,8 @@
40794845
40804846 if (readobj != null)
40814847 {
4848
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
4849
+ // Save();
40824850 try
40834851 {
40844852 //readobj.deepCopySelf(copy);
....@@ -4123,6 +4891,7 @@
41234891 }
41244892 } catch (ClassCastException e)
41254893 {
4894
+ e.printStackTrace();
41264895 assert (false);
41274896 Composite c = (Composite) copy;
41284897 c.children.clear();
....@@ -4133,15 +4902,26 @@
41334902 c.addChild(csg);
41344903 }
41354904
4905
+ copy.versions = readobj.versions;
4906
+ copy.versionindex = readobj.versionindex;
4907
+
4908
+ if (copy.versions == null)
4909
+ {
4910
+ copy.versions = new byte[100][];
4911
+ copy.versionindex = -1;
4912
+ }
4913
+
4914
+ //? SetUndoStates();
4915
+
41364916 ResetModel();
41374917 copy.HardTouch(); // recompile?
41384918 refreshContents();
41394919 }
41404920 }
41414921
4142
- void load() // throws ClassNotFoundException
4922
+ void Open() // throws ClassNotFoundException
41434923 {
4144
- if (GrafreeD.standAlone)
4924
+ if (Grafreed.standAlone)
41454925 {
41464926 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
41474927 browser.show();
....@@ -4228,11 +5008,13 @@
42285008 try
42295009 {
42305010 FileOutputStream ostream = new FileOutputStream(lastname);
4231
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5011
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5012
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
42325013
42335014 p.writeObject(copy);
42345015 p.flush();
42355016
5017
+ zstream.close();
42365018 ostream.close();
42375019
42385020 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4240,19 +5022,23 @@
42405022 //ps.print(buffer.toString());
42415023 } catch (IOException e)
42425024 {
5025
+ e.printStackTrace();
42435026 }
42445027 }
5028
+
42455029 String lastname;
42465030
42475031 void saveAs()
42485032 {
4249
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
42505034 {
42515035 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
42525036 browser.setVisible(true);
42535037 String filename = browser.getFile();
42545038 if (filename != null && filename.length() > 0)
42555039 {
5040
+ if (!filename.endsWith(".gfd"))
5041
+ filename += ".gfd";
42565042 lastname = browser.getDirectory() + filename;
42575043 save();
42585044 }
....@@ -4351,13 +5137,13 @@
43515137 try
43525138 {
43535139 FileOutputStream ostream = new FileOutputStream(filename);
4354
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4355
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5140
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5141
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43565142
43575143 Object3D objectparent = obj.parent;
43585144 obj.parent = null;
43595145
4360
- Object3D object = (Object3D) GrafreeD.clone(obj);
5146
+ Object3D object = (Object3D) Grafreed.clone(obj);
43615147
43625148 obj.parent = objectparent;
43635149
....@@ -4369,8 +5155,8 @@
43695155 p.writeObject(object);
43705156 p.flush();
43715157
5158
+ zstream.close();
43725159 ostream.close();
4373
- // zstream.close();
43745160
43755161 // group.selection.get(0).parent = parent;
43765162 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4391,7 +5177,7 @@
43915177 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43925178 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43935179 copy.generatePOV(buffer);
4394
- if (GrafreeD.standAlone)
5180
+ if (Grafreed.standAlone)
43955181 {
43965182 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43975183 browser.show();
....@@ -4417,53 +5203,70 @@
44175203 Object3D client;
44185204 Object3D copy;
44195205 MenuBar menuBar;
4420
- Menu windowMenu;
4421
- MenuItem loadItem;
5206
+ Menu fileMenu;
5207
+ MenuItem newItem;
5208
+ MenuItem openItem;
44225209 MenuItem saveItem;
44235210 MenuItem saveAsItem;
44245211 MenuItem exportAsItem;
44255212 MenuItem reexportItem;
44265213 MenuItem povItem;
44275214 MenuItem closeItem;
4428
- Menu cameraMenu;
5215
+
44295216 CheckboxMenuItem zBufferItem;
44305217 //MenuItem normalLensItem;
4431
- MenuItem editCameraItem;
4432
- MenuItem revertCameraItem;
4433
- CheckboxMenuItem toggleLiveItem;
44345218 MenuItem stepItem;
4435
- CheckboxMenuItem toggleFullItem;
5219
+ CheckboxMenuItem toggleLiveItem;
5220
+ CheckboxMenuItem toggleFullScreenItem;
5221
+ CheckboxMenuItem toggleTimelineItem;
44365222 CheckboxMenuItem toggleRenderItem;
44375223 CheckboxMenuItem toggleDebugItem;
44385224 CheckboxMenuItem toggleFrustumItem;
44395225 CheckboxMenuItem toggleFootContactItem;
44405226 CheckboxMenuItem toggleDLItem;
44415227 CheckboxMenuItem toggleTextureItem;
4442
- CheckboxMenuItem toggleRandomItem;
5228
+ CheckboxMenuItem toggleSwitchItem;
44435229 CheckboxMenuItem toggleRootItem;
44445230 CheckboxMenuItem animationItem;
5231
+ MenuItem archiveItem;
44455232 CheckboxMenuItem toggleHandleItem;
44465233 CheckboxMenuItem togglePaintItem;
44475234 JSplitPane mainPanel;
44485235 JScrollPane scrollpane;
5236
+
44495237 JPanel toolbarPanel;
4450
- JPanel treePanel;
5238
+
5239
+ cGridBag treePanel;
5240
+
44515241 JPanel radioPanel;
44525242 ButtonGroup buttonGroup;
4453
- JPanel ctrlPanel;
4454
- JPanel materialPanel;
5243
+
5244
+ cGridBag toolboxPanel;
5245
+ cGridBag materialPanel;
5246
+ cGridBag ctrlPanel;
5247
+
44555248 JScrollPane infoPanel;
4456
- JPanel optionsPanel;
5249
+
5250
+ cGridBag optionsPanel;
5251
+
44575252 JTabbedPane objectPanel;
4458
- JPanel XYZPanel;
5253
+ boolean materialFlushed;
5254
+ Object3D latestObject;
5255
+
5256
+ cGridBag XYZPanel;
5257
+
44595258 JSplitPane gridPanel;
44605259 JSplitPane bigPanel;
4461
- JPanel bigThree;
4462
- JTabbedPane jtp;
4463
- JPanel cameraPanel;
5260
+
5261
+ cGridBag bigThree;
5262
+ cGridBag scenePanel;
5263
+ cGridBag centralPanel;
5264
+ JSplitPane cameraPanel;
5265
+ JPanel timelinePanel;
5266
+ JMenuBar timelineMenubar;
44645267 JSplitPane framePanel;
44655268 JTextArea/*Field*/ nameField;
4466
- cButton textureButton;
5269
+ //cButton textureButton;
44675270 cButton okButton;
44685271 cButton applyButton;
44695272 cButton cancelButton;
....@@ -4510,65 +5313,72 @@
45105313 // MATERIAL
45115314 JLabel materialLabel;
45125315 JLabel colorLabel;
4513
- NumberSlider colorField;
5316
+ cNumberSlider colorField;
45145317 JLabel modulationLabel;
4515
- NumberSlider modulationField;
5318
+ cNumberSlider modulationField;
45165319 JLabel metalnessLabel;
4517
- NumberSlider metalnessField;
5320
+ cNumberSlider metalnessField;
45185321 JLabel diffuseLabel;
4519
- NumberSlider diffuseField;
5322
+ cNumberSlider diffuseField;
45205323 JLabel specularLabel;
4521
- NumberSlider specularField;
5324
+ cNumberSlider specularField;
45225325 JLabel shininessLabel;
4523
- NumberSlider shininessField;
5326
+ cNumberSlider shininessField;
45245327 JLabel shiftLabel;
4525
- NumberSlider shiftField;
5328
+ cNumberSlider shiftField;
45265329 JLabel ambientLabel;
4527
- NumberSlider ambientField;
5330
+ cNumberSlider ambientField;
45285331 JLabel lightareaLabel;
4529
- NumberSlider lightareaField;
5332
+ cNumberSlider lightareaField;
45305333 JLabel diffusenessLabel;
4531
- NumberSlider diffusenessField;
5334
+ cNumberSlider diffusenessField;
45325335 JLabel velvetLabel;
4533
- NumberSlider velvetField;
5336
+ cNumberSlider velvetField;
45345337 JLabel sheenLabel;
4535
- NumberSlider sheenField;
5338
+ cNumberSlider sheenField;
45365339 JLabel subsurfaceLabel;
4537
- NumberSlider subsurfaceField;
5340
+ cNumberSlider subsurfaceField;
45385341 //JLabel bumpLabel;
45395342 //NumberSlider bumpField;
45405343 JLabel backlitLabel;
4541
- NumberSlider backlitField;
5344
+ cNumberSlider backlitField;
45425345 JLabel anisoLabel;
4543
- NumberSlider anisoField;
5346
+ cNumberSlider anisoField;
45445347 JLabel anisoVLabel;
4545
- NumberSlider anisoVField;
5348
+ cNumberSlider anisoVField;
45465349 JLabel cameraLabel;
4547
- NumberSlider cameraField;
5350
+ cNumberSlider cameraField;
45485351 JLabel selfshadowLabel;
4549
- NumberSlider selfshadowField;
5352
+ cNumberSlider selfshadowField;
45505353 JLabel shadowLabel;
4551
- NumberSlider shadowField;
5354
+ cNumberSlider shadowField;
45525355 JLabel textureLabel;
4553
- NumberSlider textureField;
5356
+ cNumberSlider textureField;
45545357 JLabel opacityLabel;
4555
- NumberSlider opacityField;
5358
+ cNumberSlider opacityField;
45565359 JLabel fakedepthLabel;
4557
- NumberSlider fakedepthField;
5360
+ cNumberSlider fakedepthField;
45585361 JLabel shadowbiasLabel;
4559
- NumberSlider shadowbiasField;
5362
+ cNumberSlider shadowbiasField;
45605363 JLabel bumpLabel;
4561
- NumberSlider bumpField;
5364
+ cNumberSlider bumpField;
45625365 JLabel noiseLabel;
4563
- NumberSlider noiseField;
5366
+ cNumberSlider noiseField;
45645367 JLabel powerLabel;
4565
- NumberSlider powerField;
5368
+ cNumberSlider powerField;
45665369 JLabel borderfadeLabel;
4567
- NumberSlider borderfadeField;
5370
+ cNumberSlider borderfadeField;
45685371 JLabel fogLabel;
4569
- NumberSlider fogField;
5372
+ cNumberSlider fogField;
45705373 JLabel opacityPowerLabel;
4571
- NumberSlider opacityPowerField;
4572
- JTree jTree;
5374
+ cNumberSlider opacityPowerField;
5375
+ cTree jTree;
45735376 //ObjectUI parent;
5377
+
5378
+ cNumberSlider normalpushField;
5379
+
5380
+ private MenuItem importGFDItem;
5381
+ private MenuItem importVRMLX3DItem;
5382
+ private MenuItem import3DSItem;
5383
+ private MenuItem importOBJItem;
45745384 }