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"))
....@@ -1859,19 +2074,21 @@
18592074 }
18602075
18612076 // Images/textures
1862
- if (textures
1863
- && (filename.toLowerCase().endsWith(".jpg")
1864
- || filename.toLowerCase().endsWith(".jpeg")
1865
- || filename.toLowerCase().endsWith(".gif")
1866
- || filename.toLowerCase().endsWith(".png")
1867
- || filename.toLowerCase().endsWith(".tre")
1868
- || filename.toLowerCase().endsWith(".bmp")
1869
- || filename.toLowerCase().endsWith(".tga")
1870
- || filename.toLowerCase().endsWith(".sgi")
1871
- || filename.toLowerCase().endsWith(".tif")
1872
- || filename.toLowerCase().endsWith(".tiff")))
2077
+ if (filename.toLowerCase().endsWith(".jpg")
2078
+ || filename.toLowerCase().endsWith(".jpeg")
2079
+ || filename.toLowerCase().endsWith(".gif")
2080
+ || filename.toLowerCase().endsWith(".png")
2081
+ || filename.toLowerCase().endsWith(".tre")
2082
+ || filename.toLowerCase().endsWith(".bmp")
2083
+ || filename.toLowerCase().endsWith(".tga")
2084
+ || filename.toLowerCase().endsWith(".sgi")
2085
+ || filename.toLowerCase().endsWith(".tif")
2086
+ || filename.toLowerCase().endsWith(".tiff"))
18732087 {
1874
- DropTexture(filename);
2088
+ if (textures)
2089
+ DropTexture(filename);
2090
+ else
2091
+ CreateBillboard(filename);
18752092 continue;
18762093 }
18772094
....@@ -1880,6 +2097,60 @@
18802097 }
18812098
18822099 ResetModel();
2100
+ }
2101
+
2102
+ void CreateBillboard(String filename)
2103
+ {
2104
+ Object3D source = null;
2105
+ Object3D group = copy;
2106
+
2107
+ if (group.selection.size() > 0)
2108
+ {
2109
+ source = group.selection.get(0);
2110
+ }
2111
+
2112
+ Grid grid = new Grid(1,1);
2113
+ grid.material = null;
2114
+
2115
+ grid.toParent = LA.newMatrix();
2116
+ grid.fromParent = LA.newMatrix();
2117
+ LA.matYRotate(grid.toParent, Math.PI/2);
2118
+ LA.matXRotate(grid.toParent, -Math.PI/2);
2119
+ LA.matXRotate(grid.fromParent, Math.PI/2);
2120
+ LA.matYRotate(grid.fromParent, -Math.PI/2);
2121
+
2122
+ BillboardNode bb = new BillboardNode();
2123
+ bb.addChild(grid);
2124
+
2125
+ Object3D newgroup = new Object3D();
2126
+ newgroup.CreateMaterial();
2127
+
2128
+ File file = new File(filename);
2129
+ newgroup.name = file.getName();
2130
+ newgroup.addChild(bb);
2131
+
2132
+ Object3D main = newgroup;
2133
+
2134
+ main.SetPigmentTexture(filename);
2135
+
2136
+ if (source != null)
2137
+ {
2138
+ main.material = new cMaterial(source.material);
2139
+ if (main.projectedVertices.length < source.projectedVertices.length)
2140
+ {
2141
+ main.projectedVertices = new Object3D.cVector2[source.projectedVertices.length];
2142
+ }
2143
+
2144
+ for (int i=0; i<source.projectedVertices.length; i++)
2145
+ {
2146
+ main.projectedVertices[i].x = source.projectedVertices[i].x;
2147
+ main.projectedVertices[i].y = source.projectedVertices[i].y;
2148
+ }
2149
+
2150
+ main.texres = source.texres;
2151
+ }
2152
+
2153
+ makeSomething(newgroup, false);
18832154 }
18842155
18852156 Point location;
....@@ -1900,7 +2171,7 @@
19002171
19012172 //? flashIt = false;
19022173 CameraPane pane = (CameraPane) cameraView;
1903
- pane.clickStart(location.x, location.y, 0);
2174
+ pane.clickStart(location.x, location.y, 0, 0);
19042175 pane.clickEnd(location.x, location.y, 0, true);
19052176
19062177 if (group.selection.size() == 1)
....@@ -1949,6 +2220,7 @@
19492220 e2.printStackTrace();
19502221 }
19512222 }
2223
+
19522224 LoadJMEThread loadThread;
19532225
19542226 class LoadJMEThread extends Thread
....@@ -2006,6 +2278,7 @@
20062278 //LoadFile0(filename, converter);
20072279 }
20082280 }
2281
+
20092282 LoadOBJThread loadObjThread;
20102283
20112284 class LoadOBJThread extends Thread
....@@ -2084,19 +2357,19 @@
20842357
20852358 void LoadObjFile(String fullname)
20862359 {
2087
- /*
2360
+ System.out.println("Loading " + fullname);
2361
+ /**/
20882362 //lastFilename = fullname;
20892363 if(loadObjThread == null)
20902364 {
2091
- loadObjThread = new LoadOBJThread();
2092
- loadObjThread.start();
2365
+ loadObjThread = new LoadOBJThread();
2366
+ loadObjThread.start();
20932367 }
20942368
20952369 loadObjThread.add(fullname);
2096
- */
2370
+ /**/
20972371
2098
- System.out.println("Loading " + fullname);
2099
- makeSomething(new FileObject(fullname, true), true);
2372
+ //makeSomething(new FileObject(fullname, true), true);
21002373 }
21012374
21022375 void LoadGFDFile(String fullname)
....@@ -2138,6 +2411,8 @@
21382411 {
21392412 Mocap sel = (Mocap) copy.selection.get(0);
21402413
2414
+ sel.SetCurrentBones(sel.frame);
2415
+
21412416 sel.fullname = fullname;
21422417
21432418 if (changename)
....@@ -2151,14 +2426,18 @@
21512426 sel.smoothed = false;
21522427
21532428 // if (!changename)
2154
- 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();
21552434 // sel.setPose(0);
21562435 refreshContents();
21572436 } else
21582437 {
21592438 mocap.Reset();
21602439 // new skeleton
2161
- makeSomething(mocap, false); // true);
2440
+ makeSomething(mocap, true); // true);
21622441 }
21632442 } catch (Exception e)
21642443 {
....@@ -2185,6 +2464,8 @@
21852464 {
21862465 Mocap sel = (Mocap) select;
21872466
2467
+ sel.SetCurrentBones(sel.frame);
2468
+
21882469 File file = new File(fullname);
21892470
21902471 // Mocap mocap = new Mocap("Mocap" + file.getName());
....@@ -2251,7 +2532,11 @@
22512532
22522533 if (!changename)
22532534 {
2254
- 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();
22552540 }
22562541
22572542 // sel.setPose(0);
....@@ -2345,11 +2630,11 @@
23452630
23462631 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23472632 {
2348
- if (GrafreeD.standAlone)
2633
+ if (Grafreed.standAlone)
23492634 {
23502635 /**/
23512636 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
2352
- browser.show();
2637
+ browser.setVisible(true);
23532638 String filename = browser.getFile();
23542639 if (filename != null && filename.length() > 0)
23552640 {
....@@ -2460,6 +2745,7 @@
24602745 LA.matXRotate(((Object3D) group.get(group.size() - 1)).toParent, -Math.PI / 2);
24612746 LA.matXRotate(((Object3D) group.get(group.size() - 1)).fromParent, Math.PI / 2);
24622747 }
2748
+
24632749 //cJME.count++;
24642750 //cJME.count %= 12;
24652751 if (gc)
....@@ -2494,6 +2780,7 @@
24942780 }
24952781 if (input == null)
24962782 {
2783
+ new Exception().printStackTrace();
24972784 System.exit(0);
24982785 }
24992786
....@@ -2642,6 +2929,7 @@
26422929 }
26432930 }
26442931 }
2932
+
26452933 cFileSystemPane FSPane;
26462934
26472935 void SetMaterial(cMaterial mat, Object3D.cVector2[] others)
....@@ -2695,11 +2983,14 @@
26952983 }
26962984 }
26972985 }
2986
+
26982987 freezematerial = false;
26992988 }
27002989
27012990 void SetMaterial(Object3D object)
27022991 {
2992
+ latestObject = object;
2993
+
27032994 cMaterial mat = object.material;
27042995
27052996 if (mat == null)
....@@ -2708,7 +2999,8 @@
27082999 return;
27093000 }
27103001
2711
- multiplyToggle.setSelected(mat.multiply);
3002
+ if (multiplyToggle != null)
3003
+ multiplyToggle.setSelected(mat.multiply);
27123004
27133005 assert (object.projectedVertices != null);
27143006
....@@ -2810,12 +3102,17 @@
28103102 // }
28113103
28123104 /**/
2813
- if (deselect)
3105
+ if (deselect || child == null)
28143106 {
28153107 //group.deselectAll();
28163108 //freeze = true;
28173109 GetTree().clearSelection();
28183110 //freeze = false;
3111
+
3112
+ if (child == null)
3113
+ {
3114
+ return;
3115
+ }
28193116 }
28203117
28213118 //group.addSelectee(child);
....@@ -2884,31 +3181,48 @@
28843181 cameraView.ToggleDL();
28853182 cameraView.repaint();
28863183 return;
2887
- } else if (event.getSource() == toggleTextureItem)
3184
+ } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB)
28883185 {
28893186 cameraView.ToggleTexture();
28903187 // june 2013 copy.HardTouch();
28913188 cameraView.repaint();
28923189 return;
2893
- } else if (event.getSource() == toggleFullItem)
3190
+ } else if (event.getSource() == toggleTimelineItem)
28943191 {
2895
- if (CameraPane.FULLSCREEN)
3192
+ timeline ^= true;
3193
+
3194
+ if (timeline)
28963195 {
2897
- frame.getContentPane().remove(/*"Center",*/bigThree);
2898
- framePanel.add(bigThree);
2899
- frame.getContentPane().add(/*"Center",*/framePanel);
2900
- } else
2901
- {
2902
- frame.getContentPane().remove(/*"Center",*/framePanel);
2903
- frame.getContentPane().add(/*"Center",*/bigThree);
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);
29043204 }
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
+
29053215 frame.validate();
2906
- cameraView.ToggleFullScreen();
3216
+ return;
3217
+ } else if (event.getSource() == toggleFullScreenItem)
3218
+ {
3219
+ ToggleFullScreen();
3220
+ frame.validate();
29073221
29083222 return;
2909
- } else if (event.getSource() == toggleRandomItem)
3223
+ } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB)
29103224 {
2911
- cameraView.ToggleRandom();
3225
+ cameraView.ToggleSwitch();
29123226 cameraView.repaint();
29133227 return;
29143228 } else if (event.getSource() == toggleHandleItem)
....@@ -2937,6 +3251,10 @@
29373251 {
29383252 copy.live ^= true;
29393253 return;
3254
+ } else if (event.getSource() == selectableCB)
3255
+ {
3256
+ copy.dontselect ^= true;
3257
+ return;
29403258 } else if (event.getSource() == hideCB)
29413259 {
29423260 copy.hide ^= true;
....@@ -2951,6 +3269,7 @@
29513269 if (event.getSource() == randomCB)
29523270 {
29533271 copy.random ^= true;
3272
+ objEditor.refreshContents();
29543273 return;
29553274 }
29563275 if (event.getSource() == speedupCB)
....@@ -2974,8 +3293,9 @@
29743293
29753294 public void actionPerformed(ActionEvent event)
29763295 {
3296
+ Object source = event.getSource();
29773297 // SCRIPT DIALOG
2978
- if (event.getSource() == okbutton)
3298
+ if (source == okbutton)
29793299 {
29803300 textpanel.setVisible(false);
29813301 textpanel.remove(textarea);
....@@ -2987,7 +3307,7 @@
29873307 textarea = null;
29883308 textpanel = null;
29893309 }
2990
- if (event.getSource() == cancelbutton)
3310
+ if (source == cancelbutton)
29913311 {
29923312 textpanel.setVisible(false);
29933313 textpanel.remove(textarea);
....@@ -2999,49 +3319,50 @@
29993319 //applySelf();
30003320 //client.refreshEditWindow();
30013321 //refreshContents();
3002
- if (event.getSource() == nameField)
3322
+ if (source == nameField)
30033323 {
30043324 //System.out.println("ObjEditor " + event);
30053325 applySelf0(true);
30063326 //parent.applySelf();
30073327 objEditor.refreshContents();
3008
- } else if (event.getSource() == resetButton)
3328
+ } else if (source == resetButton)
30093329 {
30103330 CameraPane.fullreset = true;
30113331 copy.Reset(); // ResetMeshes();
30123332 copy.Touch();
30133333 objEditor.refreshContents();
3014
- } else if (event.getSource() == stepItem)
3334
+ } else if (source == stepItem)
30153335 {
3016
- cameraView.ONESTEP = true;
3336
+ //cameraView.ONESTEP = true;
3337
+ Globals.ONESTEP = true;
30173338 cameraView.repaint();
30183339 return;
3019
- } else if (event.getSource() == stepButton)
3340
+ } else if (source == stepButton)
30203341 {
30213342 copy.Step();
30223343 copy.Touch();
30233344 objEditor.refreshContents();
3024
- } else if (event.getSource() == slowerButton)
3345
+ } else if (source == slowerButton)
30253346 {
30263347 copy.Slower();
30273348 copy.Touch();
30283349 objEditor.refreshContents();
3029
- } else if (event.getSource() == fasterButton)
3350
+ } else if (source == fasterButton)
30303351 {
30313352 copy.Faster();
30323353 copy.Touch();
30333354 objEditor.refreshContents();
3034
- } else if (event.getSource() == remarkButton)
3355
+ } else if (source == remarkButton)
30353356 {
30363357 copy.Remark();
30373358 copy.Touch();
30383359 objEditor.refreshContents();
3039
- } else if (event.getSource() == stepAllButton)
3360
+ } else if (source == stepAllButton)
30403361 {
30413362 copy.StepAll();
30423363 copy.Touch();
30433364 objEditor.refreshContents();
3044
- } else if (event.getSource() == resetAllButton)
3365
+ } else if (source == resetAllButton)
30453366 {
30463367 //CameraPane.fullreset = true;
30473368 copy.ResetAll(); // ResetMeshes();
....@@ -3074,53 +3395,79 @@
30743395 // Close();
30753396 // }
30763397 // else
3077
- if (event.getSource() == resetSlidersButton)
3398
+ if (source == resetSlidersButton)
30783399 {
30793400 ResetSliders();
3080
- } else if (event.getSource() == clearMaterialButton)
3401
+ } else if (source == clearMaterialButton)
30813402 {
30823403 ClearMaterial();
3083
- } else if (event.getSource() == createMaterialButton)
3404
+ } else if (source == createMaterialButton)
30843405 {
30853406 CreateMaterial();
3086
- } else if (event.getSource() == clearPanelButton)
3407
+ } else if (source == clearPanelButton)
30873408 {
30883409 copy.ClearUI();
30893410 refreshContents(true);
3090
- } /*
3091
- }
3092
-
3093
- public boolean action(Event event, Object arg)
3094
- {
3095
- */ 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)
30963436 {
30973437 Close();
30983438 //return true;
3099
- } else if (event.getSource() == loadItem)
3439
+ } else if (source == openItem)
31003440 {
3101
- load();
3441
+ Open();
31023442 //return true;
3103
- } else if (event.getSource() == saveItem)
3443
+ } else if (source == newItem)
3444
+ {
3445
+ New();
3446
+ } else if (source == saveItem)
31043447 {
31053448 save();
31063449 //return true;
3107
- } else if (event.getSource() == saveAsItem)
3450
+ } else if (source == saveAsItem)
31083451 {
31093452 saveAs();
31103453 //return true;
3111
- } else if (event.getSource() == reexportItem)
3454
+ } else if (source == reexportItem)
31123455 {
31133456 reexport();
31143457 //return true;
3115
- } else if (event.getSource() == exportAsItem)
3458
+ } else if (source == exportAsItem)
31163459 {
31173460 export();
31183461 //return true;
3119
- } else if (event.getSource() == povItem)
3462
+ } else if (source == povItem)
31203463 {
31213464 generatePOV();
31223465 //return true;
3123
- } else if (event.getSource() == zBufferItem)
3466
+ } else if (event.getSource() == archiveItem)
3467
+ {
3468
+ cTools.Archive(frame);
3469
+ return;
3470
+ } else if (source == zBufferItem)
31243471 {
31253472 try
31263473 {
....@@ -3142,21 +3489,8 @@
31423489 cameraView.repaint();
31433490 //return true;
31443491 }
3145
- */ else if (event.getSource() == editCameraItem)
3146
- {
3147
- cameraView.ProtectCamera();
3148
- cameraView.repaint();
3149
- return;
3150
- } else if (event.getSource() == revertCameraItem)
3151
- {
3152
- cameraView.RevertCamera();
3153
- cameraView.repaint();
3154
- return;
3155
- } else if (event.getSource() == textureButton)
3156
- {
3157
- return; // true;
3158
- } else // combos...
3159
- if (event.getSource() == texresMenu)
3492
+ */ else // combos...
3493
+ if (source == texresMenu)
31603494 {
31613495 System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex());
31623496 copy.texres = texresMenu.getSelectedIndex();
....@@ -3168,27 +3502,424 @@
31683502 }
31693503 }
31703504
3171
- void ToggleAnimation()
3505
+ void New()
31723506 {
3173
- if (!CameraPane.ANIMATION)
3507
+ while (copy.Size() > 1)
31743508 {
3175
- 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);
31763873 browser.show();
31773874 String filename = browser.getFile();
31783875 if (filename != null && filename.length() > 0)
31793876 {
3180
- 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;
31813912 //CameraPane.framecount = 0;
3182
- CameraPane.imagecount = 0;
3913
+ Globals.imagecount = 0;
31833914
3184
- CameraPane.ANIMATION ^= true;
3915
+ Globals.ANIMATION ^= true;
31853916
3186
- GrafreeD.wav.cursor = 0;
3187
- GrafreeD.wav.loop = 0;
3917
+ Grafreed.wav.cursor = 0;
3918
+ Grafreed.wav.loop = 0;
31883919 }
31893920 } else
31903921 {
3191
- CameraPane.ANIMATION ^= true;
3922
+ Globals.ANIMATION ^= true;
31923923 }
31933924 }
31943925
....@@ -3234,7 +3965,7 @@
32343965 void CreateMaterial()
32353966 {
32363967 //copy.ClearMaterial(); // PATCH
3237
- copy.CreateMaterialS(multiplyToggle.isSelected());
3968
+ copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected());
32383969 if (copy.selection.size() > 0)
32393970 //SetMaterial(copy);
32403971 {
....@@ -3285,7 +4016,7 @@
32854016 assert false;
32864017 }
32874018
3288
- void EditSelection()
4019
+ void EditSelection(boolean newWindow)
32894020 {
32904021 }
32914022
....@@ -3293,11 +4024,11 @@
32934024 {
32944025 copy.ResetBlockLoop(); // temporary problem
32954026
3296
- boolean random = CameraPane.RANDOM;
3297
- CameraPane.RANDOM = false; // parse everything
4027
+ boolean random = CameraPane.SWITCH;
4028
+ CameraPane.SWITCH = false; // parse everything
32984029 copy.ResetDisplayList();
32994030 copy.HardTouch();
3300
- CameraPane.RANDOM = random;
4031
+ CameraPane.SWITCH = random;
33014032 }
33024033
33034034 // public void applySelf()
....@@ -3367,10 +4098,40 @@
33674098 current.fakedepth = (float) fakedepthField.getFloat();
33684099 current.shadowbias = (float) shadowbiasField.getFloat();
33694100
3370
- if (!NumberSlider.frozen)
4101
+ if (!cNumberSlider.frozen)
33714102 {
33724103 //System.out.println("Propagate = " + propagate);
33734104 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
+
33744135 if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null)
33754136 {
33764137 copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000);
....@@ -3399,9 +4160,25 @@
33994160 //copy.Touch();
34004161 }
34014162
4163
+ cNumberSlider versionSlider;
4164
+
34024165 public void stateChanged(ChangeEvent e)
34034166 {
34044167 // 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
+ }
34054182
34064183 if (freezematerial)
34074184 {
....@@ -3415,6 +4192,7 @@
34154192 || e.getSource() == apertureField
34164193 || e.getSource() == shadowblurField)
34174194 {
4195
+ new Exception().printStackTrace();
34184196 System.exit(0);
34194197 cameraView.options1[0] = (float) focusField.getFloat() * 10;
34204198 cameraView.options1[1] = (float) apertureField.getFloat() / 1000;
....@@ -3441,7 +4219,13 @@
34414219 //System.out.println("PARENT = " + parent);
34424220 //if (parent != null)
34434221 // parent.applySelf();
3444
- refreshContents();
4222
+ if (e.getSource() == normalpushField)
4223
+ {
4224
+ objEditor.refreshContents();
4225
+ //Refresh();
4226
+ }
4227
+ else
4228
+ refreshContents();
34454229 // ??? client.refreshEditWindow();
34464230 }
34474231 //else
....@@ -3453,7 +4237,7 @@
34534237 //group.name = nameField.getText();
34544238 //objEditor.applySelf();
34554239
3456
- assert (objEditor == this);
4240
+ // OCT2018: assert (objEditor == this);
34574241 if (copy.selection == null || copy.selection.size() == 0)
34584242 //super.applySelf()
34594243 ; else
....@@ -3477,12 +4261,18 @@
34774261 objEditor.copy = keep;
34784262 }
34794263 }
4264
+
4265
+ if (normalpushField != null)
4266
+ copy.NORMALPUSH = (float)normalpushField.getFloat()/100;
34804267 }
34814268
34824269 void SnapObject()
34834270 {
3484
- Object3D obj = (Object3D)copy.selection.elementAt(0);
3485
- SnapObject(obj);
4271
+ if (copy.selection.size() > 0)
4272
+ {
4273
+ Object3D obj = (Object3D)copy.selection.elementAt(0);
4274
+ SnapObject(obj);
4275
+ }
34864276 }
34874277
34884278 void SnapObject(Object3D obj)
....@@ -3596,7 +4386,7 @@
35964386
35974387 if (obj.parent != null)
35984388 {
3599
- obj.parent.TransformToWorld(interest);
4389
+// obj.parent.TransformToWorld(interest);
36004390 }
36014391
36024392 if (!CameraPane.TRACK)
....@@ -3728,7 +4518,7 @@
37284518
37294519 radioPanel.revalidate();
37304520 radioPanel.repaint();
3731
- ctrlPanel.revalidate(); // ? new
4521
+ ctrlPanel.validate(); // ? new
37324522 ctrlPanel.repaint();
37334523 }
37344524 }
....@@ -3737,6 +4527,8 @@
37374527
37384528 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
37394529 {
4530
+ if (Globals.REPLACEONMAKE) // && resetmodel)
4531
+ Save();
37404532 //Tween.set(thing, 0).target(1).start(tweenManager);
37414533 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
37424534 // if (thing instanceof GenericJointDemo)
....@@ -3823,6 +4615,12 @@
38234615 {
38244616 ResetModel();
38254617 Select(thing.GetTreePath(), true, false); // unselect... false);
4618
+
4619
+ if (thing.Size() == 0)
4620
+ {
4621
+ //EditSelection(false);
4622
+ }
4623
+
38264624 refreshContents();
38274625 }
38284626
....@@ -3940,6 +4738,7 @@
39404738 }
39414739 }
39424740 }
4741
+
39434742 LoadGFDThread loadGFDThread;
39444743
39454744 void ReadGFD(String fullname, iCallBack cb)
....@@ -3959,8 +4758,10 @@
39594758
39604759 try
39614760 {
4761
+ // Try compressed version first.
39624762 java.io.FileInputStream istream = new java.io.FileInputStream(fullname);
3963
- 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);
39644765
39654766 readobj = (Object3D) p.readObject();
39664767 istream.close();
....@@ -3968,7 +4769,22 @@
39684769 readobj.ResetDisplayList();
39694770 } catch (Exception e)
39704771 {
3971
- 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
+ }
39724788 }
39734789 // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); }
39744790 // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); }
....@@ -4014,6 +4830,12 @@
40144830
40154831 void LoadIt(Object obj)
40164832 {
4833
+ if (obj == null)
4834
+ {
4835
+ // Invalid file
4836
+ return;
4837
+ }
4838
+
40174839 System.out.println("Loaded " + obj);
40184840 //new Exception().printStackTrace();
40194841 Object3D readobj = (Object3D) obj;
....@@ -4023,6 +4845,8 @@
40234845
40244846 if (readobj != null)
40254847 {
4848
+ //if (Globals.SAVEONMAKE) // A new object cannot share meshes
4849
+ // Save();
40264850 try
40274851 {
40284852 //readobj.deepCopySelf(copy);
....@@ -4067,6 +4891,7 @@
40674891 }
40684892 } catch (ClassCastException e)
40694893 {
4894
+ e.printStackTrace();
40704895 assert (false);
40714896 Composite c = (Composite) copy;
40724897 c.children.clear();
....@@ -4077,15 +4902,26 @@
40774902 c.addChild(csg);
40784903 }
40794904
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
+
40804916 ResetModel();
40814917 copy.HardTouch(); // recompile?
40824918 refreshContents();
40834919 }
40844920 }
40854921
4086
- void load() // throws ClassNotFoundException
4922
+ void Open() // throws ClassNotFoundException
40874923 {
4088
- if (GrafreeD.standAlone)
4924
+ if (Grafreed.standAlone)
40894925 {
40904926 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
40914927 browser.show();
....@@ -4172,11 +5008,13 @@
41725008 try
41735009 {
41745010 FileOutputStream ostream = new FileOutputStream(lastname);
4175
- ObjectOutputStream p = new ObjectOutputStream(ostream);
5011
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5012
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
41765013
41775014 p.writeObject(copy);
41785015 p.flush();
41795016
5017
+ zstream.close();
41805018 ostream.close();
41815019
41825020 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4184,19 +5022,23 @@
41845022 //ps.print(buffer.toString());
41855023 } catch (IOException e)
41865024 {
5025
+ e.printStackTrace();
41875026 }
41885027 }
5028
+
41895029 String lastname;
41905030
41915031 void saveAs()
41925032 {
4193
- if (GrafreeD.standAlone)
5033
+ if (Grafreed.standAlone)
41945034 {
41955035 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
41965036 browser.setVisible(true);
41975037 String filename = browser.getFile();
41985038 if (filename != null && filename.length() > 0)
41995039 {
5040
+ if (!filename.endsWith(".gfd"))
5041
+ filename += ".gfd";
42005042 lastname = browser.getDirectory() + filename;
42015043 save();
42025044 }
....@@ -4295,13 +5137,13 @@
42955137 try
42965138 {
42975139 FileOutputStream ostream = new FileOutputStream(filename);
4298
- // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
4299
- ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream);
5140
+ java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream);
5141
+ ObjectOutputStream p = new ObjectOutputStream(zstream);
43005142
43015143 Object3D objectparent = obj.parent;
43025144 obj.parent = null;
43035145
4304
- Object3D object = (Object3D) GrafreeD.clone(obj);
5146
+ Object3D object = (Object3D) Grafreed.clone(obj);
43055147
43065148 obj.parent = objectparent;
43075149
....@@ -4313,8 +5155,8 @@
43135155 p.writeObject(object);
43145156 p.flush();
43155157
5158
+ zstream.close();
43165159 ostream.close();
4317
- // zstream.close();
43185160
43195161 // group.selection.get(0).parent = parent;
43205162 //FileOutputStream fos = new FileOutputStream(fullname);
....@@ -4335,7 +5177,7 @@
43355177 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43365178 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43375179 copy.generatePOV(buffer);
4338
- if (GrafreeD.standAlone)
5180
+ if (Grafreed.standAlone)
43395181 {
43405182 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43415183 browser.show();
....@@ -4361,53 +5203,70 @@
43615203 Object3D client;
43625204 Object3D copy;
43635205 MenuBar menuBar;
4364
- Menu windowMenu;
4365
- MenuItem loadItem;
5206
+ Menu fileMenu;
5207
+ MenuItem newItem;
5208
+ MenuItem openItem;
43665209 MenuItem saveItem;
43675210 MenuItem saveAsItem;
43685211 MenuItem exportAsItem;
43695212 MenuItem reexportItem;
43705213 MenuItem povItem;
43715214 MenuItem closeItem;
4372
- Menu cameraMenu;
5215
+
43735216 CheckboxMenuItem zBufferItem;
43745217 //MenuItem normalLensItem;
4375
- MenuItem editCameraItem;
4376
- MenuItem revertCameraItem;
4377
- CheckboxMenuItem toggleLiveItem;
43785218 MenuItem stepItem;
4379
- CheckboxMenuItem toggleFullItem;
5219
+ CheckboxMenuItem toggleLiveItem;
5220
+ CheckboxMenuItem toggleFullScreenItem;
5221
+ CheckboxMenuItem toggleTimelineItem;
43805222 CheckboxMenuItem toggleRenderItem;
43815223 CheckboxMenuItem toggleDebugItem;
43825224 CheckboxMenuItem toggleFrustumItem;
43835225 CheckboxMenuItem toggleFootContactItem;
43845226 CheckboxMenuItem toggleDLItem;
43855227 CheckboxMenuItem toggleTextureItem;
4386
- CheckboxMenuItem toggleRandomItem;
5228
+ CheckboxMenuItem toggleSwitchItem;
43875229 CheckboxMenuItem toggleRootItem;
43885230 CheckboxMenuItem animationItem;
5231
+ MenuItem archiveItem;
43895232 CheckboxMenuItem toggleHandleItem;
43905233 CheckboxMenuItem togglePaintItem;
43915234 JSplitPane mainPanel;
43925235 JScrollPane scrollpane;
5236
+
43935237 JPanel toolbarPanel;
4394
- JPanel treePanel;
5238
+
5239
+ cGridBag treePanel;
5240
+
43955241 JPanel radioPanel;
43965242 ButtonGroup buttonGroup;
4397
- JPanel ctrlPanel;
4398
- JPanel materialPanel;
5243
+
5244
+ cGridBag toolboxPanel;
5245
+ cGridBag materialPanel;
5246
+ cGridBag ctrlPanel;
5247
+
43995248 JScrollPane infoPanel;
4400
- JPanel optionsPanel;
5249
+
5250
+ cGridBag optionsPanel;
5251
+
44015252 JTabbedPane objectPanel;
4402
- JPanel XYZPanel;
5253
+ boolean materialFlushed;
5254
+ Object3D latestObject;
5255
+
5256
+ cGridBag XYZPanel;
5257
+
44035258 JSplitPane gridPanel;
44045259 JSplitPane bigPanel;
4405
- JPanel bigThree;
4406
- JTabbedPane jtp;
4407
- JPanel cameraPanel;
5260
+
5261
+ cGridBag bigThree;
5262
+ cGridBag scenePanel;
5263
+ cGridBag centralPanel;
5264
+ JSplitPane cameraPanel;
5265
+ JPanel timelinePanel;
5266
+ JMenuBar timelineMenubar;
44085267 JSplitPane framePanel;
44095268 JTextArea/*Field*/ nameField;
4410
- cButton textureButton;
5269
+ //cButton textureButton;
44115270 cButton okButton;
44125271 cButton applyButton;
44135272 cButton cancelButton;
....@@ -4454,65 +5313,72 @@
44545313 // MATERIAL
44555314 JLabel materialLabel;
44565315 JLabel colorLabel;
4457
- NumberSlider colorField;
5316
+ cNumberSlider colorField;
44585317 JLabel modulationLabel;
4459
- NumberSlider modulationField;
5318
+ cNumberSlider modulationField;
44605319 JLabel metalnessLabel;
4461
- NumberSlider metalnessField;
5320
+ cNumberSlider metalnessField;
44625321 JLabel diffuseLabel;
4463
- NumberSlider diffuseField;
5322
+ cNumberSlider diffuseField;
44645323 JLabel specularLabel;
4465
- NumberSlider specularField;
5324
+ cNumberSlider specularField;
44665325 JLabel shininessLabel;
4467
- NumberSlider shininessField;
5326
+ cNumberSlider shininessField;
44685327 JLabel shiftLabel;
4469
- NumberSlider shiftField;
5328
+ cNumberSlider shiftField;
44705329 JLabel ambientLabel;
4471
- NumberSlider ambientField;
5330
+ cNumberSlider ambientField;
44725331 JLabel lightareaLabel;
4473
- NumberSlider lightareaField;
5332
+ cNumberSlider lightareaField;
44745333 JLabel diffusenessLabel;
4475
- NumberSlider diffusenessField;
5334
+ cNumberSlider diffusenessField;
44765335 JLabel velvetLabel;
4477
- NumberSlider velvetField;
5336
+ cNumberSlider velvetField;
44785337 JLabel sheenLabel;
4479
- NumberSlider sheenField;
5338
+ cNumberSlider sheenField;
44805339 JLabel subsurfaceLabel;
4481
- NumberSlider subsurfaceField;
5340
+ cNumberSlider subsurfaceField;
44825341 //JLabel bumpLabel;
44835342 //NumberSlider bumpField;
44845343 JLabel backlitLabel;
4485
- NumberSlider backlitField;
5344
+ cNumberSlider backlitField;
44865345 JLabel anisoLabel;
4487
- NumberSlider anisoField;
5346
+ cNumberSlider anisoField;
44885347 JLabel anisoVLabel;
4489
- NumberSlider anisoVField;
5348
+ cNumberSlider anisoVField;
44905349 JLabel cameraLabel;
4491
- NumberSlider cameraField;
5350
+ cNumberSlider cameraField;
44925351 JLabel selfshadowLabel;
4493
- NumberSlider selfshadowField;
5352
+ cNumberSlider selfshadowField;
44945353 JLabel shadowLabel;
4495
- NumberSlider shadowField;
5354
+ cNumberSlider shadowField;
44965355 JLabel textureLabel;
4497
- NumberSlider textureField;
5356
+ cNumberSlider textureField;
44985357 JLabel opacityLabel;
4499
- NumberSlider opacityField;
5358
+ cNumberSlider opacityField;
45005359 JLabel fakedepthLabel;
4501
- NumberSlider fakedepthField;
5360
+ cNumberSlider fakedepthField;
45025361 JLabel shadowbiasLabel;
4503
- NumberSlider shadowbiasField;
5362
+ cNumberSlider shadowbiasField;
45045363 JLabel bumpLabel;
4505
- NumberSlider bumpField;
5364
+ cNumberSlider bumpField;
45065365 JLabel noiseLabel;
4507
- NumberSlider noiseField;
5366
+ cNumberSlider noiseField;
45085367 JLabel powerLabel;
4509
- NumberSlider powerField;
5368
+ cNumberSlider powerField;
45105369 JLabel borderfadeLabel;
4511
- NumberSlider borderfadeField;
5370
+ cNumberSlider borderfadeField;
45125371 JLabel fogLabel;
4513
- NumberSlider fogField;
5372
+ cNumberSlider fogField;
45145373 JLabel opacityPowerLabel;
4515
- NumberSlider opacityPowerField;
4516
- JTree jTree;
5374
+ cNumberSlider opacityPowerField;
5375
+ cTree jTree;
45175376 //ObjectUI parent;
5377
+
5378
+ cNumberSlider normalpushField;
5379
+
5380
+ private MenuItem importGFDItem;
5381
+ private MenuItem importVRMLX3DItem;
5382
+ private MenuItem import3DSItem;
5383
+ private MenuItem importOBJItem;
45185384 }