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


Java UIManager.isThemeConstant方法代码示例

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


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

示例1: initLaf

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void initLaf(UIManager manager) {
    super.initLaf(manager);
    int tabPlace = manager.getThemeConstant("tabPlacementInt", -1);
    tabsFillRows = manager.isThemeConstant("tabsFillRowsBool", false);
    tabsGridLayout = manager.isThemeConstant("tabsGridBool", false);
    changeTabOnFocus = manager.isThemeConstant("changeTabOnFocusBool", false);
    BorderLayout bd = (BorderLayout)super.getLayout();
    if(bd != null) {
        if(manager.isThemeConstant("tabsOnTopBool", false)) {
            if(bd.getCenterBehavior() != BorderLayout.CENTER_BEHAVIOR_TOTAL_BELOW) {
                bd.setCenterBehavior(BorderLayout.CENTER_BEHAVIOR_TOTAL_BELOW);
                checkTabsCanBeSeen();
            }
        } else {
            bd.setCenterBehavior(BorderLayout.CENTER_BEHAVIOR_SCALE);
        }
    }
    changeTabContainerStyleOnFocus =  manager.isThemeConstant("changeTabContainerStyleOnFocusBool", false);
    if(tabPlace != -1){
        tabPlacement = tabPlace;
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:26,代码来源:Tabs.java

示例2: initLaf

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void initLaf(UIManager uim) {
    super.initLaf(uim);
    if(!showNumbersForce) {
        showNumbers = uim.isThemeConstant("rendererShowsNumbersBool", showNumbersDefault);
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:10,代码来源:DefaultListCellRenderer.java

示例3: initLaf

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void initLaf(UIManager uim) {
    super.initLaf(uim);
    setSmoothScrolling(uim.getLookAndFeel().isDefaultSmoothScrolling());
    fixedSelection = uim.getThemeConstant("fixedSelectionInt", fixedSelection);
    itemGap = uim.getThemeConstant("listItemGapInt", itemGap);
    longPointerPressAction = uim.isThemeConstant("listLongPressBool", true);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:11,代码来源:List.java

示例4: showMenuDialog

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * A menu is implemented as a dialog, this method allows you to override dialog
 * display in order to customize the dialog menu in various ways
 * 
 * @param menu a dialog containing menu options that can be customized
 * @return the command selected by the user in the dialog (not menu) Select 
 * or Cancel
 */
protected Command showMenuDialog(Dialog menu) {
    UIManager manager = parent.getUIManager();
    boolean pref = manager.isThemeConstant("menuPrefSizeBool", false);
    int height;
    int marginLeft;
    int marginRight = 0;
    if (pref) {
        Container dialogContentPane = menu.getDialogComponent();
        marginLeft = parent.getWidth() - (dialogContentPane.getPreferredW()
                + menu.getStyle().getHorizontalPadding());
        marginLeft = Math.max(0, marginLeft);
        if (parent.getSoftButtonCount() > 1) {
            height = parent.getHeight() - parent.getSoftButton(0).getParent().getPreferredH() - dialogContentPane.getPreferredH();
        } else {
            height = parent.getHeight() - dialogContentPane.getPreferredH();
        }
        height = Math.max(0, height);
    } else {
        float menuWidthPercent = 1 - Float.parseFloat(manager.getThemeConstant("menuWidthPercent", "75")) / 100;
        float menuHeightPercent = 1 - Float.parseFloat(manager.getThemeConstant("menuHeightPercent", "50")) / 100;
        height = (int) (parent.getHeight() * menuHeightPercent);
        marginLeft = (int) (parent.getWidth() * menuWidthPercent);
    }

    if (isReverseSoftButtons()) {
        marginRight = marginLeft;
        marginLeft = 0;
    }
    if (getCommandBehavior() == Display.COMMAND_BEHAVIOR_ICS) {
        menu.setTransitionOutAnimator(transitionIn);
        menu.setTransitionInAnimator(transitionOut);
        int th = getTitleAreaContainer().getHeight();
        return menu.show(th, height - th, marginLeft, marginRight, true);
    } else {
        if (manager.getLookAndFeel().isTouchMenus() && manager.isThemeConstant("PackTouchMenuBool", true)) {
            return menu.showPacked(BorderLayout.SOUTH, true);
        } else {
            return menu.show(height, 0, marginLeft, marginRight, true);
        }
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:50,代码来源:MenuBar.java

示例5: createCommandComponent

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * Creates the component containing the commands within the given vector
 * used for showing the menu dialog, this method calls the createCommandList
 * method by default however it allows more elaborate menu creation.
 *
 * @param commands list of command objects
 * @return Component that will result in the parent menu dialog recieving a command event
 */
protected Component createCommandComponent(Vector commands) {
    UIManager manager = parent.getUIManager();
    // Create a touch based menu interface
    if (manager.getLookAndFeel().isTouchMenus()) {
        Container menu = new Container();
        menu.setScrollableY(true);
        for (int iter = 0; iter < commands.size(); iter++) {
            Command c = (Command) commands.elementAt(iter);
            menu.addComponent(createTouchCommandButton(c));
        }
        if (!manager.isThemeConstant("touchCommandFlowBool", false)) {
            int cols = calculateTouchCommandGridColumns(menu);
            if (cols > getCommandCount()) {
                cols = getCommandCount();
            }
            int rows = Math.max(1, getCommandCount() / cols + (getCommandCount() % cols != 0 ? 1 : 0));
            if (rows > 1) {
                // try to prevent too many columns concentraiting within a single row
                int remainingColumns = (rows * cols) % getCommandCount();
                int newCols = cols;
                int newRows = rows;
                while (remainingColumns != 0 && remainingColumns > 1 && newCols >= 2) {
                    newCols--;
                    newRows = Math.max(1, getCommandCount() / newCols + (getCommandCount() % newCols != 0 ? 1 : 0));
                    if (newRows != rows) {
                        break;
                    }
                    remainingColumns = (newRows * newCols) % getCommandCount();
                }
                if (newRows == rows) {
                    cols = newCols;
                    rows = newRows;
                }
            }
            GridLayout g = new GridLayout(rows, cols);
            g.setFillLastRow(manager.isThemeConstant("touchCommandFillBool", true));
            menu.setLayout(g);
        } else {
            ((FlowLayout) menu.getLayout()).setFillRows(true);
        }
        menu.setPreferredW(Display.getInstance().getDisplayWidth());
        return menu;
    }
    return createCommandList(commands);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:54,代码来源:MenuBar.java

示例6: showOverflowMenu

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
protected Command showOverflowMenu(Dialog menu) {
    Form parent = sideMenu.getParentForm();
    int height;
    int marginLeft;
    int marginRight = 0;
    Container dialogContentPane = menu.getDialogComponent();
    marginLeft = parent.getWidth() - (dialogContentPane.getPreferredW()
            + menu.getStyle().getHorizontalPadding());
    marginLeft = Math.max(0, marginLeft);
    if (parent.getSoftButtonCount() > 1) {
        height = parent.getHeight() - parent.getSoftButton(0).getParent().getPreferredH() - dialogContentPane.getPreferredH();
    } else {
        height = parent.getHeight() - dialogContentPane.getPreferredH();
    }
    height = Math.max(0, height);
    int th = getHeight();
    Transition transitionIn;
    Transition transitionOut;
    UIManager manager = parent.getUIManager();
    LookAndFeel lf = manager.getLookAndFeel();
    if (lf.getDefaultMenuTransitionIn() != null || lf.getDefaultMenuTransitionOut() != null) {
        transitionIn = lf.getDefaultMenuTransitionIn();
        if(transitionIn instanceof BubbleTransition){
            ((BubbleTransition)transitionIn).setComponentName("OverflowButton");
        }
        transitionOut = lf.getDefaultMenuTransitionOut();
    } else {
        transitionIn = CommonTransitions.createEmpty();
        transitionOut = CommonTransitions.createEmpty();
    }
    menu.setTransitionInAnimator(transitionIn);
    menu.setTransitionOutAnimator(transitionOut);
    
    if(isRTL()){
        marginRight = marginLeft;
        marginLeft = 0;
    }
    int tint = parent.getTintColor();
    parent.setTintColor(0x00FFFFFF);
    parent.tint = false;
    boolean showBelowTitle = manager.isThemeConstant("showMenuBelowTitleBool", true);
    int topPadding = 0;
    Component statusBar = ((BorderLayout) getLayout()).getNorth();
    if (statusBar != null) {
        topPadding = statusBar.getAbsoluteY() + statusBar.getHeight();
    }
    if(showBelowTitle){
        topPadding = th;
    }
    
    Command r = menu.show(topPadding, Math.max(topPadding, height - topPadding), marginLeft, marginRight, true);
    parent.setTintColor(tint);
    return r;
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:55,代码来源:Toolbar.java


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