本文整理汇总了Java中java.awt.geom.RectangularShape.getCenterY方法的典型用法代码示例。如果您正苦于以下问题:Java RectangularShape.getCenterY方法的具体用法?Java RectangularShape.getCenterY怎么用?Java RectangularShape.getCenterY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.geom.RectangularShape
的用法示例。
在下文中一共展示了RectangularShape.getCenterY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paint
import java.awt.geom.RectangularShape; //导入方法依赖的package包/类
@Override
public void paint(final Graphics2D g, final double zoom,
final RectangularShape bbox, final DataInfo di,
final NodeFeature feature, final boolean isSelected) {
PaintUtil.addPaddingInplace(bbox, -1);
final double maxRad = bbox.getWidth() * 0.5;
final double extend = 360.0 / di.getSortedFeaturesSelections().size();
double angle = 90;
g.setColor(isSelected ? Color.RED : Color.BLACK);
for(final FeatureSelectionNode fs : di.getSortedFeaturesSelections()) {
final double rad = maxRad - maxRad * radius(fs.getRank(feature), di.getMaxRank());
final double x = bbox.getCenterX() + Math.sin(Math.toRadians(angle)) * rad;
final double y = bbox.getCenterY() + Math.cos(Math.toRadians(angle)) * rad;
final Line2D line = new Line2D.Double(bbox.getCenterX(), bbox.getCenterY(), x, y);
g.draw(line);
angle += extend;
}
}