[Bojangles-cvs] cvs: bojangles / MainWindow.java
Status: Alpha
Brought to you by:
nehresma
From: kai5263499 <boj...@li...> - 2002-10-02 18:59:04
|
kai5263499 Wed Oct 2 11:59:03 2002 EDT Modified files: /bojangles MainWindow.java Log: Finally got the entire deleting of a widget working... Now on to opening a document! Index: bojangles/MainWindow.java diff -u bojangles/MainWindow.java:1.35 bojangles/MainWindow.java:1.36 --- bojangles/MainWindow.java:1.35 Mon Sep 30 14:05:00 2002 +++ bojangles/MainWindow.java Wed Oct 2 11:59:02 2002 @@ -45,7 +45,6 @@ private JTree widgetTree; private PropertiesTableModel propertiesTableModel = null; private TreePath curSelectedItem; - protected JLabel statusBar; /** * The XML path to the currently selected widget. */ @@ -148,7 +147,6 @@ jScrollPane1 = new javax.swing.JScrollPane(); propertiesTable = new javax.swing.JTable(); jToolBar1 = new javax.swing.JToolBar(); - JLabel statusBar = new JLabel("Welcome to the jungle."); jButton1 = new javax.swing.JButton(); openBtn = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); @@ -260,7 +258,6 @@ jSplitPane1.setRightComponent(jScrollPane1); getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER); - getContentPane().add(statusBar, java.awt.BorderLayout.SOUTH); jButton1.setBackground(new java.awt.Color(153, 153, 255)); jButton1.setText("print XML"); @@ -375,7 +372,7 @@ curSelectedItem = tp; if (-1 == row) { if (xmlHandler.doesPathExist(null)) { - statusBar.setText("This application already contains a top level widget."); + JOptionPane.showMessageDialog(null, "This application already contains a top level widget.", "Error", JOptionPane.ERROR_MESSAGE); return; } // menu was clicked on no particular row -- only enable the containers @@ -510,8 +507,7 @@ JPanel com_widget = (JPanel)h.get("widget"); // KILL DE WIDGET! and repaint - //widgetTree.remove(row); - widgetTree.toString(); + treeModel.removeNodeFromParent(n); parent_widget.remove(com_widget); parent_widget.repaint(); widgetTree.repaint(); @@ -651,7 +647,7 @@ path = xmlHandler.addElement(null, rootText, null); } else { if (!(parent instanceof Widget)) { - System.out.println("Attempt to add child widget to a parent that is not a widget!"); + JOptionPane.showMessageDialog(null, "Attempt to add child widget to a parent that is not a widget!", "Error", JOptionPane.ERROR_MESSAGE); return; } name = name+System.currentTimeMillis(); @@ -661,6 +657,7 @@ String parentPath = (String)h.get("path"); treeNode = new DefaultMutableTreeNode(name); treeModel.insertNodeInto(treeNode, parentTreeNode, parentTreeNode.getChildCount()); + //widgetTree.expandPath(; path = xmlHandler.addElement(parentPath, name, null); } @@ -959,8 +956,6 @@ TD_port = new javax.swing.JTextField(); TD_path = new javax.swing.JTextField(); JLabel jLabel5 = new javax.swing.JLabel(); - JLabel statusBar = new javax.swing.JLabel(); - dlgFrame.getContentPane().setLayout(null); jLabel1.setFont(new java.awt.Font("Dialog", 1, 18)); @@ -1024,8 +1019,6 @@ dlgFrame.getContentPane().add(jLabel5); jLabel5.setBounds(50, 50, 280, 16); - dlgFrame.getContentPane().add(statusBar); - statusBar.setBounds(0, 230, 400, 20); pack(); dlgFrame.setSize(407,269); dlgFrame.setResizable(false); |