本文整理汇总了Java中java.awt.geom.RectangularShape.setFrame方法的典型用法代码示例。如果您正苦于以下问题:Java RectangularShape.setFrame方法的具体用法?Java RectangularShape.setFrame怎么用?Java RectangularShape.setFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.geom.RectangularShape
的用法示例。
在下文中一共展示了RectangularShape.setFrame方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paintHandles
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
/**
* Paint the handles onto a Graphics object.
*
* @param g2d
* @param handleSize The width & height of the shape used to draw the handles
* @param colorStroke
* @param colorFill
*/
public static void paintHandles(final List<Point2> handles, final Graphics2D g2d, final double handleSize, final Color colorStroke, final Color colorFill) {
RectangularShape handleShape = new Rectangle2D.Double();
// handleShape = new Ellipse2D.Double();
for (Point2 p : handles) {
handleShape.setFrame(p.getX()-handleSize/2, p.getY()-handleSize/2, handleSize, handleSize);
if (colorFill != null) {
g2d.setColor(colorFill);
g2d.fill(handleShape);
}
if (colorStroke != null) {
g2d.setColor(colorStroke);
g2d.draw(handleShape);
}
}
}
示例2: getBoundingBox
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void getBoundingBox(final RectangularShape bbox, final DataInfo di) {
final double s = cellSize();
final double w = di.getFolds().size() * s;
double h = 0;
for(final FoldNode fn : getFolds(di)) {
final double t = fn.featureSelections().size() * s;
if(h < t) {
h = t;
}
}
bbox.setFrame(0, 0, w, h);
}
示例3: getBoundingBox
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void getBoundingBox(final RectangularShape bbox, final DataInfo di) {
int num = 0;
for(final FoldNode fn : getFolds(di)) {
num += fn.featureSelections().size();
}
bbox.setFrame(0, 0, num * barWidth(), height());
}
示例4: getBoundingBox
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void getBoundingBox(final RectangularShape bbox) {
if(f == null) {
bbox.setFrame(0, 0, 100, 0);
return;
}
glyph.getBoundingBox(bbox, di);
}
示例5: setLocation
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
public void setLocation(Shape s, Point2D p) {
if (s instanceof Line2D) {
double dx = p.getX() - ((Line2D) s).getX1();
double dy = p.getY() - ((Line2D) s).getY1();
Point2D newP = new Point2D.Double(((Line2D) s).getX2() + dx, ((Line2D) s).getY2() + dy);
((Line2D) s).setLine(p, newP);
} else if (s instanceof RectangularShape) {
RectangularShape r = (RectangularShape) s;
r.setFrame(p, new Dimension((int) r.getWidth(), (int) r.getHeight()));
}
}
示例6: paintBorder
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
public void paintBorder(Component c,
Graphics g,
int x,
int y,
int width,
int height)
{
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
RectangularShape shape = getBorderShape(c);
if(shape != null)
{
shape.setFrame(x, y, width - 1, height - 1);
if(!isFocusGained(c))
{
// 非焦点状态下
g2d.setColor(normalColor);
g2d.draw(shape);
}
else
{
// 获取焦点状态下
g2d.setColor(outShadowColor);
g2d.draw(shape);
g2d.setColor(innerShadowColor);
g2d.drawRect(x + 2, y + 2, width - 5, height - 5);
g2d.setColor(focusColor);
shape.setFrame(x + 1, y + 1, width - 3, height - 3);
g2d.draw(shape);
}
}
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF);
}
示例7: getBoundingBox
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void getBoundingBox(final RectangularShape bbox, final DataInfo di) {
bbox.setFrame(0, 0, 80, 80);
}
示例8: getBoundingBox
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void getBoundingBox(final RectangularShape bbox, final DataInfo di) {
bbox.setFrame(0, 0, 88, 88);
}
示例9: setLocation
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void setLocation(Point2D p) {
RectangularShape r = (RectangularShape) this;
r.setFrame(p, new Dimension((int) r.getWidth(), (int) r.getHeight()));
}