Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve more java plotting APIs #6237

Closed
scottdraves opened this issue Nov 5, 2017 · 3 comments
Closed

improve more java plotting APIs #6237

scottdraves opened this issue Nov 5, 2017 · 3 comments

Comments

@scottdraves
Copy link
Contributor

many of our plotting methods take Object and then dispatch on the type.
they should declare the most specific types possible, and have multiple methods to get our polymorphic behavior.
here's an example of a previous fix like this: #6142
we need to apply the same idea in these places (copying Joe's comment):

Since you asked .... Here's what a quick grep turns up for setters taking Object:

  • setBase in CategoryStems, CategoryArea, CategoryBars, BasedXYGraphics
  • setStyle in CategoryStems, CategoryLines, Stems
  • setSize in CategoryPoints, Points
  • setShape in CategoryPoints, Points
  • setFill in CategoryPoints, CategoryArea, CategoryBars, Points
  • setOutlineColor in CategoryPoints, CategoryArea, CategoryBars, Bars, Points
  • setWidth in CategoryArea, CategoryBars, Bars
  • setDrawOutline in CategoryArea, CategoryBars
  • setX in ConstantLine, Text
  • setData in Histogram

setValue in CategoryGraphics takes an array of Objects, expecting it to be an array of either array of Number or List of Number, if I'm following the code correctly. Since arrays are not generic, those could be successfully overloaded without hitting type erasure problems.

Setters taking a List of Objects, however, which includes some of the color-related ones that result from adding overloads and setX in XYGraphics and ConstantBand, can't be turned into overloads because of type erasure.

I'm not sure what to make of setItemLabel in CategoryGraphics or setToolTip in XYGraphics. I'm happy to ignore them for now.

@scottdraves
Copy link
Contributor Author

this was done here: #6253

@scottdraves
Copy link
Contributor Author

@jpallas any more?

@jpallas
Copy link
Contributor

jpallas commented Nov 7, 2017

I think that covers it for plotting, except for AbstractChart.setYBound and XYChart.setXBound taking a bare List that looks like it should be List<Number>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants