/** * Returns a new instance based on an existing instance but with the bottom * position changed. * * @param base the base (<code>null</code> not permitted). * @param bottom the bottom position (<code>null</code> not permitted). * * @return A new instance (never <code>null</code>). */ public static CategoryLabelPositions replaceBottomPosition( CategoryLabelPositions base, CategoryLabelPosition bottom) { if (base == null) { throw new IllegalArgumentException("Null 'base' argument."); } if (bottom == null) { throw new IllegalArgumentException("Null 'bottom' argument."); } return new CategoryLabelPositions( base.getLabelPosition(RectangleEdge.TOP), bottom, base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT) ); }
/** * Returns a new instance based on an existing instance but with the left * position changed. * * @param base the base (<code>null</code> not permitted). * @param left the left position (<code>null</code> not permitted). * * @return A new instance (never <code>null</code>). */ public static CategoryLabelPositions replaceLeftPosition( CategoryLabelPositions base, CategoryLabelPosition left) { if (base == null) { throw new IllegalArgumentException("Null 'base' argument."); } if (left == null) { throw new IllegalArgumentException("Null 'left' argument."); } return new CategoryLabelPositions( base.getLabelPosition(RectangleEdge.TOP), base.getLabelPosition(RectangleEdge.BOTTOM), left, base.getLabelPosition(RectangleEdge.RIGHT) ); }
/** * Returns a new instance based on an existing instance but with the top * position changed. * * @param base the base (<code>null</code> not permitted). * @param top the top position (<code>null</code> not permitted). * * @return A new instance (never <code>null</code>). */ public static CategoryLabelPositions replaceTopPosition( CategoryLabelPositions base, CategoryLabelPosition top) { if (base == null) { throw new IllegalArgumentException("Null 'base' argument."); } if (top == null) { throw new IllegalArgumentException("Null 'top' argument."); } return new CategoryLabelPositions( top, base.getLabelPosition(RectangleEdge.BOTTOM), base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT) ); }
/** * Returns a new instance based on an existing instance but with the right * position changed. * * @param base the base (<code>null</code> not permitted). * @param right the right position (<code>null</code> not permitted). * * @return A new instance (never <code>null</code>). */ public static CategoryLabelPositions replaceRightPosition( CategoryLabelPositions base, CategoryLabelPosition right) { if (base == null) { throw new IllegalArgumentException("Null 'base' argument."); } if (right == null) { throw new IllegalArgumentException("Null 'right' argument."); } return new CategoryLabelPositions( base.getLabelPosition(RectangleEdge.TOP), base.getLabelPosition(RectangleEdge.BOTTOM), base.getLabelPosition(RectangleEdge.LEFT), right ); }
/** * Creates a new instance where the category labels angled upwards by the * specified amount. * * @param angle the rotation angle (should be < Math.PI / 2.0). * * @return A category label position specification. */ public static CategoryLabelPositions createUpRotationLabelPositions( double angle) { return new CategoryLabelPositions( new CategoryLabelPosition( RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, -angle, CategoryLabelWidthType.RANGE, 0.50f), // TOP new CategoryLabelPosition( RectangleAnchor.TOP, TextBlockAnchor.TOP_RIGHT, TextAnchor.TOP_RIGHT, -angle, CategoryLabelWidthType.RANGE, 0.50f), // BOTTOM new CategoryLabelPosition( RectangleAnchor.RIGHT, TextBlockAnchor.BOTTOM_RIGHT, TextAnchor.BOTTOM_RIGHT, -angle, CategoryLabelWidthType.RANGE, 0.50f), // LEFT new CategoryLabelPosition( RectangleAnchor.LEFT, TextBlockAnchor.TOP_LEFT, TextAnchor.TOP_LEFT, -angle, CategoryLabelWidthType.RANGE, 0.50f) // RIGHT ); }
/** * Creates a new instance where the category labels angled downwards by the * specified amount. * * @param angle the rotation angle (should be < Math.PI / 2.0). * * @return A category label position specification. */ public static CategoryLabelPositions createDownRotationLabelPositions( double angle) { return new CategoryLabelPositions( new CategoryLabelPosition( RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_RIGHT, TextAnchor.BOTTOM_RIGHT, angle, CategoryLabelWidthType.RANGE, 0.50f), // TOP new CategoryLabelPosition( RectangleAnchor.TOP, TextBlockAnchor.TOP_LEFT, TextAnchor.TOP_LEFT, angle, CategoryLabelWidthType.RANGE, 0.50f), // BOTTOM new CategoryLabelPosition( RectangleAnchor.RIGHT, TextBlockAnchor.TOP_RIGHT, TextAnchor.TOP_RIGHT, angle, CategoryLabelWidthType.RANGE, 0.50f), // LEFT new CategoryLabelPosition( RectangleAnchor.LEFT, TextBlockAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, angle, CategoryLabelWidthType.RANGE, 0.50f) // RIGHT ); }
/** * Returns a new instance based on an existing instance but with the top * position changed. * * @param base the base ({@code null} not permitted). * @param top the top position ({@code null} not permitted). * * @return A new instance (never {@code null}). */ public static CategoryLabelPositions replaceTopPosition( CategoryLabelPositions base, CategoryLabelPosition top) { Args.nullNotPermitted(base, "base"); Args.nullNotPermitted(top, "top"); return new CategoryLabelPositions(top, base.getLabelPosition(RectangleEdge.BOTTOM), base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT)); }
/** * Returns a new instance based on an existing instance but with the bottom * position changed. * * @param base the base ({@code null} not permitted). * @param bottom the bottom position ({@code null} not permitted). * * @return A new instance (never {@code null}). */ public static CategoryLabelPositions replaceBottomPosition( CategoryLabelPositions base, CategoryLabelPosition bottom) { Args.nullNotPermitted(base, "base"); Args.nullNotPermitted(bottom, "bottom"); return new CategoryLabelPositions( base.getLabelPosition(RectangleEdge.TOP), bottom, base.getLabelPosition(RectangleEdge.LEFT), base.getLabelPosition(RectangleEdge.RIGHT)); }
return new CategoryLabelPositions( new CategoryLabelPosition( RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_RIGHT,
/** * Returns a new instance based on an existing instance but with the left * position changed. * * @param base the base ({@code null} not permitted). * @param left the left position ({@code null} not permitted). * * @return A new instance (never {@code null}). */ public static CategoryLabelPositions replaceLeftPosition( CategoryLabelPositions base, CategoryLabelPosition left) { Args.nullNotPermitted(base, "base"); Args.nullNotPermitted(left, "left"); return new CategoryLabelPositions( base.getLabelPosition(RectangleEdge.TOP), base.getLabelPosition(RectangleEdge.BOTTOM), left, base.getLabelPosition(RectangleEdge.RIGHT)); }
/** * Returns a new instance based on an existing instance but with the right * position changed. * * @param base the base ({@code null} not permitted). * @param right the right position ({@code null} not permitted). * * @return A new instance (never {@code null}). */ public static CategoryLabelPositions replaceRightPosition( CategoryLabelPositions base, CategoryLabelPosition right) { Args.nullNotPermitted(base, "base"); Args.nullNotPermitted(right, "right"); return new CategoryLabelPositions( base.getLabelPosition(RectangleEdge.TOP), base.getLabelPosition(RectangleEdge.BOTTOM), base.getLabelPosition(RectangleEdge.LEFT), right); }
return new CategoryLabelPositions( new CategoryLabelPosition( RectangleAnchor.BOTTOM, TextBlockAnchor.BOTTOM_LEFT,
CategoryLabelWidthType.CATEGORY, 100); CategoryLabelPositions positions = new CategoryLabelPositions(pos, pos, pos, pos); categoryAxis.setCategoryLabelPositions(positions); categoryAxis.setMaximumCategoryLabelWidthRatio(6.0f);