org.htmlparser.beans

Class BeanyBaby

Implemented Interfaces:
ActionListener, MouseListener, PropertyChangeListener

public class BeanyBaby
extends JFrame
implements PropertyChangeListener, ActionListener, MouseListener

Demo of beans. Created on December 30, 2002, 7:54 PM
Author:
Derrick Oswald

Field Summary

protected int
mCrumb
Current position on the bread crumb trail.
protected Vector
mTrail
Bread crumb trail of visited URLs.

Constructor Summary

BeanyBaby()
Creates new form BeanyBaby

Method Summary

void
actionPerformed(ActionEvent event)
Handles UI events.
static void
main(String[] args)
Unit test.
void
mouseClicked(MouseEvent event)
Invoked when the mouse button has been clicked on a component.
void
mouseEntered(MouseEvent event)
Invoked when the mouse enters a component.
void
mouseExited(MouseEvent event)
Invoked when the mouse exits a component.
void
mousePressed(MouseEvent event)
Invoked when a mouse button has been pressed on a component.
void
mouseReleased(MouseEvent event)
Invoked when a mouse button has been released on a component.
void
propertyChange(PropertyChangeEvent event)
This method ties the two beans together on the same connection.
void
setURL(String url)
Set the URL for the bean.

Field Details

mCrumb

protected int mCrumb
Current position on the bread crumb trail.

mTrail

protected Vector mTrail
Bread crumb trail of visited URLs.

Constructor Details

BeanyBaby

public BeanyBaby()
Creates new form BeanyBaby

Method Details

actionPerformed

public void actionPerformed(ActionEvent event)
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.
Parameters:
event - Details about the action.

main

public static void main(String[] args)
Unit test.
Parameters:
args - [0] The URL to use in the bean (optional).

mouseClicked

public void mouseClicked(MouseEvent event)
Invoked when the mouse button has been clicked on a component. A mouse click is a press and release of a mouse button.
Parameters:
event - Details on the mouse event.

mouseEntered

public void mouseEntered(MouseEvent event)
Invoked when the mouse enters a component.
Parameters:
event - Details on the mouse event.

mouseExited

public void mouseExited(MouseEvent event)
Invoked when the mouse exits a component.
Parameters:
event - Details on the mouse event.

mousePressed

public void mousePressed(MouseEvent event)
Invoked when a mouse button has been pressed on a component.
Parameters:
event - Details on the mouse event.

mouseReleased

public void mouseReleased(MouseEvent event)
Invoked when a mouse button has been released on a component.
Parameters:
event - Details on the mouse event.

propertyChange

public void propertyChange(PropertyChangeEvent event)
This method ties the two beans together on the same connection. Whenever a property changes on one bean, make sure the URL properties agree by setting the URL from one to the other.
Parameters:
event - The event describing the event source and the property that has changed.

setURL

public void setURL(String url)
Set the URL for the bean.
Parameters:
url - The URL to use in the bean.

HTML Parser is an open source library released under LGPL. SourceForge.net