.. | .. |
---|
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.*; |
---|
.. | .. |
---|
37 | 38 | JFrame frame; |
---|
38 | 39 | |
---|
39 | 40 | static ObjEditor theFrame; |
---|
| 41 | + |
---|
| 42 | + cButton GetButton(String name, boolean border) |
---|
| 43 | + { |
---|
| 44 | + try |
---|
| 45 | + { |
---|
| 46 | + ImageIcon icon = GetIcon(name); |
---|
| 47 | + return new cButton(icon, border); |
---|
| 48 | + } |
---|
| 49 | + catch (Exception e) |
---|
| 50 | + { |
---|
| 51 | + return new cButton(name, border); |
---|
| 52 | + } |
---|
| 53 | + } |
---|
| 54 | + |
---|
| 55 | + cToggleButton GetToggleButton(String name, boolean border) |
---|
| 56 | + { |
---|
| 57 | + try |
---|
| 58 | + { |
---|
| 59 | + ImageIcon icon = GetIcon(name); |
---|
| 60 | + return new cToggleButton(icon, border); |
---|
| 61 | + } |
---|
| 62 | + catch (Exception e) |
---|
| 63 | + { |
---|
| 64 | + return new cToggleButton(name, border); |
---|
| 65 | + } |
---|
| 66 | + } |
---|
| 67 | + |
---|
| 68 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 69 | + { |
---|
| 70 | + try |
---|
| 71 | + { |
---|
| 72 | + ImageIcon icon = GetIcon(name); |
---|
| 73 | + return new cCheckBox(icon, border); |
---|
| 74 | + } |
---|
| 75 | + catch (Exception e) |
---|
| 76 | + { |
---|
| 77 | + return new cCheckBox(name, border); |
---|
| 78 | + } |
---|
| 79 | + } |
---|
| 80 | + |
---|
| 81 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 82 | + { |
---|
| 83 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 84 | + |
---|
| 85 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 86 | + { |
---|
| 87 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 88 | + Graphics2D g = resized.createGraphics(); |
---|
| 89 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 90 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 91 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 92 | + g.dispose(); |
---|
| 93 | + |
---|
| 94 | + image = resized; |
---|
| 95 | + } |
---|
| 96 | + |
---|
| 97 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 98 | + return icon; |
---|
| 99 | + } |
---|
40 | 100 | |
---|
41 | 101 | // SCRIPT |
---|
42 | 102 | |
---|
.. | .. |
---|
337 | 397 | editPanel.add(editCommandsPanel); |
---|
338 | 398 | editPanel.add(ctrlPanel); |
---|
339 | 399 | |
---|
340 | | - materialPanel = new cGridBag().setVertical(true); |
---|
| 400 | + toolboxPanel = new cGridBag().setVertical(false); |
---|
| 401 | + toolboxPanel.setName("Toolbox"); |
---|
341 | 402 | |
---|
| 403 | + materialPanel = new cGridBag().setVertical(true); |
---|
342 | 404 | materialPanel.setName("Material"); |
---|
| 405 | + |
---|
343 | 406 | /*JTextPane*/ |
---|
344 | 407 | infoarea = createTextPane(); |
---|
345 | 408 | doc = infoarea.getStyledDocument(); |
---|
.. | .. |
---|
612 | 675 | |
---|
613 | 676 | boolean maximized; |
---|
614 | 677 | |
---|
| 678 | + cButton fullscreenLayout; |
---|
| 679 | + |
---|
615 | 680 | void Minimize() |
---|
616 | 681 | { |
---|
617 | 682 | frame.setState(Frame.ICONIFIED); |
---|
.. | .. |
---|
673 | 738 | // X frame.getContentPane().add(/*"Center",*/bigThree); |
---|
674 | 739 | framePanel.setDividerLocation(0); |
---|
675 | 740 | |
---|
676 | | - radio.layout = twoButton; |
---|
| 741 | + radio.layout = fullscreenLayout; |
---|
677 | 742 | radio.layout.doClick(); |
---|
678 | 743 | //frame.setVisible(true); |
---|
679 | 744 | } |
---|
.. | .. |
---|
1347 | 1412 | |
---|
1348 | 1413 | //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
---|
1349 | 1414 | //tmp.setName("Edit"); |
---|
| 1415 | + objectPanel.add(toolboxPanel); |
---|
1350 | 1416 | objectPanel.add(materialPanel); |
---|
1351 | 1417 | // JPanel north = new JPanel(new BorderLayout()); |
---|
1352 | 1418 | // north.setName("Edit"); |
---|
.. | .. |
---|
3408 | 3474 | |
---|
3409 | 3475 | public void Save() |
---|
3410 | 3476 | { |
---|
| 3477 | + System.err.println("Save"); |
---|
| 3478 | + |
---|
3411 | 3479 | cRadio tab = GetCurrentTab(); |
---|
3412 | 3480 | |
---|
3413 | 3481 | boolean temp = CameraPane.SWITCH; |
---|
.. | .. |
---|
3492 | 3560 | |
---|
3493 | 3561 | public void Undo() |
---|
3494 | 3562 | { |
---|
| 3563 | + System.err.println("Undo"); |
---|
| 3564 | + |
---|
3495 | 3565 | cRadio tab = GetCurrentTab(); |
---|
3496 | 3566 | |
---|
3497 | 3567 | if (tab.undoindex == 0) |
---|
.. | .. |
---|
3675 | 3745 | assert false; |
---|
3676 | 3746 | } |
---|
3677 | 3747 | |
---|
3678 | | - void EditSelection() |
---|
| 3748 | + void EditSelection(boolean newWindow) |
---|
3679 | 3749 | { |
---|
3680 | 3750 | } |
---|
3681 | 3751 | |
---|
.. | .. |
---|
4170 | 4240 | |
---|
4171 | 4241 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4172 | 4242 | { |
---|
4173 | | - Save(); |
---|
| 4243 | + if (Globals.SAVEONMAKE) // && resetmodel) |
---|
| 4244 | + Save(); |
---|
4174 | 4245 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4175 | 4246 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
4176 | 4247 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4257 | 4328 | { |
---|
4258 | 4329 | ResetModel(); |
---|
4259 | 4330 | Select(thing.GetTreePath(), true, false); // unselect... false); |
---|
| 4331 | + |
---|
| 4332 | + if (thing.Size() == 0) |
---|
| 4333 | + { |
---|
| 4334 | + //EditSelection(false); |
---|
| 4335 | + } |
---|
| 4336 | + |
---|
4260 | 4337 | refreshContents(); |
---|
4261 | 4338 | } |
---|
4262 | 4339 | |
---|
.. | .. |
---|
4479 | 4556 | |
---|
4480 | 4557 | if (readobj != null) |
---|
4481 | 4558 | { |
---|
| 4559 | + if (Globals.SAVEONMAKE) |
---|
4482 | 4560 | Save(); |
---|
4483 | 4561 | try |
---|
4484 | 4562 | { |
---|
.. | .. |
---|
4850 | 4928 | CheckboxMenuItem togglePaintItem; |
---|
4851 | 4929 | JSplitPane mainPanel; |
---|
4852 | 4930 | JScrollPane scrollpane; |
---|
| 4931 | + |
---|
4853 | 4932 | JPanel toolbarPanel; |
---|
| 4933 | + |
---|
4854 | 4934 | cGridBag treePanel; |
---|
| 4935 | + |
---|
4855 | 4936 | JPanel radioPanel; |
---|
4856 | 4937 | ButtonGroup buttonGroup; |
---|
4857 | | - cGridBag ctrlPanel; |
---|
| 4938 | + |
---|
| 4939 | + cGridBag toolboxPanel; |
---|
4858 | 4940 | cGridBag materialPanel; |
---|
| 4941 | + cGridBag ctrlPanel; |
---|
| 4942 | + |
---|
4859 | 4943 | JScrollPane infoPanel; |
---|
| 4944 | + |
---|
4860 | 4945 | cGridBag optionsPanel; |
---|
| 4946 | + |
---|
4861 | 4947 | JTabbedPane objectPanel; |
---|
| 4948 | + |
---|
4862 | 4949 | cGridBag XYZPanel; |
---|
| 4950 | + |
---|
4863 | 4951 | JSplitPane gridPanel; |
---|
4864 | 4952 | JSplitPane bigPanel; |
---|
| 4953 | + |
---|
4865 | 4954 | cGridBag bigThree; |
---|
4866 | 4955 | cGridBag scenePanel; |
---|
4867 | 4956 | cGridBag centralPanel; |
---|
.. | .. |
---|
4976 | 5065 | cNumberSlider fogField; |
---|
4977 | 5066 | JLabel opacityPowerLabel; |
---|
4978 | 5067 | cNumberSlider opacityPowerField; |
---|
4979 | | - JTree jTree; |
---|
| 5068 | + cTree jTree; |
---|
4980 | 5069 | //ObjectUI parent; |
---|
4981 | 5070 | |
---|
4982 | 5071 | cNumberSlider normalpushField; |
---|