Java 类org.jfree.chart.plot.Crosshair 实例源码

项目:ccu-historian    文件:CrosshairOverlayTest.java   
/**
 * Basic checks for cloning.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    o1.addDomainCrosshair(new Crosshair(3.21));
    o1.addRangeCrosshair(new Crosshair(4.32));
    assertFalse(o1.equals(o2));
}
项目:jfreechart    文件:CrosshairOverlayTest.java   
/**
 * Basic checks for cloning.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.RED, 3.0f, 4.0f, Color.BLUE), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    o1.addDomainCrosshair(new Crosshair(3.21));
    o1.addRangeCrosshair(new Crosshair(4.32));
    assertFalse(o1.equals(o2));
}
项目:aya-lang    文件:CrosshairOverlayTest.java   
/**
 * Basic checks for cloning.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    o1.addDomainCrosshair(new Crosshair(3.21));
    o1.addRangeCrosshair(new Crosshair(4.32));
    assertFalse(o1.equals(o2));
}
项目:ECG-Viewer    文件:CrosshairOverlayTest.java   
/**
 * Basic checks for cloning.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    o1.addDomainCrosshair(new Crosshair(3.21));
    o1.addRangeCrosshair(new Crosshair(4.32));
    assertFalse(o1.equals(o2));
}
项目:group-five    文件:CrosshairOverlayTest.java   
/**
 * Basic checks for cloning.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    o1.addDomainCrosshair(new Crosshair(3.21));
    o1.addRangeCrosshair(new Crosshair(4.32));
    assertFalse(o1.equals(o2));
}
项目:buffer_bci    文件:CrosshairOverlayTest.java   
/**
 * Basic checks for cloning.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    o1.addDomainCrosshair(new Crosshair(3.21));
    o1.addRangeCrosshair(new Crosshair(4.32));
    assertFalse(o1.equals(o2));
}
项目:proyecto-teoria-control-utn-frro    文件:CrosshairOverlayTest.java   
/**
 * Basic checks for cloning.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    o1.addDomainCrosshair(new Crosshair(3.21));
    o1.addRangeCrosshair(new Crosshair(4.32));
    assertFalse(o1.equals(o2));
}
项目:Memetic-Algorithm-for-TSP    文件:CrosshairOverlayTest.java   
/**
 * Basic checks for cloning.
 */
@Test
public void testCloning() throws CloneNotSupportedException {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) o1.clone();
    assertTrue(o1 != o2);
    assertTrue(o1.getClass() == o2.getClass());
    assertTrue(o1.equals(o2));

    o1.addDomainCrosshair(new Crosshair(3.21));
    o1.addRangeCrosshair(new Crosshair(4.32));
    assertFalse(o1.equals(o2));
}
项目:rapidminer    文件:MultiAxesCrosshairOverlay.java   
public void addRangeCrosshair(int axisIdx, Crosshair crosshair) {
    while (rangeCrosshairs.size() < axisIdx + 1) {
        rangeCrosshairs.add(new ArrayList<Crosshair>());
    }

    rangeCrosshairs.get(axisIdx).add(crosshair);
    crosshair.addPropertyChangeListener(this);
}
项目:rapidminer    文件:MultiAxesCrosshairOverlay.java   
public void removeRangeCrosshair(int axisIdx, Crosshair crosshair) {
    if (rangeCrosshairs.size() > axisIdx) {
        ArrayList<Crosshair> crosshairsForRange = rangeCrosshairs.get(axisIdx);
        crosshairsForRange.remove(crosshair);
        crosshair.removePropertyChangeListener(this);
    }
}
项目:rapidminer    文件:MultiAxesCrosshairOverlay.java   
/**
 * Clears all range crosshairs on all axes.
 */
@Override
public void clearRangeCrosshairs() {
    for (List<Crosshair> crosshairsForRange : rangeCrosshairs) {
        for (Crosshair crosshair : crosshairsForRange) {
            crosshair.removePropertyChangeListener(this);
        }
    }
    rangeCrosshairs.clear();
}
项目:jfree-fxdemos    文件:CrosshairOverlayFXDemo1.java   
public MyDemoPane() {
    XYDataset dataset = createDataset();
    JFreeChart chart = createChart(dataset); 
    this.chartViewer = new ChartViewer(chart);
    this.chartViewer.addChartMouseListener(this);
    getChildren().add(this.chartViewer);

    CrosshairOverlayFX crosshairOverlay = new CrosshairOverlayFX();
    this.xCrosshair = new Crosshair(Double.NaN, Color.GRAY, 
            new BasicStroke(0f));
    this.xCrosshair.setStroke(new BasicStroke(1.5f, 
            BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1, 
            new float[]{2.0f, 2.0f}, 0));
    this.xCrosshair.setLabelVisible(true);
    this.yCrosshair = new Crosshair(Double.NaN, Color.GRAY, 
            new BasicStroke(0f));
    this.yCrosshair.setStroke(new BasicStroke(1.5f, 
            BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1, 
            new float[] {2.0f, 2.0f}, 0));
    this.yCrosshair.setLabelVisible(true);
    crosshairOverlay.addDomainCrosshair(xCrosshair);
    crosshairOverlay.addRangeCrosshair(yCrosshair);

    Platform.runLater(() -> {
        this.chartViewer.getCanvas().addOverlay(crosshairOverlay);
    });
}
项目:ccu-historian    文件:CrosshairOverlayTest.java   
/**
 * Serialize an instance, restore it, and check for equality.
 */
@Test
public void testSerialization() {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) TestUtilities.serialised(o1);
    assertEquals(o1, o2);
}
项目:ccu-historian    文件:CrosshairOverlay.java   
/**
 * Clears all the domain crosshairs from the overlay and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 */
public void clearDomainCrosshairs() {
    if (this.xCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List crosshairs = getDomainCrosshairs();
    for (int i = 0; i < crosshairs.size(); i++) {
        Crosshair c = (Crosshair) crosshairs.get(i);
        this.xCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:ccu-historian    文件:CrosshairOverlay.java   
/**
 * Adds a crosshair against the range axis and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 *
 * @param crosshair  the crosshair (<code>null</code> not permitted).
 */
public void addRangeCrosshair(Crosshair crosshair) {
    ParamChecks.nullNotPermitted(crosshair, "crosshair");
    this.yCrosshairs.add(crosshair);
    crosshair.addPropertyChangeListener(this);
    fireOverlayChanged();
}
项目:ccu-historian    文件:CrosshairOverlay.java   
/**
 * Clears all the range crosshairs from the overlay and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 */
public void clearRangeCrosshairs() {
    if (this.yCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List crosshairs = getRangeCrosshairs();
    for (int i = 0; i < crosshairs.size(); i++) {
        Crosshair c = (Crosshair) crosshairs.get(i);
        this.yCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:ccu-historian    文件:StandardCrosshairLabelGenerator.java   
/**
 * Returns a string that can be used as the label for a crosshair.
 *
 * @param crosshair  the crosshair (<code>null</code> not permitted).
 *
 * @return The label (possibly <code>null</code>).
 */
@Override
public String generateLabel(Crosshair crosshair) {
    Object[] v = new Object[] {this.numberFormat.format(
            crosshair.getValue())};
    String result = MessageFormat.format(this.labelTemplate, v);
    return result;
}
项目:jfreechart    文件:CrosshairOverlay.java   
/**
 * Clears all the domain crosshairs from the overlay and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 */
public void clearDomainCrosshairs() {
    if (this.xCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List<Crosshair> crosshairs = getDomainCrosshairs();
    for (Crosshair c : crosshairs) {
        this.xCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:jfreechart    文件:CrosshairOverlay.java   
/**
 * Adds a crosshair against the range axis and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 *
 * @param crosshair  the crosshair ({@code null} not permitted).
 */
public void addRangeCrosshair(Crosshair crosshair) {
    Args.nullNotPermitted(crosshair, "crosshair");
    this.yCrosshairs.add(crosshair);
    crosshair.addPropertyChangeListener(this);
    fireOverlayChanged();
}
项目:jfreechart    文件:CrosshairOverlay.java   
/**
 * Clears all the range crosshairs from the overlay and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 */
public void clearRangeCrosshairs() {
    if (this.yCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List<Crosshair> crosshairs = getRangeCrosshairs();
    for (Crosshair c : crosshairs) {
        this.yCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:jfreechart    文件:StandardCrosshairLabelGenerator.java   
/**
 * Returns a string that can be used as the label for a crosshair.
 *
 * @param crosshair  the crosshair ({@code null} not permitted).
 *
 * @return The label (possibly {@code null}).
 */
@Override
public String generateLabel(Crosshair crosshair) {
    Object[] v = new Object[] {this.numberFormat.format(
            crosshair.getValue())};
    String result = MessageFormat.format(this.labelTemplate, v);
    return result;
}
项目:jfreechart    文件:CrosshairOverlayTest.java   
/**
 * Serialize an instance, restore it, and check for equality.
 */
@Test
public void testSerialization() {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.RED, 3.0f, 4.0f, Color.BLUE), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) TestUtils.serialised(o1);
    assertEquals(o1, o2);
}
项目:aya-lang    文件:CrosshairOverlayTest.java   
/**
 * Serialize an instance, restore it, and check for equality.
 */
@Test
public void testSerialization() {
    CrosshairOverlay o1 = new CrosshairOverlay();
    o1.addDomainCrosshair(new Crosshair(99.9));
    o1.addRangeCrosshair(new Crosshair(1.23, new GradientPaint(1.0f, 2.0f,
            Color.red, 3.0f, 4.0f, Color.blue), new BasicStroke(1.1f)));
    CrosshairOverlay o2 = (CrosshairOverlay) TestUtilities.serialised(o1);
    assertEquals(o1, o2);
}
项目:aya-lang    文件:CrosshairOverlay.java   
/**
 * Clears all the domain crosshairs from the overlay and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 */
public void clearDomainCrosshairs() {
    if (this.xCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List crosshairs = getDomainCrosshairs();
    for (int i = 0; i < crosshairs.size(); i++) {
        Crosshair c = (Crosshair) crosshairs.get(i);
        this.xCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:aya-lang    文件:CrosshairOverlay.java   
/**
 * Adds a crosshair against the range axis and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 *
 * @param crosshair  the crosshair (<code>null</code> not permitted).
 */
public void addRangeCrosshair(Crosshair crosshair) {
    ParamChecks.nullNotPermitted(crosshair, "crosshair");
    this.yCrosshairs.add(crosshair);
    crosshair.addPropertyChangeListener(this);
    fireOverlayChanged();
}
项目:aya-lang    文件:CrosshairOverlay.java   
/**
 * Clears all the range crosshairs from the overlay and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 */
public void clearRangeCrosshairs() {
    if (this.yCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List crosshairs = getRangeCrosshairs();
    for (int i = 0; i < crosshairs.size(); i++) {
        Crosshair c = (Crosshair) crosshairs.get(i);
        this.yCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:aya-lang    文件:StandardCrosshairLabelGenerator.java   
/**
 * Returns a string that can be used as the label for a crosshair.
 *
 * @param crosshair  the crosshair (<code>null</code> not permitted).
 *
 * @return The label (possibly <code>null</code>).
 */
@Override
public String generateLabel(Crosshair crosshair) {
    Object[] v = new Object[] {this.numberFormat.format(
            crosshair.getValue())};
    String result = MessageFormat.format(this.labelTemplate, v);
    return result;
}
项目:rapidminer-studio    文件:MultiAxesCrosshairOverlay.java   
public void addRangeCrosshair(int axisIdx, Crosshair crosshair) {
    while (rangeCrosshairs.size() < axisIdx + 1) {
        rangeCrosshairs.add(new ArrayList<Crosshair>());
    }

    rangeCrosshairs.get(axisIdx).add(crosshair);
    crosshair.addPropertyChangeListener(this);
}
项目:rapidminer-studio    文件:MultiAxesCrosshairOverlay.java   
public void removeRangeCrosshair(int axisIdx, Crosshair crosshair) {
    if (rangeCrosshairs.size() > axisIdx) {
        ArrayList<Crosshair> crosshairsForRange = rangeCrosshairs.get(axisIdx);
        crosshairsForRange.remove(crosshair);
        crosshair.removePropertyChangeListener(this);
    }
}
项目:rapidminer-studio    文件:MultiAxesCrosshairOverlay.java   
/**
 * Clears all range crosshairs on all axes.
 */
@Override
public void clearRangeCrosshairs() {
    for (List<Crosshair> crosshairsForRange : rangeCrosshairs) {
        for (Crosshair crosshair : crosshairsForRange) {
            crosshair.removePropertyChangeListener(this);
        }
    }
    rangeCrosshairs.clear();
}
项目:populus    文件:CrosshairOverlay.java   
/**
 * Clears all the domain crosshairs from the overlay and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 */
public void clearDomainCrosshairs() {
    if (this.xCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List crosshairs = getDomainCrosshairs();
    for (int i = 0; i < crosshairs.size(); i++) {
        Crosshair c = (Crosshair) crosshairs.get(i);
        this.xCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:populus    文件:CrosshairOverlay.java   
/**
 * Adds a crosshair against the range axis and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 *
 * @param crosshair  the crosshair (<code>null</code> not permitted).
 */
public void addRangeCrosshair(Crosshair crosshair) {
    ParamChecks.nullNotPermitted(crosshair, "crosshair");
    this.yCrosshairs.add(crosshair);
    crosshair.addPropertyChangeListener(this);
    fireOverlayChanged();
}
项目:populus    文件:CrosshairOverlay.java   
/**
 * Clears all the range crosshairs from the overlay and sends an
 * {@link OverlayChangeEvent} to all registered listeners.
 */
public void clearRangeCrosshairs() {
    if (this.yCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List crosshairs = getRangeCrosshairs();
    for (int i = 0; i < crosshairs.size(); i++) {
        Crosshair c = (Crosshair) crosshairs.get(i);
        this.yCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:populus    文件:StandardCrosshairLabelGenerator.java   
/**
 * Returns a string that can be used as the label for a crosshair.
 *
 * @param crosshair  the crosshair (<code>null</code> not permitted).
 *
 * @return The label (possibly <code>null</code>).
 */
@Override
public String generateLabel(Crosshair crosshair) {
    Object[] v = new Object[] {this.numberFormat.format(
            crosshair.getValue())};
    String result = MessageFormat.format(this.labelTemplate, v);
    return result;
}
项目:PI    文件:CrosshairOverlay.java   
/**
 * Adds a crosshair against the domain axis.
 *
 * @param crosshair  the crosshair.
 */
public void addDomainCrosshair(Crosshair crosshair) {
    if (crosshair == null) {
        throw new IllegalArgumentException("Null 'crosshair' argument.");
    }
    this.xCrosshairs.add(crosshair);
    crosshair.addPropertyChangeListener(this);
}
项目:PI    文件:CrosshairOverlay.java   
public void removeDomainCrosshair(Crosshair crosshair) {
    if (crosshair == null) {
        throw new IllegalArgumentException("Null 'crosshair' argument.");
    }
    if (this.xCrosshairs.remove(crosshair)) {
        crosshair.removePropertyChangeListener(this);
        fireOverlayChanged();
    }
}
项目:PI    文件:CrosshairOverlay.java   
public void clearDomainCrosshairs() {
    if (this.xCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List crosshairs = getDomainCrosshairs();
    for (int i = 0; i < crosshairs.size(); i++) {
        Crosshair c = (Crosshair) crosshairs.get(i);
        this.xCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}
项目:PI    文件:CrosshairOverlay.java   
/**
 * Adds a crosshair against the range axis.
 *
 * @param crosshair  the crosshair.
 */
public void addRangeCrosshair(Crosshair crosshair) {
    if (crosshair == null) {
        throw new IllegalArgumentException("Null 'crosshair' argument.");
    }
    this.yCrosshairs.add(crosshair);
    crosshair.addPropertyChangeListener(this);
}
项目:PI    文件:CrosshairOverlay.java   
public void removeRangeCrosshair(Crosshair crosshair) {
    if (crosshair == null) {
        throw new IllegalArgumentException("Null 'crosshair' argument.");
    }
    if (this.yCrosshairs.remove(crosshair)) {
        crosshair.removePropertyChangeListener(this);
        fireOverlayChanged();
    }
}
项目:PI    文件:CrosshairOverlay.java   
public void clearRangeCrosshairs() {
    if (this.yCrosshairs.isEmpty()) {
        return;  // nothing to do
    }
    List crosshairs = getRangeCrosshairs();
    for (int i = 0; i < crosshairs.size(); i++) {
        Crosshair c = (Crosshair) crosshairs.get(i);
        this.yCrosshairs.remove(c);
        c.removePropertyChangeListener(this);
    }
    fireOverlayChanged();
}