Java Code Examples for org.jfree.data.Range#equals()

The following examples show how to use org.jfree.data.Range#equals() . 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: ChartGroup.java    From mzmine3 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * adds the charts range and domain range to the max ranges
 * 
 * @param chart
 */
private void addChartToMaxRange(JFreeChart chart) {
  // domain
  Range nd = addRanges(maxRange[0], getDomainRange(chart));
  if (nd != null && (maxRange[0] == null || !nd.equals(maxRange[0]))) {
    maxRange[0] = nd;
    domainHasChanged(nd);
  }

  // range axis
  nd = addRanges(maxRange[1], getRangeRange(chart));
  if (nd != null && (maxRange[1] == null || !nd.equals(maxRange[1]))) {
    maxRange[1] = nd;
    rangeHasChanged(nd);
  }
}
 
Example 2
Source File: ChartGroup.java    From mzmine2 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * adds the charts range and domain range to the max ranges
 * 
 * @param chart
 */
private void addChartToMaxRange(JFreeChart chart) {
  // domain
  Range nd = addRanges(maxRange[0], getDomainRange(chart));
  if (nd != null && (maxRange[0] == null || !nd.equals(maxRange[0]))) {
    maxRange[0] = nd;
    domainHasChanged(nd);
  }

  // range axis
  nd = addRanges(maxRange[1], getRangeRange(chart));
  if (nd != null && (maxRange[1] == null || !nd.equals(maxRange[1]))) {
    maxRange[1] = nd;
    rangeHasChanged(nd);
  }
}
 
Example 3
Source File: AxisRangeChangedListener.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void axisChanged(AxisChangeEvent e) {
  ValueAxis a = (ValueAxis) e.getAxis();
  Range r = a.getRange();

  if (r != null && (lastRange == null || !r.equals(lastRange))) {
    // range has changed
    axisRangeChanged(chart, a, lastRange, r);
  }
  lastRange = r;
}
 
Example 4
Source File: AxesRangeChangedListener.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void axisChanged(AxisChangeEvent e) {
  ValueAxis a = (ValueAxis) e.getAxis();
  Range r = a.getRange();

  boolean found = false;
  int i = 0;
  for (i = 0; i < axis.length && !found; i++) {
    // get index of axis
    if (axis[i] == null)
      break;
    if (a.equals(axis[i])) {
      found = true;
      break;
    }
  }
  if (i >= axis.length)
    i = axis.length - 1;
  // insert if not found
  if (!found) {
    axis[i] = a;
  }

  if (r != null && (lastRange[i] == null || !r.equals(lastRange[i]))) {
    // range has changed
    axesRangeChanged(chart, a, lastRange[i], r);
  }
  lastRange[i] = r;
}
 
Example 5
Source File: AxisRangeChangedListener.java    From old-mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void axisChanged(AxisChangeEvent e) {
  ValueAxis a = (ValueAxis) e.getAxis();
  Range r = a.getRange();

  if (r != null && (lastRange == null || !r.equals(lastRange))) {
    // range has changed
    axisRangeChanged(chart, a, lastRange, r);
  }
  lastRange = r;
}
 
Example 6
Source File: AxesRangeChangedListener.java    From old-mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void axisChanged(AxisChangeEvent e) {
  ValueAxis a = (ValueAxis) e.getAxis();
  Range r = a.getRange();

  boolean found = false;
  int i = 0;
  for (i = 0; i < axis.length && !found; i++) {
    // get index of axis
    if (axis[i] == null)
      break;
    if (a.equals(axis[i])) {
      found = true;
      break;
    }
  }
  if (i >= axis.length)
    i = axis.length - 1;
  // insert if not found
  if (!found) {
    axis[i] = a;
  }

  if (r != null && (lastRange[i] == null || !r.equals(lastRange[i]))) {
    // range has changed
    axesRangeChanged(chart, a, lastRange[i], r);
  }
  lastRange[i] = r;
}
 
Example 7
Source File: AxisRangeChangedListener.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void axisChanged(AxisChangeEvent e) {
  ValueAxis a = (ValueAxis) e.getAxis();
  Range r = a.getRange();

  if (r != null && (lastRange == null || !r.equals(lastRange))) {
    // range has changed
    axisRangeChanged(chart, a, lastRange, r);
  }
  lastRange = r;
}
 
Example 8
Source File: AxesRangeChangedListener.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void axisChanged(AxisChangeEvent e) {
  ValueAxis a = (ValueAxis) e.getAxis();
  Range r = a.getRange();

  boolean found = false;
  int i = 0;
  for (i = 0; i < axis.length && !found; i++) {
    // get index of axis
    if (axis[i] == null)
      break;
    if (a.equals(axis[i])) {
      found = true;
      break;
    }
  }
  if (i >= axis.length)
    i = axis.length - 1;
  // insert if not found
  if (!found) {
    axis[i] = a;
  }

  if (r != null && (lastRange[i] == null || !r.equals(lastRange[i]))) {
    // range has changed
    axesRangeChanged(chart, a, lastRange[i], r);
  }
  lastRange[i] = r;
}