GrafreeD.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
Mocap.java | ●●●●● patch | view | raw | blame | history | |
MocapEditor.java | ●●●●● patch | view | raw | blame | history | |
ObjEditor.java | ●●●●● patch | view | raw | blame | history |
GrafreeD.java
.. .. @@ -15,7 +15,7 @@ 15 15 //import com.jamonapi.*; 16 16 public class GrafreeD extends Applet implements ActionListener 17 17 { 18 - static boolean NIMBUSLAF = false;18 + static boolean NIMBUSLAF = true;19 19 20 20 static int RENDERME = 0; 21 21 GroupEditor.java
.. .. @@ -436,11 +436,11 @@ 436 436 */ 437 437 //this.AddOptions(oe.toolbarPanel, oe.aConstraints); 438 438 439 - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);439 + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);440 440 liveCB.setToolTipText("Enabled animation"); 441 441 liveCB.addItemListener(this); 442 442 443 - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints);443 + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);444 444 trackCB.setToolTipText("Enable tracking"); 445 445 trackCB.addItemListener(this); 446 446 .. .. @@ -485,47 +485,42 @@ 485 485 // 486 486 487 487 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");489 489 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);492 492 closeButton.setToolTipText("Close tab"); 493 493 closeButton.addActionListener(this); 494 494 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); 495 495 //clearButton.addActionListener(this); 496 - oe.aConstraints.gridx += 1;497 496 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");500 501 editButton.addActionListener(this); 501 - oe.aConstraints.gridx += 1;502 - oe.aConstraints.weighty = 0;503 - oe.aConstraints.gridwidth = 1;504 502 505 - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);503 + commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);504 + uneditButton.setToolTipText("Unedit selection");506 505 uneditButton.addActionListener(this); 507 506 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");513 509 clearPanelButton.addActionListener(this); 514 510 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??");520 513 allParamsButton.addActionListener(this); 521 514 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");527 517 unselectButton.addActionListener(this); 528 518 519 + commandsPanel.preferredHeight = 1;520 +521 + oe.treePanel.add(commandsPanel);522 + oe.treePanel.Return();523 +529 524 // oe.aConstraints.gridx += 1; 530 525 // oe.aConstraints.weighty = 0; 531 526 // oe.aConstraints.gridwidth = 1; .. .. @@ -537,40 +532,37 @@ 537 532 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); 538 533 // gcButton.addActionListener(this); 539 534 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;551 538 //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);553 540 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();558 544 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");563 549 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");566 553 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");569 557 textureCB.addItemListener(this); 570 558 571 - oe.aConstraints.gridx = 0;572 - oe.aConstraints.gridy += 1;559 + copyOptionsPanel.preferredHeight = 1;560 + oe.treePanel.add(copyOptionsPanel);561 + oe.treePanel.Return();573 562 563 +// mainPanel.setDividerLocation(0.5); //1.0);564 +// mainPanel.setResizeWeight(0.5);565 +574 566 //jList.addListSelectionListener(this); 575 567 oe.jTree.addTreeSelectionListener(this); 576 568 //jTree.setRootVisible(false); .. .. @@ -664,6 +656,12 @@ 664 656 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); 665 657 lookAtCB.setToolTipText("Look-at target"); 666 658 lookAtCB.addItemListener(this); 659 +660 + cGridBag fill = new cGridBag();661 +662 + fill.preferredHeight = 200;663 +664 + panel.add(fill);667 665 668 666 } 669 667 .. .. @@ -4113,12 +4111,12 @@ 4113 4111 System.err.println("info : " + child.GetPath()); 4114 4112 } 4115 4113 } 4116 - else4117 - {4118 - objEditor.SetMaterial(group); // .GetMaterial());4119 - objEditor.AddInfo(group, this, true); // .GetMaterial());4120 - System.err.println("info : " + group.GetPath());4121 - }4114 +// else4115 +// {4116 +// objEditor.SetMaterial(group); // .GetMaterial());4117 +// objEditor.AddInfo(group, this, true); // .GetMaterial());4118 +// System.err.println("info : " + group.GetPath());4119 +// }4122 4120 4123 4121 objEditor.SetText(); // jan 2014 4124 4122 Mocap.java
.. .. @@ -2267,7 +2267,7 @@ 2267 2267 } 2268 2268 2269 2269 if (!smoothed) 2270 - for (int i=0; --i>=0;)2270 + for (int i=1; --i>=0;)2271 2271 SmoothAnimData(); // much reduces shakiness 2272 2272 2273 2273 smoothed = true; MocapEditor.java
.. .. @@ -9,6 +9,9 @@ 9 9 class MocapEditor extends ObjEditor implements //ItemListener, 10 10 ChangeListener, ObjectUI, ActionListener 11 11 { 12 + cGridBag firstPanel;13 + cGridBag framePanel;14 + cGridBag lastPanel;12 15 MocapEditor(Mocap inBP, GroupEditor callee) 13 16 { 14 17 super(inBP,callee); .. .. @@ -69,12 +72,15 @@ 69 72 oe.aConstraints.gridwidth = 1; 70 73 */ 71 74 super.SetupUI2(oe); 75 + framePanel = AddSlider(oe.ctrlPanel, "Frame:", 0, mocap.bvh.animation.getNumFrames()-1, mocap.frame);72 76 73 - frameField = (cNumberSlider)AddSlider(oe.ctrlPanel, "Frame:", 0, mocap.bvh.animation.getNumFrames()-1, mocap.frame).getComponent(1);77 + frameField = (cNumberSlider)framePanel.getComponent(1);74 78 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);76 81 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);78 84 oe.ctrlPanel.Return(); 79 85 80 86 // oe.aConstraints.gridx = 0; .. .. @@ -241,15 +247,18 @@ 241 247 { 242 248 ObjEditor oe = objEditor; 243 249 244 - Remove(frameField);245 - Remove(firstField);246 - Remove(lastField);250 +// Remove(frameField);251 +// Remove(firstField);252 +// Remove(lastField);247 253 // frameField.removeChangeListener(this); 248 254 // oe.ctrlPanel.remove(frameField); 249 255 // oe.ctrlPanel.remove(frameLabel); 250 256 // oe.ctrlPanel.remove(speedField); 251 257 // oe.ctrlPanel.remove(speedLabel); 252 258 //oe.ctrlPanel.repaint(); 259 + oe.ctrlPanel.remove(framePanel);260 + oe.ctrlPanel.remove(firstPanel);261 + oe.ctrlPanel.remove(lastPanel);253 262 254 263 super.closeUI(); 255 264 } ObjEditor.java
.. .. @@ -359,7 +359,7 @@ 359 359 objectPanel = new JTabbedPane(); 360 360 toolbarPanel = new JPanel(); 361 361 toolbarPanel.setName("Toolbar"); 362 - treePanel = new JPanel();362 + treePanel = new cGridBag();363 363 treePanel.setName("Tree"); 364 364 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); 365 365 ctrlPanel.setName("Edit"); .. .. @@ -367,13 +367,15 @@ 367 367 materialPanel.setName("Material"); 368 368 /*JTextPane*/ 369 369 infoarea = createTextPane(); 370 + doc = infoarea.getStyledDocument();371 +370 372 infoarea.setEditable(true); 371 373 SetText(); 372 374 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); 373 375 // infoarea.setOpaque(false); 374 376 // //infoarea.setForeground(textcolor); 375 - infoarea.setLineWrap(true);376 - infoarea.setWrapStyleWord(true);377 +// TEXTAREA infoarea.setLineWrap(true);378 +// TEXTAREA infoarea.setWrapStyleWord(true);377 379 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); 378 380 infoPanel.setPreferredSize(new Dimension(50, 200)); 379 381 infoPanel.setName("Info"); .. .. @@ -384,14 +386,14 @@ 384 386 mainPanel.setName("Main"); 385 387 mainPanel.setContinuousLayout(true); 386 388 mainPanel.setOneTouchExpandable(true); 387 - mainPanel.setDividerLocation(1.0);388 389 mainPanel.setDividerSize(9); 389 - mainPanel.setResizeWeight(0);390 + mainPanel.setDividerLocation(0.5); //1.0);391 + mainPanel.setResizeWeight(0.5);390 392 391 393 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); 392 394 //mainPanel.setLayout(new GridBagLayout()); 393 395 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); 394 - treePanel.setLayout(new GridBagLayout());396 +// treePanel.setLayout(new GridBagLayout());395 397 //ctrlPanel.setLayout(new GridBagLayout()); 396 398 //materialPanel.setLayout(new GridBagLayout()); 397 399 .. .. @@ -432,7 +434,7 @@ 432 434 static String newline = "\n"; 433 435 protected static final String buttonString = "JButton"; 434 436 StyledDocument doc; 435 - JTextArea infoarea;437 + JTextPane infoarea;436 438 437 439 void ClearInfo() 438 440 { .. .. @@ -499,7 +501,10 @@ 499 501 } 500 502 501 503 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 + }503 508 504 509 if (sel.bRep != null) 505 510 { .. .. @@ -597,6 +602,9 @@ 597 602 { 598 603 CameraPane.pointflow = (PointFlow) sel; 599 604 } 605 +606 + si.SendInfo("_____________________", "regular");607 + si.SendInfo("", "regular");600 608 } 601 609 } 602 610 .. .. @@ -628,52 +636,52 @@ 628 636 cameraView.ToggleFullScreen(); 629 637 } 630 638 631 - private JTextArea createTextPane()639 + private JTextPane createTextPane()632 640 { 633 - String[] initString =634 - {635 - "This is an editable JTextPane, ", //regular636 - "another ", //italic637 - "styled ", //bold638 - "text ", //small639 - "component, ", //large640 - "which supports embedded components..." + newline,//regular641 - " " + newline, //button642 - "...and embedded icons..." + newline, //regular643 - " ", //icon644 - 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, ", //regular644 +// "another ", //italic645 +// "styled ", //bold646 +// "text ", //small647 +// "component, ", //large648 +// "which supports embedded components..." + newline,//regular649 +// " " + newline, //button650 +// "...and embedded icons..." + newline, //regular651 +// " ", //icon652 +// 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 +// try670 +// {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 +// }648 683 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 - try662 - {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;677 685 } 678 686 679 687 protected void addStylesToDocument(StyledDocument doc) .. .. @@ -1436,17 +1444,22 @@ 1436 1444 1437 1445 cGridBag editBar = new cGridBag().setVertical(false); 1438 1446 1439 - editBar.add(createMaterialButton = new cButton("Create")); // , aConstraints);1447 + editBar.add(createMaterialButton = new cButton("Create", !GrafreeD.NIMBUSLAF)); // , aConstraints);1448 + createMaterialButton.setToolTipText("Create material");1440 1449 1441 1450 /* 1442 1451 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); 1443 1452 */ 1444 1453 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);1447 1458 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); 1448 1459 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); 1449 1460 1461 + editBar.preferredHeight = 15;1462 +1450 1463 panel.add(editBar); 1451 1464 1452 1465 /**/ .. .. @@ -4425,7 +4438,7 @@ 4425 4438 JSplitPane mainPanel; 4426 4439 JScrollPane scrollpane; 4427 4440 JPanel toolbarPanel; 4428 - JPanel treePanel;4441 + cGridBag treePanel;4429 4442 JPanel radioPanel; 4430 4443 ButtonGroup buttonGroup; 4431 4444 cGridBag ctrlPanel;