當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。