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


Java Form.getGlassPane方法代码示例

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


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

示例1: showOn

import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
 * Install the glass tutorial on a form and seamlessly dismiss it when no longer necessary
 * @param f the form
 */
public void showOn(Form f) {
    Painter oldPane = f.getGlassPane();
    f.setGlassPane(this);
    Dialog dummy = new Dialog() {
        public void keyReleased(int i) {
            dispose();
        }
    };
    int oldTint = f.getTintColor();
    f.setTintColor(0);
    
    dummy.getDialogStyle().setBgTransparency(0);
    dummy.setDisposeWhenPointerOutOfBounds(true);
    dummy.show(0, Display.getInstance().getDisplayHeight() - 2, 0, Display.getInstance().getDisplayWidth() - 2, true, true);
    
    f.setTintColor(oldTint);
    f.setGlassPane(oldPane);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:23,代码来源:GlassTutorial.java

示例2: installGlassPane

import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
 * Installs a glass pane on the given form making sure to make it a painter
 * chain only if required by existing painter
 * 
 * @param f form on which to install the chain
 * @param p painter to install
 */
public static void installGlassPane(Form f, Painter p) {
    Painter existing = f.getGlassPane();
    if(existing == null) {
        f.setGlassPane(p);
        return;
    }
    if(existing instanceof PainterChain) {
        f.setGlassPane(((PainterChain)existing).addPainter(p));
    } else {
        PainterChain pc = new PainterChain(new Painter[] {existing, p});
        f.setGlassPane(pc);
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:21,代码来源:PainterChain.java

示例3: removeGlassPane

import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
 * Removes a glass pane from the given form, this is the opposite operation for the
 * install glass pane
 * 
 * @param f form from which to remove the chain
 * @param p painter to remove
 */
public static void removeGlassPane(Form f, Painter p) {
    Painter existing = f.getGlassPane();
    if(existing == null) {
        return;
    }
    if(existing == p) {
        f.setGlassPane(null);
        return;
    }
    if(existing instanceof PainterChain) {
        PainterChain pc = (PainterChain)existing;
        if(pc.chain.length == 1) {
            f.setGlassPane(null);
        } else {
            Vector v = new Vector();
            int plen = pc.chain.length;
            for(int iter = 0 ; iter < plen ; iter++) {
                if(pc.chain[iter] != p) {
                    v.addElement(pc.chain[iter]);
                }
            }
            if(v.size() == 0) {
                f.setGlassPane(null);
                return;
            }
            Painter[] newChain = new Painter[v.size()];
            int clen = newChain.length;
            for(int iter = 0 ; iter < clen ; iter++) {
                newChain[iter] = (Painter)v.elementAt(iter);
            }
            pc.chain = newChain;
            f.repaint(); // Since setGlassPane was not called and still the painter changed, we need to call repaint
        }
    } 
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:43,代码来源:PainterChain.java


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