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


Java Rectangle2D.clone方法代码示例

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


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

示例1: draw

import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
/**
 * Draws the block within the specified area.
 * 
 * @param g2  the graphics device.
 * @param area  the area.
 * @param params  ignored (<code>null</code> permitted).
 * 
 * @return An {@link org.jfree.chart.block.EntityBlockResult} or 
 *         <code>null</code>.
 */
public Object draw(Graphics2D g2, Rectangle2D area, Object params) {
    Rectangle2D target = (Rectangle2D) area.clone();
    target = trimMargin(target);
    if (this.backgroundPaint != null) {
        g2.setPaint(this.backgroundPaint);
        g2.fill(target);
    }
    BlockFrame border = getFrame();
    border.draw(g2, target);
    border.getInsets().trim(target);
    BlockContainer container = this.wrapper;
    if (container == null) {
        container = this.items; 
    }
    target = trimPadding(target);
    return container.draw(g2, target, params);   
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:LegendTitle.java

示例2: drawFill

import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
/**
 * Draws a colored background. Returns the area wich has been filled.
 */
private Rectangle2D drawFill(Graphics2D g2, Rectangle2D area) {
	Rectangle2D filledArea = (Rectangle2D) area.clone();
	filledArea = trimMargin(filledArea);
	filledArea = trimBorder(filledArea);
	area = trimPadding(area);
	g2.setPaint(this.fillPaint);
	g2.fill(filledArea);
	drawBorder(g2, filledArea);
	return filledArea;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:14,代码来源:ColoredBlockContainer.java

示例3: drawHorizontal

import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
/**
 * Draws a the title horizontally within the specified area.  This method 
 * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} 
 * method.
 * 
 * @param g2  the graphics device.
 * @param area  the area for the title.
 */
protected void drawHorizontal(Graphics2D g2, Rectangle2D area) {
    Rectangle2D titleArea = (Rectangle2D) area.clone();
    g2.setFont(this.font);
    g2.setPaint(this.paint);
    TextBlockAnchor anchor = null;
    float x = 0.0f;
    HorizontalAlignment horizontalAlignment = getHorizontalAlignment();
    if (horizontalAlignment == HorizontalAlignment.LEFT) {
        x = (float) titleArea.getX();
        anchor = TextBlockAnchor.TOP_LEFT;
    }
    else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
        x = (float) titleArea.getMaxX();
        anchor = TextBlockAnchor.TOP_RIGHT;
    }
    else if (horizontalAlignment == HorizontalAlignment.CENTER) {
        x = (float) titleArea.getCenterX();
        anchor = TextBlockAnchor.TOP_CENTER;
    }
    float y = 0.0f;
    RectangleEdge position = getPosition();
    if (position == RectangleEdge.TOP) {
        y = (float) titleArea.getY();
    }
    else if (position == RectangleEdge.BOTTOM) {
        y = (float) titleArea.getMaxY();
        if (horizontalAlignment == HorizontalAlignment.LEFT) {
            anchor = TextBlockAnchor.BOTTOM_LEFT;
        }
        else if (horizontalAlignment == HorizontalAlignment.CENTER) {
            anchor = TextBlockAnchor.BOTTOM_CENTER;
        }
        else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
            anchor = TextBlockAnchor.BOTTOM_RIGHT;
        }
    }
    this.content.draw(g2, x, y, anchor);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:47,代码来源:TextTitle.java

示例4: drawVertical

import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
/**
 * Draws a the title vertically within the specified area.  This method 
 * will be called from the {@link #draw(Graphics2D, Rectangle2D) draw} 
 * method.
 * 
 * @param g2  the graphics device.
 * @param area  the area for the title.
 */
protected void drawVertical(Graphics2D g2, Rectangle2D area) {
    Rectangle2D titleArea = (Rectangle2D) area.clone();
    g2.setFont(this.font);
    g2.setPaint(this.paint);
    TextBlockAnchor anchor = null;
    float y = 0.0f;
    VerticalAlignment verticalAlignment = getVerticalAlignment();
    if (verticalAlignment == VerticalAlignment.TOP) {
        y = (float) titleArea.getY();
        anchor = TextBlockAnchor.TOP_RIGHT;
    }
    else if (verticalAlignment == VerticalAlignment.BOTTOM) {
        y = (float) titleArea.getMaxY();
        anchor = TextBlockAnchor.TOP_LEFT;
    }
    else if (verticalAlignment == VerticalAlignment.CENTER) {
        y = (float) titleArea.getCenterY();
        anchor = TextBlockAnchor.TOP_CENTER;
    }
    float x = 0.0f;
    RectangleEdge position = getPosition();
    if (position == RectangleEdge.LEFT) {
        x = (float) titleArea.getX();
    }
    else if (position == RectangleEdge.RIGHT) {
        x = (float) titleArea.getMaxX();
        if (verticalAlignment == VerticalAlignment.TOP) {
            anchor = TextBlockAnchor.BOTTOM_RIGHT;
        }
        else if (verticalAlignment == VerticalAlignment.CENTER) {
            anchor = TextBlockAnchor.BOTTOM_CENTER;
        }
        else if (verticalAlignment == VerticalAlignment.BOTTOM) {
            anchor = TextBlockAnchor.BOTTOM_LEFT;
        }
    }
    this.content.draw(g2, x, y, anchor, x, y, -Math.PI / 2.0);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:47,代码来源:TextTitle.java

示例5: drawHorizontal

import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
/**
 * Draws a the title horizontally within the specified area.  This method will be called
 * from the {@link #draw(Graphics2D, Rectangle2D) draw} method.
 * 
 * @param g2  the graphics device.
 * @param area  the area for the title.
 */
protected void drawHorizontal(Graphics2D g2, Rectangle2D area) {
    Rectangle2D titleArea = (Rectangle2D) area.clone();
    getSpacer().trim(titleArea);
    g2.setFont(this.font);
    g2.setPaint(this.paint);
    TextBlock title = TextUtilities.createTextBlock(
        this.text, this.font, this.paint, (float) titleArea.getWidth(), new G2TextMeasurer(g2)
    );
    TextBlockAnchor anchor = null;
    float x = 0.0f;
    HorizontalAlignment horizontalAlignment = getHorizontalAlignment();
    if (horizontalAlignment == HorizontalAlignment.LEFT) {
        x = (float) titleArea.getX();
        anchor = TextBlockAnchor.TOP_LEFT;
    }
    else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
        x = (float) titleArea.getMaxX();
        anchor = TextBlockAnchor.TOP_RIGHT;
    }
    else if (horizontalAlignment == HorizontalAlignment.CENTER) {
        x = (float) titleArea.getCenterX();
        anchor = TextBlockAnchor.TOP_CENTER;
    }
    float y = 0.0f;
    RectangleEdge position = getPosition();
    if (position == RectangleEdge.TOP) {
        y = (float) titleArea.getY();
    }
    else if (position == RectangleEdge.BOTTOM) {
        y = (float) titleArea.getMaxY();
        if (horizontalAlignment == HorizontalAlignment.LEFT) {
            anchor = TextBlockAnchor.BOTTOM_LEFT;
        }
        else if (horizontalAlignment == HorizontalAlignment.CENTER) {
            anchor = TextBlockAnchor.BOTTOM_CENTER;
        }
        else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
            anchor = TextBlockAnchor.BOTTOM_RIGHT;
        }
    }
    title.draw(g2, x, y, anchor);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:50,代码来源:TextTitle.java

示例6: drawVertical

import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
/**
 * Draws a the title vertically within the specified area.  This method will be called
 * from the {@link #draw(Graphics2D, Rectangle2D) draw} method.
 * 
 * @param g2  the graphics device.
 * @param area  the area for the title.
 */
protected void drawVertical(Graphics2D g2, Rectangle2D area) {
    Rectangle2D titleArea = (Rectangle2D) area.clone();
    getSpacer().trim(titleArea);
    g2.setFont(this.font);
    g2.setPaint(this.paint);
    TextBlock title = TextUtilities.createTextBlock(
        this.text, this.font, this.paint, (float) titleArea.getHeight(), new G2TextMeasurer(g2)
    );
    TextBlockAnchor anchor = null;
    float y = 0.0f;
    VerticalAlignment verticalAlignment = getVerticalAlignment();
    if (verticalAlignment == VerticalAlignment.TOP) {
        y = (float) titleArea.getY();
        anchor = TextBlockAnchor.TOP_RIGHT;
    }
    else if (verticalAlignment == VerticalAlignment.BOTTOM) {
        y = (float) titleArea.getMaxY();
        anchor = TextBlockAnchor.TOP_LEFT;
    }
    else if (verticalAlignment == VerticalAlignment.CENTER) {
        y = (float) titleArea.getCenterY();
        anchor = TextBlockAnchor.TOP_CENTER;
    }
    float x = 0.0f;
    RectangleEdge position = getPosition();
    if (position == RectangleEdge.LEFT) {
        x = (float) titleArea.getX();
    }
    else if (position == RectangleEdge.RIGHT) {
        x = (float) titleArea.getMaxX();
        if (verticalAlignment == VerticalAlignment.TOP) {
            anchor = TextBlockAnchor.BOTTOM_RIGHT;
        }
        else if (verticalAlignment == VerticalAlignment.CENTER) {
            anchor = TextBlockAnchor.BOTTOM_CENTER;
        }
        else if (verticalAlignment == VerticalAlignment.BOTTOM) {
            anchor = TextBlockAnchor.BOTTOM_LEFT;
        }
    }
    title.draw(g2, x, y, anchor, x, y, -Math.PI / 2.0);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:50,代码来源:TextTitle.java

示例7: JVertexLayout

import java.awt.geom.Rectangle2D; //导入方法依赖的package包/类
/**
 * Constructs a node layout from a given bounds rectangle.
 * @param bounds the intended bounds
 */
public JVertexLayout(Rectangle2D bounds) {
    this.bounds = (Rectangle2D) bounds.clone();
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:8,代码来源:JVertexLayout.java


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