Java Code Examples for org.jfree.chart.axis.ValueAxis#lengthToJava2D()

The following examples show how to use org.jfree.chart.axis.ValueAxis#lengthToJava2D() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChartLogicsFX.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Data width to pixel width on screen
 * 
 * @param myChart
 * @param dataWidth width of data
 * @param axis for width calculation
 * @return
 */
public static double calcWidthOnScreen(ChartViewer myChart, double dataWidth, ValueAxis axis,
    RectangleEdge axisEdge) {
  XYPlot plot = (XYPlot) myChart.getChart().getPlot();
  ChartRenderingInfo info = myChart.getRenderingInfo();
  Rectangle2D dataArea = info.getPlotInfo().getDataArea();

  // width 2D
  return axis.lengthToJava2D(dataWidth, dataArea, axisEdge);
}
 
Example 2
Source File: ChartLogics.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Data width to pixel width on screen
 * 
 * @param myChart
 * @param dataWidth width of data
 * @param axis for width calculation
 * @return
 */
public static double calcWidthOnScreen(ChartPanel myChart, double dataWidth, ValueAxis axis,
    RectangleEdge axisEdge) {
  XYPlot plot = (XYPlot) myChart.getChart().getPlot();
  ChartRenderingInfo info = myChart.getChartRenderingInfo();
  Rectangle2D dataArea = info.getPlotInfo().getDataArea();

  double width2D = axis.lengthToJava2D(dataWidth, dataArea, axisEdge);

  return width2D;
}
 
Example 3
Source File: ChartLogicsFX.java    From old-mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Data width to pixel width on screen
 * 
 * @param myChart
 * @param dataWidth width of data
 * @param axis for width calculation
 * @return
 */
public static double calcWidthOnScreen(ChartViewer myChart, double dataWidth, ValueAxis axis,
    RectangleEdge axisEdge) {
  XYPlot plot = (XYPlot) myChart.getChart().getPlot();
  ChartRenderingInfo info = myChart.getRenderingInfo();
  Rectangle2D dataArea = info.getPlotInfo().getDataArea();

  // width 2D
  return axis.lengthToJava2D(dataWidth, dataArea, axisEdge);
}
 
Example 4
Source File: ChartLogics.java    From old-mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Data width to pixel width on screen
 * 
 * @param myChart
 * @param dataWidth width of data
 * @param axis for width calculation
 * @return
 */
public static double calcWidthOnScreen(ChartPanel myChart, double dataWidth, ValueAxis axis,
    RectangleEdge axisEdge) {
  XYPlot plot = (XYPlot) myChart.getChart().getPlot();
  ChartRenderingInfo info = myChart.getChartRenderingInfo();
  Rectangle2D dataArea = info.getPlotInfo().getDataArea();

  double width2D = axis.lengthToJava2D(dataWidth, dataArea, axisEdge);

  return width2D;
}
 
Example 5
Source File: ChartLogicsFX.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Data width to pixel width on screen
 * 
 * @param myChart
 * @param dataWidth width of data
 * @param axis for width calculation
 * @return
 */
public static double calcWidthOnScreen(ChartViewer myChart, double dataWidth, ValueAxis axis,
    RectangleEdge axisEdge) {
  XYPlot plot = (XYPlot) myChart.getChart().getPlot();
  ChartRenderingInfo info = myChart.getRenderingInfo();
  Rectangle2D dataArea = info.getPlotInfo().getDataArea();

  // width 2D
  return axis.lengthToJava2D(dataWidth, dataArea, axisEdge);
}
 
Example 6
Source File: ChartLogics.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Data width to pixel width on screen
 * 
 * @param myChart
 * @param dataWidth width of data
 * @param axis for width calculation
 * @return
 */
public static double calcWidthOnScreen(ChartPanel myChart, double dataWidth, ValueAxis axis,
    RectangleEdge axisEdge) {
  XYPlot plot = (XYPlot) myChart.getChart().getPlot();
  ChartRenderingInfo info = myChart.getChartRenderingInfo();
  Rectangle2D dataArea = info.getPlotInfo().getDataArea();

  double width2D = axis.lengthToJava2D(dataWidth, dataArea, axisEdge);

  return width2D;
}