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"));
....@@ -1189,6 +1193,13 @@
11891193 timelinePanel = new JPanel(new BorderLayout());
11901194 timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel);
11911195
1196
+ cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel);
1197
+ cameraPanel.setContinuousLayout(true);
1198
+ cameraPanel.setOneTouchExpandable(true);
1199
+// cameraPanel.setDividerLocation(0.9);
1200
+// cameraPanel.setDividerSize(9);
1201
+ cameraPanel.setResizeWeight(1.0);
1202
+
11921203 centralPanel.add(cameraView);
11931204 //frame.setJMenuBar(timelineMenubar);
11941205 //centralPanel.add(timelinePanel);
....@@ -1208,12 +1219,12 @@
12081219 //frontView.object = copy;
12091220 //sideView.object = copy;
12101221
1211
- XYZPanel = new JPanel();
1212
- XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
1222
+ XYZPanel = new cGridBag().setVertical(true);
1223
+ //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5));
12131224
1214
- XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll);
1215
- XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll);
1216
- 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);
12171228
12181229 /*
12191230 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1283,6 +1294,9 @@
12831294 optionsPanel = new JPanel(new GridBagLayout());
12841295
12851296 optionsPanel.setName("Options");
1297
+
1298
+ AddOptions(optionsPanel, aConstraints);
1299
+
12861300 scenePanel.add(optionsPanel);
12871301
12881302
....@@ -1318,6 +1332,7 @@
13181332 //bigPanel.setSize(new Dimension(10,10));
13191333 //bigPanel.add(ctrlPanel);
13201334 //bigPanel.add(gridPanel);
1335
+ /**
13211336 bigThree = new JPanel();
13221337 //big.setLayout(new FlowLayout(FlowLayout.LEFT));
13231338 bigThree.setLayout(new GridBagLayout()); //1,3,5,5));
....@@ -1341,7 +1356,13 @@
13411356 // aConstraints.gridheight = 3;
13421357 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
13431358 bigThree.add(XYZPanel, aWindowConstraints);
1359
+ /**/
13441360
1361
+ bigThree = new cGridBag();
1362
+ bigThree.addComponent(scenePanel);
1363
+ bigThree.addComponent(centralPanel);
1364
+ bigThree.addComponent(XYZPanel);
1365
+
13451366 // // SIDE EFFECT!!!
13461367 // aConstraints.gridx = 0;
13471368 // aConstraints.gridy = 0;
....@@ -1362,7 +1383,8 @@
13621383 //worldPane.add(bigPanel);
13631384 //worldPane.add(worldPanel);
13641385 /**/
1365
- frame.getContentPane().add(/*"Center",*/framePanel);
1386
+ //frame.getContentPane().add(/*"Center",*/framePanel);
1387
+ frame.add(/*"Center",*/framePanel);
13661388 //frame.getContentPane().add(/*"Center",*/ worldPane);
13671389
13681390 // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
....@@ -1383,6 +1405,10 @@
13831405 });
13841406 }
13851407
1408
+ void AddOptions(JPanel panel, GridBagConstraints constraints)
1409
+ {
1410
+ }
1411
+
13861412 JTree GetTree()
13871413 {
13881414 return objEditor.jTree;
....@@ -2996,7 +3022,8 @@
29963022 if (timeline)
29973023 {
29983024 centralPanel.remove(cameraView);
2999
- centralPanel.add(timelinePanel);
3025
+ cameraPanel.add(cameraView);
3026
+ centralPanel.add(cameraPanel);
30003027 frame.setJMenuBar(timelineMenubar);
30013028 wasFullScreen = CameraPane.FULLSCREEN;
30023029 if (!CameraPane.FULLSCREEN)
....@@ -3005,7 +3032,7 @@
30053032 }
30063033 else
30073034 {
3008
- centralPanel.remove(timelinePanel);
3035
+ centralPanel.remove(cameraPanel);
30093036 centralPanel.add(cameraView);
30103037 frame.setJMenuBar(null);
30113038 if (!wasFullScreen)
....@@ -3128,7 +3155,8 @@
31283155 objEditor.refreshContents();
31293156 } else if (event.getSource() == stepItem)
31303157 {
3131
- cameraView.ONESTEP = true;
3158
+ //cameraView.ONESTEP = true;
3159
+ Globals.ONESTEP = true;
31323160 cameraView.repaint();
31333161 return;
31343162 } else if (event.getSource() == stepButton)
....@@ -3285,25 +3313,25 @@
32853313
32863314 void ToggleAnimation()
32873315 {
3288
- if (!CameraPane.ANIMATION)
3316
+ if (!Globals.ANIMATION)
32893317 {
32903318 FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE);
32913319 browser.show();
32923320 String filename = browser.getFile();
32933321 if (filename != null && filename.length() > 0)
32943322 {
3295
- CameraPane.filename = browser.getDirectory() + filename;
3323
+ Globals.filename = browser.getDirectory() + filename;
32963324 //CameraPane.framecount = 0;
3297
- CameraPane.imagecount = 0;
3325
+ Globals.imagecount = 0;
32983326
3299
- CameraPane.ANIMATION ^= true;
3327
+ Globals.ANIMATION ^= true;
33003328
33013329 GrafreeD.wav.cursor = 0;
33023330 GrafreeD.wav.loop = 0;
33033331 }
33043332 } else
33053333 {
3306
- CameraPane.ANIMATION ^= true;
3334
+ Globals.ANIMATION ^= true;
33073335 }
33083336 }
33093337
....@@ -4527,12 +4555,13 @@
45274555 JScrollPane infoPanel;
45284556 JPanel optionsPanel;
45294557 JTabbedPane objectPanel;
4530
- JPanel XYZPanel;
4558
+ cGridBag XYZPanel;
45314559 JSplitPane gridPanel;
45324560 JSplitPane bigPanel;
4533
- JPanel bigThree;
4561
+ cGridBag bigThree;
45344562 JTabbedPane scenePanel;
45354563 JPanel centralPanel;
4564
+ JSplitPane cameraPanel;
45364565 JPanel timelinePanel;
45374566 JMenuBar timelineMenubar;
45384567 JSplitPane framePanel;