本文整理汇总了Java中org.jfree.ui.TextAnchor.TOP_CENTER属性的典型用法代码示例。如果您正苦于以下问题:Java TextAnchor.TOP_CENTER属性的具体用法?Java TextAnchor.TOP_CENTER怎么用?Java TextAnchor.TOP_CENTER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jfree.ui.TextAnchor
的用法示例。
在下文中一共展示了TextAnchor.TOP_CENTER属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BarRenderer3D
/**
* Constructs a new renderer with the specified '3D effect'.
*
* @param xOffset the x-offset for the 3D effect.
* @param yOffset the y-offset for the 3D effect.
*/
public BarRenderer3D(double xOffset, double yOffset) {
super();
this.xOffset = xOffset;
this.yOffset = yOffset;
this.wallPaint = DEFAULT_WALL_PAINT;
// set the default item label positions
ItemLabelPosition p1 = new ItemLabelPosition(
ItemLabelAnchor.INSIDE12, TextAnchor.TOP_CENTER
);
setPositiveItemLabelPosition(p1);
ItemLabelPosition p2 = new ItemLabelPosition(
ItemLabelAnchor.INSIDE12, TextAnchor.TOP_CENTER
);
setNegativeItemLabelPosition(p2);
}
示例2: BarRenderer3D
/**
* Constructs a new renderer with the specified '3D effect'.
*
* @param xOffset the x-offset for the 3D effect.
* @param yOffset the y-offset for the 3D effect.
*/
public BarRenderer3D(double xOffset, double yOffset) {
super();
this.xOffset = xOffset;
this.yOffset = yOffset;
this.wallPaint = DEFAULT_WALL_PAINT;
// set the default item label positions
ItemLabelPosition p1 = new ItemLabelPosition(ItemLabelAnchor.INSIDE12,
TextAnchor.TOP_CENTER);
setPositiveItemLabelPosition(p1);
ItemLabelPosition p2 = new ItemLabelPosition(ItemLabelAnchor.INSIDE12,
TextAnchor.TOP_CENTER);
setNegativeItemLabelPosition(p2);
}
示例3: DialTextAnnotation
/**
* Creates a new instance of <code>DialTextAnnotation</code>.
*
* @param label the label (<code>null</code> not permitted).
*/
public DialTextAnnotation(String label) {
if (label == null) {
throw new IllegalArgumentException("Null 'label' argument.");
}
this.angle = -90.0;
this.radius = 0.3;
this.font = new Font("Dialog", Font.BOLD, 14);
this.paint = Color.black;
this.label = label;
this.anchor = TextAnchor.TOP_CENTER;
}
示例4: AbstractRenderer
/**
* Default constructor.
*/
public AbstractRenderer() {
this.seriesVisible = null;
this.seriesVisibleList = new BooleanList();
this.baseSeriesVisible = true;
this.paint = null;
this.paintList = new PaintList();
this.basePaint = DEFAULT_PAINT;
this.outlinePaint = null;
this.outlinePaintList = new PaintList();
this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
this.stroke = null;
this.strokeList = new StrokeList();
this.baseStroke = DEFAULT_STROKE;
this.outlineStroke = null;
this.outlineStrokeList = new StrokeList();
this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
this.shape = null;
this.shapeList = new ShapeList();
this.baseShape = DEFAULT_SHAPE;
this.itemLabelsVisible = null;
this.itemLabelsVisibleList = new BooleanList();
this.baseItemLabelsVisible = Boolean.FALSE;
this.itemLabelFont = null;
this.itemLabelFontList = new ObjectList();
this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);
this.itemLabelPaint = null;
this.itemLabelPaintList = new PaintList();
this.baseItemLabelPaint = Color.black;
this.positiveItemLabelPosition = null;
this.positiveItemLabelPositionList = new ObjectList();
this.basePositiveItemLabelPosition = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER
);
this.negativeItemLabelPosition = null;
this.negativeItemLabelPositionList = new ObjectList();
this.baseNegativeItemLabelPosition = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER
);
this.listenerList = new EventListenerList();
}
示例5: refreshHorizontalTicks
/**
* Calculates the positions of the tick labels for the axis, storing the results in the
* tick label list (ready for drawing).
*
* @param g2 the graphics device.
* @param cursor the cursor.
* @param plotArea the area in which the plot (inlcuding axes) should be drawn.
* @param dataArea the area in which the data should be drawn.
* @param edge the location of the axis.
*
* @return A list of ticks.
*/
protected List refreshHorizontalTicks(Graphics2D g2, double cursor,
Rectangle2D plotArea, Rectangle2D dataArea,
RectangleEdge edge) {
List result = new java.util.ArrayList();
Font tickLabelFont = getTickLabelFont();
g2.setFont(tickLabelFont);
if (isAutoTickUnitSelection()) {
selectAutoTickUnit(g2, plotArea, dataArea, edge);
}
double size = getTickUnit().getSize();
int count = calculateVisibleTickCount();
double lowestTickValue = calculateLowestVisibleTickValue();
if (count <= ValueAxis.MAXIMUM_TICK_COUNT) {
for (int i = 0; i < count; i++) {
double currentTickValue = lowestTickValue + (i * size);
String tickLabel;
NumberFormat formatter = getNumberFormatOverride();
if (formatter != null) {
tickLabel = formatter.format(currentTickValue);
}
else {
tickLabel = getTickUnit().valueToString(currentTickValue);
}
TextAnchor anchor = null;
TextAnchor rotationAnchor = null;
double angle = 0.0;
if (isVerticalTickLabels()) {
anchor = TextAnchor.CENTER_RIGHT;
rotationAnchor = TextAnchor.CENTER_RIGHT;
if (edge == RectangleEdge.TOP) {
angle = Math.PI / 2.0;
}
else {
angle = -Math.PI / 2.0;
}
}
else {
if (edge == RectangleEdge.TOP) {
anchor = TextAnchor.BOTTOM_CENTER;
rotationAnchor = TextAnchor.BOTTOM_CENTER;
}
else {
anchor = TextAnchor.TOP_CENTER;
rotationAnchor = TextAnchor.TOP_CENTER;
}
}
Tick tick = new NumberTick(
new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle
);
result.add(tick);
}
}
return result;
}
示例6: AbstractRenderer
/**
* Default constructor.
*/
public AbstractRenderer() {
this.seriesVisible = null;
this.seriesVisibleList = new BooleanList();
this.baseSeriesVisible = true;
this.seriesVisibleInLegend = null;
this.seriesVisibleInLegendList = new BooleanList();
this.baseSeriesVisibleInLegend = true;
this.paint = null;
this.paintList = new PaintList();
this.basePaint = DEFAULT_PAINT;
this.fillPaint = null;
this.fillPaintList = new PaintList();
this.baseFillPaint = Color.white;
this.outlinePaint = null;
this.outlinePaintList = new PaintList();
this.baseOutlinePaint = DEFAULT_OUTLINE_PAINT;
this.stroke = null;
this.strokeList = new StrokeList();
this.baseStroke = DEFAULT_STROKE;
this.outlineStroke = null;
this.outlineStrokeList = new StrokeList();
this.baseOutlineStroke = DEFAULT_OUTLINE_STROKE;
this.shape = null;
this.shapeList = new ShapeList();
this.baseShape = DEFAULT_SHAPE;
this.itemLabelsVisible = null;
this.itemLabelsVisibleList = new BooleanList();
this.baseItemLabelsVisible = Boolean.FALSE;
this.itemLabelFont = null;
this.itemLabelFontList = new ObjectList();
this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10);
this.itemLabelPaint = null;
this.itemLabelPaintList = new PaintList();
this.baseItemLabelPaint = Color.black;
this.positiveItemLabelPosition = null;
this.positiveItemLabelPositionList = new ObjectList();
this.basePositiveItemLabelPosition = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
this.negativeItemLabelPosition = null;
this.negativeItemLabelPositionList = new ObjectList();
this.baseNegativeItemLabelPosition = new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);
this.createEntities = null;
this.createEntitiesList = new BooleanList();
this.baseCreateEntities = true;
this.listenerList = new EventListenerList();
}
示例7: refreshTicksHorizontal
/**
* Calculates the positions of the tick labels for the axis, storing the
* results in the tick label list (ready for drawing).
*
* @param g2 the graphics device.
* @param dataArea the area in which the data should be drawn.
* @param edge the location of the axis.
*
* @return A list of ticks.
*/
protected List refreshTicksHorizontal(Graphics2D g2,
Rectangle2D dataArea,
RectangleEdge edge) {
List result = new java.util.ArrayList();
Font tickLabelFont = getTickLabelFont();
g2.setFont(tickLabelFont);
if (isAutoTickUnitSelection()) {
selectAutoTickUnit(g2, dataArea, edge);
}
double size = getTickUnit().getSize();
int count = calculateVisibleTickCount();
double lowestTickValue = calculateLowestVisibleTickValue();
if (count <= ValueAxis.MAXIMUM_TICK_COUNT) {
for (int i = 0; i < count; i++) {
double currentTickValue = lowestTickValue + (i * size);
String tickLabel;
NumberFormat formatter = getNumberFormatOverride();
if (formatter != null) {
tickLabel = formatter.format(currentTickValue);
}
else {
tickLabel = getTickUnit().valueToString(currentTickValue);
}
TextAnchor anchor = null;
TextAnchor rotationAnchor = null;
double angle = 0.0;
if (isVerticalTickLabels()) {
anchor = TextAnchor.CENTER_RIGHT;
rotationAnchor = TextAnchor.CENTER_RIGHT;
if (edge == RectangleEdge.TOP) {
angle = Math.PI / 2.0;
}
else {
angle = -Math.PI / 2.0;
}
}
else {
if (edge == RectangleEdge.TOP) {
anchor = TextAnchor.BOTTOM_CENTER;
rotationAnchor = TextAnchor.BOTTOM_CENTER;
}
else {
anchor = TextAnchor.TOP_CENTER;
rotationAnchor = TextAnchor.TOP_CENTER;
}
}
Tick tick = new NumberTick(
new Double(currentTickValue), tickLabel, anchor,
rotationAnchor, angle
);
result.add(tick);
}
}
return result;
}