当前位置: 首页>>代码示例>>Java>>正文


Java XYPlot.getOrientation方法代码示例

本文整理汇总了Java中org.jfree.chart.plot.XYPlot.getOrientation方法的典型用法代码示例。如果您正苦于以下问题:Java XYPlot.getOrientation方法的具体用法?Java XYPlot.getOrientation怎么用?Java XYPlot.getOrientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.plot.XYPlot的用法示例。


在下文中一共展示了XYPlot.getOrientation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawItem

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param info  collects info about the drawing.
 * @param plot  the plot (can be used to obtain standard color 
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot 
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, 
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot, 
                     ValueAxis domainAxis, 
                     ValueAxis rangeAxis,
                     XYDataset dataset, 
                     int series, 
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:44,代码来源:XYBoxAndWhiskerRenderer.java

示例2: draw

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the annotation.  This method is called by the drawing code in the {@link XYPlot} class,
 * you don't normally need to call this method directly.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 */
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                 ValueAxis domainAxis, ValueAxis rangeAxis) {

    PlotOrientation orientation = plot.getOrientation();
    AxisLocation domainAxisLocation = plot.getDomainAxisLocation();
    AxisLocation rangeAxisLocation = plot.getRangeAxisLocation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(domainAxisLocation, orientation);
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(rangeAxisLocation, orientation);
    float j2DX = (float) domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
    float j2DY = (float) rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);
    float xx = 0.0f;
    float yy = 0.0f;
    if (orientation == PlotOrientation.HORIZONTAL) {
        xx = j2DY;
        yy = j2DX;
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        xx = j2DX;
        yy = j2DY;
    }
    xx = xx - this.image.getWidth(null) / 2.0f;
    yy = yy - this.image.getHeight(null) / 2.0f;
    g2.drawImage(this.image, (int) xx, (int) yy, null);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:XYImageAnnotation.java

示例3: draw

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the annotation.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 */
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                 ValueAxis domainAxis, ValueAxis rangeAxis) {

    PlotOrientation orientation = plot.getOrientation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(plot.getDomainAxisLocation(), 
                                                              orientation);
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(plot.getRangeAxisLocation(), 
                                                            orientation);
    float j2DX = (float) domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
    float j2DY = (float) rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);
    Rectangle2D area = new Rectangle2D.Double(j2DX - this.width / 2.0,
                                              j2DY - this.height / 2.0,
                                              this.width, this.height);
    this.drawable.draw(g2, area);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:XYDrawableAnnotation.java

示例4: getVerticalValueAxis

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Returns a reference to the 'vertical' value axis, if there is one.
 *
 * @param plot  the plot.
 *
 * @return The axis.
 */
private ValueAxis getVerticalValueAxis(Plot plot) {

    if (plot == null) {
        return null;
    }

    ValueAxis axis = null;

    if (plot instanceof CategoryPlot) {
        CategoryPlot cp = (CategoryPlot) plot;
        if (cp.getOrientation() == PlotOrientation.VERTICAL) {
            axis = cp.getRangeAxis();
        }
    }

    if (plot instanceof XYPlot) {
        XYPlot xyp = (XYPlot) plot;
        if (xyp.getOrientation() == PlotOrientation.HORIZONTAL) {
            axis = xyp.getDomainAxis();
        }
        else if (xyp.getOrientation() == PlotOrientation.VERTICAL) {
            axis = xyp.getRangeAxis();
        }
    }
    
    if (plot instanceof FastScatterPlot) {
        FastScatterPlot fsp = (FastScatterPlot) plot;
        axis = fsp.getRangeAxis();            
    }

    return axis;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:41,代码来源:ChartPanel.java

示例5: drawRangeGridLine

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws a grid line against the range axis.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param axis  the value axis.
 * @param dataArea  the area for plotting data (not yet adjusted for any 3D effect).
 * @param value  the value at which the grid line should be drawn.
 *
 */
public void drawRangeGridLine(Graphics2D g2,
                              XYPlot plot,
                              ValueAxis axis,
                              Rectangle2D dataArea,
                              double value) {

    Range range = axis.getRange();
    if (!range.contains(value)) {
        return;
    }

    PlotOrientation orientation = plot.getOrientation();
    Line2D line = null;
    double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge());
    if (orientation == PlotOrientation.HORIZONTAL) {
        line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);
    }

    Paint paint = plot.getRangeGridlinePaint();
    Stroke stroke = plot.getRangeGridlineStroke();
    g2.setPaint(paint != null ? paint : Plot.DEFAULT_OUTLINE_PAINT);
    g2.setStroke(stroke != null ? stroke : Plot.DEFAULT_OUTLINE_STROKE);
    g2.draw(line);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:39,代码来源:AbstractXYItemRenderer.java

示例6: drawRangeLine

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws a line perpendicular to the range axis.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param axis  the value axis.
 * @param dataArea  the area for plotting data (not yet adjusted for any 3D
 *                  effect).
 * @param value  the value at which the grid line should be drawn.
 * @param paint  the paint.
 * @param stroke  the stroke.
 */
public void drawRangeLine(Graphics2D g2,
                          XYPlot plot,
                          ValueAxis axis,
                          Rectangle2D dataArea,
                          double value,
                          Paint paint,
                          Stroke stroke) {

    Range range = axis.getRange();
    if (!range.contains(value)) {
        return;
    }

    PlotOrientation orientation = plot.getOrientation();
    Line2D line = null;
    double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge());
    if (orientation == PlotOrientation.HORIZONTAL) {
        line = new Line2D.Double(v, dataArea.getMinY(), v,
                dataArea.getMaxY());
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        line = new Line2D.Double(dataArea.getMinX(), v,
                dataArea.getMaxX(), v);
    }

    g2.setPaint(paint);
    g2.setStroke(stroke);
    g2.draw(line);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:43,代码来源:AbstractXYItemRenderer.java

示例7: draw

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
* Draws the annotation.  This method is usually called by the {@link XYPlot} class, you 
* shouldn't need to call it directly.
*
* @param g2  the graphics device.
* @param plot  the plot.
* @param dataArea  the data area.
* @param domainAxis  the domain axis.
* @param rangeAxis  the range axis.
*/
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                 ValueAxis domainAxis, ValueAxis rangeAxis) {

    PlotOrientation orientation = plot.getOrientation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
        plot.getDomainAxisLocation(), orientation
    );
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
        plot.getRangeAxisLocation(), orientation
    );

    //compute transform matrix elements via sample points. Assume no rotation or shear.
    // x-axis translation
    double m02 = domainAxis.valueToJava2D(0, dataArea, domainEdge); 
    // y-axis translation
    double m12 = rangeAxis.valueToJava2D(0, dataArea, rangeEdge);
    // x-axis scale 
    double m00 = domainAxis.valueToJava2D(1, dataArea, domainEdge) - m02; 
    // y-axis scale
    double m11 = rangeAxis.valueToJava2D(1, dataArea, rangeEdge) - m12; 

    //create transform & transform shape
    Shape s = null;
    if (orientation == PlotOrientation.HORIZONTAL) {
        AffineTransform t1 = new AffineTransform(0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f);
        AffineTransform t2 = new AffineTransform(m11, 0.0f, 0.0f, m00, m12, m02);
        s = t1.createTransformedShape(this.shape);
        s = t2.createTransformedShape(s);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        AffineTransform t = new AffineTransform(m00, 0, 0, m11, m02, m12);
        s = t.createTransformedShape(this.shape);
    }

    g2.setPaint(this.paint);
    g2.setStroke(this.stroke);
    g2.draw(s);
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:50,代码来源:XYShapeAnnotation.java

示例8: draw

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the annotation.  This method is called by the {@link XYPlot} class, you 
 * won't normally need to call it yourself.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 */
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                 ValueAxis domainAxis, ValueAxis rangeAxis) {

    PlotOrientation orientation = plot.getOrientation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
        plot.getDomainAxisLocation(), orientation
    );
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
        plot.getRangeAxisLocation(), orientation
    );
    float j2DX1 = 0.0f;
    float j2DX2 = 0.0f;
    float j2DY1 = 0.0f;
    float j2DY2 = 0.0f;
    if (orientation == PlotOrientation.VERTICAL) {
        j2DX1 = (float) domainAxis.valueToJava2D(this.x1, dataArea, domainEdge);
        j2DY1 = (float) rangeAxis.valueToJava2D(this.y1, dataArea, rangeEdge);
        j2DX2 = (float) domainAxis.valueToJava2D(this.x2, dataArea, domainEdge);
        j2DY2 = (float) rangeAxis.valueToJava2D(this.y2, dataArea, rangeEdge);
    }
    else if (orientation == PlotOrientation.HORIZONTAL) {
        j2DY1 = (float) domainAxis.valueToJava2D(this.x1, dataArea, domainEdge);
        j2DX1 = (float) rangeAxis.valueToJava2D(this.y1, dataArea, rangeEdge);
        j2DY2 = (float) domainAxis.valueToJava2D(this.x2, dataArea, domainEdge);
        j2DX2 = (float) rangeAxis.valueToJava2D(this.y2, dataArea, rangeEdge);                
    }
    g2.setPaint(this.paint);
    g2.setStroke(this.stroke);
    Line2D line = new Line2D.Float(j2DX1, j2DY1, j2DX2, j2DY2);
    g2.draw(line);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:43,代码来源:XYLineAnnotation.java

示例9: draw

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the annotation.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 */
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                 ValueAxis domainAxis, ValueAxis rangeAxis) {

    PlotOrientation orientation = plot.getOrientation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(plot.getDomainAxisLocation(), 
                                                              orientation);
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(plot.getRangeAxisLocation(), 
                                                            orientation);

    float anchorX = (float) domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
    float anchorY = (float) rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);

    if (orientation == PlotOrientation.HORIZONTAL) {
        float tempAnchor = anchorX;
        anchorX = anchorY;
        anchorY = tempAnchor;
    }
    
    g2.setFont(getFont());
    g2.setPaint(getPaint());
    RefineryUtilities.drawRotatedString(
        getText(), 
        g2,
        anchorX, 
        anchorY,
        getTextAnchor(),
        getRotationAnchor(),
        getRotationAngle()
    );

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:41,代码来源:XYTextAnnotation.java

示例10: drawItem

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the block representing the specified item.
 * 
 * @param g2  the graphics device.
 * @param state  the state.
 * @param dataArea  the data area.
 * @param info  the plot rendering info.
 * @param plot  the plot.
 * @param domainAxis  the x-axis.
 * @param rangeAxis  the y-axis.
 * @param dataset  the dataset.
 * @param series  the series index.
 * @param item  the item index.
 * @param crosshairState  the crosshair state.
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, XYItemRendererState state, 
        Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, 
        ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, 
        int series, int item, CrosshairState crosshairState, int pass) {
    
    double x = dataset.getXValue(series, item);
    double y = dataset.getYValue(series, item);
    double z = 0.0;
    if (dataset instanceof XYZDataset) {
        z = ((XYZDataset) dataset).getZValue(series, item);
    }
    Paint p = this.paintScale.getPaint(z);
    double xx0 = domainAxis.valueToJava2D(x + this.xOffset, dataArea, 
            plot.getDomainAxisEdge());
    double yy0 = rangeAxis.valueToJava2D(y + this.yOffset, dataArea, 
            plot.getRangeAxisEdge());
    double xx1 = domainAxis.valueToJava2D(x + this.blockWidth 
            + this.xOffset, dataArea, plot.getDomainAxisEdge());
    double yy1 = rangeAxis.valueToJava2D(y + this.blockHeight 
            + this.yOffset, dataArea, plot.getRangeAxisEdge());
    Rectangle2D block;
    PlotOrientation orientation = plot.getOrientation();
    if (orientation.equals(PlotOrientation.HORIZONTAL)) {
        block = new Rectangle2D.Double(Math.min(yy0, yy1), 
                Math.min(xx0, xx1), Math.abs(yy1 - yy0), 
                Math.abs(xx0 - xx1));
    }
    else {
        block = new Rectangle2D.Double(Math.min(xx0, xx1), 
                Math.min(yy0, yy1), Math.abs(xx1 - xx0), 
                Math.abs(yy1 - yy0));            
    }
    g2.setPaint(p);
    g2.fill(block);
    g2.setStroke(new BasicStroke(1.0f));
    g2.draw(block);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:54,代码来源:XYBlockRenderer.java

示例11: drawItem

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the block representing the specified item.
 * 
 * @param g2
 *            the graphics device.
 * @param state
 *            the state.
 * @param dataArea
 *            the data area.
 * @param info
 *            the plot rendering info.
 * @param plot
 *            the plot.
 * @param domainAxis
 *            the x-axis.
 * @param rangeAxis
 *            the y-axis.
 * @param dataset
 *            the dataset.
 * @param series
 *            the series index.
 * @param item
 *            the item index.
 * @param crosshairState
 *            the crosshair state.
 * @param pass
 *            the pass index.
 */
@Override
public void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info,
		XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item,
		CrosshairState crosshairState, int pass) {

	Shape hotspot = null;
	EntityCollection entities = null;
	if (info != null) {
		entities = info.getOwner().getEntityCollection();
	}

	double x = dataset.getXValue(series, item);
	double y = dataset.getYValue(series, item);
	double colorValue = ((XYZDataset) dataset).getZValue(series, item);
	double normalized = (colorValue - minColor) / (maxColor - minColor);

	if (Double.isNaN(x) || Double.isNaN(y)) {
		// can't draw anything
		return;
	}

	double transX = domainAxis.valueToJava2D(x, dataArea, plot.getDomainAxisEdge());
	double transY = rangeAxis.valueToJava2D(y, dataArea, plot.getRangeAxisEdge());

	PlotOrientation orientation = plot.getOrientation();

	Shape shape = getItemShape(series, item);
	if (orientation == PlotOrientation.HORIZONTAL) {
		shape = ShapeUtilities.createTranslatedShape(shape, transY, transX);
	} else if (orientation == PlotOrientation.VERTICAL) {
		shape = ShapeUtilities.createTranslatedShape(shape, transX, transY);
	}
	hotspot = shape;
	if (shape.intersects(dataArea)) {
		g2.setPaint(colorProvider.getPointColor(normalized));
		g2.fill(shape);
		if (getDrawOutlines()) {
			if (getUseOutlinePaint()) {
				g2.setPaint(getItemOutlinePaint(series, item));
			} else {
				g2.setPaint(getItemPaint(series, item));
			}
			g2.setStroke(getItemOutlineStroke(series, item));
			g2.draw(shape);
		}
	}

	// add an entity for the item...
	if (entities != null) {
		addEntity(entities, hotspot, dataset, series, item, transX, transY);
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:81,代码来源:ColorizedShapeItemRenderer.java

示例12: zoom

import org.jfree.chart.plot.XYPlot; //导入方法依赖的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);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:66,代码来源:LinkAndBrushChartPanel.java

示例13: draw

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the annotation.  This method is called by the drawing code in the 
 * {@link XYPlot} class, you don't normally need to call this method 
 * directly.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param rendererIndex  the renderer index.
 * @param info  if supplied, this info object will be populated with
 *              entity information.
 */
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                 ValueAxis domainAxis, ValueAxis rangeAxis, 
                 int rendererIndex,
                 PlotRenderingInfo info) {

    PlotOrientation orientation = plot.getOrientation();
    AxisLocation domainAxisLocation = plot.getDomainAxisLocation();
    AxisLocation rangeAxisLocation = plot.getRangeAxisLocation();
    RectangleEdge domainEdge 
        = Plot.resolveDomainAxisLocation(domainAxisLocation, orientation);
    RectangleEdge rangeEdge 
        = Plot.resolveRangeAxisLocation(rangeAxisLocation, orientation);
    float j2DX 
        = (float) domainAxis.valueToJava2D(this.x, dataArea, domainEdge);
    float j2DY 
        = (float) rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge);
    float xx = 0.0f;
    float yy = 0.0f;
    if (orientation == PlotOrientation.HORIZONTAL) {
        xx = j2DY;
        yy = j2DX;
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        xx = j2DX;
        yy = j2DY;
    }
    int w = this.image.getWidth(null);
    int h = this.image.getHeight(null);
    
    Rectangle2D imageRect = new Rectangle2D.Double(0, 0, w, h);
    Point2D anchorPoint = (Point2D) RectangleAnchor.coordinates(imageRect, 
            this.anchor);
    xx = xx - (float) anchorPoint.getX();
    yy = yy - (float) anchorPoint.getY();
    g2.drawImage(this.image, (int) xx, (int) yy, null);
    
    String toolTip = getToolTipText();
    String url = getURL();
    if (toolTip != null || url != null) {
        addEntity(info, new Rectangle2D.Float(xx, yy, w, h), rendererIndex, 
                toolTip, url);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:58,代码来源:XYImageAnnotation.java

示例14: draw

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the annotation.  This method is usually called by the 
 * {@link XYPlot} class, you shouldn't need to call it directly.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param rendererIndex  the renderer index.
 * @param info  the plot rendering info.
 */
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                 ValueAxis domainAxis, ValueAxis rangeAxis, 
                 int rendererIndex,
                 PlotRenderingInfo info) {

    PlotOrientation orientation = plot.getOrientation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
            plot.getDomainAxisLocation(), orientation);
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
            plot.getRangeAxisLocation(), orientation);

    // compute transform matrix elements via sample points. Assume no 
    // rotation or shear.
    Rectangle2D bounds = this.shape.getBounds2D();
    double x0 = bounds.getMinX();
    double x1 = bounds.getMaxX();
    double xx0 = domainAxis.valueToJava2D(x0, dataArea, domainEdge);
    double xx1 = domainAxis.valueToJava2D(x1, dataArea, domainEdge);
    double m00 = (xx1 - xx0) / (x1 - x0);
    double m02 = xx0 - x0 * m00;
    
    double y0 = bounds.getMaxY();
    double y1 = bounds.getMinY();
    double yy0 = rangeAxis.valueToJava2D(y0, dataArea, rangeEdge);
    double yy1 = rangeAxis.valueToJava2D(y1, dataArea, rangeEdge);
    double m11 = (yy1 - yy0) / (y1 - y0);
    double m12 = yy0 - m11 * y0;

    //  create transform & transform shape
    Shape s = null;
    if (orientation == PlotOrientation.HORIZONTAL) {
        AffineTransform t1 = new AffineTransform(0.0f, 1.0f, 1.0f, 0.0f, 
                0.0f, 0.0f);
        AffineTransform t2 = new AffineTransform(m11, 0.0f, 0.0f, m00, 
                m12, m02);
        s = t1.createTransformedShape(this.shape);
        s = t2.createTransformedShape(s);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        AffineTransform t = new AffineTransform(m00, 0, 0, m11, m02, m12);
        s = t.createTransformedShape(this.shape);
    }

    if (this.fillPaint != null) {
        g2.setPaint(this.fillPaint);
        g2.fill(s);
    }
    
    if (this.stroke != null && this.outlinePaint != null) {
        g2.setPaint(this.outlinePaint);
        g2.setStroke(this.stroke);
        g2.draw(s);
    }
    addEntity(info, s, rendererIndex, getToolTipText(), getURL());
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:69,代码来源:XYShapeAnnotation.java

示例15: draw

import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
 * Draws the annotation.  This method is called by the {@link XYPlot} 
 * class, you won't normally need to call it yourself.
 *
 * @param g2  the graphics device.
 * @param plot  the plot.
 * @param dataArea  the data area.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param rendererIndex  the renderer index.
 * @param info  if supplied, this info object will be populated with
 *              entity information.
 */
public void draw(Graphics2D g2, XYPlot plot, Rectangle2D dataArea,
                 ValueAxis domainAxis, ValueAxis rangeAxis, 
                 int rendererIndex,
                 PlotRenderingInfo info) {

    PlotOrientation orientation = plot.getOrientation();
    RectangleEdge domainEdge = Plot.resolveDomainAxisLocation(
            plot.getDomainAxisLocation(), orientation);
    RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation(
            plot.getRangeAxisLocation(), orientation);
    float j2DX1 = 0.0f;
    float j2DX2 = 0.0f;
    float j2DY1 = 0.0f;
    float j2DY2 = 0.0f;
    if (orientation == PlotOrientation.VERTICAL) {
        j2DX1 = (float) domainAxis.valueToJava2D(this.x1, dataArea, 
                domainEdge);
        j2DY1 = (float) rangeAxis.valueToJava2D(this.y1, dataArea, 
                rangeEdge);
        j2DX2 = (float) domainAxis.valueToJava2D(this.x2, dataArea, 
                domainEdge);
        j2DY2 = (float) rangeAxis.valueToJava2D(this.y2, dataArea, 
                rangeEdge);
    }
    else if (orientation == PlotOrientation.HORIZONTAL) {
        j2DY1 = (float) domainAxis.valueToJava2D(this.x1, dataArea, 
                domainEdge);
        j2DX1 = (float) rangeAxis.valueToJava2D(this.y1, dataArea, 
                rangeEdge);
        j2DY2 = (float) domainAxis.valueToJava2D(this.x2, dataArea, 
                domainEdge);
        j2DX2 = (float) rangeAxis.valueToJava2D(this.y2, dataArea, 
                rangeEdge);                
    }
    g2.setPaint(this.paint);
    g2.setStroke(this.stroke);
    Line2D line = new Line2D.Float(j2DX1, j2DY1, j2DX2, j2DY2);
    g2.draw(line);

    String toolTip = getToolTipText();
    String url = getURL();
    if (toolTip != null || url != null) {
        addEntity(info, ShapeUtilities.createLineRegion(line, 1.0f), 
                rendererIndex, toolTip, url);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:60,代码来源:XYLineAnnotation.java


注:本文中的org.jfree.chart.plot.XYPlot.getOrientation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。