Normand Briere
2019-05-05 623dc0fa8cbd9473830a1786f6d49fa808a09439
GroupEditor.java
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -491,7 +491,7 @@
491491 liveCB.setToolTipText("Enabled animation");
492492 liveCB.addItemListener(this);
493493
494
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
494
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495495 oneStepButton.setToolTipText("Animate one step forward");
496496 oneStepButton.addActionListener(this);
497497
....@@ -503,7 +503,7 @@
503503 trackCB.setToolTipText("Enable tracking");
504504 trackCB.addItemListener(this);
505505
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
506
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
507507 screenfitButton.setToolTipText("Screen fit");
508508 screenfitButton.addActionListener(this);
509509
....@@ -512,39 +512,39 @@
512512
513513 if (Globals.ADVANCED)
514514 {
515
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
515
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516516 snapobjectButton.addActionListener(this);
517517 snapobjectButton.setToolTipText("Snap Object");
518518 }
519519
520
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521521 flashSelectionButton.setToolTipText("Show selection");
522522 flashSelectionButton.addActionListener(this);
523523
524524 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525525
526
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
526
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527527 twoButton.setToolTipText("Show center view only");
528528 twoButton.addActionListener(this);
529
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
529
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530530 fourButton.addActionListener(this);
531531 fourButton.setToolTipText("Show left panel only");
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
532
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533533 sixButton.setToolTipText("2-column layout left");
534534 sixButton.addActionListener(this);
535
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
535
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536536 threeButton.setToolTipText("2-column layout right");
537537 threeButton.addActionListener(this);
538
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
538
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
539539 sevenButton.setToolTipText("3-column layout");
540540 sevenButton.addActionListener(this);
541541 //
542542
543
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544544 rootButton.setToolTipText("Edit selection in new tab");
545545 rootButton.addActionListener(this);
546546
547
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
547
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
548548 closeButton.setToolTipText("Close tab");
549549 closeButton.addActionListener(this);
550550 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -552,11 +552,11 @@
552552
553553 cGridBag commandsPanel = new cGridBag();
554554
555
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
555
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
556556 editButton.setToolTipText("Edit selection");
557557 editButton.addActionListener(this);
558558
559
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
559
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
560560 uneditButton.setToolTipText("Unedit selection");
561561 uneditButton.addActionListener(this);
562562
....@@ -564,11 +564,11 @@
564564 allParamsButton.setToolTipText("Edit all params");
565565 allParamsButton.addActionListener(this);
566566
567
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
567
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
568568 clearPanelButton.setToolTipText("Clear edit panel");
569569 clearPanelButton.addActionListener(this);
570570
571
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
571
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
572572 unselectButton.setToolTipText("Unselect");
573573 unselectButton.addActionListener(this);
574574
....@@ -940,7 +940,9 @@
940940 // objEditor.DropFile((java.io.File[]) object, true);
941941 // return;
942942 // }
943
- if (string.charAt(0) == '/')
943
+
944
+ // File path for Mac and Windows
945
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
944946 {
945947 // file(s)
946948 String[] names = string.split("\n");
....@@ -967,7 +969,7 @@
967969
968970 flashIt = false;
969971 CameraPane pane = (CameraPane) target;
970
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
972
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
971973 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
972974
973975 if (group.selection.size() == 1)
....@@ -1540,9 +1542,9 @@
15401542
15411543 void Overwrite(int mask)
15421544 {
1543
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1545
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15441546 {
1545
- Object3D content = GrafreeD.clipboard.get(0);
1547
+ Object3D content = Grafreed.clipboard.get(0);
15461548
15471549 if (content instanceof cGroup && ((cGroup)content).transientlink )
15481550 content = ((cGroup)content).get(0);
....@@ -1890,7 +1892,7 @@
18901892 if (source == invariantsItem)
18911893 {
18921894 System.out.println("Invariants:");
1893
- GrafreeD.grafreeD.universe.invariants();
1895
+ Grafreed.grafreeD.universe.invariants();
18941896 } else
18951897 if (source == memoryItem)
18961898 {
....@@ -1965,10 +1967,10 @@
19651967 } else
19661968 if (source == duplicateItem)
19671969 {
1968
- Object3D keep = GrafreeD.clipboard;
1970
+ Object3D keep = Grafreed.clipboard;
19691971 loadClipboard(false);
19701972 paste(false);
1971
- GrafreeD.clipboard = keep;
1973
+ Grafreed.clipboard = keep;
19721974 } else
19731975 if (source == cloneItem)
19741976 {
....@@ -2188,9 +2190,9 @@
21882190 // group.selection.get(0).setMasterThis(content); // should be identity
21892191 // refreshContents();
21902192 // }
2191
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2193
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21922194 {
2193
- Object3D content = GrafreeD.clipboard.get(0);
2195
+ Object3D content = Grafreed.clipboard.get(0);
21942196
21952197 if (content instanceof cGroup && ((cGroup)content).transientlink )
21962198 content = ((cGroup)content).get(0);
....@@ -2240,9 +2242,9 @@
22402242 } else
22412243 if (source == setMasterItem)
22422244 {
2243
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2245
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22442246 {
2245
- Object3D content = GrafreeD.clipboard.get(0);
2247
+ Object3D content = Grafreed.clipboard.get(0);
22462248
22472249 if (content instanceof cGroup && ((cGroup)content).transientlink )
22482250 content = ((cGroup)content).get(0);
....@@ -2255,9 +2257,9 @@
22552257 {
22562258 if (group.selection.size() == 1)
22572259 {
2258
- if (GrafreeD.clipboard.size() == 1)
2260
+ if (Grafreed.clipboard.size() == 1)
22592261 {
2260
- Object3D content = GrafreeD.clipboard.get(0);
2262
+ Object3D content = Grafreed.clipboard.get(0);
22612263
22622264 if (content instanceof cGroup && ((cGroup)content).transientlink )
22632265 content = ((cGroup)content).get(0);
....@@ -3336,9 +3338,9 @@
33363338 obj = (Object3D)e.nextElement();
33373339
33383340 System.out.println("Object is: " + obj);
3339
- GrafreeD.AnalyzeObject(obj);
3341
+ Grafreed.AnalyzeObject(obj);
33403342 System.out.println("Boundary rep: " + obj.bRep);
3341
- GrafreeD.AnalyzeObject(obj.bRep);
3343
+ Grafreed.AnalyzeObject(obj.bRep);
33423344
33433345 // System.err.println((size/1024) + " KB is the size of " + obj);
33443346 }
....@@ -3552,8 +3554,8 @@
35523554
35533555 void ParseVertices()
35543556 {
3555
- boolean epsequal = GrafreeD.epsequal;
3556
- GrafreeD.epsequal = true;
3557
+ boolean epsequal = Grafreed.epsequal;
3558
+ Grafreed.epsequal = true;
35573559
35583560 for (int i=0; i<group.selection.size(); i++)
35593561 {
....@@ -3578,7 +3580,7 @@
35783580 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35793581 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35803582
3581
- g.add(GrafreeD.clipboard);
3583
+ g.add(Grafreed.clipboard);
35823584
35833585 buffer.add(g);
35843586 }
....@@ -3593,7 +3595,7 @@
35933595 makeSomething(buffer, i==group.selection.size()-1);
35943596 }
35953597
3596
- GrafreeD.epsequal = epsequal;
3598
+ Grafreed.epsequal = epsequal;
35973599
35983600 refreshContents();
35993601 }
....@@ -3743,7 +3745,7 @@
37433745 return;
37443746
37453747 Object3D poses = group.selection.get(0);
3746
- Object3D ref = GrafreeD.clipboard.get(0);
3748
+ Object3D ref = Grafreed.clipboard.get(0);
37473749
37483750 Object3D newgroup = new Object3D("Po:" + poses.name);
37493751
....@@ -3937,9 +3939,9 @@
39373939
39383940 void ClipMesh()
39393941 {
3940
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3942
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39413943 {
3942
- Object3D content = GrafreeD.clipboard.get(0);
3944
+ Object3D content = Grafreed.clipboard.get(0);
39433945
39443946 if (content instanceof cGroup && ((cGroup)content).transientlink )
39453947 content = ((cGroup)content).get(0);
....@@ -3948,7 +3950,7 @@
39483950 // {
39493951 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39503952 // }
3951
- group.selection.ClipMesh(GrafreeD.clipboard);
3953
+ group.selection.ClipMesh(Grafreed.clipboard);
39523954 }
39533955 // group.selection.ClipMesh(GrafreeD.clipboard);
39543956 System.out.println("DONE.");
....@@ -4288,12 +4290,12 @@
42884290 {
42894291 if (group.selection.isEmpty())
42904292 return;
4291
- GrafreeD.clipboardIsTempGroup = false;
4293
+ Grafreed.clipboardIsTempGroup = false;
42924294 Composite tGroup = null;
42934295 if (group.selection.size() > 0) // 1)
42944296 {
42954297 tGroup = new cGroup();
4296
- GrafreeD.clipboardIsTempGroup = true;
4298
+ Grafreed.clipboardIsTempGroup = true;
42974299 }
42984300
42994301 if (cut)
....@@ -4333,16 +4335,16 @@
43334335 //System.out.println("cut " + child);
43344336 //System.out.println("parent = " + child.parent);
43354337 // tmp.addChild(child);
4336
- if (GrafreeD.clipboardIsTempGroup)
4338
+ if (Grafreed.clipboardIsTempGroup)
43374339 tGroup.add/*Child*/(tmp);
43384340 else
4339
- GrafreeD.clipboard = tmp;
4341
+ Grafreed.clipboard = tmp;
43404342 }
43414343 else
4342
- if (GrafreeD.clipboardIsTempGroup)
4344
+ if (Grafreed.clipboardIsTempGroup)
43434345 tGroup.add/*Child*/(child);
43444346 else
4345
- GrafreeD.clipboard = child;
4347
+ Grafreed.clipboard = child;
43464348 }
43474349
43484350 //ResetModel();
....@@ -4374,21 +4376,21 @@
43744376 //System.out.println("cut " + elem);
43754377 //System.out.println("parent = " + elem.parent);
43764378 // tmp.addChild(elem);
4377
- if (GrafreeD.clipboardIsTempGroup)
4379
+ if (Grafreed.clipboardIsTempGroup)
43784380 tGroup.add/*Child*/(tmp);
43794381 else
4380
- GrafreeD.clipboard = tmp;
4382
+ Grafreed.clipboard = tmp;
43814383 }
43824384 else
4383
- if (GrafreeD.clipboardIsTempGroup)
4385
+ if (Grafreed.clipboardIsTempGroup)
43844386 tGroup.add/*Child*/(child);
43854387 else
4386
- GrafreeD.clipboard = child;
4388
+ Grafreed.clipboard = child;
43874389 }
43884390
43894391 }
4390
- if (GrafreeD.clipboardIsTempGroup)
4391
- GrafreeD.clipboard = tGroup;
4392
+ if (Grafreed.clipboardIsTempGroup)
4393
+ Grafreed.clipboard = tGroup;
43924394 if (cut)
43934395 {
43944396 ResetModel();
....@@ -4402,7 +4404,7 @@
44024404 // return;
44034405 boolean first = true;
44044406
4405
- if (GrafreeD.clipboardIsTempGroup)
4407
+ if (Grafreed.clipboardIsTempGroup)
44064408 {
44074409 Composite temp;
44084410
....@@ -4413,7 +4415,7 @@
44134415 temp = (Composite)Applet3D.clipboard.deepCopy();
44144416 */
44154417 Object3D elem;
4416
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4418
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44174419 {
44184420 Object3D child = (Object3D)e.nextElement();
44194421
....@@ -4447,14 +4449,14 @@
44474449 //Object3D cb = Applet3D.clipboard;
44484450 //temp.addChild(cb);
44494451 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4450
- assert(GrafreeD.clipboard.parent == null);
4451
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4452
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4453
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4454
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4452
+ assert(Grafreed.clipboard.parent == null);
4453
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4454
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4455
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4456
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44554457 else
4456
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4457
- GrafreeD.clipboard.get(0).parent = keepparent;
4458
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4459
+ Grafreed.clipboard.get(0).parent = keepparent;
44584460 }
44594461
44604462 ResetModel();
....@@ -4503,9 +4505,9 @@
45034505 {
45044506 boolean first = true;
45054507
4506
- if (GrafreeD.clipboardIsTempGroup)
4508
+ if (Grafreed.clipboardIsTempGroup)
45074509 {
4508
- Composite temp = (Composite)GrafreeD.clipboard;
4510
+ Composite temp = (Composite)Grafreed.clipboard;
45094511 Object3D copy;
45104512 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45114513 {
....@@ -4515,7 +4517,7 @@
45154517 }
45164518 } else
45174519 {
4518
- linkSomething(GrafreeD.clipboard); //.get(0));
4520
+ linkSomething(Grafreed.clipboard); //.get(0));
45194521 }
45204522 }
45214523 }
....@@ -4960,7 +4962,7 @@
49604962
49614963 void ImportVRMLX3D()
49624964 {
4963
- if (GrafreeD.standAlone)
4965
+ if (Grafreed.standAlone)
49644966 {
49654967 /**/
49664968 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4977,7 +4979,7 @@
49774979
49784980 String GetFile(String dialogName)
49794981 {
4980
- if (GrafreeD.standAlone)
4982
+ if (Grafreed.standAlone)
49814983 {
49824984 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49834985 browser.show();