當前位置: 首頁>>代碼示例>>Java>>正文


Java TextAnchor.BOTTOM_CENTER屬性代碼示例

本文整理匯總了Java中org.jfree.ui.TextAnchor.BOTTOM_CENTER屬性的典型用法代碼示例。如果您正苦於以下問題:Java TextAnchor.BOTTOM_CENTER屬性的具體用法?Java TextAnchor.BOTTOM_CENTER怎麽用?Java TextAnchor.BOTTOM_CENTER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.jfree.ui.TextAnchor的用法示例。


在下文中一共展示了TextAnchor.BOTTOM_CENTER屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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();

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:56,代碼來源:AbstractRenderer.java

示例2: refreshTicksVertical

/**
 * Recalculates the ticks for the date axis.
 *
 * @param g2  the graphics device.
 * @param cursor  the cursor location.
 * @param plotArea  the area in which the plot and the axes should be drawn.
 * @param dataArea  the area in which the plot should be drawn.
 * @param edge  the location of the axis.
 *
 * @return A list of ticks.
 */
protected List refreshTicksVertical(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);
    }
    DateTickUnit unit = getTickUnit();
    Date tickDate = calculateLowestVisibleTickValue(unit);
    //Date upperDate = calculateHighestVisibleTickValue(unit);
    Date upperDate = getMaximumDate();
    while (tickDate.before(upperDate)) {

        if (!isHiddenValue(tickDate.getTime())) {
            // work out the value, label and position
            String tickLabel;
            DateFormat formatter = getDateFormatOverride();
            if (formatter != null) {
                tickLabel = formatter.format(tickDate);
            }
            else {
                tickLabel = this.tickUnit.dateToString(tickDate);
            }
            TextAnchor anchor = null;
            TextAnchor rotationAnchor = null;
            double angle = 0.0;
            if (this.isVerticalTickLabels()) {
                anchor = TextAnchor.BOTTOM_CENTER;
                rotationAnchor = TextAnchor.BOTTOM_CENTER;
                if (edge == RectangleEdge.LEFT) {
                    angle = -Math.PI / 2.0;
                }
                else {
                    angle = Math.PI / 2.0;
                }
            }
            else {
                if (edge == RectangleEdge.LEFT) {
                    anchor = TextAnchor.CENTER_RIGHT;
                    rotationAnchor = TextAnchor.CENTER_RIGHT;
                }
                else {
                    anchor = TextAnchor.CENTER_LEFT;
                    rotationAnchor = TextAnchor.CENTER_LEFT;
                }
            }

            Tick tick = new DateTick(tickDate, tickLabel, anchor, rotationAnchor, angle);
            result.add(tick);
            tickDate = unit.addToDate(tickDate);
        }
        else {
            tickDate = unit.rollDate(tickDate);
        }
    }
    return result;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:75,代碼來源:DateAxis.java

示例3: 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;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:73,代碼來源:NumberAxis.java

示例4: refreshVerticalTicks

/**
 * 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 location.
 * @param plotArea  the area in which the plot and the axes should be drawn.
 * @param dataArea  the area in which the plot should be drawn.
 * @param edge  the location of the axis.
 * 
 * @return A list of ticks.
 *
 */
protected List refreshVerticalTicks(Graphics2D g2, double cursor, 
                                    Rectangle2D plotArea, Rectangle2D dataArea,
                                    RectangleEdge edge) {

    List result = new java.util.ArrayList();
    result.clear();

    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()) {
                if (edge == RectangleEdge.LEFT) { 
                    anchor = TextAnchor.BOTTOM_CENTER;
                    rotationAnchor = TextAnchor.BOTTOM_CENTER;
                    angle = -Math.PI / 2.0;
                }
                else {
                    anchor = TextAnchor.BOTTOM_CENTER;
                    rotationAnchor = TextAnchor.BOTTOM_CENTER;
                    angle = Math.PI / 2.0;
                }
            }
            else {
                if (edge == RectangleEdge.LEFT) {
                    anchor = TextAnchor.CENTER_RIGHT;
                    rotationAnchor = TextAnchor.CENTER_RIGHT;
                }
                else {
                    anchor = TextAnchor.CENTER_LEFT;
                    rotationAnchor = TextAnchor.CENTER_LEFT;
                }
            }

            Tick tick = new NumberTick(
                new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle
            );
            result.add(tick);
        }
    }
    return result;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:77,代碼來源:NumberAxis.java

示例5: 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

示例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();

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:66,代碼來源:AbstractRenderer.java

示例7: refreshTicksVertical

/**
 * Recalculates the ticks for the date axis.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area in which the plot should be drawn.
 * @param edge  the location of the axis.
 *
 * @return A list of ticks.
 */
protected List refreshTicksVertical(Graphics2D g2,
                                    Rectangle2D dataArea,
                                    RectangleEdge edge) {

    List result = new java.util.ArrayList();

    Font tickLabelFont = getTickLabelFont();
    g2.setFont(tickLabelFont);

    if (isAutoTickUnitSelection()) {
        selectAutoTickUnit(g2, dataArea, edge);
    }
    DateTickUnit unit = getTickUnit();
    Date tickDate = calculateLowestVisibleTickValue(unit);
    //Date upperDate = calculateHighestVisibleTickValue(unit);
    Date upperDate = getMaximumDate();
    while (tickDate.before(upperDate)) {

        if (!isHiddenValue(tickDate.getTime())) {
            // work out the value, label and position
            String tickLabel;
            DateFormat formatter = getDateFormatOverride();
            if (formatter != null) {
                tickLabel = formatter.format(tickDate);
            }
            else {
                tickLabel = this.tickUnit.dateToString(tickDate);
            }
            TextAnchor anchor = null;
            TextAnchor rotationAnchor = null;
            double angle = 0.0;
            if (isVerticalTickLabels()) {
                anchor = TextAnchor.BOTTOM_CENTER;
                rotationAnchor = TextAnchor.BOTTOM_CENTER;
                if (edge == RectangleEdge.LEFT) {
                    angle = -Math.PI / 2.0;
                }
                else {
                    angle = Math.PI / 2.0;
                }
            }
            else {
                if (edge == RectangleEdge.LEFT) {
                    anchor = TextAnchor.CENTER_RIGHT;
                    rotationAnchor = TextAnchor.CENTER_RIGHT;
                }
                else {
                    anchor = TextAnchor.CENTER_LEFT;
                    rotationAnchor = TextAnchor.CENTER_LEFT;
                }
            }

            Tick tick = new DateTick(tickDate, tickLabel, anchor, 
                    rotationAnchor, angle);
            result.add(tick);
            tickDate = unit.addToDate(tickDate);
        }
        else {
            tickDate = unit.rollDate(tickDate);
        }
    }
    return result;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:72,代碼來源:DateAxis.java

示例8: 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;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:72,代碼來源:NumberAxis.java

示例9: refreshTicksVertical

/**
 * 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 plot should be drawn.
 * @param edge  the location of the axis.
 * 
 * @return A list of ticks.
 *
 */
protected List refreshTicksVertical(Graphics2D g2,
                                    Rectangle2D dataArea,
                                    RectangleEdge edge) {

    List result = new java.util.ArrayList();
    result.clear();

    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()) {
                if (edge == RectangleEdge.LEFT) { 
                    anchor = TextAnchor.BOTTOM_CENTER;
                    rotationAnchor = TextAnchor.BOTTOM_CENTER;
                    angle = -Math.PI / 2.0;
                }
                else {
                    anchor = TextAnchor.BOTTOM_CENTER;
                    rotationAnchor = TextAnchor.BOTTOM_CENTER;
                    angle = Math.PI / 2.0;
                }
            }
            else {
                if (edge == RectangleEdge.LEFT) {
                    anchor = TextAnchor.CENTER_RIGHT;
                    rotationAnchor = TextAnchor.CENTER_RIGHT;
                }
                else {
                    anchor = TextAnchor.CENTER_LEFT;
                    rotationAnchor = TextAnchor.CENTER_LEFT;
                }
            }

            Tick tick = new NumberTick(
                new Double(currentTickValue), tickLabel, anchor, 
                rotationAnchor, angle
            );
            result.add(tick);
        }
    }
    return result;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:76,代碼來源:NumberAxis.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,代碼行數:7,代碼來源:ItemLabelPosition.java


注:本文中的org.jfree.ui.TextAnchor.BOTTOM_CENTER屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。