当前位置: 首页>>代码示例>>Java>>正文


Java TextAnchor.CENTER属性代码示例

本文整理汇总了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;
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:33,代码来源:Marker.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:CategoryTickTests.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:20,代码来源:StackedBarRenderer.java

示例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;
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:CategoryTick.java

示例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
    );
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:9,代码来源:CategoryLabelPosition.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:DateTickTests.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:StackedXYBarRenderer.java

示例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);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:19,代码来源:StackedBarRenderer.java

示例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();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:43,代码来源:Marker.java

示例10: ItemLabelPosition

/**
 * Creates a new position record with default settings.
 */
public ItemLabelPosition() {
    this(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER, TextAnchor.CENTER, 0.0);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:6,代码来源:ItemLabelPosition.java

示例11: ItemLabelPosition

/**
 * Creates a new position record with default settings.
 */
public ItemLabelPosition() {
    this(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER, 
            TextAnchor.CENTER, 0.0);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:7,代码来源:ItemLabelPosition.java


注:本文中的org.jfree.ui.TextAnchor.CENTER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。