.. | .. |
---|
4 | 4 | |
---|
5 | 5 | import java.awt.*; |
---|
6 | 6 | import java.awt.event.*; |
---|
| 7 | +import java.awt.image.BufferedImage; |
---|
7 | 8 | import javax.swing.*; |
---|
8 | 9 | import javax.swing.event.*; |
---|
9 | 10 | import javax.swing.text.*; |
---|
.. | .. |
---|
19 | 20 | import //weka.core. |
---|
20 | 21 | matrix.Matrix; |
---|
21 | 22 | |
---|
| 23 | +import grafeme.ui.*; |
---|
| 24 | + |
---|
22 | 25 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 26 | ActionListener, ChangeListener, |
---|
24 | 27 | InputMethodListener, |
---|
.. | .. |
---|
28 | 31 | iSendInfo |
---|
29 | 32 | //KeyListener |
---|
30 | 33 | { |
---|
| 34 | + boolean timeline; |
---|
| 35 | + boolean wasFullScreen; |
---|
31 | 36 | |
---|
| 37 | + GroupEditor callee; |
---|
| 38 | + JFrame frame; |
---|
| 39 | + |
---|
| 40 | + static ObjEditor theFrame; |
---|
| 41 | + |
---|
| 42 | + cButton GetButton(String name, boolean border) |
---|
| 43 | + { |
---|
| 44 | + try |
---|
| 45 | + { |
---|
| 46 | + ImageIcon icon = GetIcon(name); |
---|
| 47 | + return new cButton(icon, border); |
---|
| 48 | + } |
---|
| 49 | + catch (Exception e) |
---|
| 50 | + { |
---|
| 51 | + return new cButton(name, border); |
---|
| 52 | + } |
---|
| 53 | + } |
---|
| 54 | + |
---|
| 55 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 56 | + { |
---|
| 57 | + try |
---|
| 58 | + { |
---|
| 59 | + ImageIcon icon = GetIcon(name); |
---|
| 60 | + return new cCheckBox(icon, border); |
---|
| 61 | + } |
---|
| 62 | + catch (Exception e) |
---|
| 63 | + { |
---|
| 64 | + return new cCheckBox(name, border); |
---|
| 65 | + } |
---|
| 66 | + } |
---|
| 67 | + |
---|
| 68 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 69 | + { |
---|
| 70 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 71 | + |
---|
| 72 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 73 | + { |
---|
| 74 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 75 | + Graphics2D g = resized.createGraphics(); |
---|
| 76 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 77 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 78 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 79 | + g.dispose(); |
---|
| 80 | + |
---|
| 81 | + image = resized; |
---|
| 82 | + } |
---|
| 83 | + |
---|
| 84 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 85 | + return icon; |
---|
| 86 | + } |
---|
| 87 | + |
---|
32 | 88 | // SCRIPT |
---|
33 | 89 | |
---|
34 | 90 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
119 | 175 | void keyPressed(int key, int modifiers) |
---|
120 | 176 | { |
---|
121 | 177 | System.out.println("KEY PRESSED"); |
---|
122 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 178 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
123 | 179 | } |
---|
124 | 180 | */ |
---|
125 | 181 | |
---|
126 | 182 | static GridBagConstraints aConstraints; |
---|
127 | 183 | static GridBagConstraints aWindowConstraints; |
---|
128 | | - GroupEditor callee; |
---|
129 | | - JFrame frame; |
---|
| 184 | + |
---|
130 | 185 | static int GRIDWIDTH = 100; // 4; |
---|
131 | 186 | |
---|
132 | 187 | public void closeUI() |
---|
133 | 188 | { |
---|
134 | 189 | //new Exception().printStackTrace(); |
---|
135 | | - System.out.println("this = " + this); |
---|
136 | | - System.out.println("objEditor = " + objEditor); |
---|
| 190 | +// System.out.println("this = " + this); |
---|
| 191 | +// System.out.println("objEditor = " + objEditor); |
---|
137 | 192 | //nameField.removeActionListener(this); |
---|
138 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 193 | +// objEditor.ctrlPanel.remove(nameField); |
---|
| 194 | + |
---|
| 195 | + objEditor.ctrlPanel.remove(namePanel); |
---|
139 | 196 | |
---|
140 | 197 | if (!GroupEditor.allparams) |
---|
141 | 198 | return; |
---|
142 | 199 | |
---|
143 | | - objEditor.ctrlPanel.remove(liveCB); |
---|
144 | | - objEditor.ctrlPanel.remove(hideCB); |
---|
145 | | - objEditor.ctrlPanel.remove(markCB); |
---|
146 | | - |
---|
147 | | - objEditor.ctrlPanel.remove(randomCB); |
---|
148 | | - objEditor.ctrlPanel.remove(speedupCB); |
---|
149 | | - objEditor.ctrlPanel.remove(rewindCB); |
---|
150 | | - |
---|
151 | | - objEditor.ctrlPanel.remove(resetButton); |
---|
152 | | - objEditor.ctrlPanel.remove(stepButton); |
---|
153 | | -// objEditor.ctrlPanel.remove(stepAllButton); |
---|
154 | | -// objEditor.ctrlPanel.remove(resetAllButton); |
---|
155 | | - objEditor.ctrlPanel.remove(link2masterCB); |
---|
156 | | - //objEditor.ctrlPanel.remove(flipVCB); |
---|
157 | | - //objEditor.ctrlPanel.remove(texresMenu); |
---|
158 | | - objEditor.ctrlPanel.remove(slowerButton); |
---|
159 | | - objEditor.ctrlPanel.remove(fasterButton); |
---|
160 | | - objEditor.ctrlPanel.remove(remarkButton); |
---|
| 200 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 201 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 202 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 203 | +// |
---|
| 204 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 205 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 206 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 207 | +// |
---|
| 208 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 209 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 210 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 211 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 212 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 213 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 214 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 215 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 216 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 217 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
| 218 | + |
---|
| 219 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 220 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 221 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 222 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 223 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 224 | + |
---|
| 225 | + //Remove(normalpushField); |
---|
161 | 226 | } |
---|
162 | 227 | |
---|
163 | 228 | public ObjEditor GetEditor() |
---|
164 | 229 | { |
---|
165 | 230 | return objEditor; //.GetEditor(); |
---|
166 | 231 | } |
---|
| 232 | + |
---|
| 233 | + // Sometimes myself, sometimes my callee's. |
---|
167 | 234 | ObjEditor objEditor; |
---|
168 | 235 | |
---|
169 | 236 | /* |
---|
.. | .. |
---|
226 | 293 | //localCopy.parent = null; |
---|
227 | 294 | |
---|
228 | 295 | frame = new JFrame(); |
---|
| 296 | + frame.setUndecorated(true); |
---|
229 | 297 | objEditor = this; |
---|
230 | 298 | this.callee = callee; |
---|
231 | 299 | |
---|
.. | .. |
---|
238 | 306 | //if (!isDisplayable()) |
---|
239 | 307 | //setUndecorated(true); |
---|
240 | 308 | |
---|
241 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 309 | + //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
242 | 310 | client = inClient; |
---|
243 | 311 | copy = localCopy; |
---|
244 | 312 | copy.editWindow = this; |
---|
.. | .. |
---|
259 | 327 | void SetupMenu() |
---|
260 | 328 | { |
---|
261 | 329 | frame.setMenuBar(menuBar = new MenuBar()); |
---|
262 | | - menuBar.add(windowMenu = new Menu("File")); |
---|
263 | | - windowMenu.add(loadItem = new MenuItem("Load...")); |
---|
264 | | - windowMenu.add("-"); |
---|
265 | | - windowMenu.add(saveItem = new MenuItem("Save")); |
---|
266 | | - windowMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
| 330 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 331 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 332 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 333 | + |
---|
| 334 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 335 | + Menu menu = new Menu("Import"); |
---|
| 336 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 337 | + importOBJItem.addActionListener(this); |
---|
| 338 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 339 | + import3DSItem.addActionListener(this); |
---|
| 340 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 341 | + importVRMLX3DItem.addActionListener(this); |
---|
| 342 | + menu.add("-"); |
---|
| 343 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 344 | + importGFDItem.addActionListener(this); |
---|
| 345 | + fileMenu.add(menu); |
---|
| 346 | + fileMenu.add("-"); |
---|
| 347 | + |
---|
| 348 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 349 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
267 | 350 | //windowMenu.add(povItem = new MenuItem("Emit POV-Ray...")); |
---|
268 | | - windowMenu.add("-"); |
---|
269 | | - windowMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
270 | | - windowMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
271 | | - windowMenu.add("-"); |
---|
| 351 | + fileMenu.add("-"); |
---|
| 352 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 353 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 354 | + fileMenu.add("-"); |
---|
272 | 355 | if (client.parent != null) |
---|
273 | 356 | { |
---|
274 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 357 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
275 | 358 | } else |
---|
276 | 359 | { |
---|
277 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 360 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
278 | 361 | } |
---|
279 | 362 | |
---|
| 363 | + newItem.addActionListener(this); |
---|
280 | 364 | loadItem.addActionListener(this); |
---|
281 | 365 | saveItem.addActionListener(this); |
---|
282 | 366 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
285 | 369 | //povItem.addActionListener(this); |
---|
286 | 370 | closeItem.addActionListener(this); |
---|
287 | 371 | |
---|
288 | | - menuBar.add(cameraMenu = new Menu("View")); |
---|
289 | | - //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
290 | | - //zBufferItem.addActionListener(this); |
---|
291 | | - //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
292 | | - //normalLensItem.addActionListener(this); |
---|
293 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
294 | | - revertCameraItem.addActionListener(this); |
---|
295 | | - cameraMenu.add(toggleFullItem = new CheckboxMenuItem("Full Screen")); |
---|
296 | | - toggleFullItem.addItemListener(this); |
---|
297 | | - toggleFullItem.setState(CameraPane.FULLSCREEN); |
---|
298 | | - cameraMenu.add("-"); |
---|
299 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
300 | | - toggleTextureItem.addItemListener(this); |
---|
301 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
302 | | - cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
303 | | - toggleLiveItem.addItemListener(this); |
---|
304 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
305 | | - cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
306 | | - stepItem.addActionListener(this); |
---|
307 | | -// cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
308 | | -// toggleDLItem.addItemListener(this); |
---|
309 | | -// toggleDLItem.setState(false); |
---|
310 | | - cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
311 | | - toggleRenderItem.addItemListener(this); |
---|
312 | | - toggleRenderItem.setState(!CameraPane.frozen); |
---|
313 | | - cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
314 | | - toggleDebugItem.addItemListener(this); |
---|
315 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
316 | | - cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
317 | | - toggleFrustumItem.addItemListener(this); |
---|
318 | | - toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
319 | | - cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
320 | | - toggleFootContactItem.addItemListener(this); |
---|
321 | | - toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
322 | | - cameraMenu.add(toggleRandomItem = new CheckboxMenuItem("Random")); |
---|
323 | | - toggleRandomItem.addItemListener(this); |
---|
324 | | - toggleRandomItem.setState(CameraPane.RANDOM); |
---|
325 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
326 | | - toggleHandleItem.addItemListener(this); |
---|
327 | | - toggleHandleItem.setState(CameraPane.HANDLES); |
---|
328 | | - cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
329 | | - togglePaintItem.addItemListener(this); |
---|
330 | | - togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
331 | | -// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
332 | | -// toggleRootItem.addItemListener(this); |
---|
333 | | -// toggleRootItem.setState(false); |
---|
334 | | -// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
335 | | -// animationItem.addItemListener(this); |
---|
336 | | -// animationItem.setState(CameraPane.ANIMATION); |
---|
337 | | - cameraMenu.add("-"); |
---|
338 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
339 | | - editCameraItem.addActionListener(this); |
---|
340 | | - |
---|
341 | 372 | objectPanel = new JTabbedPane(); |
---|
342 | 373 | toolbarPanel = new JPanel(); |
---|
343 | 374 | toolbarPanel.setName("Toolbar"); |
---|
344 | | - treePanel = new JPanel(); |
---|
| 375 | + treePanel = new cGridBag(); |
---|
345 | 376 | treePanel.setName("Tree"); |
---|
346 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
347 | | - ctrlPanel.setName("Edit"); |
---|
348 | | - materialPanel = new JPanel(); |
---|
| 377 | + |
---|
| 378 | + editPanel = new cGridBag().setVertical(true); |
---|
| 379 | + editPanel.setName("Edit"); |
---|
| 380 | + |
---|
| 381 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 382 | + |
---|
| 383 | + editCommandsPanel = new cGridBag(); |
---|
| 384 | + editPanel.add(editCommandsPanel); |
---|
| 385 | + editPanel.add(ctrlPanel); |
---|
| 386 | + |
---|
| 387 | + materialPanel = new cGridBag().setVertical(true); |
---|
| 388 | + |
---|
349 | 389 | materialPanel.setName("Material"); |
---|
350 | 390 | /*JTextPane*/ |
---|
351 | 391 | infoarea = createTextPane(); |
---|
| 392 | + doc = infoarea.getStyledDocument(); |
---|
| 393 | + |
---|
352 | 394 | infoarea.setEditable(true); |
---|
353 | 395 | SetText(); |
---|
354 | 396 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
355 | 397 | // infoarea.setOpaque(false); |
---|
356 | 398 | // //infoarea.setForeground(textcolor); |
---|
357 | | - infoarea.setLineWrap(true); |
---|
358 | | - infoarea.setWrapStyleWord(true); |
---|
| 399 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 400 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
359 | 401 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
360 | 402 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
361 | 403 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
366 | 408 | mainPanel.setName("Main"); |
---|
367 | 409 | mainPanel.setContinuousLayout(true); |
---|
368 | 410 | mainPanel.setOneTouchExpandable(true); |
---|
369 | | - mainPanel.setDividerLocation(1.0); |
---|
370 | 411 | mainPanel.setDividerSize(9); |
---|
371 | | - mainPanel.setResizeWeight(0); |
---|
| 412 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 413 | + mainPanel.setResizeWeight(0.5); |
---|
372 | 414 | |
---|
373 | 415 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
374 | 416 | //mainPanel.setLayout(new GridBagLayout()); |
---|
375 | 417 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
376 | | - treePanel.setLayout(new GridBagLayout()); |
---|
377 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
378 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 418 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 419 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 420 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
379 | 421 | |
---|
380 | 422 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
381 | 423 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
414 | 456 | static String newline = "\n"; |
---|
415 | 457 | protected static final String buttonString = "JButton"; |
---|
416 | 458 | StyledDocument doc; |
---|
417 | | - JTextArea infoarea; |
---|
| 459 | + JTextPane infoarea; |
---|
418 | 460 | |
---|
419 | 461 | void ClearInfo() |
---|
420 | 462 | { |
---|
.. | .. |
---|
437 | 479 | e.printStackTrace(); |
---|
438 | 480 | } |
---|
439 | 481 | |
---|
440 | | - String selection = infoarea.getText(); |
---|
441 | | - java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
442 | | - java.awt.datatransfer.Clipboard clipboard = |
---|
443 | | - Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
| 482 | +// String selection = infoarea.getText(); |
---|
| 483 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 484 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 485 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
444 | 486 | //clipboard.setContents(data, data); |
---|
445 | 487 | } |
---|
446 | 488 | |
---|
.. | .. |
---|
463 | 505 | //SendInfo("Name:", "bold"); |
---|
464 | 506 | if (sel.GetTextures() != null || debug) |
---|
465 | 507 | { |
---|
466 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 508 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
467 | 509 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
468 | 510 | if (sel.Size() > 0) |
---|
469 | 511 | { |
---|
470 | 512 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
471 | 513 | } |
---|
472 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 514 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
473 | 515 | if (debug) |
---|
474 | 516 | { |
---|
475 | 517 | try |
---|
.. | .. |
---|
481 | 523 | } |
---|
482 | 524 | |
---|
483 | 525 | if (full) |
---|
484 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 526 | + { |
---|
| 527 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 528 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 529 | + } |
---|
485 | 530 | |
---|
486 | 531 | if (sel.bRep != null) |
---|
487 | 532 | { |
---|
.. | .. |
---|
508 | 553 | } |
---|
509 | 554 | if (sel.support != null) |
---|
510 | 555 | { |
---|
511 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 556 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
512 | 557 | } |
---|
513 | 558 | if (sel.scriptnode != null) |
---|
514 | 559 | { |
---|
.. | .. |
---|
579 | 624 | { |
---|
580 | 625 | CameraPane.pointflow = (PointFlow) sel; |
---|
581 | 626 | } |
---|
| 627 | + |
---|
| 628 | + si.SendInfo("_____________________", "regular"); |
---|
| 629 | + si.SendInfo("", "regular"); |
---|
582 | 630 | } |
---|
583 | 631 | } |
---|
584 | 632 | |
---|
.. | .. |
---|
594 | 642 | } |
---|
595 | 643 | } |
---|
596 | 644 | |
---|
597 | | - private JTextArea createTextPane() |
---|
598 | | - { |
---|
599 | | - String[] initString = |
---|
600 | | - { |
---|
601 | | - "This is an editable JTextPane, ", //regular |
---|
602 | | - "another ", //italic |
---|
603 | | - "styled ", //bold |
---|
604 | | - "text ", //small |
---|
605 | | - "component, ", //large |
---|
606 | | - "which supports embedded components..." + newline,//regular |
---|
607 | | - " " + newline, //button |
---|
608 | | - "...and embedded icons..." + newline, //regular |
---|
609 | | - " ", //icon |
---|
610 | | - newline + "JTextPane is a subclass of JEditorPane that " |
---|
611 | | - + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
612 | | - + "cover methods for interacting with those objects." |
---|
613 | | - }; |
---|
| 645 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 646 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
614 | 647 | |
---|
615 | | - String[] initStyles = |
---|
| 648 | + Rectangle keeprect; |
---|
| 649 | + cRadio radio; |
---|
| 650 | + |
---|
| 651 | +cButton keepButton; |
---|
| 652 | + cButton twoButton; // Full 3D |
---|
| 653 | + cButton sixButton; |
---|
| 654 | + cButton threeButton; |
---|
| 655 | + cButton sevenButton; |
---|
| 656 | + cButton fourButton; // full panel |
---|
| 657 | + cButton oneButton; // full XYZ |
---|
| 658 | + //cButton currentLayout; |
---|
| 659 | + |
---|
| 660 | + boolean maximized; |
---|
| 661 | + |
---|
| 662 | + void Minimize() |
---|
616 | 663 | { |
---|
617 | | - "regular", "italic", "bold", "small", "large", |
---|
618 | | - "regular", "button", "regular", "icon", |
---|
619 | | - "regular" |
---|
620 | | - }; |
---|
621 | | - |
---|
622 | | - JTextPane textPane = new JTextPane(); |
---|
623 | | - textPane.setEditable(true); |
---|
624 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
625 | | - addStylesToDocument(doc); |
---|
626 | | - |
---|
627 | | - try |
---|
| 664 | + frame.setState(Frame.ICONIFIED); |
---|
| 665 | + } |
---|
| 666 | + |
---|
| 667 | + void Maximize() |
---|
628 | 668 | { |
---|
629 | | - for (int j = 0; j < 2; j++) |
---|
| 669 | + if (maximized) |
---|
630 | 670 | { |
---|
631 | | - for (int i = 0; i < initString.length; i++) |
---|
632 | | - { |
---|
633 | | - doc.insertString(doc.getLength(), initString[i], |
---|
634 | | - doc.getStyle(initStyles[i])); |
---|
635 | | - } |
---|
| 671 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
636 | 672 | } |
---|
637 | | - } catch (BadLocationException ble) |
---|
| 673 | + else |
---|
| 674 | + { |
---|
| 675 | + keeprect = frame.getBounds(); |
---|
| 676 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 677 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 678 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 679 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 680 | + } |
---|
| 681 | + |
---|
| 682 | + maximized ^= true; |
---|
| 683 | + } |
---|
| 684 | + |
---|
| 685 | + void ToggleFullScreen() |
---|
638 | 686 | { |
---|
639 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
| 687 | + if (CameraPane.FULLSCREEN) |
---|
| 688 | + { |
---|
| 689 | + device.setFullScreenWindow(null); |
---|
| 690 | + //frame.setVisible(false); |
---|
| 691 | +// frame.removeNotify(); |
---|
| 692 | +// frame.setUndecorated(false); |
---|
| 693 | +// frame.addNotify(); |
---|
| 694 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 695 | + |
---|
| 696 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 697 | +// X framePanel.add(bigThree); |
---|
| 698 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 699 | + framePanel.setDividerLocation(1); |
---|
| 700 | + |
---|
| 701 | + //frame.setVisible(true); |
---|
| 702 | + radio.layout = keepButton; |
---|
| 703 | + //theFrame = null; |
---|
| 704 | + keepButton = null; |
---|
| 705 | + radio.layout.doClick(); |
---|
| 706 | + |
---|
| 707 | + } else |
---|
| 708 | + { |
---|
| 709 | + keepButton = radio.layout; |
---|
| 710 | + //keeprect = frame.getBounds(); |
---|
| 711 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 712 | +// frame.getToolkit().getScreenSize().height); |
---|
| 713 | + //frame.setVisible(false); |
---|
| 714 | + device.setFullScreenWindow(frame); |
---|
| 715 | +// frame.removeNotify(); |
---|
| 716 | +// frame.setUndecorated(true); |
---|
| 717 | +// frame.addNotify(); |
---|
| 718 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 719 | +// X framePanel.remove(bigThree); |
---|
| 720 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 721 | + framePanel.setDividerLocation(0); |
---|
| 722 | + |
---|
| 723 | + radio.layout = twoButton; |
---|
| 724 | + radio.layout.doClick(); |
---|
| 725 | + //frame.setVisible(true); |
---|
| 726 | + } |
---|
| 727 | + |
---|
| 728 | + cameraView.ToggleFullScreen(); |
---|
640 | 729 | } |
---|
641 | 730 | |
---|
642 | | - return new JTextArea(); // textPane; |
---|
| 731 | + private JTextPane createTextPane() |
---|
| 732 | + { |
---|
| 733 | +// TEXTAREA String[] initString = |
---|
| 734 | +// { |
---|
| 735 | +// "This is an editable JTextPane, ", //regular |
---|
| 736 | +// "another ", //italic |
---|
| 737 | +// "styled ", //bold |
---|
| 738 | +// "text ", //small |
---|
| 739 | +// "component, ", //large |
---|
| 740 | +// "which supports embedded components..." + newline,//regular |
---|
| 741 | +// " " + newline, //button |
---|
| 742 | +// "...and embedded icons..." + newline, //regular |
---|
| 743 | +// " ", //icon |
---|
| 744 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 745 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 746 | +// + "cover methods for interacting with those objects." |
---|
| 747 | +// }; |
---|
| 748 | +// |
---|
| 749 | +// String[] initStyles = |
---|
| 750 | +// { |
---|
| 751 | +// "regular", "italic", "bold", "small", "large", |
---|
| 752 | +// "regular", "button", "regular", "icon", |
---|
| 753 | +// "regular" |
---|
| 754 | +// }; |
---|
| 755 | +// |
---|
| 756 | +// JTextPane textPane = new JTextPane(); |
---|
| 757 | +// textPane.setEditable(true); |
---|
| 758 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 759 | +// addStylesToDocument(doc); |
---|
| 760 | +// |
---|
| 761 | +// try |
---|
| 762 | +// { |
---|
| 763 | +// for (int j = 0; j < 2; j++) |
---|
| 764 | +// { |
---|
| 765 | +// for (int i = 0; i < initString.length; i++) |
---|
| 766 | +// { |
---|
| 767 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 768 | +// doc.getStyle(initStyles[i])); |
---|
| 769 | +// } |
---|
| 770 | +// } |
---|
| 771 | +// } catch (BadLocationException ble) |
---|
| 772 | +// { |
---|
| 773 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 774 | +// } |
---|
| 775 | + |
---|
| 776 | + return new JTextPane(); // textPane; |
---|
643 | 777 | } |
---|
644 | 778 | |
---|
645 | 779 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
692 | 826 | protected static ImageIcon createImageIcon(String path, |
---|
693 | 827 | String description) |
---|
694 | 828 | { |
---|
695 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 829 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
696 | 830 | if (imgURL != null) |
---|
697 | 831 | { |
---|
698 | 832 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
724 | 858 | // NumberSlider vDivsField; |
---|
725 | 859 | // JCheckBox endcaps; |
---|
726 | 860 | JCheckBox liveCB; |
---|
| 861 | + JCheckBox selectCB; |
---|
727 | 862 | JCheckBox hideCB; |
---|
728 | 863 | JCheckBox link2masterCB; |
---|
729 | 864 | JCheckBox markCB; |
---|
.. | .. |
---|
739 | 874 | JButton slowerButton; |
---|
740 | 875 | JButton fasterButton; |
---|
741 | 876 | JButton remarkButton; |
---|
| 877 | + |
---|
| 878 | + cGridBag editPanel; |
---|
| 879 | + cGridBag editCommandsPanel; |
---|
| 880 | + |
---|
| 881 | + cGridBag namePanel; |
---|
| 882 | + cGridBag setupPanel; |
---|
| 883 | + cGridBag setupPanel2; |
---|
| 884 | + cGridBag objectCommandsPanel; |
---|
| 885 | + cGridBag pushPanel; |
---|
| 886 | + cGridBag fillPanel; |
---|
742 | 887 | |
---|
743 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 888 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
744 | 889 | { |
---|
745 | 890 | JCheckBox cb; |
---|
746 | 891 | |
---|
747 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
748 | | - oe.aConstraints.gridwidth = 1; // 3; |
---|
749 | | -// oe.aConstraints.weightx = 1; |
---|
750 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
751 | | - oe.ctrlPanel.add(cb = new JCheckBox(label, on), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 892 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
752 | 893 | cb.addItemListener(this); |
---|
753 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
754 | | - oe.aConstraints.gridwidth = 1; |
---|
755 | | - oe.aConstraints.gridx += 1; |
---|
756 | 894 | |
---|
757 | 895 | return cb; |
---|
758 | 896 | } |
---|
759 | 897 | |
---|
760 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 898 | + cButton AddButton(cGridBag panel, String label) |
---|
761 | 899 | { |
---|
762 | 900 | cButton cb; |
---|
763 | 901 | |
---|
764 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
765 | | - oe.aConstraints.gridwidth = 1; |
---|
766 | | -// oe.aConstraints.weightx = 1; |
---|
767 | | -// oe.aConstraints.anchor = GridBagConstraints.WEST; |
---|
768 | | - oe.ctrlPanel.add(cb = new cButton(label), oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
| 902 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
769 | 903 | cb.addActionListener(this); |
---|
770 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
771 | | - oe.aConstraints.gridwidth = 1; |
---|
772 | | - oe.aConstraints.gridx += 1; |
---|
773 | 904 | |
---|
774 | 905 | return cb; |
---|
775 | 906 | } |
---|
776 | 907 | |
---|
777 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 908 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
778 | 909 | { |
---|
779 | 910 | JComboBox combo; |
---|
780 | 911 | |
---|
781 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
782 | | - oe.ctrlPanel.add(combo = new JComboBox(new cListModel(list, item)), oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
783 | | - oe.aConstraints.gridx += 1; |
---|
| 912 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
784 | 913 | combo.addActionListener(this); |
---|
785 | 914 | |
---|
786 | 915 | return combo; |
---|
787 | 916 | } |
---|
788 | 917 | |
---|
789 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 918 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
790 | 919 | { |
---|
791 | | - NumberSlider combo; |
---|
| 920 | + cGridBag control = new cGridBag(); |
---|
| 921 | + |
---|
| 922 | + cNumberSlider combo; |
---|
792 | 923 | |
---|
793 | 924 | JLabel jlabel = new JLabel(label); |
---|
794 | | - |
---|
795 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
796 | 925 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
797 | | - aConstraints.gridwidth = 2; |
---|
798 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
799 | | - aConstraints.gridx += 1; |
---|
800 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
801 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
802 | | - ctrlPanel.add(combo = new NumberSlider(min, max, pow), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
803 | | - aConstraints.gridx += 1; |
---|
804 | | - aConstraints.gridwidth = 1; |
---|
805 | | - |
---|
| 926 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 927 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
806 | 928 | combo.setFloat(current); |
---|
807 | | - |
---|
808 | | - combo.label = jlabel; |
---|
809 | | - |
---|
810 | | - combo.addChangeListener(this); |
---|
811 | | - |
---|
812 | | - return combo; |
---|
| 929 | + |
---|
| 930 | + panel.add(control); |
---|
| 931 | + |
---|
| 932 | + return control; |
---|
813 | 933 | } |
---|
814 | 934 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 935 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
816 | 936 | { |
---|
817 | | - NumberSlider combo; |
---|
| 937 | + cGridBag control = new cGridBag(); |
---|
| 938 | + |
---|
| 939 | + cNumberSlider combo; |
---|
818 | 940 | |
---|
819 | 941 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 942 | jlabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
823 | | - aConstraints.gridwidth = 2; |
---|
824 | | - ctrlPanel.add(jlabel, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
825 | | - aConstraints.gridx += 1; |
---|
826 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
827 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
828 | | - ctrlPanel.add(combo = new NumberSlider(min, max), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
829 | | - aConstraints.gridx += 1; |
---|
830 | | - aConstraints.gridwidth = 1; |
---|
831 | | - |
---|
| 943 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 944 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 945 | combo.setInteger(current); |
---|
833 | 946 | |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 947 | + panel.add(control); |
---|
| 948 | + |
---|
| 949 | + return control; |
---|
839 | 950 | } |
---|
840 | 951 | |
---|
841 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 952 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
842 | 953 | { |
---|
843 | 954 | JTextArea text; |
---|
844 | 955 | |
---|
845 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
846 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
847 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 956 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
848 | 957 | text.addCaretListener(this); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.gridwidth = 1; |
---|
851 | 958 | |
---|
852 | 959 | return text; |
---|
853 | 960 | } |
---|
.. | .. |
---|
877 | 984 | objEditor.ctrlPanel.remove(j); |
---|
878 | 985 | } |
---|
879 | 986 | |
---|
| 987 | + void Remove(cNumberSlider j) |
---|
| 988 | + { |
---|
| 989 | + j.removeChangeListener(this); |
---|
| 990 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 991 | + objEditor.ctrlPanel.remove(j); |
---|
| 992 | + } |
---|
| 993 | + |
---|
880 | 994 | /* |
---|
881 | 995 | */ |
---|
882 | | - void Return() // ObjEditor oe) |
---|
| 996 | + void Return0() // ObjEditor oe) |
---|
883 | 997 | { |
---|
884 | 998 | aConstraints.gridy += 1; |
---|
885 | 999 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
934 | 1048 | |
---|
935 | 1049 | void SetupUI2(ObjEditor oe) |
---|
936 | 1050 | { |
---|
937 | | -// oe.aConstraints.weightx = 0; |
---|
938 | | -// oe.aConstraints.weighty = 0; |
---|
939 | | -// oe.aConstraints.gridx = 0; |
---|
940 | | -// oe.aConstraints.gridy = 0; |
---|
941 | | - SetupName(oe); |
---|
| 1051 | + //SetupName(oe); |
---|
| 1052 | + |
---|
| 1053 | + namePanel = new cGridBag(); |
---|
| 1054 | + |
---|
| 1055 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1056 | + namePanel.add(nameField); |
---|
| 1057 | + oe.ctrlPanel.add(namePanel); |
---|
| 1058 | + |
---|
| 1059 | + oe.ctrlPanel.Return(); |
---|
942 | 1060 | |
---|
943 | 1061 | if (!GroupEditor.allparams) |
---|
944 | 1062 | return; |
---|
945 | 1063 | |
---|
946 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
947 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
948 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1064 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1065 | + |
---|
| 1066 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1067 | + liveCB.setToolTipText("Animate object"); |
---|
| 1068 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1069 | + selectCB.setToolTipText("Make object selectable"); |
---|
949 | 1070 | // Return(); |
---|
950 | | - markCB = AddCheckBox(oe, "Mark", copy.marked); |
---|
951 | | - rewindCB = AddCheckBox(oe, "Rew", copy.rewind); |
---|
952 | | - randomCB = AddCheckBox(oe, "Rand", copy.random); |
---|
953 | | - Return(); |
---|
954 | | - resetButton = AddButton(oe, "Reset"); |
---|
955 | | - stepButton = AddButton(oe, "Step"); |
---|
| 1071 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1072 | + hideCB.setToolTipText("Hide object"); |
---|
| 1073 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1074 | + markCB.setToolTipText("Set the animation target transform"); |
---|
| 1075 | + |
---|
| 1076 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1077 | + |
---|
| 1078 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1079 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1080 | + |
---|
| 1081 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1082 | + randomCB.setToolTipText("Randomly Rewind or Go back and forth"); |
---|
| 1083 | + |
---|
| 1084 | + if (Globals.ADVANCED) |
---|
| 1085 | + { |
---|
| 1086 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
| 1087 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1088 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1089 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1090 | + } |
---|
| 1091 | + |
---|
| 1092 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1093 | + oe.ctrlPanel.Return(); |
---|
| 1094 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1095 | + oe.ctrlPanel.Return(); |
---|
| 1096 | + |
---|
| 1097 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1098 | + |
---|
| 1099 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1100 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1101 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1102 | + stepButton.setToolTipText("Step one frame"); |
---|
956 | 1103 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
957 | 1104 | // stepAllButton = AddButton(oe, "Step All"); |
---|
958 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
959 | 1105 | // Return(); |
---|
960 | | - slowerButton = AddButton(oe, "Slow"); |
---|
961 | | - fasterButton = AddButton(oe, "Fast"); |
---|
962 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1106 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1107 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1108 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1109 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1110 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1111 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
963 | 1112 | |
---|
964 | | - Return(); |
---|
| 1113 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1114 | + oe.ctrlPanel.Return(); |
---|
965 | 1115 | |
---|
| 1116 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1117 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1118 | + //Return(); |
---|
| 1119 | + |
---|
| 1120 | + oe.ctrlPanel.Return(); |
---|
| 1121 | + |
---|
966 | 1122 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
967 | 1123 | // ObjEditor.aConstraints.gridx += 1; |
---|
968 | 1124 | |
---|
.. | .. |
---|
1056 | 1212 | oe.aConstraints.gridwidth = 1; |
---|
1057 | 1213 | /**/ |
---|
1058 | 1214 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1059 | | - Return(); |
---|
| 1215 | + oe.ctrlPanel.Return(); |
---|
1060 | 1216 | |
---|
1061 | 1217 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1062 | 1218 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1158 | 1314 | //JPanel worldPanel = |
---|
1159 | 1315 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1160 | 1316 | //worldPanel.setName("World"); |
---|
1161 | | - /*JPanel*/ cameraPanel = |
---|
1162 | | - new JPanel(new BorderLayout()); |
---|
1163 | | - cameraPanel.add(cameraView); |
---|
1164 | | - //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame); |
---|
| 1317 | + centralPanel = new cGridBag(); |
---|
| 1318 | + centralPanel.preferredWidth = 20; |
---|
| 1319 | + |
---|
| 1320 | + if (Globals.ADVANCED) |
---|
| 1321 | + { |
---|
| 1322 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1323 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1165 | 1324 | |
---|
| 1325 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1326 | + cameraPanel.setContinuousLayout(true); |
---|
| 1327 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1328 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1329 | +// cameraPanel.setDividerSize(9); |
---|
| 1330 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1331 | + |
---|
| 1332 | + } |
---|
| 1333 | + |
---|
| 1334 | + centralPanel.add(cameraView); |
---|
| 1335 | + centralPanel.setFocusable(true); |
---|
| 1336 | + //frame.setJMenuBar(timelineMenubar); |
---|
| 1337 | + //centralPanel.add(timelinePanel); |
---|
| 1338 | + |
---|
1166 | 1339 | //topView.camera = ; |
---|
1167 | 1340 | //frontView.camera = new Camera(2); |
---|
1168 | 1341 | //sideView.camera = new Camera(3); |
---|
.. | .. |
---|
1178 | 1351 | //frontView.object = copy; |
---|
1179 | 1352 | //sideView.object = copy; |
---|
1180 | 1353 | |
---|
1181 | | - XYZPanel = new JPanel(); |
---|
1182 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1354 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1355 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1183 | 1356 | |
---|
1184 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1185 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1186 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1357 | + XYZPanel.preferredWidth = 5; |
---|
| 1358 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1359 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1360 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1187 | 1361 | |
---|
1188 | 1362 | /* |
---|
1189 | 1363 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1192 | 1366 | gridPanel.add(cameraView); |
---|
1193 | 1367 | gridPanel.add(XYZPanel); |
---|
1194 | 1368 | */ |
---|
1195 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout()); |
---|
| 1369 | + gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1196 | 1370 | gridPanel.setContinuousLayout(true); |
---|
1197 | 1371 | gridPanel.setOneTouchExpandable(true); |
---|
1198 | 1372 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1221 | 1395 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1222 | 1396 | //tmp.setName("Edit"); |
---|
1223 | 1397 | objectPanel.add(materialPanel); |
---|
1224 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1225 | | - north.setName("Edit"); |
---|
1226 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1227 | | - objectPanel.add(north); |
---|
| 1398 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1399 | +// north.setName("Edit"); |
---|
| 1400 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1401 | +// objectPanel.add(north); |
---|
| 1402 | + objectPanel.add(editPanel); |
---|
1228 | 1403 | objectPanel.add(infoPanel); |
---|
1229 | 1404 | |
---|
1230 | 1405 | /* |
---|
.. | .. |
---|
1245 | 1420 | scrollpane.setWheelScrollingEnabled(true); |
---|
1246 | 1421 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1247 | 1422 | |
---|
1248 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1249 | | - scenePanel.add(scrollpane); |
---|
| 1423 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1424 | + scenePanel.preferredWidth = 6; |
---|
| 1425 | + |
---|
| 1426 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1427 | + tabbedPane.add(scrollpane); |
---|
1250 | 1428 | |
---|
1251 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
| 1429 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1252 | 1430 | |
---|
1253 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1431 | + optionsPanel = new cGridBag().setVertical(true); |
---|
1254 | 1432 | |
---|
1255 | 1433 | optionsPanel.setName("Options"); |
---|
1256 | | - scenePanel.add(optionsPanel); |
---|
1257 | | - |
---|
| 1434 | + |
---|
| 1435 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1436 | + |
---|
| 1437 | + tabbedPane.add(optionsPanel); |
---|
| 1438 | + |
---|
| 1439 | + scenePanel.add(tabbedPane); |
---|
1258 | 1440 | |
---|
1259 | 1441 | /* |
---|
1260 | 1442 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1288 | 1470 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1289 | 1471 | //bigPanel.add(ctrlPanel); |
---|
1290 | 1472 | //bigPanel.add(gridPanel); |
---|
| 1473 | + /** |
---|
1291 | 1474 | bigThree = new JPanel(); |
---|
1292 | 1475 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1293 | 1476 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1304 | 1487 | // aConstraints.gridheight = 3; |
---|
1305 | 1488 | aWindowConstraints.gridx = 1; |
---|
1306 | 1489 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
1307 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 1490 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
1308 | 1491 | aWindowConstraints.weightx = 0; |
---|
1309 | 1492 | aWindowConstraints.gridx = 4; |
---|
1310 | 1493 | aWindowConstraints.gridwidth = 1; |
---|
1311 | 1494 | // aConstraints.gridheight = 3; |
---|
1312 | 1495 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1313 | 1496 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1497 | + /**/ |
---|
1314 | 1498 | |
---|
| 1499 | + bigThree = new cGridBag(); |
---|
| 1500 | + bigThree.addComponent(scenePanel); |
---|
| 1501 | + bigThree.addComponent(centralPanel); |
---|
| 1502 | + bigThree.addComponent(XYZPanel); |
---|
| 1503 | + |
---|
1315 | 1504 | // // SIDE EFFECT!!! |
---|
1316 | 1505 | // aConstraints.gridx = 0; |
---|
1317 | 1506 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1332 | 1521 | //worldPane.add(bigPanel); |
---|
1333 | 1522 | //worldPane.add(worldPanel); |
---|
1334 | 1523 | /**/ |
---|
1335 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1524 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1525 | + frame.add(/*"Center",*/framePanel); |
---|
1336 | 1526 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1337 | 1527 | |
---|
1338 | 1528 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1339 | 1529 | |
---|
1340 | | - frame.setSize(1024, 768); |
---|
1341 | | - frame.show(); |
---|
| 1530 | + frame.setSize(1280, 860); |
---|
| 1531 | + frame.setVisible(true); |
---|
1342 | 1532 | |
---|
| 1533 | + cameraView.requestFocusInWindow(); |
---|
| 1534 | + |
---|
1343 | 1535 | gridPanel.setDividerLocation(1.0); |
---|
1344 | 1536 | |
---|
1345 | 1537 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1353 | 1545 | }); |
---|
1354 | 1546 | } |
---|
1355 | 1547 | |
---|
| 1548 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1549 | + { |
---|
| 1550 | + } |
---|
| 1551 | + |
---|
1356 | 1552 | JTree GetTree() |
---|
1357 | 1553 | { |
---|
1358 | 1554 | return objEditor.jTree; |
---|
.. | .. |
---|
1364 | 1560 | ctrlPanel.removeAll(); |
---|
1365 | 1561 | } |
---|
1366 | 1562 | |
---|
1367 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1563 | + void SetupMaterial(cGridBag panel) |
---|
1368 | 1564 | { |
---|
1369 | | - aConstraints.weighty = 0; |
---|
1370 | | - //aConstraints.weightx = 1; |
---|
1371 | | - /* |
---|
| 1565 | + /* |
---|
1372 | 1566 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1373 | 1567 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1374 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1375 | | - aConstraints.gridx += 1; |
---|
1376 | 1568 | */ |
---|
1377 | 1569 | |
---|
1378 | | - aConstraints.gridwidth = 1; |
---|
1379 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1380 | | - aConstraints.gridx += 1; |
---|
1381 | | - aConstraints.weighty = 0; |
---|
1382 | | - aConstraints.gridwidth = 1; |
---|
| 1570 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1571 | + |
---|
| 1572 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1573 | + createMaterialButton.setToolTipText("Create material"); |
---|
1383 | 1574 | |
---|
1384 | 1575 | /* |
---|
1385 | 1576 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1386 | | - aConstraints.gridx += 1; |
---|
1387 | | - aConstraints.weighty = 0; |
---|
1388 | | - aConstraints.gridwidth = 1; |
---|
1389 | 1577 | */ |
---|
1390 | 1578 | |
---|
1391 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1392 | | - aConstraints.gridx += 1; |
---|
| 1579 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1580 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1581 | + |
---|
| 1582 | + if (Globals.ADVANCED) |
---|
| 1583 | + { |
---|
| 1584 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1585 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1586 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1587 | + } |
---|
1393 | 1588 | |
---|
1394 | | - ctrlPanel.add(resetSlidersButton = new cButton("Reset"), aConstraints); |
---|
1395 | | - |
---|
1396 | | - aConstraints.gridx += 1; |
---|
1397 | | - |
---|
1398 | | - ctrlPanel.add(propagateToggle = new cCheckBox("Prop", propagate), aConstraints); |
---|
1399 | | - |
---|
1400 | | - aConstraints.gridx += 1; |
---|
1401 | | - |
---|
1402 | | - ctrlPanel.add(multiplyToggle = new cCheckBox("Mult", false), aConstraints); |
---|
1403 | | - |
---|
1404 | | - aConstraints.gridx = 0; |
---|
1405 | | - aConstraints.gridy += 1; |
---|
1406 | | - aConstraints.weighty = 0; |
---|
1407 | | - aConstraints.gridwidth = 1; |
---|
| 1589 | + editBar.preferredHeight = 15; |
---|
| 1590 | + |
---|
| 1591 | + panel.add(editBar); |
---|
| 1592 | + |
---|
1408 | 1593 | /**/ |
---|
1409 | 1594 | //aConstraints.weighty = 0; |
---|
1410 | 1595 | ////aConstraints.weightx = 1; |
---|
1411 | 1596 | //aConstraints.weighty = 1; |
---|
1412 | 1597 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1413 | 1598 | //aConstraints.gridx += 1; |
---|
1414 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1415 | | - aConstraints.weighty = 0; |
---|
1416 | | - aConstraints.gridx = 0; |
---|
1417 | | - aConstraints.gridy += 1; |
---|
1418 | | - aConstraints.gridwidth = 1; |
---|
| 1599 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1419 | 1600 | |
---|
1420 | | - ctrlPanel.add(colorLabel = new JLabel("Color/hue"), aConstraints); |
---|
1421 | | - colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1422 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1423 | | - aConstraints.gridx += 1; |
---|
1424 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1425 | | - //aConstraints.weightx = 0; |
---|
1426 | | - ctrlPanel.add(colorField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1427 | | - aConstraints.gridx = 0; |
---|
1428 | | - aConstraints.gridy += 1; |
---|
1429 | | - aConstraints.gridwidth = 1; |
---|
| 1601 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1602 | + |
---|
| 1603 | + cGridBag color = new cGridBag(); |
---|
| 1604 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1605 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1606 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1607 | + //colorField.preferredWidth = 200; |
---|
| 1608 | + colorSection.add(color); |
---|
1430 | 1609 | |
---|
1431 | | - ctrlPanel.add(modulationLabel = new JLabel("Saturation"), aConstraints); |
---|
1432 | | - modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1433 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1434 | | - aConstraints.gridx += 1; |
---|
1435 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1436 | | - ctrlPanel.add(modulationField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1437 | | - aConstraints.gridx = 0; |
---|
1438 | | - aConstraints.gridy += 1; |
---|
1439 | | - aConstraints.gridwidth = 1; |
---|
| 1610 | + cGridBag modulation = new cGridBag(); |
---|
| 1611 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1612 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1613 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1614 | + colorSection.add(modulation); |
---|
1440 | 1615 | |
---|
1441 | | - ctrlPanel.add(textureLabel = new JLabel("Texture"), aConstraints); |
---|
1442 | | - textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1443 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1444 | | - aConstraints.gridx += 1; |
---|
1445 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1446 | | - ctrlPanel.add(textureField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1447 | | - aConstraints.gridx = 0; |
---|
1448 | | - aConstraints.gridy += 1; |
---|
1449 | | - aConstraints.gridwidth = 1; |
---|
| 1616 | + cGridBag texture = new cGridBag(); |
---|
| 1617 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1618 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1619 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1620 | + colorSection.add(texture); |
---|
1450 | 1621 | |
---|
1451 | | - ctrlPanel.add(anisoLabel = new JLabel("AnisoU"), aConstraints); |
---|
1452 | | - anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1453 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1454 | | - aConstraints.gridx += 1; |
---|
1455 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1456 | | - ctrlPanel.add(anisoField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1457 | | - aConstraints.gridx = 0; |
---|
1458 | | - aConstraints.gridy += 1; |
---|
1459 | | - aConstraints.gridwidth = 1; |
---|
| 1622 | + cGridBag anisoU = new cGridBag(); |
---|
| 1623 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1624 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1625 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1626 | + colorSection.add(anisoU); |
---|
1460 | 1627 | |
---|
1461 | | - ctrlPanel.add(anisoVLabel = new JLabel("AnisoV"), aConstraints); |
---|
1462 | | - anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1463 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1464 | | - aConstraints.gridx += 1; |
---|
1465 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1466 | | - ctrlPanel.add(anisoVField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1467 | | - aConstraints.gridx = 0; |
---|
1468 | | - aConstraints.gridy += 1; |
---|
1469 | | - aConstraints.gridwidth = 1; |
---|
| 1628 | + cGridBag anisoV = new cGridBag(); |
---|
| 1629 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1630 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1631 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1632 | + colorSection.add(anisoV); |
---|
1470 | 1633 | |
---|
1471 | | - ctrlPanel.add(shadowbiasLabel = new JLabel("Shadowbias"), aConstraints); |
---|
1472 | | - shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1473 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1474 | | - aConstraints.gridx += 1; |
---|
1475 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1476 | | - ctrlPanel.add(shadowbiasField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1477 | | - aConstraints.gridx = 0; |
---|
1478 | | - aConstraints.gridy += 1; |
---|
1479 | | - aConstraints.gridwidth = 1; |
---|
| 1634 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1635 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1636 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1637 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1638 | + colorSection.add(shadowbias); |
---|
1480 | 1639 | |
---|
1481 | | - //aConstraints.weighty = 1; |
---|
1482 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1483 | | - //aConstraints.gridx += 1; |
---|
1484 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1485 | | - aConstraints.weighty = 0; |
---|
1486 | | - aConstraints.gridx = 0; |
---|
1487 | | - aConstraints.gridy += 1; |
---|
1488 | | - aConstraints.gridwidth = 1; |
---|
| 1640 | + panel.add(new JSeparator()); |
---|
| 1641 | + |
---|
| 1642 | + panel.add(colorSection); |
---|
| 1643 | + |
---|
| 1644 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1645 | + |
---|
| 1646 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1647 | + |
---|
| 1648 | + cGridBag diffuse = new cGridBag(); |
---|
| 1649 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1650 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1651 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1652 | + diffuseSection.add(diffuse); |
---|
1489 | 1653 | |
---|
1490 | | - ctrlPanel.add(diffuseLabel = new JLabel("Diffuse"), aConstraints); |
---|
1491 | | - diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1492 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1493 | | - aConstraints.gridx += 1; |
---|
1494 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1495 | | - ctrlPanel.add(diffuseField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1496 | | - aConstraints.gridx = 0; |
---|
1497 | | - aConstraints.gridy += 1; |
---|
1498 | | - aConstraints.gridwidth = 1; |
---|
| 1654 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1655 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1656 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1657 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1658 | + diffuseSection.add(diffuseness); |
---|
1499 | 1659 | |
---|
1500 | | - ctrlPanel.add(diffusenessLabel = new JLabel("Diffusion"), aConstraints); |
---|
1501 | | - diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1502 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1503 | | - aConstraints.gridx += 1; |
---|
1504 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1505 | | - ctrlPanel.add(diffusenessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1506 | | - aConstraints.gridx = 0; |
---|
1507 | | - aConstraints.gridy += 1; |
---|
1508 | | - aConstraints.gridwidth = 1; |
---|
| 1660 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1661 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1662 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1663 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1664 | + diffuseSection.add(selfshadow); |
---|
1509 | 1665 | |
---|
1510 | | - ctrlPanel.add(selfshadowLabel = new JLabel("Selfshadow"), aConstraints); |
---|
1511 | | - selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1512 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1513 | | - aConstraints.gridx += 1; |
---|
1514 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1515 | | - ctrlPanel.add(selfshadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1516 | | - aConstraints.gridx = 0; |
---|
1517 | | - aConstraints.gridy += 1; |
---|
1518 | | - aConstraints.gridwidth = 1; |
---|
| 1666 | + cGridBag sheen = new cGridBag(); |
---|
| 1667 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1668 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1669 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1670 | + diffuseSection.add(sheen); |
---|
1519 | 1671 | |
---|
1520 | | - ctrlPanel.add(sheenLabel = new JLabel("Sheen"), aConstraints); |
---|
1521 | | - sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1522 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1523 | | - aConstraints.gridx += 1; |
---|
1524 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1525 | | - ctrlPanel.add(sheenField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1526 | | - aConstraints.gridx = 0; |
---|
1527 | | - aConstraints.gridy += 1; |
---|
1528 | | - aConstraints.gridwidth = 1; |
---|
| 1672 | + cGridBag subsurface = new cGridBag(); |
---|
| 1673 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1674 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1675 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1676 | + diffuseSection.add(subsurface); |
---|
1529 | 1677 | |
---|
1530 | | - ctrlPanel.add(subsurfaceLabel = new JLabel("Subsurface"), aConstraints); |
---|
1531 | | - subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1532 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1533 | | - aConstraints.gridx += 1; |
---|
1534 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1535 | | - ctrlPanel.add(subsurfaceField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1536 | | - aConstraints.gridx = 0; |
---|
1537 | | - aConstraints.gridy += 1; |
---|
1538 | | - aConstraints.gridwidth = 1; |
---|
| 1678 | + cGridBag shadow = new cGridBag(); |
---|
| 1679 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1680 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1681 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1682 | + diffuseSection.add(shadow); |
---|
1539 | 1683 | |
---|
1540 | | - ctrlPanel.add(shadowLabel = new JLabel("Shadowing"), aConstraints); |
---|
1541 | | - shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1542 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1543 | | - aConstraints.gridx += 1; |
---|
1544 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1545 | | - ctrlPanel.add(shadowField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1546 | | - aConstraints.gridx = 0; |
---|
1547 | | - aConstraints.gridy += 1; |
---|
1548 | | - aConstraints.gridwidth = 1; |
---|
| 1684 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1685 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1686 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1687 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1688 | + diffuseSection.add(fakedepth); |
---|
1549 | 1689 | |
---|
1550 | | - ctrlPanel.add(fakedepthLabel = new JLabel("Fakedepth"), aConstraints); |
---|
1551 | | - fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1552 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1553 | | - aConstraints.gridx += 1; |
---|
1554 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1555 | | - ctrlPanel.add(fakedepthField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1556 | | - aConstraints.gridx = 0; |
---|
1557 | | - aConstraints.gridy += 1; |
---|
1558 | | - aConstraints.gridwidth = 1; |
---|
| 1690 | + panel.add(new JSeparator()); |
---|
| 1691 | + |
---|
| 1692 | + panel.add(diffuseSection); |
---|
| 1693 | + |
---|
| 1694 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1695 | + |
---|
| 1696 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1559 | 1697 | |
---|
1560 | | - //aConstraints.weighty = 1; |
---|
1561 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1562 | | - //aConstraints.gridx += 1; |
---|
1563 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1564 | | - aConstraints.weighty = 0; |
---|
1565 | | - aConstraints.gridx = 0; |
---|
1566 | | - aConstraints.gridy += 1; |
---|
1567 | | - aConstraints.gridwidth = 1; |
---|
| 1698 | + cGridBag specular = new cGridBag(); |
---|
| 1699 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1700 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1701 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1702 | + specularSection.add(specular); |
---|
1568 | 1703 | |
---|
1569 | | - ctrlPanel.add(specularLabel = new JLabel("Specular"), aConstraints); |
---|
1570 | | - specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1571 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1572 | | - aConstraints.gridx += 1; |
---|
1573 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1574 | | - ctrlPanel.add(specularField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1575 | | - aConstraints.gridx = 0; |
---|
1576 | | - aConstraints.gridy += 1; |
---|
1577 | | - aConstraints.gridwidth = 1; |
---|
| 1704 | + cGridBag lightarea = new cGridBag(); |
---|
| 1705 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1706 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1707 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1708 | + specularSection.add(lightarea); |
---|
1578 | 1709 | |
---|
1579 | | - ctrlPanel.add(lightareaLabel = new JLabel("Lightarea"), aConstraints); |
---|
1580 | | - lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1581 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1582 | | - aConstraints.gridx += 1; |
---|
1583 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1584 | | - ctrlPanel.add(lightareaField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1585 | | - aConstraints.gridx = 0; |
---|
1586 | | - aConstraints.gridy += 1; |
---|
1587 | | - aConstraints.gridwidth = 1; |
---|
| 1710 | + cGridBag shininess = new cGridBag(); |
---|
| 1711 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1712 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1713 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1714 | + specularSection.add(shininess); |
---|
1588 | 1715 | |
---|
1589 | | - ctrlPanel.add(shininessLabel = new JLabel("Roughness"), aConstraints); |
---|
1590 | | - shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1591 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1592 | | - aConstraints.gridx += 1; |
---|
1593 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1594 | | - ctrlPanel.add(shininessField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1595 | | - aConstraints.gridx = 0; |
---|
1596 | | - aConstraints.gridy += 1; |
---|
1597 | | - aConstraints.gridwidth = 1; |
---|
| 1716 | + cGridBag metalness = new cGridBag(); |
---|
| 1717 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1718 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1719 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1720 | + specularSection.add(metalness); |
---|
1598 | 1721 | |
---|
1599 | | - ctrlPanel.add(metalnessLabel = new JLabel("Metalness"), aConstraints); |
---|
1600 | | - metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1601 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1602 | | - aConstraints.gridx += 1; |
---|
1603 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1604 | | - ctrlPanel.add(metalnessField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1605 | | - aConstraints.gridx = 0; |
---|
1606 | | - aConstraints.gridy += 1; |
---|
1607 | | - aConstraints.gridwidth = 1; |
---|
| 1722 | + cGridBag velvet = new cGridBag(); |
---|
| 1723 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1724 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1725 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1726 | + specularSection.add(velvet); |
---|
1608 | 1727 | |
---|
1609 | | - ctrlPanel.add(velvetLabel = new JLabel("Velvet"), aConstraints); |
---|
1610 | | - velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1611 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1612 | | - aConstraints.gridx += 1; |
---|
1613 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1614 | | - ctrlPanel.add(velvetField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1615 | | - aConstraints.gridx = 0; |
---|
1616 | | - aConstraints.gridy += 1; |
---|
1617 | | - aConstraints.gridwidth = 1; |
---|
1618 | | - |
---|
1619 | | - shiftField = AddSlider(ctrlPanel, "Shift", 0.001, 50, copy.material.shift, -1); |
---|
1620 | | - Return(); |
---|
| 1728 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1729 | + //Return(); |
---|
1621 | 1730 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1622 | 1731 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1623 | 1732 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1628 | 1737 | // aConstraints.gridy += 1; |
---|
1629 | 1738 | // aConstraints.gridwidth = 1; |
---|
1630 | 1739 | |
---|
1631 | | - //aConstraints.weighty = 1; |
---|
1632 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1633 | | - //aConstraints.gridx += 1; |
---|
1634 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1635 | | - aConstraints.weighty = 0; |
---|
1636 | | - aConstraints.gridx = 0; |
---|
1637 | | - aConstraints.gridy += 1; |
---|
1638 | | - aConstraints.gridwidth = 1; |
---|
1639 | 1740 | |
---|
1640 | | - ctrlPanel.add(cameraLabel = new JLabel("GlobalLight"), aConstraints); |
---|
1641 | | - cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1642 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1643 | | - aConstraints.gridx += 1; |
---|
1644 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1645 | | - ctrlPanel.add(cameraField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1646 | | - aConstraints.gridx = 0; |
---|
1647 | | - aConstraints.gridy += 1; |
---|
1648 | | - aConstraints.gridwidth = 1; |
---|
| 1741 | + panel.add(new JSeparator()); |
---|
| 1742 | + |
---|
| 1743 | + panel.add(specularSection); |
---|
| 1744 | + |
---|
| 1745 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1746 | + |
---|
| 1747 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1649 | 1748 | |
---|
1650 | | - ctrlPanel.add(ambientLabel = new JLabel("Ambient"), aConstraints); |
---|
1651 | | - ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1652 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1653 | | - aConstraints.gridx += 1; |
---|
1654 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1655 | | - ctrlPanel.add(ambientField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1656 | | - aConstraints.gridx = 0; |
---|
1657 | | - aConstraints.gridy += 1; |
---|
1658 | | - aConstraints.gridwidth = 1; |
---|
| 1749 | + cGridBag camera = new cGridBag(); |
---|
| 1750 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1751 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1752 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1753 | + globalSection.add(camera); |
---|
1659 | 1754 | |
---|
1660 | | - ctrlPanel.add(backlitLabel = new JLabel("Backlit"), aConstraints); |
---|
1661 | | - backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1662 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1663 | | - aConstraints.gridx += 1; |
---|
1664 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1665 | | - ctrlPanel.add(backlitField = new NumberSlider(0.001, 50, -1), aConstraints); |
---|
1666 | | - aConstraints.gridx = 0; |
---|
1667 | | - aConstraints.gridy += 1; |
---|
1668 | | - aConstraints.gridwidth = 1; |
---|
| 1755 | + cGridBag ambient = new cGridBag(); |
---|
| 1756 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1757 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1758 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1759 | + globalSection.add(ambient); |
---|
1669 | 1760 | |
---|
1670 | | - ctrlPanel.add(opacityLabel = new JLabel("Opacity"), aConstraints); |
---|
1671 | | - opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1672 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1673 | | - aConstraints.gridx += 1; |
---|
1674 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1675 | | - ctrlPanel.add(opacityField = new NumberSlider(0.001, 1, -0.1), aConstraints); |
---|
1676 | | - aConstraints.gridx = 0; |
---|
1677 | | - aConstraints.gridy += 1; |
---|
1678 | | - aConstraints.gridwidth = 1; |
---|
1679 | | - aConstraints.weighty = 0; |
---|
| 1761 | + cGridBag backlit = new cGridBag(); |
---|
| 1762 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1763 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1764 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1765 | + globalSection.add(backlit); |
---|
1680 | 1766 | |
---|
1681 | | - ctrlPanel.add(bumpLabel = new JLabel("Bump"), aConstraints); |
---|
1682 | | - bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1683 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1684 | | - aConstraints.gridx += 1; |
---|
1685 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1686 | | - ctrlPanel.add(bumpField = new NumberSlider(0.0, 2), aConstraints); |
---|
1687 | | - aConstraints.gridx = 0; |
---|
1688 | | - aConstraints.gridy += 1; |
---|
1689 | | - aConstraints.gridwidth = 1; |
---|
| 1767 | + cGridBag opacity = new cGridBag(); |
---|
| 1768 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1769 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1770 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1771 | + globalSection.add(opacity); |
---|
1690 | 1772 | |
---|
1691 | | - ctrlPanel.add(noiseLabel = new JLabel("Noise"), aConstraints); |
---|
1692 | | - noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1693 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1694 | | - aConstraints.gridx += 1; |
---|
1695 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1696 | | - ctrlPanel.add(noiseField = new NumberSlider(0.0, 1/*5*/), aConstraints); |
---|
1697 | | - aConstraints.gridx = 0; |
---|
1698 | | - aConstraints.gridy += 1; |
---|
1699 | | - aConstraints.gridwidth = 1; |
---|
| 1773 | + panel.add(new JSeparator()); |
---|
| 1774 | + |
---|
| 1775 | + panel.add(globalSection); |
---|
| 1776 | + |
---|
| 1777 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1778 | + |
---|
| 1779 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1700 | 1780 | |
---|
1701 | | - ctrlPanel.add(powerLabel = new JLabel("Turbulance"), aConstraints); |
---|
1702 | | - powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1703 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1704 | | - aConstraints.gridx += 1; |
---|
1705 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1706 | | - ctrlPanel.add(powerField = new NumberSlider(0.0, 5), aConstraints); |
---|
1707 | | - aConstraints.gridx = 0; |
---|
1708 | | - aConstraints.gridy += 1; |
---|
1709 | | - aConstraints.gridwidth = 1; |
---|
| 1781 | + cGridBag bump = new cGridBag(); |
---|
| 1782 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1783 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1784 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1785 | + textureSection.add(bump); |
---|
1710 | 1786 | |
---|
1711 | | - ctrlPanel.add(borderfadeLabel = new JLabel("Borderfade"), aConstraints); |
---|
1712 | | - borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1713 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1714 | | - aConstraints.gridx += 1; |
---|
1715 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1716 | | - ctrlPanel.add(borderfadeField = new NumberSlider(0.0, 2), aConstraints); |
---|
1717 | | - aConstraints.gridx = 0; |
---|
1718 | | - aConstraints.gridy += 1; |
---|
1719 | | - aConstraints.gridwidth = 1; |
---|
| 1787 | + cGridBag noise = new cGridBag(); |
---|
| 1788 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1789 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1790 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1791 | + textureSection.add(noise); |
---|
1720 | 1792 | |
---|
1721 | | - ctrlPanel.add(fogLabel = new JLabel("Punch"), aConstraints); |
---|
1722 | | - fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1723 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1724 | | - aConstraints.gridx += 1; |
---|
1725 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1726 | | - ctrlPanel.add(fogField = new NumberSlider(0.0, 20), aConstraints); |
---|
1727 | | - aConstraints.gridx = 0; |
---|
1728 | | - aConstraints.gridy += 1; |
---|
1729 | | - aConstraints.gridwidth = 1; |
---|
| 1793 | + cGridBag power = new cGridBag(); |
---|
| 1794 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1795 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1796 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1797 | + textureSection.add(power); |
---|
1730 | 1798 | |
---|
1731 | | - ctrlPanel.add(opacityPowerLabel = new JLabel("Halo"), aConstraints); |
---|
1732 | | - opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1733 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1734 | | - aConstraints.gridx += 1; |
---|
1735 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
1736 | | - ctrlPanel.add(opacityPowerField = new NumberSlider(0.0, 10 /*10 dec 2013*/), aConstraints); |
---|
1737 | | - aConstraints.gridx = 0; |
---|
1738 | | - aConstraints.gridy += 1; |
---|
1739 | | - aConstraints.gridwidth = 1; |
---|
| 1799 | + cGridBag borderfade = new cGridBag(); |
---|
| 1800 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1801 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1802 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1803 | + textureSection.add(borderfade); |
---|
1740 | 1804 | |
---|
1741 | | - //aConstraints.weighty = 1; |
---|
1742 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1743 | | - //aConstraints.gridx += 1; |
---|
1744 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1745 | | - aConstraints.weighty = 0; |
---|
| 1805 | + cGridBag fog = new cGridBag(); |
---|
| 1806 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1807 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1808 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1809 | + textureSection.add(fog); |
---|
1746 | 1810 | |
---|
1747 | | - aConstraints.gridx = 0; |
---|
1748 | | - aConstraints.gridy = 0; |
---|
1749 | | - aConstraints.gridwidth = 1; |
---|
| 1811 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1812 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1813 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1814 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1815 | + textureSection.add(opacityPower); |
---|
| 1816 | + |
---|
| 1817 | + panel.add(new JSeparator()); |
---|
| 1818 | + |
---|
| 1819 | + panel.add(textureSection); |
---|
| 1820 | + |
---|
| 1821 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1750 | 1822 | |
---|
1751 | 1823 | SetMaterial(copy); // .GetMaterial()); |
---|
1752 | 1824 | |
---|
1753 | | - colorField.addChangeListener(this); |
---|
1754 | | - modulationField.addChangeListener(this); |
---|
| 1825 | + //colorField.addChangeListener(this); |
---|
| 1826 | +// modulationField.addChangeListener(this); |
---|
1755 | 1827 | metalnessField.addChangeListener(this); |
---|
1756 | 1828 | diffuseField.addChangeListener(this); |
---|
1757 | 1829 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1781 | 1853 | opacityPowerField.addChangeListener(this); |
---|
1782 | 1854 | /**/ |
---|
1783 | 1855 | |
---|
1784 | | - resetSlidersButton.addActionListener(this); |
---|
1785 | 1856 | clearMaterialButton.addActionListener(this); |
---|
1786 | 1857 | createMaterialButton.addActionListener(this); |
---|
1787 | | - |
---|
1788 | | - propagateToggle.addItemListener(this); |
---|
1789 | | - multiplyToggle.addItemListener(this); |
---|
| 1858 | + |
---|
| 1859 | + if (Globals.ADVANCED) |
---|
| 1860 | + { |
---|
| 1861 | + resetSlidersButton.addActionListener(this); |
---|
| 1862 | + propagateToggle.addItemListener(this); |
---|
| 1863 | + multiplyToggle.addItemListener(this); |
---|
| 1864 | + } |
---|
1790 | 1865 | } |
---|
1791 | 1866 | |
---|
1792 | 1867 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1957 | 2032 | |
---|
1958 | 2033 | //? flashIt = false; |
---|
1959 | 2034 | CameraPane pane = (CameraPane) cameraView; |
---|
1960 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2035 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1961 | 2036 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1962 | 2037 | |
---|
1963 | 2038 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2006 | 2081 | e2.printStackTrace(); |
---|
2007 | 2082 | } |
---|
2008 | 2083 | } |
---|
| 2084 | + |
---|
2009 | 2085 | LoadJMEThread loadThread; |
---|
2010 | 2086 | |
---|
2011 | 2087 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2063 | 2139 | //LoadFile0(filename, converter); |
---|
2064 | 2140 | } |
---|
2065 | 2141 | } |
---|
| 2142 | + |
---|
2066 | 2143 | LoadOBJThread loadObjThread; |
---|
2067 | 2144 | |
---|
2068 | 2145 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2141 | 2218 | |
---|
2142 | 2219 | void LoadObjFile(String fullname) |
---|
2143 | 2220 | { |
---|
2144 | | - /* |
---|
| 2221 | + System.out.println("Loading " + fullname); |
---|
| 2222 | + /**/ |
---|
2145 | 2223 | //lastFilename = fullname; |
---|
2146 | 2224 | if(loadObjThread == null) |
---|
2147 | 2225 | { |
---|
2148 | | - loadObjThread = new LoadOBJThread(); |
---|
2149 | | - loadObjThread.start(); |
---|
| 2226 | + loadObjThread = new LoadOBJThread(); |
---|
| 2227 | + loadObjThread.start(); |
---|
2150 | 2228 | } |
---|
2151 | 2229 | |
---|
2152 | 2230 | loadObjThread.add(fullname); |
---|
2153 | | - */ |
---|
| 2231 | + /**/ |
---|
2154 | 2232 | |
---|
2155 | | - System.out.println("Loading " + fullname); |
---|
2156 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2233 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2157 | 2234 | } |
---|
2158 | 2235 | |
---|
2159 | 2236 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2414 | 2491 | |
---|
2415 | 2492 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2416 | 2493 | { |
---|
2417 | | - if (GrafreeD.standAlone) |
---|
| 2494 | + if (Grafreed.standAlone) |
---|
2418 | 2495 | { |
---|
2419 | 2496 | /**/ |
---|
2420 | 2497 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2421 | | - browser.show(); |
---|
| 2498 | + browser.setVisible(true); |
---|
2422 | 2499 | String filename = browser.getFile(); |
---|
2423 | 2500 | if (filename != null && filename.length() > 0) |
---|
2424 | 2501 | { |
---|
.. | .. |
---|
2563 | 2640 | } |
---|
2564 | 2641 | if (input == null) |
---|
2565 | 2642 | { |
---|
| 2643 | + new Exception().printStackTrace(); |
---|
2566 | 2644 | System.exit(0); |
---|
2567 | 2645 | } |
---|
2568 | 2646 | |
---|
.. | .. |
---|
2777 | 2855 | return; |
---|
2778 | 2856 | } |
---|
2779 | 2857 | |
---|
2780 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2858 | + if (multiplyToggle != null) |
---|
| 2859 | + multiplyToggle.setSelected(mat.multiply); |
---|
2781 | 2860 | |
---|
2782 | 2861 | assert (object.projectedVertices != null); |
---|
2783 | 2862 | |
---|
.. | .. |
---|
2959 | 3038 | // june 2013 copy.HardTouch(); |
---|
2960 | 3039 | cameraView.repaint(); |
---|
2961 | 3040 | return; |
---|
2962 | | - } else if (event.getSource() == toggleFullItem) |
---|
| 3041 | + } else if (event.getSource() == toggleTimelineItem) |
---|
2963 | 3042 | { |
---|
2964 | | - if (CameraPane.FULLSCREEN) |
---|
| 3043 | + timeline ^= true; |
---|
| 3044 | + |
---|
| 3045 | + if (timeline) |
---|
2965 | 3046 | { |
---|
2966 | | - frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
2967 | | - framePanel.add(bigThree); |
---|
2968 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
2969 | | - } else |
---|
2970 | | - { |
---|
2971 | | - frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
2972 | | - frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 3047 | + centralPanel.remove(cameraView); |
---|
| 3048 | + cameraPanel.add(cameraView); |
---|
| 3049 | + centralPanel.add(cameraPanel); |
---|
| 3050 | + frame.setJMenuBar(timelineMenubar); |
---|
| 3051 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3052 | + if (!CameraPane.FULLSCREEN) |
---|
| 3053 | + ToggleFullScreen(); |
---|
| 3054 | + toggleFullScreenItem.setEnabled(false); |
---|
2973 | 3055 | } |
---|
| 3056 | + else |
---|
| 3057 | + { |
---|
| 3058 | + centralPanel.remove(cameraPanel); |
---|
| 3059 | + centralPanel.add(cameraView); |
---|
| 3060 | + frame.setJMenuBar(null); |
---|
| 3061 | + if (!wasFullScreen) |
---|
| 3062 | + ToggleFullScreen(); |
---|
| 3063 | + toggleFullScreenItem.setEnabled(true); |
---|
| 3064 | + } |
---|
| 3065 | + |
---|
2974 | 3066 | frame.validate(); |
---|
2975 | | - cameraView.ToggleFullScreen(); |
---|
| 3067 | + return; |
---|
| 3068 | + } else if (event.getSource() == toggleFullScreenItem) |
---|
| 3069 | + { |
---|
| 3070 | + ToggleFullScreen(); |
---|
| 3071 | + frame.validate(); |
---|
2976 | 3072 | |
---|
2977 | 3073 | return; |
---|
2978 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3074 | + } else if (event.getSource() == toggleSwitchItem) |
---|
2979 | 3075 | { |
---|
2980 | | - cameraView.ToggleRandom(); |
---|
| 3076 | + cameraView.ToggleSwitch(); |
---|
2981 | 3077 | cameraView.repaint(); |
---|
2982 | 3078 | return; |
---|
2983 | 3079 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3006 | 3102 | { |
---|
3007 | 3103 | copy.live ^= true; |
---|
3008 | 3104 | return; |
---|
| 3105 | + } else if (event.getSource() == selectCB) |
---|
| 3106 | + { |
---|
| 3107 | + copy.dontselect ^= true; |
---|
| 3108 | + return; |
---|
3009 | 3109 | } else if (event.getSource() == hideCB) |
---|
3010 | 3110 | { |
---|
3011 | 3111 | copy.hide ^= true; |
---|
.. | .. |
---|
3020 | 3120 | if (event.getSource() == randomCB) |
---|
3021 | 3121 | { |
---|
3022 | 3122 | copy.random ^= true; |
---|
| 3123 | + objEditor.refreshContents(); |
---|
3023 | 3124 | return; |
---|
3024 | 3125 | } |
---|
3025 | 3126 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3043 | 3144 | |
---|
3044 | 3145 | public void actionPerformed(ActionEvent event) |
---|
3045 | 3146 | { |
---|
| 3147 | + Object source = event.getSource(); |
---|
3046 | 3148 | // SCRIPT DIALOG |
---|
3047 | | - if (event.getSource() == okbutton) |
---|
| 3149 | + if (source == okbutton) |
---|
3048 | 3150 | { |
---|
3049 | 3151 | textpanel.setVisible(false); |
---|
3050 | 3152 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3056 | 3158 | textarea = null; |
---|
3057 | 3159 | textpanel = null; |
---|
3058 | 3160 | } |
---|
3059 | | - if (event.getSource() == cancelbutton) |
---|
| 3161 | + if (source == cancelbutton) |
---|
3060 | 3162 | { |
---|
3061 | 3163 | textpanel.setVisible(false); |
---|
3062 | 3164 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3068 | 3170 | //applySelf(); |
---|
3069 | 3171 | //client.refreshEditWindow(); |
---|
3070 | 3172 | //refreshContents(); |
---|
3071 | | - if (event.getSource() == nameField) |
---|
| 3173 | + if (source == nameField) |
---|
3072 | 3174 | { |
---|
3073 | 3175 | //System.out.println("ObjEditor " + event); |
---|
3074 | 3176 | applySelf0(true); |
---|
3075 | 3177 | //parent.applySelf(); |
---|
3076 | 3178 | objEditor.refreshContents(); |
---|
3077 | | - } else if (event.getSource() == resetButton) |
---|
| 3179 | + } else if (source == resetButton) |
---|
3078 | 3180 | { |
---|
3079 | 3181 | CameraPane.fullreset = true; |
---|
3080 | 3182 | copy.Reset(); // ResetMeshes(); |
---|
3081 | 3183 | copy.Touch(); |
---|
3082 | 3184 | objEditor.refreshContents(); |
---|
3083 | | - } else if (event.getSource() == stepItem) |
---|
| 3185 | + } else if (source == stepItem) |
---|
3084 | 3186 | { |
---|
3085 | | - cameraView.ONESTEP = true; |
---|
| 3187 | + //cameraView.ONESTEP = true; |
---|
| 3188 | + Globals.ONESTEP = true; |
---|
3086 | 3189 | cameraView.repaint(); |
---|
3087 | 3190 | return; |
---|
3088 | | - } else if (event.getSource() == stepButton) |
---|
| 3191 | + } else if (source == stepButton) |
---|
3089 | 3192 | { |
---|
3090 | 3193 | copy.Step(); |
---|
3091 | 3194 | copy.Touch(); |
---|
3092 | 3195 | objEditor.refreshContents(); |
---|
3093 | | - } else if (event.getSource() == slowerButton) |
---|
| 3196 | + } else if (source == slowerButton) |
---|
3094 | 3197 | { |
---|
3095 | 3198 | copy.Slower(); |
---|
3096 | 3199 | copy.Touch(); |
---|
3097 | 3200 | objEditor.refreshContents(); |
---|
3098 | | - } else if (event.getSource() == fasterButton) |
---|
| 3201 | + } else if (source == fasterButton) |
---|
3099 | 3202 | { |
---|
3100 | 3203 | copy.Faster(); |
---|
3101 | 3204 | copy.Touch(); |
---|
3102 | 3205 | objEditor.refreshContents(); |
---|
3103 | | - } else if (event.getSource() == remarkButton) |
---|
| 3206 | + } else if (source == remarkButton) |
---|
3104 | 3207 | { |
---|
3105 | 3208 | copy.Remark(); |
---|
3106 | 3209 | copy.Touch(); |
---|
3107 | 3210 | objEditor.refreshContents(); |
---|
3108 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3211 | + } else if (source == stepAllButton) |
---|
3109 | 3212 | { |
---|
3110 | 3213 | copy.StepAll(); |
---|
3111 | 3214 | copy.Touch(); |
---|
3112 | 3215 | objEditor.refreshContents(); |
---|
3113 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3216 | + } else if (source == resetAllButton) |
---|
3114 | 3217 | { |
---|
3115 | 3218 | //CameraPane.fullreset = true; |
---|
3116 | 3219 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3143 | 3246 | // Close(); |
---|
3144 | 3247 | // } |
---|
3145 | 3248 | // else |
---|
3146 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3249 | + if (source == resetSlidersButton) |
---|
3147 | 3250 | { |
---|
3148 | 3251 | ResetSliders(); |
---|
3149 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3252 | + } else if (source == clearMaterialButton) |
---|
3150 | 3253 | { |
---|
3151 | 3254 | ClearMaterial(); |
---|
3152 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3255 | + } else if (source == createMaterialButton) |
---|
3153 | 3256 | { |
---|
3154 | 3257 | CreateMaterial(); |
---|
3155 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3258 | + } else if (source == clearPanelButton) |
---|
3156 | 3259 | { |
---|
3157 | 3260 | copy.ClearUI(); |
---|
3158 | 3261 | refreshContents(true); |
---|
3159 | | - } /* |
---|
3160 | | - } |
---|
3161 | | - |
---|
3162 | | - public boolean action(Event event, Object arg) |
---|
3163 | | - { |
---|
3164 | | - */ else if (event.getSource() == closeItem) |
---|
| 3262 | + } else if (source == importGFDItem) |
---|
| 3263 | + { |
---|
| 3264 | + ImportGFD(); |
---|
| 3265 | + } else |
---|
| 3266 | + if (source == importVRMLX3DItem) |
---|
| 3267 | + { |
---|
| 3268 | + ImportVRMLX3D(); |
---|
| 3269 | + } else |
---|
| 3270 | + if (source == import3DSItem) |
---|
| 3271 | + { |
---|
| 3272 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3273 | + } else |
---|
| 3274 | + if (source == importOBJItem) |
---|
| 3275 | + { |
---|
| 3276 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3277 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3278 | + browser.setVisible(true); |
---|
| 3279 | + String filename = browser.getFile(); |
---|
| 3280 | + if (filename != null && filename.length() > 0) |
---|
| 3281 | + { |
---|
| 3282 | + String fullname = browser.getDirectory() + filename; |
---|
| 3283 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3284 | + } |
---|
| 3285 | + } else |
---|
| 3286 | + if (source == closeItem) |
---|
3165 | 3287 | { |
---|
3166 | 3288 | Close(); |
---|
3167 | 3289 | //return true; |
---|
3168 | | - } else if (event.getSource() == loadItem) |
---|
| 3290 | + } else if (source == loadItem) |
---|
3169 | 3291 | { |
---|
3170 | 3292 | load(); |
---|
3171 | 3293 | //return true; |
---|
3172 | | - } else if (event.getSource() == saveItem) |
---|
| 3294 | + } else if (source == newItem) |
---|
| 3295 | + { |
---|
| 3296 | + New(); |
---|
| 3297 | + } else if (source == saveItem) |
---|
3173 | 3298 | { |
---|
3174 | 3299 | save(); |
---|
3175 | 3300 | //return true; |
---|
3176 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3301 | + } else if (source == saveAsItem) |
---|
3177 | 3302 | { |
---|
3178 | 3303 | saveAs(); |
---|
3179 | 3304 | //return true; |
---|
3180 | | - } else if (event.getSource() == reexportItem) |
---|
| 3305 | + } else if (source == reexportItem) |
---|
3181 | 3306 | { |
---|
3182 | 3307 | reexport(); |
---|
3183 | 3308 | //return true; |
---|
3184 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3309 | + } else if (source == exportAsItem) |
---|
3185 | 3310 | { |
---|
3186 | 3311 | export(); |
---|
3187 | 3312 | //return true; |
---|
3188 | | - } else if (event.getSource() == povItem) |
---|
| 3313 | + } else if (source == povItem) |
---|
3189 | 3314 | { |
---|
3190 | 3315 | generatePOV(); |
---|
3191 | 3316 | //return true; |
---|
3192 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3317 | + } else if (source == zBufferItem) |
---|
3193 | 3318 | { |
---|
3194 | 3319 | try |
---|
3195 | 3320 | { |
---|
.. | .. |
---|
3211 | 3336 | cameraView.repaint(); |
---|
3212 | 3337 | //return true; |
---|
3213 | 3338 | } |
---|
3214 | | - */ else if (event.getSource() == editCameraItem) |
---|
3215 | | - { |
---|
3216 | | - cameraView.ProtectCamera(); |
---|
3217 | | - cameraView.repaint(); |
---|
3218 | | - return; |
---|
3219 | | - } else if (event.getSource() == revertCameraItem) |
---|
3220 | | - { |
---|
3221 | | - cameraView.RevertCamera(); |
---|
3222 | | - cameraView.repaint(); |
---|
3223 | | - return; |
---|
3224 | | - } else if (event.getSource() == textureButton) |
---|
3225 | | - { |
---|
3226 | | - return; // true; |
---|
3227 | | - } else // combos... |
---|
3228 | | - if (event.getSource() == texresMenu) |
---|
| 3339 | + */ else // combos... |
---|
| 3340 | + if (source == texresMenu) |
---|
3229 | 3341 | { |
---|
3230 | 3342 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3231 | 3343 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3237 | 3349 | } |
---|
3238 | 3350 | } |
---|
3239 | 3351 | |
---|
3240 | | - void ToggleAnimation() |
---|
| 3352 | + void New() |
---|
3241 | 3353 | { |
---|
3242 | | - if (!CameraPane.ANIMATION) |
---|
| 3354 | + while (copy.Size() > 1) |
---|
3243 | 3355 | { |
---|
3244 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3356 | + copy.remove(1); |
---|
| 3357 | + } |
---|
| 3358 | + |
---|
| 3359 | + ResetModel(); |
---|
| 3360 | + objEditor.refreshContents(); |
---|
| 3361 | + } |
---|
| 3362 | + |
---|
| 3363 | + static public byte[] Compress(Object3D o) |
---|
| 3364 | + { |
---|
| 3365 | + try |
---|
| 3366 | + { |
---|
| 3367 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3368 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3369 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3370 | + |
---|
| 3371 | + Object3D parent = o.parent; |
---|
| 3372 | + o.parent = null; |
---|
| 3373 | + |
---|
| 3374 | + out.writeObject(o); |
---|
| 3375 | + |
---|
| 3376 | + o.parent = parent; |
---|
| 3377 | + |
---|
| 3378 | + out.flush(); |
---|
| 3379 | + |
---|
| 3380 | + zstream.close(); |
---|
| 3381 | + out.close(); |
---|
| 3382 | + |
---|
| 3383 | + return baos.toByteArray(); |
---|
| 3384 | + } catch (Exception e) |
---|
| 3385 | + { |
---|
| 3386 | + System.err.println(e); |
---|
| 3387 | + return null; |
---|
| 3388 | + } |
---|
| 3389 | + } |
---|
| 3390 | + |
---|
| 3391 | + static public Object Uncompress(byte[] bytes) |
---|
| 3392 | + { |
---|
| 3393 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3394 | + try |
---|
| 3395 | + { |
---|
| 3396 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3397 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3398 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3399 | + Object obj = in.readObject(); |
---|
| 3400 | + in.close(); |
---|
| 3401 | + |
---|
| 3402 | + return obj; |
---|
| 3403 | + } catch (Exception e) |
---|
| 3404 | + { |
---|
| 3405 | + System.err.println(e); |
---|
| 3406 | + return null; |
---|
| 3407 | + } |
---|
| 3408 | + } |
---|
| 3409 | + |
---|
| 3410 | + static public Object clone(Object o) |
---|
| 3411 | + { |
---|
| 3412 | + try |
---|
| 3413 | + { |
---|
| 3414 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3415 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3416 | + |
---|
| 3417 | + out.writeObject(o); |
---|
| 3418 | + |
---|
| 3419 | + out.flush(); |
---|
| 3420 | + out.close(); |
---|
| 3421 | + |
---|
| 3422 | + byte[] bytes = baos.toByteArray(); |
---|
| 3423 | + |
---|
| 3424 | + System.out.println("clone = " + bytes.length); |
---|
| 3425 | + |
---|
| 3426 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3427 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3428 | + Object obj = in.readObject(); |
---|
| 3429 | + in.close(); |
---|
| 3430 | + |
---|
| 3431 | + return obj; |
---|
| 3432 | + } catch (Exception e) |
---|
| 3433 | + { |
---|
| 3434 | + System.err.println(e); |
---|
| 3435 | + return null; |
---|
| 3436 | + } |
---|
| 3437 | + } |
---|
| 3438 | + |
---|
| 3439 | + cRadio GetCurrentTab() |
---|
| 3440 | + { |
---|
| 3441 | + cRadio ab; |
---|
| 3442 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3443 | + { |
---|
| 3444 | + ab = (cRadio)e.nextElement(); |
---|
| 3445 | + if(ab.GetObject() == copy) |
---|
| 3446 | + { |
---|
| 3447 | + return ab; |
---|
| 3448 | + } |
---|
| 3449 | + } |
---|
| 3450 | + |
---|
| 3451 | + return null; |
---|
| 3452 | + } |
---|
| 3453 | + |
---|
| 3454 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3455 | + |
---|
| 3456 | + public void Save() |
---|
| 3457 | + { |
---|
| 3458 | + System.err.println("Save"); |
---|
| 3459 | + |
---|
| 3460 | + cRadio tab = GetCurrentTab(); |
---|
| 3461 | + |
---|
| 3462 | + boolean temp = CameraPane.SWITCH; |
---|
| 3463 | + CameraPane.SWITCH = false; |
---|
| 3464 | + |
---|
| 3465 | + copy.ExtractBigData(hashtable); |
---|
| 3466 | + |
---|
| 3467 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3468 | + tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3469 | + |
---|
| 3470 | + copy.RestoreBigData(hashtable); |
---|
| 3471 | + |
---|
| 3472 | + CameraPane.SWITCH = temp; |
---|
| 3473 | + |
---|
| 3474 | + //assert(hashtable.isEmpty()); |
---|
| 3475 | + |
---|
| 3476 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3477 | + { |
---|
| 3478 | + tab.graphs[i] = null; |
---|
| 3479 | + } |
---|
| 3480 | + |
---|
| 3481 | + // test save |
---|
| 3482 | + if (false) |
---|
| 3483 | + { |
---|
| 3484 | + try |
---|
| 3485 | + { |
---|
| 3486 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3487 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3488 | + |
---|
| 3489 | + p.writeObject(copy); |
---|
| 3490 | + |
---|
| 3491 | + p.flush(); |
---|
| 3492 | + |
---|
| 3493 | + ostream.close(); |
---|
| 3494 | + } catch (Exception e) |
---|
| 3495 | + { |
---|
| 3496 | + e.printStackTrace(); |
---|
| 3497 | + } |
---|
| 3498 | + } |
---|
| 3499 | + } |
---|
| 3500 | + |
---|
| 3501 | + void CopyChanged(Object3D obj) |
---|
| 3502 | + { |
---|
| 3503 | + boolean temp = CameraPane.SWITCH; |
---|
| 3504 | + CameraPane.SWITCH = false; |
---|
| 3505 | + |
---|
| 3506 | + copy.ExtractBigData(hashtable); |
---|
| 3507 | + |
---|
| 3508 | + copy.clear(); |
---|
| 3509 | + |
---|
| 3510 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3511 | + { |
---|
| 3512 | + copy.add(obj.get(i)); |
---|
| 3513 | + } |
---|
| 3514 | + |
---|
| 3515 | + copy.RestoreBigData(hashtable); |
---|
| 3516 | + |
---|
| 3517 | + CameraPane.SWITCH = temp; |
---|
| 3518 | + |
---|
| 3519 | + //assert(hashtable.isEmpty()); |
---|
| 3520 | + |
---|
| 3521 | + copy.Touch(); |
---|
| 3522 | + |
---|
| 3523 | + ResetModel(); |
---|
| 3524 | + copy.HardTouch(); // recompile? |
---|
| 3525 | + |
---|
| 3526 | + cRadio ab; |
---|
| 3527 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3528 | + { |
---|
| 3529 | + ab = (cRadio)e.nextElement(); |
---|
| 3530 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3531 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3532 | + if (test != null) |
---|
| 3533 | + { |
---|
| 3534 | + test.editWindow = ab.object.editWindow; |
---|
| 3535 | + ab.object = test; |
---|
| 3536 | + } |
---|
| 3537 | + } |
---|
| 3538 | + |
---|
| 3539 | + refreshContents(); |
---|
| 3540 | + } |
---|
| 3541 | + |
---|
| 3542 | + public void Undo() |
---|
| 3543 | + { |
---|
| 3544 | + System.err.println("Undo"); |
---|
| 3545 | + |
---|
| 3546 | + cRadio tab = GetCurrentTab(); |
---|
| 3547 | + |
---|
| 3548 | + if (tab.undoindex == 0) |
---|
| 3549 | + { |
---|
| 3550 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3551 | + return; |
---|
| 3552 | + } |
---|
| 3553 | + |
---|
| 3554 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3555 | + { |
---|
| 3556 | + Save(); |
---|
| 3557 | + tab.undoindex -= 1; |
---|
| 3558 | + } |
---|
| 3559 | + |
---|
| 3560 | + tab.undoindex -= 1; |
---|
| 3561 | + |
---|
| 3562 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3563 | + } |
---|
| 3564 | + |
---|
| 3565 | + public void Redo() |
---|
| 3566 | + { |
---|
| 3567 | + cRadio tab = GetCurrentTab(); |
---|
| 3568 | + |
---|
| 3569 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3570 | + { |
---|
| 3571 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3572 | + return; |
---|
| 3573 | + } |
---|
| 3574 | + |
---|
| 3575 | + tab.undoindex += 1; |
---|
| 3576 | + |
---|
| 3577 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3578 | + } |
---|
| 3579 | + |
---|
| 3580 | + void ImportGFD() |
---|
| 3581 | + { |
---|
| 3582 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3245 | 3583 | browser.show(); |
---|
3246 | 3584 | String filename = browser.getFile(); |
---|
3247 | 3585 | if (filename != null && filename.length() > 0) |
---|
3248 | 3586 | { |
---|
3249 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3587 | + String fullname = browser.getDirectory() + filename; |
---|
| 3588 | + |
---|
| 3589 | + //Object3D readobj = |
---|
| 3590 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3591 | + //makeSomething(readobj); |
---|
| 3592 | + } |
---|
| 3593 | + } |
---|
| 3594 | + |
---|
| 3595 | + void ImportVRMLX3D() |
---|
| 3596 | + { |
---|
| 3597 | + if (Grafreed.standAlone) |
---|
| 3598 | + { |
---|
| 3599 | + /**/ |
---|
| 3600 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3601 | + browser.show(); |
---|
| 3602 | + String filename = browser.getFile(); |
---|
| 3603 | + if (filename != null && filename.length() > 0) |
---|
| 3604 | + { |
---|
| 3605 | + String fullname = browser.getDirectory() + filename; |
---|
| 3606 | + LoadVRMLX3D(fullname); |
---|
| 3607 | + } |
---|
| 3608 | + /**/ |
---|
| 3609 | + } |
---|
| 3610 | + } |
---|
| 3611 | + |
---|
| 3612 | + void ToggleAnimation() |
---|
| 3613 | + { |
---|
| 3614 | + if (!Globals.ANIMATION) |
---|
| 3615 | + { |
---|
| 3616 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3617 | + browser.setVisible(true); |
---|
| 3618 | + String filename = browser.getFile(); |
---|
| 3619 | + if (filename != null && filename.length() > 0) |
---|
| 3620 | + { |
---|
| 3621 | + Globals.filename = browser.getDirectory() + filename; |
---|
3250 | 3622 | //CameraPane.framecount = 0; |
---|
3251 | | - CameraPane.imagecount = 0; |
---|
| 3623 | + Globals.imagecount = 0; |
---|
3252 | 3624 | |
---|
3253 | | - CameraPane.ANIMATION ^= true; |
---|
| 3625 | + Globals.ANIMATION ^= true; |
---|
3254 | 3626 | |
---|
3255 | | - GrafreeD.wav.cursor = 0; |
---|
3256 | | - GrafreeD.wav.loop = 0; |
---|
| 3627 | + Grafreed.wav.cursor = 0; |
---|
| 3628 | + Grafreed.wav.loop = 0; |
---|
3257 | 3629 | } |
---|
3258 | 3630 | } else |
---|
3259 | 3631 | { |
---|
3260 | | - CameraPane.ANIMATION ^= true; |
---|
| 3632 | + Globals.ANIMATION ^= true; |
---|
3261 | 3633 | } |
---|
3262 | 3634 | } |
---|
3263 | 3635 | |
---|
.. | .. |
---|
3303 | 3675 | void CreateMaterial() |
---|
3304 | 3676 | { |
---|
3305 | 3677 | //copy.ClearMaterial(); // PATCH |
---|
3306 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3678 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3307 | 3679 | if (copy.selection.size() > 0) |
---|
3308 | 3680 | //SetMaterial(copy); |
---|
3309 | 3681 | { |
---|
.. | .. |
---|
3362 | 3734 | { |
---|
3363 | 3735 | copy.ResetBlockLoop(); // temporary problem |
---|
3364 | 3736 | |
---|
3365 | | - boolean random = CameraPane.RANDOM; |
---|
3366 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3737 | + boolean random = CameraPane.SWITCH; |
---|
| 3738 | + CameraPane.SWITCH = false; // parse everything |
---|
3367 | 3739 | copy.ResetDisplayList(); |
---|
3368 | 3740 | copy.HardTouch(); |
---|
3369 | | - CameraPane.RANDOM = random; |
---|
| 3741 | + CameraPane.SWITCH = random; |
---|
3370 | 3742 | } |
---|
3371 | 3743 | |
---|
3372 | 3744 | // public void applySelf() |
---|
.. | .. |
---|
3436 | 3808 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3437 | 3809 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3438 | 3810 | |
---|
3439 | | - if (!NumberSlider.frozen) |
---|
| 3811 | + if (!cNumberSlider.frozen) |
---|
3440 | 3812 | { |
---|
3441 | 3813 | //System.out.println("Propagate = " + propagate); |
---|
3442 | 3814 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3815 | + |
---|
| 3816 | + if (copy.material != null) |
---|
| 3817 | + { |
---|
| 3818 | + cMaterial mat = copy.material; |
---|
| 3819 | + |
---|
| 3820 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3821 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3822 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3823 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3824 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3825 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3826 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3827 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3828 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3829 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3830 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3831 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3832 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3833 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3834 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3835 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3836 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3837 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3838 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3839 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3840 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3841 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3842 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3843 | + } |
---|
| 3844 | + |
---|
3443 | 3845 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3444 | 3846 | { |
---|
3445 | 3847 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3484 | 3886 | || e.getSource() == apertureField |
---|
3485 | 3887 | || e.getSource() == shadowblurField) |
---|
3486 | 3888 | { |
---|
| 3889 | + new Exception().printStackTrace(); |
---|
3487 | 3890 | System.exit(0); |
---|
3488 | 3891 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3489 | 3892 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3510 | 3913 | //System.out.println("PARENT = " + parent); |
---|
3511 | 3914 | //if (parent != null) |
---|
3512 | 3915 | // parent.applySelf(); |
---|
3513 | | - refreshContents(); |
---|
| 3916 | + if (e.getSource() == normalpushField) |
---|
| 3917 | + { |
---|
| 3918 | + objEditor.refreshContents(); |
---|
| 3919 | + //Refresh(); |
---|
| 3920 | + } |
---|
| 3921 | + else |
---|
| 3922 | + refreshContents(); |
---|
3514 | 3923 | // ??? client.refreshEditWindow(); |
---|
3515 | 3924 | } |
---|
3516 | 3925 | //else |
---|
.. | .. |
---|
3522 | 3931 | //group.name = nameField.getText(); |
---|
3523 | 3932 | //objEditor.applySelf(); |
---|
3524 | 3933 | |
---|
3525 | | - assert (objEditor == this); |
---|
| 3934 | + // OCT2018: assert (objEditor == this); |
---|
3526 | 3935 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3527 | 3936 | //super.applySelf() |
---|
3528 | 3937 | ; else |
---|
.. | .. |
---|
3546 | 3955 | objEditor.copy = keep; |
---|
3547 | 3956 | } |
---|
3548 | 3957 | } |
---|
| 3958 | + |
---|
| 3959 | + if (normalpushField != null) |
---|
| 3960 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3549 | 3961 | } |
---|
3550 | 3962 | |
---|
3551 | 3963 | void SnapObject() |
---|
3552 | 3964 | { |
---|
3553 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3554 | | - SnapObject(obj); |
---|
| 3965 | + if (copy.selection.size() > 0) |
---|
| 3966 | + { |
---|
| 3967 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 3968 | + SnapObject(obj); |
---|
| 3969 | + } |
---|
3555 | 3970 | } |
---|
3556 | 3971 | |
---|
3557 | 3972 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
3797 | 4212 | |
---|
3798 | 4213 | radioPanel.revalidate(); |
---|
3799 | 4214 | radioPanel.repaint(); |
---|
3800 | | - ctrlPanel.revalidate(); // ? new |
---|
| 4215 | + ctrlPanel.validate(); // ? new |
---|
3801 | 4216 | ctrlPanel.repaint(); |
---|
3802 | 4217 | } |
---|
3803 | 4218 | } |
---|
.. | .. |
---|
3806 | 4221 | |
---|
3807 | 4222 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3808 | 4223 | { |
---|
| 4224 | + if (Globals.SAVEONMAKE) |
---|
| 4225 | + Save(); |
---|
3809 | 4226 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3810 | 4227 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3811 | 4228 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4009 | 4426 | } |
---|
4010 | 4427 | } |
---|
4011 | 4428 | } |
---|
| 4429 | + |
---|
4012 | 4430 | LoadGFDThread loadGFDThread; |
---|
4013 | 4431 | |
---|
4014 | 4432 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4028 | 4446 | |
---|
4029 | 4447 | try |
---|
4030 | 4448 | { |
---|
| 4449 | + // Try compressed version first. |
---|
4031 | 4450 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4032 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4451 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4452 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4033 | 4453 | |
---|
4034 | 4454 | readobj = (Object3D) p.readObject(); |
---|
4035 | 4455 | istream.close(); |
---|
.. | .. |
---|
4037 | 4457 | readobj.ResetDisplayList(); |
---|
4038 | 4458 | } catch (Exception e) |
---|
4039 | 4459 | { |
---|
4040 | | - e.printStackTrace(); |
---|
| 4460 | + //e.printStackTrace(); |
---|
| 4461 | + try |
---|
| 4462 | + { |
---|
| 4463 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4464 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4465 | + |
---|
| 4466 | + readobj = (Object3D) p.readObject(); |
---|
| 4467 | + istream.close(); |
---|
| 4468 | + |
---|
| 4469 | + readobj.ResetDisplayList(); |
---|
| 4470 | + } catch (Exception e2) |
---|
| 4471 | + { |
---|
| 4472 | + e2.printStackTrace(); |
---|
| 4473 | + } |
---|
4041 | 4474 | } |
---|
4042 | 4475 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4043 | 4476 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4083 | 4516 | |
---|
4084 | 4517 | void LoadIt(Object obj) |
---|
4085 | 4518 | { |
---|
| 4519 | + if (obj == null) |
---|
| 4520 | + { |
---|
| 4521 | + // Invalid file |
---|
| 4522 | + return; |
---|
| 4523 | + } |
---|
| 4524 | + |
---|
4086 | 4525 | System.out.println("Loaded " + obj); |
---|
4087 | 4526 | //new Exception().printStackTrace(); |
---|
4088 | 4527 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4092 | 4531 | |
---|
4093 | 4532 | if (readobj != null) |
---|
4094 | 4533 | { |
---|
| 4534 | + if (Globals.SAVEONMAKE) |
---|
| 4535 | + Save(); |
---|
4095 | 4536 | try |
---|
4096 | 4537 | { |
---|
4097 | 4538 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4154 | 4595 | |
---|
4155 | 4596 | void load() // throws ClassNotFoundException |
---|
4156 | 4597 | { |
---|
4157 | | - if (GrafreeD.standAlone) |
---|
| 4598 | + if (Grafreed.standAlone) |
---|
4158 | 4599 | { |
---|
4159 | 4600 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4160 | 4601 | browser.show(); |
---|
.. | .. |
---|
4241 | 4682 | try |
---|
4242 | 4683 | { |
---|
4243 | 4684 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4244 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4685 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4686 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4245 | 4687 | |
---|
4246 | 4688 | p.writeObject(copy); |
---|
4247 | 4689 | p.flush(); |
---|
4248 | 4690 | |
---|
| 4691 | + zstream.close(); |
---|
4249 | 4692 | ostream.close(); |
---|
4250 | 4693 | |
---|
4251 | 4694 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4255 | 4698 | { |
---|
4256 | 4699 | } |
---|
4257 | 4700 | } |
---|
| 4701 | + |
---|
4258 | 4702 | String lastname; |
---|
4259 | 4703 | |
---|
4260 | 4704 | void saveAs() |
---|
4261 | 4705 | { |
---|
4262 | | - if (GrafreeD.standAlone) |
---|
| 4706 | + if (Grafreed.standAlone) |
---|
4263 | 4707 | { |
---|
4264 | 4708 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4265 | 4709 | browser.setVisible(true); |
---|
.. | .. |
---|
4364 | 4808 | try |
---|
4365 | 4809 | { |
---|
4366 | 4810 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4367 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4368 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4811 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4812 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4369 | 4813 | |
---|
4370 | 4814 | Object3D objectparent = obj.parent; |
---|
4371 | 4815 | obj.parent = null; |
---|
4372 | 4816 | |
---|
4373 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4817 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4374 | 4818 | |
---|
4375 | 4819 | obj.parent = objectparent; |
---|
4376 | 4820 | |
---|
.. | .. |
---|
4382 | 4826 | p.writeObject(object); |
---|
4383 | 4827 | p.flush(); |
---|
4384 | 4828 | |
---|
| 4829 | + zstream.close(); |
---|
4385 | 4830 | ostream.close(); |
---|
4386 | | - // zstream.close(); |
---|
4387 | 4831 | |
---|
4388 | 4832 | // group.selection.get(0).parent = parent; |
---|
4389 | 4833 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4404 | 4848 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4405 | 4849 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4406 | 4850 | copy.generatePOV(buffer); |
---|
4407 | | - if (GrafreeD.standAlone) |
---|
| 4851 | + if (Grafreed.standAlone) |
---|
4408 | 4852 | { |
---|
4409 | 4853 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4410 | 4854 | browser.show(); |
---|
.. | .. |
---|
4430 | 4874 | Object3D client; |
---|
4431 | 4875 | Object3D copy; |
---|
4432 | 4876 | MenuBar menuBar; |
---|
4433 | | - Menu windowMenu; |
---|
| 4877 | + Menu fileMenu; |
---|
| 4878 | + MenuItem newItem; |
---|
4434 | 4879 | MenuItem loadItem; |
---|
4435 | 4880 | MenuItem saveItem; |
---|
4436 | 4881 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4438 | 4883 | MenuItem reexportItem; |
---|
4439 | 4884 | MenuItem povItem; |
---|
4440 | 4885 | MenuItem closeItem; |
---|
4441 | | - Menu cameraMenu; |
---|
| 4886 | + |
---|
4442 | 4887 | CheckboxMenuItem zBufferItem; |
---|
4443 | 4888 | //MenuItem normalLensItem; |
---|
4444 | | - MenuItem editCameraItem; |
---|
4445 | | - MenuItem revertCameraItem; |
---|
4446 | | - CheckboxMenuItem toggleLiveItem; |
---|
4447 | 4889 | MenuItem stepItem; |
---|
4448 | | - CheckboxMenuItem toggleFullItem; |
---|
| 4890 | + CheckboxMenuItem toggleLiveItem; |
---|
| 4891 | + CheckboxMenuItem toggleFullScreenItem; |
---|
| 4892 | + CheckboxMenuItem toggleTimelineItem; |
---|
4449 | 4893 | CheckboxMenuItem toggleRenderItem; |
---|
4450 | 4894 | CheckboxMenuItem toggleDebugItem; |
---|
4451 | 4895 | CheckboxMenuItem toggleFrustumItem; |
---|
4452 | 4896 | CheckboxMenuItem toggleFootContactItem; |
---|
4453 | 4897 | CheckboxMenuItem toggleDLItem; |
---|
4454 | 4898 | CheckboxMenuItem toggleTextureItem; |
---|
4455 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4899 | + CheckboxMenuItem toggleSwitchItem; |
---|
4456 | 4900 | CheckboxMenuItem toggleRootItem; |
---|
4457 | 4901 | CheckboxMenuItem animationItem; |
---|
4458 | 4902 | CheckboxMenuItem toggleHandleItem; |
---|
.. | .. |
---|
4460 | 4904 | JSplitPane mainPanel; |
---|
4461 | 4905 | JScrollPane scrollpane; |
---|
4462 | 4906 | JPanel toolbarPanel; |
---|
4463 | | - JPanel treePanel; |
---|
| 4907 | + cGridBag treePanel; |
---|
4464 | 4908 | JPanel radioPanel; |
---|
4465 | 4909 | ButtonGroup buttonGroup; |
---|
4466 | | - JPanel ctrlPanel; |
---|
4467 | | - JPanel materialPanel; |
---|
| 4910 | + cGridBag ctrlPanel; |
---|
| 4911 | + cGridBag materialPanel; |
---|
4468 | 4912 | JScrollPane infoPanel; |
---|
4469 | | - JPanel optionsPanel; |
---|
| 4913 | + cGridBag optionsPanel; |
---|
4470 | 4914 | JTabbedPane objectPanel; |
---|
4471 | | - JPanel XYZPanel; |
---|
| 4915 | + cGridBag XYZPanel; |
---|
4472 | 4916 | JSplitPane gridPanel; |
---|
4473 | 4917 | JSplitPane bigPanel; |
---|
4474 | | - JPanel bigThree; |
---|
4475 | | - JTabbedPane scenePanel; |
---|
4476 | | - JPanel cameraPanel; |
---|
| 4918 | + cGridBag bigThree; |
---|
| 4919 | + cGridBag scenePanel; |
---|
| 4920 | + cGridBag centralPanel; |
---|
| 4921 | + JSplitPane cameraPanel; |
---|
| 4922 | + JPanel timelinePanel; |
---|
| 4923 | + JMenuBar timelineMenubar; |
---|
4477 | 4924 | JSplitPane framePanel; |
---|
4478 | 4925 | JTextArea/*Field*/ nameField; |
---|
4479 | | - cButton textureButton; |
---|
| 4926 | + //cButton textureButton; |
---|
4480 | 4927 | cButton okButton; |
---|
4481 | 4928 | cButton applyButton; |
---|
4482 | 4929 | cButton cancelButton; |
---|
.. | .. |
---|
4523 | 4970 | // MATERIAL |
---|
4524 | 4971 | JLabel materialLabel; |
---|
4525 | 4972 | JLabel colorLabel; |
---|
4526 | | - NumberSlider colorField; |
---|
| 4973 | + cNumberSlider colorField; |
---|
4527 | 4974 | JLabel modulationLabel; |
---|
4528 | | - NumberSlider modulationField; |
---|
| 4975 | + cNumberSlider modulationField; |
---|
4529 | 4976 | JLabel metalnessLabel; |
---|
4530 | | - NumberSlider metalnessField; |
---|
| 4977 | + cNumberSlider metalnessField; |
---|
4531 | 4978 | JLabel diffuseLabel; |
---|
4532 | | - NumberSlider diffuseField; |
---|
| 4979 | + cNumberSlider diffuseField; |
---|
4533 | 4980 | JLabel specularLabel; |
---|
4534 | | - NumberSlider specularField; |
---|
| 4981 | + cNumberSlider specularField; |
---|
4535 | 4982 | JLabel shininessLabel; |
---|
4536 | | - NumberSlider shininessField; |
---|
| 4983 | + cNumberSlider shininessField; |
---|
4537 | 4984 | JLabel shiftLabel; |
---|
4538 | | - NumberSlider shiftField; |
---|
| 4985 | + cNumberSlider shiftField; |
---|
4539 | 4986 | JLabel ambientLabel; |
---|
4540 | | - NumberSlider ambientField; |
---|
| 4987 | + cNumberSlider ambientField; |
---|
4541 | 4988 | JLabel lightareaLabel; |
---|
4542 | | - NumberSlider lightareaField; |
---|
| 4989 | + cNumberSlider lightareaField; |
---|
4543 | 4990 | JLabel diffusenessLabel; |
---|
4544 | | - NumberSlider diffusenessField; |
---|
| 4991 | + cNumberSlider diffusenessField; |
---|
4545 | 4992 | JLabel velvetLabel; |
---|
4546 | | - NumberSlider velvetField; |
---|
| 4993 | + cNumberSlider velvetField; |
---|
4547 | 4994 | JLabel sheenLabel; |
---|
4548 | | - NumberSlider sheenField; |
---|
| 4995 | + cNumberSlider sheenField; |
---|
4549 | 4996 | JLabel subsurfaceLabel; |
---|
4550 | | - NumberSlider subsurfaceField; |
---|
| 4997 | + cNumberSlider subsurfaceField; |
---|
4551 | 4998 | //JLabel bumpLabel; |
---|
4552 | 4999 | //NumberSlider bumpField; |
---|
4553 | 5000 | JLabel backlitLabel; |
---|
4554 | | - NumberSlider backlitField; |
---|
| 5001 | + cNumberSlider backlitField; |
---|
4555 | 5002 | JLabel anisoLabel; |
---|
4556 | | - NumberSlider anisoField; |
---|
| 5003 | + cNumberSlider anisoField; |
---|
4557 | 5004 | JLabel anisoVLabel; |
---|
4558 | | - NumberSlider anisoVField; |
---|
| 5005 | + cNumberSlider anisoVField; |
---|
4559 | 5006 | JLabel cameraLabel; |
---|
4560 | | - NumberSlider cameraField; |
---|
| 5007 | + cNumberSlider cameraField; |
---|
4561 | 5008 | JLabel selfshadowLabel; |
---|
4562 | | - NumberSlider selfshadowField; |
---|
| 5009 | + cNumberSlider selfshadowField; |
---|
4563 | 5010 | JLabel shadowLabel; |
---|
4564 | | - NumberSlider shadowField; |
---|
| 5011 | + cNumberSlider shadowField; |
---|
4565 | 5012 | JLabel textureLabel; |
---|
4566 | | - NumberSlider textureField; |
---|
| 5013 | + cNumberSlider textureField; |
---|
4567 | 5014 | JLabel opacityLabel; |
---|
4568 | | - NumberSlider opacityField; |
---|
| 5015 | + cNumberSlider opacityField; |
---|
4569 | 5016 | JLabel fakedepthLabel; |
---|
4570 | | - NumberSlider fakedepthField; |
---|
| 5017 | + cNumberSlider fakedepthField; |
---|
4571 | 5018 | JLabel shadowbiasLabel; |
---|
4572 | | - NumberSlider shadowbiasField; |
---|
| 5019 | + cNumberSlider shadowbiasField; |
---|
4573 | 5020 | JLabel bumpLabel; |
---|
4574 | | - NumberSlider bumpField; |
---|
| 5021 | + cNumberSlider bumpField; |
---|
4575 | 5022 | JLabel noiseLabel; |
---|
4576 | | - NumberSlider noiseField; |
---|
| 5023 | + cNumberSlider noiseField; |
---|
4577 | 5024 | JLabel powerLabel; |
---|
4578 | | - NumberSlider powerField; |
---|
| 5025 | + cNumberSlider powerField; |
---|
4579 | 5026 | JLabel borderfadeLabel; |
---|
4580 | | - NumberSlider borderfadeField; |
---|
| 5027 | + cNumberSlider borderfadeField; |
---|
4581 | 5028 | JLabel fogLabel; |
---|
4582 | | - NumberSlider fogField; |
---|
| 5029 | + cNumberSlider fogField; |
---|
4583 | 5030 | JLabel opacityPowerLabel; |
---|
4584 | | - NumberSlider opacityPowerField; |
---|
| 5031 | + cNumberSlider opacityPowerField; |
---|
4585 | 5032 | JTree jTree; |
---|
4586 | 5033 | //ObjectUI parent; |
---|
| 5034 | + |
---|
| 5035 | + cNumberSlider normalpushField; |
---|
| 5036 | + |
---|
| 5037 | + private MenuItem importGFDItem; |
---|
| 5038 | + private MenuItem importVRMLX3DItem; |
---|
| 5039 | + private MenuItem import3DSItem; |
---|
| 5040 | + private MenuItem importOBJItem; |
---|
4587 | 5041 | } |
---|