.. | .. |
---|
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 | + cCheckBox GetCheckBox(String name, boolean border) |
---|
| 56 | + { |
---|
| 57 | + try |
---|
| 58 | + { |
---|
| 59 | + ImageIcon icon = GetIcon(name); |
---|
| 60 | + return new cCheckBox(icon, border); |
---|
| 61 | + } |
---|
| 62 | + catch (Exception e) |
---|
| 63 | + { |
---|
| 64 | + return new cCheckBox(name, border); |
---|
| 65 | + } |
---|
| 66 | + } |
---|
| 67 | + |
---|
| 68 | + private ImageIcon GetIcon(String name) throws IOException |
---|
| 69 | + { |
---|
| 70 | + BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name)); |
---|
| 71 | + |
---|
| 72 | + if (image.getWidth() != 24 && image.getHeight() != 24) |
---|
| 73 | + { |
---|
| 74 | + BufferedImage resized = new BufferedImage(24, 24, image.getType()); |
---|
| 75 | + Graphics2D g = resized.createGraphics(); |
---|
| 76 | + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); |
---|
| 77 | + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
---|
| 78 | + g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null); |
---|
| 79 | + g.dispose(); |
---|
| 80 | + |
---|
| 81 | + image = resized; |
---|
| 82 | + } |
---|
| 83 | + |
---|
| 84 | + javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image); |
---|
| 85 | + return icon; |
---|
| 86 | + } |
---|
40 | 87 | |
---|
41 | 88 | // SCRIPT |
---|
42 | 89 | |
---|
.. | .. |
---|
3408 | 3455 | |
---|
3409 | 3456 | public void Save() |
---|
3410 | 3457 | { |
---|
| 3458 | + System.err.println("Save"); |
---|
| 3459 | + |
---|
3411 | 3460 | cRadio tab = GetCurrentTab(); |
---|
3412 | 3461 | |
---|
3413 | 3462 | boolean temp = CameraPane.SWITCH; |
---|
.. | .. |
---|
3492 | 3541 | |
---|
3493 | 3542 | public void Undo() |
---|
3494 | 3543 | { |
---|
| 3544 | + System.err.println("Undo"); |
---|
| 3545 | + |
---|
3495 | 3546 | cRadio tab = GetCurrentTab(); |
---|
3496 | 3547 | |
---|
3497 | 3548 | if (tab.undoindex == 0) |
---|
.. | .. |
---|
4170 | 4221 | |
---|
4171 | 4222 | void makeSomething(Object3D thing, boolean resetmodel) // deselect) |
---|
4172 | 4223 | { |
---|
4173 | | - Save(); |
---|
| 4224 | + if (Globals.SAVEONMAKE) |
---|
| 4225 | + Save(); |
---|
4174 | 4226 | //Tween.set(thing, 0).target(1).start(tweenManager); |
---|
4175 | 4227 | //Tween.to(thing, 0, 0.5f).target(0).start(tweenManager); |
---|
4176 | 4228 | // if (thing instanceof GenericJointDemo) |
---|
.. | .. |
---|
4479 | 4531 | |
---|
4480 | 4532 | if (readobj != null) |
---|
4481 | 4533 | { |
---|
| 4534 | + if (Globals.SAVEONMAKE) |
---|
4482 | 4535 | Save(); |
---|
4483 | 4536 | try |
---|
4484 | 4537 | { |
---|