本文整理匯總了Java中org.jfree.chart.plot.Plot.isNotify方法的典型用法代碼示例。如果您正苦於以下問題:Java Plot.isNotify方法的具體用法?Java Plot.isNotify怎麽用?Java Plot.isNotify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.plot.Plot
的用法示例。
在下文中一共展示了Plot.isNotify方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shrinkSelectionOnCenter
import org.jfree.chart.plot.Plot; //導入方法依賴的package包/類
/**
* Zooms in on an anchor point (specified in screen coordinate space).
*
* @param x
* the x value (in screen coordinates).
* @param y
* the y value (in screen coordinates).
*/
public void shrinkSelectionOnCenter(double x, double y, MouseEvent selectionEvent) {
Plot plot = this.chart.getPlot();
if (plot == null) {
return;
}
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
shrinkSelectionOnDomain(x, y, selectionEvent);
shrinkSelectionOnRange(x, y, selectionEvent);
plot.setNotify(savedNotify);
}
示例2: enlargeSelectionOnCenter
import org.jfree.chart.plot.Plot; //導入方法依賴的package包/類
/**
* Zooms out on an anchor point (specified in screen coordinate space).
*
* @param x
* the x value (in screen coordinates).
* @param y
* the y value (in screen coordinates).
*/
public void enlargeSelectionOnCenter(double x, double y, MouseEvent selectionEvent) {
Plot plot = this.chart.getPlot();
if (plot == null) {
return;
}
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
enlargeSelectionOnDomain(x, y, selectionEvent);
enlargeSelectionOnRange(x, y, selectionEvent);
plot.setNotify(savedNotify);
}
示例3: restoreAutoBounds
import org.jfree.chart.plot.Plot; //導入方法依賴的package包/類
/**
* Restores the auto-range calculation on both axes.
*/
@Override
public void restoreAutoBounds() {
Plot plot = this.chart.getPlot();
if (plot == null) {
return;
}
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
selectCompleteDomainBounds();
selectCompleteRangeBounds();
plot.setNotify(savedNotify);
}
示例4: handleZoomable
import org.jfree.chart.plot.Plot; //導入方法依賴的package包/類
/**
* Handle the case where a plot implements the {@link Zoomable} interface.
*
* @param zoomable the zoomable plot.
* @param e the mouse wheel event.
*/
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable,
ScrollEvent e) {
// don't zoom unless the mouse pointer is in the plot's data area
ChartRenderingInfo info = canvas.getRenderingInfo();
PlotRenderingInfo pinfo = info.getPlotInfo();
Point2D p = new Point2D.Double(e.getX(), e.getY());
if (pinfo.getDataArea().contains(p)) {
Plot plot = (Plot) zoomable;
// do not notify while zooming each axis
boolean notifyState = plot.isNotify();
plot.setNotify(false);
int clicks = (int) e.getDeltaY();
double zf = 1.0 + this.zoomFactor;
if (clicks < 0) {
zf = 1.0 / zf;
}
if (canvas.isDomainZoomable()) {
zoomable.zoomDomainAxes(zf, pinfo, p, true);
}
if (canvas.isRangeZoomable()) {
zoomable.zoomRangeAxes(zf, pinfo, p, true);
}
plot.setNotify(notifyState); // this generates the change event too
}
}
示例5: selectCompleteDomainBounds
import org.jfree.chart.plot.Plot; //導入方法依賴的package包/類
/**
* Restores the auto-range calculation on the domain axis.
*/
public void selectCompleteDomainBounds() {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
// we need to guard against this.zoomPoint being null
Point2D zp = this.zoomPoint != null ? this.zoomPoint : new Point();
z.zoomDomainAxes(0.0, this.info.getPlotInfo(), zp);
plot.setNotify(savedNotify);
if (plot instanceof XYPlot) {
XYPlot xyPlot = (XYPlot) plot;
Selection selectionObject = new Selection();
for (int i = 0; i < xyPlot.getDomainAxisCount(); i++) {
ValueAxis domain = xyPlot.getDomainAxis(i);
Range axisRange = new Range(domain.getLowerBound(), domain.getUpperBound());
for (String axisName : axisNameResolver.resolveXAxis(i)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
informSelectionListener(selectionObject, null);
}
}
}
示例6: selectCompleteRangeBounds
import org.jfree.chart.plot.Plot; //導入方法依賴的package包/類
/**
* Restores the auto-range calculation on the range axis.
*/
public void selectCompleteRangeBounds() {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
// we need to guard against this.zoomPoint being null
Point2D zp = this.zoomPoint != null ? this.zoomPoint : new Point();
z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp);
plot.setNotify(savedNotify);
if (plot instanceof XYPlot) {
XYPlot xyPlot = (XYPlot) plot;
Selection selectionObject = new Selection();
for (int i = 0; i < xyPlot.getRangeAxisCount(); i++) {
ValueAxis range = xyPlot.getRangeAxis(i);
Range axisRange = new Range(range.getLowerBound(), range.getUpperBound());
for (String axisName : axisNameResolver.resolveYAxis(i)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
informSelectionListener(selectionObject, null);
}
}
}
示例7: restoreAutoBounds
import org.jfree.chart.plot.Plot; //導入方法依賴的package包/類
@Override
public void restoreAutoBounds() {
Plot plot = getChart().getPlot();
if (plot == null) {
return;
}
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
if (plot instanceof LinkAndBrushPlot) {
LinkAndBrushPlot LABPlot = (LinkAndBrushPlot) plot;
List<Pair<Integer, Range>> zoomedDomainAxisRanges = new LinkedList<Pair<Integer, Range>>();
List<Pair<Integer, Range>> zoomedRangeAxisRanges = new LinkedList<Pair<Integer, Range>>();
zoomedDomainAxisRanges.addAll(LABPlot.restoreAutoDomainAxisBounds(zoomOnLinkAndBrushSelection));
zoomedRangeAxisRanges.addAll(LABPlot.restoreAutoRangeAxisBounds(zoomOnLinkAndBrushSelection));
if (zoomOnLinkAndBrushSelection) {
informLinkAndBrushSelectionListeners(new LinkAndBrushSelection(SelectionType.RESTORE_AUTO_BOUNDS,
zoomedDomainAxisRanges, zoomedRangeAxisRanges));
} else {
informLinkAndBrushSelectionListeners(new LinkAndBrushSelection(SelectionType.RESTORE_SELECTION,
zoomedDomainAxisRanges, zoomedRangeAxisRanges));
}
} else {
restoreAutoDomainBounds();
restoreAutoRangeBounds();
}
plot.setNotify(savedNotify);
}
示例8: zoom
import org.jfree.chart.plot.Plot; //導入方法依賴的package包/類
@Override
public void zoom(Rectangle2D selection) {
// get the origin of the zoom selection in the Java2D space used for
// drawing the chart (that is, before any scaling to fit the panel)
Point2D selectOrigin = translateScreenToJava2D(new Point((int) Math.ceil(selection.getX()),
(int) Math.ceil(selection.getY())));
PlotRenderingInfo plotInfo = getChartRenderingInfo().getPlotInfo();
Rectangle2D scaledDataArea = getScreenDataArea((int) selection.getCenterX(), (int) selection.getCenterY());
if ((selection.getHeight() > 0) && (selection.getWidth() > 0)) {
double hLower = (selection.getMinX() - scaledDataArea.getMinX()) / scaledDataArea.getWidth();
double hUpper = (selection.getMaxX() - scaledDataArea.getMinX()) / scaledDataArea.getWidth();
double vLower = (scaledDataArea.getMaxY() - selection.getMaxY()) / scaledDataArea.getHeight();
double vUpper = (scaledDataArea.getMaxY() - selection.getMinY()) / scaledDataArea.getHeight();
Plot p = getChart().getPlot();
if (p instanceof LinkAndBrushPlot) {
PlotOrientation orientation = null;
if (p instanceof XYPlot) {
XYPlot xyPlot = (XYPlot) p;
orientation = xyPlot.getOrientation();
}
if (p instanceof CategoryPlot) {
CategoryPlot categoryPlot = (CategoryPlot) p;
orientation = categoryPlot.getOrientation();
}
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = p.isNotify();
p.setNotify(false);
LinkAndBrushPlot LABPlot = (LinkAndBrushPlot) p;
List<Pair<Integer, Range>> zoomedDomainAxisRanges = new LinkedList<Pair<Integer, Range>>();
List<Pair<Integer, Range>> zoomedRangeAxisRanges = new LinkedList<Pair<Integer, Range>>();
if (orientation == PlotOrientation.HORIZONTAL) {
zoomedDomainAxisRanges.addAll(LABPlot.calculateDomainAxesZoom(vLower, vUpper,
zoomOnLinkAndBrushSelection));
zoomedRangeAxisRanges.addAll(LABPlot.calculateRangeAxesZoom(hLower, hUpper, plotInfo, selectOrigin,
zoomOnLinkAndBrushSelection));
} else {
zoomedDomainAxisRanges.addAll(LABPlot.calculateDomainAxesZoom(hLower, hUpper,
zoomOnLinkAndBrushSelection));
zoomedRangeAxisRanges.addAll(LABPlot.calculateRangeAxesZoom(vLower, vUpper, plotInfo, selectOrigin,
zoomOnLinkAndBrushSelection));
}
p.setNotify(savedNotify);
if (zoomOnLinkAndBrushSelection) {
informLinkAndBrushSelectionListeners(new LinkAndBrushSelection(SelectionType.ZOOM_IN,
zoomedDomainAxisRanges, zoomedRangeAxisRanges));
} else {
informLinkAndBrushSelectionListeners(new LinkAndBrushSelection(SelectionType.SELECTION,
zoomedDomainAxisRanges, zoomedRangeAxisRanges));
}
} else {
super.zoom(selection);
}
}
}