Normand Briere
2019-05-01 d1e1417edc8a6ccf195b6da3270f22234dda61e4
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)
....@@ -943,10 +951,6 @@
943951
944952 void SetupUI2(ObjEditor oe)
945953 {
946
-// oe.aConstraints.weightx = 0;
947
-// oe.aConstraints.weighty = 0;
948
-// oe.aConstraints.gridx = 0;
949
-// oe.aConstraints.gridy = 0;
950954 //SetupName(oe);
951955
952956 namePanel = new cGridBag();
....@@ -963,7 +967,8 @@
963967 setupPanel = new cGridBag().setVertical(false);
964968
965969 liveCB = AddCheckBox(setupPanel, "Live", copy.live);
966
- link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
970
+ if (Globals.ADVANCED)
971
+ link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master);
967972 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
968973 // Return();
969974 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
....@@ -1436,17 +1441,22 @@
14361441
14371442 cGridBag editBar = new cGridBag().setVertical(false);
14381443
1439
- editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);
1444
+ editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1445
+ createMaterialButton.setToolTipText("Create material");
14401446
14411447 /*
14421448 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
14431449 */
14441450
1445
- editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints);
1446
- editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints);
1451
+ editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints);
1452
+ clearMaterialButton.setToolTipText("Clear material");
1453
+
1454
+ editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints);
14471455 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
14481456 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
14491457
1458
+ editBar.preferredHeight = 15;
1459
+
14501460 panel.add(editBar);
14511461
14521462 /**/
....@@ -3192,7 +3202,7 @@
31923202 if (!Globals.ANIMATION)
31933203 {
31943204 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
3195
- browser.show();
3205
+ browser.setVisible(true);
31963206 String filename = browser.getFile();
31973207 if (filename != null && filename.length() > 0)
31983208 {
....@@ -4425,7 +4435,7 @@
44254435 JSplitPane mainPanel;
44264436 JScrollPane scrollpane;
44274437 JPanel toolbarPanel;
4428
- JPanel treePanel;
4438
+ cGridBag treePanel;
44294439 JPanel radioPanel;
44304440 ButtonGroup buttonGroup;
44314441 cGridBag ctrlPanel;