/** * Draws the block within the specified area. * * @param g2 the graphics device. * @param area the area. * @param params ignored ({@code null} permitted). * * @return Always {@code null}. */ @Override public Object draw(Graphics2D g2, Rectangle2D area, Object params) { draw(g2, area); return null; }
/** * Draws the title on a Java 2D graphics device (such as the screen or a * printer). * * @param g2 the graphics device. * @param area the area allocated for the title. */ @Override public void draw(Graphics2D g2, Rectangle2D area) { RectangleEdge position = getPosition(); if (position == RectangleEdge.TOP || position == RectangleEdge.BOTTOM) { drawHorizontal(g2, area); } else if (position == RectangleEdge.LEFT || position == RectangleEdge.RIGHT) { drawVertical(g2, area); } else { throw new RuntimeException("Invalid title position."); } }
double rightSpace = 0.0; double w = getWidth(); double h = getHeight(); RectangleInsets padding = getPadding(); topSpace = padding.calculateTopOutset(h); bottomSpace = padding.calculateBottomOutset(h); rightSpace = padding.calculateRightOutset(w); if (getPosition() == RectangleEdge.TOP) { startY = chartArea.getY() + topSpace; HorizontalAlignment horizontalAlignment = getHorizontalAlignment(); double startX = 0.0; if (horizontalAlignment == HorizontalAlignment.CENTER) {
double rightSpace = 0.0; double w = getWidth(); double h = getHeight(); RectangleInsets padding = getPadding(); if (padding != null) { topSpace = padding.calculateTopOutset(h); if (getPosition() == RectangleEdge.LEFT) { startX = chartArea.getX() + leftSpace; VerticalAlignment alignment = getVerticalAlignment(); double startY = 0.0; if (alignment == VerticalAlignment.CENTER) {
/** * 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} not permitted). * * @return The block size (in Java2D units, never {@code null}). */ @Override public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) { Size2D s = new Size2D(this.image.getWidth(null), this.image.getHeight(null)); return new Size2D(calculateTotalWidth(s.getWidth()), calculateTotalHeight(s.getHeight())); }
double rightSpace; double w = getWidth(); double h = getHeight(); RectangleInsets padding = getPadding(); topSpace = padding.calculateTopOutset(h); bottomSpace = padding.calculateBottomOutset(h); rightSpace = padding.calculateRightOutset(w); if (getPosition() == RectangleEdge.TOP) { startY = chartArea.getY() + topSpace; HorizontalAlignment horizontalAlignment = getHorizontalAlignment(); double startX = 0.0; if (horizontalAlignment == HorizontalAlignment.CENTER) {
double rightSpace = 0.0; double w = getWidth(); double h = getHeight(); RectangleInsets padding = getPadding(); if (padding != null) { topSpace = padding.calculateTopOutset(h); if (getPosition() == RectangleEdge.LEFT) { startX = chartArea.getX() + leftSpace; VerticalAlignment alignment = getVerticalAlignment(); double startY = 0.0; if (alignment == VerticalAlignment.CENTER) {
/** * 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) { Size2D s = new Size2D(this.image.getWidth(null), this.image.getHeight(null)); return new Size2D(calculateTotalWidth(s.getWidth()), calculateTotalHeight(s.getHeight())); }
/** * Draws the title on a Java 2D graphics device (such as the screen or a * printer). * * @param g2 the graphics device. * @param area the area allocated for the title. */ public void draw(Graphics2D g2, Rectangle2D area) { RectangleEdge position = getPosition(); if (position == RectangleEdge.TOP || position == RectangleEdge.BOTTOM) { drawHorizontal(g2, area); } else if (position == RectangleEdge.LEFT || position == RectangleEdge.RIGHT) { drawVertical(g2, area); } else { throw new RuntimeException("Invalid title position."); } }
/** * Draws the block within the specified area. * * @param g2 the graphics device. * @param area the area. * @param params ignored (<code>null</code> permitted). * * @return Always <code>null</code>. */ public Object draw(Graphics2D g2, Rectangle2D area, Object params) { draw(g2, area); return null; }