Java Code Examples for org.jfree.chart.axis.LogAxis#setMinorTickCount()

The following examples show how to use org.jfree.chart.axis.LogAxis#setMinorTickCount() . 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: LogAxisTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    LogAxis a1 = new LogAxis("Test");
    LogAxis a2 = new LogAxis("Test");
    assertTrue(a1.equals(a2));

    a1.setBase(2.0);
    assertFalse(a1.equals(a2));
    a2.setBase(2.0);
    assertTrue(a1.equals(a2));

    a1.setSmallestValue(0.1);
    assertFalse(a1.equals(a2));
    a2.setSmallestValue(0.1);
    assertTrue(a1.equals(a2));

    a1.setMinorTickCount(8);
    assertFalse(a1.equals(a2));
    a2.setMinorTickCount(8);
    assertTrue(a1.equals(a2));
}
 
Example 2
Source File: LogAxisTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    LogAxis a1 = new LogAxis("Test");
    LogAxis a2 = new LogAxis("Test");
    assertTrue(a1.equals(a2));

    a1.setBase(2.0);
    assertFalse(a1.equals(a2));
    a2.setBase(2.0);
    assertTrue(a1.equals(a2));

    a1.setSmallestValue(0.1);
    assertFalse(a1.equals(a2));
    a2.setSmallestValue(0.1);
    assertTrue(a1.equals(a2));

    a1.setMinorTickCount(8);
    assertFalse(a1.equals(a2));
    a2.setMinorTickCount(8);
    assertTrue(a1.equals(a2));
}
 
Example 3
Source File: ScatterPlotChart.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
public ScatterPlotChart(ScatterPlotWindow window, ScatterPlotTopPanel topPanel,
    PeakList peakList) {

  super(null);

  this.window = window;
  this.peakList = peakList;
  this.topPanel = topPanel;

  // initialize the chart by default time series chart from factory
  chart = ChartFactory.createXYLineChart("", // title
      "", // x-axis label
      "", // y-axis label
      null, // data set
      PlotOrientation.VERTICAL, // orientation
      false, // create legend
      false, // generate tooltips
      false // generate URLs
  );

  chart.setBackgroundPaint(Color.white);
  setChart(chart);

  // disable maximum size (we don't want scaling)
  // setMaximumDrawWidth(Integer.MAX_VALUE);
  // setMaximumDrawHeight(Integer.MAX_VALUE);

  // set the plot properties
  plot = chart.getXYPlot();
  plot.setBackgroundPaint(Color.white);
  plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
  plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
  plot.setSeriesRenderingOrder(SeriesRenderingOrder.FORWARD);
  plot.setDomainGridlinePaint(gridColor);
  plot.setRangeGridlinePaint(gridColor);

  // Set the domain log axis
  LogAxis logAxisDomain = new LogAxis();
  logAxisDomain.setMinorTickCount(1);
  logAxisDomain.setNumberFormatOverride(MZmineCore.getConfiguration().getIntensityFormat());
  logAxisDomain.setAutoRange(true);
  plot.setDomainAxis(logAxisDomain);

  // Set the range log axis
  LogAxis logAxisRange = new LogAxis();
  logAxisRange.setMinorTickCount(1);
  logAxisRange.setNumberFormatOverride(MZmineCore.getConfiguration().getIntensityFormat());
  logAxisRange.setAutoRange(true);
  plot.setRangeAxis(logAxisRange);

  // Set crosshair properties
  plot.setDomainCrosshairVisible(true);
  plot.setRangeCrosshairVisible(true);
  plot.setDomainCrosshairPaint(crossHairColor);
  plot.setRangeCrosshairPaint(crossHairColor);
  plot.setDomainCrosshairStroke(crossHairStroke);
  plot.setRangeCrosshairStroke(crossHairStroke);

  // Create data sets;
  mainDataSet = new ScatterPlotDataSet(peakList);
  plot.setDataset(0, mainDataSet);
  diagonalLineDataset = new DiagonalLineDataset();
  plot.setDataset(1, diagonalLineDataset);

  // Create renderers
  mainRenderer = new ScatterPlotRenderer();
  plot.setRenderer(0, mainRenderer);
  diagonalLineRenderer = new DiagonalLineRenderer();
  plot.setRenderer(1, diagonalLineRenderer);

  // Set tooltip properties
  // ttm = new ComponentToolTipManager();
  // ttm.registerComponent(this);
  // setDismissDelay(Integer.MAX_VALUE);
  // setInitialDelay(0);

  // add items to popup menu TODO: add other Show... items
  ContextMenu popupMenu = getContextMenu();
  // popupMenu.addSeparator();
  // GUIUtils.addMenuItem(popupMenu, "Show Chromatogram", this, "TIC");

  // reset zoom history
  ZoomHistory history = getZoomHistory();
  if (history != null)
    history.clear();
}
 
Example 4
Source File: ScatterPlotChart.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
public ScatterPlotChart(ScatterPlotWindow window, ScatterPlotTopPanel topPanel,
    PeakList peakList) {

  super(null, true);

  this.window = window;
  this.peakList = peakList;
  this.topPanel = topPanel;

  // initialize the chart by default time series chart from factory
  chart = ChartFactory.createXYLineChart("", // title
      "", // x-axis label
      "", // y-axis label
      null, // data set
      PlotOrientation.VERTICAL, // orientation
      false, // create legend
      false, // generate tooltips
      false // generate URLs
  );

  chart.setBackgroundPaint(Color.white);
  setChart(chart);

  // disable maximum size (we don't want scaling)
  setMaximumDrawWidth(Integer.MAX_VALUE);
  setMaximumDrawHeight(Integer.MAX_VALUE);

  // set the plot properties
  plot = chart.getXYPlot();
  plot.setBackgroundPaint(Color.white);
  plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
  plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
  plot.setSeriesRenderingOrder(SeriesRenderingOrder.FORWARD);
  plot.setDomainGridlinePaint(gridColor);
  plot.setRangeGridlinePaint(gridColor);

  // Set the domain log axis
  LogAxis logAxisDomain = new LogAxis();
  logAxisDomain.setMinorTickCount(1);
  logAxisDomain.setNumberFormatOverride(MZmineCore.getConfiguration().getIntensityFormat());
  logAxisDomain.setAutoRange(true);
  plot.setDomainAxis(logAxisDomain);

  // Set the range log axis
  LogAxis logAxisRange = new LogAxis();
  logAxisRange.setMinorTickCount(1);
  logAxisRange.setNumberFormatOverride(MZmineCore.getConfiguration().getIntensityFormat());
  logAxisRange.setAutoRange(true);
  plot.setRangeAxis(logAxisRange);

  // Set crosshair properties
  plot.setDomainCrosshairVisible(true);
  plot.setRangeCrosshairVisible(true);
  plot.setDomainCrosshairPaint(crossHairColor);
  plot.setRangeCrosshairPaint(crossHairColor);
  plot.setDomainCrosshairStroke(crossHairStroke);
  plot.setRangeCrosshairStroke(crossHairStroke);

  // Create data sets;
  mainDataSet = new ScatterPlotDataSet(peakList);
  plot.setDataset(0, mainDataSet);
  diagonalLineDataset = new DiagonalLineDataset();
  plot.setDataset(1, diagonalLineDataset);

  // Create renderers
  mainRenderer = new ScatterPlotRenderer();
  plot.setRenderer(0, mainRenderer);
  diagonalLineRenderer = new DiagonalLineRenderer();
  plot.setRenderer(1, diagonalLineRenderer);

  // Set tooltip properties
  ttm = new ComponentToolTipManager();
  ttm.registerComponent(this);
  setDismissDelay(Integer.MAX_VALUE);
  setInitialDelay(0);

  // add items to popup menu TODO: add other Show... items
  JPopupMenu popupMenu = getPopupMenu();
  popupMenu.addSeparator();
  GUIUtils.addMenuItem(popupMenu, "Show Chromatogram", this, "TIC");

  // Add EMF and EPS options to the save as menu
  JMenuItem saveAsMenu = (JMenuItem) popupMenu.getComponent(3);
  GUIUtils.addMenuItem(saveAsMenu, "EMF...", this, "SAVE_EMF");
  GUIUtils.addMenuItem(saveAsMenu, "EPS...", this, "SAVE_EPS");

  // reset zoom history
  ZoomHistory history = getZoomHistory();
  if (history != null)
    history.clear();
}