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


Java Component.setHeight方法代码示例

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


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

示例1: expand

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void expand(Component component, String height, String width) {
    if (expandedComponent != null && expandedComponent instanceof DesktopComponent) {
        ((DesktopComponent) expandedComponent).setExpanded(false);
    }

    // only Y direction
    if (StringUtils.isEmpty(height) || AUTO_SIZE.equals(height) || height.endsWith("%")) {
        component.setHeight("100%");
    }

    JComponent expandingChild = DesktopComponentsHelper.getComposition(component);

    Pair<JPanel, BoxLayoutAdapter> wrapperInfo = wrappers.get(component);
    if (wrapperInfo != null) {
        expandingChild = wrapperInfo.getFirst();
    }

    layoutAdapter.expand(expandingChild, height, width);

    if (component instanceof DesktopComponent) {
        ((DesktopComponent) component).setExpanded(true);
    }

    expandedComponent = component;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:DesktopWindow.java

示例2: expand

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void expand(Component component, String height, String width) {
    if (expandedComponent != null
            && expandedComponent instanceof DesktopComponent) {
        ((DesktopComponent) expandedComponent).setExpanded(false);
    }

    if (layoutAdapter.getFlowDirection() == BoxLayoutAdapter.FlowDirection.Y) {
        if (StringUtils.isEmpty(height) || AUTO_SIZE.equals(height) || height.endsWith("%")) {
            component.setHeight("100%");
        }
    } else if (layoutAdapter.getFlowDirection() == BoxLayoutAdapter.FlowDirection.X) {
        if (StringUtils.isEmpty(width) || AUTO_SIZE.equals(width) || width.endsWith("%")) {
            component.setWidth("100%");
        }
    }

    JComponent expandingChild = DesktopComponentsHelper.getComposition(component);

    Pair<JPanel, BoxLayoutAdapter> wrapperInfo = wrappers.get(component);
    if (wrapperInfo != null) {
        expandingChild = wrapperInfo.getFirst();
    }

    layoutAdapter.expand(expandingChild, height, width);

    if (component instanceof DesktopComponent) {
        ((DesktopComponent) component).setExpanded(true);
    }

    expandedComponent = component;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:33,代码来源:DesktopAbstractBox.java

示例3: adjustTabSize

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
protected void adjustTabSize(Component tabComponent) {
    if (getWidth() >= 0) {
        tabComponent.setWidth("100%");
    } else {
        tabComponent.setWidth(Component.AUTO_SIZE);
    }

    if (getHeight() >= 0) {
        tabComponent.setHeight("100%");
    } else {
        tabComponent.setHeight(Component.AUTO_SIZE);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:DesktopTabSheet.java

示例4: loadComponent

import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void loadComponent() {
    assignFrame(resultComponent);
    assignXmlDescriptor(resultComponent, element);

    loadVisible(resultComponent, element);

    loadStyleName(resultComponent, element);

    loadAlign(resultComponent, element);
    loadScrollBars(resultComponent, element);

    loadSpacing(resultComponent, element);
    loadMargin(resultComponent, element);

    loadHeight(resultComponent, element);
    loadWidth(resultComponent, element);

    loadIcon(resultComponent, element);
    loadCaption(resultComponent, element);
    loadDescription(resultComponent, element);

    loadSubComponents();

    for (Component child : resultComponent.getOwnComponents()) {
        if (resultComponent.getOrientation() == ScrollBoxLayout.Orientation.VERTICAL && ComponentsHelper.hasFullHeight(child)) {
            child.setHeight("-1px");
            log.warn("100% height of " + child.getClass().getSimpleName() + " id=" + child.getId()
                    + " inside vertical scrollBox replaced with -1px height");
        }
        if (resultComponent.getOrientation() == ScrollBoxLayout.Orientation.HORIZONTAL && ComponentsHelper.hasFullWidth(child)) {
            child.setWidth("-1px");
            log.warn("100% width of " + child.getClass().getSimpleName() + " id=" + child.getId()
                    + " inside horizontal scrollBox replaced with -1px width");
        }
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:38,代码来源:ScrollBoxLayoutLoader.java


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