Normand Briere
2019-05-01 b1585b5b2b60c4165be400636c787fae24428c6a
Fix info panel
5 files modified
266 ■■■■ changed files
GrafreeD.java 2 ●●● patch | view | raw | blame | history
GroupEditor.java 116 ●●●● patch | view | raw | blame | history
Mocap.java 2 ●●● patch | view | raw | blame | history
MocapEditor.java 21 ●●●● patch | view | raw | blame | history
ObjEditor.java 125 ●●●●● patch | view | raw | blame | history
GrafreeD.java
....@@ -15,7 +15,7 @@
1515 //import com.jamonapi.*;
1616 public class GrafreeD extends Applet implements ActionListener
1717 {
18
- static boolean NIMBUSLAF = false;
18
+ static boolean NIMBUSLAF = true;
1919
2020 static int RENDERME = 0;
2121
GroupEditor.java
....@@ -436,11 +436,11 @@
436436 */
437437 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
438438
439
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440440 liveCB.setToolTipText("Enabled animation");
441441 liveCB.addItemListener(this);
442442
443
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);
443
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
444444 trackCB.setToolTipText("Enable tracking");
445445 trackCB.addItemListener(this);
446446
....@@ -485,47 +485,42 @@
485485 //
486486
487487 oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
488
- rootButton.setToolTipText("Edit object in new tab");
488
+ rootButton.setToolTipText("Edit selection in new tab");
489489 rootButton.addActionListener(this);
490
- oe.aConstraints.gridx += 1;
491
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
490
+
491
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
492492 closeButton.setToolTipText("Close tab");
493493 closeButton.addActionListener(this);
494494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
495495 //clearButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497496
498
- oe.aConstraints.gridx = 1; //
499
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
497
+ cGridBag commandsPanel = new cGridBag();
498
+
499
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
500
+ editButton.setToolTipText("Edit selection");
500501 editButton.addActionListener(this);
501
- oe.aConstraints.gridx += 1;
502
- oe.aConstraints.weighty = 0;
503
- oe.aConstraints.gridwidth = 1;
504502
505
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
503
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
+ uneditButton.setToolTipText("Unedit selection");
506505 uneditButton.addActionListener(this);
507506
508
- oe.aConstraints.gridx += 1;
509
- oe.aConstraints.weighty = 0;
510
- oe.aConstraints.gridwidth = 1;
511
-
512
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
507
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
508
+ clearPanelButton.setToolTipText("Clear edit panel");
513509 clearPanelButton.addActionListener(this);
514510
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518
-
519
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
511
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
512
+ allParamsButton.setToolTipText("All params??");
520513 allParamsButton.addActionListener(this);
521514
522
- oe.aConstraints.gridx += 1;
523
- oe.aConstraints.weighty = 0;
524
- oe.aConstraints.gridwidth = 1;
525
-
526
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
515
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
516
+ unselectButton.setToolTipText("Unselect");
527517 unselectButton.addActionListener(this);
528518
519
+ commandsPanel.preferredHeight = 1;
520
+
521
+ oe.treePanel.add(commandsPanel);
522
+ oe.treePanel.Return();
523
+
529524 // oe.aConstraints.gridx += 1;
530525 // oe.aConstraints.weighty = 0;
531526 // oe.aConstraints.gridwidth = 1;
....@@ -537,40 +532,37 @@
537532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
538533 // gcButton.addActionListener(this);
539534
540
- oe.aConstraints.gridx = 0;
541
- oe.aConstraints.gridy += 1;
542
-
543
- //ctrlPanel.add(objList = new List(5, true));
544
- oe.aConstraints.gridwidth = 100;
545
- // oe.aConstraints.gridheight = 100;
546
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
547
- oe.aConstraints.gridheight = 1;
548
- oe.aConstraints.weighty = 0.5;
549
- oe.aConstraints.gridx = 0;
550
- JScrollPane jSP;
535
+ cGridBag jSPPanel = new cGridBag();
536
+
537
+ JScrollPane jSP;
551538 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
552
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
539
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
553540 ResetModel();
554
- oe.aConstraints.weighty = 0.5;
555
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
556
- oe.aConstraints.gridy += 1;
557
- oe.aConstraints.gridwidth = 1;
541
+
542
+ oe.treePanel.add(jSPPanel);
543
+ oe.treePanel.Return();
558544
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 2;
561
-
562
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
545
+ cGridBag copyOptionsPanel = new cGridBag();
546
+
547
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
548
+ colorCB.setToolTipText("Copy color when dropped");
563549 colorCB.addItemListener(this);
564
- oe.aConstraints.gridx += 2;
565
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
550
+
551
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
552
+ materialCB.setToolTipText("Copy material when dropped");
566553 materialCB.addItemListener(this);
567
- oe.aConstraints.gridx += 2;
568
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
554
+
555
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
556
+ textureCB.setToolTipText("Copy texture when dropped");
569557 textureCB.addItemListener(this);
570558
571
- oe.aConstraints.gridx = 0;
572
- oe.aConstraints.gridy += 1;
559
+ copyOptionsPanel.preferredHeight = 1;
560
+ oe.treePanel.add(copyOptionsPanel);
561
+ oe.treePanel.Return();
573562
563
+// mainPanel.setDividerLocation(0.5); //1.0);
564
+// mainPanel.setResizeWeight(0.5);
565
+
574566 //jList.addListSelectionListener(this);
575567 oe.jTree.addTreeSelectionListener(this);
576568 //jTree.setRootVisible(false);
....@@ -664,6 +656,12 @@
664656 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
665657 lookAtCB.setToolTipText("Look-at target");
666658 lookAtCB.addItemListener(this);
659
+
660
+ cGridBag fill = new cGridBag();
661
+
662
+ fill.preferredHeight = 200;
663
+
664
+ panel.add(fill);
667665
668666 }
669667
....@@ -4113,12 +4111,12 @@
41134111 System.err.println("info : " + child.GetPath());
41144112 }
41154113 }
4116
- else
4117
- {
4118
- objEditor.SetMaterial(group); // .GetMaterial());
4119
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4120
- System.err.println("info : " + group.GetPath());
4121
- }
4114
+// else
4115
+// {
4116
+// objEditor.SetMaterial(group); // .GetMaterial());
4117
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4118
+// System.err.println("info : " + group.GetPath());
4119
+// }
41224120
41234121 objEditor.SetText(); // jan 2014
41244122
Mocap.java
....@@ -2267,7 +2267,7 @@
22672267 }
22682268
22692269 if (!smoothed)
2270
- for (int i=0; --i>=0;)
2270
+ for (int i=1; --i>=0;)
22712271 SmoothAnimData(); // much reduces shakiness
22722272
22732273 smoothed = true;
MocapEditor.java
....@@ -9,6 +9,9 @@
99 class MocapEditor extends ObjEditor implements //ItemListener,
1010 ChangeListener, ObjectUI, ActionListener
1111 {
12
+ cGridBag firstPanel;
13
+ cGridBag framePanel;
14
+ cGridBag lastPanel;
1215 MocapEditor(Mocap inBP, GroupEditor callee)
1316 {
1417 super(inBP,callee);
....@@ -69,12 +72,15 @@
6972 oe.aConstraints.gridwidth = 1;
7073 */
7174 super.SetupUI2(oe);
75
+ framePanel = AddSlider(oe.ctrlPanel, "Frame:", 0, mocap.bvh.animation.getNumFrames()-1, mocap.frame);
7276
73
- frameField = (cNumberSlider)AddSlider(oe.ctrlPanel, "Frame:", 0, mocap.bvh.animation.getNumFrames()-1, mocap.frame).getComponent(1);
77
+ frameField = (cNumberSlider)framePanel.getComponent(1);
7478 oe.ctrlPanel.Return();
75
- firstField = (cNumberSlider)AddSlider(oe.ctrlPanel, "First:", 0, mocap.bvh.animation.getNumFrames()-1, mocap.firstframe).getComponent(1);
79
+ firstPanel = AddSlider(oe.ctrlPanel, "First:", 0, mocap.bvh.animation.getNumFrames()-1, mocap.firstframe);
80
+ firstField = (cNumberSlider)firstPanel.getComponent(1);
7681 oe.ctrlPanel.Return();
77
- lastField = (cNumberSlider)AddSlider(oe.ctrlPanel, "Last:", 0, mocap.bvh.animation.getNumFrames()-1, mocap.lastframe).getComponent(1);
82
+ lastPanel = AddSlider(oe.ctrlPanel, "Last:", 0, mocap.bvh.animation.getNumFrames()-1, mocap.lastframe);
83
+ lastField = (cNumberSlider)lastPanel.getComponent(1);
7884 oe.ctrlPanel.Return();
7985
8086 // oe.aConstraints.gridx = 0;
....@@ -241,15 +247,18 @@
241247 {
242248 ObjEditor oe = objEditor;
243249
244
- Remove(frameField);
245
- Remove(firstField);
246
- Remove(lastField);
250
+// Remove(frameField);
251
+// Remove(firstField);
252
+// Remove(lastField);
247253 // frameField.removeChangeListener(this);
248254 // oe.ctrlPanel.remove(frameField);
249255 // oe.ctrlPanel.remove(frameLabel);
250256 // oe.ctrlPanel.remove(speedField);
251257 // oe.ctrlPanel.remove(speedLabel);
252258 //oe.ctrlPanel.repaint();
259
+ oe.ctrlPanel.remove(framePanel);
260
+ oe.ctrlPanel.remove(firstPanel);
261
+ oe.ctrlPanel.remove(lastPanel);
253262
254263 super.closeUI();
255264 }
ObjEditor.java
....@@ -359,7 +359,7 @@
359359 objectPanel = new JTabbedPane();
360360 toolbarPanel = new JPanel();
361361 toolbarPanel.setName("Toolbar");
362
- treePanel = new JPanel();
362
+ treePanel = new cGridBag();
363363 treePanel.setName("Tree");
364364 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
365365 ctrlPanel.setName("Edit");
....@@ -367,13 +367,15 @@
367367 materialPanel.setName("Material");
368368 /*JTextPane*/
369369 infoarea = createTextPane();
370
+ doc = infoarea.getStyledDocument();
371
+
370372 infoarea.setEditable(true);
371373 SetText();
372374 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
373375 // infoarea.setOpaque(false);
374376 // //infoarea.setForeground(textcolor);
375
- infoarea.setLineWrap(true);
376
- infoarea.setWrapStyleWord(true);
377
+// TEXTAREA infoarea.setLineWrap(true);
378
+// TEXTAREA infoarea.setWrapStyleWord(true);
377379 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
378380 infoPanel.setPreferredSize(new Dimension(50, 200));
379381 infoPanel.setName("Info");
....@@ -384,14 +386,14 @@
384386 mainPanel.setName("Main");
385387 mainPanel.setContinuousLayout(true);
386388 mainPanel.setOneTouchExpandable(true);
387
- mainPanel.setDividerLocation(1.0);
388389 mainPanel.setDividerSize(9);
389
- mainPanel.setResizeWeight(0);
390
+ mainPanel.setDividerLocation(0.5); //1.0);
391
+ mainPanel.setResizeWeight(0.5);
390392
391393 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
392394 //mainPanel.setLayout(new GridBagLayout());
393395 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
394
- treePanel.setLayout(new GridBagLayout());
396
+// treePanel.setLayout(new GridBagLayout());
395397 //ctrlPanel.setLayout(new GridBagLayout());
396398 //materialPanel.setLayout(new GridBagLayout());
397399
....@@ -432,7 +434,7 @@
432434 static String newline = "\n";
433435 protected static final String buttonString = "JButton";
434436 StyledDocument doc;
435
- JTextArea infoarea;
437
+ JTextPane infoarea;
436438
437439 void ClearInfo()
438440 {
....@@ -499,7 +501,10 @@
499501 }
500502
501503 if (full)
502
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
504
+ {
505
+ si.SendInfo(" BBox min: " + minima, "regular");
506
+ si.SendInfo(" BBox max: " + maxima, "regular");
507
+ }
503508
504509 if (sel.bRep != null)
505510 {
....@@ -597,6 +602,9 @@
597602 {
598603 CameraPane.pointflow = (PointFlow) sel;
599604 }
605
+
606
+ si.SendInfo("_____________________", "regular");
607
+ si.SendInfo("", "regular");
600608 }
601609 }
602610
....@@ -628,52 +636,52 @@
628636 cameraView.ToggleFullScreen();
629637 }
630638
631
- private JTextArea createTextPane()
639
+ private JTextPane createTextPane()
632640 {
633
- String[] initString =
634
- {
635
- "This is an editable JTextPane, ", //regular
636
- "another ", //italic
637
- "styled ", //bold
638
- "text ", //small
639
- "component, ", //large
640
- "which supports embedded components..." + newline,//regular
641
- " " + newline, //button
642
- "...and embedded icons..." + newline, //regular
643
- " ", //icon
644
- newline + "JTextPane is a subclass of JEditorPane that "
645
- + "uses a StyledEditorKit and StyledDocument, and provides "
646
- + "cover methods for interacting with those objects."
647
- };
641
+// TEXTAREA String[] initString =
642
+// {
643
+// "This is an editable JTextPane, ", //regular
644
+// "another ", //italic
645
+// "styled ", //bold
646
+// "text ", //small
647
+// "component, ", //large
648
+// "which supports embedded components..." + newline,//regular
649
+// " " + newline, //button
650
+// "...and embedded icons..." + newline, //regular
651
+// " ", //icon
652
+// newline + "JTextPane is a subclass of JEditorPane that "
653
+// + "uses a StyledEditorKit and StyledDocument, and provides "
654
+// + "cover methods for interacting with those objects."
655
+// };
656
+//
657
+// String[] initStyles =
658
+// {
659
+// "regular", "italic", "bold", "small", "large",
660
+// "regular", "button", "regular", "icon",
661
+// "regular"
662
+// };
663
+//
664
+// JTextPane textPane = new JTextPane();
665
+// textPane.setEditable(true);
666
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
667
+// addStylesToDocument(doc);
668
+//
669
+// try
670
+// {
671
+// for (int j = 0; j < 2; j++)
672
+// {
673
+// for (int i = 0; i < initString.length; i++)
674
+// {
675
+// doc.insertString(doc.getLength(), initString[i],
676
+// doc.getStyle(initStyles[i]));
677
+// }
678
+// }
679
+// } catch (BadLocationException ble)
680
+// {
681
+// System.err.println("Couldn't insert initial text into text pane.");
682
+// }
648683
649
- String[] initStyles =
650
- {
651
- "regular", "italic", "bold", "small", "large",
652
- "regular", "button", "regular", "icon",
653
- "regular"
654
- };
655
-
656
- JTextPane textPane = new JTextPane();
657
- textPane.setEditable(true);
658
- /*StyledDocument*/ doc = textPane.getStyledDocument();
659
- addStylesToDocument(doc);
660
-
661
- try
662
- {
663
- for (int j = 0; j < 2; j++)
664
- {
665
- for (int i = 0; i < initString.length; i++)
666
- {
667
- doc.insertString(doc.getLength(), initString[i],
668
- doc.getStyle(initStyles[i]));
669
- }
670
- }
671
- } catch (BadLocationException ble)
672
- {
673
- System.err.println("Couldn't insert initial text into text pane.");
674
- }
675
-
676
- return new JTextArea(); // textPane;
684
+ return new JTextPane(); // textPane;
677685 }
678686
679687 protected void addStylesToDocument(StyledDocument doc)
....@@ -1436,17 +1444,22 @@
14361444
14371445 cGridBag editBar = new cGridBag().setVertical(false);
14381446
1439
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1447
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1448
+ createMaterialButton.setToolTipText("Create material");
14401449
14411450 /*
14421451 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14431452 */
14441453
1445
- editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints);
1446
- editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints);
1454
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1455
+ clearMaterialButton.setToolTipText("Clear material");
1456
+
1457
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
14471458 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
14481459 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
14491460
1461
+ editBar.preferredHeight = 15;
1462
+
14501463 panel.add(editBar);
14511464
14521465 /**/
....@@ -4425,7 +4438,7 @@
44254438 JSplitPane mainPanel;
44264439 JScrollPane scrollpane;
44274440 JPanel toolbarPanel;
4428
- JPanel treePanel;
4441
+ cGridBag treePanel;
44294442 JPanel radioPanel;
44304443 ButtonGroup buttonGroup;
44314444 cGridBag ctrlPanel;