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


Java RectangularShape.setFrame方法代码示例

本文整理汇总了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);
			}
		}
	}
 
开发者ID:qupath,项目名称:qupath,代码行数:25,代码来源:PathHierarchyPaintingHelper.java

示例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);
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:14,代码来源:MatrixGlyph.java

示例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());
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:9,代码来源:BarChartGlyph.java

示例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);
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:9,代码来源:NodeRenderpass.java

示例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()));
    }
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:12,代码来源:Lienzo.java

示例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);
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:46,代码来源:LuckShapeBorder.java

示例7: getBoundingBox

import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void getBoundingBox(final RectangularShape bbox, final DataInfo di) {
  bbox.setFrame(0, 0, 80, 80);
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:5,代码来源:StarGlyph.java

示例8: getBoundingBox

import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void getBoundingBox(final RectangularShape bbox, final DataInfo di) {
  bbox.setFrame(0, 0, 88, 88);
}
 
开发者ID:nyuvis,项目名称:infuse-java,代码行数:5,代码来源:PieGlyph.java

示例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()));
}
 
开发者ID:oskyar,项目名称:Sistemas-Multimedia,代码行数:6,代码来源:ORectangle2D.java


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