Bug #5659
closedKepler CaseGraphFrame and CaseGraphTableau have duplicated Ptolemy code.
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.
Updated by Christopher Brooks about 12 years ago
I'm reassigning this to Dan.
There has to be a better way to do this than to duplicate a bunch of code.
Updated by Daniel Crawl about 12 years ago
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?
Updated by Christopher Brooks about 12 years ago
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
Updated by Daniel Crawl about 9 years ago
- Target version changed from 2.5.0 to 2.X.Y
CaseGraphFrame is no longer in Kepler. CaseGraphTableau still is.
Updated by Christopher Brooks about 9 years ago
- 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.