Normand Briere
2019-06-24 47cd0f0a3870d843cb758535316060d30f15c811
Toolbox + DnD
7 files modified
13 files added
372 ■■■■ changed files
CameraPane.java 4 ●●●● patch | view | raw | blame | history
Checker.java 2 ●●● patch | view | raw | blame | history
GroupEditor.java 179 ●●●● patch | view | raw | blame | history
MandelBulb.java 56 ●●●●● patch | view | raw | blame | history
ObjEditor.java 48 ●●●● patch | view | raw | blame | history
cButton.java 4 ●●●● patch | view | raw | blame | history
cFileSystemPane.java 2 ●●● patch | view | raw | blame | history
cToggleButton.java 41 ●●●●● patch | view | raw | blame | history
cTree.java 36 ●●●● patch | view | raw | blame | history
icons/box.png patch | view | raw | blame | history
icons/close-icon.png patch | view | raw | blame | history
icons/cone.png patch | view | raw | blame | history
icons/flash-light.png patch | view | raw | blame | history
icons/grid.png patch | view | raw | blame | history
icons/overlay.png patch | view | raw | blame | history
icons/particles.png patch | view | raw | blame | history
icons/sphere.png patch | view | raw | blame | history
icons/super.png patch | view | raw | blame | history
icons/torus.png patch | view | raw | blame | history
icons/write.png patch | view | raw | blame | history
CameraPane.java
....@@ -14377,7 +14377,7 @@
1437714377 info.camera = renderCamera;
1437814378 info.x = x;
1437914379 info.y = y;
14380
- object.manipWindow.copy
14380
+ object.GetWindow().copy
1438114381 .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1438214382 } else
1438314383 {
....@@ -15378,7 +15378,7 @@
1537815378 }
1537915379 */
1538015380
15381
- object.editWindow.EditSelection();
15381
+ object.editWindow.EditSelection(false);
1538215382 }
1538315383
1538415384 void SelectParent()
Checker.java
....@@ -2,7 +2,7 @@
22 {
33 Checker()
44 {
5
- this("Checker");
5
+ this("Overlay");
66 }
77
88 Checker(String name)
GroupEditor.java
....@@ -150,6 +150,8 @@
150150
151151 void SetupMenu2(GroupEditor oe)
152152 {
153
+ oe.jTree = new cTree();
154
+
153155 Menu menu;
154156 oe.menuBar.add(menu = new Menu("Edit"));
155157 //editItem = menu.add(new MenuItem("Edit"));
....@@ -160,7 +162,7 @@
160162 // redoItem = menu.add(new MenuItem("Redo"));
161163 // redoItem.addActionListener(this);
162164 // menu.add("-");
163
- duplicateItem = menu.add(new MenuItem("Duplicate"));
165
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
164166 duplicateItem.addActionListener(this);
165167 cloneItem = menu.add(new MenuItem("Clone"));
166168 cloneItem.addActionListener(this);
....@@ -334,13 +336,21 @@
334336 frontItem.addActionListener(this);
335337 compositeItem = menu.add(new MenuItem("Composite"));
336338 compositeItem.addActionListener(this);
339
+
340
+ if (Globals.ADVANCED)
341
+ {
337342 hideItem = menu.add(new MenuItem("Hidden Group"));
338343 hideItem.addActionListener(this);
344
+ }
339345 ungroupItem = menu.add(new MenuItem("Ungroup"));
340346 ungroupItem.addActionListener(this);
347
+
341348 menu.add("-");
349
+
342350 randomItem = menu.add(new MenuItem("Switch node"));
343351 randomItem.addActionListener(this);
352
+ if (Globals.ADVANCED)
353
+ {
344354 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345355 switchGeoItem.addActionListener(this);
346356 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +358,6 @@
348358 morphItem = menu.add(new MenuItem("Morph Group"));
349359 morphItem.addActionListener(this);
350360
351
- if (Globals.ADVANCED)
352
- {
353361 menu.add("-");
354362 physicsItem = menu.add(new MenuItem("Physics"));
355363 physicsItem.addActionListener(this);
....@@ -588,35 +596,37 @@
588596 fullButton.setToolTipText("Full-screen window");
589597 fullButton.addActionListener(this);
590598
591
- oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
599
+ oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592600 undoButton.setToolTipText("Undo changes");
593601 undoButton.addActionListener(this);
594602
595
- oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596604 redoButton.setToolTipText("Redo changes");
597605 redoButton.addActionListener(this);
598606
599
- oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
607
+ oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600608 saveButton.setToolTipText("Save changes");
601609 saveButton.addActionListener(this);
602610
603
- oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
611
+ oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
604612 liveCB.setToolTipText("Enable animation");
605613 liveCB.addItemListener(this);
606614
607
- oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints);
608
- fastCB.setToolTipText("Fast mode");
609
- fastCB.addItemListener(this);
610
-
611
- oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
615
+ oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612616 oneStepButton.setToolTipText("Animate one step forward");
613617 oneStepButton.addActionListener(this);
614618
615
- oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
619
+ oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
620
+ fastCB.setToolTipText("Fast mode");
621
+ fastCB.addItemListener(this);
622
+
623
+ oe.toolboxPanel.Return();
624
+
625
+ oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
616626 trackCB.setToolTipText("Enable tracking");
617627 trackCB.addItemListener(this);
618628
619
- oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620630 screenfitButton.setToolTipText("Screen fit");
621631 screenfitButton.addActionListener(this);
622632
....@@ -630,15 +640,17 @@
630640 snapobjectButton.setToolTipText("Snap Object");
631641 }
632642
633
- oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
+ oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634644 flashSelectionButton.setToolTipText("Highlight selection");
635645 flashSelectionButton.addActionListener(this);
636646
637
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
647
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638648
639649 oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640650 twoButton.setToolTipText("Show center view only");
641651 twoButton.addActionListener(this);
652
+ this.fullscreenLayout = twoButton;
653
+
642654 oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643655 fourButton.addActionListener(this);
644656 fourButton.setToolTipText("Show left panel only");
....@@ -653,16 +665,63 @@
653665 sevenButton.addActionListener(this);
654666 //
655667
656
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
+ oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657669 rootButton.setToolTipText("Edit selection in new tab");
658670 rootButton.addActionListener(this);
659671
660
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
672
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661673 closeButton.setToolTipText("Close tab");
662674 closeButton.addActionListener(this);
663675 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
664676 //clearButton.addActionListener(this);
665
-
677
+
678
+ // INSERT
679
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
680
+ gridButton.setToolTipText("Create grid");
681
+ gridButton.addActionListener(this);
682
+
683
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
684
+ boxButton.setToolTipText("Create box");
685
+ boxButton.addActionListener(this);
686
+
687
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
688
+ sphereButton.setToolTipText("Create sphere");
689
+ sphereButton.addActionListener(this);
690
+
691
+ oe.toolboxPanel.Return();
692
+
693
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694
+ coneButton.setToolTipText("Create cone");
695
+ coneButton.addActionListener(this);
696
+
697
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
698
+ torusButton.setToolTipText("Create torus");
699
+ torusButton.addActionListener(this);
700
+
701
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
702
+ superButton.setToolTipText("Create superellipsoid");
703
+ superButton.addActionListener(this);
704
+
705
+ if (Globals.ADVANCED)
706
+ {
707
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ kleinButton.setToolTipText("Create Klein bottle");
709
+ kleinButton.addActionListener(this);
710
+ }
711
+
712
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
713
+ particlesButton.setToolTipText("Create particle system");
714
+ particlesButton.addActionListener(this);
715
+
716
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
717
+ overlayButton.setToolTipText("Create overlay");
718
+ overlayButton.addActionListener(this);
719
+
720
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
721
+ lightButton.setToolTipText("Create light");
722
+ lightButton.addActionListener(this);
723
+
724
+ // EDIT panel
666725 editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667726 editButton.setToolTipText("Edit selection");
668727 editButton.addActionListener(this);
....@@ -703,7 +762,7 @@
703762
704763 JScrollPane jSP;
705764 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
706
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
765
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
707766 ResetModel();
708767
709768 oe.treePanel.add(jSPPanel);
....@@ -868,16 +927,16 @@
868927 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
869928 }
870929
871
- cCheckBox liveCB;
930
+ cToggleButton liveCB;
872931 cCheckBox supportCB;
873932 cCheckBox localCB;
874933 cCheckBox crowdCB;
875934 cCheckBox smoothCB;
876
- cCheckBox fastCB;
935
+ cToggleButton fastCB;
877936 cCheckBox slowCB;
878937 cCheckBox boxCB;
879938 cCheckBox zoomBoxCB;
880
- cCheckBox trackCB;
939
+ cToggleButton trackCB;
881940 cCheckBox smoothfocusCB;
882941 // JCheckBox speakerMocapCB;
883942 cCheckBox speakerCameraCB;
....@@ -1014,7 +1073,8 @@
10141073
10151074 /**/
10161075 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
1017
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1076
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1077
+ TreePath path = objEditor.jTree.getSelectionPath();
10181078 if ((path == null) || (path.getPathCount() <= 1)) {
10191079 // We can't move the root node or an empty selection
10201080 return;
....@@ -1138,16 +1198,16 @@
11381198 return;
11391199 }
11401200
1141
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1142
- {
1201
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1202
+// {
11431203 loadClipboard(true);
11441204 objEditor.jTree.setSelectionPath(destinationPath);
11451205 pasteInto(false, false);
1146
- } else {
1147
- loadClipboard(false);
1148
- objEditor.jTree.setSelectionPath(destinationPath);
1149
- pasteInto(false, false); // true); // ???
1150
- }
1206
+// } else {
1207
+// loadClipboard(false);
1208
+// objEditor.jTree.setSelectionPath(destinationPath);
1209
+// pasteInto(false, false); // true); // ???
1210
+// }
11511211 }
11521212 public void dropActionChanged(DropTargetDragEvent dtde)
11531213 // Called if the user has modified the current drop gesture
....@@ -1739,11 +1799,11 @@
17391799 objEditor.cameraView.renderCamera.setAim(v2, v1);
17401800 objEditor.cameraView.repaint();
17411801 } else
1742
- if (source == rectoidItem)
1802
+ if (source == rectoidItem || source == boxButton)
17431803 {
17441804 makeSomething(new Box());
17451805 } else
1746
- if (source == particleItem)
1806
+ if (source == particleItem || source == particlesButton)
17471807 {
17481808 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
17491809 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1822,27 +1882,27 @@
18221882
18231883 makeSomething(obj);
18241884 } else
1825
- if (source == gridItem)
1885
+ if (source == gridItem || source == gridButton)
18261886 {
18271887 makeSomething(new Grid());
18281888 } else
1829
- if (source == ellipsoidItem)
1889
+ if (source == ellipsoidItem || source == sphereButton)
18301890 {
18311891 makeSomething(new Sphere());
18321892 } else
1833
- if (source == coneItem)
1893
+ if (source == coneItem || source == coneButton)
18341894 {
18351895 makeSomething(new Cone());
18361896 } else
1837
- if (source == torusItem)
1897
+ if (source == torusItem || source == torusButton)
18381898 {
18391899 makeSomething(new Torus());
18401900 } else
1841
- if (source == superItem)
1901
+ if (source == superItem || source == superButton)
18421902 {
18431903 makeSomething(new Superellipsoid());
18441904 } else
1845
- if (source == kleinItem)
1905
+ if (source == kleinItem || source == kleinButton)
18461906 {
18471907 makeSomething(new Klein());
18481908 } else
....@@ -1862,7 +1922,7 @@
18621922 {
18631923 makeSomething(new BezierSurface());
18641924 } else
1865
- if (source == overlayItem)
1925
+ if (source == overlayItem || source == overlayButton)
18661926 {
18671927 /*
18681928 Object3D obj = new BezierSurface(5,8);
....@@ -1910,7 +1970,7 @@
19101970 s.setup();
19111971 makeSomething(s);
19121972 } else
1913
- if (source == lightItem)
1973
+ if (source == lightItem || source == lightButton)
19141974 {
19151975 makeSomething(new Light());
19161976 } else
....@@ -2596,7 +2656,7 @@
25962656 {
25972657 CastShadow(2);
25982658 } else
2599
- if (source == ungroupItem)
2659
+ if (source == ungroupItem || source == ungroupButton)
26002660 {
26012661 //ungroup();
26022662 for (int i=0; i<group.selection.size(); i++)
....@@ -2934,6 +2994,10 @@
29342994 if (source == twoButton)
29352995 {
29362996 radio.layout = twoButton;
2997
+
2998
+ if (CameraPane.FULLSCREEN)
2999
+ fullscreenLayout = radio.layout;
3000
+
29373001 // bug
29383002 //gridPanel.setDividerLocation(1.0);
29393003 //bigPanel.setDividerLocation(0.0);
....@@ -2989,6 +3053,9 @@
29893053 {
29903054 radio.layout = threeButton;
29913055
3056
+ if (CameraPane.FULLSCREEN)
3057
+ fullscreenLayout = radio.layout;
3058
+
29923059 // bigThree.remove(scenePanel);
29933060 // bigThree.remove(centralPanel);
29943061 // bigThree.remove(XYZPanel);
....@@ -3027,6 +3094,9 @@
30273094 {
30283095 radio.layout = fourButton;
30293096
3097
+ if (CameraPane.FULLSCREEN)
3098
+ fullscreenLayout = radio.layout;
3099
+
30303100 // bigThree.remove(scenePanel);
30313101 // bigThree.remove(centralPanel);
30323102 // bigThree.remove(XYZPanel);
....@@ -3063,6 +3133,9 @@
30633133 if (source == sixButton)
30643134 {
30653135 radio.layout = sixButton;
3136
+
3137
+ if (CameraPane.FULLSCREEN)
3138
+ fullscreenLayout = radio.layout;
30663139
30673140 // bigThree.remove(scenePanel);
30683141 // bigThree.remove(centralPanel);
....@@ -3101,6 +3174,9 @@
31013174 if (source == sevenButton)
31023175 {
31033176 radio.layout = sevenButton;
3177
+
3178
+ if (CameraPane.FULLSCREEN)
3179
+ fullscreenLayout = radio.layout;
31043180
31053181 // bigThree.remove(scenePanel);
31063182 // bigThree.remove(centralPanel);
....@@ -4369,7 +4445,7 @@
43694445 {
43704446 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
43714447 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4372
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4448
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
43734449
43744450 Object3D elem = (Object3D)group.selection.elementAt(i);
43754451 if(elem != group || !newWindow)
....@@ -5333,6 +5409,21 @@
53335409 cButton saveButton;
53345410 cButton oneStepButton;
53355411
5412
+ cButton groupButton;
5413
+ cButton ungroupButton;
5414
+ cButton compositeButton;
5415
+
5416
+ cButton gridButton;
5417
+ cButton boxButton;
5418
+ cButton sphereButton;
5419
+ cButton coneButton;
5420
+ cButton torusButton;
5421
+ cButton superButton;
5422
+ cButton kleinButton;
5423
+ cButton particlesButton;
5424
+ cButton overlayButton;
5425
+ cButton lightButton;
5426
+
53365427 cButton screenfitButton;
53375428 cButton screenfitpointButton;
53385429 cButton snapobjectButton;
....@@ -5357,7 +5448,7 @@
53575448 private MenuItem cutItem;
53585449 private MenuItem undoItem;
53595450 private MenuItem redoItem;
5360
- private MenuItem duplicateItem;
5451
+ private JMenuItem duplicateItem;
53615452 private MenuItem cloneItem;
53625453 private MenuItem cloneSupportItem;
53635454 private MenuItem overwriteGeoItem;
MandelBulb.java
....@@ -0,0 +1,56 @@
1
+/*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+
6
+/**
7
+ *
8
+ * @author nbriere
9
+ */
10
+public class MandelBulb extends Object3D
11
+{
12
+ public boolean inside(double x, double y, double z, boolean transform) // , double d)
13
+ {
14
+ double d = 1; // Oops not so easy
15
+
16
+ double posX = x;
17
+ double posY = y;
18
+ double posZ = z;
19
+
20
+ double dr = 1.0;
21
+ double r = 0.0;
22
+
23
+ for (int i = 0; i < 10; i++)
24
+ {
25
+ double dist2xy = x*x + y*y;
26
+ r = Math.sqrt(dist2xy + z*z);
27
+ if (r > 10000)
28
+ {
29
+ break;
30
+ }
31
+
32
+ // convert to polar coordinates
33
+ //double theta = Math.acos(z / r);
34
+ double theta = Math.atan2(-z, Math.sqrt(dist2xy));
35
+ double phi = Math.atan2(y, x);
36
+ double zr = Math.pow(r, 8);
37
+ dr = zr / r * 8 * dr + 1.0;
38
+
39
+ // scale and rotate the point
40
+ theta = theta * 8;
41
+ phi = phi * 8;
42
+
43
+ // convert back to cartesian coordinates
44
+ double sintheta = zr * Math.sin(theta);
45
+ x = sintheta * Math.cos(phi);
46
+ y = Math.sin(phi) * sintheta;
47
+ z = zr * Math.cos(theta);
48
+
49
+ x += posX;
50
+ y += posY;
51
+ z += posZ;
52
+ }
53
+
54
+ return ((0.5 * Math.log(r) * r / dr) < d);
55
+ }
56
+}
ObjEditor.java
....@@ -52,6 +52,19 @@
5252 }
5353 }
5454
55
+ cToggleButton GetToggleButton(String name, boolean border)
56
+ {
57
+ try
58
+ {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cToggleButton(icon, border);
61
+ }
62
+ catch (Exception e)
63
+ {
64
+ return new cToggleButton(name, border);
65
+ }
66
+ }
67
+
5568 cCheckBox GetCheckBox(String name, boolean border)
5669 {
5770 try
....@@ -384,9 +397,12 @@
384397 editPanel.add(editCommandsPanel);
385398 editPanel.add(ctrlPanel);
386399
387
- materialPanel = new cGridBag().setVertical(true);
400
+ toolboxPanel = new cGridBag().setVertical(false);
401
+ toolboxPanel.setName("Toolbox");
388402
403
+ materialPanel = new cGridBag().setVertical(true);
389404 materialPanel.setName("Material");
405
+
390406 /*JTextPane*/
391407 infoarea = createTextPane();
392408 doc = infoarea.getStyledDocument();
....@@ -659,6 +675,8 @@
659675
660676 boolean maximized;
661677
678
+ cButton fullscreenLayout;
679
+
662680 void Minimize()
663681 {
664682 frame.setState(Frame.ICONIFIED);
....@@ -720,7 +738,7 @@
720738 // X frame.getContentPane().add(/*"Center",*/bigThree);
721739 framePanel.setDividerLocation(0);
722740
723
- radio.layout = twoButton;
741
+ radio.layout = fullscreenLayout;
724742 radio.layout.doClick();
725743 //frame.setVisible(true);
726744 }
....@@ -1394,6 +1412,7 @@
13941412
13951413 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
13961414 //tmp.setName("Edit");
1415
+ objectPanel.add(toolboxPanel);
13971416 objectPanel.add(materialPanel);
13981417 // JPanel north = new JPanel(new BorderLayout());
13991418 // north.setName("Edit");
....@@ -3726,7 +3745,7 @@
37263745 assert false;
37273746 }
37283747
3729
- void EditSelection()
3748
+ void EditSelection(boolean newWindow)
37303749 {
37313750 }
37323751
....@@ -4221,7 +4240,7 @@
42214240
42224241 void makeSomething(Object3D thing, boolean resetmodel) // deselect)
42234242 {
4224
- if (Globals.SAVEONMAKE)
4243
+ if (Globals.SAVEONMAKE) // && resetmodel)
42254244 Save();
42264245 //Tween.set(thing, 0).target(1).start(tweenManager);
42274246 //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager);
....@@ -4309,6 +4328,12 @@
43094328 {
43104329 ResetModel();
43114330 Select(thing.GetTreePath(), true, false); // unselect... false);
4331
+
4332
+ if (thing.Size() == 0)
4333
+ {
4334
+ //EditSelection(false);
4335
+ }
4336
+
43124337 refreshContents();
43134338 }
43144339
....@@ -4903,18 +4928,29 @@
49034928 CheckboxMenuItem togglePaintItem;
49044929 JSplitPane mainPanel;
49054930 JScrollPane scrollpane;
4931
+
49064932 JPanel toolbarPanel;
4933
+
49074934 cGridBag treePanel;
4935
+
49084936 JPanel radioPanel;
49094937 ButtonGroup buttonGroup;
4910
- cGridBag ctrlPanel;
4938
+
4939
+ cGridBag toolboxPanel;
49114940 cGridBag materialPanel;
4941
+ cGridBag ctrlPanel;
4942
+
49124943 JScrollPane infoPanel;
4944
+
49134945 cGridBag optionsPanel;
4946
+
49144947 JTabbedPane objectPanel;
4948
+
49154949 cGridBag XYZPanel;
4950
+
49164951 JSplitPane gridPanel;
49174952 JSplitPane bigPanel;
4953
+
49184954 cGridBag bigThree;
49194955 cGridBag scenePanel;
49204956 cGridBag centralPanel;
....@@ -5029,7 +5065,7 @@
50295065 cNumberSlider fogField;
50305066 JLabel opacityPowerLabel;
50315067 cNumberSlider opacityPowerField;
5032
- JTree jTree;
5068
+ cTree jTree;
50335069 //ObjectUI parent;
50345070
50355071 cNumberSlider normalpushField;
cButton.java
....@@ -12,7 +12,7 @@
1212 {
1313 super(name);
1414
15
- setMargin(new java.awt.Insets(1, 1, 1, 1));
15
+ setMargin(new java.awt.Insets(1, -8, 1, -8));
1616
1717 if (border)
1818 setBorder(new javax.swing.border.EtchedBorder());
....@@ -26,7 +26,7 @@
2626 {
2727 super(icon);
2828
29
- setMargin(new java.awt.Insets(1, 1, 1, 1));
29
+ setMargin(new java.awt.Insets(-1, -8, -1, -8));
3030
3131 //result = new JButton( icon );
3232 //result.setBorderPainted( false );
cFileSystemPane.java
....@@ -14,7 +14,7 @@
1414 //DragSourceListener,
1515 DropTargetListener
1616 {
17
- cTree jTree = new cTree(null);
17
+ cTree jTree = new cTree();
1818 iCallBack owner;
1919
2020 JButton refreshButton;
cToggleButton.java
....@@ -0,0 +1,41 @@
1
+import java.awt.Color;
2
+import javax.swing.ImageIcon;
3
+import javax.swing.border.EtchedBorder;
4
+
5
+public class cToggleButton extends javax.swing.JToggleButton
6
+{
7
+ cToggleButton(String name, boolean enabled)
8
+ {
9
+ super(name, enabled);
10
+
11
+ //setBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0));
12
+ setBorder(new javax.swing.border.EtchedBorder(8));
13
+ }
14
+
15
+ cToggleButton(ImageIcon icon, boolean enabled)
16
+ {
17
+ super("", enabled);
18
+
19
+ this.image = icon.getImage();
20
+ iconWidth = icon.getIconWidth();
21
+
22
+ //setBorder(new javax.swing.border.EmptyBorder(8, 0, 8, 24)); // top, left, bottom, right
23
+ setBorder(new javax.swing.border.EtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.BLACK));
24
+ }
25
+
26
+ private java.awt.Image image;
27
+ private int iconWidth;
28
+
29
+ @Override
30
+ protected void paintComponent(java.awt.Graphics g)
31
+ {
32
+ super.paintComponent(g);
33
+ if (image != null)
34
+ {
35
+ //if (getWidth() > image.getWidth(null) + 8)
36
+ {
37
+ g.drawImage(image, this.getWidth()/2 - 12, this.getHeight()/2 - 12, this);
38
+ }
39
+ }
40
+ }
41
+}
cTree.java
....@@ -2,17 +2,29 @@
22 /**/
33 import java.awt.*;
44 import java.awt.dnd.*;
5
-import javax.swing.JTree;
6
-import javax.swing.tree.TreeModel;
5
+import javax.swing.*;
6
+import javax.swing.tree.*;
7
+import java.awt.event.*;
78
89 class cTree extends JTree implements Autoscroll //, DragGestureListener
910 {
11
+ JPopupMenu popup = new JPopupMenu();
1012
11
- public cTree(TreeModel newModel)
13
+ public cTree() // TreeModel newModel)
1214 {
13
- super(newModel);
14
-
15
+ //super(newModel);
16
+
1517 //setRootVisible(false);
18
+
19
+ addMouseListener(new MouseAdapter()
20
+ {
21
+ public void mousePressed(MouseEvent e)
22
+ {
23
+ if (e.isPopupTrigger()) {
24
+ popup.show((JComponent) e.getSource(), e.getX(), e.getY());
25
+ }
26
+ }
27
+ });
1628 }
1729
1830 /*
....@@ -46,8 +58,17 @@
4658 Rectangle inner = getParent().getBounds();
4759 return new Insets(inner.y - outer.y + margin, inner.x - outer.x + margin, outer.height - inner.height - inner.y + outer.y + margin, outer.width - inner.width - inner.x + outer.x + margin);
4860 }
49
-
50
- // Use this method if you want to see the boundaries of the
61
+//@Override
62
+//public void mouseClicked(java.awt.event.MouseEvent e) {
63
+//
64
+// if (SwingUtilities.isRightMouseButton(e)) {
65
+//
66
+// int row = getClosestRowForLocation(e.getX(), e.getY());
67
+// setSelectionRow(row);
68
+// popupMenu.show(e.getComponent(), e.getX(), e.getY());
69
+// }
70
+//}
71
+// Use this method if you want to see the boundaries of the
5172 // autoscroll active region
5273
5374 /* bug
....@@ -62,4 +83,3 @@
6283 /**/
6384 }
6485 /**/
65
-
icons/box.png
Binary files differ
icons/close-icon.png
Binary files differ
icons/cone.png
Binary files differ
icons/flash-light.png
Binary files differ
icons/grid.png
Binary files differ
icons/overlay.png
Binary files differ
icons/particles.png
Binary files differ
icons/sphere.png
Binary files differ
icons/super.png
Binary files differ
icons/torus.png
Binary files differ
icons/write.png
Binary files differ