MOMRecentSearchControl.java
资源名称:src.zip [点击查看]
上传用户:luxiaowei
上传日期:2022-06-06
资源大小:58k
文件大小:2k
源码类别:
J2ME
开发平台:
Java
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.MOM.ui.control;
- import com.MOM.resources.Resources;
- import com.framework.DisplayManager;
- import com.framework.TickerTextControl;
- import com.framework.UIControl;
- import javax.microedition.lcdui.Graphics;
- /**
- *
- * @author Swaroop Kumar
- */
- public class MOMRecentSearchControl extends UIControl{
- TickerTextControl control[];
- public MOMRecentSearchControl(String name,String reading,String change) {
- setWidth(DisplayManager.getInst().getWidth());
- String str[] = new String[3];
- str[0] = name;
- str[1] = reading;
- str[2] = change;
- control = new TickerTextControl[3];
- for (int i = 0; i < 3; i++) {
- TickerTextControl tickerTextControl;
- if(i == 0)
- {
- tickerTextControl = new TickerTextControl(str[i], Resources.getInstance().getFontBlueSmallPlain());
- tickerTextControl.setAllignment(Graphics.LEFT);
- }else{
- tickerTextControl = new TickerTextControl(str[i], Resources.getInstance().getFontRedSmallPalin());
- tickerTextControl.setAllignment(Graphics.RIGHT);
- }
- tickerTextControl.setWidth(width / 3);
- tickerTextControl.setX( (width / 3) * i);
- }
- }
- public void setSelected(boolean selected) {
- super.setSelected(selected);
- for (int i = 0; i < control.length; i++) {
- control[i].setSelected(selected);
- }
- }
- public void paint(Graphics g) {
- for (int i = 0; i < control.length; i++) {
- control[i].paintUI(g);
- }
- }
- }