Thread: [Htmlparser-cvs] htmlparser/src/org/htmlparser/beans BeanyBaby.java,1.23,1.24 FilterBean.java,1.1,1.
Brought to you by:
derrickoswald
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30655/htmlparser/src/org/htmlparser/beans Modified Files: BeanyBaby.java FilterBean.java HTMLLinkBean.java HTMLTextBean.java LinkBean.java StringBean.java package.html Log Message: Documentation revamp part one. Deprecated node decorators. Added doSemanticAction for Text and Comment nodes. Added missing sitecapturer scripts. Fixed DOS batch files to work when called from any location. Index: package.html =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans/package.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** package.html 2 Jan 2004 16:24:53 -0000 1.19 --- package.html 10 Apr 2005 23:20:42 -0000 1.20 *************** *** 30,45 **** </head> <body bgcolor="white"> ! The beans package contains Java Beans that can integrate within IDEs. ! There are visual and non-visual beans, the former follow the naming pattern HTMLxxx. - BeanyBaby is an example application using these beans. - - <h2>Related Documentation</h2> - - For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> ! <li><a href="http://htmlparser.sourceforge.net">HTML Parser Home Page</a> </ul> ! <!-- Put @see and @since tags down here. --> --- 30,53 ---- </head> <body bgcolor="white"> ! The beans package contains Java Beans using the HTML Parser. ! <p>There are visual and non-visual beans, the former follow the naming pattern HTMLxxx. <ul> ! <li>{@link org.htmlparser.beans.BeanyBaby} is an example application using the StringBean and LinkBean.</li> ! <li>{@link org.htmlparser.beans.FilterBean} is a bean accepting a filter and returning a ! {@link org.htmlparser.util.NodeList NodeList}.</li> ! <li>{@link org.htmlparser.beans.LinkBean} is a bean returning an array of URLs from a page.</li> ! <li>{@link org.htmlparser.beans.StringBean} is a bean returning the text of a page.</li> ! <li>{@link org.htmlparser.beans.HTMLLinkBean} is a GUI bean showing the URLs from a page.</li> ! <li>{@link org.htmlparser.beans.HTMLStringBean} is a GUI bean showing the text of a page.</li> </ul> ! </p> ! <p>For a quick look at the output of these beans, run beanybaby or filterbuilder: ! <pre> ! <code> ! bin/beanybaby [url] ! bin/filterbuilder [url] ! </code> ! </pre> <!-- Put @see and @since tags down here. --> Index: HTMLLinkBean.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans/HTMLLinkBean.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** HTMLLinkBean.java 2 Jan 2004 16:24:53 -0000 1.21 --- HTMLLinkBean.java 10 Apr 2005 23:20:42 -0000 1.22 *************** *** 73,76 **** --- 73,77 ---- /** * Return the minimum dimension for this visible bean. + * @return a minimum bounding box for this bean. */ public Dimension getMinimumSize () Index: FilterBean.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans/FilterBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FilterBean.java 13 Feb 2005 20:36:03 -0000 1.1 --- FilterBean.java 10 Apr 2005 23:20:42 -0000 1.2 *************** *** 40,47 **** --- 40,51 ---- /** * Extract nodes from a URL using a filter. + * <pre> + * <code> * FilterBean fb = new FilterBean ("http://cbc.ca"); * fb.setFilters (new NodeFilter[] { new TagNameFilter ("META") }); * fb.setURL ("http://cbc.ca"); * System.out.println (fb.getNodes ().toHtml ()); + * </code> + * </pre> */ public class FilterBean Index: HTMLTextBean.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans/HTMLTextBean.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** HTMLTextBean.java 2 Jan 2004 16:24:53 -0000 1.22 --- HTMLTextBean.java 10 Apr 2005 23:20:42 -0000 1.23 *************** *** 59,62 **** --- 59,63 ---- /** * Return the minimum dimension for this visible bean. + * @return a minimum bounding box for this bean. */ public Dimension getMinimumSize () Index: LinkBean.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans/LinkBean.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** LinkBean.java 12 Mar 2005 21:39:45 -0000 1.30 --- LinkBean.java 10 Apr 2005 23:20:42 -0000 1.31 *************** *** 86,89 **** --- 86,94 ---- // + /** + * Internal routine to extract all the links from the parser. + * @return A list of all links on the page as URLs. + * @exception ParserException If the parse fails. + */ protected URL[] extractLinks () throws ParserException { Index: StringBean.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans/StringBean.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** StringBean.java 12 Mar 2005 12:52:19 -0000 1.42 --- StringBean.java 10 Apr 2005 23:20:42 -0000 1.43 *************** *** 275,278 **** --- 275,279 ---- * Extract the text from a page. * @return The textual contents of the page. + * @exception ParserException If a parse error occurs. */ protected String extractStrings () *************** *** 630,633 **** --- 631,635 ---- * Appends a newline to the output if the tag breaks flow, and * possibly sets the state of the PRE and SCRIPT flags. + * @param tag The tag to examine. */ public void visitTag (Tag tag) Index: BeanyBaby.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/beans/BeanyBaby.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** BeanyBaby.java 12 Mar 2005 21:39:45 -0000 1.23 --- BeanyBaby.java 10 Apr 2005 23:20:42 -0000 1.24 *************** *** 27,30 **** --- 27,41 ---- package org.htmlparser.beans; + import java.awt.BorderLayout; + import java.awt.Dimension; + import java.awt.Toolkit; + import java.awt.event.ActionEvent; + import java.awt.event.ActionListener; + import java.awt.event.MouseEvent; + import java.awt.event.MouseListener; + import java.awt.event.WindowAdapter; + import java.awt.event.WindowEvent; + import java.beans.PropertyChangeListener; + import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenuItem; *************** *** 39,45 **** javax.swing.JFrame implements ! java.beans.PropertyChangeListener, ! java.awt.event.ActionListener, ! java.awt.event.MouseListener { /** --- 50,56 ---- javax.swing.JFrame implements ! PropertyChangeListener, ! ActionListener, ! MouseListener { /** *************** *** 119,123 **** // ! public void actionPerformed (java.awt.event.ActionEvent event) { Object source; --- 130,141 ---- // ! /** ! * Handles UI events. ! * Changing the URL in the text field, altering a checkbox setting or ! * choosing a menu item winds up here, where the appropriate change ! * is made to the state of the bean. ! * @param event Details about the action. ! */ ! public void actionPerformed (ActionEvent event) { Object source; *************** *** 176,181 **** /** * Invoked when the mouse button has been clicked (pressed and released) on a component. */ ! public void mouseClicked (java.awt.event.MouseEvent event) { int index; --- 194,200 ---- /** * Invoked when the mouse button has been clicked (pressed and released) on a component. + * @param event Details on the mouse event. */ ! public void mouseClicked (MouseEvent event) { int index; *************** *** 192,197 **** /** * Invoked when the mouse enters a component. */ ! public void mouseEntered (java.awt.event.MouseEvent event) { } --- 211,217 ---- /** * Invoked when the mouse enters a component. + * @param event Details on the mouse event. */ ! public void mouseEntered (MouseEvent event) { } *************** *** 199,204 **** /** * Invoked when the mouse exits a component. */ ! public void mouseExited (java.awt.event.MouseEvent event) { } --- 219,225 ---- /** * Invoked when the mouse exits a component. + * @param event Details on the mouse event. */ ! public void mouseExited (MouseEvent event) { } *************** *** 206,211 **** /** * Invoked when a mouse button has been pressed on a component. */ ! public void mousePressed (java.awt.event.MouseEvent event) { } --- 227,233 ---- /** * Invoked when a mouse button has been pressed on a component. + * @param event Details on the mouse event. */ ! public void mousePressed (MouseEvent event) { } *************** *** 213,218 **** /** * Invoked when a mouse button has been released on a component. */ ! public void mouseReleased (java.awt.event.MouseEvent event) { } --- 235,241 ---- /** * Invoked when a mouse button has been released on a component. + * @param event Details on the mouse event. */ ! public void mouseReleased (MouseEvent event) { } *************** *** 221,224 **** --- 244,252 ---- // API control // + + /** + * Set the URL for the bean. + * @param url The URL to use in the bean. + */ public void setURL (String url) { *************** *** 313,319 **** setTitle("BeanyBaby"); ! addWindowListener(new java.awt.event.WindowAdapter() { ! public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); --- 341,347 ---- setTitle("BeanyBaby"); ! addWindowListener(new WindowAdapter() { ! public void windowClosing(WindowEvent evt) { exitForm(evt); *************** *** 321,325 **** }); ! panel.setLayout(new java.awt.BorderLayout()); pane1.setViewportView(mLinkBean); --- 349,353 ---- }); ! panel.setLayout(new BorderLayout()); pane1.setViewportView(mLinkBean); *************** *** 331,349 **** mSplitPane.setRightComponent(pane2); ! panel.add(mSplitPane, java.awt.BorderLayout.CENTER); mTextField.setToolTipText("Enter the URL to view"); ! panel.add(mTextField, java.awt.BorderLayout.SOUTH); ! getContentPane().add(panel, java.awt.BorderLayout.CENTER); pack(); ! java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); ! setSize(new java.awt.Dimension(640, 480)); setLocation((screenSize.width-640)/2,(screenSize.height-480)/2); }//GEN-END:initComponents /** Exit the Application */ ! private void exitForm (java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm System.exit (0); --- 359,377 ---- mSplitPane.setRightComponent(pane2); ! panel.add(mSplitPane, BorderLayout.CENTER); mTextField.setToolTipText("Enter the URL to view"); ! panel.add(mTextField, BorderLayout.SOUTH); ! getContentPane().add(panel, BorderLayout.CENTER); pack(); ! Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); ! setSize(new Dimension(640, 480)); setLocation((screenSize.width-640)/2,(screenSize.height-480)/2); }//GEN-END:initComponents /** Exit the Application */ ! private void exitForm (WindowEvent evt) {//GEN-FIRST:event_exitForm System.exit (0); *************** *** 364,367 **** --- 392,396 ---- /** * Unit test. + * @param args [0] The URL to use in the bean (optional). */ public static void main (String[] args) |