[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[udig-devel] First cut of Events done! Please test
|
You will see I made a StyleComponent to hold the event shunting code,
this bottoms out
at StyleLayerDescriptor - which actually fires events.
I think the setters should look like this for "simple content" like
name, title, description:
public void setName(String name) {
this.name = name;
fireChanged();
}
For a more complicated thing - that is still in the style package:
public void setFill(Fill fill) {
if( this.fill == fill ) return;
if( this.fill != null ){
fireChildRemoved( fill );
}
this.fill = fill;
if( fill != null ){
fireChildAdded( fill );
}
}
And finally for something like an Expression (that the user interface
may be in the middle
of editing):
public void setRotation(Expression rotation) {
this.rotation = rotation;
fireChildChanged( rotation );
}
public void setRotation(double rotation) {
setRotation(filterFactory.createLiteralExpression( rotation
));
}
What is left to do? Lists - I placed the fireChilfChanged( child1,
child2 ) to handle moves, but we really
need to break out a list to intercept edits of this nature. Currently
the best that can be done is smacking
the entire array for a single "changed" event.
The deltas work as expected, I create a StyleAdapater (abstract
StyleListener according to Java naming conventions) where we can
put utility code to help people understand the events.
Jody
Jody