/** * Returns a hash code for this object. * * @return A hash code. */ public int hashCode() { // FIXME: do better than this return this.title.hashCode(); }
/** * Adds a chart subtitle, and notifies registered listeners that the chart * has been modified. * * @param subtitle the subtitle (<code>null</code> not permitted). * * @see #getSubtitle(int) */ public void addSubtitle(Title subtitle) { if (subtitle == null) { throw new IllegalArgumentException("Null 'subtitle' argument."); } this.subtitles.add(subtitle); subtitle.addChangeListener(this); fireChartChanged(); }
/** * Returns a clone of this object. * * @return A clone. * * @throws CloneNotSupportedException never. */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); }
Args.nullNotPermitted(area, "area"); Rectangle2D titleArea; RectangleEdge position = t.getPosition(); double ww = area.getWidth(); if (ww <= 0.0) { p.setGenerateEntities(entities); if (position == RectangleEdge.TOP) { Size2D size = t.arrange(g2, constraint); titleArea = createAlignedRectangle2D(size, area, t.getHorizontalAlignment(), VerticalAlignment.TOP); retValue = t.draw(g2, titleArea, p); area.setRect(area.getX(), Math.min(area.getY() + size.height, area.getMaxY()), area.getWidth(), Math.max(area.getHeight() - size.height, 0)); } else if (position == RectangleEdge.BOTTOM) { Size2D size = t.arrange(g2, constraint); titleArea = createAlignedRectangle2D(size, area, t.getHorizontalAlignment(), VerticalAlignment.BOTTOM); retValue = t.draw(g2, titleArea, p); area.setRect(area.getX(), area.getY(), area.getWidth(), area.getHeight() - size.height); } else if (position == RectangleEdge.RIGHT) { Size2D size = t.arrange(g2, constraint); titleArea = createAlignedRectangle2D(size, area, HorizontalAlignment.RIGHT, t.getVerticalAlignment()); retValue = t.draw(g2, titleArea, p); area.setRect(area.getX(), area.getY(), area.getWidth() - size.width, area.getHeight());
/** * Tests this {@code ImageTitle} for equality with an arbitrary * object. Returns {@code true} if: * <ul> * <li>{@code obj} is an instance of {@code ImageTitle}; * <li>{@code obj} references the same image as this * {@code ImageTitle}; * <li>{@code super.equals(obj)} returns {@code true}; * </ul> * * @param obj the object ({@code null} permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ImageTitle)) { return false; } ImageTitle that = (ImageTitle) obj; if (!ObjectUtils.equal(this.image, that.image)) { return false; } return super.equals(obj); }
Title subtitle = (Title) getSubtitle(i).clone(); chart.subtitles.add(subtitle); subtitle.addChangeListener(chart);
if (currentTitle.isVisible()) { EntityCollection e = drawTitle(currentTitle, g2, nonTitleArea, (entities != null));
RectangleEdge position = t.getPosition(); double ww = area.getWidth(); if (ww <= 0.0) { p.setGenerateEntities(entities); if (position == RectangleEdge.TOP) { Size2D size = t.arrange(g2, constraint); titleArea = createAlignedRectangle2D(size, area, t.getHorizontalAlignment(), VerticalAlignment.TOP); retValue = t.draw(g2, titleArea, p); area.setRect(area.getX(), Math.min(area.getY() + size.height, area.getMaxY()), area.getWidth(), Math.max(area.getHeight() Size2D size = t.arrange(g2, constraint); titleArea = createAlignedRectangle2D(size, area, t.getHorizontalAlignment(), VerticalAlignment.BOTTOM); retValue = t.draw(g2, titleArea, p); area.setRect(area.getX(), area.getY(), area.getWidth(), area.getHeight() - size.height); Size2D size = t.arrange(g2, constraint); titleArea = createAlignedRectangle2D(size, area, HorizontalAlignment.RIGHT, t.getVerticalAlignment()); retValue = t.draw(g2, titleArea, p); area.setRect(area.getX(), area.getY(), area.getWidth() - size.width, area.getHeight()); Size2D size = t.arrange(g2, constraint); titleArea = createAlignedRectangle2D(size, area,
new Range(0, maxW), new Range(0, maxH)); Size2D size = this.title.arrange(g2, rc); Rectangle2D titleRect = new Rectangle2D.Double(0, 0, size.width, size.height); Object result = this.title.draw(g2, titleRect, p); if (result instanceof EntityBlockResult) { EntityBlockResult ebr = (EntityBlockResult) result;
/** * Tests this <code>ImageTitle</code> for equality with an arbitrary * object. Returns <code>true</code> if: * <ul> * <li><code>obj</code> is an instance of <code>ImageTitle</code>; * <li><code>obj</code> references the same image as this * <code>ImageTitle</code>; * <li><code>super.equals(obj)<code> returns <code>true</code>; * </ul> * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ImageTitle)) { return false; } ImageTitle that = (ImageTitle) obj; if (!ObjectUtilities.equal(this.image, that.image)) { return false; } return super.equals(obj); }
Title subtitle = (Title) getSubtitle(i).clone(); chart.subtitles.add(subtitle); subtitle.addChangeListener(chart);
while (iterator.hasNext()) { Title currentTitle = (Title) iterator.next(); if (currentTitle.isVisible()) { EntityCollection e = drawTitle(currentTitle, g2, nonTitleArea, (entities != null));
/** * Tests this title 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 CompositeTitle)) { return false; } CompositeTitle that = (CompositeTitle) obj; if (!this.container.equals(that.container)) { return false; } if (!PaintUtils.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } return super.equals(obj); }
/** * Returns a hash code. * * @return A hash code. */ public int hashCode() { int result = super.hashCode(); result = 29 * result + (this.text != null ? this.text.hashCode() : 0); result = 29 * result + (this.font != null ? this.font.hashCode() : 0); result = 29 * result + (this.paint != null ? this.paint.hashCode() : 0); result = 29 * result + (this.backgroundPaint != null ? this.backgroundPaint.hashCode() : 0); return result; }
/** * Adds a chart subtitle, and notifies registered listeners that the chart * has been modified. * * @param subtitle the subtitle ({@code null} not permitted). * * @see #getSubtitle(int) */ public void addSubtitle(Title subtitle) { Args.nullNotPermitted(subtitle, "subtitle"); this.subtitles.add(subtitle); subtitle.addChangeListener(this); fireChartChanged(); }
/** * Returns a clone of this object. * * @return A clone. * * @throws CloneNotSupportedException never. */ public Object clone() throws CloneNotSupportedException { return super.clone(); }
/** * Tests this title 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 CompositeTitle)) { return false; } CompositeTitle that = (CompositeTitle) obj; if (!this.container.equals(that.container)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } return super.equals(obj); }
/** * Returns a hash code. * * @return A hash code. */ @Override public int hashCode() { int result = super.hashCode(); result = 29 * result + (this.text != null ? this.text.hashCode() : 0); result = 29 * result + (this.font != null ? this.font.hashCode() : 0); result = 29 * result + (this.paint != null ? this.paint.hashCode() : 0); result = 29 * result + (this.backgroundPaint != null ? this.backgroundPaint.hashCode() : 0); return result; }