From 20c1a07b76c39462594aedfedfe6e6adb17cd552 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Wed, 01 May 2019 14:27:01 -0400 Subject: [PATCH] Fix animation and fast mode. --- ObjEditor.java | 127 +++++++++++++++++++++++------------------- 1 files changed, 70 insertions(+), 57 deletions(-) diff --git a/ObjEditor.java b/ObjEditor.java index 98cec4e..177b5d2 100644 --- a/ObjEditor.java +++ b/ObjEditor.java @@ -359,7 +359,7 @@ objectPanel = new JTabbedPane(); toolbarPanel = new JPanel(); toolbarPanel.setName("Toolbar"); - treePanel = new JPanel(); + treePanel = new cGridBag(); treePanel.setName("Tree"); ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); ctrlPanel.setName("Edit"); @@ -367,13 +367,15 @@ materialPanel.setName("Material"); /*JTextPane*/ infoarea = createTextPane(); + doc = infoarea.getStyledDocument(); + infoarea.setEditable(true); SetText(); // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); // infoarea.setOpaque(false); // //infoarea.setForeground(textcolor); - infoarea.setLineWrap(true); - infoarea.setWrapStyleWord(true); +// TEXTAREA infoarea.setLineWrap(true); +// TEXTAREA infoarea.setWrapStyleWord(true); infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); infoPanel.setPreferredSize(new Dimension(50, 200)); infoPanel.setName("Info"); @@ -384,14 +386,14 @@ mainPanel.setName("Main"); mainPanel.setContinuousLayout(true); mainPanel.setOneTouchExpandable(true); - mainPanel.setDividerLocation(1.0); mainPanel.setDividerSize(9); - mainPanel.setResizeWeight(0); + mainPanel.setDividerLocation(0.5); //1.0); + mainPanel.setResizeWeight(0.5); //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); //mainPanel.setLayout(new GridBagLayout()); toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); - treePanel.setLayout(new GridBagLayout()); +// treePanel.setLayout(new GridBagLayout()); //ctrlPanel.setLayout(new GridBagLayout()); //materialPanel.setLayout(new GridBagLayout()); @@ -432,7 +434,7 @@ static String newline = "\n"; protected static final String buttonString = "JButton"; StyledDocument doc; - JTextArea infoarea; + JTextPane infoarea; void ClearInfo() { @@ -499,7 +501,10 @@ } if (full) - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); + { + si.SendInfo(" BBox min: " + minima, "regular"); + si.SendInfo(" BBox max: " + maxima, "regular"); + } if (sel.bRep != null) { @@ -597,6 +602,9 @@ { CameraPane.pointflow = (PointFlow) sel; } + + si.SendInfo("_____________________", "regular"); + si.SendInfo("", "regular"); } } @@ -628,52 +636,52 @@ cameraView.ToggleFullScreen(); } - private JTextArea createTextPane() + private JTextPane createTextPane() { - String[] initString = - { - "This is an editable JTextPane, ", //regular - "another ", //italic - "styled ", //bold - "text ", //small - "component, ", //large - "which supports embedded components..." + newline,//regular - " " + newline, //button - "...and embedded icons..." + newline, //regular - " ", //icon - newline + "JTextPane is a subclass of JEditorPane that " - + "uses a StyledEditorKit and StyledDocument, and provides " - + "cover methods for interacting with those objects." - }; +// TEXTAREA String[] initString = +// { +// "This is an editable JTextPane, ", //regular +// "another ", //italic +// "styled ", //bold +// "text ", //small +// "component, ", //large +// "which supports embedded components..." + newline,//regular +// " " + newline, //button +// "...and embedded icons..." + newline, //regular +// " ", //icon +// newline + "JTextPane is a subclass of JEditorPane that " +// + "uses a StyledEditorKit and StyledDocument, and provides " +// + "cover methods for interacting with those objects." +// }; +// +// String[] initStyles = +// { +// "regular", "italic", "bold", "small", "large", +// "regular", "button", "regular", "icon", +// "regular" +// }; +// +// JTextPane textPane = new JTextPane(); +// textPane.setEditable(true); +// /*StyledDocument*/ doc = textPane.getStyledDocument(); +// addStylesToDocument(doc); +// +// try +// { +// for (int j = 0; j < 2; j++) +// { +// for (int i = 0; i < initString.length; i++) +// { +// doc.insertString(doc.getLength(), initString[i], +// doc.getStyle(initStyles[i])); +// } +// } +// } catch (BadLocationException ble) +// { +// System.err.println("Couldn't insert initial text into text pane."); +// } - String[] initStyles = - { - "regular", "italic", "bold", "small", "large", - "regular", "button", "regular", "icon", - "regular" - }; - - JTextPane textPane = new JTextPane(); - textPane.setEditable(true); - /*StyledDocument*/ doc = textPane.getStyledDocument(); - addStylesToDocument(doc); - - try - { - for (int j = 0; j < 2; j++) - { - for (int i = 0; i < initString.length; i++) - { - doc.insertString(doc.getLength(), initString[i], - doc.getStyle(initStyles[i])); - } - } - } catch (BadLocationException ble) - { - System.err.println("Couldn't insert initial text into text pane."); - } - - return new JTextArea(); // textPane; + return new JTextPane(); // textPane; } protected void addStylesToDocument(StyledDocument doc) @@ -1436,17 +1444,22 @@ cGridBag editBar = new cGridBag().setVertical(false); - editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints); + editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints); + createMaterialButton.setToolTipText("Create material"); /* ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); */ - editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints); - editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints); + editBar.add(clearMaterialButton = new cButton("Clear", !GrafreeD.NIMBUSLAF)); // , aConstraints); + clearMaterialButton.setToolTipText("Clear material"); + + editBar.add(resetSlidersButton = new cButton("Reset", !GrafreeD.NIMBUSLAF)); // , aConstraints); editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); + editBar.preferredHeight = 15; + panel.add(editBar); /**/ @@ -3192,7 +3205,7 @@ if (!Globals.ANIMATION) { FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); - browser.show(); + browser.setVisible(true); String filename = browser.getFile(); if (filename != null && filename.length() > 0) { @@ -4425,7 +4438,7 @@ JSplitPane mainPanel; JScrollPane scrollpane; JPanel toolbarPanel; - JPanel treePanel; + cGridBag treePanel; JPanel radioPanel; ButtonGroup buttonGroup; cGridBag ctrlPanel; -- Gitblit v1.6.2