/** * Sets the base radius and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param radius the radius (in Java2D units). * * @see #getBaseRadius() */ public void setBaseRadius(double radius) { this.baseRadius = radius; fireAnnotationChanged(); }
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation( plot.getRangeAxisLocation(), orientation); double j2DX = domainAxis.valueToJava2D(getX(), dataArea, domainEdge); double j2DY = rangeAxis.valueToJava2D(getY(), dataArea, rangeEdge); if (orientation == PlotOrientation.HORIZONTAL) { double temp = j2DX; double labelY = j2DY + Math.sin(this.angle) * (this.baseRadius + this.labelOffset); g2.setFont(getFont()); Shape hotspot = TextUtils.calculateRotatedStringBounds( getText(), g2, (float) labelX, (float) labelY, getTextAnchor(), getRotationAngle(), getRotationAnchor()); if (getBackgroundPaint() != null) { g2.setPaint(getBackgroundPaint()); g2.fill(hotspot); g2.setPaint(getPaint()); TextUtils.drawRotatedString(getText(), g2, (float) labelX, (float) labelY, getTextAnchor(), getRotationAngle(), getRotationAnchor()); if (isOutlineVisible()) { g2.setStroke(getOutlineStroke()); g2.setPaint(getOutlinePaint()); g2.draw(hotspot); String toolTip = getToolTipText(); String url = getURL(); if (toolTip != null || url != null) {
RectangleEdge rangeEdge = Plot.resolveRangeAxisLocation( plot.getRangeAxisLocation(), orientation); double j2DX = domainAxis.valueToJava2D(getX(), dataArea, domainEdge); double j2DY = rangeAxis.valueToJava2D(getY(), dataArea, rangeEdge); if (orientation == PlotOrientation.HORIZONTAL) { double temp = j2DX; double labelY = j2DY + Math.sin(this.angle) * (this.baseRadius + this.labelOffset); g2.setFont(getFont()); Shape hotspot = TextUtilities.calculateRotatedStringBounds( getText(), g2, (float) labelX, (float) labelY, getTextAnchor(), getRotationAngle(), getRotationAnchor()); if (getBackgroundPaint() != null) { g2.setPaint(getBackgroundPaint()); g2.fill(hotspot); g2.setPaint(getPaint()); TextUtilities.drawRotatedString(getText(), g2, (float) labelX, (float) labelY, getTextAnchor(), getRotationAngle(), getRotationAnchor()); if (isOutlineVisible()) { g2.setStroke(getOutlineStroke()); g2.setPaint(getOutlinePaint()); g2.draw(hotspot); String toolTip = getToolTipText(); String url = getURL(); if (toolTip != null || url != null) {
/** * Sets the base radius and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param radius the radius (in Java2D units). * * @see #getBaseRadius() */ public void setBaseRadius(double radius) { this.baseRadius = radius; fireAnnotationChanged(); }
/** * Sets the angle of the arrow and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param angle the angle (in radians). * * @see #getAngle() */ public void setAngle(double angle) { this.angle = angle; fireAnnotationChanged(); }
/** * Sets the tip radius and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param radius the radius (in Java2D units). * * @see #getTipRadius() */ public void setTipRadius(double radius) { this.tipRadius = radius; fireAnnotationChanged(); }
/** * Sets the arrow width and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param width the width (in Java2D units). * * @see #getArrowWidth() */ public void setArrowWidth(double width) { this.arrowWidth = width; fireAnnotationChanged(); }
/** * Sets the tip radius and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param radius the radius (in Java2D units). * * @see #getTipRadius() */ public void setTipRadius(double radius) { this.tipRadius = radius; fireAnnotationChanged(); }
/** * Sets the arrow length and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param length the length. * * @see #getArrowLength() */ public void setArrowLength(double length) { this.arrowLength = length; fireAnnotationChanged(); }
/** * Sets the label offset (from the arrow base, continuing in a straight * line, in Java2D units) and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param offset the offset (in Java2D units). * * @see #getLabelOffset() */ public void setLabelOffset(double offset) { this.labelOffset = offset; fireAnnotationChanged(); }
/** * Sets the angle of the arrow and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param angle the angle (in radians). * * @see #getAngle() */ public void setAngle(double angle) { this.angle = angle; fireAnnotationChanged(); }
/** * Sets the arrow length and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param length the length. * * @see #getArrowLength() */ public void setArrowLength(double length) { this.arrowLength = length; fireAnnotationChanged(); }
/** * Sets the arrow width and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param width the width (in Java2D units). * * @see #getArrowWidth() */ public void setArrowWidth(double width) { this.arrowWidth = width; fireAnnotationChanged(); }
/** * Sets the label offset (from the arrow base, continuing in a straight * line, in Java2D units) and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param offset the offset (in Java2D units). * * @see #getLabelOffset() */ public void setLabelOffset(double offset) { this.labelOffset = offset; fireAnnotationChanged(); }
/** * Sets the paint used for the arrow and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param paint the arrow paint (<code>null</code> not permitted). * * @see #getArrowPaint() */ public void setArrowPaint(Paint paint) { if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.arrowPaint = paint; fireAnnotationChanged(); }
/** * Sets the stroke used to draw the arrow line and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param stroke the stroke (<code>null</code> not permitted). * * @see #getArrowStroke() */ public void setArrowStroke(Stroke stroke) { if (stroke == null) { throw new IllegalArgumentException("Null 'stroke' not permitted."); } this.arrowStroke = stroke; fireAnnotationChanged(); }
/** * Sets the stroke used to draw the arrow line and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param stroke the stroke ({@code null} not permitted). * * @see #getArrowStroke() */ public void setArrowStroke(Stroke stroke) { Args.nullNotPermitted(stroke, "stroke"); this.arrowStroke = stroke; fireAnnotationChanged(); }
/** * Sets the paint used for the arrow and sends an * {@link AnnotationChangeEvent} to all registered listeners. * * @param paint the arrow paint ({@code null} not permitted). * * @see #getArrowPaint() */ public void setArrowPaint(Paint paint) { Args.nullNotPermitted(paint, "paint"); this.arrowPaint = paint; fireAnnotationChanged(); }