![JAR search and dependency download from the Maven repository](/logo.png)
de.gsi.chart.ui.ResizableCanvas Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chartfx-chart Show documentation
Show all versions of chartfx-chart Show documentation
This charting library ${project.artifactId}- is an extension
in the spirit of Oracle's XYChart and performance/time-proven JDataViewer charting functionalities.
Emphasis was put on plotting performance for both large number of data points and real-time displays,
as well as scientific accuracies leading to error bar/surface plots, and other scientific plotting
features (parameter measurements, fitting, multiple axes, zoom, ...).
The newest version!
package de.gsi.chart.ui;
import javafx.scene.canvas.Canvas;
/**
* extended default Canvas class to be embeddable and resizable within a StackPane or Region
*
* @author rstein
*/
public class ResizableCanvas extends Canvas {
public ResizableCanvas() {
super();
}
@Override
public boolean isResizable() {
return true;
}
@Override
public double maxHeight(final double width) {
return Double.MAX_VALUE;
}
@Override
public double maxWidth(final double height) {
return Double.MAX_VALUE;
}
@Override
public double minHeight(final double width) {
return 1;
}
@Override
public double minWidth(final double height) {
return 1;
}
@Override
public double prefHeight(final double width) {
return getHeight();
}
@Override
public double prefWidth(final double height) {
return this.getWidth();
}
@Override
public void resize(final double w, final double h) {
super.resize(w, h);
setWidth(w);
setHeight(h);
// System.err.println("canvas resize to = " + String.format("%fx%f",
// getWidth(), getHeight()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy