david.gilbert wrote:wwwclaes wrote:1. What do you think about changing several of your private class member vars to protected? Sometimes functionality needs to be added to your classes and I think inheritance is a good means not to mess with your core. Right now, I have extended eg JFreeChart, ChartPanel, XYPlot and StandardXYItemRenderer. But I couldn't do it without changing many of the member vars in those classes from private to protected.
In general, I don't want to change them. But if you make a good case for specific cases, I'll look at them.
The problem is, they are so many (29 of them as of yet I think). For instance, I override draw(...) and drawItem(...) to implement the rulers. I want to keep original behaviour but add some additional in the middle of it so it's a copy'n paste with slight modifications. But I can't implement those in my subclass unless I change all member variables (and methods) they use from private to protected. (However, this is not a big issue for us, we will ship with JFreeChart included and can modify it as needed.)
david.gilbert wrote:wwwclaes wrote:2. One of the things I've added is two vertical rulers (no, crosshairs didn't do what the customer wanted) that snap onto actual item values in series while being moved. During zoom they hold on to their item value. If they get out of zoom they reappear at the closest visible value (hence they're always there). If anyone would be interested in this, let me know and I'll try to send it to you... (it required quite a few changes hence it's a bit messy and probably not suitable as a patch for this forum)
Can you explain what these are used for? I'd like to understand the requirement so I can keep it in mind for future changes.
Well, they want two rulers that can be moved along the X-axis to display values from the series which are being displayed in legends (not the JFreeChart ones) below the chart. Suppose there are 8 series, then they can see all 2*8 values at the same time (two ruler values, both X and Y, for each series). They also want to see rulers diffs for each series.
Operations such as trend lines should be displayed in the range of the rulers rather than over the entire display. For other ruler behaviour, see my description above. If you want code samples, I would be glad to send it to you.
david.gilbert wrote:wwwclaes wrote:3. A number of functions should be calculated based on the values within these rulers. Is there an easy way to extract the ruler subrange from a TimeSeriesCollection (that always only contains one Series) based on the ruler range values (as doubles)?
The only thing I can suggest is the createCopy() methods in the TimeSeries class.
Whoops, look like I may have missed that one... Thanks!