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


Java UIManager.getLookAndFeel方法代码示例

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


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

示例1: initLaf

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void initLaf(UIManager uim) {
    super.initLaf(uim);
    LookAndFeel laf = uim.getLookAndFeel();
    transitionOutAnimator = laf.getDefaultFormTransitionOut();
    transitionInAnimator = laf.getDefaultFormTransitionIn();
    focusScrolling = laf.isFocusScrolling();
    if (menuBar == null || !menuBar.getClass().equals(laf.getMenuBarClass())) {
        try {
            menuBar = (MenuBar) laf.getMenuBarClass().newInstance();
        } catch (Exception ex) {
            Log.e(ex);
            menuBar = new MenuBar();
        }
        menuBar.initMenuBar(this);
    }

    tintColor = laf.getDefaultFormTintColor();
    tactileTouchDuration = laf.getTactileTouchDuration();
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:23,代码来源:Form.java

示例2: initLaf

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * This method initializes the Component defaults constants
 */
protected void initLaf(UIManager uim){
    if(uim == getUIManager() && isInitialized()){
        return;
    }
    selectText = uim.localize("select", "Select");
    LookAndFeel laf = uim.getLookAndFeel();
    animationSpeed = laf.getDefaultSmoothScrollingSpeed();
    rtl = laf.isRTL();
    tactileTouch = isFocusable();
    tensileDragEnabled = laf.isDefaultTensileDrag();
    snapToGrid = laf.isDefaultSnapToGrid();
    alwaysTensile = laf.isDefaultAlwaysTensile();
    tensileHighlightEnabled = laf.isDefaultTensileHighlight();
    scrollOpacityChangeSpeed = laf.getFadeScrollBarSpeed();
    isScrollVisible = laf.isScrollVisible();
    
    if(tensileHighlightEnabled) {
        tensileLength = 3;
    } else {
        tensileLength = -1;
    }        
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:26,代码来源:Component.java

示例3: initLaf

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * 
 * {@inheritDoc}
 */
protected void initLaf(UIManager uim) {
    if(uim == getUIManager() && isInitialized()){
        return;
    }
    super.initLaf(uim);
    LookAndFeel laf = uim.getLookAndFeel();
    setSmoothScrolling(laf.isDefaultSmoothScrolling());
    if(components != null){
        int count = getComponentCount();
        for (int i = 0; i < count; i++) {
            Component c = getComponentAt(i);
            c.initLaf(uim);
        }
    }

}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:21,代码来源:Container.java

示例4: initComponentImpl

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
void initComponentImpl() {
    super.initComponentImpl();
    UIManager manager = getUIManager();
    LookAndFeel lf = manager.getLookAndFeel();
    if(hasFocus()) {
        if(lf instanceof DefaultLookAndFeel) {
            ((DefaultLookAndFeel)lf).focusGained(this);
        }
    }
    // solves the case of a user starting a ticker before adding the component
    // into the container
    if(isTickerEnabled() && isTickerRunning() && !isCellRenderer()) {
        getComponentForm().registerAnimatedInternal(this);
    }
    checkAnimation();
    if(maskName != null && mask == null) {
        setMask(UIManager.getInstance().getThemeMaskConstant(maskName));
    }
    if(getIcon() != null) {
        getIcon().lock();
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:26,代码来源:Label.java

示例5: initLaf

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void initLaf(UIManager uim) {
    super.initLaf(uim);
    setSelectCommandText(uim.localize("edit", "Edit"));
    LookAndFeel laf = uim.getLookAndFeel();
    setSmoothScrolling(laf.isDefaultSmoothScrolling());
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:10,代码来源:TextArea.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

示例7: createMenuSelectCommand

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * Factory method that returns the Form Menu select Command.
 * This method can be overridden to customize the Command on the Form.
 * 
 * @return Command
 */
protected Command createMenuSelectCommand() {
    UIManager manager = parent.getUIManager();
    LookAndFeel lf = manager.getLookAndFeel();
    return new Command(manager.localize("select", "Select"), lf.getMenuIcons()[0]);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:12,代码来源:MenuBar.java

示例8: createMenuCancelCommand

import com.codename1.ui.plaf.UIManager; //导入方法依赖的package包/类
/**
 * Factory method that returns the Form Menu cancel Command.
 * This method can be overridden to customize the Command on the Form.
 * 
 * @return Command
 */
protected Command createMenuCancelCommand() {
    UIManager manager = parent.getUIManager();
    LookAndFeel lf = manager.getLookAndFeel();
    return new Command(manager.localize("cancel", "Cancel"), lf.getMenuIcons()[1]);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:12,代码来源:MenuBar.java


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