PathVisio / libGPML

Java library for reading / writing GPML files
Apache License 2.0
2 stars 4 forks source link

How to implement fireObjectModifiedEvent() and firePropertyChange() #9

Closed Finterly closed 3 years ago

Finterly commented 3 years ago

In PathVisio(3?) the core.model communicates via fireObjectModifiedEvent() which is a custom method similar to firePropertyChange() used in typical MVC application design.

Used in Set methods throughout Pathway Elements: fireObjectModifiedEvent(PathwayElementEvent.createSinglePropertyEvent(this, StaticProperty.LINETHICKNESS));

However because of the hierarchical architecture implemented in libGPML, set methods for graphics properties (e.g. lineColor) are nested (e.g. in LineStyleProperty). When fireObjectModifiedEvent() is called from LineStyleProperty, "this" will be the LineStyleProperty object rather than the PathwayElement. LineStyleProperty also does not hold a reference to the PathwayElement it belongs.

TODO: