本文整理汇总了Java中sun.font.TextLineComponent.getItalicBounds方法的典型用法代码示例。如果您正苦于以下问题:Java TextLineComponent.getItalicBounds方法的具体用法?Java TextLineComponent.getItalicBounds怎么用?Java TextLineComponent.getItalicBounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.font.TextLineComponent
的用法示例。
在下文中一共展示了TextLineComponent.getItalicBounds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItalicBounds
import sun.font.TextLineComponent; //导入方法依赖的package包/类
public Rectangle2D getItalicBounds() {
float left = Float.MAX_VALUE, right = -Float.MAX_VALUE;
float top = Float.MAX_VALUE, bottom = -Float.MAX_VALUE;
for (int i=0, n = 0; i < fComponents.length; i++, n += 2) {
TextLineComponent tlc = fComponents[getComponentLogicalIndex(i)];
Rectangle2D tlcBounds = tlc.getItalicBounds();
float x = locs[n];
float y = locs[n+1];
left = Math.min(left, x + (float)tlcBounds.getX());
right = Math.max(right, x + (float)tlcBounds.getMaxX());
top = Math.min(top, y + (float)tlcBounds.getY());
bottom = Math.max(bottom, y + (float)tlcBounds.getMaxY());
}
return new Rectangle2D.Float(left, top, right-left, bottom-top);
}
示例2: getItalicBounds
import sun.font.TextLineComponent; //导入方法依赖的package包/类
public Rectangle2D getItalicBounds() {
float left = Float.MAX_VALUE, right = -Float.MAX_VALUE;
float top = Float.MAX_VALUE, bottom = -Float.MAX_VALUE;
for (int i=0, n = 0; i < fComponents.length; i++, n += 2) {
int vi = fComponentVisualOrder==null? i : fComponentVisualOrder[i];
TextLineComponent tlc = fComponents[vi];
Rectangle2D tlcBounds = tlc.getItalicBounds();
float x = locs[n];
float y = locs[n+1];
left = Math.min(left, x + (float)tlcBounds.getX());
right = Math.max(right, x + (float)tlcBounds.getMaxX());
top = Math.min(top, y + (float)tlcBounds.getY());
bottom = Math.max(bottom, y + (float)tlcBounds.getMaxY());
}
return new Rectangle2D.Float(left, top, right-left, bottom-top);
}