.. | .. |
---|
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.*; |
---|
.. | .. |
---|
14 | 15 | //import javax.swing.plaf.ColorUIResource; |
---|
15 | 16 | //import javax.swing.plaf.metal.DefaultMetalTheme; |
---|
16 | 17 | |
---|
| 18 | +import javax.swing.plaf.basic.BasicSplitPaneDivider; |
---|
| 19 | +import javax.swing.plaf.basic.BasicSplitPaneUI; |
---|
| 20 | + |
---|
17 | 21 | //import javax.media.opengl.GLCanvas; |
---|
18 | 22 | |
---|
19 | 23 | import //weka.core. |
---|
20 | 24 | matrix.Matrix; |
---|
| 25 | + |
---|
| 26 | +import grafeme.ui.*; |
---|
21 | 27 | |
---|
22 | 28 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 29 | ActionListener, ChangeListener, |
---|
.. | .. |
---|
28 | 34 | iSendInfo |
---|
29 | 35 | //KeyListener |
---|
30 | 36 | { |
---|
| 37 | + boolean timeline; |
---|
| 38 | + boolean wasFullScreen; |
---|
31 | 39 | |
---|
| 40 | + GroupEditor callee; |
---|
| 41 | + JFrame frame; |
---|
| 42 | + |
---|
| 43 | + static ObjEditor theFrame; |
---|
| 44 | + |
---|
| 45 | + cButton GetButton(String name, boolean border) |
---|
| 46 | + { |
---|
| 47 | + try |
---|
| 48 | + { |
---|
| 49 | + ImageIcon icon = GetIcon(name); |
---|
| 50 | + return new cButton(icon, border); |
---|
| 51 | + } |
---|
| 52 | + catch (Exception e) |
---|
| 53 | + { |
---|
| 54 | + return new cButton(name, border); |
---|
| 55 | + } |
---|
| 56 | + } |
---|
| 57 | + |
---|
| 58 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 59 | + { |
---|
| 60 | + try |
---|
| 61 | + { |
---|
| 62 | + ImageIcon icon = GetIcon(name); |
---|
| 63 | + return new cToggleButton(icon, border); |
---|
| 64 | + } |
---|
| 65 | + catch (Exception e) |
---|
| 66 | + { |
---|
| 67 | + return new cToggleButton(name, border); |
---|
| 68 | + } |
---|
| 69 | + } |
---|
| 70 | + |
---|
| 71 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 72 | + { |
---|
| 73 | + try |
---|
| 74 | + { |
---|
| 75 | + ImageIcon icon = GetIcon(name); |
---|
| 76 | + return new cCheckBox(icon, border); |
---|
| 77 | + } |
---|
| 78 | + catch (Exception e) |
---|
| 79 | + { |
---|
| 80 | + return new cCheckBox(name, border); |
---|
| 81 | + } |
---|
| 82 | + } |
---|
| 83 | + |
---|
| 84 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 85 | + { |
---|
| 86 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 87 | + |
---|
| 88 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 89 | + { |
---|
| 90 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 91 | + Graphics2D g = resized.createGraphics(); |
---|
| 92 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 93 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 94 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 95 | + g.dispose(); |
---|
| 96 | + |
---|
| 97 | + image = resized; |
---|
| 98 | + } |
---|
| 99 | + |
---|
| 100 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 101 | + return icon; |
---|
| 102 | + } |
---|
| 103 | + |
---|
32 | 104 | // SCRIPT |
---|
33 | 105 | |
---|
34 | 106 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
119 | 191 | void keyPressed(int key, int modifiers) |
---|
120 | 192 | { |
---|
121 | 193 | System.out.println("KEY PRESSED"); |
---|
122 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 194 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
123 | 195 | } |
---|
124 | 196 | */ |
---|
125 | 197 | |
---|
126 | 198 | static GridBagConstraints aConstraints; |
---|
127 | 199 | static GridBagConstraints aWindowConstraints; |
---|
128 | | - GroupEditor callee; |
---|
129 | | - JFrame frame; |
---|
| 200 | + |
---|
130 | 201 | static int GRIDWIDTH = 100; // 4; |
---|
131 | 202 | |
---|
132 | 203 | public void closeUI() |
---|
133 | 204 | { |
---|
134 | 205 | //new Exception().printStackTrace(); |
---|
135 | | - System.out.println("this = " + this); |
---|
136 | | - System.out.println("objEditor = " + objEditor); |
---|
| 206 | +// System.out.println("this = " + this); |
---|
| 207 | +// System.out.println("objEditor = " + objEditor); |
---|
137 | 208 | //nameField.removeActionListener(this); |
---|
138 | | - objEditor.ctrlPanel.remove(nameField); |
---|
| 209 | +// objEditor.ctrlPanel.remove(nameField); |
---|
139 | 210 | |
---|
140 | | - if (!GroupEditor.allparams) |
---|
| 211 | + objEditor.ctrlPanel.remove(namePanel); |
---|
| 212 | + |
---|
| 213 | + if (!allparams) |
---|
141 | 214 | return; |
---|
142 | 215 | |
---|
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); |
---|
| 216 | +// objEditor.ctrlPanel.remove(liveCB); |
---|
| 217 | +// objEditor.ctrlPanel.remove(hideCB); |
---|
| 218 | +// objEditor.ctrlPanel.remove(markCB); |
---|
| 219 | +// |
---|
| 220 | +// objEditor.ctrlPanel.remove(randomCB); |
---|
| 221 | +// objEditor.ctrlPanel.remove(speedupCB); |
---|
| 222 | +// objEditor.ctrlPanel.remove(rewindCB); |
---|
| 223 | +// |
---|
| 224 | +// objEditor.ctrlPanel.remove(resetButton); |
---|
| 225 | +// objEditor.ctrlPanel.remove(stepButton); |
---|
| 226 | +//// objEditor.ctrlPanel.remove(stepAllButton); |
---|
| 227 | +//// objEditor.ctrlPanel.remove(resetAllButton); |
---|
| 228 | +// objEditor.ctrlPanel.remove(link2masterCB); |
---|
| 229 | +// //objEditor.ctrlPanel.remove(flipVCB); |
---|
| 230 | +// //objEditor.ctrlPanel.remove(texresMenu); |
---|
| 231 | +// objEditor.ctrlPanel.remove(slowerButton); |
---|
| 232 | +// objEditor.ctrlPanel.remove(fasterButton); |
---|
| 233 | +// objEditor.ctrlPanel.remove(remarkButton); |
---|
| 234 | + |
---|
| 235 | + objEditor.ctrlPanel.remove(setupPanel); |
---|
| 236 | + objEditor.ctrlPanel.remove(setupPanel2); |
---|
| 237 | + objEditor.ctrlPanel.remove(objectCommandsPanel); |
---|
| 238 | + objEditor.ctrlPanel.remove(pushPanel); |
---|
| 239 | + //objEditor.ctrlPanel.remove(fillPanel); |
---|
| 240 | + |
---|
| 241 | + //Remove(normalpushField); |
---|
161 | 242 | } |
---|
162 | 243 | |
---|
163 | 244 | public ObjEditor GetEditor() |
---|
164 | 245 | { |
---|
165 | 246 | return objEditor; //.GetEditor(); |
---|
166 | 247 | } |
---|
| 248 | + |
---|
| 249 | + // Sometimes myself, sometimes my callee's. |
---|
167 | 250 | ObjEditor objEditor; |
---|
168 | 251 | |
---|
169 | 252 | /* |
---|
.. | .. |
---|
226 | 309 | //localCopy.parent = null; |
---|
227 | 310 | |
---|
228 | 311 | frame = new JFrame(); |
---|
| 312 | + frame.setUndecorated(true); |
---|
229 | 313 | objEditor = this; |
---|
230 | 314 | this.callee = callee; |
---|
231 | 315 | |
---|
.. | .. |
---|
238 | 322 | //if (!isDisplayable()) |
---|
239 | 323 | //setUndecorated(true); |
---|
240 | 324 | |
---|
241 | | - System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
| 325 | + //System.out.println("getFullScreenWindow? " + gd.getFullScreenWindow()); |
---|
242 | 326 | client = inClient; |
---|
243 | 327 | copy = localCopy; |
---|
244 | 328 | copy.editWindow = this; |
---|
.. | .. |
---|
256 | 340 | return frame.action(event, obj); |
---|
257 | 341 | } |
---|
258 | 342 | |
---|
| 343 | + // Cannot work without static |
---|
| 344 | + static boolean allparams = true; |
---|
| 345 | + |
---|
| 346 | + static java.util.Vector<Object3D> listUI = new java.util.Vector<Object3D>(); |
---|
| 347 | + |
---|
259 | 348 | void SetupMenu() |
---|
260 | 349 | { |
---|
261 | 350 | 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...")); |
---|
| 351 | + menuBar.add(fileMenu = new Menu("File")); |
---|
| 352 | + fileMenu.add(newItem = new MenuItem("New")); |
---|
| 353 | + fileMenu.add(loadItem = new MenuItem("Open...")); |
---|
| 354 | + |
---|
| 355 | + //oe.menuBar.add(menu = new Menu("Include")); |
---|
| 356 | + Menu menu = new Menu("Import"); |
---|
| 357 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
| 358 | + importOBJItem.addActionListener(this); |
---|
| 359 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
| 360 | + import3DSItem.addActionListener(this); |
---|
| 361 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 362 | + importVRMLX3DItem.addActionListener(this); |
---|
| 363 | + menu.add("-"); |
---|
| 364 | + importGFDItem = menu.add(new MenuItem("Grafreed file...")); |
---|
| 365 | + importGFDItem.addActionListener(this); |
---|
| 366 | + fileMenu.add(menu); |
---|
| 367 | + fileMenu.add("-"); |
---|
| 368 | + |
---|
| 369 | + fileMenu.add(saveItem = new MenuItem("Save")); |
---|
| 370 | + fileMenu.add(saveAsItem = new MenuItem("Save As...")); |
---|
267 | 371 | //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("-"); |
---|
| 372 | + fileMenu.add("-"); |
---|
| 373 | + fileMenu.add(exportAsItem = new MenuItem("Export Selection...")); |
---|
| 374 | + fileMenu.add(reexportItem = new MenuItem("Re-export")); |
---|
| 375 | + fileMenu.add("-"); |
---|
272 | 376 | if (client.parent != null) |
---|
273 | 377 | { |
---|
274 | | - windowMenu.add(closeItem = new MenuItem("Close")); |
---|
| 378 | + fileMenu.add(closeItem = new MenuItem("Close")); |
---|
275 | 379 | } else |
---|
276 | 380 | { |
---|
277 | | - windowMenu.add(closeItem = new MenuItem("Exit")); |
---|
| 381 | + fileMenu.add(closeItem = new MenuItem("Exit")); |
---|
278 | 382 | } |
---|
279 | 383 | |
---|
| 384 | + newItem.addActionListener(this); |
---|
280 | 385 | loadItem.addActionListener(this); |
---|
281 | 386 | saveItem.addActionListener(this); |
---|
282 | 387 | saveAsItem.addActionListener(this); |
---|
.. | .. |
---|
285 | 390 | //povItem.addActionListener(this); |
---|
286 | 391 | closeItem.addActionListener(this); |
---|
287 | 392 | |
---|
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 | 393 | objectPanel = new JTabbedPane(); |
---|
| 394 | + |
---|
| 395 | + ChangeListener changeListener = new ChangeListener() |
---|
| 396 | + { |
---|
| 397 | + public void stateChanged(ChangeEvent changeEvent) |
---|
| 398 | + { |
---|
| 399 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Material") && !materialFlushed) |
---|
| 400 | +// { |
---|
| 401 | +// if (latestObject != null) |
---|
| 402 | +// { |
---|
| 403 | +// refreshContents(true); |
---|
| 404 | +// SetMaterial(latestObject); |
---|
| 405 | +// } |
---|
| 406 | +// |
---|
| 407 | +// materialFlushed = true; |
---|
| 408 | +// } |
---|
| 409 | +// if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Edit")) |
---|
| 410 | +// { |
---|
| 411 | +// if (listUI.size() == 0) |
---|
| 412 | +// EditSelection(false); |
---|
| 413 | +// } |
---|
| 414 | + |
---|
| 415 | + refreshContents(false); // To refresh Info tab |
---|
| 416 | + } |
---|
| 417 | + }; |
---|
| 418 | + objectPanel.addChangeListener(changeListener); |
---|
| 419 | + |
---|
342 | 420 | toolbarPanel = new JPanel(); |
---|
343 | 421 | toolbarPanel.setName("Toolbar"); |
---|
344 | | - treePanel = new JPanel(); |
---|
| 422 | + treePanel = new cGridBag(); |
---|
345 | 423 | treePanel.setName("Tree"); |
---|
346 | | - ctrlPanel = new JPanel(); // new GridBagLayout()); |
---|
347 | | - ctrlPanel.setName("Edit"); |
---|
348 | | - materialPanel = new JPanel(); |
---|
| 424 | + |
---|
| 425 | + editPanel = new cGridBag().setVertical(true); |
---|
| 426 | + editPanel.setName("Edit"); |
---|
| 427 | + |
---|
| 428 | + ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout()); |
---|
| 429 | + |
---|
| 430 | + editCommandsPanel = new cGridBag(); |
---|
| 431 | + editPanel.add(editCommandsPanel); |
---|
| 432 | + editPanel.add(ctrlPanel); |
---|
| 433 | + |
---|
| 434 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 435 | + toolboxPanel.setName("Toolbox"); |
---|
| 436 | + |
---|
| 437 | + materialPanel = new cGridBag().setVertical(true); |
---|
349 | 438 | materialPanel.setName("Material"); |
---|
| 439 | + |
---|
350 | 440 | /*JTextPane*/ |
---|
351 | 441 | infoarea = createTextPane(); |
---|
| 442 | + doc = infoarea.getStyledDocument(); |
---|
| 443 | + |
---|
352 | 444 | infoarea.setEditable(true); |
---|
353 | 445 | SetText(); |
---|
354 | 446 | // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f)); |
---|
355 | 447 | // infoarea.setOpaque(false); |
---|
356 | 448 | // //infoarea.setForeground(textcolor); |
---|
357 | | - infoarea.setLineWrap(true); |
---|
358 | | - infoarea.setWrapStyleWord(true); |
---|
| 449 | +// TEXTAREA infoarea.setLineWrap(true); |
---|
| 450 | +// TEXTAREA infoarea.setWrapStyleWord(true); |
---|
359 | 451 | infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED); |
---|
360 | 452 | infoPanel.setPreferredSize(new Dimension(50, 200)); |
---|
361 | 453 | infoPanel.setName("Info"); |
---|
.. | .. |
---|
366 | 458 | mainPanel.setName("Main"); |
---|
367 | 459 | mainPanel.setContinuousLayout(true); |
---|
368 | 460 | mainPanel.setOneTouchExpandable(true); |
---|
369 | | - mainPanel.setDividerLocation(1.0); |
---|
370 | 461 | mainPanel.setDividerSize(9); |
---|
371 | | - mainPanel.setResizeWeight(0); |
---|
372 | | - |
---|
| 462 | + mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 463 | + mainPanel.setResizeWeight(0.5); |
---|
| 464 | + |
---|
| 465 | +//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5)); |
---|
| 466 | + BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider(); |
---|
| 467 | + divider.setDividerSize(15); |
---|
| 468 | + divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!")); |
---|
| 469 | + |
---|
| 470 | + mainPanel.setUI(new BasicSplitPaneUI()); |
---|
| 471 | + |
---|
373 | 472 | //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5)); |
---|
374 | 473 | //mainPanel.setLayout(new GridBagLayout()); |
---|
375 | 474 | toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
376 | | - treePanel.setLayout(new GridBagLayout()); |
---|
377 | | - ctrlPanel.setLayout(new GridBagLayout()); |
---|
378 | | - materialPanel.setLayout(new GridBagLayout()); |
---|
| 475 | +// treePanel.setLayout(new GridBagLayout()); |
---|
| 476 | + //ctrlPanel.setLayout(new GridBagLayout()); |
---|
| 477 | + //materialPanel.setLayout(new GridBagLayout()); |
---|
379 | 478 | |
---|
380 | 479 | aConstraints = new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, |
---|
381 | 480 | GridBagConstraints.NORTHEAST, GridBagConstraints.BOTH, new Insets(1, 1, 1, 1), 0, 0); |
---|
.. | .. |
---|
414 | 513 | static String newline = "\n"; |
---|
415 | 514 | protected static final String buttonString = "JButton"; |
---|
416 | 515 | StyledDocument doc; |
---|
417 | | - JTextArea infoarea; |
---|
| 516 | + JTextPane infoarea; |
---|
418 | 517 | |
---|
419 | 518 | void ClearInfo() |
---|
420 | 519 | { |
---|
.. | .. |
---|
437 | 536 | e.printStackTrace(); |
---|
438 | 537 | } |
---|
439 | 538 | |
---|
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(); |
---|
| 539 | +// String selection = infoarea.getText(); |
---|
| 540 | +// java.awt.datatransfer.StringSelection data = new java.awt.datatransfer.StringSelection(selection); |
---|
| 541 | +// java.awt.datatransfer.Clipboard clipboard = |
---|
| 542 | +// Toolkit.getDefaultToolkit().getSystemClipboard(); |
---|
444 | 543 | //clipboard.setContents(data, data); |
---|
445 | 544 | } |
---|
446 | 545 | |
---|
.. | .. |
---|
463 | 562 | //SendInfo("Name:", "bold"); |
---|
464 | 563 | if (sel.GetTextures() != null || debug) |
---|
465 | 564 | { |
---|
466 | | - si.SendInfo(sel.toString(), "bold"); |
---|
| 565 | + si.SendInfo(sel.toString() + (Globals.ADVANCED?"":" " + System.identityHashCode(sel)), "bold"); |
---|
467 | 566 | //SendInfo("#children virtual = " + sel.size() + "; real = " + sel.Size() + newline, "regular"); |
---|
468 | 567 | if (sel.Size() > 0) |
---|
469 | 568 | { |
---|
470 | 569 | si.SendInfo("#children = " + sel.Size(), "regular"); |
---|
471 | 570 | } |
---|
472 | | - si.SendInfo((debug ? " Parent: " : " ") + sel.parent, "regular"); |
---|
| 571 | + si.SendInfo((debug ? " Parent: " : " ") + sel.parent + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.parent)), "regular"); |
---|
473 | 572 | if (debug) |
---|
474 | 573 | { |
---|
475 | 574 | try |
---|
.. | .. |
---|
481 | 580 | } |
---|
482 | 581 | |
---|
483 | 582 | if (full) |
---|
484 | | - si.SendInfo(" BBox: " + minima + " - " + maxima, "regular"); |
---|
| 583 | + { |
---|
| 584 | + si.SendInfo(" BBox min: " + minima, "regular"); |
---|
| 585 | + si.SendInfo(" BBox max: " + maxima, "regular"); |
---|
| 586 | + } |
---|
485 | 587 | |
---|
486 | 588 | if (sel.bRep != null) |
---|
487 | 589 | { |
---|
.. | .. |
---|
508 | 610 | } |
---|
509 | 611 | if (sel.support != null) |
---|
510 | 612 | { |
---|
511 | | - si.SendInfo(" support: " + sel.support, "regular"); |
---|
| 613 | + si.SendInfo(" support: " + sel.support + (Globals.ADVANCED?"":" " + System.identityHashCode(sel.support)), "regular"); |
---|
512 | 614 | } |
---|
513 | 615 | if (sel.scriptnode != null) |
---|
514 | 616 | { |
---|
.. | .. |
---|
579 | 681 | { |
---|
580 | 682 | CameraPane.pointflow = (PointFlow) sel; |
---|
581 | 683 | } |
---|
| 684 | + |
---|
| 685 | + si.SendInfo("_____________________", "regular"); |
---|
| 686 | + si.SendInfo("", "regular"); |
---|
582 | 687 | } |
---|
583 | 688 | } |
---|
584 | 689 | |
---|
.. | .. |
---|
594 | 699 | } |
---|
595 | 700 | } |
---|
596 | 701 | |
---|
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 | | - }; |
---|
| 702 | +static GraphicsDevice device = GraphicsEnvironment |
---|
| 703 | + .getLocalGraphicsEnvironment().getScreenDevices()[0]; |
---|
614 | 704 | |
---|
615 | | - String[] initStyles = |
---|
616 | | - { |
---|
617 | | - "regular", "italic", "bold", "small", "large", |
---|
618 | | - "regular", "button", "regular", "icon", |
---|
619 | | - "regular" |
---|
620 | | - }; |
---|
| 705 | + Rectangle keeprect; |
---|
| 706 | + cRadio radio; |
---|
| 707 | + |
---|
| 708 | +cButton keepButton; |
---|
| 709 | + cButton twoButton; // Full 3D |
---|
| 710 | + cButton sixButton; |
---|
| 711 | + cButton threeButton; |
---|
| 712 | + cButton sevenButton; |
---|
| 713 | + cButton fourButton; // full panel |
---|
| 714 | + cButton oneButton; // full XYZ |
---|
| 715 | + //cButton currentLayout; |
---|
| 716 | + |
---|
| 717 | + boolean maximized; |
---|
| 718 | + |
---|
| 719 | + cButton fullscreenLayout; |
---|
621 | 720 | |
---|
622 | | - JTextPane textPane = new JTextPane(); |
---|
623 | | - textPane.setEditable(true); |
---|
624 | | - /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
625 | | - addStylesToDocument(doc); |
---|
626 | | - |
---|
627 | | - try |
---|
| 721 | + void Minimize() |
---|
628 | 722 | { |
---|
629 | | - for (int j = 0; j < 2; j++) |
---|
| 723 | + frame.setState(Frame.ICONIFIED); |
---|
| 724 | + } |
---|
| 725 | + |
---|
| 726 | + void Maximize() |
---|
| 727 | + { |
---|
| 728 | + if (maximized) |
---|
630 | 729 | { |
---|
631 | | - for (int i = 0; i < initString.length; i++) |
---|
632 | | - { |
---|
633 | | - doc.insertString(doc.getLength(), initString[i], |
---|
634 | | - doc.getStyle(initStyles[i])); |
---|
635 | | - } |
---|
| 730 | + frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
636 | 731 | } |
---|
637 | | - } catch (BadLocationException ble) |
---|
| 732 | + else |
---|
| 733 | + { |
---|
| 734 | + keeprect = frame.getBounds(); |
---|
| 735 | + Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); |
---|
| 736 | + Dimension rect2 = frame.getToolkit().getScreenSize(); |
---|
| 737 | + frame.setBounds(0, rect2.height - rect.height, rect.width, rect.height); |
---|
| 738 | +// frame.setState(Frame.MAXIMIZED_BOTH); |
---|
| 739 | + } |
---|
| 740 | + |
---|
| 741 | + maximized ^= true; |
---|
| 742 | + } |
---|
| 743 | + |
---|
| 744 | + void ToggleFullScreen() |
---|
638 | 745 | { |
---|
639 | | - System.err.println("Couldn't insert initial text into text pane."); |
---|
| 746 | + cameraView.ToggleFullScreen(); |
---|
| 747 | + |
---|
| 748 | + if (!CameraPane.FULLSCREEN) |
---|
| 749 | + { |
---|
| 750 | + device.setFullScreenWindow(null); |
---|
| 751 | + //frame.setVisible(false); |
---|
| 752 | +// frame.removeNotify(); |
---|
| 753 | +// frame.setUndecorated(false); |
---|
| 754 | +// frame.addNotify(); |
---|
| 755 | + //frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height); |
---|
| 756 | + |
---|
| 757 | +// X frame.getContentPane().remove(/*"Center",*/bigThree); |
---|
| 758 | +// X framePanel.add(bigThree); |
---|
| 759 | +// X frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 760 | + framePanel.setDividerLocation(1); |
---|
| 761 | + |
---|
| 762 | + //frame.setVisible(true); |
---|
| 763 | + radio.layout = keepButton; |
---|
| 764 | + //theFrame = null; |
---|
| 765 | + keepButton = null; |
---|
| 766 | + radio.layout.doClick(); |
---|
| 767 | + |
---|
| 768 | + } else |
---|
| 769 | + { |
---|
| 770 | + keepButton = radio.layout; |
---|
| 771 | + //keeprect = frame.getBounds(); |
---|
| 772 | +// frame.setBounds(0, 0, frame.getToolkit().getScreenSize().width, |
---|
| 773 | +// frame.getToolkit().getScreenSize().height); |
---|
| 774 | + //frame.setVisible(false); |
---|
| 775 | + device.setFullScreenWindow(frame); |
---|
| 776 | +// frame.removeNotify(); |
---|
| 777 | +// frame.setUndecorated(true); |
---|
| 778 | +// frame.addNotify(); |
---|
| 779 | +// X frame.getContentPane().remove(/*"Center",*/framePanel); |
---|
| 780 | +// X framePanel.remove(bigThree); |
---|
| 781 | +// X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
| 782 | + framePanel.setDividerLocation(0); |
---|
| 783 | + |
---|
| 784 | + radio.layout = fullscreenLayout; |
---|
| 785 | + radio.layout.doClick(); |
---|
| 786 | + //frame.setVisible(true); |
---|
| 787 | + } |
---|
640 | 788 | } |
---|
641 | 789 | |
---|
642 | | - return new JTextArea(); // textPane; |
---|
| 790 | + private JTextPane createTextPane() |
---|
| 791 | + { |
---|
| 792 | +// TEXTAREA String[] initString = |
---|
| 793 | +// { |
---|
| 794 | +// "This is an editable JTextPane, ", //regular |
---|
| 795 | +// "another ", //italic |
---|
| 796 | +// "styled ", //bold |
---|
| 797 | +// "text ", //small |
---|
| 798 | +// "component, ", //large |
---|
| 799 | +// "which supports embedded components..." + newline,//regular |
---|
| 800 | +// " " + newline, //button |
---|
| 801 | +// "...and embedded icons..." + newline, //regular |
---|
| 802 | +// " ", //icon |
---|
| 803 | +// newline + "JTextPane is a subclass of JEditorPane that " |
---|
| 804 | +// + "uses a StyledEditorKit and StyledDocument, and provides " |
---|
| 805 | +// + "cover methods for interacting with those objects." |
---|
| 806 | +// }; |
---|
| 807 | +// |
---|
| 808 | +// String[] initStyles = |
---|
| 809 | +// { |
---|
| 810 | +// "regular", "italic", "bold", "small", "large", |
---|
| 811 | +// "regular", "button", "regular", "icon", |
---|
| 812 | +// "regular" |
---|
| 813 | +// }; |
---|
| 814 | +// |
---|
| 815 | +// JTextPane textPane = new JTextPane(); |
---|
| 816 | +// textPane.setEditable(true); |
---|
| 817 | +// /*StyledDocument*/ doc = textPane.getStyledDocument(); |
---|
| 818 | +// addStylesToDocument(doc); |
---|
| 819 | +// |
---|
| 820 | +// try |
---|
| 821 | +// { |
---|
| 822 | +// for (int j = 0; j < 2; j++) |
---|
| 823 | +// { |
---|
| 824 | +// for (int i = 0; i < initString.length; i++) |
---|
| 825 | +// { |
---|
| 826 | +// doc.insertString(doc.getLength(), initString[i], |
---|
| 827 | +// doc.getStyle(initStyles[i])); |
---|
| 828 | +// } |
---|
| 829 | +// } |
---|
| 830 | +// } catch (BadLocationException ble) |
---|
| 831 | +// { |
---|
| 832 | +// System.err.println("Couldn't insert initial text into text pane."); |
---|
| 833 | +// } |
---|
| 834 | + |
---|
| 835 | + return new JTextPane(); // textPane; |
---|
643 | 836 | } |
---|
644 | 837 | |
---|
645 | 838 | protected void addStylesToDocument(StyledDocument doc) |
---|
.. | .. |
---|
692 | 885 | protected static ImageIcon createImageIcon(String path, |
---|
693 | 886 | String description) |
---|
694 | 887 | { |
---|
695 | | - java.net.URL imgURL = GrafreeD.class.getResource(path); |
---|
| 888 | + java.net.URL imgURL = Grafreed.class.getResource(path); |
---|
696 | 889 | if (imgURL != null) |
---|
697 | 890 | { |
---|
698 | 891 | return new ImageIcon(imgURL, description); |
---|
.. | .. |
---|
724 | 917 | // NumberSlider vDivsField; |
---|
725 | 918 | // JCheckBox endcaps; |
---|
726 | 919 | JCheckBox liveCB; |
---|
| 920 | + JCheckBox selectCB; |
---|
727 | 921 | JCheckBox hideCB; |
---|
728 | 922 | JCheckBox link2masterCB; |
---|
729 | 923 | JCheckBox markCB; |
---|
.. | .. |
---|
731 | 925 | JCheckBox speedupCB; |
---|
732 | 926 | JCheckBox rewindCB; |
---|
733 | 927 | JCheckBox flipVCB; |
---|
| 928 | + |
---|
| 929 | + cCheckBox toggleTextureCB; |
---|
| 930 | + cCheckBox toggleSwitchCB; |
---|
| 931 | + |
---|
734 | 932 | JComboBox texresMenu; |
---|
| 933 | + |
---|
735 | 934 | JButton resetButton; |
---|
736 | 935 | JButton stepButton; |
---|
737 | 936 | JButton stepAllButton; |
---|
.. | .. |
---|
739 | 938 | JButton slowerButton; |
---|
740 | 939 | JButton fasterButton; |
---|
741 | 940 | JButton remarkButton; |
---|
| 941 | + |
---|
| 942 | + cGridBag editPanel; |
---|
| 943 | + cGridBag editCommandsPanel; |
---|
| 944 | + |
---|
| 945 | + cGridBag namePanel; |
---|
| 946 | + cGridBag setupPanel; |
---|
| 947 | + cGridBag setupPanel2; |
---|
| 948 | + cGridBag objectCommandsPanel; |
---|
| 949 | + cGridBag pushPanel; |
---|
| 950 | + cGridBag fillPanel; |
---|
742 | 951 | |
---|
743 | | - JCheckBox AddCheckBox(ObjEditor oe, String label, boolean on) |
---|
| 952 | + JCheckBox AddCheckBox(cGridBag panel, String label, boolean on) |
---|
744 | 953 | { |
---|
745 | 954 | JCheckBox cb; |
---|
746 | 955 | |
---|
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); |
---|
| 956 | + panel.add(cb = new JCheckBox(label, on)); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
752 | 957 | cb.addItemListener(this); |
---|
753 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
754 | | - oe.aConstraints.gridwidth = 1; |
---|
755 | | - oe.aConstraints.gridx += 1; |
---|
756 | 958 | |
---|
757 | 959 | return cb; |
---|
758 | 960 | } |
---|
759 | 961 | |
---|
760 | | - cButton AddButton(ObjEditor oe, String label) |
---|
| 962 | + cButton AddButton(cGridBag panel, String label) |
---|
761 | 963 | { |
---|
762 | 964 | cButton cb; |
---|
763 | 965 | |
---|
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); |
---|
| 966 | + panel.add(cb = new cButton(label)); //, oe.aConstraints, oe.ctrlPanel.getComponentCount() - 1); |
---|
769 | 967 | cb.addActionListener(this); |
---|
770 | | -// oe.aConstraints.anchor = GridBagConstraints.EAST; |
---|
771 | | - oe.aConstraints.gridwidth = 1; |
---|
772 | | - oe.aConstraints.gridx += 1; |
---|
773 | 968 | |
---|
774 | 969 | return cb; |
---|
775 | 970 | } |
---|
776 | 971 | |
---|
777 | | - JComboBox AddCombo(ObjEditor oe, java.util.Vector list, int item) |
---|
| 972 | + JComboBox AddCombo(cGridBag panel, java.util.Vector list, int item) |
---|
778 | 973 | { |
---|
779 | 974 | JComboBox combo; |
---|
780 | 975 | |
---|
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; |
---|
| 976 | + panel.add(combo = new JComboBox(new cListModel(list, item))); //, oe.aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
784 | 977 | combo.addActionListener(this); |
---|
785 | 978 | |
---|
786 | 979 | return combo; |
---|
787 | 980 | } |
---|
788 | 981 | |
---|
789 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, double min, double max, double current, double pow) |
---|
| 982 | + cGridBag AddSlider(cGridBag panel, String label, double min, double max, double current, double pow) |
---|
790 | 983 | { |
---|
791 | | - NumberSlider combo; |
---|
| 984 | + cGridBag control = new cGridBag(); |
---|
| 985 | + |
---|
| 986 | + cNumberSlider combo; |
---|
792 | 987 | |
---|
793 | 988 | JLabel jlabel = new JLabel(label); |
---|
794 | | - |
---|
795 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
796 | 989 | 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 | | - |
---|
| 990 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 991 | + control.add(combo = new cNumberSlider(this, min, max, pow)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
806 | 992 | combo.setFloat(current); |
---|
807 | | - |
---|
808 | | - combo.label = jlabel; |
---|
809 | | - |
---|
810 | | - combo.addChangeListener(this); |
---|
811 | | - |
---|
812 | | - return combo; |
---|
| 993 | + |
---|
| 994 | + panel.add(control); |
---|
| 995 | + |
---|
| 996 | + return control; |
---|
813 | 997 | } |
---|
814 | 998 | |
---|
815 | | - NumberSlider AddSlider(JPanel ctrlPanel, String label, int min, int max, int current) |
---|
| 999 | + cGridBag AddSlider(cGridBag panel, String label, int min, int max, int current) |
---|
816 | 1000 | { |
---|
817 | | - NumberSlider combo; |
---|
| 1001 | + cGridBag control = new cGridBag(); |
---|
| 1002 | + |
---|
| 1003 | + cNumberSlider combo; |
---|
818 | 1004 | |
---|
819 | 1005 | JLabel jlabel = new JLabel(label); |
---|
820 | | - |
---|
821 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
822 | 1006 | 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 | | - |
---|
| 1007 | + control.add(jlabel); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1008 | + control.add(combo = new cNumberSlider(this, min, max)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
832 | 1009 | combo.setInteger(current); |
---|
833 | 1010 | |
---|
834 | | - combo.label = jlabel; |
---|
835 | | - |
---|
836 | | - combo.addChangeListener(this); |
---|
837 | | - |
---|
838 | | - return combo; |
---|
| 1011 | + panel.add(control); |
---|
| 1012 | + |
---|
| 1013 | + return control; |
---|
839 | 1014 | } |
---|
840 | 1015 | |
---|
841 | | - JTextArea AddText(JPanel ctrlPanel, String name) |
---|
| 1016 | + JTextArea AddText(cGridBag ctrlPanel, String name) |
---|
842 | 1017 | { |
---|
843 | 1018 | JTextArea text; |
---|
844 | 1019 | |
---|
845 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
846 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; |
---|
847 | | - ctrlPanel.add(text = new JTextArea(name), aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
| 1020 | + ctrlPanel.add(text = new JTextArea(name)); //, aConstraints); //, oe.ctrlPanel.getComponentCount()-1); |
---|
848 | 1021 | text.addCaretListener(this); |
---|
849 | | - aConstraints.gridx += 1; |
---|
850 | | - aConstraints.gridwidth = 1; |
---|
851 | 1022 | |
---|
852 | 1023 | return text; |
---|
853 | 1024 | } |
---|
.. | .. |
---|
877 | 1048 | objEditor.ctrlPanel.remove(j); |
---|
878 | 1049 | } |
---|
879 | 1050 | |
---|
| 1051 | + void Remove(cNumberSlider j) |
---|
| 1052 | + { |
---|
| 1053 | + j.removeChangeListener(this); |
---|
| 1054 | + //objEditor.ctrlPanel.remove(j.label); |
---|
| 1055 | + objEditor.ctrlPanel.remove(j); |
---|
| 1056 | + } |
---|
| 1057 | + |
---|
880 | 1058 | /* |
---|
881 | 1059 | */ |
---|
882 | | - void Return() // ObjEditor oe) |
---|
| 1060 | + void Return0() // ObjEditor oe) |
---|
883 | 1061 | { |
---|
884 | 1062 | aConstraints.gridy += 1; |
---|
885 | 1063 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
934 | 1112 | |
---|
935 | 1113 | void SetupUI2(ObjEditor oe) |
---|
936 | 1114 | { |
---|
937 | | -// oe.aConstraints.weightx = 0; |
---|
938 | | -// oe.aConstraints.weighty = 0; |
---|
939 | | -// oe.aConstraints.gridx = 0; |
---|
940 | | -// oe.aConstraints.gridy = 0; |
---|
941 | | - SetupName(oe); |
---|
| 1115 | + //SetupName(oe); |
---|
942 | 1116 | |
---|
943 | | - if (!GroupEditor.allparams) |
---|
| 1117 | + namePanel = new cGridBag(); |
---|
| 1118 | + |
---|
| 1119 | + nameField = AddText(namePanel, copy.GetName()); |
---|
| 1120 | + namePanel.add(nameField); |
---|
| 1121 | + oe.ctrlPanel.add(namePanel); |
---|
| 1122 | + |
---|
| 1123 | + oe.ctrlPanel.Return(); |
---|
| 1124 | + |
---|
| 1125 | + if (!allparams) |
---|
944 | 1126 | return; |
---|
945 | 1127 | |
---|
946 | | - liveCB = AddCheckBox(oe, "Live", copy.live); |
---|
947 | | - link2masterCB = AddCheckBox(oe, "Supp", copy.link2master); |
---|
948 | | - hideCB = AddCheckBox(oe, "Hide", copy.hide); |
---|
| 1128 | + setupPanel = new cGridBag().setVertical(false); |
---|
| 1129 | + |
---|
| 1130 | + liveCB = AddCheckBox(setupPanel, "Live", copy.live); |
---|
| 1131 | + liveCB.setToolTipText("Animate object"); |
---|
| 1132 | + selectCB = AddCheckBox(setupPanel, "Select", !copy.dontselect); |
---|
| 1133 | + selectCB.setToolTipText("Make object selectable"); |
---|
949 | 1134 | // 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"); |
---|
| 1135 | + hideCB = AddCheckBox(setupPanel, "Hide", copy.hide); |
---|
| 1136 | + hideCB.setToolTipText("Hide object"); |
---|
| 1137 | + markCB = AddCheckBox(setupPanel, "Mark", copy.marked); |
---|
| 1138 | + markCB.setToolTipText("As animation target transform"); |
---|
| 1139 | + |
---|
| 1140 | + setupPanel2 = new cGridBag().setVertical(false); |
---|
| 1141 | + |
---|
| 1142 | + rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind); |
---|
| 1143 | + rewindCB.setToolTipText("Rewind animation"); |
---|
| 1144 | + |
---|
| 1145 | + randomCB = AddCheckBox(setupPanel2, "Rand", copy.random); |
---|
| 1146 | + randomCB.setToolTipText("Randomly Rewind (or Go back and forth)"); |
---|
| 1147 | + |
---|
| 1148 | + if (Globals.ADVANCED) |
---|
| 1149 | + { |
---|
| 1150 | + link2masterCB = AddCheckBox(setupPanel2, "Supp", copy.link2master); |
---|
| 1151 | + link2masterCB.setToolTipText("Attach to support"); |
---|
| 1152 | + speedupCB = AddCheckBox(setupPanel2, "Speed", copy.speedup); |
---|
| 1153 | + speedupCB.setToolTipText("Option motion capture"); |
---|
| 1154 | + } |
---|
| 1155 | + |
---|
| 1156 | + oe.ctrlPanel.add(setupPanel); |
---|
| 1157 | + oe.ctrlPanel.Return(); |
---|
| 1158 | + oe.ctrlPanel.add(setupPanel2); |
---|
| 1159 | + oe.ctrlPanel.Return(); |
---|
| 1160 | + |
---|
| 1161 | + objectCommandsPanel = new cGridBag().setVertical(false); |
---|
| 1162 | + |
---|
| 1163 | + resetButton = AddButton(objectCommandsPanel, "Reset"); |
---|
| 1164 | + resetButton.setToolTipText("Jump to frame zero"); |
---|
| 1165 | + stepButton = AddButton(objectCommandsPanel, "Step"); |
---|
| 1166 | + stepButton.setToolTipText("Step one frame"); |
---|
956 | 1167 | // resetAllButton = AddButton(oe, "Reset All"); |
---|
957 | 1168 | // stepAllButton = AddButton(oe, "Step All"); |
---|
958 | | - speedupCB = AddCheckBox(oe, "Speed", copy.speedup); |
---|
959 | 1169 | // Return(); |
---|
960 | | - slowerButton = AddButton(oe, "Slow"); |
---|
961 | | - fasterButton = AddButton(oe, "Fast"); |
---|
962 | | - remarkButton = AddButton(oe, "Rem"); |
---|
| 1170 | + slowerButton = AddButton(objectCommandsPanel, "Slow"); |
---|
| 1171 | + slowerButton.setToolTipText("Decrease animation speed"); |
---|
| 1172 | + fasterButton = AddButton(objectCommandsPanel, "Fast"); |
---|
| 1173 | + fasterButton.setToolTipText("Increase animation speed"); |
---|
| 1174 | + remarkButton = AddButton(objectCommandsPanel, "Remark"); |
---|
| 1175 | + remarkButton.setToolTipText("Set the current transform as the target"); |
---|
963 | 1176 | |
---|
964 | | - Return(); |
---|
| 1177 | + oe.ctrlPanel.add(objectCommandsPanel); |
---|
| 1178 | + oe.ctrlPanel.Return(); |
---|
965 | 1179 | |
---|
| 1180 | + pushPanel = AddSlider(oe.ctrlPanel, "Push", -1, 1, copy.NORMALPUSH, 1.1); // To have the buttons |
---|
| 1181 | + normalpushField = (cNumberSlider)pushPanel.getComponent(1); |
---|
| 1182 | + //Return(); |
---|
| 1183 | + |
---|
| 1184 | + oe.ctrlPanel.Return(); |
---|
| 1185 | + |
---|
966 | 1186 | // oe.ctrlPanel.add(stepButton = new cButton("Step"), ObjEditor.aConstraints, oe.ctrlPanel.getComponentCount() - 2); |
---|
967 | 1187 | // ObjEditor.aConstraints.gridx += 1; |
---|
968 | 1188 | |
---|
.. | .. |
---|
1056 | 1276 | oe.aConstraints.gridwidth = 1; |
---|
1057 | 1277 | /**/ |
---|
1058 | 1278 | nameField = AddText(oe.ctrlPanel, copy.GetName()); |
---|
1059 | | - Return(); |
---|
| 1279 | + oe.ctrlPanel.Return(); |
---|
1060 | 1280 | |
---|
1061 | 1281 | //ctrlPanel.add(textureButton = new Button("Texture...")); |
---|
1062 | 1282 | //textureButton.setEnabled(false); |
---|
.. | .. |
---|
1158 | 1378 | //JPanel worldPanel = |
---|
1159 | 1379 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1160 | 1380 | //worldPanel.setName("World"); |
---|
1161 | | - /*JPanel*/ cameraPanel = |
---|
1162 | | - new JPanel(new BorderLayout()); |
---|
1163 | | - cameraPanel.add(cameraView); |
---|
1164 | | - //new timeflow.app.TimeflowApp().TimeFlowWindow(cameraPanel, frame); |
---|
| 1381 | + centralPanel = new cGridBag(); |
---|
| 1382 | + centralPanel.preferredWidth = 20; |
---|
| 1383 | + |
---|
| 1384 | + if (Globals.ADVANCED) |
---|
| 1385 | + { |
---|
| 1386 | + timelinePanel = new JPanel(new BorderLayout()); |
---|
| 1387 | + timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1165 | 1388 | |
---|
| 1389 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1390 | + cameraPanel.setContinuousLayout(true); |
---|
| 1391 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1392 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1393 | +// cameraPanel.setDividerSize(9); |
---|
| 1394 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1395 | + |
---|
| 1396 | + } |
---|
| 1397 | + |
---|
| 1398 | + centralPanel.add(cameraView); |
---|
| 1399 | + centralPanel.setFocusable(true); |
---|
| 1400 | + //frame.setJMenuBar(timelineMenubar); |
---|
| 1401 | + //centralPanel.add(timelinePanel); |
---|
| 1402 | + |
---|
1166 | 1403 | //topView.camera = ; |
---|
1167 | 1404 | //frontView.camera = new Camera(2); |
---|
1168 | 1405 | //sideView.camera = new Camera(3); |
---|
.. | .. |
---|
1178 | 1415 | //frontView.object = copy; |
---|
1179 | 1416 | //sideView.object = copy; |
---|
1180 | 1417 | |
---|
1181 | | - XYZPanel = new JPanel(); |
---|
1182 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1418 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1419 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1183 | 1420 | |
---|
1184 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1185 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1186 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1421 | + XYZPanel.preferredWidth = 5; |
---|
| 1422 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1423 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1424 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1187 | 1425 | |
---|
1188 | 1426 | /* |
---|
1189 | 1427 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1192 | 1430 | gridPanel.add(cameraView); |
---|
1193 | 1431 | gridPanel.add(XYZPanel); |
---|
1194 | 1432 | */ |
---|
1195 | | - gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, cameraPanel, XYZPanel); //new BorderLayout()); |
---|
| 1433 | + gridPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, centralPanel, XYZPanel); //new BorderLayout()); |
---|
1196 | 1434 | gridPanel.setContinuousLayout(true); |
---|
1197 | 1435 | gridPanel.setOneTouchExpandable(true); |
---|
1198 | 1436 | gridPanel.setDividerLocation(1.0); |
---|
.. | .. |
---|
1221 | 1459 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1222 | 1460 | //tmp.setName("Edit"); |
---|
1223 | 1461 | objectPanel.add(materialPanel); |
---|
1224 | | - JPanel north = new JPanel(new BorderLayout()); |
---|
1225 | | - north.setName("Edit"); |
---|
1226 | | - north.add(ctrlPanel, BorderLayout.NORTH); |
---|
1227 | | - objectPanel.add(north); |
---|
| 1462 | +// JPanel north = new JPanel(new BorderLayout()); |
---|
| 1463 | +// north.setName("Edit"); |
---|
| 1464 | +// north.add(ctrlPanel, BorderLayout.NORTH); |
---|
| 1465 | +// objectPanel.add(north); |
---|
| 1466 | + objectPanel.add(editPanel); |
---|
1228 | 1467 | objectPanel.add(infoPanel); |
---|
| 1468 | + objectPanel.add(toolboxPanel); |
---|
1229 | 1469 | |
---|
1230 | 1470 | /* |
---|
1231 | 1471 | aConstraints.gridx = 0; |
---|
.. | .. |
---|
1234 | 1474 | aConstraints.gridy += 1; |
---|
1235 | 1475 | aConstraints.gridwidth = 1; |
---|
1236 | 1476 | mainPanel.add(objectPanel, aConstraints); |
---|
1237 | | - */ |
---|
| 1477 | + */ |
---|
1238 | 1478 | |
---|
1239 | 1479 | scrollpane = new JScrollPane(mainPanel, ScrollPaneConstants.// VERTICAL_SCROLLBAR_ALWAYS, |
---|
1240 | 1480 | VERTICAL_SCROLLBAR_AS_NEEDED, |
---|
.. | .. |
---|
1245 | 1485 | scrollpane.setWheelScrollingEnabled(true); |
---|
1246 | 1486 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1247 | 1487 | |
---|
1248 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1249 | | - scenePanel.add(scrollpane); |
---|
| 1488 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1489 | + scenePanel.preferredWidth = 6; |
---|
| 1490 | + |
---|
| 1491 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1492 | + tabbedPane.add(scrollpane); |
---|
1250 | 1493 | |
---|
1251 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
1252 | | - |
---|
1253 | | - optionsPanel = new JPanel(new GridBagLayout()); |
---|
| 1494 | + optionsPanel = new cGridBag().setVertical(false); |
---|
1254 | 1495 | |
---|
1255 | 1496 | optionsPanel.setName("Options"); |
---|
1256 | | - scenePanel.add(optionsPanel); |
---|
| 1497 | + |
---|
| 1498 | + AddOptions(optionsPanel); //, aConstraints); |
---|
| 1499 | + |
---|
| 1500 | + tabbedPane.add(optionsPanel); |
---|
| 1501 | + |
---|
| 1502 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1257 | 1503 | |
---|
| 1504 | + scenePanel.add(tabbedPane); |
---|
1258 | 1505 | |
---|
1259 | 1506 | /* |
---|
1260 | 1507 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1288 | 1535 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1289 | 1536 | //bigPanel.add(ctrlPanel); |
---|
1290 | 1537 | //bigPanel.add(gridPanel); |
---|
| 1538 | + /** |
---|
1291 | 1539 | bigThree = new JPanel(); |
---|
1292 | 1540 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1293 | 1541 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1304 | 1552 | // aConstraints.gridheight = 3; |
---|
1305 | 1553 | aWindowConstraints.gridx = 1; |
---|
1306 | 1554 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
1307 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 1555 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
1308 | 1556 | aWindowConstraints.weightx = 0; |
---|
1309 | 1557 | aWindowConstraints.gridx = 4; |
---|
1310 | 1558 | aWindowConstraints.gridwidth = 1; |
---|
1311 | 1559 | // aConstraints.gridheight = 3; |
---|
1312 | 1560 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1313 | 1561 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1562 | + /**/ |
---|
1314 | 1563 | |
---|
| 1564 | + bigThree = new cGridBag(); |
---|
| 1565 | + bigThree.addComponent(scenePanel); |
---|
| 1566 | + bigThree.addComponent(centralPanel); |
---|
| 1567 | + bigThree.addComponent(XYZPanel); |
---|
| 1568 | + |
---|
1315 | 1569 | // // SIDE EFFECT!!! |
---|
1316 | 1570 | // aConstraints.gridx = 0; |
---|
1317 | 1571 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1332 | 1586 | //worldPane.add(bigPanel); |
---|
1333 | 1587 | //worldPane.add(worldPanel); |
---|
1334 | 1588 | /**/ |
---|
1335 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1589 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1590 | + frame.add(/*"Center",*/framePanel); |
---|
1336 | 1591 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1337 | 1592 | |
---|
1338 | 1593 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
1339 | 1594 | |
---|
1340 | | - frame.setSize(1024, 768); |
---|
1341 | | - frame.show(); |
---|
| 1595 | + frame.setSize(1280, 860); |
---|
| 1596 | + |
---|
| 1597 | + frame.validate(); |
---|
| 1598 | + frame.setVisible(true); |
---|
1342 | 1599 | |
---|
| 1600 | + cameraView.requestFocusInWindow(); |
---|
| 1601 | + |
---|
1343 | 1602 | gridPanel.setDividerLocation(1.0); |
---|
1344 | 1603 | |
---|
1345 | 1604 | frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); |
---|
.. | .. |
---|
1353 | 1612 | }); |
---|
1354 | 1613 | } |
---|
1355 | 1614 | |
---|
| 1615 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1616 | + { |
---|
| 1617 | + } |
---|
| 1618 | + |
---|
1356 | 1619 | JTree GetTree() |
---|
1357 | 1620 | { |
---|
1358 | 1621 | return objEditor.jTree; |
---|
.. | .. |
---|
1364 | 1627 | ctrlPanel.removeAll(); |
---|
1365 | 1628 | } |
---|
1366 | 1629 | |
---|
1367 | | - void SetupMaterial(JPanel ctrlPanel) |
---|
| 1630 | + void SetupMaterial(cGridBag panel) |
---|
1368 | 1631 | { |
---|
1369 | | - aConstraints.weighty = 0; |
---|
1370 | | - //aConstraints.weightx = 1; |
---|
1371 | | - /* |
---|
| 1632 | + /* |
---|
1372 | 1633 | ctrlPanel.add(materialLabel = new JLabel("MATERIAL : "), aConstraints); |
---|
1373 | 1634 | materialLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1374 | | - aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
1375 | | - aConstraints.gridx += 1; |
---|
1376 | 1635 | */ |
---|
1377 | 1636 | |
---|
1378 | | - aConstraints.gridwidth = 1; |
---|
1379 | | - ctrlPanel.add(createMaterialButton = new cButton("Create"), aConstraints); |
---|
1380 | | - aConstraints.gridx += 1; |
---|
1381 | | - aConstraints.weighty = 0; |
---|
1382 | | - aConstraints.gridwidth = 1; |
---|
| 1637 | + cGridBag editBar = new cGridBag().setVertical(false); |
---|
| 1638 | + |
---|
| 1639 | + editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1640 | + createMaterialButton.setToolTipText("Create material"); |
---|
1383 | 1641 | |
---|
1384 | 1642 | /* |
---|
1385 | 1643 | ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints); |
---|
1386 | | - aConstraints.gridx += 1; |
---|
1387 | | - aConstraints.weighty = 0; |
---|
1388 | | - aConstraints.gridwidth = 1; |
---|
1389 | 1644 | */ |
---|
1390 | 1645 | |
---|
1391 | | - ctrlPanel.add(clearMaterialButton = new cButton("Clear"), aConstraints); |
---|
1392 | | - aConstraints.gridx += 1; |
---|
| 1646 | + editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1647 | + clearMaterialButton.setToolTipText("Clear material"); |
---|
| 1648 | + |
---|
| 1649 | + if (Globals.ADVANCED) |
---|
| 1650 | + { |
---|
| 1651 | + editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints); |
---|
| 1652 | + editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints); |
---|
| 1653 | + editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints); |
---|
| 1654 | + } |
---|
1393 | 1655 | |
---|
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; |
---|
| 1656 | + editBar.preferredHeight = 15; |
---|
| 1657 | + |
---|
| 1658 | + panel.add(editBar); |
---|
| 1659 | + |
---|
1408 | 1660 | /**/ |
---|
1409 | 1661 | //aConstraints.weighty = 0; |
---|
1410 | 1662 | ////aConstraints.weightx = 1; |
---|
1411 | 1663 | //aConstraints.weighty = 1; |
---|
1412 | 1664 | aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1413 | 1665 | //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; |
---|
| 1666 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1419 | 1667 | |
---|
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; |
---|
| 1668 | + cGridBag colorSection = new cGridBag().setVertical(true); |
---|
| 1669 | + |
---|
| 1670 | + cGridBag color = new cGridBag(); |
---|
| 1671 | + color.add(colorLabel = new JLabel("Color/hue")); // , aConstraints); |
---|
| 1672 | + colorLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1673 | + color.add(colorField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1674 | + //colorField.preferredWidth = 200; |
---|
| 1675 | + colorSection.add(color); |
---|
1430 | 1676 | |
---|
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; |
---|
| 1677 | + cGridBag modulation = new cGridBag(); |
---|
| 1678 | + modulation.add(modulationLabel = new JLabel("Saturation")); // , aConstraints); |
---|
| 1679 | + modulationLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1680 | + modulation.add(modulationField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1681 | + colorSection.add(modulation); |
---|
1440 | 1682 | |
---|
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; |
---|
| 1683 | + cGridBag texture = new cGridBag(); |
---|
| 1684 | + texture.add(textureLabel = new JLabel("Texture")); // , aConstraints); |
---|
| 1685 | + textureLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1686 | + texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1687 | + colorSection.add(texture); |
---|
1450 | 1688 | |
---|
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; |
---|
| 1689 | + cGridBag anisoU = new cGridBag(); |
---|
| 1690 | + anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints); |
---|
| 1691 | + anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1692 | + anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1693 | + colorSection.add(anisoU); |
---|
1460 | 1694 | |
---|
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; |
---|
| 1695 | + cGridBag anisoV = new cGridBag(); |
---|
| 1696 | + anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints); |
---|
| 1697 | + anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1698 | + anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1699 | + colorSection.add(anisoV); |
---|
1470 | 1700 | |
---|
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; |
---|
| 1701 | + cGridBag shadowbias = new cGridBag(); |
---|
| 1702 | + shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints); |
---|
| 1703 | + shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1704 | + shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1705 | + colorSection.add(shadowbias); |
---|
1480 | 1706 | |
---|
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; |
---|
| 1707 | + panel.add(new JSeparator()); |
---|
| 1708 | + |
---|
| 1709 | + panel.add(colorSection); |
---|
| 1710 | + |
---|
| 1711 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1712 | + |
---|
| 1713 | + cGridBag diffuseSection = new cGridBag().setVertical(true); |
---|
| 1714 | + |
---|
| 1715 | + cGridBag diffuse = new cGridBag(); |
---|
| 1716 | + diffuse.add(diffuseLabel = new JLabel("Diffuse")); // , aConstraints); |
---|
| 1717 | + diffuseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1718 | + diffuse.add(diffuseField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1719 | + diffuseSection.add(diffuse); |
---|
1489 | 1720 | |
---|
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; |
---|
| 1721 | + cGridBag diffuseness = new cGridBag(); |
---|
| 1722 | + diffuseness.add(diffusenessLabel = new JLabel("Diffusion")); // , aConstraints); |
---|
| 1723 | + diffusenessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1724 | + diffuseness.add(diffusenessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1725 | + diffuseSection.add(diffuseness); |
---|
1499 | 1726 | |
---|
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; |
---|
| 1727 | + cGridBag selfshadow = new cGridBag(); |
---|
| 1728 | + selfshadow.add(selfshadowLabel = new JLabel("Selfshadow")); // , aConstraints); |
---|
| 1729 | + selfshadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1730 | + selfshadow.add(selfshadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1731 | + diffuseSection.add(selfshadow); |
---|
1509 | 1732 | |
---|
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; |
---|
| 1733 | + cGridBag sheen = new cGridBag(); |
---|
| 1734 | + sheen.add(sheenLabel = new JLabel("Sheen")); // , aConstraints); |
---|
| 1735 | + sheenLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1736 | + sheen.add(sheenField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1737 | + diffuseSection.add(sheen); |
---|
1519 | 1738 | |
---|
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; |
---|
| 1739 | + cGridBag subsurface = new cGridBag(); |
---|
| 1740 | + subsurface.add(subsurfaceLabel = new JLabel("Subsurface")); // , aConstraints); |
---|
| 1741 | + subsurfaceLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1742 | + subsurface.add(subsurfaceField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1743 | + diffuseSection.add(subsurface); |
---|
1529 | 1744 | |
---|
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; |
---|
| 1745 | + cGridBag shadow = new cGridBag(); |
---|
| 1746 | + shadow.add(shadowLabel = new JLabel("Shadowing")); // , aConstraints); |
---|
| 1747 | + shadowLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1748 | + shadow.add(shadowField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1749 | + diffuseSection.add(shadow); |
---|
1539 | 1750 | |
---|
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; |
---|
| 1751 | + cGridBag fakedepth = new cGridBag(); |
---|
| 1752 | + fakedepth.add(fakedepthLabel = new JLabel("Fakedepth")); // , aConstraints); |
---|
| 1753 | + fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1754 | + fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1755 | + diffuseSection.add(fakedepth); |
---|
1549 | 1756 | |
---|
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; |
---|
| 1757 | + panel.add(new JSeparator()); |
---|
| 1758 | + |
---|
| 1759 | + panel.add(diffuseSection); |
---|
| 1760 | + |
---|
| 1761 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1762 | + |
---|
| 1763 | + cGridBag specularSection = new cGridBag().setVertical(true); |
---|
1559 | 1764 | |
---|
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; |
---|
| 1765 | + cGridBag specular = new cGridBag(); |
---|
| 1766 | + specular.add(specularLabel = new JLabel("Specular")); // , aConstraints); |
---|
| 1767 | + specularLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1768 | + specular.add(specularField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1769 | + specularSection.add(specular); |
---|
1568 | 1770 | |
---|
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; |
---|
| 1771 | + cGridBag lightarea = new cGridBag(); |
---|
| 1772 | + lightarea.add(lightareaLabel = new JLabel("Lightarea")); // , aConstraints); |
---|
| 1773 | + lightareaLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1774 | + lightarea.add(lightareaField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1775 | + specularSection.add(lightarea); |
---|
1578 | 1776 | |
---|
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; |
---|
| 1777 | + cGridBag shininess = new cGridBag(); |
---|
| 1778 | + shininess.add(shininessLabel = new JLabel("Roughness")); // , aConstraints); |
---|
| 1779 | + shininessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1780 | + shininess.add(shininessField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1781 | + specularSection.add(shininess); |
---|
1588 | 1782 | |
---|
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; |
---|
| 1783 | + cGridBag metalness = new cGridBag(); |
---|
| 1784 | + metalness.add(metalnessLabel = new JLabel("Metalness")); // , aConstraints); |
---|
| 1785 | + metalnessLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1786 | + metalness.add(metalnessField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1787 | + specularSection.add(metalness); |
---|
1598 | 1788 | |
---|
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; |
---|
| 1789 | + cGridBag velvet = new cGridBag(); |
---|
| 1790 | + velvet.add(velvetLabel = new JLabel("Velvet")); // , aConstraints); |
---|
| 1791 | + velvetLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1792 | + velvet.add(velvetField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1793 | + specularSection.add(velvet); |
---|
1608 | 1794 | |
---|
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(); |
---|
| 1795 | + shiftField = (cNumberSlider)AddSlider(specularSection, "Shift", 0.001, 50, copy.material.shift, -1).getComponent(1); |
---|
| 1796 | + //Return(); |
---|
1621 | 1797 | // ctrlPanel.add(shiftLabel = new JLabel("Shift"), aConstraints); |
---|
1622 | 1798 | // shiftLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
1623 | 1799 | // aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
.. | .. |
---|
1628 | 1804 | // aConstraints.gridy += 1; |
---|
1629 | 1805 | // aConstraints.gridwidth = 1; |
---|
1630 | 1806 | |
---|
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 | 1807 | |
---|
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; |
---|
| 1808 | + panel.add(new JSeparator()); |
---|
| 1809 | + |
---|
| 1810 | + panel.add(specularSection); |
---|
| 1811 | + |
---|
| 1812 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1813 | + |
---|
| 1814 | + cGridBag globalSection = new cGridBag().setVertical(true); |
---|
1649 | 1815 | |
---|
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; |
---|
| 1816 | + cGridBag camera = new cGridBag(); |
---|
| 1817 | + camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints); |
---|
| 1818 | + cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1819 | + camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1820 | + globalSection.add(camera); |
---|
1659 | 1821 | |
---|
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; |
---|
| 1822 | + cGridBag ambient = new cGridBag(); |
---|
| 1823 | + ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints); |
---|
| 1824 | + ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1825 | + ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1826 | + globalSection.add(ambient); |
---|
1669 | 1827 | |
---|
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; |
---|
| 1828 | + cGridBag backlit = new cGridBag(); |
---|
| 1829 | + backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints); |
---|
| 1830 | + backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1831 | + backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
| 1832 | + globalSection.add(backlit); |
---|
1680 | 1833 | |
---|
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; |
---|
| 1834 | + cGridBag opacity = new cGridBag(); |
---|
| 1835 | + opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints); |
---|
| 1836 | + opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1837 | + opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints); |
---|
| 1838 | + globalSection.add(opacity); |
---|
1690 | 1839 | |
---|
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; |
---|
| 1840 | + panel.add(new JSeparator()); |
---|
| 1841 | + |
---|
| 1842 | + panel.add(globalSection); |
---|
| 1843 | + |
---|
| 1844 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
| 1845 | + |
---|
| 1846 | + cGridBag textureSection = new cGridBag().setVertical(true); |
---|
1700 | 1847 | |
---|
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; |
---|
| 1848 | + cGridBag bump = new cGridBag(); |
---|
| 1849 | + bump.add(bumpLabel = new JLabel("Bump")); // , aConstraints); |
---|
| 1850 | + bumpLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1851 | + bump.add(bumpField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1852 | + textureSection.add(bump); |
---|
1710 | 1853 | |
---|
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; |
---|
| 1854 | + cGridBag noise = new cGridBag(); |
---|
| 1855 | + noise.add(noiseLabel = new JLabel("Noise")); // , aConstraints); |
---|
| 1856 | + noiseLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1857 | + noise.add(noiseField = new cNumberSlider(this, 0.0, 1/*5*/)); // , aConstraints); |
---|
| 1858 | + textureSection.add(noise); |
---|
1720 | 1859 | |
---|
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; |
---|
| 1860 | + cGridBag power = new cGridBag(); |
---|
| 1861 | + power.add(powerLabel = new JLabel("Turbulance")); // , aConstraints); |
---|
| 1862 | + powerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1863 | + power.add(powerField = new cNumberSlider(this, 0.0, 5)); // , aConstraints); |
---|
| 1864 | + textureSection.add(power); |
---|
1730 | 1865 | |
---|
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; |
---|
| 1866 | + cGridBag borderfade = new cGridBag(); |
---|
| 1867 | + borderfade.add(borderfadeLabel = new JLabel("Borderfade")); // , aConstraints); |
---|
| 1868 | + borderfadeLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1869 | + borderfade.add(borderfadeField = new cNumberSlider(this, 0.0, 2)); // , aConstraints); |
---|
| 1870 | + textureSection.add(borderfade); |
---|
1740 | 1871 | |
---|
1741 | | - //aConstraints.weighty = 1; |
---|
1742 | | - aConstraints.gridwidth = ObjEditor.GRIDWIDTH; // 100; |
---|
1743 | | - //aConstraints.gridx += 1; |
---|
1744 | | - ctrlPanel.add(new JLabel("----------------------------------"), aConstraints); |
---|
1745 | | - aConstraints.weighty = 0; |
---|
| 1872 | + cGridBag fog = new cGridBag(); |
---|
| 1873 | + fog.add(fogLabel = new JLabel("Punch")); // , aConstraints); |
---|
| 1874 | + fogLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1875 | + fog.add(fogField = new cNumberSlider(this, 0.0, 20)); // , aConstraints); |
---|
| 1876 | + textureSection.add(fog); |
---|
1746 | 1877 | |
---|
1747 | | - aConstraints.gridx = 0; |
---|
1748 | | - aConstraints.gridy = 0; |
---|
1749 | | - aConstraints.gridwidth = 1; |
---|
| 1878 | + cGridBag opacityPower = new cGridBag(); |
---|
| 1879 | + opacityPower.add(opacityPowerLabel = new JLabel("Halo")); // , aConstraints); |
---|
| 1880 | + opacityPowerLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 1881 | + opacityPower.add(opacityPowerField = new cNumberSlider(this, 0.0, 10 /*10 dec 2013*/)); // , aConstraints); |
---|
| 1882 | + textureSection.add(opacityPower); |
---|
| 1883 | + |
---|
| 1884 | + panel.add(new JSeparator()); |
---|
| 1885 | + |
---|
| 1886 | + panel.add(textureSection); |
---|
| 1887 | + |
---|
| 1888 | + //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints); |
---|
1750 | 1889 | |
---|
1751 | 1890 | SetMaterial(copy); // .GetMaterial()); |
---|
1752 | 1891 | |
---|
1753 | | - colorField.addChangeListener(this); |
---|
1754 | | - modulationField.addChangeListener(this); |
---|
| 1892 | + //colorField.addChangeListener(this); |
---|
| 1893 | +// modulationField.addChangeListener(this); |
---|
1755 | 1894 | metalnessField.addChangeListener(this); |
---|
1756 | 1895 | diffuseField.addChangeListener(this); |
---|
1757 | 1896 | specularField.addChangeListener(this); |
---|
.. | .. |
---|
1781 | 1920 | opacityPowerField.addChangeListener(this); |
---|
1782 | 1921 | /**/ |
---|
1783 | 1922 | |
---|
1784 | | - resetSlidersButton.addActionListener(this); |
---|
1785 | 1923 | clearMaterialButton.addActionListener(this); |
---|
1786 | 1924 | createMaterialButton.addActionListener(this); |
---|
1787 | | - |
---|
1788 | | - propagateToggle.addItemListener(this); |
---|
1789 | | - multiplyToggle.addItemListener(this); |
---|
| 1925 | + |
---|
| 1926 | + if (Globals.ADVANCED) |
---|
| 1927 | + { |
---|
| 1928 | + resetSlidersButton.addActionListener(this); |
---|
| 1929 | + propagateToggle.addItemListener(this); |
---|
| 1930 | + multiplyToggle.addItemListener(this); |
---|
| 1931 | + } |
---|
1790 | 1932 | } |
---|
1791 | 1933 | |
---|
1792 | 1934 | void DropFile(java.io.File[] files, boolean textures) |
---|
.. | .. |
---|
1957 | 2099 | |
---|
1958 | 2100 | //? flashIt = false; |
---|
1959 | 2101 | CameraPane pane = (CameraPane) cameraView; |
---|
1960 | | - pane.clickStart(location.x, location.y, 0); |
---|
| 2102 | + pane.clickStart(location.x, location.y, 0, 0); |
---|
1961 | 2103 | pane.clickEnd(location.x, location.y, 0, true); |
---|
1962 | 2104 | |
---|
1963 | 2105 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
2006 | 2148 | e2.printStackTrace(); |
---|
2007 | 2149 | } |
---|
2008 | 2150 | } |
---|
| 2151 | + |
---|
2009 | 2152 | LoadJMEThread loadThread; |
---|
2010 | 2153 | |
---|
2011 | 2154 | class LoadJMEThread extends Thread |
---|
.. | .. |
---|
2063 | 2206 | //LoadFile0(filename, converter); |
---|
2064 | 2207 | } |
---|
2065 | 2208 | } |
---|
| 2209 | + |
---|
2066 | 2210 | LoadOBJThread loadObjThread; |
---|
2067 | 2211 | |
---|
2068 | 2212 | class LoadOBJThread extends Thread |
---|
.. | .. |
---|
2141 | 2285 | |
---|
2142 | 2286 | void LoadObjFile(String fullname) |
---|
2143 | 2287 | { |
---|
2144 | | - /* |
---|
| 2288 | + System.out.println("Loading " + fullname); |
---|
| 2289 | + /**/ |
---|
2145 | 2290 | //lastFilename = fullname; |
---|
2146 | 2291 | if(loadObjThread == null) |
---|
2147 | 2292 | { |
---|
2148 | | - loadObjThread = new LoadOBJThread(); |
---|
2149 | | - loadObjThread.start(); |
---|
| 2293 | + loadObjThread = new LoadOBJThread(); |
---|
| 2294 | + loadObjThread.start(); |
---|
2150 | 2295 | } |
---|
2151 | 2296 | |
---|
2152 | 2297 | loadObjThread.add(fullname); |
---|
2153 | | - */ |
---|
| 2298 | + /**/ |
---|
2154 | 2299 | |
---|
2155 | | - System.out.println("Loading " + fullname); |
---|
2156 | | - makeSomething(new FileObject(fullname, true), true); |
---|
| 2300 | + //makeSomething(new FileObject(fullname, true), true); |
---|
2157 | 2301 | } |
---|
2158 | 2302 | |
---|
2159 | 2303 | void LoadGFDFile(String fullname) |
---|
.. | .. |
---|
2414 | 2558 | |
---|
2415 | 2559 | void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) |
---|
2416 | 2560 | { |
---|
2417 | | - if (GrafreeD.standAlone) |
---|
| 2561 | + if (Grafreed.standAlone) |
---|
2418 | 2562 | { |
---|
2419 | 2563 | /**/ |
---|
2420 | 2564 | FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); |
---|
2421 | | - browser.show(); |
---|
| 2565 | + browser.setVisible(true); |
---|
2422 | 2566 | String filename = browser.getFile(); |
---|
2423 | 2567 | if (filename != null && filename.length() > 0) |
---|
2424 | 2568 | { |
---|
.. | .. |
---|
2563 | 2707 | } |
---|
2564 | 2708 | if (input == null) |
---|
2565 | 2709 | { |
---|
| 2710 | + new Exception().printStackTrace(); |
---|
2566 | 2711 | System.exit(0); |
---|
2567 | 2712 | } |
---|
2568 | 2713 | |
---|
.. | .. |
---|
2769 | 2914 | |
---|
2770 | 2915 | void SetMaterial(Object3D object) |
---|
2771 | 2916 | { |
---|
| 2917 | + latestObject = object; |
---|
| 2918 | + |
---|
2772 | 2919 | cMaterial mat = object.material; |
---|
2773 | 2920 | |
---|
2774 | 2921 | if (mat == null) |
---|
.. | .. |
---|
2777 | 2924 | return; |
---|
2778 | 2925 | } |
---|
2779 | 2926 | |
---|
2780 | | - multiplyToggle.setSelected(mat.multiply); |
---|
| 2927 | + if (multiplyToggle != null) |
---|
| 2928 | + multiplyToggle.setSelected(mat.multiply); |
---|
2781 | 2929 | |
---|
2782 | 2930 | assert (object.projectedVertices != null); |
---|
2783 | 2931 | |
---|
.. | .. |
---|
2879 | 3027 | // } |
---|
2880 | 3028 | |
---|
2881 | 3029 | /**/ |
---|
2882 | | - if (deselect) |
---|
| 3030 | + if (deselect || child == null) |
---|
2883 | 3031 | { |
---|
2884 | 3032 | //group.deselectAll(); |
---|
2885 | 3033 | //freeze = true; |
---|
2886 | 3034 | GetTree().clearSelection(); |
---|
2887 | 3035 | //freeze = false; |
---|
| 3036 | + |
---|
| 3037 | + if (child == null) |
---|
| 3038 | + { |
---|
| 3039 | + return; |
---|
| 3040 | + } |
---|
2888 | 3041 | } |
---|
2889 | 3042 | |
---|
2890 | 3043 | //group.addSelectee(child); |
---|
.. | .. |
---|
2953 | 3106 | cameraView.ToggleDL(); |
---|
2954 | 3107 | cameraView.repaint(); |
---|
2955 | 3108 | return; |
---|
2956 | | - } else if (event.getSource() == toggleTextureItem) |
---|
| 3109 | + } else if (event.getSource() == toggleTextureItem || event.getSource() == toggleTextureCB) |
---|
2957 | 3110 | { |
---|
2958 | 3111 | cameraView.ToggleTexture(); |
---|
2959 | 3112 | // june 2013 copy.HardTouch(); |
---|
2960 | 3113 | cameraView.repaint(); |
---|
2961 | 3114 | return; |
---|
2962 | | - } else if (event.getSource() == toggleFullItem) |
---|
| 3115 | + } else if (event.getSource() == toggleTimelineItem) |
---|
2963 | 3116 | { |
---|
2964 | | - if (CameraPane.FULLSCREEN) |
---|
| 3117 | + timeline ^= true; |
---|
| 3118 | + |
---|
| 3119 | + if (timeline) |
---|
2965 | 3120 | { |
---|
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); |
---|
| 3121 | + centralPanel.remove(cameraView); |
---|
| 3122 | + cameraPanel.add(cameraView); |
---|
| 3123 | + centralPanel.add(cameraPanel); |
---|
| 3124 | + frame.setJMenuBar(timelineMenubar); |
---|
| 3125 | + wasFullScreen = CameraPane.FULLSCREEN; |
---|
| 3126 | + if (!CameraPane.FULLSCREEN) |
---|
| 3127 | + ToggleFullScreen(); |
---|
| 3128 | + toggleFullScreenItem.setEnabled(false); |
---|
2973 | 3129 | } |
---|
| 3130 | + else |
---|
| 3131 | + { |
---|
| 3132 | + centralPanel.remove(cameraPanel); |
---|
| 3133 | + centralPanel.add(cameraView); |
---|
| 3134 | + frame.setJMenuBar(null); |
---|
| 3135 | + if (!wasFullScreen) |
---|
| 3136 | + ToggleFullScreen(); |
---|
| 3137 | + toggleFullScreenItem.setEnabled(true); |
---|
| 3138 | + } |
---|
| 3139 | + |
---|
2974 | 3140 | frame.validate(); |
---|
2975 | | - cameraView.ToggleFullScreen(); |
---|
| 3141 | + return; |
---|
| 3142 | + } else if (event.getSource() == toggleFullScreenItem) |
---|
| 3143 | + { |
---|
| 3144 | + ToggleFullScreen(); |
---|
| 3145 | + frame.validate(); |
---|
2976 | 3146 | |
---|
2977 | 3147 | return; |
---|
2978 | | - } else if (event.getSource() == toggleRandomItem) |
---|
| 3148 | + } else if (event.getSource() == toggleSwitchItem || event.getSource() == toggleSwitchCB) |
---|
2979 | 3149 | { |
---|
2980 | | - cameraView.ToggleRandom(); |
---|
| 3150 | + cameraView.ToggleSwitch(); |
---|
2981 | 3151 | cameraView.repaint(); |
---|
2982 | 3152 | return; |
---|
2983 | 3153 | } else if (event.getSource() == toggleHandleItem) |
---|
.. | .. |
---|
3006 | 3176 | { |
---|
3007 | 3177 | copy.live ^= true; |
---|
3008 | 3178 | return; |
---|
| 3179 | + } else if (event.getSource() == selectCB) |
---|
| 3180 | + { |
---|
| 3181 | + copy.dontselect ^= true; |
---|
| 3182 | + return; |
---|
3009 | 3183 | } else if (event.getSource() == hideCB) |
---|
3010 | 3184 | { |
---|
3011 | 3185 | copy.hide ^= true; |
---|
.. | .. |
---|
3020 | 3194 | if (event.getSource() == randomCB) |
---|
3021 | 3195 | { |
---|
3022 | 3196 | copy.random ^= true; |
---|
| 3197 | + objEditor.refreshContents(); |
---|
3023 | 3198 | return; |
---|
3024 | 3199 | } |
---|
3025 | 3200 | if (event.getSource() == speedupCB) |
---|
.. | .. |
---|
3043 | 3218 | |
---|
3044 | 3219 | public void actionPerformed(ActionEvent event) |
---|
3045 | 3220 | { |
---|
| 3221 | + Object source = event.getSource(); |
---|
3046 | 3222 | // SCRIPT DIALOG |
---|
3047 | | - if (event.getSource() == okbutton) |
---|
| 3223 | + if (source == okbutton) |
---|
3048 | 3224 | { |
---|
3049 | 3225 | textpanel.setVisible(false); |
---|
3050 | 3226 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3056 | 3232 | textarea = null; |
---|
3057 | 3233 | textpanel = null; |
---|
3058 | 3234 | } |
---|
3059 | | - if (event.getSource() == cancelbutton) |
---|
| 3235 | + if (source == cancelbutton) |
---|
3060 | 3236 | { |
---|
3061 | 3237 | textpanel.setVisible(false); |
---|
3062 | 3238 | textpanel.remove(textarea); |
---|
.. | .. |
---|
3068 | 3244 | //applySelf(); |
---|
3069 | 3245 | //client.refreshEditWindow(); |
---|
3070 | 3246 | //refreshContents(); |
---|
3071 | | - if (event.getSource() == nameField) |
---|
| 3247 | + if (source == nameField) |
---|
3072 | 3248 | { |
---|
3073 | 3249 | //System.out.println("ObjEditor " + event); |
---|
3074 | 3250 | applySelf0(true); |
---|
3075 | 3251 | //parent.applySelf(); |
---|
3076 | 3252 | objEditor.refreshContents(); |
---|
3077 | | - } else if (event.getSource() == resetButton) |
---|
| 3253 | + } else if (source == resetButton) |
---|
3078 | 3254 | { |
---|
3079 | 3255 | CameraPane.fullreset = true; |
---|
3080 | 3256 | copy.Reset(); // ResetMeshes(); |
---|
3081 | 3257 | copy.Touch(); |
---|
3082 | 3258 | objEditor.refreshContents(); |
---|
3083 | | - } else if (event.getSource() == stepItem) |
---|
| 3259 | + } else if (source == stepItem) |
---|
3084 | 3260 | { |
---|
3085 | | - cameraView.ONESTEP = true; |
---|
| 3261 | + //cameraView.ONESTEP = true; |
---|
| 3262 | + Globals.ONESTEP = true; |
---|
3086 | 3263 | cameraView.repaint(); |
---|
3087 | 3264 | return; |
---|
3088 | | - } else if (event.getSource() == stepButton) |
---|
| 3265 | + } else if (source == stepButton) |
---|
3089 | 3266 | { |
---|
3090 | 3267 | copy.Step(); |
---|
3091 | 3268 | copy.Touch(); |
---|
3092 | 3269 | objEditor.refreshContents(); |
---|
3093 | | - } else if (event.getSource() == slowerButton) |
---|
| 3270 | + } else if (source == slowerButton) |
---|
3094 | 3271 | { |
---|
3095 | 3272 | copy.Slower(); |
---|
3096 | 3273 | copy.Touch(); |
---|
3097 | 3274 | objEditor.refreshContents(); |
---|
3098 | | - } else if (event.getSource() == fasterButton) |
---|
| 3275 | + } else if (source == fasterButton) |
---|
3099 | 3276 | { |
---|
3100 | 3277 | copy.Faster(); |
---|
3101 | 3278 | copy.Touch(); |
---|
3102 | 3279 | objEditor.refreshContents(); |
---|
3103 | | - } else if (event.getSource() == remarkButton) |
---|
| 3280 | + } else if (source == remarkButton) |
---|
3104 | 3281 | { |
---|
3105 | 3282 | copy.Remark(); |
---|
3106 | 3283 | copy.Touch(); |
---|
3107 | 3284 | objEditor.refreshContents(); |
---|
3108 | | - } else if (event.getSource() == stepAllButton) |
---|
| 3285 | + } else if (source == stepAllButton) |
---|
3109 | 3286 | { |
---|
3110 | 3287 | copy.StepAll(); |
---|
3111 | 3288 | copy.Touch(); |
---|
3112 | 3289 | objEditor.refreshContents(); |
---|
3113 | | - } else if (event.getSource() == resetAllButton) |
---|
| 3290 | + } else if (source == resetAllButton) |
---|
3114 | 3291 | { |
---|
3115 | 3292 | //CameraPane.fullreset = true; |
---|
3116 | 3293 | copy.ResetAll(); // ResetMeshes(); |
---|
.. | .. |
---|
3143 | 3320 | // Close(); |
---|
3144 | 3321 | // } |
---|
3145 | 3322 | // else |
---|
3146 | | - if (event.getSource() == resetSlidersButton) |
---|
| 3323 | + if (source == resetSlidersButton) |
---|
3147 | 3324 | { |
---|
3148 | 3325 | ResetSliders(); |
---|
3149 | | - } else if (event.getSource() == clearMaterialButton) |
---|
| 3326 | + } else if (source == clearMaterialButton) |
---|
3150 | 3327 | { |
---|
3151 | 3328 | ClearMaterial(); |
---|
3152 | | - } else if (event.getSource() == createMaterialButton) |
---|
| 3329 | + } else if (source == createMaterialButton) |
---|
3153 | 3330 | { |
---|
3154 | 3331 | CreateMaterial(); |
---|
3155 | | - } else if (event.getSource() == clearPanelButton) |
---|
| 3332 | + } else if (source == clearPanelButton) |
---|
3156 | 3333 | { |
---|
3157 | 3334 | copy.ClearUI(); |
---|
3158 | 3335 | refreshContents(true); |
---|
3159 | | - } /* |
---|
3160 | | - } |
---|
3161 | | - |
---|
3162 | | - public boolean action(Event event, Object arg) |
---|
3163 | | - { |
---|
3164 | | - */ else if (event.getSource() == closeItem) |
---|
| 3336 | + } else if (source == importGFDItem) |
---|
| 3337 | + { |
---|
| 3338 | + ImportGFD(); |
---|
| 3339 | + } else |
---|
| 3340 | + if (source == importVRMLX3DItem) |
---|
| 3341 | + { |
---|
| 3342 | + ImportVRMLX3D(); |
---|
| 3343 | + } else |
---|
| 3344 | + if (source == import3DSItem) |
---|
| 3345 | + { |
---|
| 3346 | + objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
| 3347 | + } else |
---|
| 3348 | + if (source == importOBJItem) |
---|
| 3349 | + { |
---|
| 3350 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 3351 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 3352 | + browser.setVisible(true); |
---|
| 3353 | + String filename = browser.getFile(); |
---|
| 3354 | + if (filename != null && filename.length() > 0) |
---|
| 3355 | + { |
---|
| 3356 | + String fullname = browser.getDirectory() + filename; |
---|
| 3357 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 3358 | + } |
---|
| 3359 | + } else |
---|
| 3360 | + if (source == closeItem) |
---|
3165 | 3361 | { |
---|
3166 | 3362 | Close(); |
---|
3167 | 3363 | //return true; |
---|
3168 | | - } else if (event.getSource() == loadItem) |
---|
| 3364 | + } else if (source == loadItem) |
---|
3169 | 3365 | { |
---|
3170 | 3366 | load(); |
---|
3171 | 3367 | //return true; |
---|
3172 | | - } else if (event.getSource() == saveItem) |
---|
| 3368 | + } else if (source == newItem) |
---|
| 3369 | + { |
---|
| 3370 | + New(); |
---|
| 3371 | + } else if (source == saveItem) |
---|
3173 | 3372 | { |
---|
3174 | 3373 | save(); |
---|
3175 | 3374 | //return true; |
---|
3176 | | - } else if (event.getSource() == saveAsItem) |
---|
| 3375 | + } else if (source == saveAsItem) |
---|
3177 | 3376 | { |
---|
3178 | 3377 | saveAs(); |
---|
3179 | 3378 | //return true; |
---|
3180 | | - } else if (event.getSource() == reexportItem) |
---|
| 3379 | + } else if (source == reexportItem) |
---|
3181 | 3380 | { |
---|
3182 | 3381 | reexport(); |
---|
3183 | 3382 | //return true; |
---|
3184 | | - } else if (event.getSource() == exportAsItem) |
---|
| 3383 | + } else if (source == exportAsItem) |
---|
3185 | 3384 | { |
---|
3186 | 3385 | export(); |
---|
3187 | 3386 | //return true; |
---|
3188 | | - } else if (event.getSource() == povItem) |
---|
| 3387 | + } else if (source == povItem) |
---|
3189 | 3388 | { |
---|
3190 | 3389 | generatePOV(); |
---|
3191 | 3390 | //return true; |
---|
3192 | | - } else if (event.getSource() == zBufferItem) |
---|
| 3391 | + } else if (source == zBufferItem) |
---|
3193 | 3392 | { |
---|
3194 | 3393 | try |
---|
3195 | 3394 | { |
---|
.. | .. |
---|
3211 | 3410 | cameraView.repaint(); |
---|
3212 | 3411 | //return true; |
---|
3213 | 3412 | } |
---|
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) |
---|
| 3413 | + */ else // combos... |
---|
| 3414 | + if (source == texresMenu) |
---|
3229 | 3415 | { |
---|
3230 | 3416 | System.err.println("Object = " + copy + "; change value " + copy.texres + " to " + texresMenu.getSelectedIndex()); |
---|
3231 | 3417 | copy.texres = texresMenu.getSelectedIndex(); |
---|
.. | .. |
---|
3237 | 3423 | } |
---|
3238 | 3424 | } |
---|
3239 | 3425 | |
---|
3240 | | - void ToggleAnimation() |
---|
| 3426 | + void New() |
---|
3241 | 3427 | { |
---|
3242 | | - if (!CameraPane.ANIMATION) |
---|
| 3428 | + while (copy.Size() > 1) |
---|
3243 | 3429 | { |
---|
3244 | | - FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3430 | + copy.remove(1); |
---|
| 3431 | + } |
---|
| 3432 | + |
---|
| 3433 | + ResetModel(); |
---|
| 3434 | + objEditor.refreshContents(); |
---|
| 3435 | + } |
---|
| 3436 | + |
---|
| 3437 | + static public byte[] Compress(Object3D o) |
---|
| 3438 | + { |
---|
| 3439 | + try |
---|
| 3440 | + { |
---|
| 3441 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3442 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(baos); |
---|
| 3443 | + ObjectOutputStream out = new ObjectOutputStream(zstream); |
---|
| 3444 | + |
---|
| 3445 | + Object3D parent = o.parent; |
---|
| 3446 | + o.parent = null; |
---|
| 3447 | + |
---|
| 3448 | + out.writeObject(o); |
---|
| 3449 | + |
---|
| 3450 | + o.parent = parent; |
---|
| 3451 | + |
---|
| 3452 | + out.flush(); |
---|
| 3453 | + |
---|
| 3454 | + zstream.close(); |
---|
| 3455 | + out.close(); |
---|
| 3456 | + |
---|
| 3457 | + return baos.toByteArray(); |
---|
| 3458 | + } catch (Exception e) |
---|
| 3459 | + { |
---|
| 3460 | + System.err.println(e); |
---|
| 3461 | + return null; |
---|
| 3462 | + } |
---|
| 3463 | + } |
---|
| 3464 | + |
---|
| 3465 | + static public Object Uncompress(byte[] bytes) |
---|
| 3466 | + { |
---|
| 3467 | + System.out.println("#bytes = " + bytes.length); |
---|
| 3468 | + try |
---|
| 3469 | + { |
---|
| 3470 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3471 | + java.util.zip.GZIPInputStream istream = new java.util.zip.GZIPInputStream(bais); |
---|
| 3472 | + ObjectInputStream in = new ObjectInputStream(istream); |
---|
| 3473 | + Object obj = in.readObject(); |
---|
| 3474 | + in.close(); |
---|
| 3475 | + |
---|
| 3476 | + return obj; |
---|
| 3477 | + } catch (Exception e) |
---|
| 3478 | + { |
---|
| 3479 | + System.err.println(e); |
---|
| 3480 | + return null; |
---|
| 3481 | + } |
---|
| 3482 | + } |
---|
| 3483 | + |
---|
| 3484 | + static public Object clone(Object o) |
---|
| 3485 | + { |
---|
| 3486 | + try |
---|
| 3487 | + { |
---|
| 3488 | + ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
---|
| 3489 | + ObjectOutputStream out = new ObjectOutputStream(baos); |
---|
| 3490 | + |
---|
| 3491 | + out.writeObject(o); |
---|
| 3492 | + |
---|
| 3493 | + out.flush(); |
---|
| 3494 | + out.close(); |
---|
| 3495 | + |
---|
| 3496 | + byte[] bytes = baos.toByteArray(); |
---|
| 3497 | + |
---|
| 3498 | + System.out.println("clone = " + bytes.length); |
---|
| 3499 | + |
---|
| 3500 | + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); |
---|
| 3501 | + ObjectInputStream in = new ObjectInputStream(bais); |
---|
| 3502 | + Object obj = in.readObject(); |
---|
| 3503 | + in.close(); |
---|
| 3504 | + |
---|
| 3505 | + return obj; |
---|
| 3506 | + } catch (Exception e) |
---|
| 3507 | + { |
---|
| 3508 | + System.err.println(e); |
---|
| 3509 | + return null; |
---|
| 3510 | + } |
---|
| 3511 | + } |
---|
| 3512 | + |
---|
| 3513 | + cRadio GetCurrentTab() |
---|
| 3514 | + { |
---|
| 3515 | + cRadio ab; |
---|
| 3516 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3517 | + { |
---|
| 3518 | + ab = (cRadio)e.nextElement(); |
---|
| 3519 | + if(ab.GetObject() == copy) |
---|
| 3520 | + { |
---|
| 3521 | + return ab; |
---|
| 3522 | + } |
---|
| 3523 | + } |
---|
| 3524 | + |
---|
| 3525 | + return null; |
---|
| 3526 | + } |
---|
| 3527 | + |
---|
| 3528 | + java.util.Hashtable<java.util.UUID, Object3D> hashtable = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 3529 | + |
---|
| 3530 | + public void Save() |
---|
| 3531 | + { |
---|
| 3532 | + System.err.println("Save"); |
---|
| 3533 | + |
---|
| 3534 | + cRadio tab = GetCurrentTab(); |
---|
| 3535 | + |
---|
| 3536 | + boolean temp = CameraPane.SWITCH; |
---|
| 3537 | + CameraPane.SWITCH = false; |
---|
| 3538 | + |
---|
| 3539 | + copy.ExtractBigData(hashtable); |
---|
| 3540 | + |
---|
| 3541 | + //EditorFrame.m_MainFrame.requestFocusInWindow(); |
---|
| 3542 | + tab.graphs[tab.undoindex++] = Compress(copy); |
---|
| 3543 | + |
---|
| 3544 | + copy.RestoreBigData(hashtable); |
---|
| 3545 | + |
---|
| 3546 | + CameraPane.SWITCH = temp; |
---|
| 3547 | + |
---|
| 3548 | + //assert(hashtable.isEmpty()); |
---|
| 3549 | + |
---|
| 3550 | + for (int i = tab.undoindex; i < tab.graphs.length; i++) |
---|
| 3551 | + { |
---|
| 3552 | + tab.graphs[i] = null; |
---|
| 3553 | + } |
---|
| 3554 | + |
---|
| 3555 | + SetUndoStates(); |
---|
| 3556 | + |
---|
| 3557 | + // test save |
---|
| 3558 | + if (false) |
---|
| 3559 | + { |
---|
| 3560 | + try |
---|
| 3561 | + { |
---|
| 3562 | + FileOutputStream ostream = new FileOutputStream("save" + tab.undoindex); |
---|
| 3563 | + ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 3564 | + |
---|
| 3565 | + p.writeObject(copy); |
---|
| 3566 | + |
---|
| 3567 | + p.flush(); |
---|
| 3568 | + |
---|
| 3569 | + ostream.close(); |
---|
| 3570 | + } catch (Exception e) |
---|
| 3571 | + { |
---|
| 3572 | + e.printStackTrace(); |
---|
| 3573 | + } |
---|
| 3574 | + } |
---|
| 3575 | + } |
---|
| 3576 | + |
---|
| 3577 | + void CopyChanged(Object3D obj) |
---|
| 3578 | + { |
---|
| 3579 | + SetUndoStates(); |
---|
| 3580 | + |
---|
| 3581 | + boolean temp = CameraPane.SWITCH; |
---|
| 3582 | + CameraPane.SWITCH = false; |
---|
| 3583 | + |
---|
| 3584 | + copy.ExtractBigData(hashtable); |
---|
| 3585 | + |
---|
| 3586 | + copy.clear(); |
---|
| 3587 | + |
---|
| 3588 | + for (int i=0; i<obj.Size(); i++) |
---|
| 3589 | + { |
---|
| 3590 | + copy.add(obj.get(i)); |
---|
| 3591 | + } |
---|
| 3592 | + |
---|
| 3593 | + copy.RestoreBigData(hashtable); |
---|
| 3594 | + |
---|
| 3595 | + CameraPane.SWITCH = temp; |
---|
| 3596 | + |
---|
| 3597 | + //assert(hashtable.isEmpty()); |
---|
| 3598 | + |
---|
| 3599 | + copy.Touch(); |
---|
| 3600 | + |
---|
| 3601 | + ResetModel(); |
---|
| 3602 | + copy.HardTouch(); // recompile? |
---|
| 3603 | + |
---|
| 3604 | + cRadio ab; |
---|
| 3605 | + for (java.util.Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
| 3606 | + { |
---|
| 3607 | + ab = (cRadio)e.nextElement(); |
---|
| 3608 | + Object3D test = copy.GetObject(ab.object.GetUUID()); |
---|
| 3609 | + //ab.camera = (Camera)copy.GetObject(ab.camera.GetUUID()); |
---|
| 3610 | + if (test != null) |
---|
| 3611 | + { |
---|
| 3612 | + test.editWindow = ab.object.editWindow; |
---|
| 3613 | + ab.object = test; |
---|
| 3614 | + } |
---|
| 3615 | + } |
---|
| 3616 | + |
---|
| 3617 | + refreshContents(); |
---|
| 3618 | + } |
---|
| 3619 | + |
---|
| 3620 | + cButton undoButton; |
---|
| 3621 | + cButton redoButton; |
---|
| 3622 | + |
---|
| 3623 | + void SetUndoStates() |
---|
| 3624 | + { |
---|
| 3625 | + cRadio tab = GetCurrentTab(); |
---|
| 3626 | + |
---|
| 3627 | + undoButton.setEnabled(tab.undoindex > 0); |
---|
| 3628 | + redoButton.setEnabled(tab.graphs[tab.undoindex + 1] != null); |
---|
| 3629 | + } |
---|
| 3630 | + |
---|
| 3631 | + public void Undo() |
---|
| 3632 | + { |
---|
| 3633 | + System.err.println("Undo"); |
---|
| 3634 | + |
---|
| 3635 | + cRadio tab = GetCurrentTab(); |
---|
| 3636 | + |
---|
| 3637 | + if (tab.undoindex == 0) |
---|
| 3638 | + { |
---|
| 3639 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3640 | + return; |
---|
| 3641 | + } |
---|
| 3642 | + |
---|
| 3643 | + if (tab.graphs[tab.undoindex] == null) |
---|
| 3644 | + { |
---|
| 3645 | + Save(); |
---|
| 3646 | + tab.undoindex -= 1; |
---|
| 3647 | + } |
---|
| 3648 | + |
---|
| 3649 | + tab.undoindex -= 1; |
---|
| 3650 | + |
---|
| 3651 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3652 | + } |
---|
| 3653 | + |
---|
| 3654 | + public void Redo() |
---|
| 3655 | + { |
---|
| 3656 | + cRadio tab = GetCurrentTab(); |
---|
| 3657 | + |
---|
| 3658 | + if (tab.graphs[tab.undoindex + 1] == null) |
---|
| 3659 | + { |
---|
| 3660 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 3661 | + return; |
---|
| 3662 | + } |
---|
| 3663 | + |
---|
| 3664 | + tab.undoindex += 1; |
---|
| 3665 | + |
---|
| 3666 | + CopyChanged((Object3D)Uncompress(tab.graphs[tab.undoindex])); |
---|
| 3667 | + } |
---|
| 3668 | + |
---|
| 3669 | + void ImportGFD() |
---|
| 3670 | + { |
---|
| 3671 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
3245 | 3672 | browser.show(); |
---|
3246 | 3673 | String filename = browser.getFile(); |
---|
3247 | 3674 | if (filename != null && filename.length() > 0) |
---|
3248 | 3675 | { |
---|
3249 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3676 | + String fullname = browser.getDirectory() + filename; |
---|
| 3677 | + |
---|
| 3678 | + //Object3D readobj = |
---|
| 3679 | + objEditor.ReadGFD(fullname, objEditor); |
---|
| 3680 | + //makeSomething(readobj); |
---|
| 3681 | + } |
---|
| 3682 | + } |
---|
| 3683 | + |
---|
| 3684 | + void ImportVRMLX3D() |
---|
| 3685 | + { |
---|
| 3686 | + if (Grafreed.standAlone) |
---|
| 3687 | + { |
---|
| 3688 | + /**/ |
---|
| 3689 | + FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
| 3690 | + browser.show(); |
---|
| 3691 | + String filename = browser.getFile(); |
---|
| 3692 | + if (filename != null && filename.length() > 0) |
---|
| 3693 | + { |
---|
| 3694 | + String fullname = browser.getDirectory() + filename; |
---|
| 3695 | + LoadVRMLX3D(fullname); |
---|
| 3696 | + } |
---|
| 3697 | + /**/ |
---|
| 3698 | + } |
---|
| 3699 | + } |
---|
| 3700 | + |
---|
| 3701 | + void ToggleAnimation() |
---|
| 3702 | + { |
---|
| 3703 | + if (!Globals.ANIMATION) |
---|
| 3704 | + { |
---|
| 3705 | + FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
| 3706 | + browser.setVisible(true); |
---|
| 3707 | + String filename = browser.getFile(); |
---|
| 3708 | + if (filename != null && filename.length() > 0) |
---|
| 3709 | + { |
---|
| 3710 | + Globals.filename = browser.getDirectory() + filename; |
---|
3250 | 3711 | //CameraPane.framecount = 0; |
---|
3251 | | - CameraPane.imagecount = 0; |
---|
| 3712 | + Globals.imagecount = 0; |
---|
3252 | 3713 | |
---|
3253 | | - CameraPane.ANIMATION ^= true; |
---|
| 3714 | + Globals.ANIMATION ^= true; |
---|
3254 | 3715 | |
---|
3255 | | - GrafreeD.wav.cursor = 0; |
---|
3256 | | - GrafreeD.wav.loop = 0; |
---|
| 3716 | + Grafreed.wav.cursor = 0; |
---|
| 3717 | + Grafreed.wav.loop = 0; |
---|
3257 | 3718 | } |
---|
3258 | 3719 | } else |
---|
3259 | 3720 | { |
---|
3260 | | - CameraPane.ANIMATION ^= true; |
---|
| 3721 | + Globals.ANIMATION ^= true; |
---|
3261 | 3722 | } |
---|
3262 | 3723 | } |
---|
3263 | 3724 | |
---|
.. | .. |
---|
3303 | 3764 | void CreateMaterial() |
---|
3304 | 3765 | { |
---|
3305 | 3766 | //copy.ClearMaterial(); // PATCH |
---|
3306 | | - copy.CreateMaterialS(multiplyToggle.isSelected()); |
---|
| 3767 | + copy.CreateMaterialS(multiplyToggle != null && multiplyToggle.isSelected()); |
---|
3307 | 3768 | if (copy.selection.size() > 0) |
---|
3308 | 3769 | //SetMaterial(copy); |
---|
3309 | 3770 | { |
---|
.. | .. |
---|
3354 | 3815 | assert false; |
---|
3355 | 3816 | } |
---|
3356 | 3817 | |
---|
3357 | | - void EditSelection() |
---|
| 3818 | + void EditSelection(boolean newWindow) |
---|
3358 | 3819 | { |
---|
3359 | 3820 | } |
---|
3360 | 3821 | |
---|
.. | .. |
---|
3362 | 3823 | { |
---|
3363 | 3824 | copy.ResetBlockLoop(); // temporary problem |
---|
3364 | 3825 | |
---|
3365 | | - boolean random = CameraPane.RANDOM; |
---|
3366 | | - CameraPane.RANDOM = false; // parse everything |
---|
| 3826 | + boolean random = CameraPane.SWITCH; |
---|
| 3827 | + CameraPane.SWITCH = false; // parse everything |
---|
3367 | 3828 | copy.ResetDisplayList(); |
---|
3368 | 3829 | copy.HardTouch(); |
---|
3369 | | - CameraPane.RANDOM = random; |
---|
| 3830 | + CameraPane.SWITCH = random; |
---|
3370 | 3831 | } |
---|
3371 | 3832 | |
---|
3372 | 3833 | // public void applySelf() |
---|
.. | .. |
---|
3436 | 3897 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
3437 | 3898 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
3438 | 3899 | |
---|
3439 | | - if (!NumberSlider.frozen) |
---|
| 3900 | + if (!cNumberSlider.frozen) |
---|
3440 | 3901 | { |
---|
3441 | 3902 | //System.out.println("Propagate = " + propagate); |
---|
3442 | 3903 | copy.UpdateMaterial(anchor, current, propagate); |
---|
| 3904 | + |
---|
| 3905 | + if (copy.material != null) |
---|
| 3906 | + { |
---|
| 3907 | + cMaterial mat = copy.material; |
---|
| 3908 | + |
---|
| 3909 | + colorField.SetToolTipValue((mat.color)); |
---|
| 3910 | + modulationField.SetToolTipValue((mat.modulation)); |
---|
| 3911 | + metalnessField.SetToolTipValue((mat.metalness)); |
---|
| 3912 | + diffuseField.SetToolTipValue((mat.diffuse)); |
---|
| 3913 | + specularField.SetToolTipValue((mat.specular)); |
---|
| 3914 | + shininessField.SetToolTipValue((mat.shininess)); |
---|
| 3915 | + shiftField.SetToolTipValue((mat.shift)); |
---|
| 3916 | + ambientField.SetToolTipValue((mat.ambient)); |
---|
| 3917 | + lightareaField.SetToolTipValue((mat.lightarea)); |
---|
| 3918 | + diffusenessField.SetToolTipValue((mat.factor)); |
---|
| 3919 | + velvetField.SetToolTipValue((mat.velvet)); |
---|
| 3920 | + sheenField.SetToolTipValue((mat.sheen)); |
---|
| 3921 | + subsurfaceField.SetToolTipValue((mat.subsurface)); |
---|
| 3922 | + backlitField.SetToolTipValue((mat.bump)); |
---|
| 3923 | + anisoField.SetToolTipValue((mat.aniso)); |
---|
| 3924 | + anisoVField.SetToolTipValue((mat.anisoV)); |
---|
| 3925 | + cameraField.SetToolTipValue((mat.cameralight)); |
---|
| 3926 | + selfshadowField.SetToolTipValue((mat.diffuseness)); |
---|
| 3927 | + shadowField.SetToolTipValue((mat.shadow)); |
---|
| 3928 | + textureField.SetToolTipValue((mat.texture)); |
---|
| 3929 | + opacityField.SetToolTipValue((mat.opacity)); |
---|
| 3930 | + fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
| 3931 | + shadowbiasField.SetToolTipValue((mat.shadowbias)); |
---|
| 3932 | + } |
---|
| 3933 | + |
---|
3443 | 3934 | if (copy.material != null && copy.projectedVertices.length > 0 && copy.projectedVertices[0] != null) |
---|
3444 | 3935 | { |
---|
3445 | 3936 | copy.projectedVertices[0].x = (int) (bumpField.getFloat() * 1000); |
---|
.. | .. |
---|
3484 | 3975 | || e.getSource() == apertureField |
---|
3485 | 3976 | || e.getSource() == shadowblurField) |
---|
3486 | 3977 | { |
---|
| 3978 | + new Exception().printStackTrace(); |
---|
3487 | 3979 | System.exit(0); |
---|
3488 | 3980 | cameraView.options1[0] = (float) focusField.getFloat() * 10; |
---|
3489 | 3981 | cameraView.options1[1] = (float) apertureField.getFloat() / 1000; |
---|
.. | .. |
---|
3510 | 4002 | //System.out.println("PARENT = " + parent); |
---|
3511 | 4003 | //if (parent != null) |
---|
3512 | 4004 | // parent.applySelf(); |
---|
3513 | | - refreshContents(); |
---|
| 4005 | + if (e.getSource() == normalpushField) |
---|
| 4006 | + { |
---|
| 4007 | + objEditor.refreshContents(); |
---|
| 4008 | + //Refresh(); |
---|
| 4009 | + } |
---|
| 4010 | + else |
---|
| 4011 | + refreshContents(); |
---|
3514 | 4012 | // ??? client.refreshEditWindow(); |
---|
3515 | 4013 | } |
---|
3516 | 4014 | //else |
---|
.. | .. |
---|
3522 | 4020 | //group.name = nameField.getText(); |
---|
3523 | 4021 | //objEditor.applySelf(); |
---|
3524 | 4022 | |
---|
3525 | | - assert (objEditor == this); |
---|
| 4023 | + // OCT2018: assert (objEditor == this); |
---|
3526 | 4024 | if (copy.selection == null || copy.selection.size() == 0) |
---|
3527 | 4025 | //super.applySelf() |
---|
3528 | 4026 | ; else |
---|
.. | .. |
---|
3546 | 4044 | objEditor.copy = keep; |
---|
3547 | 4045 | } |
---|
3548 | 4046 | } |
---|
| 4047 | + |
---|
| 4048 | + if (normalpushField != null) |
---|
| 4049 | + copy.NORMALPUSH = (float)normalpushField.getFloat()/100; |
---|
3549 | 4050 | } |
---|
3550 | 4051 | |
---|
3551 | 4052 | void SnapObject() |
---|
3552 | 4053 | { |
---|
3553 | | - Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
3554 | | - SnapObject(obj); |
---|
| 4054 | + if (copy.selection.size() > 0) |
---|
| 4055 | + { |
---|
| 4056 | + Object3D obj = (Object3D)copy.selection.elementAt(0); |
---|
| 4057 | + SnapObject(obj); |
---|
| 4058 | + } |
---|
3555 | 4059 | } |
---|
3556 | 4060 | |
---|
3557 | 4061 | void SnapObject(Object3D obj) |
---|
.. | .. |
---|
3797 | 4301 | |
---|
3798 | 4302 | radioPanel.revalidate(); |
---|
3799 | 4303 | radioPanel.repaint(); |
---|
3800 | | - ctrlPanel.revalidate(); // ? new |
---|
| 4304 | + ctrlPanel.validate(); // ? new |
---|
3801 | 4305 | ctrlPanel.repaint(); |
---|
3802 | 4306 | } |
---|
3803 | 4307 | } |
---|
.. | .. |
---|
3806 | 4310 | |
---|
3807 | 4311 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
3808 | 4312 | { |
---|
| 4313 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4314 | + Save(); |
---|
3809 | 4315 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
3810 | 4316 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
3811 | 4317 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
3892 | 4398 | { |
---|
3893 | 4399 | ResetModel(); |
---|
3894 | 4400 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4401 | + |
---|
| 4402 | + if (thing.Size() == 0) |
---|
| 4403 | + { |
---|
| 4404 | + //EditSelection(false); |
---|
| 4405 | + } |
---|
| 4406 | + |
---|
3895 | 4407 | refreshContents(); |
---|
3896 | 4408 | } |
---|
3897 | 4409 | |
---|
.. | .. |
---|
4009 | 4521 | } |
---|
4010 | 4522 | } |
---|
4011 | 4523 | } |
---|
| 4524 | + |
---|
4012 | 4525 | LoadGFDThread loadGFDThread; |
---|
4013 | 4526 | |
---|
4014 | 4527 | void ReadGFD(String fullname, iCallBack cb) |
---|
.. | .. |
---|
4028 | 4541 | |
---|
4029 | 4542 | try |
---|
4030 | 4543 | { |
---|
| 4544 | + // Try compressed version first. |
---|
4031 | 4545 | java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
4032 | | - java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4546 | + java.util.zip.GZIPInputStream zstream = new java.util.zip.GZIPInputStream(istream); |
---|
| 4547 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(zstream); |
---|
4033 | 4548 | |
---|
4034 | 4549 | readobj = (Object3D) p.readObject(); |
---|
4035 | 4550 | istream.close(); |
---|
.. | .. |
---|
4037 | 4552 | readobj.ResetDisplayList(); |
---|
4038 | 4553 | } catch (Exception e) |
---|
4039 | 4554 | { |
---|
4040 | | - e.printStackTrace(); |
---|
| 4555 | + //e.printStackTrace(); |
---|
| 4556 | + try |
---|
| 4557 | + { |
---|
| 4558 | + java.io.FileInputStream istream = new java.io.FileInputStream(fullname); |
---|
| 4559 | + java.io.ObjectInputStream p = new java.io.ObjectInputStream(istream); |
---|
| 4560 | + |
---|
| 4561 | + readobj = (Object3D) p.readObject(); |
---|
| 4562 | + istream.close(); |
---|
| 4563 | + |
---|
| 4564 | + readobj.ResetDisplayList(); |
---|
| 4565 | + } catch (Exception e2) |
---|
| 4566 | + { |
---|
| 4567 | + e2.printStackTrace(); |
---|
| 4568 | + } |
---|
4041 | 4569 | } |
---|
4042 | 4570 | // catch(java.io.StreamCorruptedException e) { e.printStackTrace(); } |
---|
4043 | 4571 | // catch(java.io.IOException e) { System.out.println("IOexception"); e.printStackTrace(); } |
---|
.. | .. |
---|
4083 | 4611 | |
---|
4084 | 4612 | void LoadIt(Object obj) |
---|
4085 | 4613 | { |
---|
| 4614 | + if (obj == null) |
---|
| 4615 | + { |
---|
| 4616 | + // Invalid file |
---|
| 4617 | + return; |
---|
| 4618 | + } |
---|
| 4619 | + |
---|
4086 | 4620 | System.out.println("Loaded " + obj); |
---|
4087 | 4621 | //new Exception().printStackTrace(); |
---|
4088 | 4622 | Object3D readobj = (Object3D) obj; |
---|
.. | .. |
---|
4092 | 4626 | |
---|
4093 | 4627 | if (readobj != null) |
---|
4094 | 4628 | { |
---|
| 4629 | + if (Globals.SAVEONMAKE) |
---|
| 4630 | + Save(); |
---|
4095 | 4631 | try |
---|
4096 | 4632 | { |
---|
4097 | 4633 | //readobj.deepCopySelf(copy); |
---|
.. | .. |
---|
4154 | 4690 | |
---|
4155 | 4691 | void load() // throws ClassNotFoundException |
---|
4156 | 4692 | { |
---|
4157 | | - if (GrafreeD.standAlone) |
---|
| 4693 | + if (Grafreed.standAlone) |
---|
4158 | 4694 | { |
---|
4159 | 4695 | FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); |
---|
4160 | 4696 | browser.show(); |
---|
.. | .. |
---|
4241 | 4777 | try |
---|
4242 | 4778 | { |
---|
4243 | 4779 | FileOutputStream ostream = new FileOutputStream(lastname); |
---|
4244 | | - ObjectOutputStream p = new ObjectOutputStream(ostream); |
---|
| 4780 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4781 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4245 | 4782 | |
---|
4246 | 4783 | p.writeObject(copy); |
---|
4247 | 4784 | p.flush(); |
---|
4248 | 4785 | |
---|
| 4786 | + zstream.close(); |
---|
4249 | 4787 | ostream.close(); |
---|
4250 | 4788 | |
---|
4251 | 4789 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4255 | 4793 | { |
---|
4256 | 4794 | } |
---|
4257 | 4795 | } |
---|
| 4796 | + |
---|
4258 | 4797 | String lastname; |
---|
4259 | 4798 | |
---|
4260 | 4799 | void saveAs() |
---|
4261 | 4800 | { |
---|
4262 | | - if (GrafreeD.standAlone) |
---|
| 4801 | + if (Grafreed.standAlone) |
---|
4263 | 4802 | { |
---|
4264 | 4803 | FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); |
---|
4265 | 4804 | browser.setVisible(true); |
---|
4266 | 4805 | String filename = browser.getFile(); |
---|
4267 | 4806 | if (filename != null && filename.length() > 0) |
---|
4268 | 4807 | { |
---|
| 4808 | + if (!filename.endsWith(".gfd")) |
---|
| 4809 | + filename += ".gfd"; |
---|
4269 | 4810 | lastname = browser.getDirectory() + filename; |
---|
4270 | 4811 | save(); |
---|
4271 | 4812 | } |
---|
.. | .. |
---|
4364 | 4905 | try |
---|
4365 | 4906 | { |
---|
4366 | 4907 | FileOutputStream ostream = new FileOutputStream(filename); |
---|
4367 | | - // ?? java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
4368 | | - ObjectOutputStream p = new ObjectOutputStream(/*z*/ostream); |
---|
| 4908 | + java.util.zip.GZIPOutputStream zstream = new java.util.zip.GZIPOutputStream(ostream); |
---|
| 4909 | + ObjectOutputStream p = new ObjectOutputStream(zstream); |
---|
4369 | 4910 | |
---|
4370 | 4911 | Object3D objectparent = obj.parent; |
---|
4371 | 4912 | obj.parent = null; |
---|
4372 | 4913 | |
---|
4373 | | - Object3D object = (Object3D) GrafreeD.clone(obj); |
---|
| 4914 | + Object3D object = (Object3D) Grafreed.clone(obj); |
---|
4374 | 4915 | |
---|
4375 | 4916 | obj.parent = objectparent; |
---|
4376 | 4917 | |
---|
.. | .. |
---|
4382 | 4923 | p.writeObject(object); |
---|
4383 | 4924 | p.flush(); |
---|
4384 | 4925 | |
---|
| 4926 | + zstream.close(); |
---|
4385 | 4927 | ostream.close(); |
---|
4386 | | - // zstream.close(); |
---|
4387 | 4928 | |
---|
4388 | 4929 | // group.selection.get(0).parent = parent; |
---|
4389 | 4930 | //FileOutputStream fos = new FileOutputStream(fullname); |
---|
.. | .. |
---|
4404 | 4945 | buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); |
---|
4405 | 4946 | cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); |
---|
4406 | 4947 | copy.generatePOV(buffer); |
---|
4407 | | - if (GrafreeD.standAlone) |
---|
| 4948 | + if (Grafreed.standAlone) |
---|
4408 | 4949 | { |
---|
4409 | 4950 | FileDialog browser = new FileDialog(frame, "Export POV", 1); |
---|
4410 | 4951 | browser.show(); |
---|
.. | .. |
---|
4430 | 4971 | Object3D client; |
---|
4431 | 4972 | Object3D copy; |
---|
4432 | 4973 | MenuBar menuBar; |
---|
4433 | | - Menu windowMenu; |
---|
| 4974 | + Menu fileMenu; |
---|
| 4975 | + MenuItem newItem; |
---|
4434 | 4976 | MenuItem loadItem; |
---|
4435 | 4977 | MenuItem saveItem; |
---|
4436 | 4978 | MenuItem saveAsItem; |
---|
.. | .. |
---|
4438 | 4980 | MenuItem reexportItem; |
---|
4439 | 4981 | MenuItem povItem; |
---|
4440 | 4982 | MenuItem closeItem; |
---|
4441 | | - Menu cameraMenu; |
---|
| 4983 | + |
---|
4442 | 4984 | CheckboxMenuItem zBufferItem; |
---|
4443 | 4985 | //MenuItem normalLensItem; |
---|
4444 | | - MenuItem editCameraItem; |
---|
4445 | | - MenuItem revertCameraItem; |
---|
4446 | | - CheckboxMenuItem toggleLiveItem; |
---|
4447 | 4986 | MenuItem stepItem; |
---|
4448 | | - CheckboxMenuItem toggleFullItem; |
---|
| 4987 | + CheckboxMenuItem toggleLiveItem; |
---|
| 4988 | + CheckboxMenuItem toggleFullScreenItem; |
---|
| 4989 | + CheckboxMenuItem toggleTimelineItem; |
---|
4449 | 4990 | CheckboxMenuItem toggleRenderItem; |
---|
4450 | 4991 | CheckboxMenuItem toggleDebugItem; |
---|
4451 | 4992 | CheckboxMenuItem toggleFrustumItem; |
---|
4452 | 4993 | CheckboxMenuItem toggleFootContactItem; |
---|
4453 | 4994 | CheckboxMenuItem toggleDLItem; |
---|
4454 | 4995 | CheckboxMenuItem toggleTextureItem; |
---|
4455 | | - CheckboxMenuItem toggleRandomItem; |
---|
| 4996 | + CheckboxMenuItem toggleSwitchItem; |
---|
4456 | 4997 | CheckboxMenuItem toggleRootItem; |
---|
4457 | 4998 | CheckboxMenuItem animationItem; |
---|
4458 | 4999 | CheckboxMenuItem toggleHandleItem; |
---|
4459 | 5000 | CheckboxMenuItem togglePaintItem; |
---|
4460 | 5001 | JSplitPane mainPanel; |
---|
4461 | 5002 | JScrollPane scrollpane; |
---|
| 5003 | + |
---|
4462 | 5004 | JPanel toolbarPanel; |
---|
4463 | | - JPanel treePanel; |
---|
| 5005 | + |
---|
| 5006 | + cGridBag treePanel; |
---|
| 5007 | + |
---|
4464 | 5008 | JPanel radioPanel; |
---|
4465 | 5009 | ButtonGroup buttonGroup; |
---|
4466 | | - JPanel ctrlPanel; |
---|
4467 | | - JPanel materialPanel; |
---|
| 5010 | + |
---|
| 5011 | + cGridBag toolboxPanel; |
---|
| 5012 | + cGridBag materialPanel; |
---|
| 5013 | + cGridBag ctrlPanel; |
---|
| 5014 | + |
---|
4468 | 5015 | JScrollPane infoPanel; |
---|
4469 | | - JPanel optionsPanel; |
---|
| 5016 | + |
---|
| 5017 | + cGridBag optionsPanel; |
---|
| 5018 | + |
---|
4470 | 5019 | JTabbedPane objectPanel; |
---|
4471 | | - JPanel XYZPanel; |
---|
| 5020 | + boolean materialFlushed; |
---|
| 5021 | + Object3D latestObject; |
---|
| 5022 | + |
---|
| 5023 | + cGridBag XYZPanel; |
---|
| 5024 | + |
---|
4472 | 5025 | JSplitPane gridPanel; |
---|
4473 | 5026 | JSplitPane bigPanel; |
---|
4474 | | - JPanel bigThree; |
---|
4475 | | - JTabbedPane scenePanel; |
---|
4476 | | - JPanel cameraPanel; |
---|
| 5027 | + |
---|
| 5028 | + cGridBag bigThree; |
---|
| 5029 | + cGridBag scenePanel; |
---|
| 5030 | + cGridBag centralPanel; |
---|
| 5031 | + JSplitPane cameraPanel; |
---|
| 5032 | + JPanel timelinePanel; |
---|
| 5033 | + JMenuBar timelineMenubar; |
---|
4477 | 5034 | JSplitPane framePanel; |
---|
4478 | 5035 | JTextArea/*Field*/ nameField; |
---|
4479 | | - cButton textureButton; |
---|
| 5036 | + //cButton textureButton; |
---|
4480 | 5037 | cButton okButton; |
---|
4481 | 5038 | cButton applyButton; |
---|
4482 | 5039 | cButton cancelButton; |
---|
.. | .. |
---|
4523 | 5080 | // MATERIAL |
---|
4524 | 5081 | JLabel materialLabel; |
---|
4525 | 5082 | JLabel colorLabel; |
---|
4526 | | - NumberSlider colorField; |
---|
| 5083 | + cNumberSlider colorField; |
---|
4527 | 5084 | JLabel modulationLabel; |
---|
4528 | | - NumberSlider modulationField; |
---|
| 5085 | + cNumberSlider modulationField; |
---|
4529 | 5086 | JLabel metalnessLabel; |
---|
4530 | | - NumberSlider metalnessField; |
---|
| 5087 | + cNumberSlider metalnessField; |
---|
4531 | 5088 | JLabel diffuseLabel; |
---|
4532 | | - NumberSlider diffuseField; |
---|
| 5089 | + cNumberSlider diffuseField; |
---|
4533 | 5090 | JLabel specularLabel; |
---|
4534 | | - NumberSlider specularField; |
---|
| 5091 | + cNumberSlider specularField; |
---|
4535 | 5092 | JLabel shininessLabel; |
---|
4536 | | - NumberSlider shininessField; |
---|
| 5093 | + cNumberSlider shininessField; |
---|
4537 | 5094 | JLabel shiftLabel; |
---|
4538 | | - NumberSlider shiftField; |
---|
| 5095 | + cNumberSlider shiftField; |
---|
4539 | 5096 | JLabel ambientLabel; |
---|
4540 | | - NumberSlider ambientField; |
---|
| 5097 | + cNumberSlider ambientField; |
---|
4541 | 5098 | JLabel lightareaLabel; |
---|
4542 | | - NumberSlider lightareaField; |
---|
| 5099 | + cNumberSlider lightareaField; |
---|
4543 | 5100 | JLabel diffusenessLabel; |
---|
4544 | | - NumberSlider diffusenessField; |
---|
| 5101 | + cNumberSlider diffusenessField; |
---|
4545 | 5102 | JLabel velvetLabel; |
---|
4546 | | - NumberSlider velvetField; |
---|
| 5103 | + cNumberSlider velvetField; |
---|
4547 | 5104 | JLabel sheenLabel; |
---|
4548 | | - NumberSlider sheenField; |
---|
| 5105 | + cNumberSlider sheenField; |
---|
4549 | 5106 | JLabel subsurfaceLabel; |
---|
4550 | | - NumberSlider subsurfaceField; |
---|
| 5107 | + cNumberSlider subsurfaceField; |
---|
4551 | 5108 | //JLabel bumpLabel; |
---|
4552 | 5109 | //NumberSlider bumpField; |
---|
4553 | 5110 | JLabel backlitLabel; |
---|
4554 | | - NumberSlider backlitField; |
---|
| 5111 | + cNumberSlider backlitField; |
---|
4555 | 5112 | JLabel anisoLabel; |
---|
4556 | | - NumberSlider anisoField; |
---|
| 5113 | + cNumberSlider anisoField; |
---|
4557 | 5114 | JLabel anisoVLabel; |
---|
4558 | | - NumberSlider anisoVField; |
---|
| 5115 | + cNumberSlider anisoVField; |
---|
4559 | 5116 | JLabel cameraLabel; |
---|
4560 | | - NumberSlider cameraField; |
---|
| 5117 | + cNumberSlider cameraField; |
---|
4561 | 5118 | JLabel selfshadowLabel; |
---|
4562 | | - NumberSlider selfshadowField; |
---|
| 5119 | + cNumberSlider selfshadowField; |
---|
4563 | 5120 | JLabel shadowLabel; |
---|
4564 | | - NumberSlider shadowField; |
---|
| 5121 | + cNumberSlider shadowField; |
---|
4565 | 5122 | JLabel textureLabel; |
---|
4566 | | - NumberSlider textureField; |
---|
| 5123 | + cNumberSlider textureField; |
---|
4567 | 5124 | JLabel opacityLabel; |
---|
4568 | | - NumberSlider opacityField; |
---|
| 5125 | + cNumberSlider opacityField; |
---|
4569 | 5126 | JLabel fakedepthLabel; |
---|
4570 | | - NumberSlider fakedepthField; |
---|
| 5127 | + cNumberSlider fakedepthField; |
---|
4571 | 5128 | JLabel shadowbiasLabel; |
---|
4572 | | - NumberSlider shadowbiasField; |
---|
| 5129 | + cNumberSlider shadowbiasField; |
---|
4573 | 5130 | JLabel bumpLabel; |
---|
4574 | | - NumberSlider bumpField; |
---|
| 5131 | + cNumberSlider bumpField; |
---|
4575 | 5132 | JLabel noiseLabel; |
---|
4576 | | - NumberSlider noiseField; |
---|
| 5133 | + cNumberSlider noiseField; |
---|
4577 | 5134 | JLabel powerLabel; |
---|
4578 | | - NumberSlider powerField; |
---|
| 5135 | + cNumberSlider powerField; |
---|
4579 | 5136 | JLabel borderfadeLabel; |
---|
4580 | | - NumberSlider borderfadeField; |
---|
| 5137 | + cNumberSlider borderfadeField; |
---|
4581 | 5138 | JLabel fogLabel; |
---|
4582 | | - NumberSlider fogField; |
---|
| 5139 | + cNumberSlider fogField; |
---|
4583 | 5140 | JLabel opacityPowerLabel; |
---|
4584 | | - NumberSlider opacityPowerField; |
---|
4585 | | - JTree jTree; |
---|
| 5141 | + cNumberSlider opacityPowerField; |
---|
| 5142 | + cTree jTree; |
---|
4586 | 5143 | //ObjectUI parent; |
---|
| 5144 | + |
---|
| 5145 | + cNumberSlider normalpushField; |
---|
| 5146 | + |
---|
| 5147 | + private MenuItem importGFDItem; |
---|
| 5148 | + private MenuItem importVRMLX3DItem; |
---|
| 5149 | + private MenuItem import3DSItem; |
---|
| 5150 | + private MenuItem importOBJItem; |
---|
4587 | 5151 | } |
---|