Package org.jfree.chart.entity

Examples of org.jfree.chart.entity.ChartEntity


        area = trimMargin(area);
        drawBorder(g2, area);
        if (this.text.equals("")) {
            return null;
        }
        ChartEntity entity = null;
        if (params instanceof EntityBlockParams) {
            EntityBlockParams p = (EntityBlockParams) params;
            if (p.getGenerateEntities()) {
                entity = new ChartEntity(area, this.toolTipText, this.urlText);
            }
        }
        area = trimBorder(area);
        if (this.backgroundPaint != null) {
            g2.setPaint(this.backgroundPaint);
View Full Code Here


        String result = null;
        if (this.info != null) {
            EntityCollection entities = this.info.getEntityCollection();
            if (entities != null) {
                Rectangle insets = getClientArea();
                ChartEntity entity = entities.getEntity(
                        (int) ((e.x - insets.x) / this.scaleX),
                        (int) ((e.y - insets.y) / this.scaleY));
                if (entity != null) {
                    result = entity.getToolTipText();
                }
            }
        }
        return result;
View Full Code Here

        this.anchor = new Point2D.Double(x, y);
        this.chart.setNotify(true)// force a redraw
        this.canvas.redraw();
       
        // new entity code
        ChartEntity entity = null;
        if (this.info != null) {
            EntityCollection entities = this.info.getEntityCollection();
            if (entities != null) {
                entity = entities.getEntity(x, y);
            }
View Full Code Here

            }
            this.canvas.redraw();
        }

        // new entity code
        ChartEntity entity = null;
        int x = (int) ((event.x - getClientArea().x) / this.scaleX);
        int y = (int) ((event.y - getClientArea().y) / this.scaleY);

        if (this.info != null) {
            EntityCollection entities = this.info.getEntityCollection();
View Full Code Here

        // since JFreeChart is not very nice to extensions - constructors calling protected methods...
        LazyToolTipChartPanel.profileModeModel = profileModeModel;
        chartPanel = new LazyToolTipChartPanel(chart, false, true, true, true, true);
        chartPanel.addChartMouseListener(new ChartMouseListener() {
            public void chartMouseClicked(ChartMouseEvent e) {
                ChartEntity entity = e.getEntity();
                if (!(entity instanceof XYItemEntity))
                    return;
                int row = ((XYItemEntity) entity).getItem();
                positionsSelectionModel.setSelectedPositions(new int[]{row}, true);
            }
View Full Code Here

        this.label.draw(g2, (float) pt.getX(), (float) pt.getY(),
                this.contentAlignmentPoint);
        BlockResult result = null;
        if (ebp != null && sec != null) {
            if (this.toolTipText != null || this.urlText != null) {
                ChartEntity entity = new ChartEntity(entityArea,
                        this.toolTipText, this.urlText);
                sec.add(entity);
                result = new BlockResult();
                result.setEntityCollection(sec);
            }
View Full Code Here

        sb.append(StringUtils.getLineSeparator());
        EntityCollection entities = info.getEntityCollection();
        if (entities != null) {
            int count = entities.getEntityCount();
            for (int i = count - 1; i >= 0; i--) {
                ChartEntity entity = entities.getEntity(i);
                if (entity.getToolTipText() != null
                        || entity.getURLText() != null) {
                    String area = entity.getImageMapAreaTag(
                            toolTipTagFragmentGenerator,
                            urlTagFragmentGenerator);
                    if (area.length() > 0) {
                        sb.append(area);
                        sb.append(StringUtils.getLineSeparator());
View Full Code Here

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

    }
   
    public void dispatchMouseMovedEvent(Point2D point, MouseEvent e) {
        double x = point.getX();
        double y = point.getY();
        ChartEntity entity = this.info.getEntityCollection().getEntity(x, y);
        ChartMouseEventFX event = new ChartMouseEventFX(this.chart, e, entity);
        for (ChartMouseListenerFX listener : this.chartMouseListeners) {
            listener.chartMouseMoved(event);
        }
    }
View Full Code Here

    }

    public void dispatchMouseClickedEvent(Point2D point, MouseEvent e) {
        double x = point.getX();
        double y = point.getY();
        ChartEntity entity = this.info.getEntityCollection().getEntity(x, y);
        ChartMouseEventFX event = new ChartMouseEventFX(this.chart, e, entity);
        for (ChartMouseListenerFX listener : this.chartMouseListeners) {
            listener.chartMouseClicked(event);
        }
    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.entity.ChartEntity

Copyright © 2018 www.massapicom. 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.