/** * Rotate the transition * * Currently doesn't work * @param angle to rotate */ public final void rotate(int angle) { shape = ShapeUtilities.rotateShape(unrotated, Math.toRadians(angle), 0,0); Rectangle bounds = shape.getBounds(); Rectangle newBounds = new Rectangle((int)(model.getCentre().getX() + bounds.getX()), (int)(model.getCentre().getY() + bounds.getY()), (int) bounds.getWidth() + getComponentDrawOffset(), (int)bounds.getHeight() + getComponentDrawOffset()) ; setBounds(newBounds); }
/** * 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; }
d.getWidth(), d.getHeight() ); final Shape rotatedBounds = ShapeUtilities.rotateShape( bounds, angle, rotateX, rotateY );
d.getWidth(), d.getHeight() ); final Shape rotatedBounds = ShapeUtilities.rotateShape( bounds, angle, rotateX, rotateY );
d.getWidth(), d.getHeight() ); final Shape rotatedBounds = ShapeUtilities.rotateShape( bounds, angle, rotateX, rotateY );
Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, textWidth, textHeight); Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(), 0.0f, 0.0f); max = Math.max(max, rotatedBox.getBounds2D().getWidth() + insets.getTop() + insets.getBottom());