The old code has a class for "Static properties for ObjectTypes, linked in PathwayElement". We had removed this class since we took a more object oriented approach. However these static properties are used in the
fireObjectModifiedEvent() seems to be similar to public void firePropertyChange(String propertyName, int oldValue, int newValue).
What is the reason for the need of a String propertyName or StaticProperty? It seems to be necessary for updating listeners and tracking properties. Therefore, we would need to also define these StaticProperties again?
public void fireObjectModifiedEvent(PathwayElementEvent e) {
if (noFire > 0) {
noFire -= 1;
return;
}
if (parent != null)
parent.childModified(e);
for (PathwayElementListener g : listeners) {
g.gmmlObjectModified(e);
}
}
....
protected static PathwayElementEvent createSinglePropertyEvent(PathwayElement pwe, Object property) {
return new PathwayElementEvent(pwe, property, false);
}
/**
* Constructor.
*
* @param elem the PathwayElement that's been modified
* @param prop the Property on the element that's been modified
* @param coordinateChange Flag to indicate this event applies to a coordinate change.
*/
private PathwayElementEvent(PathwayElement elem, Object prop, boolean coordinateChange) {
pwElement = elem;
property = prop;
this.coordinateChange = coordinateChange;
}
@egonw
The old code has a class for "Static properties for ObjectTypes, linked in PathwayElement". We had removed this class since we took a more object oriented approach. However these static properties are used in the
fireObjectModifiedEvent(PathwayElementEvent.createSinglePropertyEvent(this, StaticProperty.TEXTLABEL));
fireObjectModifiedEvent() seems to be similar to public void firePropertyChange(String propertyName, int oldValue, int newValue).
What is the reason for the need of a String propertyName or StaticProperty? It seems to be necessary for updating listeners and tracking properties. Therefore, we would need to also define these StaticProperties again?