org.jfree.chart.panel.Overlay Java Examples

The following examples show how to use org.jfree.chart.panel.Overlay. 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: ChartPanel.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Removes an overlay from the panel.
 *
 * @param overlay  the overlay to remove (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void removeOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    boolean removed = this.overlays.remove(overlay);
    if (removed) {
        overlay.removeChangeListener(this);
        repaint();
    }
}
 
Example #2
Source File: ChartPanel.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Removes an overlay from the panel.
 *
 * @param overlay  the overlay to remove (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void removeOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    boolean removed = this.overlays.remove(overlay);
    if (removed) {
        overlay.removeChangeListener(this);
        repaint();
    }
}
 
Example #3
Source File: ChartPanel.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Removes an overlay from the panel.
 *
 * @param overlay  the overlay to remove (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void removeOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    boolean removed = this.overlays.remove(overlay);
    if (removed) {
        overlay.removeChangeListener(this);
        repaint();
    }
}
 
Example #4
Source File: ChartPanel.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes an overlay from the panel.
 *
 * @param overlay  the overlay to remove (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void removeOverlay(Overlay overlay) {
    if (overlay == null) {
        throw new IllegalArgumentException("Null 'overlay' argument.");
    }
    boolean removed = this.overlays.remove(overlay);
    if (removed) {
        overlay.removeChangeListener(this);
        repaint();
    }
}
 
Example #5
Source File: ChartPanel.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add an overlay to the panel.
 *
 * @param overlay  the overlay (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void addOverlay(Overlay overlay) {
    if (overlay == null) {
        throw new IllegalArgumentException("Null 'overlay' argument.");
    }
    this.overlays.add(overlay);
    overlay.addChangeListener(this);
    repaint();
}
 
Example #6
Source File: ChartPanel.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes an overlay from the panel.
 *
 * @param overlay  the overlay to remove (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void removeOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    boolean removed = this.overlays.remove(overlay);
    if (removed) {
        overlay.removeChangeListener(this);
        repaint();
    }
}
 
Example #7
Source File: AbstractChartPanel.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Removes an overlay from the panel.
 * 
 * @param overlay
 *            the overlay to remove (<code>null</code> not permitted).
 * 
 * @since 1.0.13
 */

@Override
public void removeOverlay(Overlay overlay) {
	if (overlay == null) {
		throw new IllegalArgumentException("Null 'overlay' argument.");
	}
	boolean removed = this.overlays.remove(overlay);
	if (removed) {
		overlay.removeChangeListener(this);
		repaint();
	}
}
 
Example #8
Source File: AbstractChartPanel.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Add an overlay to the panel.
 * 
 * @param overlay
 *            the overlay (<code>null</code> not permitted).
 * 
 * @since 1.0.13
 */

@Override
public void addOverlay(Overlay overlay) {
	if (overlay == null) {
		throw new IllegalArgumentException("Null 'overlay' argument.");
	}
	this.overlays.add(overlay);
	overlay.addChangeListener(this);
	repaint();
}
 
Example #9
Source File: ChartPanel.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Removes an overlay from the panel.
 *
 * @param overlay  the overlay to remove (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void removeOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    boolean removed = this.overlays.remove(overlay);
    if (removed) {
        overlay.removeChangeListener(this);
        repaint();
    }
}
 
Example #10
Source File: ChartPanel.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Removes an overlay from the panel.
 *
 * @param overlay  the overlay to remove (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void removeOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    boolean removed = this.overlays.remove(overlay);
    if (removed) {
        overlay.removeChangeListener(this);
        repaint();
    }
}
 
Example #11
Source File: AbstractChartPanel.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 * Paints the component by drawing the chart to fill the entire component, but allowing for the
 * insets (which will be non-zero if a border has been set for this component). To increase
 * performance (at the expense of memory), an off-screen buffer image can be used.
 * 
 * @param g
 *            the graphics device for drawing on.
 */

@Override
public void paintComponent(Graphics g) {
	if (this.chart == null) {
		return;
	}
	Graphics2D g2 = (Graphics2D) g.create();

	// first determine the size of the chart rendering area...
	Dimension size = getSize();
	Insets insets = getInsets();
	Rectangle2D available = new Rectangle2D.Double(insets.left, insets.top,
			size.getWidth() - insets.left - insets.right, size.getHeight() - insets.top - insets.bottom);

	// work out if scaling is required...
	boolean scale = false;
	double drawWidth = available.getWidth();
	double drawHeight = available.getHeight();
	this.scaleX = 1.0;
	this.scaleY = 1.0;

	if (drawWidth < this.minimumDrawWidth) {
		this.scaleX = drawWidth / this.minimumDrawWidth;
		drawWidth = this.minimumDrawWidth;
		scale = true;
	} else if (drawWidth > this.maximumDrawWidth) {
		this.scaleX = drawWidth / this.maximumDrawWidth;
		drawWidth = this.maximumDrawWidth;
		scale = true;
	}

	if (drawHeight < this.minimumDrawHeight) {
		this.scaleY = drawHeight / this.minimumDrawHeight;
		drawHeight = this.minimumDrawHeight;
		scale = true;
	} else if (drawHeight > this.maximumDrawHeight) {
		this.scaleY = drawHeight / this.maximumDrawHeight;
		drawHeight = this.maximumDrawHeight;
		scale = true;
	}

	Rectangle2D chartArea = new Rectangle2D.Double(0.0, 0.0, drawWidth, drawHeight);
	// redrawing the chart every time...

	AffineTransform saved = g2.getTransform();
	g2.translate(insets.left, insets.top);
	if (scale) {
		AffineTransform st = AffineTransform.getScaleInstance(this.scaleX, this.scaleY);
		g2.transform(st);
	}
	this.chart.draw(g2, chartArea, this.anchor, this.info);
	g2.setTransform(saved);

	Iterator<Overlay> iterator = this.overlays.iterator();
	while (iterator.hasNext()) {
		Overlay overlay = iterator.next();
		overlay.paintOverlay(g2, this);
	}

	// redraw the zoom rectangle (if present) - if useBuffer is false,
	// we use XOR so we can XOR the rectangle away again without redrawing
	// the chart
	drawSelectionRectangle(g2);

	g2.dispose();

	this.anchor = null;
	this.verticalTraceLine = null;
	this.horizontalTraceLine = null;

}
 
Example #12
Source File: LinkAndBrushChartPanel.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public List<Overlay> getOverlayList() {
	return (List<Overlay>) getChartFieldValueByName("overlays");
}
 
Example #13
Source File: LinkAndBrushChartPanel.java    From rapidminer-studio with GNU Affero General Public License v3.0 4 votes vote down vote up
public void setOverlayList(List<Overlay> list) {
	setChartFieldValue(getChartFieldByName("overlays"), list);
}
 
Example #14
Source File: ChartPanel.java    From ECG-Viewer with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Add an overlay to the panel.
 *
 * @param overlay  the overlay (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void addOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    this.overlays.add(overlay);
    overlay.addChangeListener(this);
    repaint();
}
 
Example #15
Source File: ChartPanel.java    From SIMVA-SoS with Apache License 2.0 3 votes vote down vote up
/**
 * Add an overlay to the panel.
 *
 * @param overlay  the overlay (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void addOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    this.overlays.add(overlay);
    overlay.addChangeListener(this);
    repaint();
}
 
Example #16
Source File: ChartPanel.java    From buffer_bci with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Add an overlay to the panel.
 *
 * @param overlay  the overlay (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void addOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    this.overlays.add(overlay);
    overlay.addChangeListener(this);
    repaint();
}
 
Example #17
Source File: ChartPanel.java    From ccu-historian with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Add an overlay to the panel.
 *
 * @param overlay  the overlay (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void addOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    this.overlays.add(overlay);
    overlay.addChangeListener(this);
    repaint();
}
 
Example #18
Source File: ChartPanel.java    From buffer_bci with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Add an overlay to the panel.
 *
 * @param overlay  the overlay (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void addOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    this.overlays.add(overlay);
    overlay.addChangeListener(this);
    repaint();
}
 
Example #19
Source File: ChartPanel.java    From openstock with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Add an overlay to the panel.
 *
 * @param overlay  the overlay (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public void addOverlay(Overlay overlay) {
    ParamChecks.nullNotPermitted(overlay, "overlay");
    this.overlays.add(overlay);
    overlay.addChangeListener(this);
    repaint();
}