if (plotState != null && plotState.getOwner() != null) { EntityCollection entities = plotState.getOwner().getEntityCollection(); if (entities != null) { String tooltip = getCategoryLabelToolTip(
/** * A convenience method that returns a reference to the entity * collection (may be <code>null</code>) being used to record * chart entities. * * @return The entity collection (possibly <code>null</code>). */ public EntityCollection getEntityCollection() { EntityCollection result = null; if (this.info != null) { ChartRenderingInfo owner = this.info.getOwner(); if (owner != null) { result = owner.getEntityCollection(); } } return result; }
/** * A convenience method that returns a reference to the entity * collection (may be {@code null}) being used to record * chart entities. * * @return The entity collection (possibly {@code null}). */ public EntityCollection getEntityCollection() { EntityCollection result = null; if (this.info != null) { ChartRenderingInfo owner = this.info.getOwner(); if (owner != null) { result = owner.getEntityCollection(); } } return result; }
static Map<Shape, String> buildShapeLinkMap(ChartRenderingInfo renderingInfo, int dotsPerPixel) { Map<Shape, String> linkShapes = null; AffineTransform scaleTransform = new AffineTransform(); scaleTransform.scale(dotsPerPixel, dotsPerPixel); for (Object entity : renderingInfo.getEntityCollection().getEntities()) { if (!(entity instanceof ChartEntity)) continue; ChartEntity chartEntity = (ChartEntity) entity; Shape shape = chartEntity.getArea(); String url = chartEntity.getURLText(); if (url != null) { if (linkShapes == null) linkShapes = new HashMap<Shape, String>(); linkShapes.put(scaleTransform.createTransformedShape(shape), url); } } return linkShapes; }
private void populateInfo( final ChartRenderingInfo info ) { if ( urlTemplate == null ) { return; } ArrayList seriesListArray = null; Iterator iter = info.getEntityCollection().iterator(); while ( iter.hasNext() ) { ChartEntity entity = (ChartEntity) iter.next(); if ( entity instanceof PieSectionEntity ) { populatePieSectionEntity( (PieSectionEntity) entity ); } else if ( entity instanceof CategoryItemEntity ) { populateCategoryItemEntity( (CategoryItemEntity) entity, seriesListArray ); } } }
/** * Returns the chart entity at a given point. * <P> * This method will return null if there is (a) no entity at the given * point, or (b) no entity collection has been generated. * * @param viewX the x-coordinate. * @param viewY the y-coordinate. * * @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(); result = entities != null ? entities.getEntity(x, y) : null; } return result; }
/** * Returns the chart entity at a given point. * <P> * This method will return null if there is (a) no entity at the given * point, or (b) no entity collection has been generated. * * @param viewX the x-coordinate. * @param viewY the y-coordinate. * * @return The chart entity (possibly {@code null}). */ 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(); result = entities != null ? entities.getEntity(x, y) : null; } return result; }
/** * Returns a string for the tooltip. * * @param e the mouse event. * * @return A tool tip or {@code null} if no tooltip is available. */ @Override public String getToolTipText(MouseEvent e) { 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; }
/** * Returns a string for the tooltip. * * @param e the mouse event. * * @return A tool tip or <code>null</code> if no tooltip is available. */ public String getToolTipText(MouseEvent e) { 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; }
@Override public RepresentationResponse producePresentation(DesignOptions options) throws Exception { ChartRenderingInfo renderingInfo = new ChartRenderingInfo(new StandardEntityCollection()); String chartUrl = createChart(options, renderingInfo); Rectangle2D plotArea = renderingInfo.getPlotInfo().getDataArea(); for (Axis axis : renderer.getAxisMapping().values()) { axis.setMaxY(plotArea.getMaxY()); axis.setMinY(plotArea.getMinY()); } ImageEntity[] entities = {}; if (!this.isOverview) { LOGGER.debug("Produced EES diagram " + chartUrl); entities = createImageEntities(renderingInfo.getEntityCollection()); } else { LOGGER.debug("Produced EES Overview diagram " + chartUrl); } Bounds chartArea = new Bounds(plotArea.getMinX(), plotArea.getMaxX(), plotArea.getMinY(), plotArea.getMaxY()); return new EESDataResponse(chartUrl, options, chartArea, entities, renderer.getAxisMapping()); }
/** * A utility method for adding an {@link XYAnnotationEntity} to * a {@link PlotRenderingInfo} instance. * * @param info the plot rendering info ({@code null} permitted). * @param hotspot the hotspot area. * @param rendererIndex the renderer index. * @param toolTipText the tool tip text. * @param urlText the URL text. */ protected void addEntity(PlotRenderingInfo info, Shape hotspot, int rendererIndex, String toolTipText, String urlText) { if (info == null) { return; } EntityCollection entities = info.getOwner().getEntityCollection(); if (entities == null) { return; } XYAnnotationEntity entity = new XYAnnotationEntity(hotspot, rendererIndex, toolTipText, urlText); entities.add(entity); }
/** * A utility method for adding an {@link XYAnnotationEntity} to * a {@link PlotRenderingInfo} instance. * * @param info the plot rendering info (<code>null</code> permitted). * @param hotspot the hotspot area. * @param rendererIndex the renderer index. * @param toolTipText the tool tip text. * @param urlText the URL text. */ protected void addEntity(PlotRenderingInfo info, Shape hotspot, int rendererIndex, String toolTipText, String urlText) { if (info == null) { return; } EntityCollection entities = info.getOwner().getEntityCollection(); if (entities == null) { return; } XYAnnotationEntity entity = new XYAnnotationEntity(hotspot, rendererIndex, toolTipText, urlText); entities.add(entity); }
EntityCollection entities = this.info.getEntityCollection(); if (entities != null) { entity = entities.getEntity(x, y);
EntityCollection entities = this.info.getEntityCollection(); if (entities != null) { entity = entities.getEntity(x, y);
EntityCollection entities = this.info.getEntityCollection(); if (entities != null) { entity = entities.getEntity(x, y);
/** * Creates a plot entity that contains a reference to the plot and the * data area as shape. * * @param dataArea the data area used as hot spot for the entity. * @param plotState the plot rendering info containing a reference to the * EntityCollection. * @param toolTip the tool tip (defined in the respective Plot * subclass) (<code>null</code> permitted). * @param urlText the url (defined in the respective Plot subclass) * (<code>null</code> permitted). * * @since 1.0.13 */ protected void createAndAddEntity(Rectangle2D dataArea, PlotRenderingInfo plotState, String toolTip, String urlText) { if (plotState != null && plotState.getOwner() != null) { EntityCollection e = plotState.getOwner().getEntityCollection(); if (e != null) { e.add(new PlotEntity(dataArea, this, toolTip, urlText)); } } }
/** * Creates a plot entity that contains a reference to the plot and the * data area as shape. * * @param dataArea the data area used as hot spot for the entity. * @param plotState the plot rendering info containing a reference to the * EntityCollection. * @param toolTip the tool tip (defined in the respective Plot * subclass) ({@code null} permitted). * @param urlText the url (defined in the respective Plot subclass) * ({@code null} permitted). * * @since 1.0.13 */ protected void createAndAddEntity(Rectangle2D dataArea, PlotRenderingInfo plotState, String toolTip, String urlText) { if (plotState != null && plotState.getOwner() != null) { EntityCollection e = plotState.getOwner().getEntityCollection(); if (e != null) { e.add(new PlotEntity(dataArea, this, toolTip, urlText)); } } }
return; Iterator iter = info.getEntityCollection().iterator(); while ( iter.hasNext() ) { ChartEntity entity = (ChartEntity) iter.next();
entities = info.getOwner().getEntityCollection();
xb.addAttribute("id", mapId); xb.addAttribute("name", mapId); Iterator iter = renderingInfo.getEntityCollection().iterator(); while (iter.hasNext()) { ChartEntity ce = (ChartEntity) iter.next();