.. | .. |
---|
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")); |
---|
.. | .. |
---|
1185 | 1189 | //JPanel worldPanel = |
---|
1186 | 1190 | // new gov.nasa.worldwind.examples.ApplicationTemplate.AppPanel(null, true); |
---|
1187 | 1191 | //worldPanel.setName("World"); |
---|
1188 | | - centralPanel = new JPanel(new BorderLayout()); |
---|
| 1192 | + centralPanel = new cGridBag(); |
---|
| 1193 | + centralPanel.preferredWidth = 20; |
---|
1189 | 1194 | timelinePanel = new JPanel(new BorderLayout()); |
---|
1190 | 1195 | timelineMenubar = new timeflow.app.TimeflowApp().TimeFlowWindow(timelinePanel); |
---|
1191 | 1196 | |
---|
| 1197 | + cameraPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cameraView, timelinePanel); |
---|
| 1198 | + cameraPanel.setContinuousLayout(true); |
---|
| 1199 | + cameraPanel.setOneTouchExpandable(true); |
---|
| 1200 | +// cameraPanel.setDividerLocation(0.9); |
---|
| 1201 | +// cameraPanel.setDividerSize(9); |
---|
| 1202 | + cameraPanel.setResizeWeight(1.0); |
---|
| 1203 | + |
---|
1192 | 1204 | centralPanel.add(cameraView); |
---|
1193 | 1205 | //frame.setJMenuBar(timelineMenubar); |
---|
1194 | 1206 | //centralPanel.add(timelinePanel); |
---|
.. | .. |
---|
1208 | 1220 | //frontView.object = copy; |
---|
1209 | 1221 | //sideView.object = copy; |
---|
1210 | 1222 | |
---|
1211 | | - XYZPanel = new JPanel(); |
---|
1212 | | - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
| 1223 | + XYZPanel = new cGridBag().setVertical(true); |
---|
| 1224 | + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); |
---|
1213 | 1225 | |
---|
1214 | | - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
1215 | | - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
1216 | | - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
| 1226 | + XYZPanel.preferredWidth = 5; |
---|
| 1227 | + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); |
---|
| 1228 | + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); |
---|
| 1229 | + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); |
---|
1217 | 1230 | |
---|
1218 | 1231 | /* |
---|
1219 | 1232 | gridPanel = new JPanel(); //new BorderLayout()); |
---|
.. | .. |
---|
1275 | 1288 | scrollpane.setWheelScrollingEnabled(true); |
---|
1276 | 1289 | scrollpane.addMouseWheelListener(this); // Default not fast enough |
---|
1277 | 1290 | |
---|
1278 | | - /*JTabbedPane*/ scenePanel = new JTabbedPane(); |
---|
1279 | | - scenePanel.add(scrollpane); |
---|
| 1291 | + /*JTabbedPane*/ scenePanel = new cGridBag(); |
---|
| 1292 | + scenePanel.preferredWidth = 7; |
---|
| 1293 | + |
---|
| 1294 | + JTabbedPane tabbedPane = new JTabbedPane(); |
---|
| 1295 | + tabbedPane.add(scrollpane); |
---|
1280 | 1296 | |
---|
1281 | | - scenePanel.add(FSPane = new cFileSystemPane(this)); |
---|
| 1297 | + tabbedPane.add(FSPane = new cFileSystemPane(this)); |
---|
1282 | 1298 | |
---|
1283 | 1299 | optionsPanel = new JPanel(new GridBagLayout()); |
---|
1284 | 1300 | |
---|
1285 | 1301 | optionsPanel.setName("Options"); |
---|
1286 | | - scenePanel.add(optionsPanel); |
---|
1287 | | - |
---|
| 1302 | + |
---|
| 1303 | + AddOptions(optionsPanel, aConstraints); |
---|
| 1304 | + |
---|
| 1305 | + tabbedPane.add(optionsPanel); |
---|
| 1306 | + |
---|
| 1307 | + scenePanel.add(tabbedPane); |
---|
1288 | 1308 | |
---|
1289 | 1309 | /* |
---|
1290 | 1310 | cTree jTree = new cTree(null); |
---|
.. | .. |
---|
1318 | 1338 | //bigPanel.setSize(new Dimension(10,10)); |
---|
1319 | 1339 | //bigPanel.add(ctrlPanel); |
---|
1320 | 1340 | //bigPanel.add(gridPanel); |
---|
| 1341 | + /** |
---|
1321 | 1342 | bigThree = new JPanel(); |
---|
1322 | 1343 | //big.setLayout(new FlowLayout(FlowLayout.LEFT)); |
---|
1323 | 1344 | bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); |
---|
.. | .. |
---|
1341 | 1362 | // aConstraints.gridheight = 3; |
---|
1342 | 1363 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
1343 | 1364 | bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 1365 | + /**/ |
---|
1344 | 1366 | |
---|
| 1367 | + bigThree = new cGridBag(); |
---|
| 1368 | + bigThree.addComponent(scenePanel); |
---|
| 1369 | + bigThree.addComponent(centralPanel); |
---|
| 1370 | + bigThree.addComponent(XYZPanel); |
---|
| 1371 | + |
---|
1345 | 1372 | // // SIDE EFFECT!!! |
---|
1346 | 1373 | // aConstraints.gridx = 0; |
---|
1347 | 1374 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
1362 | 1389 | //worldPane.add(bigPanel); |
---|
1363 | 1390 | //worldPane.add(worldPanel); |
---|
1364 | 1391 | /**/ |
---|
1365 | | - frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1392 | + //frame.getContentPane().add(/*"Center",*/framePanel); |
---|
| 1393 | + frame.add(/*"Center",*/framePanel); |
---|
1366 | 1394 | //frame.getContentPane().add(/*"Center",*/ worldPane); |
---|
1367 | 1395 | |
---|
1368 | 1396 | // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); |
---|
.. | .. |
---|
1383 | 1411 | }); |
---|
1384 | 1412 | } |
---|
1385 | 1413 | |
---|
| 1414 | + void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 1415 | + { |
---|
| 1416 | + } |
---|
| 1417 | + |
---|
1386 | 1418 | JTree GetTree() |
---|
1387 | 1419 | { |
---|
1388 | 1420 | return objEditor.jTree; |
---|
.. | .. |
---|
2996 | 3028 | if (timeline) |
---|
2997 | 3029 | { |
---|
2998 | 3030 | centralPanel.remove(cameraView); |
---|
2999 | | - centralPanel.add(timelinePanel); |
---|
| 3031 | + cameraPanel.add(cameraView); |
---|
| 3032 | + centralPanel.add(cameraPanel); |
---|
3000 | 3033 | frame.setJMenuBar(timelineMenubar); |
---|
3001 | 3034 | wasFullScreen = CameraPane.FULLSCREEN; |
---|
3002 | 3035 | if (!CameraPane.FULLSCREEN) |
---|
.. | .. |
---|
3005 | 3038 | } |
---|
3006 | 3039 | else |
---|
3007 | 3040 | { |
---|
3008 | | - centralPanel.remove(timelinePanel); |
---|
| 3041 | + centralPanel.remove(cameraPanel); |
---|
3009 | 3042 | centralPanel.add(cameraView); |
---|
3010 | 3043 | frame.setJMenuBar(null); |
---|
3011 | 3044 | if (!wasFullScreen) |
---|
.. | .. |
---|
3128 | 3161 | objEditor.refreshContents(); |
---|
3129 | 3162 | } else if (event.getSource() == stepItem) |
---|
3130 | 3163 | { |
---|
3131 | | - cameraView.ONESTEP = true; |
---|
| 3164 | + //cameraView.ONESTEP = true; |
---|
| 3165 | + Globals.ONESTEP = true; |
---|
3132 | 3166 | cameraView.repaint(); |
---|
3133 | 3167 | return; |
---|
3134 | 3168 | } else if (event.getSource() == stepButton) |
---|
.. | .. |
---|
3285 | 3319 | |
---|
3286 | 3320 | void ToggleAnimation() |
---|
3287 | 3321 | { |
---|
3288 | | - if (!CameraPane.ANIMATION) |
---|
| 3322 | + if (!Globals.ANIMATION) |
---|
3289 | 3323 | { |
---|
3290 | 3324 | FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); |
---|
3291 | 3325 | browser.show(); |
---|
3292 | 3326 | String filename = browser.getFile(); |
---|
3293 | 3327 | if (filename != null && filename.length() > 0) |
---|
3294 | 3328 | { |
---|
3295 | | - CameraPane.filename = browser.getDirectory() + filename; |
---|
| 3329 | + Globals.filename = browser.getDirectory() + filename; |
---|
3296 | 3330 | //CameraPane.framecount = 0; |
---|
3297 | | - CameraPane.imagecount = 0; |
---|
| 3331 | + Globals.imagecount = 0; |
---|
3298 | 3332 | |
---|
3299 | | - CameraPane.ANIMATION ^= true; |
---|
| 3333 | + Globals.ANIMATION ^= true; |
---|
3300 | 3334 | |
---|
3301 | 3335 | GrafreeD.wav.cursor = 0; |
---|
3302 | 3336 | GrafreeD.wav.loop = 0; |
---|
3303 | 3337 | } |
---|
3304 | 3338 | } else |
---|
3305 | 3339 | { |
---|
3306 | | - CameraPane.ANIMATION ^= true; |
---|
| 3340 | + Globals.ANIMATION ^= true; |
---|
3307 | 3341 | } |
---|
3308 | 3342 | } |
---|
3309 | 3343 | |
---|
.. | .. |
---|
4527 | 4561 | JScrollPane infoPanel; |
---|
4528 | 4562 | JPanel optionsPanel; |
---|
4529 | 4563 | JTabbedPane objectPanel; |
---|
4530 | | - JPanel XYZPanel; |
---|
| 4564 | + cGridBag XYZPanel; |
---|
4531 | 4565 | JSplitPane gridPanel; |
---|
4532 | 4566 | JSplitPane bigPanel; |
---|
4533 | | - JPanel bigThree; |
---|
4534 | | - JTabbedPane scenePanel; |
---|
4535 | | - JPanel centralPanel; |
---|
| 4567 | + cGridBag bigThree; |
---|
| 4568 | + cGridBag scenePanel; |
---|
| 4569 | + cGridBag centralPanel; |
---|
| 4570 | + JSplitPane cameraPanel; |
---|
4536 | 4571 | JPanel timelinePanel; |
---|
4537 | 4572 | JMenuBar timelineMenubar; |
---|
4538 | 4573 | JSplitPane framePanel; |
---|