Examples of ChartEntity


Examples of org.jfree.chart.entity.ChartEntity

     * Convenience hit-testing
     * @param e MouseEvent to be tested
     * @return true if on X-Axis, false otherwise
     */
    protected boolean mouseIsOnXAxis(MouseEvent e) {
        ChartEntity entity = this.chartPanel.getEntityForPoint(
                e.getPoint().x, e.getPoint().y);
        return ((entity instanceof AxisEntity) &&
                (((AxisEntity) entity).getAxis().equals(
                getDomainAxis())));
    }
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

     * Convenience hit-testing
     * @param e MouseEvent to be tested
     * @return true if on Y-Axis, false otherwise
     */
    protected boolean mouseIsOnYAxis(MouseEvent e) {
        ChartEntity entity = this.chartPanel.getEntityForPoint(
                e.getPoint().x, e.getPoint().y);
        return ((entity instanceof AxisEntity) &&
                (((AxisEntity) entity).getAxis().equals(
                getRangeAxis())));
    }
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

     * Convenience hit-testing
     * @param e MouseEvent to be tested
     * @return true if on Plot, false otherwise
     */
    protected boolean mouseIsOnPlot(MouseEvent e) {
        ChartEntity entity = this.chartPanel.getEntityForPoint(
                e.getPoint().x, e.getPoint().y);
        return ((entity instanceof PlotEntity) | (entity instanceof XYItemEntity));
    }
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

        this.mouseDragAnchor = arg0.getPoint();
        this.mouseDragPreviousPoint = this.mouseDragAnchor;
        this.mouseDragMode = MOUSEDRAGMODE.NONE;

        // See if it was the plot or axes that were clicked on
        ChartEntity entity = this.chartPanel.getEntityForPoint(
                arg0.getPoint().x, arg0.getPoint().y);

        // Depending on domain, figure out which button is high or low
        if (this.getDomainAxis().isInverted()) {
            lowButton = MouseEvent.BUTTON3;
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

        String result = null;
        if (this.info != null) {
            EntityCollection entities = this.info.getEntityCollection();
            if (entities != null) {
                Insets insets = getInsets();
                ChartEntity entity = entities.getEntity(
                        (int) ((e.getX() - insets.left) / this.scaleX),
                        (int) ((e.getY() - insets.top) / this.scaleY));
                if (entity != null) {
                    result = entity.getToolTipText();
                }
            }
        }
        return result;
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

     *
     * @return The chart entity (possibly <code>null</code>).
     */
    public ChartEntity getEntityForPoint(int viewX, int viewY) {

        ChartEntity result = null;
        if (this.info != null) {
            Insets insets = getInsets();
            double x = (viewX - insets.left) / this.scaleX;
            double y = (viewY - insets.top) / this.scaleY;
            EntityCollection entities = this.info.getEntityCollection();
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

                ChartMouseListener.class);
        if (listeners.length == 0) {
            return;
        }

        ChartEntity entity = null;
        if (this.info != null) {
            EntityCollection entities = this.info.getEntityCollection();
            if (entities != null) {
                entity = entities.getEntity(x, y);
            }
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

        }
        Insets insets = getInsets();
        int x = (int) ((e.getX() - insets.left) / this.scaleX);
        int y = (int) ((e.getY() - insets.top) / this.scaleY);

        ChartEntity entity = null;
        if (this.info != null) {
            EntityCollection entities = this.info.getEntityCollection();
            if (entities != null) {
                entity = entities.getEntity(x, y);
            }
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

        assertFalse(i1.equals(i2));
        i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
        assertTrue(i1.equals(i2));

        StandardEntityCollection e1 = new StandardEntityCollection();
        e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
        i1.setEntityCollection(e1);
        assertFalse(i1.equals(i2));
        StandardEntityCollection e2 = new StandardEntityCollection();
        e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
        i2.setEntityCollection(e2);
    }
View Full Code Here

Examples of org.jfree.chart.entity.ChartEntity

        i1.getChartArea().setRect(4.0, 3.0, 2.0, 1.0);
        assertFalse(i1.equals(i2));
        i2.getChartArea().setRect(4.0, 3.0, 2.0, 1.0);
        assertTrue(i1.equals(i2));

        i1.getEntityCollection().add(new ChartEntity(new Rectangle(1, 2, 2,
                1)));
        assertFalse(i1.equals(i2));
        i2.getEntityCollection().add(new ChartEntity(new Rectangle(1, 2, 2,
                1)));
        assertTrue(i1.equals(i2));

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.