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


Java Form.registerAnimated方法代码示例

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


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

示例1: setImage

import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
 * Sets the currently showing image
 * @param image the image to set
 */
public void setImage(Image image) {
    if(this.image != image) {
        panPositionX = 0.5f;
        panPositionY = 0.5f;
        zoom = MIN_ZOOM;
        this.image = image;
        updatePositions();
        repaint();
        if(image.isAnimation()) {
            Form f = getComponentForm();
            if(f != null) {
                f.registerAnimated(this);
            }
        }
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:21,代码来源:ImageViewer.java

示例2: start

import com.codename1.ui.Form; //导入方法依赖的package包/类
public void start(){
    Form f = ChartComponent.this.getComponentForm();
    if ( f != null ){
        f.registerAnimated(this);
        this.motion.start();
    } else {
        animations.remove(this);
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:10,代码来源:ChartComponent.java

示例3: setComponentValueWithTickering

import com.codename1.ui.Form; //导入方法依赖的package包/类
private void setComponentValueWithTickering(Component cmp, Object value, Component l, Component rootRenderer) {
    setComponentValue(cmp, value, l, rootRenderer);
    if(cmp instanceof Label) {
        if(selectionListener) {
            if(l instanceof List) {
                ((List)l).addActionListener(mon);
            }
            parentList = l;
        }
        Label label = (Label)cmp;
        if(label.shouldTickerStart() && Display.getInstance().shouldRenderSelection()) {
            if(!label.isTickerRunning()) {
                parentList = l;
                if(parentList != null) {
                    Form f = parentList.getComponentForm();
                    if(f != null) {
                        f.registerAnimated(mon);
                        label.startTicker(cmp.getUIManager().getLookAndFeel().getTickerSpeed(), true);
                    }
                }
            }
        } else {
            if(label.isTickerRunning()) {
                label.stopTicker();
            }
            label.setTextPosition(0);
        }
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:30,代码来源:GenericListCellRenderer.java

示例4: schedule

import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
 * Binds the timer to start at the given schedule
 * 
 * @param timeMillis the time from now in milliseconds
 * @param repeat whether the timer repeats
 * @param bound  the form to which the timer is bound
 */
public void schedule(int timeMillis, boolean repeat, Form bound) {
    lastEllapse = System.currentTimeMillis();
    ms = timeMillis;
    this.repeat = repeat;
    this.bound = bound;
    bound.registerAnimated(i);
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:15,代码来源:UITimer.java

示例5: checkAnimation

import com.codename1.ui.Form; //导入方法依赖的package包/类
void checkAnimation(Image icon) {
    if(icon != null && icon.isAnimation()) {
        Form parent = getComponentForm();
        if(parent != null) {
            // animations are always running so the internal animation isn't
            // good enough. We never want to stop this sort of animation
            parent.registerAnimated(this);
        }
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:11,代码来源:ScaleImageLabel.java

示例6: initComponent

import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void initComponent() {
    super.initComponent();
    if(animation == null) {
        animation = UIManager.getInstance().getThemeImageConstant("infiniteImage");
    }
    Form f = getComponentForm();
    if(f != null) {
        f.registerAnimated(this);
    }
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:14,代码来源:InfiniteProgress.java

示例7: execute

import com.codename1.ui.Form; //导入方法依赖的package包/类
/**
 * Executes the chart demo.
 * @param context the context
 * @return the built intent
 */
public Form execute() {
  String[] titles = new String[] { "sin", "cos" };
  List<double[]> x = new ArrayList<double[]>();
  List<double[]> values = new ArrayList<double[]>();
  int step = 4;
  int count = 360 / step + 1;
  x.add(new double[count]);
  x.add(new double[count]);
  double[] sinValues = new double[count];
  double[] cosValues = new double[count];
  values.add(sinValues);
  values.add(cosValues);
  for (int i = 0; i < count; i++) {
    int angle = i * step;
    x.get(0)[i] = angle;
    x.get(1)[i] = angle;
    double rAngle = Math.toRadians(angle);
    sinValues[i] = Math.sin(rAngle);
    cosValues[i] = Math.cos(rAngle);
  }
  int [] colors = new int[] { ColorUtil.BLUE, ColorUtil.CYAN };
  PointStyle[] styles = new PointStyle[] { PointStyle.POINT, PointStyle.POINT };
  final XYMultipleSeriesRenderer renderer = buildRenderer(colors, styles);
  setChartSettings(renderer, "Trigonometric functions", "X (in degrees)", "Y", 0, 360, -1, 1,
      ColorUtil.GRAY, ColorUtil.LTGRAY);
  
  int strWidth = smallFont.stringWidth("360") / 2;
  int numXLabels = Display.getInstance().getDisplayWidth() / (strWidth + 20);
  renderer.setXLabels(numXLabels);
  renderer.setYLabels(10);
  renderer.setXAxisMin(0);
  renderer.setXAxisMax(50);
  
  final Motion m = Motion.createLinearMotion(0, 310, 10000);
  
  
  final LineChart chart = new LineChart(buildDataset(titles, x, values), renderer);
  final ChartComponent cmp = new ChartComponent(chart);
  Form out = wrap("", cmp);
  out.registerAnimated(new Animation() {

      public boolean animate() {
          if (m.isFinished()) {
              return false;
          } else {
              renderer.setXAxisMin(m.getValue());
              renderer.setXAxisMax(m.getValue()+50);
              cmp.repaint();
              return true;
          }
      }

      public void paint(Graphics g) {
          
      }
      
  });
  m.start();
  return out;
  
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:67,代码来源:TrigonometricFunctionsChart.java


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