Normand Briere
2019-05-02 a76491b66a2e304d9ae27a162f407b98c70fbafa
ObjEditor.java
....@@ -143,6 +143,8 @@
143143 //nameField.removeActionListener(this);
144144 // objEditor.ctrlPanel.remove(nameField);
145145
146
+ objEditor.ctrlPanel.remove(namePanel);
147
+
146148 if (!GroupEditor.allparams)
147149 return;
148150
....@@ -165,7 +167,6 @@
165167 // objEditor.ctrlPanel.remove(fasterButton);
166168 // objEditor.ctrlPanel.remove(remarkButton);
167169
168
- objEditor.ctrlPanel.remove(namePanel);
169170 objEditor.ctrlPanel.remove(setupPanel);
170171 objEditor.ctrlPanel.remove(commandsPanel);
171172 objEditor.ctrlPanel.remove(pushPanel);
....@@ -359,7 +360,7 @@
359360 objectPanel = new JTabbedPane();
360361 toolbarPanel = new JPanel();
361362 toolbarPanel.setName("Toolbar");
362
- treePanel = new JPanel();
363
+ treePanel = new cGridBag();
363364 treePanel.setName("Tree");
364365 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
365366 ctrlPanel.setName("Edit");
....@@ -367,13 +368,15 @@
367368 materialPanel.setName("Material");
368369 /*JTextPane*/
369370 infoarea = createTextPane();
371
+ doc = infoarea.getStyledDocument();
372
+
370373 infoarea.setEditable(true);
371374 SetText();
372375 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
373376 // infoarea.setOpaque(false);
374377 // //infoarea.setForeground(textcolor);
375
- infoarea.setLineWrap(true);
376
- infoarea.setWrapStyleWord(true);
378
+// TEXTAREA infoarea.setLineWrap(true);
379
+// TEXTAREA infoarea.setWrapStyleWord(true);
377380 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
378381 infoPanel.setPreferredSize(new Dimension(50, 200));
379382 infoPanel.setName("Info");
....@@ -384,14 +387,14 @@
384387 mainPanel.setName("Main");
385388 mainPanel.setContinuousLayout(true);
386389 mainPanel.setOneTouchExpandable(true);
387
- mainPanel.setDividerLocation(1.0);
388390 mainPanel.setDividerSize(9);
389
- mainPanel.setResizeWeight(0);
391
+ mainPanel.setDividerLocation(0.5); //1.0);
392
+ mainPanel.setResizeWeight(0.5);
390393
391394 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
392395 //mainPanel.setLayout(new GridBagLayout());
393396 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
394
- treePanel.setLayout(new GridBagLayout());
397
+// treePanel.setLayout(new GridBagLayout());
395398 //ctrlPanel.setLayout(new GridBagLayout());
396399 //materialPanel.setLayout(new GridBagLayout());
397400
....@@ -432,7 +435,7 @@
432435 static String newline = "\n";
433436 protected static final String buttonString = "JButton";
434437 StyledDocument doc;
435
- JTextArea infoarea;
438
+ JTextPane infoarea;
436439
437440 void ClearInfo()
438441 {
....@@ -499,7 +502,10 @@
499502 }
500503
501504 if (full)
502
- si.SendInfo(" BBox: " + minima + " - " + maxima, "regular");
505
+ {
506
+ si.SendInfo(" BBox min: " + minima, "regular");
507
+ si.SendInfo(" BBox max: " + maxima, "regular");
508
+ }
503509
504510 if (sel.bRep != null)
505511 {
....@@ -597,6 +603,9 @@
597603 {
598604 CameraPane.pointflow = (PointFlow) sel;
599605 }
606
+
607
+ si.SendInfo("_____________________", "regular");
608
+ si.SendInfo("", "regular");
600609 }
601610 }
602611
....@@ -628,52 +637,52 @@
628637 cameraView.ToggleFullScreen();
629638 }
630639
631
- private JTextArea createTextPane()
640
+ private JTextPane createTextPane()
632641 {
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
- };
642
+// TEXTAREA String[] initString =
643
+// {
644
+// "This is an editable JTextPane, ", //regular
645
+// "another ", //italic
646
+// "styled ", //bold
647
+// "text ", //small
648
+// "component, ", //large
649
+// "which supports embedded components..." + newline,//regular
650
+// " " + newline, //button
651
+// "...and embedded icons..." + newline, //regular
652
+// " ", //icon
653
+// newline + "JTextPane is a subclass of JEditorPane that "
654
+// + "uses a StyledEditorKit and StyledDocument, and provides "
655
+// + "cover methods for interacting with those objects."
656
+// };
657
+//
658
+// String[] initStyles =
659
+// {
660
+// "regular", "italic", "bold", "small", "large",
661
+// "regular", "button", "regular", "icon",
662
+// "regular"
663
+// };
664
+//
665
+// JTextPane textPane = new JTextPane();
666
+// textPane.setEditable(true);
667
+// /*StyledDocument*/ doc = textPane.getStyledDocument();
668
+// addStylesToDocument(doc);
669
+//
670
+// try
671
+// {
672
+// for (int j = 0; j < 2; j++)
673
+// {
674
+// for (int i = 0; i < initString.length; i++)
675
+// {
676
+// doc.insertString(doc.getLength(), initString[i],
677
+// doc.getStyle(initStyles[i]));
678
+// }
679
+// }
680
+// } catch (BadLocationException ble)
681
+// {
682
+// System.err.println("Couldn't insert initial text into text pane.");
683
+// }
648684
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;
685
+ return new JTextPane(); // textPane;
677686 }
678687
679688 protected void addStylesToDocument(StyledDocument doc)
....@@ -943,10 +952,6 @@
943952
944953 void SetupUI2(ObjEditor oe)
945954 {
946
-// oe.aConstraints.weightx = 0;
947
-// oe.aConstraints.weighty = 0;
948
-// oe.aConstraints.gridx = 0;
949
-// oe.aConstraints.gridy = 0;
950955 //SetupName(oe);
951956
952957 namePanel = new cGridBag();
....@@ -963,27 +968,45 @@
963968 setupPanel = new cGridBag().setVertical(false);
964969
965970 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
966
- link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
971
+ liveCB.setToolTipText("Animate object");
967972 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
973
+ hideCB.setToolTipText("Hide object");
968974 // Return();
969975 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
970
- rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind);
971
- randomCB = AddCheckBox(setupPanel, "Rand", copy.random);
976
+ markCB.setToolTipText("Set the animation target transform");
977
+
978
+ rewindCB = AddCheckBox(setupPanel, "Rewind", copy.rewind);
979
+ rewindCB.setToolTipText("Rewind animation");
980
+
981
+ randomCB = AddCheckBox(setupPanel, "Random", copy.random);
982
+ randomCB.setToolTipText("Option for switch node");
972983
984
+ if (Globals.ADVANCED)
985
+ {
986
+ link2masterCB = AddCheckBox(setupPanel, "Support", copy.link2master);
987
+ link2masterCB.setToolTipText("Attach to support");
988
+ speedupCB = AddCheckBox(setupPanel, "Speed", copy.speedup);
989
+ speedupCB.setToolTipText("Option motion capture");
990
+ }
991
+
973992 oe.ctrlPanel.add(setupPanel);
974993 oe.ctrlPanel.Return();
975994
976995 commandsPanel = new cGridBag().setVertical(false);
977996
978997 resetButton = AddButton(commandsPanel, "Reset");
998
+ resetButton.setToolTipText("Jump to frame zero");
979999 stepButton = AddButton(commandsPanel, "Step");
1000
+ stepButton.setToolTipText("Step one frame");
9801001 // resetAllButton = AddButton(oe, "Reset All");
9811002 // stepAllButton = AddButton(oe, "Step All");
982
- speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup);
9831003 // Return();
9841004 slowerButton = AddButton(commandsPanel, "Slow");
1005
+ slowerButton.setToolTipText("Decrease animation speed");
9851006 fasterButton = AddButton(commandsPanel, "Fast");
1007
+ fasterButton.setToolTipText("Increase animation speed");
9861008 remarkButton = AddButton(commandsPanel, "Remark");
1009
+ remarkButton.setToolTipText("Set the current transform as the target");
9871010
9881011 oe.ctrlPanel.add(commandsPanel);
9891012 oe.ctrlPanel.Return();
....@@ -1436,17 +1459,22 @@
14361459
14371460 cGridBag editBar = new cGridBag().setVertical(false);
14381461
1439
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1462
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1463
+ createMaterialButton.setToolTipText("Create material");
14401464
14411465 /*
14421466 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14431467 */
14441468
1445
- editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints);
1446
- editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints);
1469
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1470
+ clearMaterialButton.setToolTipText("Clear material");
1471
+
1472
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
14471473 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
14481474 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
14491475
1476
+ editBar.preferredHeight = 15;
1477
+
14501478 panel.add(editBar);
14511479
14521480 /**/
....@@ -2969,6 +2997,7 @@
29692997 if (event.getSource() == randomCB)
29702998 {
29712999 copy.random ^= true;
3000
+ objEditor.refreshContents();
29723001 return;
29733002 }
29743003 if (event.getSource() == speedupCB)
....@@ -3192,7 +3221,7 @@
31923221 if (!Globals.ANIMATION)
31933222 {
31943223 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3195
- browser.show();
3224
+ browser.setVisible(true);
31963225 String filename = browser.getFile();
31973226 if (filename != null && filename.length() > 0)
31983227 {
....@@ -4425,7 +4454,7 @@
44254454 JSplitPane mainPanel;
44264455 JScrollPane scrollpane;
44274456 JPanel toolbarPanel;
4428
- JPanel treePanel;
4457
+ cGridBag treePanel;
44294458 JPanel radioPanel;
44304459 ButtonGroup buttonGroup;
44314460 cGridBag ctrlPanel;