marcomachadosantos / gwt-chronoscope

Automatically exported from code.google.com/p/gwt-chronoscope
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Generalize TickFormatterFactory so that it controls the zoom link and date range formatting as well #106

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, TickFormatterFactory configures a chain of date/time TickFormatter 
objects, which are 
used by DomainAxisPanel to render the domain ticks.  A while back, a user 
requested a more 
general-purpose domain axis, which could display generic integers (they wanted 
the domain to 
represent revision control version #'s).  The short term solution for 
addressing this need was to 
make DomainAxisPanel a subclass of RangeAxisPanel, and then let XYPlot override 
the default 
DomainAxisPanel with an instance of RangeAxisPanel (which would take the 
responsibility of 
drawing the domain using the existing vertical range tick logic).  Some issues 
with this approach 
as a long term solution are:

    1) Propagation of if-then logic in RangeAxisPanel, LegendAxisPanel, and DateRangePanel to 
handle formatting based on whether or not domain represents timestamps or 
integers.
    2) Class hierarchy is somewhat confusing from a OO modeling perspective, as a "domain axis 
panel" is not really a specialization of a "range axis panel".

Proposed solution is this:

    1) TickFormatterFactory/TickFormatter becomes abstract.
    2) Create 2 subclass families: DateTickFormatterFactory/DateTickFormatter, and 
IntTickFormatterFactory/IntTickFormatter.  The "Date*" subclasses contain the 
current logic for 
rendering date ticks.
    3) Add more methods to TickFormatter that facilitate configuration of zoom link and date 
range formatting logic (probably want to rename these classes to something more 
general than 
"Tick*" at this point).

Original issue reported on code.google.com by chadtaka...@gmail.com on 5 Jan 2009 at 7:32

GoogleCodeExporter commented 8 years ago
Will need to make the TickFormatterFactory implementation configurable from 
XYPlot.

Original comment by chadtaka...@gmail.com on 6 Jan 2009 at 12:27

GoogleCodeExporter commented 8 years ago
Steps 1) and 2) in the "Proposed solution" section have been implemented in 
r834.

Original comment by chadtaka...@gmail.com on 6 Jan 2009 at 7:05