/** * Returns the height of the text box. * * @param g2 the graphics device. * * @return The height (in Java2D units). */ public double getHeight(final Graphics2D g2) { final Size2D d = this.textBlock.calculateDimensions(g2); return this.interiorGap.extendHeight(d.getHeight()); }
/** * Returns the height of the text box. * * @param g2 the graphics device. * * @return The height (in Java2D units). */ public double getHeight(final Graphics2D g2) { final Size2D d = this.textBlock.calculateDimensions(g2); return this.interiorGap.extendHeight(d.getHeight()); }
/** * Returns the height of the text box. * * @param g2 the graphics device. * * @return The height (in Java2D units). */ public double getHeight(final Graphics2D g2) { final Size2D d = this.textBlock.calculateDimensions(g2); return this.interiorGap.extendHeight(d.getHeight()); }
final float x, final float y, final RectangleAnchor anchor) { final Size2D d1 = this.textBlock.calculateDimensions(g2); final double w = this.interiorGap.extendWidth(d1.getWidth()); final double h = this.interiorGap.extendHeight(d1.getHeight());
final float x, final float y, final RectangleAnchor anchor) { final Size2D d1 = this.textBlock.calculateDimensions(g2); final double w = this.interiorGap.extendWidth(d1.getWidth()); final double h = this.interiorGap.extendHeight(d1.getHeight());
final float x, final float y, final RectangleAnchor anchor) { final Size2D d1 = this.textBlock.calculateDimensions(g2); final double w = this.interiorGap.extendWidth(d1.getWidth()); final double h = this.interiorGap.extendHeight(d1.getHeight());
/** * Arranges the contents of the block, within the given constraints, and * returns the block size. * * @param g2 the graphics device. * @param constraint the constraint (<code>null</code> not permitted). * * @return The block size (in Java2D units, never <code>null</code>). */ public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) { g2.setFont(this.font); Size2D s = this.label.calculateDimensions(g2); return new Size2D(calculateTotalWidth(s.getWidth()), calculateTotalHeight(s.getHeight())); }
/** * A utility method for determining the width of a text block. * * @param block the text block. * @param position the position. * @param g2 the graphics device. * * @return The width. */ protected double calculateTextBlockWidth(TextBlock block, CategoryLabelPosition position, Graphics2D g2) { RectangleInsets insets = getTickLabelInsets(); Size2D size = block.calculateDimensions(g2); Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight()); Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); double w = rotatedBox.getBounds2D().getWidth() + insets.getLeft() + insets.getRight(); return w; }
/** * A utility method for determining the height of a text block. * * @param block the text block. * @param position the label position. * @param g2 the graphics device. * * @return The height. */ protected double calculateTextBlockHeight(TextBlock block, CategoryLabelPosition position, Graphics2D g2) { RectangleInsets insets = getTickLabelInsets(); Size2D size = block.calculateDimensions(g2); Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight()); Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); double h = rotatedBox.getBounds2D().getHeight() + insets.getTop() + insets.getBottom(); return h; }
final double angle) { final Size2D d = calculateDimensions(g2); final float[] offsets = calculateOffsets( anchor, d.getWidth(), d.getHeight()
final double angle) { final Size2D d = calculateDimensions(g2); final float[] offsets = calculateOffsets( anchor, d.getWidth(), d.getHeight()
final double angle) { final Size2D d = calculateDimensions(g2); final float[] offsets = calculateOffsets( anchor, d.getWidth(), d.getHeight()
new G2TextMeasurer(g2)); this.content.setLineAlignment(this.textAlignment); Size2D contentSize = this.content.calculateDimensions(g2); if (this.expandToFitSpace) { return new Size2D(maxWidth, contentSize.getHeight()); new G2TextMeasurer(g2)); this.content.setLineAlignment(this.textAlignment); Size2D contentSize = this.content.calculateDimensions(g2);
final double angle) { final Size2D d = calculateDimensions(g2); final float[] offsets = calculateOffsets(anchor, d.getWidth(), d.getHeight());
final double angle) { final Size2D d = calculateDimensions(g2); final float[] offsets = calculateOffsets(anchor, d.getWidth(), d.getHeight());
final double angle) { final Size2D d = calculateDimensions(g2); final float[] offsets = calculateOffsets(anchor, d.getWidth(), d.getHeight());
new G2TextMeasurer(g2)); this.content.setLineAlignment(this.textAlignment); Size2D contentSize = this.content.calculateDimensions(g2); if (this.expandToFitSpace) { return new Size2D(maxWidth, contentSize.getHeight()); new G2TextMeasurer(g2)); this.content.setLineAlignment(this.textAlignment); Size2D contentSize = this.content.calculateDimensions(g2);