From bed42c663d286d76a32f155049f9efabc2fdb73f Mon Sep 17 00:00:00 2001 From: Normand Briere <nbriere@noware.ca> Date: Sun, 28 Apr 2019 20:48:43 -0400 Subject: [PATCH] New UI proto --- ObjEditor.java | 56 ++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 38 insertions(+), 18 deletions(-) diff --git a/ObjEditor.java b/ObjEditor.java index 751955c..0ea0e59 100644 --- a/ObjEditor.java +++ b/ObjEditor.java @@ -19,6 +19,8 @@ import //weka.core. matrix.Matrix; +import grafeme.ui.*; + class ObjEditor /*extends JFrame*/ implements iCallBack, ObjectUI, ActionListener, ChangeListener, InputMethodListener, @@ -31,6 +33,9 @@ boolean timeline; boolean wasFullScreen; + GroupEditor callee; + JFrame frame; + // SCRIPT transient JFrame textpanel = null; @@ -121,14 +126,13 @@ void keyPressed(int key, int modifiers) { System.out.println("KEY PRESSED"); - CameraPane.theRenderer.keyPressed(key, modifiers); + Globals.theRenderer.keyPressed(key, modifiers); } */ static GridBagConstraints aConstraints; static GridBagConstraints aWindowConstraints; - GroupEditor callee; - JFrame frame; + static int GRIDWIDTH = 100; // 4; public void closeUI() @@ -309,7 +313,7 @@ toggleTextureItem.setState(CameraPane.textureon); cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); toggleLiveItem.addItemListener(this); - toggleLiveItem.setState(CameraPane.isLIVE()); + toggleLiveItem.setState(Globals.isLIVE()); cameraMenu.add(stepItem = new MenuItem("Step")); stepItem.addActionListener(this); // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); @@ -1215,12 +1219,12 @@ //frontView.object = copy; //sideView.object = copy; - XYZPanel = new JPanel(); - XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); + XYZPanel = new cGridBag().setVertical(true); + //XYZPanel.setLayout(new GridLayout(3, 1, 5, 5)); - XYZPanel.add(/*BorderLayout.SOUTH,*/sideView); // Scroll); - XYZPanel.add(/*BorderLayout.CENTER,*/frontView); // Scroll); - XYZPanel.add(/*BorderLayout.NORTH,*/topView); // Scroll); + XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll); + XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll); + XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll); /* gridPanel = new JPanel(); //new BorderLayout()); @@ -1290,6 +1294,9 @@ optionsPanel = new JPanel(new GridBagLayout()); optionsPanel.setName("Options"); + + AddOptions(optionsPanel, aConstraints); + scenePanel.add(optionsPanel); @@ -1325,6 +1332,7 @@ //bigPanel.setSize(new Dimension(10,10)); //bigPanel.add(ctrlPanel); //bigPanel.add(gridPanel); + /** bigThree = new JPanel(); //big.setLayout(new FlowLayout(FlowLayout.LEFT)); bigThree.setLayout(new GridBagLayout()); //1,3,5,5)); @@ -1348,7 +1356,13 @@ // aConstraints.gridheight = 3; aWindowConstraints.fill = GridBagConstraints.VERTICAL; bigThree.add(XYZPanel, aWindowConstraints); + /**/ + bigThree = new cGridBag(); + bigThree.addComponent(scenePanel); + bigThree.addComponent(centralPanel); + bigThree.addComponent(XYZPanel); + // // SIDE EFFECT!!! // aConstraints.gridx = 0; // aConstraints.gridy = 0; @@ -1369,7 +1383,8 @@ //worldPane.add(bigPanel); //worldPane.add(worldPanel); /**/ - frame.getContentPane().add(/*"Center",*/framePanel); + //frame.getContentPane().add(/*"Center",*/framePanel); + frame.add(/*"Center",*/framePanel); //frame.getContentPane().add(/*"Center",*/ worldPane); // aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc); @@ -1390,6 +1405,10 @@ }); } + void AddOptions(JPanel panel, GridBagConstraints constraints) + { + } + JTree GetTree() { return objEditor.jTree; @@ -3136,7 +3155,8 @@ objEditor.refreshContents(); } else if (event.getSource() == stepItem) { - cameraView.ONESTEP = true; + //cameraView.ONESTEP = true; + Globals.ONESTEP = true; cameraView.repaint(); return; } else if (event.getSource() == stepButton) @@ -3293,25 +3313,25 @@ void ToggleAnimation() { - if (!CameraPane.ANIMATION) + if (!Globals.ANIMATION) { FileDialog browser = new FileDialog(frame, "Save Animation As...", FileDialog.SAVE); browser.show(); String filename = browser.getFile(); if (filename != null && filename.length() > 0) { - CameraPane.filename = browser.getDirectory() + filename; + Globals.filename = browser.getDirectory() + filename; //CameraPane.framecount = 0; - CameraPane.imagecount = 0; + Globals.imagecount = 0; - CameraPane.ANIMATION ^= true; + Globals.ANIMATION ^= true; GrafreeD.wav.cursor = 0; GrafreeD.wav.loop = 0; } } else { - CameraPane.ANIMATION ^= true; + Globals.ANIMATION ^= true; } } @@ -4535,10 +4555,10 @@ JScrollPane infoPanel; JPanel optionsPanel; JTabbedPane objectPanel; - JPanel XYZPanel; + cGridBag XYZPanel; JSplitPane gridPanel; JSplitPane bigPanel; - JPanel bigThree; + cGridBag bigThree; JTabbedPane scenePanel; JPanel centralPanel; JSplitPane cameraPanel; -- Gitblit v1.6.2