.. | .. |
---|
19 | 19 | import //weka.core. |
---|
20 | 20 | matrix.Matrix; |
---|
21 | 21 | |
---|
| 22 | +import grafeme.ui.*; |
---|
| 23 | + |
---|
22 | 24 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 25 | ActionListener, ChangeListener, |
---|
24 | 26 | InputMethodListener, |
---|
.. | .. |
---|
31 | 33 | boolean timeline; |
---|
32 | 34 | boolean wasFullScreen; |
---|
33 | 35 | |
---|
| 36 | + GroupEditor callee; |
---|
| 37 | + JFrame frame; |
---|
| 38 | + |
---|
| 39 | + static ObjEditor theFrame; |
---|
| 40 | + |
---|
34 | 41 | // SCRIPT |
---|
35 | 42 | |
---|
36 | 43 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
121 | 128 | void keyPressed(int key, int modifiers) |
---|
122 | 129 | { |
---|
123 | 130 | System.out.println("KEY PRESSED"); |
---|
124 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 131 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
125 | 132 | } |
---|
126 | 133 | */ |
---|
127 | 134 | |
---|
128 | 135 | static GridBagConstraints aConstraints; |
---|
129 | 136 | static GridBagConstraints aWindowConstraints; |
---|
130 | | - GroupEditor callee; |
---|
131 | | - JFrame frame; |
---|
| 137 | + |
---|
132 | 138 | static int GRIDWIDTH = 100; // 4; |
---|
133 | 139 | |
---|
134 | 140 | public void closeUI() |
---|
135 | 141 | { |
---|
136 | 142 | //new Exception().printStackTrace(); |
---|
137 | | - System.out.println("this = " + this); |
---|
138 | | - System.out.println("objEditor = " + objEditor); |
---|
| 143 | +// System.out.println("this = " + this); |
---|
| 144 | +// System.out.println("objEditor = " + objEditor); |
---|
139 | 145 | //nameField.removeActionListener(this); |
---|
140 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 146 | +// objEditor.ctrlPanel.remove(nameField); |
---|
| 147 | + |
---|
| 148 | + objEditor.ctrlPanel.remove(namePanel); |
---|
141 | 149 | |
---|
142 | 150 | if (!GroupEditor.allparams) |
---|
143 | 151 | return; |
---|
144 | 152 | |
---|
145 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
146 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
147 | | - objEditor.ctrlPanel.remove(markCB); |
---|
148 | | - |
---|
149 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
150 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
151 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
152 | | - |
---|
153 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
154 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
155 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
156 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
157 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
158 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
159 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
160 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
161 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
162 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 153 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 154 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 155 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 156 | +// |
---|
| 157 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 158 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 159 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 160 | +// |
---|
| 161 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 162 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 163 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 164 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 165 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 166 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 167 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 168 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 169 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 170 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
| 171 | + |
---|
| 172 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 173 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 174 | + objEditor.ctrlPanel.remove(commandsPanel); |
---|
| 175 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 176 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 177 | + |
---|
| 178 | + //Remove(normalpushField); |
---|
163 | 179 | } |
---|
164 | 180 | |
---|
165 | 181 | public ObjEditor GetEditor() |
---|
166 | 182 | { |
---|
167 | 183 | return objEditor; //.GetEditor(); |
---|
168 | 184 | } |
---|
| 185 | + |
---|
| 186 | + // Sometimes myself, sometimes my callee's. |
---|
169 | 187 | ObjEditor objEditor; |
---|
170 | 188 | |
---|
171 | 189 | /* |
---|
.. | .. |
---|
228 | 246 | //localCopy.parent = null; |
---|
229 | 247 | |
---|
230 | 248 | frame = new JFrame(); |
---|
| 249 | + frame.setUndecorated(true); |
---|
231 | 250 | objEditor = this; |
---|
232 | 251 | this.callee = callee; |
---|
233 | 252 | |
---|
.. | .. |
---|
261 | 280 | void SetupMenu() |
---|
262 | 281 | { |
---|
263 | 282 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
264 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
265 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
266 | | - windowMenu.add("-"); |
---|
267 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
268 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 283 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 284 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 285 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 286 | + |
---|
| 287 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 288 | + Menu menu = new Menu("Import"); |
---|
| 289 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 290 | + importOBJItem.addActionListener(this); |
---|
| 291 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 292 | + import3DSItem.addActionListener(this); |
---|
| 293 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 294 | + importVRMLX3DItem.addActionListener(this); |
---|
| 295 | + menu.add("-"); |
---|
| 296 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 297 | + importGFDItem.addActionListener(this); |
---|
| 298 | + fileMenu.add(menu); |
---|
| 299 | + fileMenu.add("-"); |
---|
| 300 | + |
---|
| 301 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 302 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
269 | 303 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
270 | | - windowMenu.add("-"); |
---|
271 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
272 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
273 | | - windowMenu.add("-"); |
---|
| 304 | + fileMenu.add("-"); |
---|
| 305 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 306 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 307 | + fileMenu.add("-"); |
---|
274 | 308 | if (client.parent != null) |
---|
275 | 309 | { |
---|
276 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 310 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
277 | 311 | } else |
---|
278 | 312 | { |
---|
279 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 313 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
280 | 314 | } |
---|
281 | 315 | |
---|
| 316 | + newItem.addActionListener(this); |
---|
282 | 317 | loadItem.addActionListener(this); |
---|
283 | 318 | saveItem.addActionListener(this); |
---|
284 | 319 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
287 | 322 | //povItem.addActionListener(this); |
---|
288 | 323 | closeItem.addActionListener(this); |
---|
289 | 324 | |
---|
290 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
291 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
292 | | - //zBufferItem.addActionListener(this); |
---|
293 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
294 | | - //normalLensItem.addActionListener(this); |
---|
295 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
296 | | - revertCameraItem.addActionListener(this); |
---|
297 | | - cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
298 | | - toggleTimelineItem.addItemListener(this); |
---|
299 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
300 | | - toggleFullScreenItem.addItemListener(this); |
---|
301 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
302 | | - cameraMenu.add("-"); |
---|
303 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
304 | | - toggleTextureItem.addItemListener(this); |
---|
305 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
306 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
307 | | - toggleLiveItem.addItemListener(this); |
---|
308 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
309 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
310 | | - stepItem.addActionListener(this); |
---|
311 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
312 | | -// toggleDLItem.addItemListener(this); |
---|
313 | | -// toggleDLItem.setState(false); |
---|
314 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
315 | | - toggleRenderItem.addItemListener(this); |
---|
316 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
317 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
318 | | - toggleDebugItem.addItemListener(this); |
---|
319 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
320 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
321 | | - toggleFrustumItem.addItemListener(this); |
---|
322 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
323 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
324 | | - toggleFootContactItem.addItemListener(this); |
---|
325 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
326 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
327 | | - toggleRandomItem.addItemListener(this); |
---|
328 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
329 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
330 | | - toggleHandleItem.addItemListener(this); |
---|
331 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
332 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
333 | | - togglePaintItem.addItemListener(this); |
---|
334 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
335 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
336 | | -// toggleRootItem.addItemListener(this); |
---|
337 | | -// toggleRootItem.setState(false); |
---|
338 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
339 | | -// animationItem.addItemListener(this); |
---|
340 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
341 | | - cameraMenu.add("-"); |
---|
342 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
343 | | - editCameraItem.addActionListener(this); |
---|
344 | | - |
---|
345 | 325 | objectPanel = new JTabbedPane(); |
---|
346 | 326 | toolbarPanel = new JPanel(); |
---|
347 | 327 | toolbarPanel.setName("Toolbar"); |
---|
348 | | - treePanel = new JPanel(); |
---|
| 328 | + treePanel = new cGridBag(); |
---|
349 | 329 | treePanel.setName("Tree"); |
---|
350 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
| 330 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
351 | 331 | ctrlPanel.setName("Edit"); |
---|
352 | | - materialPanel = new JPanel(); |
---|
| 332 | + materialPanel = new cGridBag().setVertical(true); |
---|
353 | 333 | materialPanel.setName("Material"); |
---|
354 | 334 | /*JTextPane*/ |
---|
355 | 335 | infoarea = createTextPane(); |
---|
| 336 | + doc = infoarea.getStyledDocument(); |
---|
| 337 | + |
---|
356 | 338 | infoarea.setEditable(true); |
---|
357 | 339 | SetText(); |
---|
358 | 340 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
359 | 341 | // infoarea.setOpaque(false); |
---|
360 | 342 | // //infoarea.setForeground(textcolor); |
---|
361 | | - infoarea.setLineWrap(true); |
---|
362 | | - infoarea.setWrapStyleWord(true); |
---|
| 343 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 344 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
363 | 345 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
364 | 346 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
365 | 347 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
370 | 352 | mainPanel.setName("Main"); |
---|
371 | 353 | mainPanel.setContinuousLayout(true); |
---|
372 | 354 | mainPanel.setOneTouchExpandable(true); |
---|
373 | | - mainPanel.setDividerLocation(1.0); |
---|
374 | 355 | mainPanel.setDividerSize(9); |
---|
375 | | - mainPanel.setResizeWeight(0); |
---|
| 356 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 357 | + mainPanel.setResizeWeight(0.5); |
---|
376 | 358 | |
---|
377 | 359 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
378 | 360 | //mainPanel.setLayout(new GridBagLayout()); |
---|
379 | 361 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
380 | | - treePanel.setLayout(new GridBagLayout()); |
---|
381 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
382 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 362 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 363 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 364 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
383 | 365 | |
---|
384 | 366 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
385 | 367 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
418 | 400 | static String newline = "\n"; |
---|
419 | 401 | protected static final String buttonString = "JButton"; |
---|
420 | 402 | StyledDocument doc; |
---|
421 | | - JTextArea infoarea; |
---|
| 403 | + JTextPane infoarea; |
---|
422 | 404 | |
---|
423 | 405 | void ClearInfo() |
---|
424 | 406 | { |
---|
.. | .. |
---|
441 | 423 | e.printStackTrace(); |
---|
442 | 424 | } |
---|
443 | 425 | |
---|
444 | | - String selection = infoarea.getText(); |
---|
445 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
446 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
447 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 426 | +// String selection = infoarea.getText(); |
---|
| 427 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 428 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 429 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
448 | 430 | //clipboard.setContents(data, data); |
---|
449 | 431 | } |
---|
450 | 432 | |
---|
.. | .. |
---|
467 | 449 | //SendInfo("Name:", "bold"); |
---|
468 | 450 | if (sel.GetTextures() != null || debug) |
---|
469 | 451 | { |
---|
470 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 452 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
471 | 453 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
472 | 454 | if (sel.Size() > 0) |
---|
473 | 455 | { |
---|
474 | 456 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
475 | 457 | } |
---|
476 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 458 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
477 | 459 | if (debug) |
---|
478 | 460 | { |
---|
479 | 461 | try |
---|
.. | .. |
---|
485 | 467 | } |
---|
486 | 468 | |
---|
487 | 469 | if (full) |
---|
488 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 470 | + { |
---|
| 471 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 472 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 473 | + } |
---|
489 | 474 | |
---|
490 | 475 | if (sel.bRep != null) |
---|
491 | 476 | { |
---|
.. | .. |
---|
512 | 497 | } |
---|
513 | 498 | if (sel.support != null) |
---|
514 | 499 | { |
---|
515 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 500 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
516 | 501 | } |
---|
517 | 502 | if (sel.scriptnode != null) |
---|
518 | 503 | { |
---|
.. | .. |
---|
583 | 568 | { |
---|
584 | 569 | CameraPane.pointflow = (PointFlow) sel; |
---|
585 | 570 | } |
---|
| 571 | + |
---|
| 572 | + si.SendInfo("_____________________", "regular"); |
---|
| 573 | + si.SendInfo("", "regular"); |
---|
586 | 574 | } |
---|
587 | 575 | } |
---|
588 | 576 | |
---|
.. | .. |
---|
598 | 586 | } |
---|
599 | 587 | } |
---|
600 | 588 | |
---|
| 589 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 590 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
| 591 | + |
---|
| 592 | + Rectangle keeprect; |
---|
| 593 | + cRadio radio; |
---|
| 594 | + |
---|
| 595 | +cButton keepButton; |
---|
| 596 | + cButton twoButton; // Full 3D |
---|
| 597 | + cButton sixButton; |
---|
| 598 | + cButton threeButton; |
---|
| 599 | + cButton sevenButton; |
---|
| 600 | + cButton fourButton; // full panel |
---|
| 601 | + cButton oneButton; // full XYZ |
---|
| 602 | + //cButton currentLayout; |
---|
| 603 | + |
---|
| 604 | + boolean maximized; |
---|
| 605 | + |
---|
| 606 | + void Minimize() |
---|
| 607 | + { |
---|
| 608 | + frame.setState(Frame.ICONIFIED); |
---|
| 609 | + } |
---|
| 610 | + |
---|
| 611 | + void Maximize() |
---|
| 612 | + { |
---|
| 613 | + if (maximized) |
---|
| 614 | + { |
---|
| 615 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 616 | + } |
---|
| 617 | + else |
---|
| 618 | + { |
---|
| 619 | + keeprect = frame.getBounds(); |
---|
| 620 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 621 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 622 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 623 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 624 | + } |
---|
| 625 | + |
---|
| 626 | + maximized ^= true; |
---|
| 627 | + } |
---|
| 628 | + |
---|
601 | 629 | void ToggleFullScreen() |
---|
602 | 630 | { |
---|
603 | 631 | if (CameraPane.FULLSCREEN) |
---|
604 | 632 | { |
---|
605 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
606 | | - framePanel.add(bigThree); |
---|
607 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 633 | + device.setFullScreenWindow(null); |
---|
| 634 | + //frame.setVisible(false); |
---|
| 635 | +// frame.removeNotify(); |
---|
| 636 | +// frame.setUndecorated(false); |
---|
| 637 | +// frame.addNotify(); |
---|
| 638 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 639 | + |
---|
| 640 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 641 | +// X framePanel.add(bigThree); |
---|
| 642 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 643 | + framePanel.setDividerLocation(1); |
---|
| 644 | + |
---|
| 645 | + //frame.setVisible(true); |
---|
| 646 | + radio.layout = keepButton; |
---|
| 647 | + //theFrame = null; |
---|
| 648 | + keepButton = null; |
---|
| 649 | + radio.layout.doClick(); |
---|
| 650 | + |
---|
608 | 651 | } else |
---|
609 | 652 | { |
---|
610 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
611 | | - framePanel.remove(bigThree); |
---|
612 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 653 | + keepButton = radio.layout; |
---|
| 654 | + //keeprect = frame.getBounds(); |
---|
| 655 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 656 | +// frame.getToolkit().getScreenSize().height); |
---|
| 657 | + //frame.setVisible(false); |
---|
| 658 | + device.setFullScreenWindow(frame); |
---|
| 659 | +// frame.removeNotify(); |
---|
| 660 | +// frame.setUndecorated(true); |
---|
| 661 | +// frame.addNotify(); |
---|
| 662 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 663 | +// X framePanel.remove(bigThree); |
---|
| 664 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 665 | + framePanel.setDividerLocation(0); |
---|
| 666 | + |
---|
| 667 | + radio.layout = twoButton; |
---|
| 668 | + radio.layout.doClick(); |
---|
| 669 | + //frame.setVisible(true); |
---|
613 | 670 | } |
---|
| 671 | + |
---|
614 | 672 | cameraView.ToggleFullScreen(); |
---|
615 | 673 | } |
---|
616 | 674 | |
---|
617 | | - private JTextArea createTextPane() |
---|
| 675 | + private JTextPane createTextPane() |
---|
618 | 676 | { |
---|
619 | | - String[] initString = |
---|
620 | | - { |
---|
621 | | - "This is an editable JTextPane, ", //regular |
---|
622 | | - "another ", //italic |
---|
623 | | - "styled ", //bold |
---|
624 | | - "text ", //small |
---|
625 | | - "component, ", //large |
---|
626 | | - "which supports embedded components..." + newline,//regular |
---|
627 | | - " " + newline, //button |
---|
628 | | - "...and embedded icons..." + newline, //regular |
---|
629 | | - " ", //icon |
---|
630 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
631 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
632 | | - + "cover methods for interacting with those objects." |
---|
633 | | - }; |
---|
| 677 | +// TEXTAREA String[] initString = |
---|
| 678 | +// { |
---|
| 679 | +// "This is an editable JTextPane, ", //regular |
---|
| 680 | +// "another ", //italic |
---|
| 681 | +// "styled ", //bold |
---|
| 682 | +// "text ", //small |
---|
| 683 | +// "component, ", //large |
---|
| 684 | +// "which supports embedded components..." + newline,//regular |
---|
| 685 | +// " " + newline, //button |
---|
| 686 | +// "...and embedded icons..." + newline, //regular |
---|
| 687 | +// " ", //icon |
---|
| 688 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 689 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 690 | +// + "cover methods for interacting with those objects." |
---|
| 691 | +// }; |
---|
| 692 | +// |
---|
| 693 | +// String[] initStyles = |
---|
| 694 | +// { |
---|
| 695 | +// "regular", "italic", "bold", "small", "large", |
---|
| 696 | +// "regular", "button", "regular", "icon", |
---|
| 697 | +// "regular" |
---|
| 698 | +// }; |
---|
| 699 | +// |
---|
| 700 | +// JTextPane textPane = new JTextPane(); |
---|
| 701 | +// textPane.setEditable(true); |
---|
| 702 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 703 | +// addStylesToDocument(doc); |
---|
| 704 | +// |
---|
| 705 | +// try |
---|
| 706 | +// { |
---|
| 707 | +// for (int j = 0; j < 2; j++) |
---|
| 708 | +// { |
---|
| 709 | +// for (int i = 0; i < initString.length; i++) |
---|
| 710 | +// { |
---|
| 711 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 712 | +// doc.getStyle(initStyles[i])); |
---|
| 713 | +// } |
---|
| 714 | +// } |
---|
| 715 | +// } catch (BadLocationException ble) |
---|
| 716 | +// { |
---|
| 717 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 718 | +// } |
---|
634 | 719 | |
---|
635 | | - String[] initStyles = |
---|
636 | | - { |
---|
637 | | - "regular", "italic", "bold", "small", "large", |
---|
638 | | - "regular", "button", "regular", "icon", |
---|
639 | | - "regular" |
---|
640 | | - }; |
---|
641 | | - |
---|
642 | | - JTextPane textPane = new JTextPane(); |
---|
643 | | - textPane.setEditable(true); |
---|
644 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
645 | | - addStylesToDocument(doc); |
---|
646 | | - |
---|
647 | | - try |
---|
648 | | - { |
---|
649 | | - for (int j = 0; j < 2; j++) |
---|
650 | | - { |
---|
651 | | - for (int i = 0; i < initString.length; i++) |
---|
652 | | - { |
---|
653 | | - doc.insertString(doc.getLength(), initString[i], |
---|
654 | | - doc.getStyle(initStyles[i])); |
---|
655 | | - } |
---|
656 | | - } |
---|
657 | | - } catch (BadLocationException ble) |
---|
658 | | - { |
---|
659 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
660 | | - } |
---|
661 | | - |
---|
662 | | - return new JTextArea(); // textPane; |
---|
| 720 | + return new JTextPane(); // textPane; |
---|
663 | 721 | } |
---|
664 | 722 | |
---|
665 | 723 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
712 | 770 | protected static ImageIcon createImageIcon(String path, |
---|
713 | 771 | String description) |
---|
714 | 772 | { |
---|
715 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 773 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
716 | 774 | if (imgURL != null) |
---|
717 | 775 | { |
---|
718 | 776 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
744 | 802 | // NumberSlider vDivsField; |
---|
745 | 803 | // JCheckBox endcaps; |
---|
746 | 804 | JCheckBox liveCB; |
---|
| 805 | + JCheckBox selectCB; |
---|
747 | 806 | JCheckBox hideCB; |
---|
748 | 807 | JCheckBox link2masterCB; |
---|
749 | 808 | JCheckBox markCB; |
---|
.. | .. |
---|
759 | 818 | JButton slowerButton; |
---|
760 | 819 | JButton fasterButton; |
---|
761 | 820 | JButton remarkButton; |
---|
| 821 | + |
---|
| 822 | + cGridBag namePanel; |
---|
| 823 | + cGridBag setupPanel; |
---|
| 824 | + cGridBag setupPanel2; |
---|
| 825 | + cGridBag commandsPanel; |
---|
| 826 | + cGridBag pushPanel; |
---|
| 827 | + cGridBag fillPanel; |
---|
762 | 828 | |
---|
763 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 829 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
764 | 830 | { |
---|
765 | 831 | JCheckBox cb; |
---|
766 | 832 | |
---|
767 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
768 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
769 | | -// oe.aConstraints.weightx = 1; |
---|
770 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
771 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 833 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
772 | 834 | cb.addItemListener(this); |
---|
773 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
774 | | - oe.aConstraints.gridwidth = 1; |
---|
775 | | - oe.aConstraints.gridx += 1; |
---|
776 | 835 | |
---|
777 | 836 | return cb; |
---|
778 | 837 | } |
---|
779 | 838 | |
---|
780 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 839 | + cButton AddButton(cGridBag panel, String label) |
---|
781 | 840 | { |
---|
782 | 841 | cButton cb; |
---|
783 | 842 | |
---|
784 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
785 | | - oe.aConstraints.gridwidth = 1; |
---|
786 | | -// oe.aConstraints.weightx = 1; |
---|
787 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
788 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 843 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
789 | 844 | cb.addActionListener(this); |
---|
790 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
791 | | - oe.aConstraints.gridwidth = 1; |
---|
792 | | - oe.aConstraints.gridx += 1; |
---|
793 | 845 | |
---|
794 | 846 | return cb; |
---|
795 | 847 | } |
---|
796 | 848 | |
---|
797 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 849 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
798 | 850 | { |
---|
799 | 851 | JComboBox combo; |
---|
800 | 852 | |
---|
801 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
802 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
803 | | - oe.aConstraints.gridx += 1; |
---|
| 853 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
804 | 854 | combo.addActionListener(this); |
---|
805 | 855 | |
---|
806 | 856 | return combo; |
---|
807 | 857 | } |
---|
808 | 858 | |
---|
809 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 859 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
810 | 860 | { |
---|
811 | | - NumberSlider combo; |
---|
| 861 | + cGridBag control = new cGridBag(); |
---|
| 862 | + |
---|
| 863 | + cNumberSlider combo; |
---|
812 | 864 | |
---|
813 | 865 | JLabel jlabel = new JLabel(label); |
---|
814 | | - |
---|
815 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
816 | 866 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
817 | | - aConstraints.gridwidth = 2; |
---|
818 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
819 | | - aConstraints.gridx += 1; |
---|
820 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
821 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
822 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
823 | | - aConstraints.gridx += 1; |
---|
824 | | - aConstraints.gridwidth = 1; |
---|
825 | | - |
---|
| 867 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 868 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
826 | 869 | combo.setFloat(current); |
---|
827 | | - |
---|
828 | | - combo.label = jlabel; |
---|
829 | | - |
---|
830 | | - combo.addChangeListener(this); |
---|
831 | | - |
---|
832 | | - return combo; |
---|
| 870 | + |
---|
| 871 | + panel.add(control); |
---|
| 872 | + |
---|
| 873 | + return control; |
---|
833 | 874 | } |
---|
834 | 875 | |
---|
835 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 876 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
836 | 877 | { |
---|
837 | | - NumberSlider combo; |
---|
| 878 | + cGridBag control = new cGridBag(); |
---|
| 879 | + |
---|
| 880 | + cNumberSlider combo; |
---|
838 | 881 | |
---|
839 | 882 | JLabel jlabel = new JLabel(label); |
---|
840 | | - |
---|
841 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
842 | 883 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
843 | | - aConstraints.gridwidth = 2; |
---|
844 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
845 | | - aConstraints.gridx += 1; |
---|
846 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
847 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
848 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.gridwidth = 1; |
---|
851 | | - |
---|
| 884 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 885 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
852 | 886 | combo.setInteger(current); |
---|
853 | 887 | |
---|
854 | | - combo.label = jlabel; |
---|
855 | | - |
---|
856 | | - combo.addChangeListener(this); |
---|
857 | | - |
---|
858 | | - return combo; |
---|
| 888 | + panel.add(control); |
---|
| 889 | + |
---|
| 890 | + return control; |
---|
859 | 891 | } |
---|
860 | 892 | |
---|
861 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 893 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
862 | 894 | { |
---|
863 | 895 | JTextArea text; |
---|
864 | 896 | |
---|
865 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
866 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
867 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 897 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
868 | 898 | text.addCaretListener(this); |
---|
869 | | - aConstraints.gridx += 1; |
---|
870 | | - aConstraints.gridwidth = 1; |
---|
871 | 899 | |
---|
872 | 900 | return text; |
---|
873 | 901 | } |
---|
.. | .. |
---|
897 | 925 | objEditor.ctrlPanel.remove(j); |
---|
898 | 926 | } |
---|
899 | 927 | |
---|
| 928 | + void Remove(cNumberSlider j) |
---|
| 929 | + { |
---|
| 930 | + j.removeChangeListener(this); |
---|
| 931 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 932 | + objEditor.ctrlPanel.remove(j); |
---|
| 933 | + } |
---|
| 934 | + |
---|
900 | 935 | /* |
---|
901 | 936 | */ |
---|
902 | | - void Return() // ObjEditor oe) |
---|
| 937 | + void Return0() // ObjEditor oe) |
---|
903 | 938 | { |
---|
904 | 939 | aConstraints.gridy += 1; |
---|
905 | 940 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
954 | 989 | |
---|
955 | 990 | void SetupUI2(ObjEditor oe) |
---|
956 | 991 | { |
---|
957 | | -// oe.aConstraints.weightx = 0; |
---|
958 | | -// oe.aConstraints.weighty = 0; |
---|
959 | | -// oe.aConstraints.gridx = 0; |
---|
960 | | -// oe.aConstraints.gridy = 0; |
---|
961 | | - SetupName(oe); |
---|
| 992 | + //SetupName(oe); |
---|
| 993 | + |
---|
| 994 | + namePanel = new cGridBag(); |
---|
| 995 | + |
---|
| 996 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 997 | + namePanel.add(nameField); |
---|
| 998 | + oe.ctrlPanel.add(namePanel); |
---|
| 999 | + |
---|
| 1000 | + oe.ctrlPanel.Return(); |
---|
962 | 1001 | |
---|
963 | 1002 | if (!GroupEditor.allparams) |
---|
964 | 1003 | return; |
---|
965 | 1004 | |
---|
966 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
967 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
968 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1005 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1006 | + |
---|
| 1007 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1008 | + liveCB.setToolTipText("Animate object"); |
---|
| 1009 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1010 | + selectCB.setToolTipText("Make object selectable"); |
---|
969 | 1011 | // Return(); |
---|
970 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
971 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
972 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
973 | | - Return(); |
---|
974 | | - resetButton = AddButton(oe, "Reset"); |
---|
975 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1012 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1013 | + hideCB.setToolTipText("Hide object"); |
---|
| 1014 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1015 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 1016 | + |
---|
| 1017 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1018 | + |
---|
| 1019 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1020 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1021 | + |
---|
| 1022 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1023 | + randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
| 1024 | + |
---|
| 1025 | + if (Globals.ADVANCED) |
---|
| 1026 | + { |
---|
| 1027 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
| 1028 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1029 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1030 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1031 | + } |
---|
| 1032 | + |
---|
| 1033 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1034 | + oe.ctrlPanel.Return(); |
---|
| 1035 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1036 | + oe.ctrlPanel.Return(); |
---|
| 1037 | + |
---|
| 1038 | + commandsPanel = new cGridBag().setVertical(false); |
---|
| 1039 | + |
---|
| 1040 | + resetButton = AddButton(commandsPanel, "Reset"); |
---|
| 1041 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1042 | + stepButton = AddButton(commandsPanel, "Step"); |
---|
| 1043 | + stepButton.setToolTipText("Step one frame"); |
---|
976 | 1044 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
977 | 1045 | // stepAllButton = AddButton(oe, "Step All"); |
---|
978 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
979 | 1046 | // Return(); |
---|
980 | | - slowerButton = AddButton(oe, "Slow"); |
---|
981 | | - fasterButton = AddButton(oe, "Fast"); |
---|
982 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1047 | + slowerButton = AddButton(commandsPanel, "Slow"); |
---|
| 1048 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1049 | + fasterButton = AddButton(commandsPanel, "Fast"); |
---|
| 1050 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1051 | + remarkButton = AddButton(commandsPanel, "Remark"); |
---|
| 1052 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
983 | 1053 | |
---|
984 | | - Return(); |
---|
| 1054 | + oe.ctrlPanel.add(commandsPanel); |
---|
| 1055 | + oe.ctrlPanel.Return(); |
---|
985 | 1056 | |
---|
| 1057 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1058 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1059 | + //Return(); |
---|
| 1060 | + |
---|
| 1061 | + oe.ctrlPanel.Return(); |
---|
| 1062 | + |
---|
986 | 1063 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
987 | 1064 | // ObjEditor.aConstraints.gridx += 1; |
---|
988 | 1065 | |
---|
.. | .. |
---|
1076 | 1153 | oe.aConstraints.gridwidth = 1; |
---|
1077 | 1154 | /**/ |
---|
1078 | 1155 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1079 | | - Return(); |
---|
| 1156 | + oe.ctrlPanel.Return(); |
---|
1080 | 1157 | |
---|
1081 | 1158 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1082 | 1159 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1178 | 1255 | //JPanel worldPanel = |
---|
1179 | 1256 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1180 | 1257 | //worldPanel.setName("World"); |
---|
1181 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
1182 | | - timelinePanel = new JPanel(new BorderLayout()); |
---|
1183 | | - timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
| 1258 | + centralPanel = new cGridBag(); |
---|
| 1259 | + centralPanel.preferredWidth = 20; |
---|
| 1260 | + |
---|
| 1261 | + if (Globals.ADVANCED) |
---|
| 1262 | + { |
---|
| 1263 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1264 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1184 | 1265 | |
---|
| 1266 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1267 | + cameraPanel.setContinuousLayout(true); |
---|
| 1268 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1269 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1270 | +// cameraPanel.setDividerSize(9); |
---|
| 1271 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1272 | + |
---|
| 1273 | + } |
---|
| 1274 | + |
---|
1185 | 1275 | centralPanel.add(cameraView); |
---|
| 1276 | + centralPanel.setFocusable(true); |
---|
1186 | 1277 | //frame.setJMenuBar(timelineMenubar); |
---|
1187 | 1278 | //centralPanel.add(timelinePanel); |
---|
1188 | 1279 | |
---|
.. | .. |
---|
1201 | 1292 | //frontView.object = copy; |
---|
1202 | 1293 | //sideView.object = copy; |
---|
1203 | 1294 | |
---|
1204 | | - XYZPanel = new JPanel(); |
---|
1205 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1295 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1296 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1206 | 1297 | |
---|
1207 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1208 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1209 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1298 | + XYZPanel.preferredWidth = 5; |
---|
| 1299 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1300 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1301 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1210 | 1302 | |
---|
1211 | 1303 | /* |
---|
1212 | 1304 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1244 | 1336 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1245 | 1337 | //tmp.setName("Edit"); |
---|
1246 | 1338 | objectPanel.add(materialPanel); |
---|
1247 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1248 | | - north.setName("Edit"); |
---|
1249 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1250 | | - objectPanel.add(north); |
---|
| 1339 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1340 | +// north.setName("Edit"); |
---|
| 1341 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1342 | +// objectPanel.add(north); |
---|
| 1343 | + objectPanel.add(ctrlPanel); |
---|
1251 | 1344 | objectPanel.add(infoPanel); |
---|
1252 | 1345 | |
---|
1253 | 1346 | /* |
---|
.. | .. |
---|
1268 | 1361 | scrollpane.setWheelScrollingEnabled(true); |
---|
1269 | 1362 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1270 | 1363 | |
---|
1271 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1272 | | - scenePanel.add(scrollpane); |
---|
| 1364 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1365 | + scenePanel.preferredWidth = 6; |
---|
| 1366 | + |
---|
| 1367 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1368 | + tabbedPane.add(scrollpane); |
---|
1273 | 1369 | |
---|
1274 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
| 1370 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1275 | 1371 | |
---|
1276 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1372 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1277 | 1373 | |
---|
1278 | 1374 | optionsPanel.setName("Options"); |
---|
1279 | | - scenePanel.add(optionsPanel); |
---|
1280 | | - |
---|
| 1375 | + |
---|
| 1376 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1377 | + |
---|
| 1378 | + tabbedPane.add(optionsPanel); |
---|
| 1379 | + |
---|
| 1380 | + scenePanel.add(tabbedPane); |
---|
1281 | 1381 | |
---|
1282 | 1382 | /* |
---|
1283 | 1383 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1311 | 1411 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1312 | 1412 | //bigPanel.add(ctrlPanel); |
---|
1313 | 1413 | //bigPanel.add(gridPanel); |
---|
| 1414 | + /** |
---|
1314 | 1415 | bigThree = new JPanel(); |
---|
1315 | 1416 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1316 | 1417 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1334 | 1435 | // aConstraints.gridheight = 3; |
---|
1335 | 1436 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1336 | 1437 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1438 | + /**/ |
---|
1337 | 1439 | |
---|
| 1440 | + bigThree = new cGridBag(); |
---|
| 1441 | + bigThree.addComponent(scenePanel); |
---|
| 1442 | + bigThree.addComponent(centralPanel); |
---|
| 1443 | + bigThree.addComponent(XYZPanel); |
---|
| 1444 | + |
---|
1338 | 1445 | // // SIDE EFFECT!!! |
---|
1339 | 1446 | // aConstraints.gridx = 0; |
---|
1340 | 1447 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1355 | 1462 | //worldPane.add(bigPanel); |
---|
1356 | 1463 | //worldPane.add(worldPanel); |
---|
1357 | 1464 | /**/ |
---|
1358 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1465 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1466 | + frame.add(/*"Center",*/framePanel); |
---|
1359 | 1467 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1360 | 1468 | |
---|
1361 | 1469 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1362 | 1470 | |
---|
1363 | | - frame.setSize(1024, 768); |
---|
1364 | | - frame.show(); |
---|
| 1471 | + frame.setSize(1280, 860); |
---|
| 1472 | + frame.setVisible(true); |
---|
1365 | 1473 | |
---|
| 1474 | + cameraView.requestFocusInWindow(); |
---|
| 1475 | + |
---|
1366 | 1476 | gridPanel.setDividerLocation(1.0); |
---|
1367 | 1477 | |
---|
1368 | 1478 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1376 | 1486 | }); |
---|
1377 | 1487 | } |
---|
1378 | 1488 | |
---|
| 1489 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1490 | + { |
---|
| 1491 | + } |
---|
| 1492 | + |
---|
1379 | 1493 | JTree GetTree() |
---|
1380 | 1494 | { |
---|
1381 | 1495 | return objEditor.jTree; |
---|
.. | .. |
---|
1387 | 1501 | ctrlPanel.removeAll(); |
---|
1388 | 1502 | } |
---|
1389 | 1503 | |
---|
1390 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1504 | + void SetupMaterial(cGridBag panel) |
---|
1391 | 1505 | { |
---|
1392 | | - aConstraints.weighty = 0; |
---|
1393 | | - //aConstraints.weightx = 1; |
---|
1394 | | - /* |
---|
| 1506 | + /* |
---|
1395 | 1507 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1396 | 1508 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1397 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1398 | | - aConstraints.gridx += 1; |
---|
1399 | 1509 | */ |
---|
1400 | 1510 | |
---|
1401 | | - aConstraints.gridwidth = 1; |
---|
1402 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1403 | | - aConstraints.gridx += 1; |
---|
1404 | | - aConstraints.weighty = 0; |
---|
1405 | | - aConstraints.gridwidth = 1; |
---|
| 1511 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1512 | + |
---|
| 1513 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1514 | + createMaterialButton.setToolTipText("Create material"); |
---|
1406 | 1515 | |
---|
1407 | 1516 | /* |
---|
1408 | 1517 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1409 | | - aConstraints.gridx += 1; |
---|
1410 | | - aConstraints.weighty = 0; |
---|
1411 | | - aConstraints.gridwidth = 1; |
---|
1412 | 1518 | */ |
---|
1413 | 1519 | |
---|
1414 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1415 | | - aConstraints.gridx += 1; |
---|
| 1520 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1521 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1522 | + |
---|
| 1523 | + if (Globals.ADVANCED) |
---|
| 1524 | + { |
---|
| 1525 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1526 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1527 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1528 | + } |
---|
1416 | 1529 | |
---|
1417 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1418 | | - |
---|
1419 | | - aConstraints.gridx += 1; |
---|
1420 | | - |
---|
1421 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1422 | | - |
---|
1423 | | - aConstraints.gridx += 1; |
---|
1424 | | - |
---|
1425 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1426 | | - |
---|
1427 | | - aConstraints.gridx = 0; |
---|
1428 | | - aConstraints.gridy += 1; |
---|
1429 | | - aConstraints.weighty = 0; |
---|
1430 | | - aConstraints.gridwidth = 1; |
---|
| 1530 | + editBar.preferredHeight = 15; |
---|
| 1531 | + |
---|
| 1532 | + panel.add(editBar); |
---|
| 1533 | + |
---|
1431 | 1534 | /**/ |
---|
1432 | 1535 | //aConstraints.weighty = 0; |
---|
1433 | 1536 | ////aConstraints.weightx = 1; |
---|
1434 | 1537 | //aConstraints.weighty = 1; |
---|
1435 | 1538 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1436 | 1539 | //aConstraints.gridx += 1; |
---|
1437 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1438 | | - aConstraints.weighty = 0; |
---|
1439 | | - aConstraints.gridx = 0; |
---|
1440 | | - aConstraints.gridy += 1; |
---|
1441 | | - aConstraints.gridwidth = 1; |
---|
| 1540 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1442 | 1541 | |
---|
1443 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1444 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1445 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1446 | | - aConstraints.gridx += 1; |
---|
1447 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1448 | | - //aConstraints.weightx = 0; |
---|
1449 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1450 | | - aConstraints.gridx = 0; |
---|
1451 | | - aConstraints.gridy += 1; |
---|
1452 | | - aConstraints.gridwidth = 1; |
---|
| 1542 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1543 | + |
---|
| 1544 | + cGridBag color = new cGridBag(); |
---|
| 1545 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1546 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1547 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1548 | + //colorField.preferredWidth = 200; |
---|
| 1549 | + colorSection.add(color); |
---|
1453 | 1550 | |
---|
1454 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1455 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1456 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1457 | | - aConstraints.gridx += 1; |
---|
1458 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1459 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1460 | | - aConstraints.gridx = 0; |
---|
1461 | | - aConstraints.gridy += 1; |
---|
1462 | | - aConstraints.gridwidth = 1; |
---|
| 1551 | + cGridBag modulation = new cGridBag(); |
---|
| 1552 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1553 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1554 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1555 | + colorSection.add(modulation); |
---|
1463 | 1556 | |
---|
1464 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1465 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1466 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1467 | | - aConstraints.gridx += 1; |
---|
1468 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1469 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1470 | | - aConstraints.gridx = 0; |
---|
1471 | | - aConstraints.gridy += 1; |
---|
1472 | | - aConstraints.gridwidth = 1; |
---|
| 1557 | + cGridBag texture = new cGridBag(); |
---|
| 1558 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1559 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1560 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1561 | + colorSection.add(texture); |
---|
1473 | 1562 | |
---|
1474 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1475 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1476 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1477 | | - aConstraints.gridx += 1; |
---|
1478 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1479 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1480 | | - aConstraints.gridx = 0; |
---|
1481 | | - aConstraints.gridy += 1; |
---|
1482 | | - aConstraints.gridwidth = 1; |
---|
| 1563 | + cGridBag anisoU = new cGridBag(); |
---|
| 1564 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1565 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1566 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1567 | + colorSection.add(anisoU); |
---|
1483 | 1568 | |
---|
1484 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1485 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1486 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1487 | | - aConstraints.gridx += 1; |
---|
1488 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1489 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1490 | | - aConstraints.gridx = 0; |
---|
1491 | | - aConstraints.gridy += 1; |
---|
1492 | | - aConstraints.gridwidth = 1; |
---|
| 1569 | + cGridBag anisoV = new cGridBag(); |
---|
| 1570 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1571 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1572 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1573 | + colorSection.add(anisoV); |
---|
1493 | 1574 | |
---|
1494 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1495 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1496 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1497 | | - aConstraints.gridx += 1; |
---|
1498 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1499 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1500 | | - aConstraints.gridx = 0; |
---|
1501 | | - aConstraints.gridy += 1; |
---|
1502 | | - aConstraints.gridwidth = 1; |
---|
| 1575 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1576 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1577 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1578 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1579 | + colorSection.add(shadowbias); |
---|
1503 | 1580 | |
---|
1504 | | - //aConstraints.weighty = 1; |
---|
1505 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1506 | | - //aConstraints.gridx += 1; |
---|
1507 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1508 | | - aConstraints.weighty = 0; |
---|
1509 | | - aConstraints.gridx = 0; |
---|
1510 | | - aConstraints.gridy += 1; |
---|
1511 | | - aConstraints.gridwidth = 1; |
---|
| 1581 | + panel.add(new JSeparator()); |
---|
| 1582 | + |
---|
| 1583 | + panel.add(colorSection); |
---|
| 1584 | + |
---|
| 1585 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1586 | + |
---|
| 1587 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1588 | + |
---|
| 1589 | + cGridBag diffuse = new cGridBag(); |
---|
| 1590 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1591 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1592 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1593 | + diffuseSection.add(diffuse); |
---|
1512 | 1594 | |
---|
1513 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1514 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1515 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1516 | | - aConstraints.gridx += 1; |
---|
1517 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1518 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1519 | | - aConstraints.gridx = 0; |
---|
1520 | | - aConstraints.gridy += 1; |
---|
1521 | | - aConstraints.gridwidth = 1; |
---|
| 1595 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1596 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1597 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1598 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1599 | + diffuseSection.add(diffuseness); |
---|
1522 | 1600 | |
---|
1523 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1524 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1525 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1526 | | - aConstraints.gridx += 1; |
---|
1527 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1528 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1529 | | - aConstraints.gridx = 0; |
---|
1530 | | - aConstraints.gridy += 1; |
---|
1531 | | - aConstraints.gridwidth = 1; |
---|
| 1601 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1602 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1603 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1604 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1605 | + diffuseSection.add(selfshadow); |
---|
1532 | 1606 | |
---|
1533 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1534 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1535 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1536 | | - aConstraints.gridx += 1; |
---|
1537 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1538 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1539 | | - aConstraints.gridx = 0; |
---|
1540 | | - aConstraints.gridy += 1; |
---|
1541 | | - aConstraints.gridwidth = 1; |
---|
| 1607 | + cGridBag sheen = new cGridBag(); |
---|
| 1608 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1609 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1610 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1611 | + diffuseSection.add(sheen); |
---|
1542 | 1612 | |
---|
1543 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1544 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1545 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1546 | | - aConstraints.gridx += 1; |
---|
1547 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1548 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1549 | | - aConstraints.gridx = 0; |
---|
1550 | | - aConstraints.gridy += 1; |
---|
1551 | | - aConstraints.gridwidth = 1; |
---|
| 1613 | + cGridBag subsurface = new cGridBag(); |
---|
| 1614 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1615 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1616 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1617 | + diffuseSection.add(subsurface); |
---|
1552 | 1618 | |
---|
1553 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1554 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1555 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1556 | | - aConstraints.gridx += 1; |
---|
1557 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1558 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1559 | | - aConstraints.gridx = 0; |
---|
1560 | | - aConstraints.gridy += 1; |
---|
1561 | | - aConstraints.gridwidth = 1; |
---|
| 1619 | + cGridBag shadow = new cGridBag(); |
---|
| 1620 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1621 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1622 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1623 | + diffuseSection.add(shadow); |
---|
1562 | 1624 | |
---|
1563 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1564 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1565 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1566 | | - aConstraints.gridx += 1; |
---|
1567 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1568 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1569 | | - aConstraints.gridx = 0; |
---|
1570 | | - aConstraints.gridy += 1; |
---|
1571 | | - aConstraints.gridwidth = 1; |
---|
| 1625 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1626 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1627 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1628 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1629 | + diffuseSection.add(fakedepth); |
---|
1572 | 1630 | |
---|
1573 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1574 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1575 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1576 | | - aConstraints.gridx += 1; |
---|
1577 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1578 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1579 | | - aConstraints.gridx = 0; |
---|
1580 | | - aConstraints.gridy += 1; |
---|
1581 | | - aConstraints.gridwidth = 1; |
---|
| 1631 | + panel.add(new JSeparator()); |
---|
| 1632 | + |
---|
| 1633 | + panel.add(diffuseSection); |
---|
| 1634 | + |
---|
| 1635 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1636 | + |
---|
| 1637 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1582 | 1638 | |
---|
1583 | | - //aConstraints.weighty = 1; |
---|
1584 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1585 | | - //aConstraints.gridx += 1; |
---|
1586 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1587 | | - aConstraints.weighty = 0; |
---|
1588 | | - aConstraints.gridx = 0; |
---|
1589 | | - aConstraints.gridy += 1; |
---|
1590 | | - aConstraints.gridwidth = 1; |
---|
| 1639 | + cGridBag specular = new cGridBag(); |
---|
| 1640 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1641 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1642 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1643 | + specularSection.add(specular); |
---|
1591 | 1644 | |
---|
1592 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1593 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1594 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1595 | | - aConstraints.gridx += 1; |
---|
1596 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1597 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1598 | | - aConstraints.gridx = 0; |
---|
1599 | | - aConstraints.gridy += 1; |
---|
1600 | | - aConstraints.gridwidth = 1; |
---|
| 1645 | + cGridBag lightarea = new cGridBag(); |
---|
| 1646 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1647 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1648 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1649 | + specularSection.add(lightarea); |
---|
1601 | 1650 | |
---|
1602 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1603 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1604 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1605 | | - aConstraints.gridx += 1; |
---|
1606 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1607 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1608 | | - aConstraints.gridx = 0; |
---|
1609 | | - aConstraints.gridy += 1; |
---|
1610 | | - aConstraints.gridwidth = 1; |
---|
| 1651 | + cGridBag shininess = new cGridBag(); |
---|
| 1652 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1653 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1654 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1655 | + specularSection.add(shininess); |
---|
1611 | 1656 | |
---|
1612 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1613 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1614 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1615 | | - aConstraints.gridx += 1; |
---|
1616 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1617 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1618 | | - aConstraints.gridx = 0; |
---|
1619 | | - aConstraints.gridy += 1; |
---|
1620 | | - aConstraints.gridwidth = 1; |
---|
| 1657 | + cGridBag metalness = new cGridBag(); |
---|
| 1658 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1659 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1660 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1661 | + specularSection.add(metalness); |
---|
1621 | 1662 | |
---|
1622 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1623 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1624 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1625 | | - aConstraints.gridx += 1; |
---|
1626 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1627 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1628 | | - aConstraints.gridx = 0; |
---|
1629 | | - aConstraints.gridy += 1; |
---|
1630 | | - aConstraints.gridwidth = 1; |
---|
| 1663 | + cGridBag velvet = new cGridBag(); |
---|
| 1664 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1665 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1666 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1667 | + specularSection.add(velvet); |
---|
1631 | 1668 | |
---|
1632 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1633 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1634 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1635 | | - aConstraints.gridx += 1; |
---|
1636 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1637 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1638 | | - aConstraints.gridx = 0; |
---|
1639 | | - aConstraints.gridy += 1; |
---|
1640 | | - aConstraints.gridwidth = 1; |
---|
1641 | | - |
---|
1642 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1643 | | - Return(); |
---|
| 1669 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1670 | + //Return(); |
---|
1644 | 1671 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1645 | 1672 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1646 | 1673 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1651 | 1678 | // aConstraints.gridy += 1; |
---|
1652 | 1679 | // aConstraints.gridwidth = 1; |
---|
1653 | 1680 | |
---|
1654 | | - //aConstraints.weighty = 1; |
---|
1655 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1656 | | - //aConstraints.gridx += 1; |
---|
1657 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1658 | | - aConstraints.weighty = 0; |
---|
1659 | | - aConstraints.gridx = 0; |
---|
1660 | | - aConstraints.gridy += 1; |
---|
1661 | | - aConstraints.gridwidth = 1; |
---|
1662 | 1681 | |
---|
1663 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1664 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1665 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1666 | | - aConstraints.gridx += 1; |
---|
1667 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1668 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1669 | | - aConstraints.gridx = 0; |
---|
1670 | | - aConstraints.gridy += 1; |
---|
1671 | | - aConstraints.gridwidth = 1; |
---|
| 1682 | + panel.add(new JSeparator()); |
---|
| 1683 | + |
---|
| 1684 | + panel.add(specularSection); |
---|
| 1685 | + |
---|
| 1686 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1687 | + |
---|
| 1688 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1672 | 1689 | |
---|
1673 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1674 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1675 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1676 | | - aConstraints.gridx += 1; |
---|
1677 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1678 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1679 | | - aConstraints.gridx = 0; |
---|
1680 | | - aConstraints.gridy += 1; |
---|
1681 | | - aConstraints.gridwidth = 1; |
---|
| 1690 | + cGridBag camera = new cGridBag(); |
---|
| 1691 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1692 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1693 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1694 | + globalSection.add(camera); |
---|
1682 | 1695 | |
---|
1683 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1684 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1685 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1686 | | - aConstraints.gridx += 1; |
---|
1687 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1688 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1689 | | - aConstraints.gridx = 0; |
---|
1690 | | - aConstraints.gridy += 1; |
---|
1691 | | - aConstraints.gridwidth = 1; |
---|
| 1696 | + cGridBag ambient = new cGridBag(); |
---|
| 1697 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1698 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1699 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1700 | + globalSection.add(ambient); |
---|
1692 | 1701 | |
---|
1693 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1694 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1695 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1696 | | - aConstraints.gridx += 1; |
---|
1697 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1698 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1699 | | - aConstraints.gridx = 0; |
---|
1700 | | - aConstraints.gridy += 1; |
---|
1701 | | - aConstraints.gridwidth = 1; |
---|
1702 | | - aConstraints.weighty = 0; |
---|
| 1702 | + cGridBag backlit = new cGridBag(); |
---|
| 1703 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1704 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1705 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1706 | + globalSection.add(backlit); |
---|
1703 | 1707 | |
---|
1704 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1705 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1706 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1707 | | - aConstraints.gridx += 1; |
---|
1708 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1709 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1710 | | - aConstraints.gridx = 0; |
---|
1711 | | - aConstraints.gridy += 1; |
---|
1712 | | - aConstraints.gridwidth = 1; |
---|
| 1708 | + cGridBag opacity = new cGridBag(); |
---|
| 1709 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1710 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1711 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1712 | + globalSection.add(opacity); |
---|
1713 | 1713 | |
---|
1714 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1715 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1716 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1717 | | - aConstraints.gridx += 1; |
---|
1718 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1719 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1720 | | - aConstraints.gridx = 0; |
---|
1721 | | - aConstraints.gridy += 1; |
---|
1722 | | - aConstraints.gridwidth = 1; |
---|
| 1714 | + panel.add(new JSeparator()); |
---|
| 1715 | + |
---|
| 1716 | + panel.add(globalSection); |
---|
| 1717 | + |
---|
| 1718 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1719 | + |
---|
| 1720 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1723 | 1721 | |
---|
1724 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1725 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1726 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1727 | | - aConstraints.gridx += 1; |
---|
1728 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1729 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1730 | | - aConstraints.gridx = 0; |
---|
1731 | | - aConstraints.gridy += 1; |
---|
1732 | | - aConstraints.gridwidth = 1; |
---|
| 1722 | + cGridBag bump = new cGridBag(); |
---|
| 1723 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1724 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1725 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1726 | + textureSection.add(bump); |
---|
1733 | 1727 | |
---|
1734 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1735 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1736 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1737 | | - aConstraints.gridx += 1; |
---|
1738 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1739 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1740 | | - aConstraints.gridx = 0; |
---|
1741 | | - aConstraints.gridy += 1; |
---|
1742 | | - aConstraints.gridwidth = 1; |
---|
| 1728 | + cGridBag noise = new cGridBag(); |
---|
| 1729 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1730 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1731 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1732 | + textureSection.add(noise); |
---|
1743 | 1733 | |
---|
1744 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1745 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1746 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1747 | | - aConstraints.gridx += 1; |
---|
1748 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1749 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1750 | | - aConstraints.gridx = 0; |
---|
1751 | | - aConstraints.gridy += 1; |
---|
1752 | | - aConstraints.gridwidth = 1; |
---|
| 1734 | + cGridBag power = new cGridBag(); |
---|
| 1735 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1736 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1737 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1738 | + textureSection.add(power); |
---|
1753 | 1739 | |
---|
1754 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1755 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1756 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1757 | | - aConstraints.gridx += 1; |
---|
1758 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1759 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1760 | | - aConstraints.gridx = 0; |
---|
1761 | | - aConstraints.gridy += 1; |
---|
1762 | | - aConstraints.gridwidth = 1; |
---|
| 1740 | + cGridBag borderfade = new cGridBag(); |
---|
| 1741 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1742 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1743 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1744 | + textureSection.add(borderfade); |
---|
1763 | 1745 | |
---|
1764 | | - //aConstraints.weighty = 1; |
---|
1765 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1766 | | - //aConstraints.gridx += 1; |
---|
1767 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1768 | | - aConstraints.weighty = 0; |
---|
| 1746 | + cGridBag fog = new cGridBag(); |
---|
| 1747 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1748 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1749 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1750 | + textureSection.add(fog); |
---|
1769 | 1751 | |
---|
1770 | | - aConstraints.gridx = 0; |
---|
1771 | | - aConstraints.gridy = 0; |
---|
1772 | | - aConstraints.gridwidth = 1; |
---|
| 1752 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1753 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1754 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1755 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1756 | + textureSection.add(opacityPower); |
---|
| 1757 | + |
---|
| 1758 | + panel.add(new JSeparator()); |
---|
| 1759 | + |
---|
| 1760 | + panel.add(textureSection); |
---|
| 1761 | + |
---|
| 1762 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1773 | 1763 | |
---|
1774 | 1764 | SetMaterial(copy); // .GetMaterial()); |
---|
1775 | 1765 | |
---|
1776 | | - colorField.addChangeListener(this); |
---|
1777 | | - modulationField.addChangeListener(this); |
---|
| 1766 | + //colorField.addChangeListener(this); |
---|
| 1767 | +// modulationField.addChangeListener(this); |
---|
1778 | 1768 | metalnessField.addChangeListener(this); |
---|
1779 | 1769 | diffuseField.addChangeListener(this); |
---|
1780 | 1770 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1804 | 1794 | opacityPowerField.addChangeListener(this); |
---|
1805 | 1795 | /**/ |
---|
1806 | 1796 | |
---|
1807 | | - resetSlidersButton.addActionListener(this); |
---|
1808 | 1797 | clearMaterialButton.addActionListener(this); |
---|
1809 | 1798 | createMaterialButton.addActionListener(this); |
---|
1810 | | - |
---|
1811 | | - propagateToggle.addItemListener(this); |
---|
1812 | | - multiplyToggle.addItemListener(this); |
---|
| 1799 | + |
---|
| 1800 | + if (Globals.ADVANCED) |
---|
| 1801 | + { |
---|
| 1802 | + resetSlidersButton.addActionListener(this); |
---|
| 1803 | + propagateToggle.addItemListener(this); |
---|
| 1804 | + multiplyToggle.addItemListener(this); |
---|
| 1805 | + } |
---|
1813 | 1806 | } |
---|
1814 | 1807 | |
---|
1815 | 1808 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1980 | 1973 | |
---|
1981 | 1974 | //? flashIt = false; |
---|
1982 | 1975 | CameraPane pane = (CameraPane) cameraView; |
---|
1983 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 1976 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1984 | 1977 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1985 | 1978 | |
---|
1986 | 1979 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2029 | 2022 | e2.printStackTrace(); |
---|
2030 | 2023 | } |
---|
2031 | 2024 | } |
---|
| 2025 | + |
---|
2032 | 2026 | LoadJMEThread loadThread; |
---|
2033 | 2027 | |
---|
2034 | 2028 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2086 | 2080 | //LoadFile0(filename, converter); |
---|
2087 | 2081 | } |
---|
2088 | 2082 | } |
---|
| 2083 | + |
---|
2089 | 2084 | LoadOBJThread loadObjThread; |
---|
2090 | 2085 | |
---|
2091 | 2086 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2164 | 2159 | |
---|
2165 | 2160 | void LoadObjFile(String fullname) |
---|
2166 | 2161 | { |
---|
2167 | | - /* |
---|
| 2162 | + System.out.println("Loading " + fullname); |
---|
| 2163 | + /**/ |
---|
2168 | 2164 | //lastFilename = fullname; |
---|
2169 | 2165 | if(loadObjThread == null) |
---|
2170 | 2166 | { |
---|
2171 | | - loadObjThread = new LoadOBJThread(); |
---|
2172 | | - loadObjThread.start(); |
---|
| 2167 | + loadObjThread = new LoadOBJThread(); |
---|
| 2168 | + loadObjThread.start(); |
---|
2173 | 2169 | } |
---|
2174 | 2170 | |
---|
2175 | 2171 | loadObjThread.add(fullname); |
---|
2176 | | - */ |
---|
| 2172 | + /**/ |
---|
2177 | 2173 | |
---|
2178 | | - System.out.println("Loading " + fullname); |
---|
2179 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2174 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2180 | 2175 | } |
---|
2181 | 2176 | |
---|
2182 | 2177 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2437 | 2432 | |
---|
2438 | 2433 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2439 | 2434 | { |
---|
2440 | | - if (GrafreeD.standAlone) |
---|
| 2435 | + if (Grafreed.standAlone) |
---|
2441 | 2436 | { |
---|
2442 | 2437 | /**/ |
---|
2443 | 2438 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2444 | | - browser.show(); |
---|
| 2439 | + browser.setVisible(true); |
---|
2445 | 2440 | String filename = browser.getFile(); |
---|
2446 | 2441 | if (filename != null && filename.length() > 0) |
---|
2447 | 2442 | { |
---|
.. | .. |
---|
2586 | 2581 | } |
---|
2587 | 2582 | if (input == null) |
---|
2588 | 2583 | { |
---|
| 2584 | + new Exception().printStackTrace(); |
---|
2589 | 2585 | System.exit(0); |
---|
2590 | 2586 | } |
---|
2591 | 2587 | |
---|
.. | .. |
---|
2800 | 2796 | return; |
---|
2801 | 2797 | } |
---|
2802 | 2798 | |
---|
2803 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2799 | + if (multiplyToggle != null) |
---|
| 2800 | + multiplyToggle.setSelected(mat.multiply); |
---|
2804 | 2801 | |
---|
2805 | 2802 | assert (object.projectedVertices != null); |
---|
2806 | 2803 | |
---|
.. | .. |
---|
2989 | 2986 | if (timeline) |
---|
2990 | 2987 | { |
---|
2991 | 2988 | centralPanel.remove(cameraView); |
---|
2992 | | - centralPanel.add(timelinePanel); |
---|
| 2989 | + cameraPanel.add(cameraView); |
---|
| 2990 | + centralPanel.add(cameraPanel); |
---|
2993 | 2991 | frame.setJMenuBar(timelineMenubar); |
---|
2994 | 2992 | wasFullScreen = CameraPane.FULLSCREEN; |
---|
2995 | 2993 | if (!CameraPane.FULLSCREEN) |
---|
.. | .. |
---|
2998 | 2996 | } |
---|
2999 | 2997 | else |
---|
3000 | 2998 | { |
---|
3001 | | - centralPanel.remove(timelinePanel); |
---|
| 2999 | + centralPanel.remove(cameraPanel); |
---|
3002 | 3000 | centralPanel.add(cameraView); |
---|
3003 | 3001 | frame.setJMenuBar(null); |
---|
3004 | 3002 | if (!wasFullScreen) |
---|
.. | .. |
---|
3014 | 3012 | frame.validate(); |
---|
3015 | 3013 | |
---|
3016 | 3014 | return; |
---|
3017 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3015 | + } else if (event.getSource() == toggleSwitchItem) |
---|
3018 | 3016 | { |
---|
3019 | | - cameraView.ToggleRandom(); |
---|
| 3017 | + cameraView.ToggleSwitch(); |
---|
3020 | 3018 | cameraView.repaint(); |
---|
3021 | 3019 | return; |
---|
3022 | 3020 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3045 | 3043 | { |
---|
3046 | 3044 | copy.live ^= true; |
---|
3047 | 3045 | return; |
---|
| 3046 | + } else if (event.getSource() == selectCB) |
---|
| 3047 | + { |
---|
| 3048 | + copy.dontselect ^= true; |
---|
| 3049 | + return; |
---|
3048 | 3050 | } else if (event.getSource() == hideCB) |
---|
3049 | 3051 | { |
---|
3050 | 3052 | copy.hide ^= true; |
---|
.. | .. |
---|
3059 | 3061 | if (event.getSource() == randomCB) |
---|
3060 | 3062 | { |
---|
3061 | 3063 | copy.random ^= true; |
---|
| 3064 | + objEditor.refreshContents(); |
---|
3062 | 3065 | return; |
---|
3063 | 3066 | } |
---|
3064 | 3067 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3082 | 3085 | |
---|
3083 | 3086 | public void actionPerformed(ActionEvent event) |
---|
3084 | 3087 | { |
---|
| 3088 | + Object source = event.getSource(); |
---|
3085 | 3089 | // SCRIPT DIALOG |
---|
3086 | | - if (event.getSource() == okbutton) |
---|
| 3090 | + if (source == okbutton) |
---|
3087 | 3091 | { |
---|
3088 | 3092 | textpanel.setVisible(false); |
---|
3089 | 3093 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3095 | 3099 | textarea = null; |
---|
3096 | 3100 | textpanel = null; |
---|
3097 | 3101 | } |
---|
3098 | | - if (event.getSource() == cancelbutton) |
---|
| 3102 | + if (source == cancelbutton) |
---|
3099 | 3103 | { |
---|
3100 | 3104 | textpanel.setVisible(false); |
---|
3101 | 3105 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3107 | 3111 | //applySelf(); |
---|
3108 | 3112 | //client.refreshEditWindow(); |
---|
3109 | 3113 | //refreshContents(); |
---|
3110 | | - if (event.getSource() == nameField) |
---|
| 3114 | + if (source == nameField) |
---|
3111 | 3115 | { |
---|
3112 | 3116 | //System.out.println("ObjEditor " + event); |
---|
3113 | 3117 | applySelf0(true); |
---|
3114 | 3118 | //parent.applySelf(); |
---|
3115 | 3119 | objEditor.refreshContents(); |
---|
3116 | | - } else if (event.getSource() == resetButton) |
---|
| 3120 | + } else if (source == resetButton) |
---|
3117 | 3121 | { |
---|
3118 | 3122 | CameraPane.fullreset = true; |
---|
3119 | 3123 | copy.Reset(); // ResetMeshes(); |
---|
3120 | 3124 | copy.Touch(); |
---|
3121 | 3125 | objEditor.refreshContents(); |
---|
3122 | | - } else if (event.getSource() == stepItem) |
---|
| 3126 | + } else if (source == stepItem) |
---|
3123 | 3127 | { |
---|
3124 | | - cameraView.ONESTEP = true; |
---|
| 3128 | + //cameraView.ONESTEP = true; |
---|
| 3129 | + Globals.ONESTEP = true; |
---|
3125 | 3130 | cameraView.repaint(); |
---|
3126 | 3131 | return; |
---|
3127 | | - } else if (event.getSource() == stepButton) |
---|
| 3132 | + } else if (source == stepButton) |
---|
3128 | 3133 | { |
---|
3129 | 3134 | copy.Step(); |
---|
3130 | 3135 | copy.Touch(); |
---|
3131 | 3136 | objEditor.refreshContents(); |
---|
3132 | | - } else if (event.getSource() == slowerButton) |
---|
| 3137 | + } else if (source == slowerButton) |
---|
3133 | 3138 | { |
---|
3134 | 3139 | copy.Slower(); |
---|
3135 | 3140 | copy.Touch(); |
---|
3136 | 3141 | objEditor.refreshContents(); |
---|
3137 | | - } else if (event.getSource() == fasterButton) |
---|
| 3142 | + } else if (source == fasterButton) |
---|
3138 | 3143 | { |
---|
3139 | 3144 | copy.Faster(); |
---|
3140 | 3145 | copy.Touch(); |
---|
3141 | 3146 | objEditor.refreshContents(); |
---|
3142 | | - } else if (event.getSource() == remarkButton) |
---|
| 3147 | + } else if (source == remarkButton) |
---|
3143 | 3148 | { |
---|
3144 | 3149 | copy.Remark(); |
---|
3145 | 3150 | copy.Touch(); |
---|
3146 | 3151 | objEditor.refreshContents(); |
---|
3147 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3152 | + } else if (source == stepAllButton) |
---|
3148 | 3153 | { |
---|
3149 | 3154 | copy.StepAll(); |
---|
3150 | 3155 | copy.Touch(); |
---|
3151 | 3156 | objEditor.refreshContents(); |
---|
3152 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3157 | + } else if (source == resetAllButton) |
---|
3153 | 3158 | { |
---|
3154 | 3159 | //CameraPane.fullreset = true; |
---|
3155 | 3160 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3182 | 3187 | // Close(); |
---|
3183 | 3188 | // } |
---|
3184 | 3189 | // else |
---|
3185 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3190 | + if (source == resetSlidersButton) |
---|
3186 | 3191 | { |
---|
3187 | 3192 | ResetSliders(); |
---|
3188 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3193 | + } else if (source == clearMaterialButton) |
---|
3189 | 3194 | { |
---|
3190 | 3195 | ClearMaterial(); |
---|
3191 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3196 | + } else if (source == createMaterialButton) |
---|
3192 | 3197 | { |
---|
3193 | 3198 | CreateMaterial(); |
---|
3194 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3199 | + } else if (source == clearPanelButton) |
---|
3195 | 3200 | { |
---|
3196 | 3201 | copy.ClearUI(); |
---|
3197 | 3202 | refreshContents(true); |
---|
3198 | | - } /* |
---|
3199 | | - } |
---|
3200 | | - |
---|
3201 | | - public boolean action(Event event, Object arg) |
---|
3202 | | - { |
---|
3203 | | - */ else if (event.getSource() == closeItem) |
---|
| 3203 | + } else if (source == importGFDItem) |
---|
| 3204 | + { |
---|
| 3205 | + ImportGFD(); |
---|
| 3206 | + } else |
---|
| 3207 | + if (source == importVRMLX3DItem) |
---|
| 3208 | + { |
---|
| 3209 | + ImportVRMLX3D(); |
---|
| 3210 | + } else |
---|
| 3211 | + if (source == import3DSItem) |
---|
| 3212 | + { |
---|
| 3213 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3214 | + } else |
---|
| 3215 | + if (source == importOBJItem) |
---|
| 3216 | + { |
---|
| 3217 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3218 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3219 | + browser.setVisible(true); |
---|
| 3220 | + String filename = browser.getFile(); |
---|
| 3221 | + if (filename != null && filename.length() > 0) |
---|
| 3222 | + { |
---|
| 3223 | + String fullname = browser.getDirectory() + filename; |
---|
| 3224 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3225 | + } |
---|
| 3226 | + } else |
---|
| 3227 | + if (source == closeItem) |
---|
3204 | 3228 | { |
---|
3205 | 3229 | Close(); |
---|
3206 | 3230 | //return true; |
---|
3207 | | - } else if (event.getSource() == loadItem) |
---|
| 3231 | + } else if (source == loadItem) |
---|
3208 | 3232 | { |
---|
3209 | 3233 | load(); |
---|
3210 | 3234 | //return true; |
---|
3211 | | - } else if (event.getSource() == saveItem) |
---|
| 3235 | + } else if (source == newItem) |
---|
| 3236 | + { |
---|
| 3237 | + New(); |
---|
| 3238 | + } else if (source == saveItem) |
---|
3212 | 3239 | { |
---|
3213 | 3240 | save(); |
---|
3214 | 3241 | //return true; |
---|
3215 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3242 | + } else if (source == saveAsItem) |
---|
3216 | 3243 | { |
---|
3217 | 3244 | saveAs(); |
---|
3218 | 3245 | //return true; |
---|
3219 | | - } else if (event.getSource() == reexportItem) |
---|
| 3246 | + } else if (source == reexportItem) |
---|
3220 | 3247 | { |
---|
3221 | 3248 | reexport(); |
---|
3222 | 3249 | //return true; |
---|
3223 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3250 | + } else if (source == exportAsItem) |
---|
3224 | 3251 | { |
---|
3225 | 3252 | export(); |
---|
3226 | 3253 | //return true; |
---|
3227 | | - } else if (event.getSource() == povItem) |
---|
| 3254 | + } else if (source == povItem) |
---|
3228 | 3255 | { |
---|
3229 | 3256 | generatePOV(); |
---|
3230 | 3257 | //return true; |
---|
3231 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3258 | + } else if (source == zBufferItem) |
---|
3232 | 3259 | { |
---|
3233 | 3260 | try |
---|
3234 | 3261 | { |
---|
.. | .. |
---|
3250 | 3277 | cameraView.repaint(); |
---|
3251 | 3278 | //return true; |
---|
3252 | 3279 | } |
---|
3253 | | - */ else if (event.getSource() == editCameraItem) |
---|
3254 | | - { |
---|
3255 | | - cameraView.ProtectCamera(); |
---|
3256 | | - cameraView.repaint(); |
---|
3257 | | - return; |
---|
3258 | | - } else if (event.getSource() == revertCameraItem) |
---|
3259 | | - { |
---|
3260 | | - cameraView.RevertCamera(); |
---|
3261 | | - cameraView.repaint(); |
---|
3262 | | - return; |
---|
3263 | | -// } else if (event.getSource() == textureButton) |
---|
3264 | | -// { |
---|
3265 | | -// return; // true; |
---|
3266 | | - } else // combos... |
---|
3267 | | - if (event.getSource() == texresMenu) |
---|
| 3280 | + */ else // combos... |
---|
| 3281 | + if (source == texresMenu) |
---|
3268 | 3282 | { |
---|
3269 | 3283 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3270 | 3284 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3276 | 3290 | } |
---|
3277 | 3291 | } |
---|
3278 | 3292 | |
---|
3279 | | - void ToggleAnimation() |
---|
| 3293 | + void New() |
---|
3280 | 3294 | { |
---|
3281 | | - if (!CameraPane.ANIMATION) |
---|
| 3295 | + while (copy.Size() > 1) |
---|
3282 | 3296 | { |
---|
3283 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3297 | + copy.remove(1); |
---|
| 3298 | + } |
---|
| 3299 | + |
---|
| 3300 | + ResetModel(); |
---|
| 3301 | + objEditor.refreshContents(); |
---|
| 3302 | + } |
---|
| 3303 | + |
---|
| 3304 | + static public byte[] Compress(Object3D o) |
---|
| 3305 | + { |
---|
| 3306 | + try |
---|
| 3307 | + { |
---|
| 3308 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3309 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3310 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3311 | + |
---|
| 3312 | + Object3D parent = o.parent; |
---|
| 3313 | + o.parent = null; |
---|
| 3314 | + |
---|
| 3315 | + out.writeObject(o); |
---|
| 3316 | + |
---|
| 3317 | + o.parent = parent; |
---|
| 3318 | + |
---|
| 3319 | + out.flush(); |
---|
| 3320 | + |
---|
| 3321 | + zstream.close(); |
---|
| 3322 | + out.close(); |
---|
| 3323 | + |
---|
| 3324 | + return baos.toByteArray(); |
---|
| 3325 | + } catch (Exception e) |
---|
| 3326 | + { |
---|
| 3327 | + System.err.println(e); |
---|
| 3328 | + return null; |
---|
| 3329 | + } |
---|
| 3330 | + } |
---|
| 3331 | + |
---|
| 3332 | + static public Object Uncompress(byte[] bytes) |
---|
| 3333 | + { |
---|
| 3334 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3335 | + try |
---|
| 3336 | + { |
---|
| 3337 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3338 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3339 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3340 | + Object obj = in.readObject(); |
---|
| 3341 | + in.close(); |
---|
| 3342 | + |
---|
| 3343 | + return obj; |
---|
| 3344 | + } catch (Exception e) |
---|
| 3345 | + { |
---|
| 3346 | + System.err.println(e); |
---|
| 3347 | + return null; |
---|
| 3348 | + } |
---|
| 3349 | + } |
---|
| 3350 | + |
---|
| 3351 | + static public Object clone(Object o) |
---|
| 3352 | + { |
---|
| 3353 | + try |
---|
| 3354 | + { |
---|
| 3355 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3356 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3357 | + |
---|
| 3358 | + out.writeObject(o); |
---|
| 3359 | + |
---|
| 3360 | + out.flush(); |
---|
| 3361 | + out.close(); |
---|
| 3362 | + |
---|
| 3363 | + byte[] bytes = baos.toByteArray(); |
---|
| 3364 | + |
---|
| 3365 | + System.out.println("clone = " + bytes.length); |
---|
| 3366 | + |
---|
| 3367 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3368 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3369 | + Object obj = in.readObject(); |
---|
| 3370 | + in.close(); |
---|
| 3371 | + |
---|
| 3372 | + return obj; |
---|
| 3373 | + } catch (Exception e) |
---|
| 3374 | + { |
---|
| 3375 | + System.err.println(e); |
---|
| 3376 | + return null; |
---|
| 3377 | + } |
---|
| 3378 | + } |
---|
| 3379 | + |
---|
| 3380 | + cRadio GetCurrentTab() |
---|
| 3381 | + { |
---|
| 3382 | + cRadio ab; |
---|
| 3383 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3384 | + { |
---|
| 3385 | + ab = (cRadio)e.nextElement(); |
---|
| 3386 | + if(ab.GetObject() == copy) |
---|
| 3387 | + { |
---|
| 3388 | + return ab; |
---|
| 3389 | + } |
---|
| 3390 | + } |
---|
| 3391 | + |
---|
| 3392 | + return null; |
---|
| 3393 | + } |
---|
| 3394 | + |
---|
| 3395 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3396 | + |
---|
| 3397 | + public void Save() |
---|
| 3398 | + { |
---|
| 3399 | + cRadio tab = GetCurrentTab(); |
---|
| 3400 | + |
---|
| 3401 | + boolean temp = CameraPane.SWITCH; |
---|
| 3402 | + CameraPane.SWITCH = false; |
---|
| 3403 | + |
---|
| 3404 | + copy.ExtractBigData(hashtable); |
---|
| 3405 | + |
---|
| 3406 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3407 | + tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3408 | + |
---|
| 3409 | + copy.RestoreBigData(hashtable); |
---|
| 3410 | + |
---|
| 3411 | + CameraPane.SWITCH = temp; |
---|
| 3412 | + |
---|
| 3413 | + //assert(hashtable.isEmpty()); |
---|
| 3414 | + |
---|
| 3415 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3416 | + { |
---|
| 3417 | + tab.graphs[i] = null; |
---|
| 3418 | + } |
---|
| 3419 | + |
---|
| 3420 | + // test save |
---|
| 3421 | + if (false) |
---|
| 3422 | + { |
---|
| 3423 | + try |
---|
| 3424 | + { |
---|
| 3425 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3426 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3427 | + |
---|
| 3428 | + p.writeObject(copy); |
---|
| 3429 | + |
---|
| 3430 | + p.flush(); |
---|
| 3431 | + |
---|
| 3432 | + ostream.close(); |
---|
| 3433 | + } catch (Exception e) |
---|
| 3434 | + { |
---|
| 3435 | + e.printStackTrace(); |
---|
| 3436 | + } |
---|
| 3437 | + } |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
| 3440 | + void CopyChanged(Object3D obj) |
---|
| 3441 | + { |
---|
| 3442 | + boolean temp = CameraPane.SWITCH; |
---|
| 3443 | + CameraPane.SWITCH = false; |
---|
| 3444 | + |
---|
| 3445 | + copy.ExtractBigData(hashtable); |
---|
| 3446 | + |
---|
| 3447 | + copy.clear(); |
---|
| 3448 | + |
---|
| 3449 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3450 | + { |
---|
| 3451 | + copy.add(obj.get(i)); |
---|
| 3452 | + } |
---|
| 3453 | + |
---|
| 3454 | + copy.RestoreBigData(hashtable); |
---|
| 3455 | + |
---|
| 3456 | + CameraPane.SWITCH = temp; |
---|
| 3457 | + |
---|
| 3458 | + //assert(hashtable.isEmpty()); |
---|
| 3459 | + |
---|
| 3460 | + copy.Touch(); |
---|
| 3461 | + |
---|
| 3462 | + ResetModel(); |
---|
| 3463 | + copy.HardTouch(); // recompile? |
---|
| 3464 | + |
---|
| 3465 | + cRadio ab; |
---|
| 3466 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3467 | + { |
---|
| 3468 | + ab = (cRadio)e.nextElement(); |
---|
| 3469 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3470 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3471 | + if (test != null) |
---|
| 3472 | + { |
---|
| 3473 | + test.editWindow = ab.object.editWindow; |
---|
| 3474 | + ab.object = test; |
---|
| 3475 | + } |
---|
| 3476 | + } |
---|
| 3477 | + |
---|
| 3478 | + refreshContents(); |
---|
| 3479 | + } |
---|
| 3480 | + |
---|
| 3481 | + public void Undo() |
---|
| 3482 | + { |
---|
| 3483 | + cRadio tab = GetCurrentTab(); |
---|
| 3484 | + |
---|
| 3485 | + if (tab.undoindex == 0) |
---|
| 3486 | + { |
---|
| 3487 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3488 | + return; |
---|
| 3489 | + } |
---|
| 3490 | + |
---|
| 3491 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3492 | + { |
---|
| 3493 | + Save(); |
---|
| 3494 | + tab.undoindex -= 1; |
---|
| 3495 | + } |
---|
| 3496 | + |
---|
| 3497 | + tab.undoindex -= 1; |
---|
| 3498 | + |
---|
| 3499 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3500 | + } |
---|
| 3501 | + |
---|
| 3502 | + public void Redo() |
---|
| 3503 | + { |
---|
| 3504 | + cRadio tab = GetCurrentTab(); |
---|
| 3505 | + |
---|
| 3506 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3507 | + { |
---|
| 3508 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3509 | + return; |
---|
| 3510 | + } |
---|
| 3511 | + |
---|
| 3512 | + tab.undoindex += 1; |
---|
| 3513 | + |
---|
| 3514 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3515 | + } |
---|
| 3516 | + |
---|
| 3517 | + void ImportGFD() |
---|
| 3518 | + { |
---|
| 3519 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3284 | 3520 | browser.show(); |
---|
3285 | 3521 | String filename = browser.getFile(); |
---|
3286 | 3522 | if (filename != null && filename.length() > 0) |
---|
3287 | 3523 | { |
---|
3288 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3524 | + String fullname = browser.getDirectory() + filename; |
---|
| 3525 | + |
---|
| 3526 | + //Object3D readobj = |
---|
| 3527 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3528 | + //makeSomething(readobj); |
---|
| 3529 | + } |
---|
| 3530 | + } |
---|
| 3531 | + |
---|
| 3532 | + void ImportVRMLX3D() |
---|
| 3533 | + { |
---|
| 3534 | + if (Grafreed.standAlone) |
---|
| 3535 | + { |
---|
| 3536 | + /**/ |
---|
| 3537 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3538 | + browser.show(); |
---|
| 3539 | + String filename = browser.getFile(); |
---|
| 3540 | + if (filename != null && filename.length() > 0) |
---|
| 3541 | + { |
---|
| 3542 | + String fullname = browser.getDirectory() + filename; |
---|
| 3543 | + LoadVRMLX3D(fullname); |
---|
| 3544 | + } |
---|
| 3545 | + /**/ |
---|
| 3546 | + } |
---|
| 3547 | + } |
---|
| 3548 | + |
---|
| 3549 | + void ToggleAnimation() |
---|
| 3550 | + { |
---|
| 3551 | + if (!Globals.ANIMATION) |
---|
| 3552 | + { |
---|
| 3553 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3554 | + browser.setVisible(true); |
---|
| 3555 | + String filename = browser.getFile(); |
---|
| 3556 | + if (filename != null && filename.length() > 0) |
---|
| 3557 | + { |
---|
| 3558 | + Globals.filename = browser.getDirectory() + filename; |
---|
3289 | 3559 | //CameraPane.framecount = 0; |
---|
3290 | | - CameraPane.imagecount = 0; |
---|
| 3560 | + Globals.imagecount = 0; |
---|
3291 | 3561 | |
---|
3292 | | - CameraPane.ANIMATION ^= true; |
---|
| 3562 | + Globals.ANIMATION ^= true; |
---|
3293 | 3563 | |
---|
3294 | | - GrafreeD.wav.cursor = 0; |
---|
3295 | | - GrafreeD.wav.loop = 0; |
---|
| 3564 | + Grafreed.wav.cursor = 0; |
---|
| 3565 | + Grafreed.wav.loop = 0; |
---|
3296 | 3566 | } |
---|
3297 | 3567 | } else |
---|
3298 | 3568 | { |
---|
3299 | | - CameraPane.ANIMATION ^= true; |
---|
| 3569 | + Globals.ANIMATION ^= true; |
---|
3300 | 3570 | } |
---|
3301 | 3571 | } |
---|
3302 | 3572 | |
---|
.. | .. |
---|
3342 | 3612 | void CreateMaterial() |
---|
3343 | 3613 | { |
---|
3344 | 3614 | //copy.ClearMaterial(); // PATCH |
---|
3345 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3615 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3346 | 3616 | if (copy.selection.size() > 0) |
---|
3347 | 3617 | //SetMaterial(copy); |
---|
3348 | 3618 | { |
---|
.. | .. |
---|
3401 | 3671 | { |
---|
3402 | 3672 | copy.ResetBlockLoop(); // temporary problem |
---|
3403 | 3673 | |
---|
3404 | | - boolean random = CameraPane.RANDOM; |
---|
3405 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3674 | + boolean random = CameraPane.SWITCH; |
---|
| 3675 | + CameraPane.SWITCH = false; // parse everything |
---|
3406 | 3676 | copy.ResetDisplayList(); |
---|
3407 | 3677 | copy.HardTouch(); |
---|
3408 | | - CameraPane.RANDOM = random; |
---|
| 3678 | + CameraPane.SWITCH = random; |
---|
3409 | 3679 | } |
---|
3410 | 3680 | |
---|
3411 | 3681 | // public void applySelf() |
---|
.. | .. |
---|
3475 | 3745 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3476 | 3746 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3477 | 3747 | |
---|
3478 | | - if (!NumberSlider.frozen) |
---|
| 3748 | + if (!cNumberSlider.frozen) |
---|
3479 | 3749 | { |
---|
3480 | 3750 | //System.out.println("Propagate = " + propagate); |
---|
3481 | 3751 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3752 | + |
---|
| 3753 | + if (copy.material != null) |
---|
| 3754 | + { |
---|
| 3755 | + cMaterial mat = copy.material; |
---|
| 3756 | + |
---|
| 3757 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3758 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3759 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3760 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3761 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3762 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3763 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3764 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3765 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3766 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3767 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3768 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3769 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3770 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3771 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3772 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3773 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3774 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3775 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3776 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3777 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3778 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3779 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3780 | + } |
---|
| 3781 | + |
---|
3482 | 3782 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3483 | 3783 | { |
---|
3484 | 3784 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3523 | 3823 | || e.getSource() == apertureField |
---|
3524 | 3824 | || e.getSource() == shadowblurField) |
---|
3525 | 3825 | { |
---|
| 3826 | + new Exception().printStackTrace(); |
---|
3526 | 3827 | System.exit(0); |
---|
3527 | 3828 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3528 | 3829 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3549 | 3850 | //System.out.println("PARENT = " + parent); |
---|
3550 | 3851 | //if (parent != null) |
---|
3551 | 3852 | // parent.applySelf(); |
---|
3552 | | - refreshContents(); |
---|
| 3853 | + if (e.getSource() == normalpushField) |
---|
| 3854 | + { |
---|
| 3855 | + objEditor.refreshContents(); |
---|
| 3856 | + //Refresh(); |
---|
| 3857 | + } |
---|
| 3858 | + else |
---|
| 3859 | + refreshContents(); |
---|
3553 | 3860 | // ??? client.refreshEditWindow(); |
---|
3554 | 3861 | } |
---|
3555 | 3862 | //else |
---|
.. | .. |
---|
3561 | 3868 | //group.name = nameField.getText(); |
---|
3562 | 3869 | //objEditor.applySelf(); |
---|
3563 | 3870 | |
---|
3564 | | - assert (objEditor == this); |
---|
| 3871 | + // OCT2018: assert (objEditor == this); |
---|
3565 | 3872 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3566 | 3873 | //super.applySelf() |
---|
3567 | 3874 | ; else |
---|
.. | .. |
---|
3585 | 3892 | objEditor.copy = keep; |
---|
3586 | 3893 | } |
---|
3587 | 3894 | } |
---|
| 3895 | + |
---|
| 3896 | + if (normalpushField != null) |
---|
| 3897 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3588 | 3898 | } |
---|
3589 | 3899 | |
---|
3590 | 3900 | void SnapObject() |
---|
.. | .. |
---|
3839 | 4149 | |
---|
3840 | 4150 | radioPanel.revalidate(); |
---|
3841 | 4151 | radioPanel.repaint(); |
---|
3842 | | - ctrlPanel.revalidate(); // ? new |
---|
| 4152 | + ctrlPanel.validate(); // ? new |
---|
3843 | 4153 | ctrlPanel.repaint(); |
---|
3844 | 4154 | } |
---|
3845 | 4155 | } |
---|
.. | .. |
---|
3848 | 4158 | |
---|
3849 | 4159 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3850 | 4160 | { |
---|
| 4161 | + Save(); |
---|
3851 | 4162 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3852 | 4163 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3853 | 4164 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4051 | 4362 | } |
---|
4052 | 4363 | } |
---|
4053 | 4364 | } |
---|
| 4365 | + |
---|
4054 | 4366 | LoadGFDThread loadGFDThread; |
---|
4055 | 4367 | |
---|
4056 | 4368 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4070 | 4382 | |
---|
4071 | 4383 | try |
---|
4072 | 4384 | { |
---|
| 4385 | + // Try compressed version first. |
---|
4073 | 4386 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4074 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4387 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4388 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4075 | 4389 | |
---|
4076 | 4390 | readobj = (Object3D) p.readObject(); |
---|
4077 | 4391 | istream.close(); |
---|
.. | .. |
---|
4079 | 4393 | readobj.ResetDisplayList(); |
---|
4080 | 4394 | } catch (Exception e) |
---|
4081 | 4395 | { |
---|
4082 | | - e.printStackTrace(); |
---|
| 4396 | + //e.printStackTrace(); |
---|
| 4397 | + try |
---|
| 4398 | + { |
---|
| 4399 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4400 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4401 | + |
---|
| 4402 | + readobj = (Object3D) p.readObject(); |
---|
| 4403 | + istream.close(); |
---|
| 4404 | + |
---|
| 4405 | + readobj.ResetDisplayList(); |
---|
| 4406 | + } catch (Exception e2) |
---|
| 4407 | + { |
---|
| 4408 | + e2.printStackTrace(); |
---|
| 4409 | + } |
---|
4083 | 4410 | } |
---|
4084 | 4411 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4085 | 4412 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4125 | 4452 | |
---|
4126 | 4453 | void LoadIt(Object obj) |
---|
4127 | 4454 | { |
---|
| 4455 | + if (obj == null) |
---|
| 4456 | + { |
---|
| 4457 | + // Invalid file |
---|
| 4458 | + return; |
---|
| 4459 | + } |
---|
| 4460 | + |
---|
4128 | 4461 | System.out.println("Loaded " + obj); |
---|
4129 | 4462 | //new Exception().printStackTrace(); |
---|
4130 | 4463 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4134 | 4467 | |
---|
4135 | 4468 | if (readobj != null) |
---|
4136 | 4469 | { |
---|
| 4470 | + Save(); |
---|
4137 | 4471 | try |
---|
4138 | 4472 | { |
---|
4139 | 4473 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4196 | 4530 | |
---|
4197 | 4531 | void load() // throws ClassNotFoundException |
---|
4198 | 4532 | { |
---|
4199 | | - if (GrafreeD.standAlone) |
---|
| 4533 | + if (Grafreed.standAlone) |
---|
4200 | 4534 | { |
---|
4201 | 4535 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4202 | 4536 | browser.show(); |
---|
.. | .. |
---|
4283 | 4617 | try |
---|
4284 | 4618 | { |
---|
4285 | 4619 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4286 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4620 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4621 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4287 | 4622 | |
---|
4288 | 4623 | p.writeObject(copy); |
---|
4289 | 4624 | p.flush(); |
---|
4290 | 4625 | |
---|
| 4626 | + zstream.close(); |
---|
4291 | 4627 | ostream.close(); |
---|
4292 | 4628 | |
---|
4293 | 4629 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4297 | 4633 | { |
---|
4298 | 4634 | } |
---|
4299 | 4635 | } |
---|
| 4636 | + |
---|
4300 | 4637 | String lastname; |
---|
4301 | 4638 | |
---|
4302 | 4639 | void saveAs() |
---|
4303 | 4640 | { |
---|
4304 | | - if (GrafreeD.standAlone) |
---|
| 4641 | + if (Grafreed.standAlone) |
---|
4305 | 4642 | { |
---|
4306 | 4643 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4307 | 4644 | browser.setVisible(true); |
---|
.. | .. |
---|
4406 | 4743 | try |
---|
4407 | 4744 | { |
---|
4408 | 4745 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4409 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4410 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4746 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4747 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4411 | 4748 | |
---|
4412 | 4749 | Object3D objectparent = obj.parent; |
---|
4413 | 4750 | obj.parent = null; |
---|
4414 | 4751 | |
---|
4415 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4752 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4416 | 4753 | |
---|
4417 | 4754 | obj.parent = objectparent; |
---|
4418 | 4755 | |
---|
.. | .. |
---|
4424 | 4761 | p.writeObject(object); |
---|
4425 | 4762 | p.flush(); |
---|
4426 | 4763 | |
---|
| 4764 | + zstream.close(); |
---|
4427 | 4765 | ostream.close(); |
---|
4428 | | - // zstream.close(); |
---|
4429 | 4766 | |
---|
4430 | 4767 | // group.selection.get(0).parent = parent; |
---|
4431 | 4768 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4446 | 4783 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4447 | 4784 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4448 | 4785 | copy.generatePOV(buffer); |
---|
4449 | | - if (GrafreeD.standAlone) |
---|
| 4786 | + if (Grafreed.standAlone) |
---|
4450 | 4787 | { |
---|
4451 | 4788 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4452 | 4789 | browser.show(); |
---|
.. | .. |
---|
4472 | 4809 | Object3D client; |
---|
4473 | 4810 | Object3D copy; |
---|
4474 | 4811 | MenuBar menuBar; |
---|
4475 | | - Menu windowMenu; |
---|
| 4812 | + Menu fileMenu; |
---|
| 4813 | + MenuItem newItem; |
---|
4476 | 4814 | MenuItem loadItem; |
---|
4477 | 4815 | MenuItem saveItem; |
---|
4478 | 4816 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4480 | 4818 | MenuItem reexportItem; |
---|
4481 | 4819 | MenuItem povItem; |
---|
4482 | 4820 | MenuItem closeItem; |
---|
4483 | | - Menu cameraMenu; |
---|
| 4821 | + |
---|
4484 | 4822 | CheckboxMenuItem zBufferItem; |
---|
4485 | 4823 | //MenuItem normalLensItem; |
---|
4486 | | - MenuItem editCameraItem; |
---|
4487 | | - MenuItem revertCameraItem; |
---|
4488 | | - CheckboxMenuItem toggleLiveItem; |
---|
4489 | 4824 | MenuItem stepItem; |
---|
| 4825 | + CheckboxMenuItem toggleLiveItem; |
---|
4490 | 4826 | CheckboxMenuItem toggleFullScreenItem; |
---|
4491 | 4827 | CheckboxMenuItem toggleTimelineItem; |
---|
4492 | 4828 | CheckboxMenuItem toggleRenderItem; |
---|
.. | .. |
---|
4495 | 4831 | CheckboxMenuItem toggleFootContactItem; |
---|
4496 | 4832 | CheckboxMenuItem toggleDLItem; |
---|
4497 | 4833 | CheckboxMenuItem toggleTextureItem; |
---|
4498 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4834 | + CheckboxMenuItem toggleSwitchItem; |
---|
4499 | 4835 | CheckboxMenuItem toggleRootItem; |
---|
4500 | 4836 | CheckboxMenuItem animationItem; |
---|
4501 | 4837 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4503 | 4839 | JSplitPane mainPanel; |
---|
4504 | 4840 | JScrollPane scrollpane; |
---|
4505 | 4841 | JPanel toolbarPanel; |
---|
4506 | | - JPanel treePanel; |
---|
| 4842 | + cGridBag treePanel; |
---|
4507 | 4843 | JPanel radioPanel; |
---|
4508 | 4844 | ButtonGroup buttonGroup; |
---|
4509 | | - JPanel ctrlPanel; |
---|
4510 | | - JPanel materialPanel; |
---|
| 4845 | + cGridBag ctrlPanel; |
---|
| 4846 | + cGridBag materialPanel; |
---|
4511 | 4847 | JScrollPane infoPanel; |
---|
4512 | | - JPanel optionsPanel; |
---|
| 4848 | + cGridBag optionsPanel; |
---|
4513 | 4849 | JTabbedPane objectPanel; |
---|
4514 | | - JPanel XYZPanel; |
---|
| 4850 | + cGridBag XYZPanel; |
---|
4515 | 4851 | JSplitPane gridPanel; |
---|
4516 | 4852 | JSplitPane bigPanel; |
---|
4517 | | - JPanel bigThree; |
---|
4518 | | - JTabbedPane scenePanel; |
---|
4519 | | - JPanel centralPanel; |
---|
| 4853 | + cGridBag bigThree; |
---|
| 4854 | + cGridBag scenePanel; |
---|
| 4855 | + cGridBag centralPanel; |
---|
| 4856 | + JSplitPane cameraPanel; |
---|
4520 | 4857 | JPanel timelinePanel; |
---|
4521 | 4858 | JMenuBar timelineMenubar; |
---|
4522 | 4859 | JSplitPane framePanel; |
---|
.. | .. |
---|
4568 | 4905 | // MATERIAL |
---|
4569 | 4906 | JLabel materialLabel; |
---|
4570 | 4907 | JLabel colorLabel; |
---|
4571 | | - NumberSlider colorField; |
---|
| 4908 | + cNumberSlider colorField; |
---|
4572 | 4909 | JLabel modulationLabel; |
---|
4573 | | - NumberSlider modulationField; |
---|
| 4910 | + cNumberSlider modulationField; |
---|
4574 | 4911 | JLabel metalnessLabel; |
---|
4575 | | - NumberSlider metalnessField; |
---|
| 4912 | + cNumberSlider metalnessField; |
---|
4576 | 4913 | JLabel diffuseLabel; |
---|
4577 | | - NumberSlider diffuseField; |
---|
| 4914 | + cNumberSlider diffuseField; |
---|
4578 | 4915 | JLabel specularLabel; |
---|
4579 | | - NumberSlider specularField; |
---|
| 4916 | + cNumberSlider specularField; |
---|
4580 | 4917 | JLabel shininessLabel; |
---|
4581 | | - NumberSlider shininessField; |
---|
| 4918 | + cNumberSlider shininessField; |
---|
4582 | 4919 | JLabel shiftLabel; |
---|
4583 | | - NumberSlider shiftField; |
---|
| 4920 | + cNumberSlider shiftField; |
---|
4584 | 4921 | JLabel ambientLabel; |
---|
4585 | | - NumberSlider ambientField; |
---|
| 4922 | + cNumberSlider ambientField; |
---|
4586 | 4923 | JLabel lightareaLabel; |
---|
4587 | | - NumberSlider lightareaField; |
---|
| 4924 | + cNumberSlider lightareaField; |
---|
4588 | 4925 | JLabel diffusenessLabel; |
---|
4589 | | - NumberSlider diffusenessField; |
---|
| 4926 | + cNumberSlider diffusenessField; |
---|
4590 | 4927 | JLabel velvetLabel; |
---|
4591 | | - NumberSlider velvetField; |
---|
| 4928 | + cNumberSlider velvetField; |
---|
4592 | 4929 | JLabel sheenLabel; |
---|
4593 | | - NumberSlider sheenField; |
---|
| 4930 | + cNumberSlider sheenField; |
---|
4594 | 4931 | JLabel subsurfaceLabel; |
---|
4595 | | - NumberSlider subsurfaceField; |
---|
| 4932 | + cNumberSlider subsurfaceField; |
---|
4596 | 4933 | //JLabel bumpLabel; |
---|
4597 | 4934 | //NumberSlider bumpField; |
---|
4598 | 4935 | JLabel backlitLabel; |
---|
4599 | | - NumberSlider backlitField; |
---|
| 4936 | + cNumberSlider backlitField; |
---|
4600 | 4937 | JLabel anisoLabel; |
---|
4601 | | - NumberSlider anisoField; |
---|
| 4938 | + cNumberSlider anisoField; |
---|
4602 | 4939 | JLabel anisoVLabel; |
---|
4603 | | - NumberSlider anisoVField; |
---|
| 4940 | + cNumberSlider anisoVField; |
---|
4604 | 4941 | JLabel cameraLabel; |
---|
4605 | | - NumberSlider cameraField; |
---|
| 4942 | + cNumberSlider cameraField; |
---|
4606 | 4943 | JLabel selfshadowLabel; |
---|
4607 | | - NumberSlider selfshadowField; |
---|
| 4944 | + cNumberSlider selfshadowField; |
---|
4608 | 4945 | JLabel shadowLabel; |
---|
4609 | | - NumberSlider shadowField; |
---|
| 4946 | + cNumberSlider shadowField; |
---|
4610 | 4947 | JLabel textureLabel; |
---|
4611 | | - NumberSlider textureField; |
---|
| 4948 | + cNumberSlider textureField; |
---|
4612 | 4949 | JLabel opacityLabel; |
---|
4613 | | - NumberSlider opacityField; |
---|
| 4950 | + cNumberSlider opacityField; |
---|
4614 | 4951 | JLabel fakedepthLabel; |
---|
4615 | | - NumberSlider fakedepthField; |
---|
| 4952 | + cNumberSlider fakedepthField; |
---|
4616 | 4953 | JLabel shadowbiasLabel; |
---|
4617 | | - NumberSlider shadowbiasField; |
---|
| 4954 | + cNumberSlider shadowbiasField; |
---|
4618 | 4955 | JLabel bumpLabel; |
---|
4619 | | - NumberSlider bumpField; |
---|
| 4956 | + cNumberSlider bumpField; |
---|
4620 | 4957 | JLabel noiseLabel; |
---|
4621 | | - NumberSlider noiseField; |
---|
| 4958 | + cNumberSlider noiseField; |
---|
4622 | 4959 | JLabel powerLabel; |
---|
4623 | | - NumberSlider powerField; |
---|
| 4960 | + cNumberSlider powerField; |
---|
4624 | 4961 | JLabel borderfadeLabel; |
---|
4625 | | - NumberSlider borderfadeField; |
---|
| 4962 | + cNumberSlider borderfadeField; |
---|
4626 | 4963 | JLabel fogLabel; |
---|
4627 | | - NumberSlider fogField; |
---|
| 4964 | + cNumberSlider fogField; |
---|
4628 | 4965 | JLabel opacityPowerLabel; |
---|
4629 | | - NumberSlider opacityPowerField; |
---|
| 4966 | + cNumberSlider opacityPowerField; |
---|
4630 | 4967 | JTree jTree; |
---|
4631 | 4968 | //ObjectUI parent; |
---|
| 4969 | + |
---|
| 4970 | + cNumberSlider normalpushField; |
---|
| 4971 | + |
---|
| 4972 | + private MenuItem importGFDItem; |
---|
| 4973 | + private MenuItem importVRMLX3DItem; |
---|
| 4974 | + private MenuItem import3DSItem; |
---|
| 4975 | + private MenuItem importOBJItem; |
---|
4632 | 4976 | } |
---|