Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Image


  /* Create prompt alert. */
  public void run() {
    // Due to a quirk on T637 (MIDP 1.0), we need to create a form
    // before the alert or the alert will not be seen.
    Form formAlert = new Form(origCmd.getLabel());
    Image question = UiUtil.getImage("/icons/questionMk.png");
    formAlert.append(question);
    int ix = formAlert.append(new StringItem(null,
          (String)promptCommands.get(origCmd)));
    Command okCmd = UiUtil.getCmdRsc("cmd.ok", Command.OK, 1);
    formAlert.addCommand(okCmd);
View Full Code Here


                    prefContentHeight
            );
        }
        else
        {
            Image buffer = null;
            try
            {
                final int selectedIndex = this.selectedIndex;
                final Font font = this.font;
                final RowSet rowSet = this.rowSet;
                final String[] labels = this.labels;
                Graphics g = graphics;
                final int height = getHeight();
                if( !isDoubleBuffered() )
                {
                    buffer = Image.createImage( getWidth(), height );
                    g = buffer.getGraphics();
                }
                g.setColor( background );
                g.fillRect( 0, 0, getWidth(), height );
//                g.setColor( 0x85B0C6 );
//                g.fillRect( 0, 0, getWidth(), height );
View Full Code Here

    clock.start();
  }
 
  private TiledLayer generateCave(int lenght) throws Exception
  {
    Image tile = Image.createImage(this.getClass().getResourceAsStream("/front.jpg"));
    int tw = 20;
    int th = 20;
    int xmax = getWidth()/tw;
    int ymax = getHeight()/th;
   
View Full Code Here

    if (frontLayer == null)
    {
      frontLayer = Image.createImage(getWidth(), getHeight());
      try
      {
        Image tile = Image.createImage(this.getClass().getResourceAsStream("/front.jpg"));
        int tw = tile.getWidth();
        int th = tile.getHeight();
        int xmax = getWidth() / tw;
        int ymax = getHeight() / th;
        Graphics g = frontLayer.getGraphics();
        for (int i = 0; i <= xmax; ++i)
        {
          for (int j = 0; j <= ymax; ++j)
          {
            g.drawImage(tile, i * tw, j * th, Graphics.TOP | Graphics.LEFT);
          }
        }
      } catch (IOException e)
      {
        e.printStackTrace();
        // no tile available, draw default color (black)
        Graphics g = frontLayer.getGraphics();
        g.setColor(0x00000000);
        g.fillRect(0, 0, getWidth(), getHeight());
      }
    }
   
    // prepare the tiled back  layer.
    if (backLayer == null)
    {
      backLayer = Image.createImage(getWidth(), getHeight());
      try
      {
        Image tile = Image.createImage(this.getClass().getResourceAsStream("/back.jpg"));
        int tw = tile.getWidth();
        int th = tile.getHeight();
        int xmax = getWidth() / tw;
        int ymax = getHeight() / th;
        Graphics g = backLayer.getGraphics();
        for (int i = 0; i <= xmax; ++i)
        {
View Full Code Here

            if( splash != null )
            {
                form.setFullScreenMode( true );
                AppState.setScreenWidth( form.getWidth() );
                AppState.setScreenHeight( form.getHeight() );
                final Image image = Image.createImage(
                        getClass().getResourceAsStream( splash )
                );
                form.setImage( image );
                form.setMeterPlacement( ProgressView.BOTTOM );
            }
View Full Code Here

            final int       height
    )
    {
        if( !sets.containsKey( name ) )
        {
            final Image all = Util.loadImage( dummy.getClass(), source );
            if( all != null )
            {
                final int count = all.getWidth() / width;
                int x = 0;
                for( int i = 0; i < count; i++ )
                {
                    final Image image = Image.createImage(
                            all,
                            x,
                            0,
                            width,
                            height,
View Full Code Here

        final int lineHeight = listFont.getHeight() + 1;

        int maxHeight = lineHeight;
        final MenuItem item0 = ( (MenuItem) items.elementAt( 0 ) );
        final Image image0 = item0.image;
        final int imageHeight = image0 != null ? image0.getHeight() + 1 : 0;
        if( imageHeight > maxHeight )
        {
            maxHeight = imageHeight;
        }
View Full Code Here

        }
        else
        {
            try
            {
                final Image src = Image.createImage( source );
                final int height = src.getHeight();
                startSlice = Image.createImage(
                        src,
                        0,
                        0,
                        1,
View Full Code Here

        this.labelAbove = labelAbove;
    }

    public void paint( Graphics graphics, final int x0, final int y0, int w, int h )
    {
        final Image buffer = Image.createImage( w, h );
        final Graphics g = buffer.getGraphics();
        g.setColor( 0xFFFFFF );
        g.fillRect( 0, 0, w, h );

        if( showLabel )
        {
View Full Code Here

    protected void paint( Graphics graphics )
    {
        AbstractView.touchLastAccess();
        if( items.size() > 0 )
        {
            Image buffer = null;
            Graphics g = graphics;
            final int height = getHeight();
            if( !isDoubleBuffered() )
            {
                buffer = Image.createImage( getWidth(), height );
                g = buffer.getGraphics();
            }
            g.setColor( background );
            g.fillRect( 0, 0, getWidth(), getHeight() );
            if( mode == GRID )
            {
View Full Code Here

TOP

Related Classes of javax.microedition.lcdui.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.