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


Java Form.repaint方法代码示例

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


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

示例1: show

import com.codename1.ui.Form; //导入方法依赖的package包/类
public static void show(String text, final Form f)
{
    isVisible = true;
    
    f.getLayeredPane().setLayout(new BorderLayout());
    final Label l = new Label(text);
    l.setUIID("ToastMessage");
    f.getLayeredPane().addComponent(BorderLayout.SOUTH, l);
    f.repaint();

    Timer exitTimer = new Timer();
    exitTimer.schedule(new TimerTask() {
        @Override
        public void run() {
            f.getLayeredPane().removeAll();
            f.repaint();
            isVisible = false;
        }
    }, toastTimeOut);
}
 
开发者ID:martijn00,项目名称:MusicPlayerCodenameOne,代码行数:21,代码来源:ToastView.java

示例2: onMain_BtShowInterstitialAction

import com.codename1.ui.Form; //导入方法依赖的package包/类
@Override
protected void onMain_BtShowInterstitialAction(Component c, ActionEvent event) {
    _("onMain_BtShowInterstitialAction");
    _("Showing interstitial");
    
    Form f = c.getComponentForm();
    
    if (my==null)
    {
        showInterstitialText = "BAD.";
    }
    else
    {
        my.setPlc(tfPlc.getText()); // you must set your plc before you try to show an ad
        my.showInterstitial();
        showInterstitialText = "OK.";
    }
    
    f.add(new SpanLabel("show:\n"+showInterstitialText));
    f.invalidate();
    f.repaint();
}
 
开发者ID:amiga,项目名称:aerserv-codenameone-testbed,代码行数:23,代码来源:StateMachine.java

示例3: beforeShowAfterModel

import com.codename1.ui.Form; //导入方法依赖的package包/类
protected void beforeShowAfterModel(Form f) {
    BorderLayout bl = (BorderLayout)ui.findCtnListLoading(f).getLayout();
    if(bl.getNorth() != null)
    {
        ui.findCtnListLoading(f).removeComponent(bl.getNorth());
        f.repaint();
    }
    else if(bl.getSouth() != null)
    {
        ui.findCtnListLoading(f).removeComponent(bl.getSouth());
        f.repaint();
    }

    super.beforeShowAfterModel(f);
}
 
开发者ID:martijn00,项目名称:MusicPlayerCodenameOne,代码行数:16,代码来源:NewsView.java

示例4: beforeShowAfterModel

import com.codename1.ui.Form; //导入方法依赖的package包/类
protected void beforeShowAfterModel(Form f) {
    f.getTitleComponent().setEndsWith3Points(true);

    BorderLayout bl = (BorderLayout)f.getContentPane().getLayout();
    if(bl.getNorth() != null)
    {
        f.getContentPane().removeComponent(bl.getNorth());
        f.repaint();
    }

    super.beforeShowAfterModel(f);
}
 
开发者ID:martijn00,项目名称:MusicPlayerCodenameOne,代码行数:13,代码来源:BrowseView.java

示例5: onMain_BtLoadInterstitialAction

import com.codename1.ui.Form; //导入方法依赖的package包/类
@Override
protected void onMain_BtLoadInterstitialAction(Component c, ActionEvent event) {
    _("onMain_BtLoadInterstitialAction");    
    
     Form f = c.getComponentForm();
     
    if (my!=null && my.isSupported())
    {
        _("Loading interstitial");
        my.setPlc(tfPlc.getText()); // you must set your plc before you try to show an ad
        my.loadInterstitial();
        
        loadInterstitialText = "Loading interstitial with plc "+my.getPlc();
    }
    else
    {
        _("Cannot start video!");
        if (my==null)
        {
            _("WARNING. Failed to create native class!");
            loadInterstitialText = "Failed to create native class!";
        }
        else if (!my.isSupported())
        {
            _("WARNING. This device is not supported by this library, feel free to implement it yourself!");
            loadInterstitialText = "Platform not supported!";
        }
    }
    f.add(new SpanLabel("load:\n"+loadInterstitialText));
     f.invalidate();
     f.repaint();
}
 
开发者ID:amiga,项目名称:aerserv-codenameone-testbed,代码行数:33,代码来源:StateMachine.java

示例6: setLightweightMode

import com.codename1.ui.Form; //导入方法依赖的package包/类
protected void setLightweightMode(boolean l) {
    if(nativePeer != null && nativePeer[0] != 0) {
        if(lightweightMode != l) {
            lightweightMode = l;
            nativeInstance.peerSetVisible(nativePeer[0], !lightweightMode);
            // fix for https://groups.google.com/d/msg/codenameone-discussions/LKxy16PhYEY/bvusdq-ICwAJ
            Form f = getComponentForm();
            if(f != null) {
                f.repaint();
            }
        }
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:14,代码来源:IOSImplementation.java

示例7: 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

示例8: onMain_BtPreloadInterstitialAction

import com.codename1.ui.Form; //导入方法依赖的package包/类
@Override
protected void onMain_BtPreloadInterstitialAction(Component c, ActionEvent event) {
    _("onMain_BtPreloadInterstitialAction");
    _("Pre-loading interstitial");
    
    Form f = c.getComponentForm();
    
    preloadInterstitialText = "Attempting to preload with plc "+tfPlc.getText();
    //Container ADTOME = (Container) findByName("ADTOME",c.getComponentForm());
    f.add(new SpanLabel(preloadInterstitialText));
    
     
    if (my==null)
    {
        
        preloadInterstitialText = "native class is still null!";
        _(""+preloadInterstitialText);
        f.add(new SpanLabel(preloadInterstitialText));
      //  ADTOME.invalidate();
    }
    else
    {
        preloadInterstitialText = "...";
        _(""+preloadInterstitialText);
        f.add(new SpanLabel(preloadInterstitialText));
      //  ADTOME.invalidate();
    }
     
    if (my!=null)
    {
          _("...");
          my.setPlc(tfPlc.getText()); // you must set your plc before you try to show an ad
          my.preloadInterstitial();
          preloadInterstitialText = "Preloaded";
          f.add(new SpanLabel("preload:\n"+preloadInterstitialText));
        //  ADTOME.invalidate();
    }
    else
    {
        _("my still null");
    }
  f.invalidate();
  f.repaint();
    //c.getComponentForm().invalidate();
  
}
 
开发者ID:amiga,项目名称:aerserv-codenameone-testbed,代码行数:47,代码来源:StateMachine.java


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