Normand Briere
2019-04-29 bed42c663d286d76a32f155049f9efabc2fdb73f
ObjEditor.java
....@@ -19,6 +19,8 @@
1919 import //weka.core.
2020 matrix.Matrix;
2121
22
+import grafeme.ui.*;
23
+
2224 class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI,
2325 ActionListener, ChangeListener,
2426 InputMethodListener,
....@@ -31,6 +33,9 @@
3133 boolean timeline;
3234 boolean wasFullScreen;
3335
36
+ GroupEditor callee;
37
+ JFrame frame;
38
+
3439 // SCRIPT
3540
3641 transient JFrame textpanel = null;
....@@ -121,14 +126,13 @@
121126 void keyPressed(int key, int modifiers)
122127 {
123128 System.out.println("KEY PRESSED");
124
- CameraPane.theRenderer.keyPressed(key, modifiers);
129
+ Globals.theRenderer.keyPressed(key, modifiers);
125130 }
126131 */
127132
128133 static GridBagConstraints aConstraints;
129134 static GridBagConstraints aWindowConstraints;
130
- GroupEditor callee;
131
- JFrame frame;
135
+
132136 static int GRIDWIDTH = 100; // 4;
133137
134138 public void closeUI()
....@@ -309,7 +313,7 @@
309313 toggleTextureItem.setState(CameraPane.textureon);
310314 cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
311315 toggleLiveItem.addItemListener(this);
312
- toggleLiveItem.setState(CameraPane.isLIVE());
316
+ toggleLiveItem.setState(Globals.isLIVE());
313317 cameraMenu.add(stepItem = new MenuItem("Step"));
314318 stepItem.addActionListener(this);
315319 // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
....@@ -1215,12 +1219,12 @@
12151219 //frontView.object = copy;
12161220 //sideView.object = copy;
12171221
1218
- XYZPanel = new JPanel();
1219
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1222
+ XYZPanel = new cGridBag().setVertical(true);
1223
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12201224
1221
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1222
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1223
- XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll);
1225
+ XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1226
+ XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
1227
+ XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
12241228
12251229 /*
12261230 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1290,6 +1294,9 @@
12901294 optionsPanel = new JPanel(new GridBagLayout());
12911295
12921296 optionsPanel.setName("Options");
1297
+
1298
+ AddOptions(optionsPanel, aConstraints);
1299
+
12931300 scenePanel.add(optionsPanel);
12941301
12951302
....@@ -1325,6 +1332,7 @@
13251332 //bigPanel.setSize(new Dimension(10,10));
13261333 //bigPanel.add(ctrlPanel);
13271334 //bigPanel.add(gridPanel);
1335
+ /**
13281336 bigThree = new JPanel();
13291337 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13301338 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1348,7 +1356,13 @@
13481356 // aConstraints.gridheight = 3;
13491357 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13501358 bigThree.add(XYZPanel, aWindowConstraints);
1359
+ /**/
13511360
1361
+ bigThree = new cGridBag();
1362
+ bigThree.addComponent(scenePanel);
1363
+ bigThree.addComponent(centralPanel);
1364
+ bigThree.addComponent(XYZPanel);
1365
+
13521366 // // SIDE EFFECT!!!
13531367 // aConstraints.gridx = 0;
13541368 // aConstraints.gridy = 0;
....@@ -1369,7 +1383,8 @@
13691383 //worldPane.add(bigPanel);
13701384 //worldPane.add(worldPanel);
13711385 /**/
1372
- frame.getContentPane().add(/*"Center",*/framePanel);
1386
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1387
+ frame.add(/*"Center",*/framePanel);
13731388 //frame.getContentPane().add(/*"Center",*/ worldPane);
13741389
13751390 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
....@@ -1390,6 +1405,10 @@
13901405 });
13911406 }
13921407
1408
+ void AddOptions(JPanel panel, GridBagConstraints constraints)
1409
+ {
1410
+ }
1411
+
13931412 JTree GetTree()
13941413 {
13951414 return objEditor.jTree;
....@@ -3136,7 +3155,8 @@
31363155 objEditor.refreshContents();
31373156 } else if (event.getSource() == stepItem)
31383157 {
3139
- cameraView.ONESTEP = true;
3158
+ //cameraView.ONESTEP = true;
3159
+ Globals.ONESTEP = true;
31403160 cameraView.repaint();
31413161 return;
31423162 } else if (event.getSource() == stepButton)
....@@ -3293,25 +3313,25 @@
32933313
32943314 void ToggleAnimation()
32953315 {
3296
- if (!CameraPane.ANIMATION)
3316
+ if (!Globals.ANIMATION)
32973317 {
32983318 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
32993319 browser.show();
33003320 String filename = browser.getFile();
33013321 if (filename != null && filename.length() > 0)
33023322 {
3303
- CameraPane.filename = browser.getDirectory() + filename;
3323
+ Globals.filename = browser.getDirectory() + filename;
33043324 //CameraPane.framecount = 0;
3305
- CameraPane.imagecount = 0;
3325
+ Globals.imagecount = 0;
33063326
3307
- CameraPane.ANIMATION ^= true;
3327
+ Globals.ANIMATION ^= true;
33083328
33093329 GrafreeD.wav.cursor = 0;
33103330 GrafreeD.wav.loop = 0;
33113331 }
33123332 } else
33133333 {
3314
- CameraPane.ANIMATION ^= true;
3334
+ Globals.ANIMATION ^= true;
33153335 }
33163336 }
33173337
....@@ -4535,10 +4555,10 @@
45354555 JScrollPane infoPanel;
45364556 JPanel optionsPanel;
45374557 JTabbedPane objectPanel;
4538
- JPanel XYZPanel;
4558
+ cGridBag XYZPanel;
45394559 JSplitPane gridPanel;
45404560 JSplitPane bigPanel;
4541
- JPanel bigThree;
4561
+ cGridBag bigThree;
45424562 JTabbedPane scenePanel;
45434563 JPanel centralPanel;
45444564 JSplitPane cameraPanel;