g2.setFont(getTickLabelFont(tick.getCategory())); g2.setPaint(getTickLabelPaint(tick.getCategory())); x1 = x0 - state.getMax(); Rectangle2D area = new Rectangle2D.Double(x0, y0, (x1 - x0), (y1 - y0)); if(r==null || !r.intersects(area)) { position.getLabelAnchor(), (float) anchorPoint.getX(), (float) anchorPoint.getY(), position.getAngle()); if (plotState != null && plotState.getOwner() != null) { EntityCollection entities = plotState.getOwner().getEntityCollection(); if (entities != null) { String tooltip = getCategoryLabelToolTip( tick.getCategory()); entities.add(new CategoryLabelEntity(tick.getCategory(), bounds, tooltip, null));
/** * Adds all the entities from the specified collection. * * @param collection the collection of entities (<code>null</code> not * permitted). */ public void addAll(EntityCollection collection) { this.entities.addAll(collection.getEntities()); }
/** * Clears the information recorded by this object. */ public void clear() { this.chartArea.setRect(0.0, 0.0, 0.0, 0.0); this.plotInfo = new PlotRenderingInfo(this); if (this.entities != null) { this.entities.clear(); } }
info.setPlotArea(plotArea); info.setDataArea(plotArea); Shape savedClip = g2.getClip(); g2.clip(plotArea); Rectangle2D linkAreaXX = new Rectangle2D.Double(linkX, linkY, linkW, linkH * (1 - this.depthFactor)); state.setLinkArea(linkAreaXX); g2.draw(linkAreaXX); g2.setPaint(Color.YELLOW); g2.draw(new Ellipse2D.Double(linkAreaXX.getX(), linkAreaXX.getY(), linkAreaXX.getWidth(), linkAreaXX.getHeight())); Rectangle2D explodeArea = new Rectangle2D.Double(linkX + hh / 2.0, linkY + vv / 2.0, linkW - hh, linkH - vv); = info.getOwner().getEntityCollection(); if (entities != null) { String tip = null; upperArc, dataset, getPieIndex(), sectionIndex, currentKey, tip, url); entities.add(entity);
bar = new Rectangle2D.Double( barL0, barW0, barLength, state.getBarWidth() ); } else { bar = new Rectangle2D.Double( barW0, barL0, state.getBarWidth(), barLength ); g2.setPaint(seriesPaint); g2.fill(bar); if (isDrawBarOutline() && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) { g2.setStroke(getItemStroke(row, column)); g2.setPaint(getItemOutlinePaint(row, column)); g2.draw(bar); column ); entities.add(entity);
info.clear(); info.setChartArea(chartArea); entities = info.getEntityCollection(); entities.add(new JFreeChartEntity((Rectangle2D) chartArea.clone(), this)); Shape savedClip = g2.getClip(); g2.clip(chartArea); g2.addRenderingHints(this.renderingHints); Rectangle2D nonTitleArea = new Rectangle2D.Double(); nonTitleArea.setRect(chartArea); this.padding.trim(nonTitleArea); (entities != null)); if (e != null) { entities.addAll(e); (entities != null)); if (e != null) { entities.addAll(e);
entities = info.getOwner().getEntityCollection(); - headW / 2, point.getY() - headH / 2, headW, headH); g2.setPaint(paint); g2.fill(head); g2.setStroke(outlineStroke); g2.setPaint(outlinePaint); g2.draw(head); this.getDataset().getRowKey(row), this.getDataset().getColumnKey(col)); entities.add(entity);
RectangleEdge domainAxisLocation = plot.getDomainAxisEdge(); RectangleEdge rangeAxisLocation = plot.getRangeAxisEdge(); double transX = domainAxis.valueToJava2D( x, dataArea, domainAxisLocation ); double transY = rangeAxis.valueToJava2D( y, dataArea, rangeAxisLocation ); circle = new Ellipse2D.Double( transY - circleSize / 2.0, transX - circleSize / 2.0, circleSize, circleSize ); g2.setPaint( getItemPaint( series, item ) ); g2.fill( circle ); g2.setStroke( getItemOutlineStroke( series, item ) ); g2.setPaint( getItemOutlinePaint( series, item ) ); g2.draw( circle ); entities = info.getOwner().getEntityCollection(); entities.add( entity );
EntityCollection entities = null; if (info != null) { entities = info.getOwner().getEntityCollection(); rect = new Rectangle2D.Double(); Object antiAlias = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); transX = horizontalAxis.valueToJava2D(x[k], dataArea, RectangleEdge.BOTTOM); transXm1 = horizontalAxis.valueToJava2D(x[indexX[i - 1]], rect.setRect(transX, transY, transDX, transDY); if (zNumber[k] != null) { g2.setPaint(colorBar.getPaint(zNumber[k].doubleValue())); g2.fill(rect); (Rectangle2D.Double) entityArea.clone(), tip, url); entity.setIndex(k); entities.add(entity);
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation( rangeAxisLocation, orientation); Range xRange = domainAxis.getRange(); Range yRange = rangeAxis.getRange(); double anchorX = 0.0; double anchorY = 0.0; anchorX = domainAxis.valueToJava2D(this.x, dataArea, domainEdge); anchorY = rangeAxis.valueToJava2D(this.y, dataArea, rangeEdge); Rectangle2D titleRect = new Rectangle2D.Double(0, 0, size.width, size.height); Point2D anchorPoint = RectangleAnchor.coordinates(titleRect, BlockParams p = new BlockParams(); if (info != null) { if (info.getOwner().getEntityCollection() != null) { p.setGenerateEntities(true); if (result instanceof EntityBlockResult) { EntityBlockResult ebr = (EntityBlockResult) result; info.getOwner().getEntityCollection().addAll( ebr.getEntityCollection());
subinfo = new ChartRenderingInfo(); info.getOwner().getEntityCollection().addAll( subinfo.getEntityCollection()); info.addSubplotInfo(subinfo.getPlotInfo());
/** * 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)); } } }
final Font ytkfont = chart.getYAxisTickFont(); if (ylbfont != null) { cplot.getRangeAxis().setLabelFont(ylbfont); cplot.getRangeAxis().setTickLabelFont(ytkfont); final Font xtkfont = chart.getXAxisTickFont(); if (xlbfont != null) { xyplot.getDomainAxis().setLabelFont(xlbfont); ChartRenderingInfo jfinfo = new ChartRenderingInfo(); BufferedImage bi = jfchart.createBufferedImage(chart.getIntWidth(), chart.getIntHeight(), Transparency.TRANSLUCENT, jfinfo); int j = 0; String preUrl = null; for(Iterator it=jfinfo.getEntityCollection().iterator();it.hasNext();) { ChartEntity ce = ( ChartEntity ) it.next(); final String url = ce.getURLText();
ChartRenderingInfo renderingInfo = new ChartRenderingInfo(); EntityCollection entityCollection = renderingInfo.getEntityCollection(); if (entityCollection != null && entityCollection.getEntityCount() > 0) areaHyperlinks = new ArrayList(entityCollection.getEntityCount()); for (Iterator it = entityCollection.iterator(); it.hasNext();)
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 ); } } }
entities.add(entity);
sb.append("\" name=\"").append(htmlEscape(name)).append("\">"); 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) {
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; }
info.setPlotArea(plotArea); info.setDataArea(plotArea); Shape savedClip = g2.getClip(); g2.clip(plotArea); Rectangle2D linkAreaXX = new Rectangle2D.Double(linkX, linkY, linkW, linkH * (1 - this.depthFactor)); state.setLinkArea(linkAreaXX); g2.draw(linkAreaXX); g2.setPaint(Color.yellow); g2.draw(new Ellipse2D.Double(linkAreaXX.getX(), linkAreaXX.getY(), linkAreaXX.getWidth(), linkAreaXX.getHeight())); Rectangle2D explodeArea = new Rectangle2D.Double(linkX + hh / 2.0, linkY + vv / 2.0, linkW - hh, linkH - vv); = info.getOwner().getEntityCollection(); if (entities != null) { String tip = null; upperArc, dataset, getPieIndex(), sectionIndex, currentKey, tip, url); entities.add(entity);