From 504890a7b930ab6b853c49de825ae848e0535339 Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Wed, 01 May 2019 09:08:30 -0400 Subject: [PATCH] Control pane --- ObjEditor.java | 890 ++++++++++++++++++++++++++--------------------------------- 1 files changed, 392 insertions(+), 498 deletions(-) diff --git a/ObjEditor.java b/ObjEditor.java index 884881a..98cec4e 100644 --- a/ObjEditor.java +++ b/ObjEditor.java @@ -19,6 +19,8 @@ import //weka.core. matrix.Matrix; +import grafeme.ui.*; + class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, ActionListener, ChangeListener, InputMethodListener, @@ -124,7 +126,7 @@ void keyPressed(int key, int modifiers) { System.out.println("KEY PRESSED"); - CameraPane.theRenderer.keyPressed(key, modifiers); + Globals.theRenderer.keyPressed(key, modifiers); } */ @@ -136,34 +138,40 @@ public void closeUI() { //new Exception().printStackTrace(); - System.out.println("this = " + this); - System.out.println("objEditor = " + objEditor); +// System.out.println("this = " + this); +// System.out.println("objEditor = " + objEditor); //nameField.removeActionListener(this); - objEditor.ctrlPanel.remove(nameField); +// objEditor.ctrlPanel.remove(nameField); if (!GroupEditor.allparams) return; - objEditor.ctrlPanel.remove(liveCB); - objEditor.ctrlPanel.remove(hideCB); - objEditor.ctrlPanel.remove(markCB); - - objEditor.ctrlPanel.remove(randomCB); - objEditor.ctrlPanel.remove(speedupCB); - objEditor.ctrlPanel.remove(rewindCB); - - objEditor.ctrlPanel.remove(resetButton); - objEditor.ctrlPanel.remove(stepButton); -// objEditor.ctrlPanel.remove(stepAllButton); -// objEditor.ctrlPanel.remove(resetAllButton); - objEditor.ctrlPanel.remove(link2masterCB); - //objEditor.ctrlPanel.remove(flipVCB); - //objEditor.ctrlPanel.remove(texresMenu); - objEditor.ctrlPanel.remove(slowerButton); - objEditor.ctrlPanel.remove(fasterButton); - objEditor.ctrlPanel.remove(remarkButton); +// objEditor.ctrlPanel.remove(liveCB); +// objEditor.ctrlPanel.remove(hideCB); +// objEditor.ctrlPanel.remove(markCB); +// +// objEditor.ctrlPanel.remove(randomCB); +// objEditor.ctrlPanel.remove(speedupCB); +// objEditor.ctrlPanel.remove(rewindCB); +// +// objEditor.ctrlPanel.remove(resetButton); +// objEditor.ctrlPanel.remove(stepButton); +//// objEditor.ctrlPanel.remove(stepAllButton); +//// objEditor.ctrlPanel.remove(resetAllButton); +// objEditor.ctrlPanel.remove(link2masterCB); +// //objEditor.ctrlPanel.remove(flipVCB); +// //objEditor.ctrlPanel.remove(texresMenu); +// objEditor.ctrlPanel.remove(slowerButton); +// objEditor.ctrlPanel.remove(fasterButton); +// objEditor.ctrlPanel.remove(remarkButton); - Remove(normalpushField); + objEditor.ctrlPanel.remove(namePanel); + objEditor.ctrlPanel.remove(setupPanel); + objEditor.ctrlPanel.remove(commandsPanel); + objEditor.ctrlPanel.remove(pushPanel); + //objEditor.ctrlPanel.remove(fillPanel); + + //Remove(normalpushField); } public ObjEditor GetEditor() @@ -353,9 +361,9 @@ toolbarPanel.setName("Toolbar"); treePanel = new JPanel(); treePanel.setName("Tree"); - ctrlPanel = new JPanel(); // new GridBagLayout()); + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); ctrlPanel.setName("Edit"); - materialPanel = new JPanel(); + materialPanel = new cGridBag().setVertical(true); materialPanel.setName("Material"); /*JTextPane*/ infoarea = createTextPane(); @@ -384,8 +392,8 @@ //mainPanel.setLayout(new GridBagLayout()); toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); treePanel.setLayout(new GridBagLayout()); - ctrlPanel.setLayout(new GridBagLayout()); - materialPanel.setLayout(new GridBagLayout()); + //ctrlPanel.setLayout(new GridBagLayout()); + //materialPanel.setLayout(new GridBagLayout()); aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); @@ -765,115 +773,83 @@ JButton slowerButton; JButton fasterButton; JButton remarkButton; + + cGridBag namePanel; + cGridBag setupPanel; + cGridBag commandsPanel; + cGridBag pushPanel; + cGridBag fillPanel; - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) { JCheckBox cb; - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; - oe.aConstraints.gridwidth = 1; // 3; -// oe.aConstraints.weightx = 1; -// oe.aConstraints.anchor = GridBagConstraints.WEST; - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); cb.addItemListener(this); -// oe.aConstraints.anchor = GridBagConstraints.EAST; - oe.aConstraints.gridwidth = 1; - oe.aConstraints.gridx += 1; return cb; } - cButton AddButton(ObjEditor oe, String label) + cButton AddButton(cGridBag panel, String label) { cButton cb; - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; - oe.aConstraints.gridwidth = 1; -// oe.aConstraints.weightx = 1; -// oe.aConstraints.anchor = GridBagConstraints.WEST; - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); cb.addActionListener(this); -// oe.aConstraints.anchor = GridBagConstraints.EAST; - oe.aConstraints.gridwidth = 1; - oe.aConstraints.gridx += 1; return cb; } - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) { JComboBox combo; - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); - oe.aConstraints.gridx += 1; + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); combo.addActionListener(this); return combo; } - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) { - NumberSlider combo; + cGridBag control = new cGridBag(); + + cNumberSlider combo; JLabel jlabel = new JLabel(label); - - aConstraints.fill = GridBagConstraints.VERTICAL; jlabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.gridwidth = 1; - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); - aConstraints.gridx += 1; - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); - aConstraints.gridx += 1; - aConstraints.gridwidth = 1; - + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); combo.setFloat(current); - - combo.label = jlabel; - - combo.addChangeListener(this); - - return combo; + + panel.add(control); + + return control; } - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) { - NumberSlider combo; + cGridBag control = new cGridBag(); + + cNumberSlider combo; JLabel jlabel = new JLabel(label); - - aConstraints.fill = GridBagConstraints.VERTICAL; jlabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.gridwidth = 2; - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); - aConstraints.gridx += 1; - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); - aConstraints.gridx += 1; - aConstraints.gridwidth = 1; - + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); combo.setInteger(current); - combo.label = jlabel; - - combo.addChangeListener(this); - - return combo; + panel.add(control); + + return control; } - JTextArea AddText(JPanel ctrlPanel, String name) + JTextArea AddText(cGridBag ctrlPanel, String name) { JTextArea text; - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); text.addCaretListener(this); - aConstraints.gridx += 1; - aConstraints.gridwidth = 1; return text; } @@ -903,9 +879,16 @@ objEditor.ctrlPanel.remove(j); } + void Remove(cNumberSlider j) + { + j.removeChangeListener(this); + //objEditor.ctrlPanel.remove(j.label); + objEditor.ctrlPanel.remove(j); + } + /* */ - void Return() // ObjEditor oe) + void Return0() // ObjEditor oe) { aConstraints.gridy += 1; aConstraints.gridx = 0; @@ -964,33 +947,52 @@ // oe.aConstraints.weighty = 0; // oe.aConstraints.gridx = 0; // oe.aConstraints.gridy = 0; - SetupName(oe); + //SetupName(oe); + + namePanel = new cGridBag(); + + nameField = AddText(namePanel, copy.GetName()); + namePanel.add(nameField); + oe.ctrlPanel.add(namePanel); + + oe.ctrlPanel.Return(); if (!GroupEditor.allparams) return; - liveCB = AddCheckBox(oe, "Live", copy.live); - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); - hideCB = AddCheckBox(oe, "Hide", copy.hide); + setupPanel = new cGridBag().setVertical(false); + + liveCB = AddCheckBox(setupPanel, "Live", copy.live); + link2masterCB = AddCheckBox(setupPanel, "Supp", copy.link2master); + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); // Return(); - markCB = AddCheckBox(oe, "Mark", copy.marked); - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); - randomCB = AddCheckBox(oe, "Rand", copy.random); - Return(); - resetButton = AddButton(oe, "Reset"); - stepButton = AddButton(oe, "Step"); + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); + rewindCB = AddCheckBox(setupPanel, "Rew", copy.rewind); + randomCB = AddCheckBox(setupPanel, "Rand", copy.random); + + oe.ctrlPanel.add(setupPanel); + oe.ctrlPanel.Return(); + + commandsPanel = new cGridBag().setVertical(false); + + resetButton = AddButton(commandsPanel, "Reset"); + stepButton = AddButton(commandsPanel, "Step"); // resetAllButton = AddButton(oe, "Reset All"); // stepAllButton = AddButton(oe, "Step All"); - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); + speedupCB = AddCheckBox(commandsPanel, "Speed", copy.speedup); // Return(); - slowerButton = AddButton(oe, "Slow"); - fasterButton = AddButton(oe, "Fast"); - remarkButton = AddButton(oe, "Rem"); + slowerButton = AddButton(commandsPanel, "Slow"); + fasterButton = AddButton(commandsPanel, "Fast"); + remarkButton = AddButton(commandsPanel, "Remark"); - Return(); + oe.ctrlPanel.add(commandsPanel); + oe.ctrlPanel.Return(); - normalpushField = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, -1); - Return(); + pushPanel = AddSlider(oe.ctrlPanel, "Push", -10, 10, 0, 1); + normalpushField = (cNumberSlider)pushPanel.getComponent(1); + //Return(); + + oe.ctrlPanel.Return(); // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); // ObjEditor.aConstraints.gridx += 1; @@ -1085,7 +1087,7 @@ oe.aConstraints.gridwidth = 1; /**/ nameField = AddText(oe.ctrlPanel, copy.GetName()); - Return(); + oe.ctrlPanel.Return(); //ctrlPanel.add(textureButton = new Button("Texture...")); //textureButton.setEnabled(false); @@ -1187,7 +1189,8 @@ //JPanel worldPanel = // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); //worldPanel.setName("World"); - centralPanel = new JPanel(new BorderLayout()); + centralPanel = new cGridBag(); + centralPanel.preferredWidth = 20; timelinePanel = new JPanel(new BorderLayout()); timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); @@ -1217,12 +1220,13 @@ //frontView.object = copy; //sideView.object = copy; - XYZPanel = new JPanel(); - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); + XYZPanel = new cGridBag().setVertical(true); + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); + XYZPanel.preferredWidth = 5; + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); /* gridPanel = new JPanel(); //new BorderLayout()); @@ -1260,10 +1264,11 @@ //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //tmp.setName("Edit"); objectPanel.add(materialPanel); - JPanel north = new JPanel(new BorderLayout()); - north.setName("Edit"); - north.add(ctrlPanel, BorderLayout.NORTH); - objectPanel.add(north); +// JPanel north = new JPanel(new BorderLayout()); +// north.setName("Edit"); +// north.add(ctrlPanel, BorderLayout.NORTH); +// objectPanel.add(north); + objectPanel.add(ctrlPanel); objectPanel.add(infoPanel); /* @@ -1284,16 +1289,23 @@ scrollpane.setWheelScrollingEnabled(true); scrollpane.addMouseWheelListener(this); // Default not fast enough - /*JTabbedPane*/ scenePanel = new JTabbedPane(); - scenePanel.add(scrollpane); + /*JTabbedPane*/ scenePanel = new cGridBag(); + scenePanel.preferredWidth = 7; + + JTabbedPane tabbedPane = new JTabbedPane(); + tabbedPane.add(scrollpane); - scenePanel.add(FSPane = new cFileSystemPane(this)); + tabbedPane.add(FSPane = new cFileSystemPane(this)); - optionsPanel = new JPanel(new GridBagLayout()); + optionsPanel = new cGridBag().setVertical(true); optionsPanel.setName("Options"); - scenePanel.add(optionsPanel); - + + AddOptions(optionsPanel); //, aConstraints); + + tabbedPane.add(optionsPanel); + + scenePanel.add(tabbedPane); /* cTree jTree = new cTree(null); @@ -1327,6 +1339,7 @@ //bigPanel.setSize(new Dimension(10,10)); //bigPanel.add(ctrlPanel); //bigPanel.add(gridPanel); + /** bigThree = new JPanel(); //big.setLayout(new FlowLayout(FlowLayout.LEFT)); bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); @@ -1350,7 +1363,13 @@ // aConstraints.gridheight = 3; aWindowConstraints.fill = GridBagConstraints.VERTICAL; bigThree.add(XYZPanel, aWindowConstraints); + /**/ + bigThree = new cGridBag(); + bigThree.addComponent(scenePanel); + bigThree.addComponent(centralPanel); + bigThree.addComponent(XYZPanel); + // // SIDE EFFECT!!! // aConstraints.gridx = 0; // aConstraints.gridy = 0; @@ -1393,6 +1412,10 @@ }); } + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) + { + } + JTree GetTree() { return objEditor.jTree; @@ -1404,260 +1427,165 @@ ctrlPanel.removeAll(); } - void SetupMaterial(JPanel ctrlPanel) + void SetupMaterial(cGridBag panel) { - aConstraints.weighty = 0; - //aConstraints.weightx = 1; - /* + /* ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; */ - aConstraints.gridwidth = 1; - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); - aConstraints.gridx += 1; - aConstraints.weighty = 0; - aConstraints.gridwidth = 1; + cGridBag editBar = new cGridBag().setVertical(false); + + editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints); /* ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); - aConstraints.gridx += 1; - aConstraints.weighty = 0; - aConstraints.gridwidth = 1; */ - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); - aConstraints.gridx += 1; + editBar.add(clearMaterialButton = new cButton("Clear")); // , aConstraints); + editBar.add(resetSlidersButton = new cButton("Reset")); // , aConstraints); + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); - - aConstraints.gridx += 1; - - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); - - aConstraints.gridx += 1; - - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); - - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.weighty = 0; - aConstraints.gridwidth = 1; + panel.add(editBar); + /**/ //aConstraints.weighty = 0; ////aConstraints.weightx = 1; //aConstraints.weighty = 1; aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; //aConstraints.gridx += 1; - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); - aConstraints.weighty = 0; - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - //aConstraints.weightx = 0; - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag colorSection = new cGridBag().setVertical(true); + + cGridBag color = new cGridBag(); + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); + //colorField.preferredWidth = 200; + colorSection.add(color); - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag modulation = new cGridBag(); + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); + colorSection.add(modulation); - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag texture = new cGridBag(); + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); + colorSection.add(texture); - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag anisoU = new cGridBag(); + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); + colorSection.add(anisoU); - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag anisoV = new cGridBag(); + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); + colorSection.add(anisoV); - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag shadowbias = new cGridBag(); + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + colorSection.add(shadowbias); - //aConstraints.weighty = 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; - //aConstraints.gridx += 1; - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); - aConstraints.weighty = 0; - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + panel.add(new JSeparator()); + + panel.add(colorSection); + + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); + + cGridBag diffuseSection = new cGridBag().setVertical(true); + + cGridBag diffuse = new cGridBag(); + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + diffuseSection.add(diffuse); - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag diffuseness = new cGridBag(); + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + diffuseSection.add(diffuseness); - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag selfshadow = new cGridBag(); + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + diffuseSection.add(selfshadow); - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag sheen = new cGridBag(); + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + diffuseSection.add(sheen); - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag subsurface = new cGridBag(); + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); + diffuseSection.add(subsurface); - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag shadow = new cGridBag(); + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + diffuseSection.add(shadow); - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag fakedepth = new cGridBag(); + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + diffuseSection.add(fakedepth); - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + panel.add(new JSeparator()); + + panel.add(diffuseSection); + + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); + + cGridBag specularSection = new cGridBag().setVertical(true); - //aConstraints.weighty = 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; - //aConstraints.gridx += 1; - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); - aConstraints.weighty = 0; - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag specular = new cGridBag(); + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + specularSection.add(specular); - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag lightarea = new cGridBag(); + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + specularSection.add(lightarea); - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag shininess = new cGridBag(); + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + specularSection.add(shininess); - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag metalness = new cGridBag(); + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); + specularSection.add(metalness); - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag velvet = new cGridBag(); + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + specularSection.add(velvet); - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; - - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); - Return(); + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); + //Return(); // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); // aConstraints.fill = GridBagConstraints.HORIZONTAL; @@ -1668,130 +1596,93 @@ // aConstraints.gridy += 1; // aConstraints.gridwidth = 1; - //aConstraints.weighty = 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; - //aConstraints.gridx += 1; - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); - aConstraints.weighty = 0; - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + panel.add(new JSeparator()); + + panel.add(specularSection); + + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); + + cGridBag globalSection = new cGridBag().setVertical(true); - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag camera = new cGridBag(); + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + globalSection.add(camera); - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag ambient = new cGridBag(); + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + globalSection.add(ambient); - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; - aConstraints.weighty = 0; + cGridBag backlit = new cGridBag(); + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); + globalSection.add(backlit); - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag opacity = new cGridBag(); + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); + globalSection.add(opacity); - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + panel.add(new JSeparator()); + + panel.add(globalSection); + + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); + + cGridBag textureSection = new cGridBag().setVertical(true); - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag bump = new cGridBag(); + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); + textureSection.add(bump); - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag noise = new cGridBag(); + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); + textureSection.add(noise); - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag power = new cGridBag(); + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); + textureSection.add(power); - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); - aConstraints.fill = GridBagConstraints.HORIZONTAL; - aConstraints.gridx += 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); - aConstraints.gridx = 0; - aConstraints.gridy += 1; - aConstraints.gridwidth = 1; + cGridBag borderfade = new cGridBag(); + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); + textureSection.add(borderfade); - //aConstraints.weighty = 1; - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; - //aConstraints.gridx += 1; - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); - aConstraints.weighty = 0; + cGridBag fog = new cGridBag(); + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); + textureSection.add(fog); - aConstraints.gridx = 0; - aConstraints.gridy = 0; - aConstraints.gridwidth = 1; + cGridBag opacityPower = new cGridBag(); + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); + textureSection.add(opacityPower); + + panel.add(new JSeparator()); + + panel.add(textureSection); + + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); SetMaterial(copy); // .GetMaterial()); - colorField.addChangeListener(this); - modulationField.addChangeListener(this); + //colorField.addChangeListener(this); +// modulationField.addChangeListener(this); metalnessField.addChangeListener(this); diffuseField.addChangeListener(this); specularField.addChangeListener(this); @@ -2603,6 +2494,7 @@ } if (input == null) { + new Exception().printStackTrace(); System.exit(0); } @@ -3297,25 +3189,25 @@ void ToggleAnimation() { - if (!CameraPane.ANIMATION) + if (!Globals.ANIMATION) { FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); browser.show(); String filename = browser.getFile(); if (filename != null && filename.length() > 0) { - CameraPane.filename = browser.getDirectory() + filename; + Globals.filename = browser.getDirectory() + filename; //CameraPane.framecount = 0; - CameraPane.imagecount = 0; + Globals.imagecount = 0; - CameraPane.ANIMATION ^= true; + Globals.ANIMATION ^= true; GrafreeD.wav.cursor = 0; GrafreeD.wav.loop = 0; } } else { - CameraPane.ANIMATION ^= true; + Globals.ANIMATION ^= true; } } @@ -3332,6 +3224,7 @@ callee.refreshContents(); } else { + new Exception().printStackTrace(); System.exit(0); } } @@ -3494,7 +3387,7 @@ current.fakedepth = (float) fakedepthField.getFloat(); current.shadowbias = (float) shadowbiasField.getFloat(); - if (!NumberSlider.frozen) + if (!cNumberSlider.frozen) { //System.out.println("Propagate = " + propagate); copy.UpdateMaterial(anchor, current, propagate); @@ -3542,6 +3435,7 @@ || e.getSource() == apertureField || e.getSource() == shadowblurField) { + new Exception().printStackTrace(); System.exit(0); cameraView.options1[0] = (float) focusField.getFloat() * 10; cameraView.options1[1] = (float) apertureField.getFloat() / 1000; @@ -3867,7 +3761,7 @@ radioPanel.revalidate(); radioPanel.repaint(); - ctrlPanel.revalidate(); // ? new + ctrlPanel.validate(); // ? new ctrlPanel.repaint(); } } @@ -4513,8 +4407,8 @@ //MenuItem normalLensItem; MenuItem editCameraItem; MenuItem revertCameraItem; - CheckboxMenuItem toggleLiveItem; MenuItem stepItem; + CheckboxMenuItem toggleLiveItem; CheckboxMenuItem toggleFullScreenItem; CheckboxMenuItem toggleTimelineItem; CheckboxMenuItem toggleRenderItem; @@ -4534,17 +4428,17 @@ JPanel treePanel; JPanel radioPanel; ButtonGroup buttonGroup; - JPanel ctrlPanel; - JPanel materialPanel; + cGridBag ctrlPanel; + cGridBag materialPanel; JScrollPane infoPanel; - JPanel optionsPanel; + cGridBag optionsPanel; JTabbedPane objectPanel; - JPanel XYZPanel; + cGridBag XYZPanel; JSplitPane gridPanel; JSplitPane bigPanel; - JPanel bigThree; - JTabbedPane scenePanel; - JPanel centralPanel; + cGridBag bigThree; + cGridBag scenePanel; + cGridBag centralPanel; JSplitPane cameraPanel; JPanel timelinePanel; JMenuBar timelineMenubar; @@ -4597,67 +4491,67 @@ // MATERIAL JLabel materialLabel; JLabel colorLabel; - NumberSlider colorField; + cNumberSlider colorField; JLabel modulationLabel; - NumberSlider modulationField; + cNumberSlider modulationField; JLabel metalnessLabel; - NumberSlider metalnessField; + cNumberSlider metalnessField; JLabel diffuseLabel; - NumberSlider diffuseField; + cNumberSlider diffuseField; JLabel specularLabel; - NumberSlider specularField; + cNumberSlider specularField; JLabel shininessLabel; - NumberSlider shininessField; + cNumberSlider shininessField; JLabel shiftLabel; - NumberSlider shiftField; + cNumberSlider shiftField; JLabel ambientLabel; - NumberSlider ambientField; + cNumberSlider ambientField; JLabel lightareaLabel; - NumberSlider lightareaField; + cNumberSlider lightareaField; JLabel diffusenessLabel; - NumberSlider diffusenessField; + cNumberSlider diffusenessField; JLabel velvetLabel; - NumberSlider velvetField; + cNumberSlider velvetField; JLabel sheenLabel; - NumberSlider sheenField; + cNumberSlider sheenField; JLabel subsurfaceLabel; - NumberSlider subsurfaceField; + cNumberSlider subsurfaceField; //JLabel bumpLabel; //NumberSlider bumpField; JLabel backlitLabel; - NumberSlider backlitField; + cNumberSlider backlitField; JLabel anisoLabel; - NumberSlider anisoField; + cNumberSlider anisoField; JLabel anisoVLabel; - NumberSlider anisoVField; + cNumberSlider anisoVField; JLabel cameraLabel; - NumberSlider cameraField; + cNumberSlider cameraField; JLabel selfshadowLabel; - NumberSlider selfshadowField; + cNumberSlider selfshadowField; JLabel shadowLabel; - NumberSlider shadowField; + cNumberSlider shadowField; JLabel textureLabel; - NumberSlider textureField; + cNumberSlider textureField; JLabel opacityLabel; - NumberSlider opacityField; + cNumberSlider opacityField; JLabel fakedepthLabel; - NumberSlider fakedepthField; + cNumberSlider fakedepthField; JLabel shadowbiasLabel; - NumberSlider shadowbiasField; + cNumberSlider shadowbiasField; JLabel bumpLabel; - NumberSlider bumpField; + cNumberSlider bumpField; JLabel noiseLabel; - NumberSlider noiseField; + cNumberSlider noiseField; JLabel powerLabel; - NumberSlider powerField; + cNumberSlider powerField; JLabel borderfadeLabel; - NumberSlider borderfadeField; + cNumberSlider borderfadeField; JLabel fogLabel; - NumberSlider fogField; + cNumberSlider fogField; JLabel opacityPowerLabel; - NumberSlider opacityPowerField; + cNumberSlider opacityPowerField; JTree jTree; //ObjectUI parent; - NumberSlider normalpushField; + cNumberSlider normalpushField; } -- Gitblit v1.6.2