J2ME GUI实战之三 ----------LWUIT实现切换特效

MobaXterm隧道配置详解:为PyCharm远程开发打通‘最后一公里’ 本文详细解析了如何利用MobaXterm配置SSH隧道,实现PyCharm远程开发的高效连接。通过本地端口转发技术,开发者可以安全访问内网服务器,特别适用于需要通过跳板机的复杂网络环境。文章涵盖从基础配置到企业级运维的全套解决方案,包括性能优化、安全加固等实用技巧。 阅读详情
本文来自:http://blog.youkuaiyun.com/hellogv/ ,转载必须注明出处!


以上第一幅图是窗体切换特效之一;第二幅图是控件切换特效之一

以下给出设置特效的代码,这些代码同样来自Sample例子中:
  1. /*
  2.  * Copyright ?2008 Sun Microsystems, Inc. All rights reserved.
  3.  * Use is subject to license terms.
  4.  *
  5.  */
  6. package com.sun.lwuit.uidemo;
  7. import com.sun.lwuit.Button;
  8. import com.sun.lwuit.ButtonGroup;
  9. import com.sun.lwuit.CheckBox;
  10. import com.sun.lwuit.Command;
  11. import com.sun.lwuit.Component;
  12. import com.sun.lwuit.Container;
  13. import com.sun.lwuit.Dialog;
  14. import com.sun.lwuit.Display;
  15. import com.sun.lwuit.Form;
  16. import com.sun.lwuit.Label;
  17. import com.sun.lwuit.M3G;
  18. import com.sun.lwuit.RadioButton;
  19. import com.sun.lwuit.TextArea;
  20. import com.sun.lwuit.TextField;
  21. import com.sun.lwuit.animations.CommonTransitions;
  22. import com.sun.lwuit.animations.Transition;
  23. import com.sun.lwuit.animations.Transition3D;
  24. import com.sun.lwuit.events.ActionEvent;
  25. import com.sun.lwuit.events.ActionListener;
  26. import com.sun.lwuit.layouts.BoxLayout;
  27. import com.sun.lwuit.layouts.FlowLayout;
  28. import com.sun.lwuit.plaf.Style;
  29. /**
  30.  * Transitons between screens
  31.  *
  32.  * @author Shai Almog
  33.  */
  34. public class TransitionDemo extends Demo {
  35.     /**
  36.      * The selected radio button index 
  37.      */
  38.     private static int selectedIndex = 0;
  39.     public String getName() {
  40.         return "Transitions";
  41.     }
  42.     protected String getHelp() {
  43.         return "Transitions appear when switching from one form to the next, a transition can be bound " +
  44.             "to the operation of exiting or entering the screen. There are default transitions in the toolkit " +
  45.             "and custom transitions are easy to write.";
  46.     }
  47.     private RadioButton createRB(String label, ButtonGroup g, Form f) {
  48.         RadioButton b = new RadioButton(label);
  49.         Style s = b.getStyle();
  50.         s.setMargin(0, 0, 0, 0);
  51.         s.setBgTransparency(70);
  52.         g.add(b);
  53.         f.addComponent(b);
  54.         return b;
  55.     }
  56.     
  57.     protected void execute(final Form f) {
  58.         f.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
  59.         Label title = new Label("Please select a transition type:");
  60.         title.getStyle().setMargin(0, 0, 0, 0);
  61.         title.getStyle().setBgTransparency(70);
  62.         f.addComponent(title);
  63.         final ButtonGroup radioButtonGroup = new ButtonGroup();
  64.         createRB("Slide Horizontal", radioButtonGroup, f);
  65.         createRB("Slide Vertical", radioButtonGroup, f);
  66.         createRB("Fade", radioButtonGroup, f);
  67.         if(M3G.isM3GSupported()) {
  68.             createRB("Rotate", radioButtonGroup, f);
  69.             createRB("Fly In", radioButtonGroup, f);
  70.             createRB("Cube", radioButtonGroup, f);
  71.             createRB("Static Rotation", radioButtonGroup, f);
  72.             createRB("Swing Top", radioButtonGroup, f);
  73.             createRB("Swing Bottom", radioButtonGroup, f);
  74.         }
  75.         radioButtonGroup.setSelected(selectedIndex);
  76.         final TextField speed = new TextField("500");
  77.         speed.setConstraint(TextArea.NUMERIC);
  78.         speed.setInputModeOrder(new String[] {"123"});
  79.         f.addComponent(createPair("Speed", speed));
  80.         final Form destination = new Form("Destination");
  81.         destination.addComponent(new Label("This is the transition destination..."));
  82.         destination.addCommand(new Command("Back") {
  83.             public void actionPerformed(ActionEvent evt) {
  84.                 f.show();
  85.             }
  86.         });
  87.         
  88.         final CheckBox highQuality = new CheckBox("High Quality");
  89.         highQuality.setSelected(!Display.getInstance().isLightMode());
  90.         highQuality.getStyle().setBgTransparency(0);
  91.         f.addComponent(highQuality);
  92.         highQuality.addActionListener(new ActionListener() {
  93.             public void actionPerformed(ActionEvent evt) {
  94.                 if(Display.getInstance().isLightMode()) {
  95.                     Dialog.show("Warning", "The device seems a bit weak for high quality rendering, " +
  96.                         "using this mode might crash your device.", "OK", null);
  97.                 }
  98.             }
  99.         });
  100.         final Button updateButton = new Button("Preview Transition");
  101.         final Button applyButton = new Button("Apply Transition");
  102.         final Button applyMenu = new Button("Apply To Menu");
  103.         final Button applyComponents = new Button("Apply To Components");
  104.         updateButton.setAlignment(Button.CENTER);
  105.         updateButton.getStyle().setPadding(5, 5, 7, 7);
  106.         applyButton.setAlignment(Button.CENTER);
  107.         applyButton.getStyle().setPadding(5, 5, 7, 7);
  108.         ActionListener listener = new ActionListener() {
  109.             public void actionPerformed(ActionEvent ev) {
  110.                 int runSpeed = Integer.parseInt(speed.getText());
  111.                 Transition in, out;//in 表示窗体切入时使用的特效,out表示窗体切出时使用的特性
  112.                 switch (radioButtonGroup.getSelectedIndex()) {
  113.                     case 0: {
  114.                         out = CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL, false, runSpeed);
  115.                         in = CommonTransitions.createSlide(CommonTransitions.SLIDE_HORIZONTAL, true, runSpeed);
  116.                         break;
  117.                     }
  118.                     case 1: {
  119.                         out = CommonTransitions.createSlide(CommonTransitions.SLIDE_VERTICAL, false, runSpeed);
  120.                         in = CommonTransitions.createSlide(CommonTransitions.SLIDE_VERTICAL, true, runSpeed);
  121.                         break;
  122.                     }
  123.                     case 2: {
  124.                         out = CommonTransitions.createFade(runSpeed);
  125.                         in = CommonTransitions.createFade(runSpeed);
  126.                         break;
  127.                     }
  128.                     case 3:  {
  129.                         out = Transition3D.createRotation(runSpeed, true);
  130.                         in = Transition3D.createRotation(runSpeed, false);
  131.                         break;
  132.                     }
  133.                     case 4:  {
  134.                         out = Transition3D.createFlyIn(runSpeed);
  135.                         in = Transition3D.createFlyIn(runSpeed);
  136.                         break;
  137.                     }
  138.                     case 5:  {
  139.                         out = Transition3D.createCube(runSpeed, true);
  140.                         in = Transition3D.createCube(runSpeed, false);
  141.                         break;
  142.                     }
  143.                     case 6:  {
  144.                         out = Transition3D.createStaticRotation(runSpeed, true);
  145.                         in = Transition3D.createStaticRotation(runSpeed, false);
  146.                         break;
  147.                     }
  148.                     case 7:  {
  149.                         out = Transition3D.createSwingIn(runSpeed);
  150.                         in = out;
  151.                         break;
  152.                     }
  153.                     default:  {
  154.                         out = Transition3D.createSwingIn(runSpeed, false);
  155.                         in = out;
  156.                         break;
  157.                     }
  158.                 }
  159.                 selectedIndex = radioButtonGroup.getSelectedIndex();
  160.                 if(out instanceof Transition3D) {//这里需要设置特效效果,仅对部分特效有效
  161.                     ((Transition3D)out).setHighQualityMode(highQuality.isSelected());
  162.                     ((Transition3D)in).setHighQualityMode(highQuality.isSelected());
  163.                 }
  164.                 if(updateButton == ev.getSource()) {
  165.                     //演示窗体切换特效
  166.                     f.setTransitionOutAnimator(out);
  167.                     f.setTransitionInAnimator(in);
  168.                     destination.show();
  169.                 }
  170.                 else if(applyButton == ev.getSource()) {
  171.                         //设置全部窗体在切换时都是同一个特效,注意是“窗体切换时”
  172.                     f.setTransitionOutAnimator(null);
  173.                     f.setTransitionInAnimator(null);
  174.                     UIDemoMIDlet.setTransition(in, out);
  175.                     }
  176. /*这个函数是UIDemoMIDlet的成员函数
  177.  *  public static void setTransition(Transition in, Transition out) {
  178.         form.setTransitionInAnimator(in);
  179.         form.setTransitionOutAnimator(out);
  180.     }
  181. */
  182.                 else  if(applyMenu == ev.getSource()) {
  183.                         //设置全部菜单都是同一个特效,菜单Menu就是一般在右下角弹出的
  184.                         UIDemoMIDlet.setMenuTransition(in, out);
  185.                 }
  186. /*这个函数是UIDemoMIDlet的成员函数
  187.  *     public static void setMenuTransition(Transition in, Transition out) {
  188.         form.setMenuTransitions(in, out);
  189.         UIManager.getInstance().getLookAndFeel().setDefaultMenuTransitionIn(in);
  190.         UIManager.getInstance().getLookAndFeel().setDefaultMenuTransitionOut(out);
  191.     }
  192.  */
  193.                 else if(applyComponents == ev.getSource()) {
  194.                         //设置控件都是同一个特效,这里的控件可以是Button
  195.                         //当Button被选中时就会显示特效
  196.                         UIDemoMIDlet.setComponentTransition(in);
  197.                 }
  198. /* 这个函数是UIDemoMIDlet的成员函数
  199.  *     public static void setComponentTransition(Transition t) {
  200.         componentTransitions = t;
  201.         form.setSmoothScrolling(false);
  202.     }
  203.  */
  204.             }
  205.         };
  206.         updateButton.addActionListener(listener);
  207.         applyButton.addActionListener(listener);
  208.         applyMenu.addActionListener(listener);
  209.         applyComponents.addActionListener(listener);
  210.         Container buttonPanel = new Container(new FlowLayout(Component.CENTER));
  211.         buttonPanel.addComponent(updateButton);
  212.         f.addComponent(buttonPanel);
  213.         buttonPanel = new Container(new FlowLayout(Component.CENTER));
  214.         buttonPanel.addComponent(applyButton);
  215.         f.addComponent(buttonPanel);
  216.         buttonPanel = new Container(new FlowLayout(Component.CENTER));
  217.         buttonPanel.addComponent(applyMenu);
  218.         f.addComponent(buttonPanel);
  219.         buttonPanel = new Container(new FlowLayout(Component.CENTER));
  220.         buttonPanel.addComponent(applyComponents);
  221.         f.addComponent(buttonPanel);
  222.     }    
  223. }


第八节:Orin NX 修改pinmux 读SPI1对应的寄存器,看对应的GPIO口是否被复用为SPI功能。说明GPIO口的功能已经被复用为SPI。烧录或者命令行烧录,都是根据。这里我们把文件统一命名成。文件,Orin NX的。测试SPI功能,基于。 阅读详情

相关推荐

ThingsBoard实战指南:RPC命令下发与设备交互详解

本文深入解析了ThingsBoard平台中RPC命令下发的核心机制与实战应用。通过对比客户端与服务端RPC模式,详细阐述了从仪表盘控件配置到设备端Python代码响应的完整双向交互流程,并提供了常见问题排查与进阶优化技巧,帮助开发者构建可靠、实时的物联网设备控制系统。

weixin_29168153的博客 213

J2ME GUI实战之四 ----------LWUIT的Button使用以及窗体布局

  function StorePage(){d=document;t=d.selection?(d.selection.type!=None?d.selection.createRange().text:):(d.getSelection?d.getSelection():);void(keyit=window.open(http://www.365key.com/storeit.

hellogv的专栏 5794

百度贴吧爬虫实战:完整实现与使用指南

使用 csv 模块创建写入器,首先写入表头("标题" 和 "链接"),然后遍历帖子字典,将每个标题和链接作为一行写入文件。首先检查内容是否为空,然后通过查找 JSON 结构的起始({)和结束(})位置,提取有效的 JSON 片段。接着遍历帖子列表中的每个条目,提取标题文本和对应的链接,对于相对路径的链接会自动补全为完整的 URL。从 JSON 提取标题和链接此方法专门用于从解析后的 JSON 数据中提取帖子标题和对应的链接。提取到的标题和链接以字典形式返回,键为标题,值为对应的完整链接。

qq_63736560的博客 2019

通过J2ME的录音功能实现简易示波器

通过J2ME的录音功能实现简易示波器

hellogv的专栏 1万+

波束管理 Beam Management

Beam Management in 5G NR   波束管理,是5G NR中基于信道质量来动态选择每个UE和gNB之间以什么方向和频率的波束beam来进行通信。   背景   5G NR(New Radio)支持非常高的数据速率和更低的延迟。5G NR支持FR1和FR2频段,FR1为亚6 GHz(450至6000 MHz);FR2为毫米波段(24.25 GHz至52.6 GHz)。   由于毫米波频带使用非常高的频率,因此会导致传播损耗和其他损耗。为了补偿损失,在这种频率下定向通信是必不可少的。

最忆是江南的博客 5828

用Python玩转Milvus:从安装SDK到完成第一个向量搜索Demo

本文为Python开发者提供了一份详细的Milvus向量数据库实战指南。文章重点讲解了如何规避版本兼容性陷阱,正确部署Milvus服务端并安装匹配的Python SDK。通过一个电影推荐系统的完整案例,演示了从数据建模、集合创建、向量插入、索引构建到执行混合搜索的全流程,帮助开发者快速上手并完成第一个向量搜索Demo。

weixin_29239279的博客 192

手机二维码~~~ZXing简介

本文来自http://blog.youkuaiyun.com/hellogv/       最近3G不断在发力,商务部也主动牵头推动移动电子商务的发展,所以,针对企业应用、消费辅助类的J2ME软件将以更快的速度涌现。这里,我要介绍的是,手机的新应用----手机二维码。    什么是一维码、二维码?一维码就是商品包装盒上的条形码,而二维码就是。。。。。。类似“马赛克”打格的图像,以图像中的黑白点数量、大小来表示

hellogv的专栏 8497

高频网络协议与编程IO相关面试基本问题和知识点整理

网络IO相关基本高频面试基本问题和知识点整合

曾经“等你生日那天”都遥远得像未来,如今却可欢愉的挥手说“下个十年见” 173万+

获取网站的实时股票数据

以下代码可以解析WAP的PHP网页以及JSP网页;如果是要解析JSP网页,代码可以更加简略。/** *本文来自http://blog.youkuaiyun.com/hellogv/ * 这个单元负责全局函数 */import java.io.*;import java.util.*;import javax.microedition.midlet.*;

hellogv的专栏 8140

学Simulink——基于Simulink的固态变压器(SST)多级协同控制​

本文介绍了基于Simulink的固态变压器(SST)多级协同控制系统设计与仿真方法。SST作为智能电网关键设备,包含AC-DC整流、DC-DC隔离和DC-AC逆变三级变换器。针对级间耦合问题,提出了能量-功率协同控制策略,通过纵向解耦和横向联动实现稳定运行。详细演示了在Simulink中搭建三级主电路、设计协同控制器(含电网定向控制、功率前馈和虚拟惯性控制)的全过程,并通过负载突变测试验证了系统动态性能(直流母线电压波动<2%)。最后给出了工程部署建议,包括数字控制延时补偿、启动序列设计和代码自动生成

xiaoheshang_123的博客 209

海思图像质量之HiPQTool调试

文章目录一. HiPQTool 界面二. 图像调试三. 将调试参数写入程序中 一. HiPQTool 界面 二. 图像调试 三. 将调试参数写入程序中

lzg2011的博客 2383

LWUIT 上使用List实现表格

本文来自http://blog.youkuaiyun.com/hellogv/ ,引用必须注明出处!      最近越来越多人用LWUIT,问得问题也越来越多了。最近超级多人问的是,如何使用List实现表格。以前我用Grid实现了表格(http://blog.youkuaiyun.com/hellogv/archive/2009/01/12/3759984.aspx),现在就来说说如何

hellogv的专栏 8026

华为OD机试新系统真题 【查找最佳充电策略】

华为OD机试 新系统真题【查找最佳充电策略】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为OD机试真题【查找最佳充电策略】多语言题解。

qq_45776114的博客 439

使用J2ME发送手机短信

以下代码出自http://blog.youkuaiyun.com/hellogv/,引用请注明出处!小弟有一部索爱的K508C,在学习J2ME时,发觉它竟是MIDP2.0,因此,就利用它来开始自己的移动开发之旅。  首先,要加入以下这两句必须的库引用:import javax.wireless.messaging.MessageConnection;import javax.wireles

hellogv的专栏 6764

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

J2ME GUI实战之一 ----------LWUIT简介

本文来自:http://blog.youkuaiyun.com/hellogv/ ,转载必须注明出处!首先,想让大家看看LWUIT可以做出什么界面:这种界面,用J2ME-Polish也不难做出来,但是作者我更喜欢LWUIT,因为她发展得很快很快,觉得值得大家关注!!好了,继续介绍,以下内容摘自网络:Sun发布了LWUIT(Light-Weight UI Toolkit)的源代码以及示例代码(示例后面会详细说明

hellogv的专栏 6733

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

J2ME GUI实战之二 ----------LWUIT实现手机九宫图

 本文来自:http://blog.youkuaiyun.com/hellogv/ ,转载必须注明出处! 本文的源代码,已放到 http://download.youkuaiyun.com/user/hellogv 供大家下载!首先,想让大家看看九宫图实现之后的界面:本文所用的代码,是来自LWUIT所提供的Sample例子,但是对例子做出以下修改:1.设计自主的res资源文件2.把builde.xml里面的 。。。。。

hellogv的专栏 6519

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

用最少的代码来,美化你的J2ME程序!

以下代码出自http://blog.youkuaiyun.com/hellogv/,引用请注明出处!在开始本文之前,请确定你自己,是否想把你的J2ME程序界面改为以下这样:   如果你已经想好了,想把你J2ME程序改成这样,那么,请继续往下看.......  在动手美化你的J2ME程序之前,请准备以下:  1。请到http://www.enough.de/news.html下载j2me

hellogv的专栏 6087

J2ME的RMS读写实现

以下代码出自http://blog.youkuaiyun.com/hellogv/,引用请注明出处!  在实现RMS的读写前,首先要注意RMS对汉字不兼容,为了解决这个这个首要问题,首先要编写以下两个成员函数:public byte[] StringtoBytes(String Str) { //写成字节byte[] STB = null;try {ByteArrayOutpu

hellogv的专栏 6039

LWUIT + ChartComponent 之一实现饼图(PieChart)

本文来自http://blog.youkuaiyun.com/hellogv/     本文源代码下载地址:http://download.youkuaiyun.com/source/872671    本文所用的Chart组件为J2me ChartComponent - ver 1.5.2,该组件的下载页面为http://www.beanizer.org/site/index.php/en/Software/J2me-

hellogv的专栏 6005

LWUIT + J4LChart 之 多种Chart

 本文来自http://blog.youkuaiyun.com/hellogv/ 本文例子代码,可以到这里下载:http://download.youkuaiyun.com/source/886261Lwuit就不必介绍了,至于J4LChart,就不得不介绍一下了。。。。。。J4LChart,提供了完整的Chart图表,从饼、线、柱等都一网打尽,并且其使用也比较简单,Chart的式样可以从TXT文本中读取,当然,也可以在

hellogv的专栏 5637
上一篇: J2ME GUI实战之二 ----------LWUIT实现手机九宫图
下一篇: J2ME GUI实战之四 ----------LWUIT的Button使用以及窗体布局
欧巴Godwin
欧巴Godwin 领域专家: 操作系统技术领域 领域专家: 操作系统技术领域
博客等级 码龄20年 9690粉丝 141原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值