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


Java Component.getWidth方法代码示例

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


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

示例1: updateComponent

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void updateComponent(Component child) {
    boolean componentReAdded = false;
    if (DesktopContainerHelper.mayHaveExternalCaption(child)
            || DesktopContainerHelper.mayHaveExternalContextHelp(child)) {
        if (captions.containsKey(child)
                && !DesktopContainerHelper.hasExternalCaption(child)
                && !DesktopContainerHelper.hasExternalContextHelp(child)) {
            reAddChild(child);
            componentReAdded = true;
        } else if (!captions.containsKey(child)
                && (DesktopContainerHelper.hasExternalCaption(child)
                || DesktopContainerHelper.hasExternalContextHelp(child))) {
            reAddChild(child);
            componentReAdded = true;
        } else if (captions.containsKey(child)) {
            ComponentCaption caption = captions.get(child);
            caption.update();
            BoxLayoutAdapter adapterForCaption = layoutAdapter;
            if (wrappers.containsKey(child)) {
                adapterForCaption = wrappers.get(child).getSecond();
            }
            adapterForCaption.updateConstraints(caption, adapterForCaption.getCaptionConstraints(child));
        }
    }

    if (!componentReAdded) {
        JComponent composition;
        if (wrappers.containsKey(child)) {
            composition = wrappers.get(child).getFirst();
            CC constraints = MigLayoutHelper.getConstraints(child);
            if (child.getHeight() == -1.0) {
                MigLayoutHelper.applyHeight(constraints, -1, UNITS_PIXELS, false);
            } else {
                MigLayoutHelper.applyHeight(constraints, 100, UNITS_PERCENTAGE, false);
            }
            if (child.getWidth() == -1.0) {
                MigLayoutHelper.applyWidth(constraints, -1, UNITS_PIXELS, false);
            } else {
                MigLayoutHelper.applyWidth(constraints, 100, UNITS_PERCENTAGE, false);
            }
            BoxLayoutAdapter adapter = wrappers.get(child).getSecond();
            adapter.updateConstraints(DesktopComponentsHelper.getComposition(child), constraints);
        } else {
            composition = DesktopComponentsHelper.getComposition(child);
        }
        layoutAdapter.updateConstraints(composition, layoutAdapter.getConstraints(child));
    }

    requestRepaint();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:52,代码来源:DesktopWindow.java

示例2: updateComponentInternal

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
protected void updateComponentInternal(Component child) {
    boolean componentReAdded = false;
    if (DesktopContainerHelper.mayHaveExternalCaption(child)
            || DesktopContainerHelper.mayHaveExternalContextHelp(child)) {
        if (captions.containsKey(child)
                && !DesktopContainerHelper.hasExternalCaption(child)
                && !DesktopContainerHelper.hasExternalContextHelp(child)) {
            reAddChild(child);
            componentReAdded = true;
        } else if (!captions.containsKey(child)
                && (DesktopContainerHelper.hasExternalCaption(child)
                || DesktopContainerHelper.hasExternalContextHelp(child))) {
            reAddChild(child);
            componentReAdded = true;
        } else if (captions.containsKey(child)) {
            ComponentCaption caption = captions.get(child);
            caption.update();
            BoxLayoutAdapter adapterForCaption = layoutAdapter;
            if (wrappers.containsKey(child)) {
                adapterForCaption = wrappers.get(child).getSecond();
            }
            adapterForCaption.updateConstraints(caption, adapterForCaption.getCaptionConstraints(child));
        }
    }

    if (!componentReAdded) {
        JComponent composition;
        if (wrappers.containsKey(child)) {
            composition = wrappers.get(child).getFirst();
            CC constraints = MigLayoutHelper.getConstraints(child);
            if (child.getHeight() == -1.0) {
                MigLayoutHelper.applyHeight(constraints, -1, UNITS_PIXELS, false);
            } else {
                MigLayoutHelper.applyHeight(constraints, 100, UNITS_PERCENTAGE, false);
            }
            if (child.getWidth() == -1.0) {
                MigLayoutHelper.applyWidth(constraints, -1, UNITS_PIXELS, false);
            } else {
                MigLayoutHelper.applyWidth(constraints, 100, UNITS_PERCENTAGE, false);
            }
            BoxLayoutAdapter adapter = wrappers.get(child).getSecond();
            adapter.updateConstraints(DesktopComponentsHelper.getComposition(child), constraints);
        } else {
            composition = DesktopComponentsHelper.getComposition(child);
        }
        layoutAdapter.updateConstraints(composition, layoutAdapter.getConstraints(child));
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:49,代码来源:DesktopAbstractBox.java

示例3: updateComponent

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void updateComponent(Component child) {
    boolean componentReAdded = false;

    if (DesktopContainerHelper.mayHaveExternalCaption(child)
            || DesktopContainerHelper.mayHaveExternalContextHelp(child)) {
        if (captions.containsKey(child)
                && !DesktopContainerHelper.hasExternalCaption(child)
                && !DesktopContainerHelper.hasExternalContextHelp(child)) {
            reAddChild(child);
            componentReAdded = true;
        } else if (!captions.containsKey(child)
                && (DesktopContainerHelper.hasExternalCaption(child)
                || DesktopContainerHelper.hasExternalContextHelp(child))) {
            reAddChild(child);
            componentReAdded = true;
        } else if (captions.containsKey(child)) {
            ComponentCaption caption = captions.get(child);
            caption.update();
            if (!wrappers.containsKey(child)) {
                CC c = (CC) layoutAdapter.getConstraints(child);
                layoutAdapter.updateConstraints(caption, layoutAdapter.getCaptionConstraints(child,
                        c.getCellX(), c.getCellY(), c.getCellX(), c.getCellY()));
            }
        }
    }

    if (!componentReAdded) {
        JComponent composition;
        if (wrappers.containsKey(child)) {
            composition = wrappers.get(child).getFirst();
            CC constraints = MigLayoutHelper.getConstraints(child);
            if (child.getHeight() == -1.0) {
                MigLayoutHelper.applyHeight(constraints, -1, UNITS_PIXELS, false);
            } else {
                MigLayoutHelper.applyHeight(constraints, 100, UNITS_PERCENTAGE, false);
            }
            if (child.getWidth() == -1.0) {
                MigLayoutHelper.applyWidth(constraints, -1, UNITS_PIXELS, false);
            } else {
                MigLayoutHelper.applyWidth(constraints, 100, UNITS_PERCENTAGE, false);
            }
            BoxLayoutAdapter adapter = wrappers.get(child).getSecond();
            adapter.updateConstraints(DesktopComponentsHelper.getComposition(child), constraints);
        } else {
            composition = DesktopComponentsHelper.getComposition(child);
        }
        layoutAdapter.updateConstraints(composition, layoutAdapter.getConstraints(child));
    }

    requestRepaint();

    requestContainerUpdate();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:55,代码来源:DesktopGridLayout.java


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