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


Java Size2D.getHeight方法代码示例

本文整理汇总了Java中org.jfree.ui.Size2D.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Size2D.getHeight方法的具体用法?Java Size2D.getHeight怎么用?Java Size2D.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.ui.Size2D的用法示例。


在下文中一共展示了Size2D.getHeight方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculateTextBlockWidth

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * A utility method for determining the width of a text block.
 *
 * @param block  the text block.
 * @param position  the position.
 * @param g2  the graphics device.
 *
 * @return The width.
 */
protected double calculateTextBlockWidth(TextBlock block, 
                                         CategoryLabelPosition position, 
                                         Graphics2D g2) {
                                                
    RectangleInsets insets = getTickLabelInsets();
    Size2D size = block.calculateDimensions(g2);
    Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), 
            size.getHeight());
    Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),
            0.0f, 0.0f);
    double w = rotatedBox.getBounds2D().getWidth() + insets.getTop() 
            + insets.getBottom();
    return w;
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:CategoryAxis.java

示例2: calculateTextBlockHeight

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * A utility method for determining the height of a text block.
 *
 * @param block  the text block.
 * @param position  the label position.
 * @param g2  the graphics device.
 *
 * @return The height.
 */
protected double calculateTextBlockHeight(TextBlock block, 
                                          CategoryLabelPosition position, 
                                          Graphics2D g2) {
                                                
    RectangleInsets insets = getTickLabelInsets();
    Size2D size = block.calculateDimensions(g2);
    Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), 
            size.getHeight());
    Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),
            0.0f, 0.0f);
    double h = rotatedBox.getBounds2D().getHeight() 
               + insets.getTop() + insets.getBottom();
    return h;
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:25,代码来源:CategoryAxis.java

示例3: calculateBounds

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * Returns the bounds of the text block.
 * 
 * @param g2  the graphics device (<code>null</code> not permitted).
 * @param anchorX  the x-coordinate for the anchor point.
 * @param anchorY  the y-coordinate for the anchor point.
 * @param anchor  the text block anchor (<code>null</code> not permitted).
 * @param rotateX  the x-coordinate for the rotation point.
 * @param rotateY  the y-coordinate for the rotation point.
 * @param angle  the rotation angle.
 * 
 * @return The bounds.
 */
public Shape calculateBounds(final Graphics2D g2,
                             final float anchorX, final float anchorY, 
                             final TextBlockAnchor anchor,
                             final float rotateX, final float rotateY, 
                             final double angle) {
    
    final Size2D d = calculateDimensions(g2);
    final float[] offsets = calculateOffsets(
        anchor, d.getWidth(), d.getHeight()
    );
    final Rectangle2D bounds = new Rectangle2D.Double(
        anchorX + offsets[0], anchorY + offsets[1], 
        d.getWidth(), d.getHeight()
    );
    final Shape rotatedBounds = ShapeUtilities.rotateShape(
        bounds, angle, rotateX, rotateY
    );
    return rotatedBounds;   
    
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:34,代码来源:TextBlock.java

示例4: calculateTextBlockWidth

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * A utility method for determining the width of a text block.
 *
 * @param block  the text block.
 * @param position  the position.
 * @param g2  the graphics device.
 *
 * @return the width.
 */
protected double calculateTextBlockWidth(TextBlock block, 
                                         CategoryLabelPosition position, 
                                         Graphics2D g2) {
                                                
    Insets insets = getTickLabelInsets();
    Size2D size = block.calculateDimensions(g2);
    Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight());
    Shape rotatedBox = ShapeUtils.rotateShape(box, position.getAngle(), 0.0f, 0.0f);
    double w = rotatedBox.getBounds2D().getWidth() + insets.top + insets.bottom;
    return w;
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:CategoryAxis.java

示例5: calculateTextBlockHeight

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * A utility method for determining the height of a text block.
 *
 * @param block  the text block.
 * @param position  the label position.
 * @param g2  the graphics device.
 *
 * @return the height.
 */
protected double calculateTextBlockHeight(TextBlock block, 
                                          CategoryLabelPosition position, 
                                          Graphics2D g2) {
                                                
    Insets insets = getTickLabelInsets();
    Size2D size = block.calculateDimensions(g2);
    Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(), size.getHeight());
    Shape rotatedBox = ShapeUtils.rotateShape(box, position.getAngle(), 0.0f, 0.0f);
    double h = rotatedBox.getBounds2D().getHeight() + insets.top + insets.bottom;
    return h;
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:CategoryAxis.java

示例6: calculateTextBlockWidth

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * A utility method for determining the width of a text block.
 *
 * @param block  the text block.
 * @param position  the position.
 * @param g2  the graphics device.
 *
 * @return The width.
 */
protected double calculateTextBlockWidth(TextBlock block,
        CategoryLabelPosition position, Graphics2D g2) {
    RectangleInsets insets = getTickLabelInsets();
    Size2D size = block.calculateDimensions(g2);
    Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(),
            size.getHeight());
    Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),
            0.0f, 0.0f);
    double w = rotatedBox.getBounds2D().getWidth() + insets.getLeft()
            + insets.getRight();
    return w;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:22,代码来源:CategoryAxis.java

示例7: calculateTextBlockHeight

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * A utility method for determining the height of a text block.
 *
 * @param block  the text block.
 * @param position  the label position.
 * @param g2  the graphics device.
 *
 * @return The height.
 */
protected double calculateTextBlockHeight(TextBlock block,
        CategoryLabelPosition position, Graphics2D g2) {
    RectangleInsets insets = getTickLabelInsets();
    Size2D size = block.calculateDimensions(g2);
    Rectangle2D box = new Rectangle2D.Double(0.0, 0.0, size.getWidth(),
            size.getHeight());
    Shape rotatedBox = ShapeUtilities.rotateShape(box, position.getAngle(),
            0.0f, 0.0f);
    double h = rotatedBox.getBounds2D().getHeight()
               + insets.getTop() + insets.getBottom();
    return h;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:22,代码来源:CategoryAxis.java

示例8: calculateDimensions

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * Returns the width and height of the text block.
 * 
 * @param g2  the graphics device.
 * 
 * @return The width and height.
 */
public Size2D calculateDimensions(final Graphics2D g2) {
    double width = 0.0;
    double height = 0.0;
    final Iterator iterator = this.lines.iterator();
    while (iterator.hasNext()) {
        final TextLine line = (TextLine) iterator.next();
        final Size2D dimension = line.calculateDimensions(g2);
        width = Math.max(width, dimension.getWidth());
        height = height + dimension.getHeight();
    }
    return new Size2D(width, height);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:20,代码来源:TextBlock.java

示例9: draw

import org.jfree.ui.Size2D; //导入方法依赖的package包/类
/**
 * Draws the text block, aligning it with the specified anchor point and 
 * rotating it about the specified rotation point.
 * 
 * @param g2  the graphics device.
 * @param anchorX  the x-coordinate for the anchor point.
 * @param anchorY  the y-coordinate for the anchor point.
 * @param anchor  the point on the text block that is aligned to the 
 *                anchor point.
 * @param rotateX  the x-coordinate for the rotation point.
 * @param rotateY  the x-coordinate for the rotation point.
 * @param angle  the rotation (in radians).
 */
public void draw(final Graphics2D g2,
                 final float anchorX, final float anchorY, 
                 final TextBlockAnchor anchor,
                 final float rotateX, final float rotateY, 
                 final double angle) {

    final Size2D d = calculateDimensions(g2);
    final float[] offsets = calculateOffsets(anchor, d.getWidth(), 
            d.getHeight());
    final Iterator iterator = this.lines.iterator();
    float yCursor = 0.0f;
    while (iterator.hasNext()) {
        TextLine line = (TextLine) iterator.next();
        Size2D dimension = line.calculateDimensions(g2);
        float lineOffset = 0.0f;
        if (this.lineAlignment == HorizontalAlignment.CENTER) {
            lineOffset = (float) (d.getWidth() - dimension.getWidth()) 
                / 2.0f;   
        }
        else if (this.lineAlignment == HorizontalAlignment.RIGHT) {
            lineOffset = (float) (d.getWidth() - dimension.getWidth());   
        }
        line.draw(
            g2, anchorX + offsets[0] + lineOffset, anchorY + offsets[1] + yCursor,
            TextAnchor.TOP_LEFT, rotateX, rotateY, angle
        );
        yCursor = yCursor + (float) dimension.getHeight();
    }
    
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:44,代码来源:TextBlock.java


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