Bug #5659
closed
Kepler CaseGraphFrame and CaseGraphTableau have duplicated Ptolemy code.
Added by Christopher Brooks over 12 years ago.
Updated over 9 years ago.
Description
./gui/src/org/kepler/gui/frame/CaseGraphFrame.java
FIXME: Refactor!
Duplicate of ptolemy/src/ptolemy/vergil/modal/CaseGraphFrame.java
The Kepler version extends the Kepler-specific MultiCompositeGraphFrame which extends KeplerGraphFrame
./gui/src/org/kepler/gui/frame/CaseGraphTableau.java
FIXME: Refactor!
Probably like CaseGraphFrame above.
I'm reassigning this to Dan.
There has to be a better way to do this than to duplicate a bunch of code.
One solution is to move as much of the duplicated code as possible into static methods. There would still need to be CaseGraphFrame and CaseGraphTableau classes in Kepler, but they would be small.
Another solution is for KeplerGraphFrame to become a subclass of CaseGraphFrame. CaseGraphFrame would have to be updated to display a tabbed pane and create menus for adding/removing refinements only if the container was a Case actor.
Both solutions remove a lot of the duplicated code but do not really fix the problem... Comments? Other solutions?
One option would be to move more of the KeplerGraphFrame features in to BasicGraphFrame.
CaseGraphFrame would have to be updated to display a tabbed pane and create
menus for adding/removing refinements only if the container was a Case actor.
KeplerGraphFrame has tabs that appear in the right pane, but these tabs are not visible when I run kepler. Where do the tabs appear?
Can more of KeplerGraphFrame be merged into BasicGraphFrame?
One issue is that KeplerGraphFrame has scrollbars. Could these be disabled
for Vergil?
KeplerGraphFrame also has a save as that saves the kar files.
Maybe we can use some sort of mixin facility?
See
http://stackoverflow.com/questions/386695/option-for-inheritance
Original Bugzilla ID was 5659
- Target version changed from 2.5.0 to 2.X.Y
CaseGraphFrame is no longer in Kepler. CaseGraphTableau still is.
- Status changed from New to Closed
- % Done changed from 0 to 100
I'm not sure of the status of this bug.
There is a CaseGraphTableau in ptII and kepler/gui and a CaseGraphFrame in ptII:
./gui/src/org/kepler/gui/frame/CaseGraphTableau.java
./ptolemy/src/ptolemy/vergil/modal/CaseGraphFrame.java
./ptolemy/src/ptolemy/vergil/modal/CaseGraphTableau.java
There was a CaseGraphFrame in Kepler, but that was removed.
The duplicate code check for Kepler no longer shows a problem here, see http://terra.eecs.berkeley.edu:8080/job/kepler/Kepler_Duplicate_Code/
I'm closing this bug.
Also available in: Atom
PDF