本文整理匯總了Java中org.jfree.ui.RectangleAnchor.BOTTOM屬性的典型用法代碼示例。如果您正苦於以下問題:Java RectangleAnchor.BOTTOM屬性的具體用法?Java RectangleAnchor.BOTTOM怎麽用?Java RectangleAnchor.BOTTOM使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.jfree.ui.RectangleAnchor
的用法示例。
在下文中一共展示了RectangleAnchor.BOTTOM屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createUpRotationLabelPositions
/**
* 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
);
}
示例2: createDownRotationLabelPositions
/**
* 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
);
}
示例3: createUpRotationLabelPositions
/**
* 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
);
}
示例4: createDownRotationLabelPositions
/**
* 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
);
}
示例5: flipAnchorV
private RectangleAnchor flipAnchorV(RectangleAnchor anchor) {
RectangleAnchor result = anchor;
if (anchor.equals(RectangleAnchor.TOP_LEFT)) {
result = RectangleAnchor.BOTTOM_LEFT;
}
else if (anchor.equals(RectangleAnchor.TOP_RIGHT)) {
result = RectangleAnchor.BOTTOM_RIGHT;
}
else if (anchor.equals(RectangleAnchor.TOP)) {
result = RectangleAnchor.BOTTOM;
}
else if (anchor.equals(RectangleAnchor.BOTTOM)) {
result = RectangleAnchor.TOP;
}
else if (anchor.equals(RectangleAnchor.BOTTOM_LEFT)) {
result = RectangleAnchor.TOP_LEFT;
}
else if (anchor.equals(RectangleAnchor.BOTTOM_RIGHT)) {
result = RectangleAnchor.TOP_RIGHT;
}
return result;
}
示例6: createUpRotationLabelPositions
/**
* 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
);
}
示例7: createDownRotationLabelPositions
/**
* 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
);
}
示例8: calculateLabelPoint
/**
* Calculates the anchor point for a label.
*
* @param line the line for the crosshair.
* @param anchor the anchor point.
* @param deltaX the x-offset.
* @param deltaY the y-offset.
*
* @return The anchor point.
*/
private Point2D calculateLabelPoint(Line2D line, RectangleAnchor anchor,
double deltaX, double deltaY) {
double x, y;
boolean left = (anchor == RectangleAnchor.BOTTOM_LEFT
|| anchor == RectangleAnchor.LEFT
|| anchor == RectangleAnchor.TOP_LEFT);
boolean right = (anchor == RectangleAnchor.BOTTOM_RIGHT
|| anchor == RectangleAnchor.RIGHT
|| anchor == RectangleAnchor.TOP_RIGHT);
boolean top = (anchor == RectangleAnchor.TOP_LEFT
|| anchor == RectangleAnchor.TOP
|| anchor == RectangleAnchor.TOP_RIGHT);
boolean bottom = (anchor == RectangleAnchor.BOTTOM_LEFT
|| anchor == RectangleAnchor.BOTTOM
|| anchor == RectangleAnchor.BOTTOM_RIGHT);
Rectangle rect = line.getBounds();
// we expect the line to be vertical or horizontal
if (line.getX1() == line.getX2()) { // vertical
x = line.getX1();
y = (line.getY1() + line.getY2()) / 2.0;
if (left) {
x = x - deltaX;
}
if (right) {
x = x + deltaX;
}
if (top) {
y = Math.min(line.getY1(), line.getY2()) + deltaY;
}
if (bottom) {
y = Math.max(line.getY1(), line.getY2()) - deltaY;
}
}
else { // horizontal
x = (line.getX1() + line.getX2()) / 2.0;
y = line.getY1();
if (left) {
x = Math.min(line.getX1(), line.getX2()) + deltaX;
}
if (right) {
x = Math.max(line.getX1(), line.getX2()) - deltaX;
}
if (top) {
y = y - deltaY;
}
if (bottom) {
y = y + deltaY;
}
}
return new Point2D.Double(x, y);
}