Thread: [Htmlparser-cvs] htmlparser/src/org/htmlparser/parserapplications/filterbuilder SubFilterList.java,N
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications/filterbuilder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12396/src/org/htmlparser/parserapplications/filterbuilder Added Files: SubFilterList.java HtmlTreeCellRenderer.java Filter.java HtmlTreeModel.java FilterBuilder.java Log Message: FilterBuilder --- NEW FILE: SubFilterList.java --- // HTMLParser Library $Name: $ - A java-based parser for HTML // http://sourceforge.org/projects/htmlparser // Copyright (C) 2005 Derrick Oswald // // Revision Control Information // // $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications/filterbuilder/SubFilterList.java,v $ // $Author: derrickoswald $ // $Date: 2005/02/13 20:43:06 $ // $Revision: 1.1 $ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // package org.htmlparser.parserapplications.filterbuilder; import java.awt.*; import javax.swing.*; import javax.swing.border.*; import org.htmlparser.NodeFilter; import org.htmlparser.parserapplications.filterbuilder.layouts.VerticalLayoutManager; public class SubFilterList extends JPanel { protected int mExtra = 25; // for now protected Component mSpacer; protected Filter mHome; protected String mTitle; protected int mMax; /** * Creates a container panel. * Set the panel minimum size to the same width as the container * but with a bit of extra length. * @param home The filter we belong to. * @param title The border title. * @param max The maximum number of filters in the list (0 for no limit). */ public SubFilterList (Filter home, String title, int max) { mHome = home; mTitle = title; mMax = max; // not quite: // new BoxLayout (this, BoxLayout.Y_AXIS)); setLayout (new VerticalLayoutManager ()); addSpacer (); setSelected (false); } /** * Set the 'selected look' for the component. * @param selected If <code>true</code>, 'select' this component, * otherwise 'deselect' it. */ public void setSelected (boolean selected) { if (selected) setBorder ( new CompoundBorder ( new TitledBorder ( null, mTitle, TitledBorder.LEFT, TitledBorder.TOP), new CompoundBorder ( new LineBorder (Color.green, 2), new EmptyBorder (1, 1, 1, 1)))); else setBorder ( new CompoundBorder ( new TitledBorder ( null, mTitle, TitledBorder.LEFT, TitledBorder.TOP), new EmptyBorder (3,3,3,3))); } protected void addSpacer () { Dimension dimension; Insets insets; // set the command area size by adding a rigid area dimension = mHome.getSize (); insets = mHome.getInsets (); // todo: this should resize with the container dimension.setSize (dimension.width - insets.left - insets.right, mExtra); mSpacer = Box.createRigidArea (dimension); add (mSpacer); } protected void removeSpacer () { remove (mSpacer); mSpacer = null; } /** * Get the components in which to drop commands. * @return The component to act as a drop target. */ public Component[] getDropTargets () { return (new Component[] { this }); } /** * Add a filter to the container contents. * @param filter The command to add to the container. */ public void addFilter (Filter filter) { int count; count = getComponentCount (); if (null != mSpacer) count--; // insert before the spacer addFilter (filter, count); } /** * Add a filter to the container at a specific position. * @param filter The filter to add to the container. * @param index The index at which to add it. */ public void addFilter (Filter filter, int index) { NodeFilter[] before; NodeFilter[] after; int offset; add (filter, index); before = mHome.getSubNodeFilters (); after = new NodeFilter[before.length + 1]; offset = 0; for (int i = 0; i < after.length; i++) after[i] = (i == index) ? filter : before[offset++]; mHome.setSubNodeFilters (after); if ((null != mSpacer) && (0 != mMax) && (after.length >= mMax)) removeSpacer (); } /** * Remove a filter from the container. * @param filter The filter to remove from the container. */ public void removeFilter (Filter filter) { Filter[] filters; int index; filters = getFilters (); index = -1; for (int i = 0; ((-1 == index) && (i < filters.length)); i++) if (filter == filters[i]) index = i; if (-1 != index) removeFilter (index); } /** * Remove a filter from the container. * @param filter The filter to remove from the container. */ public void removeFilter (int index) { NodeFilter[] before; NodeFilter[] after; int offset; remove (index); before = mHome.getSubNodeFilters (); if (0 != before.length) { after = new NodeFilter[before.length - 1]; offset = 0; for (int i = 0; i < before.length; i++) if (i != index) after[offset++] = before[i]; mHome.setSubNodeFilters (after); if ((null == mSpacer) && (0 != mMax) && (after.length < mMax)) addSpacer (); } } /** * Return the list of filters in this container. * @return The list of contained filters. */ public Filter[] getFilters () { NodeFilter[] list; Filter[] ret; list = mHome.getSubNodeFilters (); ret = new Filter[list.length]; System.arraycopy (list, 0, ret, 0, list.length); return (ret); } public boolean canAccept () { int count; boolean ret; if (0 == mMax) ret = true; else { count = getComponentCount (); if (null != mSpacer) count--; ret = count < mMax; } return (ret); } /** * Get the bytes for this command as a String. * @param indent The number of spaces to indent a block. * @param level The current indentation level. * The first non-whitespace character should be at * indented <code>indent</code> * <code>level</code> spaces. * @return The string representing this command. */ public String toString (int indent, int level) { Filter[] filters; StringBuffer ret; ret = new StringBuffer (); filters = getFilters (); for (int i = 0; i < filters.length; i++) { ret.append (filters[i].toString ()); if (i + 1 != filters.length) ret.append ("\n"); } return (ret.toString ()); } } --- NEW FILE: HtmlTreeCellRenderer.java --- // HTMLParser Library $Name: $ - A java-based parser for HTML // http://sourceforge.org/projects/htmlparser // Copyright (C) 2005 Derrick Oswald // // Revision Control Information // // $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications/filterbuilder/HtmlTreeCellRenderer.java,v $ // $Author: derrickoswald $ // $Date: 2005/02/13 20:43:06 $ // $Revision: 1.1 $ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // package org.htmlparser.parserapplications.filterbuilder; import java.awt.Component; import java.util.Vector; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeCellRenderer; import org.htmlparser.Attribute; import org.htmlparser.Node; import org.htmlparser.lexer.Cursor; import org.htmlparser.nodes.TagNode; import org.htmlparser.nodes.TextNode; import org.htmlparser.util.ParserException; import org.htmlparser.util.Translate; /** * @author derrick * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class HtmlTreeCellRenderer extends DefaultTreeCellRenderer implements TreeCellRenderer { public HtmlTreeCellRenderer () { setLeafIcon (null); setClosedIcon (null); setOpenIcon (null); } /** * Render the tag as HTML. * This is different from the tag's normal toHtml() method in that it * doesn't process children or end tags, just the initial tag, and * it also wraps the tag in something a label would expect. * @see org.htmlparser.Node#toHtml() */ public String toHtml (TagNode tag) { int length; int size; Vector attributes; Attribute attribute; String s; boolean children; StringBuffer ret; length = 2; attributes = tag.getAttributesEx (); size = attributes.size (); for (int i = 0; i < size; i++) { attribute = (Attribute)attributes.elementAt (i); length += attribute.getLength (); } ret = new StringBuffer (length); ret.append ("<"); for (int i = 0; i < size; i++) { attribute = (Attribute)attributes.elementAt (i); attribute.toString (ret); } ret.append (">"); s = Translate.encode (ret.toString ()); children = null != tag.getChildren (); ret = new StringBuffer (s.length () + 13 + (children ? 16 : 0)); ret.append ("<html>"); if (children) ret.append ("<font color=\"blue\">"); ret.append (s); if (children) ret.append ("</font>"); ret.append ("</html>"); return (ret.toString ()); } /** * Express this string node as a printable string * This is suitable for display in a debugger or output to a printout. * Control characters are replaced by their equivalent escape * sequence and contents is truncated to 80 characters. * @return A string representation of the string node. */ public String toText (TextNode node) { int startpos; int endpos; String s; char c; StringBuffer ret; startpos = node.getStartPosition (); endpos = node.getEndPosition (); ret = new StringBuffer (endpos - startpos + 20); s = node.toHtml (); for (int i = 0; i < s.length (); i++) { c = s.charAt (i); switch (c) { case '\t': ret.append ("\\t"); break; case '\n': ret.append ("\\n"); break; case '\r': ret.append ("\\r"); break; default: ret.append (c); } if (77 <= ret.length ()) { ret.append ("..."); break; } } return (ret.toString ()); } /** * @see javax.swing.tree.TreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int, boolean) */ public Component getTreeCellRendererComponent (JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Node node; super.getTreeCellRendererComponent (tree, value, selected, expanded, leaf, row, hasFocus); node = (Node)value; if (node instanceof TagNode) setText (toHtml ((TagNode)node)); else if (node instanceof TextNode) setText (toText ((TextNode)node)); else setText (node.toHtml ()); return (this); } } --- NEW FILE: Filter.java --- // HTMLParser Library $Name: $ - A java-based parser for HTML // http://sourceforge.org/projects/htmlparser // Copyright (C) 2005 Derrick Oswald // // Revision Control Information // // $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications/filterbuilder/Filter.java,v $ // $Author: derrickoswald $ // $Date: 2005/02/13 20:43:06 $ // $Revision: 1.1 $ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // package org.htmlparser.parserapplications.filterbuilder; import java.awt.*; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Hashtable; import java.util.Vector; import javax.swing.*; import javax.swing.border.*; import org.htmlparser.NodeFilter; import org.htmlparser.Parser; import org.htmlparser.parserapplications.filterbuilder.layouts.VerticalLayoutManager; /** * Base class for all filters. * Provides common functionality applicable to all filters. */ public abstract class Filter extends JComponent implements NodeFilter { /** * Create a new filter from the class name. * @param class_name The class to instatiate. * @return The constructed filter object. */ public static Filter instantiate (String class_name) { Filter ret; ret = null; try { Class cls = Class.forName (class_name); ret = (Filter)cls.newInstance (); mWrappers.put (ret.getNodeFilter ().getClass ().getName (), class_name); } catch (ClassNotFoundException cnfe) { System.out.println ("can't find class " + class_name); } catch (InstantiationException ie) { System.out.println ("can't instantiate class " + class_name); } catch (IllegalAccessException ie) { System.out.println ("class " + class_name + " has no public constructor"); } catch (ClassCastException cce) { System.out.println ("class " + class_name + " is not a Filter"); } return (ret); } /** * Map from cilter class to wrapper. * Populated as part of each wrapper being loaded. */ protected static Hashtable mWrappers = new Hashtable (); /** * Create a filter. * Set up the default display. * Only a border with the label of the filter name, * returned by <code>getDescription()</code>, * and an icon, returned by <code>getIcon()</code>. */ public Filter () { JLabel label; Dimension dimension; Insets insets; setToolTipText (getDescription ()); // none of these quite does it: // new BoxLayout (this, BoxLayout.Y_AXIS)); // new GridLayout (0, 1)); setLayout (new VerticalLayoutManager ()); setSelected (false); label = new JLabel (getDescription (), getIcon (), SwingConstants.LEFT); label.setBackground (Color.green); label.setAlignmentX (Component.LEFT_ALIGNMENT); label.setHorizontalAlignment (SwingConstants.LEFT); add (label); dimension = label.getMaximumSize (); insets = getInsets (); dimension.setSize (dimension.width + insets.left + insets.right, dimension.height + insets.top + insets.bottom); setSize (dimension); } /** * Get the name of the filter. * @return A descriptive name for the filter. */ public abstract String getDescription (); /** * Get the underlying node filter object. * @return The node filter object suitable for serialization. */ public abstract NodeFilter getNodeFilter (); /** * Assign the underlying node filter for this wrapper. * @param filter The filter to wrap. * @param context The parser to use for conditioning this filter. * Some filters need contextual information to provide to the user, * i.e. for tag names or attribute names or values, * so the Parser context is provided. */ public abstract void setNodeFilter (NodeFilter filter, Parser context); /** * Get the underlying node filter's subordinate filters. * @return The node filter object's contained filters. */ public abstract NodeFilter[] getSubNodeFilters (); /** * Assign the underlying node filter's subordinate filters. * @param filters The filters to insert into the underlying node filter. */ public abstract void setSubNodeFilters (NodeFilter[] filters); /** * Convert this filter into Java code. * Output whatever text necessary and return the variable name. * @param out The output buffer. * @param context Three integers as follows: * <li>indent level - the number of spaces to insert at the beginning of each line</li> * <li>filter number - the next available filter number</li> * <li>filter array number - the next available array of filters number</li> * @return The variable name to use when referencing this filter (usually "filter" + context[1]++) */ public abstract String toJavaCode (StringBuffer out, int[] context); /** * Get the icon for the filter. * Loads the resource specified by * <code>getIconSpec()</code> as an icon. * @return The icon or null if it was not found. */ public Icon getIcon () { ImageIcon ret; ret = null; try { ret = new ImageIcon (getClass ().getResource (getIconSpec ())); } catch (NullPointerException npe) { System.err.println ("can't find icon " + getIconSpec ()); } return (ret); } /** * Get the resource name for the icon. * @return The icon resource specification. */ public abstract String getIconSpec (); // // Component overrides // /** * Returns a string representation of this component and its values. * @return A string representation of this component. */ public String toString () { return (getDescription () + " [" + this.getClass ().getName () + "]"); } // // utilities // public static byte[] pickle (Object object) throws IOException { ByteArrayOutputStream bos; ObjectOutputStream oos; byte[] ret; bos = new ByteArrayOutputStream (); oos = new ObjectOutputStream (bos); oos.writeObject (object); oos.close (); ret = bos.toByteArray (); return (ret); } public static Object unpickle (byte[] data) throws IOException, ClassNotFoundException { ByteArrayInputStream bis; ObjectInputStream ois; Object ret; bis = new ByteArrayInputStream (data); ois = new ObjectInputStream (bis); ret = ois.readObject (); ois.close (); return (ret); } public static String serialize (byte[] data) { String string; StringBuffer ret; ret = new StringBuffer (data.length * 2); for (int i = 0; i < data.length; i++) { string = Integer.toString (0xff & data[i], 16); if (string.length () < 2) ret.append ("0"); ret.append (string); } return (ret.toString ()); } public static byte[] deserialize (String string) { byte[] ret; ret = new byte[string.length () / 2]; for (int i = 0; i < string.length (); i += 2) ret[i/2] = (byte)Integer.parseInt (string.substring (i, i + 2), 16); // todo: hopelessly inefficient return (ret); } /** * Returns a string serialization of the filters. * @return A string representation of the filters. */ public static String deconstitute (Filter[] filters) throws IOException { StringBuffer ret; ret = new StringBuffer (1024); for (int i = 0; i < filters.length; i++) { ret.append ("["); ret.append (serialize (pickle (filters[i].getNodeFilter ()))); ret.append ("]"); } return (ret.toString ()); } /** * Returns the filters represented by the string. * @param string The string with serialized node filters. * @return The filters gleaned from the string. */ public static Filter[] reconstitute (String string, Parser context) { Filter[] ret; Vector vector; int index; String code; Object object; Filter filter; vector = new Vector (); try { while (string.startsWith ("[")) { index = string.indexOf (']'); if (-1 != index) { code = string.substring (1, index); string = string.substring (index + 1); object = unpickle (deserialize (code)); if (object instanceof NodeFilter) { filter = wrap ((NodeFilter)object, context); if (null != filter) vector.addElement (filter); } else break; } else break; } } catch (Exception e) { e.printStackTrace (); } ret = new Filter[vector.size ()]; vector.copyInto (ret); return (ret); } /** * Get the enclosed sub filter list if any. * Todo: rationalize with FilterBuilder's method(s) of the same name. * @param component The component that's supposedly enclosing the list. * @return The enclosed component or <code>null</code> otherwise. */ protected static SubFilterList getEnclosed (Component component) { Component[] list; if (component instanceof Container) { list = ((Container)component).getComponents (); for (int i = 0; i < list.length; i++) if (list[i] instanceof SubFilterList) return ((SubFilterList)list[i]); } return (null); } /** * Returns a wrapped filter. * @param filter A filter to be wrapped by GUI components. * @param context The context within which to wrap the object. * Some wrappers need context to set up useful choices for the user. * @return The filter to wrap. */ public static Filter wrap (NodeFilter filter, Parser context) { String class_name; NodeFilter[] filters; SubFilterList list; Filter ret; ret = null; class_name = filter.getClass ().getName (); class_name = (String)mWrappers.get (class_name); if (null != class_name) { try { ret = Filter.instantiate (class_name); ret.setNodeFilter (filter, context); // recurse into subfilters filters = ret.getSubNodeFilters (); if (0 != filters.length) { list = getEnclosed (ret); if (null != list) { ret.setSubNodeFilters (new NodeFilter[0]); // clean out the unwrapped filters for (int i = 0; i < filters.length; i++) list.addFilter (wrap (filters[i], context)); } else throw new IllegalStateException ("filter can't have subnodes without a SubFilterList on the wrapper"); } } catch (Exception e) { e.printStackTrace (); } } else System.out.println (class_name + " is not registered for wrapping."); return (ret); } /** * Set the 'selected look' for the component. * @param selected If <code>true</code>, 'select' this component, * otherwise 'deselect' it. */ public void setSelected (boolean selected) { if (selected) setBorder ( new CompoundBorder ( new EtchedBorder (), new CompoundBorder ( new LineBorder(Color.blue, 2), new EmptyBorder (1, 1, 1, 1)))); else setBorder ( new CompoundBorder ( new EtchedBorder (), new EmptyBorder (3,3,3,3))); } /** * Set the expanded state for the component. * This sets invisible all but the JLabel component in the * comand component. * @param expanded If <code>true</code>, 'expand' this component, * otherwise 'collapse' it. */ public void setExpanded (boolean expanded) { Component[] components; components = getComponents (); for (int i = 0; i < components.length; i++) if (!(components[i] instanceof JLabel)) components[i].setVisible (expanded); } public static void spaces (StringBuffer out, int count) { for (int i = 0; i < count; i++) out.append (' '); } public static void newline (StringBuffer out) { out.append ('\n'); } } --- NEW FILE: HtmlTreeModel.java --- // HTMLParser Library $Name: $ - A java-based parser for HTML // http://sourceforge.org/projects/htmlparser // Copyright (C) 2005 Derrick Oswald // // Revision Control Information // // $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications/filterbuilder/HtmlTreeModel.java,v $ // $Author: derrickoswald $ // $Date: 2005/02/13 20:43:06 $ // $Revision: 1.1 $ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // package org.htmlparser.parserapplications.filterbuilder; import java.util.Vector; import javax.swing.tree.*; import javax.swing.event.*; import org.htmlparser.Node; import org.htmlparser.tags.Html; import org.htmlparser.util.NodeList; /** * Each leaf is a TreeItem or something that does toString(). */ public class HtmlTreeModel implements TreeModel { protected Vector mTreeListeners; protected Node mRoot; public HtmlTreeModel (NodeList root) { mTreeListeners = new Vector (); // for simplicity we encapsulate the nodelist in a Html tag mRoot = new Html (); mRoot.setChildren (root); } // // TreeModel interface // // Adds a listener for the TreeModelEvent posted after the tree changes. public void addTreeModelListener (TreeModelListener l) { synchronized (mTreeListeners) { if (!mTreeListeners.contains(l)) mTreeListeners.addElement(l); } } // Removes a listener previously added with addTreeModelListener(). public void removeTreeModelListener(TreeModelListener l) { synchronized (mTreeListeners) { mTreeListeners.removeElement (l); } } // Returns the child of parent at index index in the parent's child array. public Object getChild (Object parent, int index) { Node node; NodeList list; Object ret; node = (Node)parent; list = node.getChildren (); if (null == list) throw new IllegalArgumentException ("invalid parent for getChild()"); else ret = list.elementAt (index); return (ret); } // Returns the number of children of parent. public int getChildCount (Object parent) { Node node; NodeList list; int ret; ret = 0; node = (Node)parent; list = node.getChildren (); if (null != list) ret = list.size (); return (ret); } // Returns the index of child in parent. public int getIndexOfChild (Object parent, Object child) { Node node; NodeList list; int count; int ret; ret = -1; node = (Node)parent; list = node.getChildren (); if (null != list) { count = list.size (); for (int i = 0; i < count; i++) if (child == list.elementAt (i)) { ret = i; break; } } else throw new IllegalArgumentException ("invalid parent for getIndexOfChild()"); if (0 > ret) throw new IllegalArgumentException ("child not found in getIndexOfChild()"); return (ret); } // Returns the root of the tree. public Object getRoot () { return (mRoot); } // Returns true if node is a leaf. public boolean isLeaf (Object node) { NodeList list; boolean ret; list = ((Node)node).getChildren (); if (null == list) ret = true; else ret = 0 == list.size (); return (ret); } // Messaged when the user has altered the value for the item identified by path to newValue. public void valueForPathChanged (TreePath path, Object newValue) { TreeModelEvent event; Vector v; event = new TreeModelEvent (this, path); synchronized (mTreeListeners) { v = (Vector)mTreeListeners.clone (); } for (int i = 0; i < v.size (); i++) { TreeModelListener listener = (TreeModelListener)v.elementAt (i); listener.treeStructureChanged (event); } } } --- NEW FILE: FilterBuilder.java --- // HTMLParser Library $Name: $ - A java-based parser for HTML // http://sourceforge.org/projects/htmlparser // Copyright (C) 2005 Derrick Oswald // // Revision Control Information // // $Source: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications/filterbuilder/FilterBuilder.java,v $ // $Author: derrickoswald $ // $Date: 2005/02/13 20:43:06 $ // $Revision: 1.1 $ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU [...2371 lines suppressed...] // { // javax.swing.UIManager.setLookAndFeel (javax.swing.UIManager.getSystemLookAndFeelClassName ()); // } // catch (Exception e) // { // } // create a new instance of our application's frame, and make it visible FilterBuilder builder = new FilterBuilder (); builder.setVisible (true); } catch (Throwable t) { t.printStackTrace (); // ensure the application exits with an error condition System.exit (1); } } } |