@Override public LegendItem getLegendItem(int datasetIndex, int series) { LegendItem li = super.getLegendItem(datasetIndex, series); Stroke outlineStroke = getItemStroke(series, 0); Paint fillPaint = li.getFillPaint(); Paint outlinePaint = fillPaint; if (!fillCoordinates) { fillPaint = new Color(255, 255, 255, 255); } return new LegendItem( li.getLabel(), li.getDescription(), li.getToolTipText(), li.getURLText(), li.getShape(), fillPaint, outlineStroke, outlinePaint); }
@Override public XYItemRendererState initialise( Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info) { return super.initialise(g2, dataArea, plot, data, info); }
/** * Adds an annotation and sends a {@link RendererChangeEvent} to all * registered listeners. The annotation is added to the foreground * layer. * * @param annotation the annotation (<code>null</code> not permitted). */ public void addAnnotation(XYAnnotation annotation) { // defer argument checking addAnnotation(annotation, Layer.FOREGROUND); }
boolean negative) { XYItemLabelGenerator generator = getItemLabelGenerator(series, item); if (generator != null) { Font labelFont = getItemLabelFont(series, item); Paint paint = getItemLabelPaint(series, item); g2.setFont(labelFont); g2.setPaint(paint); position = getPositiveItemLabelPosition(series, item); position = getNegativeItemLabelPosition(series, item); Point2D anchorPoint = calculateLabelAnchorPoint( position.getItemLabelAnchor(), x, y, orientation); TextUtils.drawRotatedString(label, g2,
/** * Returns a clone of the renderer. * * @return A clone. * * @throws CloneNotSupportedException if the renderer cannot be cloned. */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); }
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object ({@code null} permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYBubbleRenderer)) { return false; } XYBubbleRenderer that = (XYBubbleRenderer) obj; if (this.scaleType != that.scaleType) { return false; } return super.equals(obj); }
/** * Returns a (possibly empty) collection of legend items for the series * that this renderer is responsible for drawing. * * @return The legend item collection (never {@code null}). */ @Override public LegendItemCollection getLegendItems() { if (this.plot == null) { return new LegendItemCollection(); } LegendItemCollection result = new LegendItemCollection(); int index = this.plot.getIndexOf(this); XYDataset dataset = this.plot.getDataset(index); if (dataset != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { if (isSeriesVisibleInLegend(i)) { LegendItem item = getLegendItem(index, i); if (item != null) { result.add(item); } } } } return result; }
/** * Draws a base line across the chart at value zero on the domain axis. * * @param g2 the graphics device. * @param area the data area. * * @see #setDomainZeroBaselineVisible(boolean) * * @since 1.0.5 */ protected void drawZeroDomainBaseline(Graphics2D g2, Rectangle2D area) { if (isDomainZeroBaselineVisible()) { XYItemRenderer r = getRenderer(); // FIXME: the renderer interface doesn't have the drawDomainLine() // method, so we have to rely on the renderer being a subclass of // AbstractXYItemRenderer (which is lame) if (r instanceof AbstractXYItemRenderer) { AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) r; renderer.drawDomainLine(g2, this, getDomainAxis(), area, 0.0, this.domainZeroBaselinePaint, this.domainZeroBaselineStroke); } } }
/** * Returns the lower and upper bounds (range) of the x-values in the * specified dataset. * * @param dataset the dataset (<code>null</code> permitted). * * @return The range (<code>null</code> if the dataset is <code>null</code> * or empty). * * @see #findRangeBounds(XYDataset) */ public Range findDomainBounds(XYDataset dataset) { return findDomainBounds(dataset, false); }
Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); Point2D coords = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); Point2D coords = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(),
Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); Point2D coords = calculateDomainMarkerTextAnchorPoint( g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); Point2D coords = calculateDomainMarkerTextAnchorPoint( g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(),
boolean negative) { XYItemLabelGenerator generator = getItemLabelGenerator(series, item); if (generator != null) { Font labelFont = getItemLabelFont(series, item); Paint paint = getItemLabelPaint(series, item); g2.setFont(labelFont); g2.setPaint(paint); position = getPositiveItemLabelPosition(series, item); position = getNegativeItemLabelPosition(series, item); Point2D anchorPoint = calculateLabelAnchorPoint( position.getItemLabelAnchor(), x, y, orientation); TextUtilities.drawRotatedString(label, g2,
/** * Returns a clone of the renderer. * * @return A clone. * * @throws CloneNotSupportedException if the renderer cannot be cloned. */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); }
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYBubbleRenderer)) { return false; } XYBubbleRenderer that = (XYBubbleRenderer) obj; if (this.scaleType != that.scaleType) { return false; } return super.equals(obj); }
/** * Returns a (possibly empty) collection of legend items for the series * that this renderer is responsible for drawing. * * @return The legend item collection (never <code>null</code>). */ public LegendItemCollection getLegendItems() { if (this.plot == null) { return new LegendItemCollection(); } LegendItemCollection result = new LegendItemCollection(); int index = this.plot.getIndexOf(this); XYDataset dataset = this.plot.getDataset(index); if (dataset != null) { int seriesCount = dataset.getSeriesCount(); for (int i = 0; i < seriesCount; i++) { if (isSeriesVisibleInLegend(i)) { LegendItem item = getLegendItem(index, i); if (item != null) { result.add(item); } } } } return result; }
((AbstractXYItemRenderer) r).drawDomainLine(g2, this, getDomainAxis(), dataArea, tick.getValue(), gridPaint, gridStroke);
/** * Returns the lower and upper bounds (range) of the x-values in the * specified dataset. * * @param dataset the dataset ({@code null} permitted). * * @return The range ({@code null} if the dataset is {@code null} * or empty). * * @see #findRangeBounds(XYDataset) */ @Override public Range findDomainBounds(XYDataset dataset) { return findDomainBounds(dataset, false); }
g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(),
g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateDomainMarkerTextAnchorPoint( g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateDomainMarkerTextAnchorPoint( g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(),
/** * Returns a clone of this renderer. * * @return A clone of this renderer. * * @throws CloneNotSupportedException if there is a problem creating the * clone. */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); }