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


Java Insets.getWidth方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.geometry.Insets.getWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Insets.getWidth方法的具体用法?Java Insets.getWidth怎么用?Java Insets.getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.geometry.Insets的用法示例。


在下文中一共展示了Insets.getWidth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawHorizontalTitleBar

import org.eclipse.draw2d.geometry.Insets; //导入方法依赖的package包/类
/**
 * rect는 타이틀 바를 그릴 사각형이다. 여기서는 이 사각형에 타이틀 바를 그린다.
 * 타이틀 바를 가로로 생성한 파티션의 왼쪽에 세로로 그린다.
 * 
 * @param figure
 * @param g
 * @param rect
 *            void
 */
private void drawHorizontalTitleBar(IFigure figure, Graphics g, Rectangle rect) {
    g.setBackgroundColor(getBackgroundColor());
    g.fillRectangle(rect);

    Insets padding = getPadding();
    int x = rect.x + padding.left;
    int y = rect.y + padding.top + (rect.height - getTextExtents(figure).height) / 2;

    int textWidth = getTextExtents(figure).width;
    int freeSpace = rect.width - padding.getWidth() - textWidth;

    if (getTextAlignment() == PositionConstants.CENTER)
        freeSpace /= 2;
    if (getTextAlignment() != PositionConstants.LEFT)
        x += freeSpace;

    Font f = getFont(figure);
    FontData fData = f.getFontData()[0];
    fData.setName(this.getFontName());
    fData.setStyle(this.getTextStyle());
    fData.setHeight(this.getFontSize());
    g.setFont(f);
    g.setForegroundColor(this.getTextColor());
    g.drawString(getLabel(), x, y);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:35,代码来源:TitleBarBorder.java

示例2: drawTitleBar

import org.eclipse.draw2d.geometry.Insets; //导入方法依赖的package包/类
/**
 * rect는 타이틀 바를 그릴 사각형이다. 여기서는 이 사각형에 타이틀 바를 그린다.
 * 
 * @param figure
 * @param g
 * @param rect
 *            void
 */
private void drawTitleBar(IFigure figure, Graphics g, Rectangle rect) {
    g.setBackgroundColor(getBackgroundColor());
    g.fillRectangle(rect);

    Insets padding = getPadding();
    int x = rect.x + padding.left;
    int y = rect.y + padding.top + (rect.height - getTextExtents(figure).height) / 2;

    int textWidth = getTextExtents(figure).width;
    int freeSpace = rect.width - padding.getWidth() - textWidth;

    if (getTextAlignment() == PositionConstants.CENTER)
        freeSpace /= 2;
    if (getTextAlignment() != PositionConstants.LEFT)
        x += freeSpace;

    Font f = getFont(figure);
    FontData fData = f.getFontData()[0];
    fData.setName(this.getFontName());
    fData.setStyle(this.getTextStyle());
    fData.setHeight(this.getFontSize());
    g.setFont(f);
    g.setForegroundColor(this.getTextColor());
    g.drawString(getLabel(), x, y);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:34,代码来源:TitleBarBorder.java

示例3: shrink

import org.eclipse.draw2d.geometry.Insets; //导入方法依赖的package包/类
private Rectangle shrink(final Rectangle bounds, final Insets insets) {
    final Rectangle shrinked = bounds.getCopy();

    shrinked.x += insets.left;
    shrinked.y += insets.top;
    shrinked.width -= insets.getWidth();
    shrinked.height -= insets.getHeight();

    return shrinked;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:11,代码来源:DropShadowRectangle.java

示例4: shrink

import org.eclipse.draw2d.geometry.Insets; //导入方法依赖的package包/类
private Rectangle shrink(Rectangle bounds, Insets insets) {
	Rectangle shrinked = bounds.getCopy();

	shrinked.x += insets.left;
	shrinked.y += insets.top;
	shrinked.width -= insets.getWidth();
	shrinked.height -= insets.getHeight();

	return shrinked;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:11,代码来源:DropShadowRectangle.java

示例5: shrink

import org.eclipse.draw2d.geometry.Insets; //导入方法依赖的package包/类
private Rectangle shrink(Rectangle bounds, Insets insets) {
    final Rectangle shrinked = bounds.getCopy();
    shrinked.x += insets.left;
    shrinked.y += insets.top;
    shrinked.width -= insets.getWidth();
    shrinked.height -= insets.getHeight();

    return shrinked;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:10,代码来源:DropShadowRectangle.java

示例6: shrink

import org.eclipse.draw2d.geometry.Insets; //导入方法依赖的package包/类
private Rectangle shrink(Rectangle bounds, Insets insets) {
    final Rectangle shrinked = bounds.getCopy();

    shrinked.x += insets.left;
    shrinked.y += insets.top;
    shrinked.width -= insets.getWidth();
    shrinked.height -= insets.getHeight();

    return shrinked;
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:11,代码来源:PrintERDiagramOperation.java


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