Changes between Initial Version and Version 2 of Ticket #422


Ignore:
Timestamp:
Jun 6, 2013, 10:23:30 AM (11 years ago)
Author:
Kevin Milner
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #422

    • Property Status changed from new to closed
    • Property Resolution changed from to fixed
  • Ticket #422 – Description

    initial v2  
    11Refactor GraphPanel and related classes - remove nasty APIs and make self contained GraphWidget class which can be shared by GraphWindow and regular applications.
     2
     3DONE - here is a summary of changes
     4
     5Previously there were 4 primary classes:
     6    * GraphPanel - actually does the graphing, extends JSplitPane
     7    * GraphWindow - used for peel off and most non-application embedded plotting, extends JFrame
     8    * GraphiWindowAPI_Impl - wrapper for GraphWindow which implements all of its various APIs
     9    * HeadlessGraphPanel - for headless plotting
     10As well as a some utility/GUI component classes:
     11    * ButtonControlPanel - buttons below the Graph Panel
     12    * PlotColorAndLineTypeSelectorControlPanel - GUI to set colors and plotting styles for curves
     13    * AxisLimitsControlPanel - GUI to set axis limits
     14As well as a bunch of interfaces which applications must implement in order to use the above classes:
     15    * GraphPanelAPI - must be implemented in order to use a GraphPanel
     16    * GraphWindowAPI - must be implemented in order to show a GraphWindow
     17    * ButtonControlPanelAPI - must be implemented in order to use a ButtonControlPanel
     18    * PlotControllerAPI - must be implemented in order to use a GraphPanel
     19    * PlotColorAndLineTypeSelectorControlPanelAPI - must be implemented in order to use a PlotColorAndLineTypeSelectorControlPane
     20    * AxisLimitsControlPanelAPI - must be implemented in order to use AxisLimitsControlPanel
     21
     22All of these interfaces were created such that the ButtonControlPanel and various other GUI components could be embedded in an application or used separately in a GraphWindow. The thing is, none of them are actually needed if we just had a class which represented a GraphPanel and associated controls that could be embedded into an application or standalone window...enter GraphWidget. GraphWidget encompasses the GraphPanel and all controls (buttons, style, axis limits) and is used both by applications and GraphWindow. Here is the new class list:
     23
     24New primary classes:
     25    * GraphPanel - actually does the graphing, extends JSplitPane
     26    * GraphWidget - widget for all GraphPanel and all associated controls, extends JPanel
     27    * GraphWindow - used for peel off and most non-application embedded plotting, extends JFrame
     28    * HeadlessGraphPanel - for headless plotting
     29
     30All of those APIs have be removed, and our applications are much cleaner. There is also much less code duplication as the controls and APIs don't need to be implemented everywhere. The GraphWindow class functions much like (and has similar constructors/methods to) the old GraphiWindowAPI_Impl class. I tried to document as much as I could, and make sure everything was working correctly but there may be bugs. Also some very old one off plots (classes that were used to make a plot in UCERF2 for example) did not get fully upgraded in that they might not display in log format by default where they previously might have been. There were over 1000 errors when I finished the new class structure so I did my best but didn't spend much time on plots which are likely never going to be used again.
     31
     32There was also a some nastiness in the way that WeightedFunctionLists were handled - basically GraphPanel took an ArrayList of Objects, which were mixed between XYDataSets and WeightedFunctionLists. Both of these now extend a common interface PlotElement, with some common methods which allowed for simplification of GraphPanel and use of Generics.
     33
     34Additionally, these updates/new features have been added:
     35
     36* All classes work with PlotSpec objects
     37* Auto scale has been separated for the X an Y axis, so that for example you can specify a custom X scale but still use auto Y scale
     38* XY annotation support added - you can now add XYAnnotations (such as text annotations) to a PlotSpec object and they will be included in the plots
     39* All plotting classes moved to commons from sha
     40* new PlotMultiDataLayer object which implements PlotElement for adding many lines to plots such as separators and such with the same characteristics without flooding the plot data window. For example, the fault based paleo plots could have very clean metadata now if I used this new object.
     41* subplot support, currently only at the GraphPanel level (can only be used by HeadlessGraphPanel right now but could be exposed further).
     42* plot preferences (font sizes and background colors) now in PlotPreferences object, could potentially store user specific properties that get loaded in on application start.