.. | .. |
---|
19 | 19 | import //weka.core. |
---|
20 | 20 | matrix.Matrix; |
---|
21 | 21 | |
---|
| 22 | +import grafeme.ui.*; |
---|
| 23 | + |
---|
22 | 24 | class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, |
---|
23 | 25 | ActionListener, ChangeListener, |
---|
24 | 26 | InputMethodListener, |
---|
.. | .. |
---|
31 | 33 | boolean timeline; |
---|
32 | 34 | boolean wasFullScreen; |
---|
33 | 35 | |
---|
| 36 | + GroupEditor callee; |
---|
| 37 | + JFrame frame; |
---|
| 38 | + |
---|
34 | 39 | // SCRIPT |
---|
35 | 40 | |
---|
36 | 41 | transient JFrame textpanel = null; |
---|
.. | .. |
---|
121 | 126 | void keyPressed(int key, int modifiers) |
---|
122 | 127 | { |
---|
123 | 128 | System.out.println("KEY PRESSED"); |
---|
124 | | - CameraPane.theRenderer.keyPressed(key, modifiers); |
---|
| 129 | + Globals.theRenderer.keyPressed(key, modifiers); |
---|
125 | 130 | } |
---|
126 | 131 | */ |
---|
127 | 132 | |
---|
128 | 133 | static GridBagConstraints aConstraints; |
---|
129 | 134 | static GridBagConstraints aWindowConstraints; |
---|
130 | | - GroupEditor callee; |
---|
131 | | - JFrame frame; |
---|
| 135 | + |
---|
132 | 136 | static int GRIDWIDTH = 100; // 4; |
---|
133 | 137 | |
---|
134 | 138 | public void closeUI() |
---|
.. | .. |
---|
309 | 313 | toggleTextureItem.setState(CameraPane.textureon); |
---|
310 | 314 | cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
311 | 315 | toggleLiveItem.addItemListener(this); |
---|
312 | | - toggleLiveItem.setState(CameraPane.isLIVE()); |
---|
| 316 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
313 | 317 | cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
314 | 318 | stepItem.addActionListener(this); |
---|
315 | 319 | // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
.. | .. |
---|
1189 | 1193 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1190 | 1194 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1191 | 1195 | |
---|
| 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 | + |
---|
1192 | 1203 | centralPanel.add(cameraView); |
---|
1193 | 1204 | //frame.setJMenuBar(timelineMenubar); |
---|
1194 | 1205 | //centralPanel.add(timelinePanel); |
---|
.. | .. |
---|
1208 | 1219 | //frontView.object = copy; |
---|
1209 | 1220 | //sideView.object = copy; |
---|
1210 | 1221 | |
---|
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)); |
---|
1213 | 1224 | |
---|
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); |
---|
1217 | 1228 | |
---|
1218 | 1229 | /* |
---|
1219 | 1230 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1283 | 1294 | optionsPanel = new JPanel(new GridBagLayout()); |
---|
1284 | 1295 | |
---|
1285 | 1296 | optionsPanel.setName("Options"); |
---|
| 1297 | + |
---|
| 1298 | + AddOptions(optionsPanel, aConstraints); |
---|
| 1299 | + |
---|
1286 | 1300 | scenePanel.add(optionsPanel); |
---|
1287 | 1301 | |
---|
1288 | 1302 | |
---|
.. | .. |
---|
1318 | 1332 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1319 | 1333 | //bigPanel.add(ctrlPanel); |
---|
1320 | 1334 | //bigPanel.add(gridPanel); |
---|
| 1335 | + /** |
---|
1321 | 1336 | bigThree = new JPanel(); |
---|
1322 | 1337 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1323 | 1338 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1341 | 1356 | // aConstraints.gridheight = 3; |
---|
1342 | 1357 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1343 | 1358 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1359 | + /**/ |
---|
1344 | 1360 | |
---|
| 1361 | + bigThree = new cGridBag(); |
---|
| 1362 | + bigThree.addComponent(scenePanel); |
---|
| 1363 | + bigThree.addComponent(centralPanel); |
---|
| 1364 | + bigThree.addComponent(XYZPanel); |
---|
| 1365 | + |
---|
1345 | 1366 | // // SIDE EFFECT!!! |
---|
1346 | 1367 | // aConstraints.gridx = 0; |
---|
1347 | 1368 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1362 | 1383 | //worldPane.add(bigPanel); |
---|
1363 | 1384 | //worldPane.add(worldPanel); |
---|
1364 | 1385 | /**/ |
---|
1365 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1386 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1387 | + frame.add(/*"Center",*/framePanel); |
---|
1366 | 1388 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1367 | 1389 | |
---|
1368 | 1390 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
.. | .. |
---|
1383 | 1405 | }); |
---|
1384 | 1406 | } |
---|
1385 | 1407 | |
---|
| 1408 | + void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 1409 | + { |
---|
| 1410 | + } |
---|
| 1411 | + |
---|
1386 | 1412 | JTree GetTree() |
---|
1387 | 1413 | { |
---|
1388 | 1414 | return objEditor.jTree; |
---|
.. | .. |
---|
2996 | 3022 | if (timeline) |
---|
2997 | 3023 | { |
---|
2998 | 3024 | centralPanel.remove(cameraView); |
---|
2999 | | - centralPanel.add(timelinePanel); |
---|
| 3025 | + cameraPanel.add(cameraView); |
---|
| 3026 | + centralPanel.add(cameraPanel); |
---|
3000 | 3027 | frame.setJMenuBar(timelineMenubar); |
---|
3001 | 3028 | wasFullScreen = CameraPane.FULLSCREEN; |
---|
3002 | 3029 | if (!CameraPane.FULLSCREEN) |
---|
.. | .. |
---|
3005 | 3032 | } |
---|
3006 | 3033 | else |
---|
3007 | 3034 | { |
---|
3008 | | - centralPanel.remove(timelinePanel); |
---|
| 3035 | + centralPanel.remove(cameraPanel); |
---|
3009 | 3036 | centralPanel.add(cameraView); |
---|
3010 | 3037 | frame.setJMenuBar(null); |
---|
3011 | 3038 | if (!wasFullScreen) |
---|
.. | .. |
---|
3128 | 3155 | objEditor.refreshContents(); |
---|
3129 | 3156 | } else if (event.getSource() == stepItem) |
---|
3130 | 3157 | { |
---|
3131 | | - cameraView.ONESTEP = true; |
---|
| 3158 | + //cameraView.ONESTEP = true; |
---|
| 3159 | + Globals.ONESTEP = true; |
---|
3132 | 3160 | cameraView.repaint(); |
---|
3133 | 3161 | return; |
---|
3134 | 3162 | } else if (event.getSource() == stepButton) |
---|
.. | .. |
---|
3285 | 3313 | |
---|
3286 | 3314 | void ToggleAnimation() |
---|
3287 | 3315 | { |
---|
3288 | | - if (!CameraPane.ANIMATION) |
---|
| 3316 | + if (!Globals.ANIMATION) |
---|
3289 | 3317 | { |
---|
3290 | 3318 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3291 | 3319 | browser.show(); |
---|
3292 | 3320 | String filename = browser.getFile(); |
---|
3293 | 3321 | if (filename != null && filename.length() > 0) |
---|
3294 | 3322 | { |
---|
3295 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3323 | + Globals.filename = browser.getDirectory() + filename; |
---|
3296 | 3324 | //CameraPane.framecount = 0; |
---|
3297 | | - CameraPane.imagecount = 0; |
---|
| 3325 | + Globals.imagecount = 0; |
---|
3298 | 3326 | |
---|
3299 | | - CameraPane.ANIMATION ^= true; |
---|
| 3327 | + Globals.ANIMATION ^= true; |
---|
3300 | 3328 | |
---|
3301 | 3329 | GrafreeD.wav.cursor = 0; |
---|
3302 | 3330 | GrafreeD.wav.loop = 0; |
---|
3303 | 3331 | } |
---|
3304 | 3332 | } else |
---|
3305 | 3333 | { |
---|
3306 | | - CameraPane.ANIMATION ^= true; |
---|
| 3334 | + Globals.ANIMATION ^= true; |
---|
3307 | 3335 | } |
---|
3308 | 3336 | } |
---|
3309 | 3337 | |
---|
.. | .. |
---|
4527 | 4555 | JScrollPane infoPanel; |
---|
4528 | 4556 | JPanel optionsPanel; |
---|
4529 | 4557 | JTabbedPane objectPanel; |
---|
4530 | | - JPanel XYZPanel; |
---|
| 4558 | + cGridBag XYZPanel; |
---|
4531 | 4559 | JSplitPane gridPanel; |
---|
4532 | 4560 | JSplitPane bigPanel; |
---|
4533 | | - JPanel bigThree; |
---|
| 4561 | + cGridBag bigThree; |
---|
4534 | 4562 | JTabbedPane scenePanel; |
---|
4535 | 4563 | JPanel centralPanel; |
---|
| 4564 | + JSplitPane cameraPanel; |
---|
4536 | 4565 | JPanel timelinePanel; |
---|
4537 | 4566 | JMenuBar timelineMenubar; |
---|
4538 | 4567 | JSplitPane framePanel; |
---|