bojangles-cvs Mailing List for bojangles (Page 3)
Status: Alpha
Brought to you by:
nehresma
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(43) |
Sep
(11) |
Oct
(3) |
Nov
|
Dec
|
---|
From: kai5263499 <boj...@li...> - 2002-08-14 14:52:37
|
kai5263499 Wed Aug 14 07:52:36 2002 EDT Modified files: /bojangles MainWindow.java Log: Added the actual save function to the save XML button. Still need to check for pre-existing file and confirm overwrite and nit-picky things like that. Index: bojangles/MainWindow.java diff -u bojangles/MainWindow.java:1.9 bojangles/MainWindow.java:1.10 --- bojangles/MainWindow.java:1.9 Sun Aug 11 16:39:42 2002 +++ bojangles/MainWindow.java Wed Aug 14 07:52:36 2002 @@ -35,11 +35,12 @@ private DefaultTreeModel treeModel = null; private DisplayPanel displayPanel; private Hashtable widgetDefinitions = new Hashtable(); - private JButton jButton1, addProperty; + private JButton jButton1, jButton2, addProperty; private JComboBox propertiesComboBox; - private JMenu treeAddMenu, fileMenu, containerMenu, componentMenu; + private JMenu treeAddMenu, fileMenu, helpMenu, containerMenu, componentMenu; private JMenuBar jMenuBar1; private JMenuItem exitMenuItem; + private JMenuItem genhelpMenuItem; private JPopupMenu treePopup; private JScrollPane jScrollPane1; private JSplitPane jSplitPane1, jSplitPane2; @@ -53,6 +54,11 @@ private String currentElement = null; private XmlHandler xmlHandler = new XmlHandler(); + /** + * File variables for opening/closing a previously designed app + */ + private File selectedfile; + /** Creates new form MainWindow */ public MainWindow() { loadWidgetDefinitions(); @@ -96,6 +102,10 @@ } } + private void initFileBrowser() { + + } + private void initComponents() { treePopup = new javax.swing.JPopupMenu(); treeAddMenu = new javax.swing.JMenu(); @@ -109,12 +119,15 @@ propertiesTable = new javax.swing.JTable(); jToolBar1 = new javax.swing.JToolBar(); jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); addProperty = new javax.swing.JButton("Add"); propertiesComboBox = new javax.swing.JComboBox(); jMenuBar1 = new javax.swing.JMenuBar(); fileMenu = new javax.swing.JMenu(); + helpMenu = new javax.swing.JMenu(); exitMenuItem = new javax.swing.JMenuItem(); - + genhelpMenuItem = new javax.swing.JMenuItem(); + treePopup.addPopupMenuListener(new javax.swing.event.PopupMenuListener() { public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) { } public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) { } @@ -210,8 +223,17 @@ } }); - jToolBar1.add(jButton1); + jButton2.setBackground(new java.awt.Color(153, 153, 255)); + jButton2.setText("save XML"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + jToolBar1.add(jButton1); + jToolBar1.add(jButton2); + getContentPane().add(jToolBar1, java.awt.BorderLayout.NORTH); fileMenu.setText("File"); @@ -222,8 +244,18 @@ } }); + helpMenu.setText("Help"); + genhelpMenuItem.setText("General Help"); + genhelpMenuItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + genhelpMenuItemActionPerformed(evt); + } + }); + fileMenu.add(exitMenuItem); + helpMenu.add(genhelpMenuItem); jMenuBar1.add(fileMenu); + jMenuBar1.add(helpMenu); setJMenuBar(jMenuBar1); pack(); @@ -274,11 +306,27 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { xmlHandler.printXML(); -System.out.println(propertiesTable.getColumnModel().getColumn(0).getCellRenderer()); + System.out.println(propertiesTable.getColumnModel().getColumn(0).getCellRenderer()); } + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { + try { + FileDialog fb = new FileDialog(this, "Save as", FileDialog.SAVE); + fb.setVisible(true); + String file = new String(fb.getDirectory() + fb.getFile()); + xmlHandler.saveXML(file); + } + catch (Exception e) { + e.printStackTrace(); + } + } + private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) { System.exit(0); + } + + private void genhelpMenuItemActionPerformed(java.awt.event.ActionEvent evt) { + // TODO here... } public void elementFocusChanged(String path) { |
From: kai5263499 <boj...@li...> - 2002-08-14 14:51:18
|
kai5263499 Wed Aug 14 07:51:17 2002 EDT Modified files: /bojangles/xml XmlHandler.java Log: Added saveXML function that does just that (and requires a filename in a string to be passed to it). Index: bojangles/xml/XmlHandler.java diff -u bojangles/xml/XmlHandler.java:1.5 bojangles/xml/XmlHandler.java:1.6 --- bojangles/xml/XmlHandler.java:1.5 Sun Aug 11 16:40:48 2002 +++ bojangles/xml/XmlHandler.java Wed Aug 14 07:51:16 2002 @@ -10,6 +10,7 @@ */ import java.lang.*; +import java.io.*; import java.util.*; import java.util.regex.*; import java.awt.event.*; @@ -171,6 +172,16 @@ List l = doc.selectNodes(path); if (null == l) return 0; return l.size(); + } + + public void saveXML(String of) { + try { + //File sfile = new File(of); + FileOutputStream outfile = new FileOutputStream(of); + XMLWriter saver = new XMLWriter(outfile); + saver.write(this.doc); + System.out.println("Slected file: \n" + of); + } catch (Exception e) { e.printStackTrace(); } } public void printXML() { |
From: kai5263499 <boj...@li...> - 2002-08-14 14:11:43
|
kai5263499 Wed Aug 14 07:11:42 2002 EDT Added files: /bojangles/widget_definitions form.xml Log: New sub-container widget... Crude but it works... Index: bojangles/widget_definitions/form.xml +++ bojangles/widget_definitions/form.xml <widget> <name>form</name> <displayname>Form</displayname> <outer_type>widget/form</outer_type> <class>container</class> <visible>true</visible> <initial_settings> <x>5</x> <y>5</y> <width>100</width> <height>100</height> <bgcolor>#77CBEE</bgcolor> </initial_settings> <resizable>true</resizable> <moveable>true</moveable> <max_per_document></max_per_document> <properties> <title> <represent_as>text</represent_as> <default>bojangles generated application</default> </title> <bgcolor> <represent_as>color</represent_as> <default>#77CBEE</default> </bgcolor> <textcolor> <represent_as>color</represent_as> <default>#000000</default> </textcolor> </properties> </widget> |
From: kai5263499 <boj...@li...> - 2002-08-12 19:47:51
|
kai5263499 Mon Aug 12 12:47:50 2002 EDT Added files: /bojangles buildBJ Log: Crude autobuild support that also makes a jarball... This is more of a sanity device so I don't go out of my mind cleaning and compiling classes all of the time. |
From: nehresma <boj...@li...> - 2002-08-12 00:29:19
|
nehresma Sun Aug 11 17:29:18 2002 EDT Added files: /bojangles/images x.gif Log: this is the image used for the remove button in the properties table. |
From: nehresma <boj...@li...> - 2002-08-11 23:40:49
|
nehresma Sun Aug 11 16:40:48 2002 EDT Modified files: /bojangles/xml XmlHandler.java Log: fixed a bug when changing the name of a widget. i was using the wrong path in the XML document. Index: bojangles/xml/XmlHandler.java diff -u bojangles/xml/XmlHandler.java:1.4 bojangles/xml/XmlHandler.java:1.5 --- bojangles/xml/XmlHandler.java:1.4 Thu Aug 8 18:00:53 2002 +++ bojangles/xml/XmlHandler.java Sun Aug 11 16:40:48 2002 @@ -104,7 +104,11 @@ n.setName(name); if (null != text) n.setText(text); - notifyListeners(MODIFY, path); + + if (newPath.equals(path)) + notifyListeners(MODIFY, path); + else + notifyListeners(MODIFY, newPath); } return newPath; } |
From: nehresma <boj...@li...> - 2002-08-11 23:39:44
|
nehresma Sun Aug 11 16:39:42 2002 EDT Added files: /bojangles RemoveButtonEditor.java RemoveButtonRenderer.java Modified files: /bojangles MainWindow.java PropertiesTableModel.java Log: Added initial support for adding and removing properties from the properties table. Doesn't actually do anything yet, but the skeleton is there. This should be cleaned up a little bit too - the renderer and editor could be the same object if done carefully, thus saving a bit of memory. |