本文整理匯總了Java中java.awt.geom.RectangularShape.getCenterX方法的典型用法代碼示例。如果您正苦於以下問題:Java RectangularShape.getCenterX方法的具體用法?Java RectangularShape.getCenterX怎麽用?Java RectangularShape.getCenterX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.geom.RectangularShape
的用法示例。
在下文中一共展示了RectangularShape.getCenterX方法的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;
}
}