[jdom-interest] Event enabled classes
mbernhardt at swsgmbh.de
Tue Jun 26 11:36:21 PDT 2001
I have written a set of event enabled jdom classes.
My events are not DOM v3 events (some words later).
Main purpose is the usage as model for a (swing) gui.
The classes are subclasses of the original (beta7).
I placed them into the package org.jdom.contrib.event.
I hope this is ok.
The package can be downloaded via ftp from:
Any suggestions are welcome !!!
THIS CODE IS BETA.
WORK IN PROGRESS.
1. Unzip package.
2. build.bat start_tree_model_example
1. Untar package.
2. build.sh start_tree_model_example
After a short time a frame with a tree in it should open.
Press the 'add new element' button.
If a new TreeNode is created everything is correct.
Change your variable declaration from anything like:
Document document = null;
org.jdom.Document document = null;
If you are using SAXBuilder, you have to add one line:
SAXBuilder builder = new SAXBuilder();
doc = (Document)builder.build(...);
HOW TO CREATE LISTENER:
Each listener has to be derived from
and to implement the method nodeChanged.
Now you can add it to or remove it from any
Element, Document, etc.
Your listener will be notified now about all changes.
Why not DOM v3:
DOM v3 specifies several types of events like
DocumentEvents, KeyEvents, FocusEvent etc.
Most of them java already have.
(Think they copied the java events)
DOM v3 specifies some things which are very
critical to performance like bubbling, etc.
I found some reasons to implement this features.
But no time.
I tried to keep an eye on performance.
If there are for example no listeners at an element,
the whole event stuff will be skipped.
- subclass PartialList / FilterList to fire events
- look for bugs
- code models, like
TreeModel, TableModel, TableColumnModel, ListSelectionModel ....
- think about bubbling
Hope someone likes this package.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 459 bytes
Desc: Card for Markus Bernhardt
Url : http://jdom.org/pipermail/jdom-interest/attachments/20010626/24c72589/mbernhardt.vcf
More information about the jdom-interest