Too many private field declaration without access methods #329
Replies: 4 comments
-
Instead of accessing
|
Beta Was this translation helpful? Give feedback.
-
But I want the zoom rect being drawn when moving the mouse reflect the
final zoom that will be applied if the mouse is released
Em seg., 28 de nov. de 2022 18:56, trashgod ***@***.***>
escreveu:
… Instead of accessing zoomPoint, consider adding an AxisChangeListener
that restores the lower bound; do likewise for the domain.
rangeAxis.addChangeListener(new AxisChangeListener() {
@OverRide
public void axisChanged(AxisChangeEvent event) {
EventQueue.invokeLater(() -> {
rangeAxis.setLowerBound(0);
});
}
});
—
Reply to this email directly, view it on GitHub
<#329 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG247S7RMTJASACABBU5ECTWKU2A5ANCNFSM6AAAAAASNHDC6Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
It seems to work for me using this example. |
Beta Was this translation helpful? Give feedback.
-
What I did is just modify the appropriate private variables to be protected. True it makes for a bit of a pain in the rear if/when you update your jfreechart baseline, but you'll survive lol. I do :-) |
Beta Was this translation helpful? Give feedback.
-
The code is full of private access field declaration. This makes some simple extensions difficult.
For example: I implemented a chart that the value axis starts always on zero, no matter the zoom level. So the zoom painted box should always starts on zero, no matter where I started drawing it. If I had access to zoomPoint, it would be enough to change it to set Y to zero position of the chart. But it is declared as private with no access method. I can implement the correct behaviour accessing zoomPoint with java reflection on JDK 11, but this cannot work on other or future releases of Java.
Beta Was this translation helpful? Give feedback.
All reactions