本文整理汇总了Java中org.jfree.ui.TextAnchor.CENTER属性的典型用法代码示例。如果您正苦于以下问题:Java TextAnchor.CENTER属性的具体用法?Java TextAnchor.CENTER怎么用?Java TextAnchor.CENTER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jfree.ui.TextAnchor
的用法示例。
在下文中一共展示了TextAnchor.CENTER属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Marker
/**
* Constructs a new marker.
*
* @param paint the paint (<code>null</code> not permitted).
* @param stroke the stroke (<code>null</code> not permitted).
* @param outlinePaint the outline paint (<code>null</code> permitted).
* @param outlineStroke the outline stroke (<code>null</code> permitted).
* @param alpha the alpha transparency.
*/
public Marker(Paint paint, Stroke stroke,
Paint outlinePaint, Stroke outlineStroke,
float alpha) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
this.paint = paint;
this.stroke = stroke;
this.outlinePaint = outlinePaint;
this.outlineStroke = outlineStroke;
this.alpha = alpha;
this.labelFont = new Font("SansSerif", Font.PLAIN, 9);
this.labelPaint = Color.black;
this.labelAnchor = RectangleAnchor.TOP_LEFT;
this.labelOffset = new RectangleInsets(UnitType.ABSOLUTE, 3.0, 3.0, 3.0, 3.0);
this.labelTextAnchor = TextAnchor.CENTER;
}
示例2: testHashCode
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashCode() {
Comparable c1 = "C1";
TextBlock tb1 = new TextBlock();
tb1.addLine(new TextLine("Block 1"));
tb1.addLine(new TextLine("Block 2"));
TextBlockAnchor tba1 = TextBlockAnchor.CENTER;
TextAnchor ta1 = TextAnchor.CENTER;
CategoryTick t1 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f);
CategoryTick t2 = new CategoryTick(c1, tb1, tba1, ta1, 1.0f);
assertTrue(t1.equals(t2));
int h1 = t1.hashCode();
int h2 = t2.hashCode();
assertEquals(h1, h2);
}
示例3: StackedBarRenderer
/**
* Creates a new renderer with no tool tip generator and no URL generator.
* <P>
* The defaults (no tool tip or URL generators) have been chosen to minimise the processing
* required to generate a default chart. If you require tool tips or URLs, then you can
* easily add the required generators.
*/
public StackedBarRenderer() {
super();
// set the default item label positions, which will only be used if the user
// requests visible item labels...
ItemLabelPosition p = new ItemLabelPosition(
ItemLabelAnchor.CENTER, TextAnchor.CENTER
);
setBasePositiveItemLabelPosition(p);
setBaseNegativeItemLabelPosition(p);
setPositiveItemLabelPositionFallback(null);
setNegativeItemLabelPositionFallback(null);
}
示例4: CategoryTick
/**
* Creates a new tick.
*
* @param category the category.
* @param label the label.
* @param labelAnchor the label anchor.
* @param rotationAnchor the rotation anchor.
* @param angle the rotation angle (in radians).
*/
public CategoryTick(Comparable category,
TextBlock label,
TextBlockAnchor labelAnchor,
TextAnchor rotationAnchor,
double angle) {
super("", TextAnchor.CENTER, rotationAnchor, angle);
this.category = category;
this.label = label;
this.labelAnchor = labelAnchor;
}
示例5: CategoryLabelPosition
/**
* Creates a new position record with default settings.
*/
public CategoryLabelPosition() {
this(
RectangleAnchor.CENTER, TextBlockAnchor.BOTTOM_CENTER,
TextAnchor.CENTER, 0.0, CategoryLabelWidthType.CATEGORY, 0.95f
);
}
示例6: testHashCode
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashCode() {
Date d1 = new Date(0L);
String l1 = "Label 1";
TextAnchor ta1 = TextAnchor.CENTER;
DateTick t1 = new DateTick(d1, l1, ta1, ta1, Math.PI / 2.0);
DateTick t2 = new DateTick(d1, l1, ta1, ta1, Math.PI / 2.0);
assertTrue(t1.equals(t2));
int h1 = t1.hashCode();
int h2 = t2.hashCode();
assertEquals(h1, h2);
}
示例7: StackedXYBarRenderer
/**
* Creates a new renderer.
*
* @param margin the percentual amount of the bars that are cut away.
*/
public StackedXYBarRenderer(double margin) {
super(margin);
this.renderAsPercentages = false;
// set the default item label positions, which will only be used if
// the user requests visible item labels...
ItemLabelPosition p = new ItemLabelPosition(ItemLabelAnchor.CENTER,
TextAnchor.CENTER);
setBasePositiveItemLabelPosition(p);
setBaseNegativeItemLabelPosition(p);
setPositiveItemLabelPositionFallback(null);
setNegativeItemLabelPositionFallback(null);
}
示例8: StackedBarRenderer
/**
* Creates a new renderer.
*
* @param renderAsPercentages a flag that controls whether the data values
* are rendered as percentages.
*/
public StackedBarRenderer(boolean renderAsPercentages) {
super();
this.renderAsPercentages = renderAsPercentages;
// set the default item label positions, which will only be used if
// the user requests visible item labels...
ItemLabelPosition p = new ItemLabelPosition(ItemLabelAnchor.CENTER,
TextAnchor.CENTER);
setBasePositiveItemLabelPosition(p);
setBaseNegativeItemLabelPosition(p);
setPositiveItemLabelPositionFallback(null);
setNegativeItemLabelPositionFallback(null);
}
示例9: Marker
/**
* Constructs a new marker.
*
* @param paint the paint (<code>null</code> not permitted).
* @param stroke the stroke (<code>null</code> not permitted).
* @param outlinePaint the outline paint (<code>null</code> permitted).
* @param outlineStroke the outline stroke (<code>null</code> permitted).
* @param alpha the alpha transparency (must be in the range 0.0f to
* 1.0f).
*
* @throws IllegalArgumentException if <code>paint</code> or
* <code>stroke</code> is <code>null</code>, or <code>alpha</code> is
* not in the specified range.
*/
protected Marker(Paint paint, Stroke stroke,
Paint outlinePaint, Stroke outlineStroke,
float alpha) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
if (stroke == null) {
throw new IllegalArgumentException("Null 'stroke' argument.");
}
if (alpha < 0.0f || alpha > 1.0f)
throw new IllegalArgumentException(
"The 'alpha' value must be in the range 0.0f to 1.0f");
this.paint = paint;
this.stroke = stroke;
this.outlinePaint = outlinePaint;
this.outlineStroke = outlineStroke;
this.alpha = alpha;
this.labelFont = new Font("SansSerif", Font.PLAIN, 9);
this.labelPaint = Color.black;
this.labelAnchor = RectangleAnchor.TOP_LEFT;
this.labelOffset = new RectangleInsets(3.0, 3.0, 3.0, 3.0);
this.labelOffsetType = LengthAdjustmentType.CONTRACT;
this.labelTextAnchor = TextAnchor.CENTER;
this.listenerList = new EventListenerList();
}
示例10: ItemLabelPosition
/**
* Creates a new position record with default settings.
*/
public ItemLabelPosition() {
this(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER, TextAnchor.CENTER, 0.0);
}
示例11: ItemLabelPosition
/**
* Creates a new position record with default settings.
*/
public ItemLabelPosition() {
this(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER,
TextAnchor.CENTER, 0.0);
}