PocketPCSynchroProgressBar.java

00001 /*
00002  * OpenMobileIS - a free Java(TM) Framework for mobile applications Java(TM)
00003  * Copyright (C) 2004-2006 Philippe Delrieu
00004  * All rights reserved.
00005  * Contact: pdelrieu@openmobileis.org
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00020  * USA
00021  *
00022  *  Author : Philippe Delrieu
00023  *  
00024  *  Modifications :
00025  *  Creation P.Delrieu
00026  * 
00027  */
00028 package org.openmobileis.modules.common.gui;
00029 
00030 import java.awt.BorderLayout;
00031 import java.awt.Button;
00032 import java.awt.Canvas;
00033 import java.awt.Color;
00034 import java.awt.Dimension;
00035 import java.awt.FlowLayout;
00036 import java.awt.Frame;
00037 
00043 public final class PocketPCSynchroProgressBar {
00044   public static final Color WHITE = new Color(255,255,255);
00045         private Frame frame;
00046         private ProgressBar prgBar;
00050         public PocketPCSynchroProgressBar(String frameName) {
00051         frame = new Frame(frameName);
00052         frame.setBackground(WHITE);
00053         Dimension framedim =  java.awt.Toolkit.getDefaultToolkit().getScreenSize();
00054         frame.setSize(framedim);                
00055                 frame.setLayout(new BorderLayout());
00056                 
00057         Canvas canhaut = new Canvas();
00058         canhaut.setBackground(WHITE);
00059         canhaut.setSize(framedim.width, framedim.height/3);
00060     frame.add(BorderLayout.NORTH, canhaut);
00061         Canvas canbas = new Canvas();
00062         canbas.setBackground(WHITE);
00063         canbas.setSize(framedim.width, framedim.height/3);
00064     frame.add(BorderLayout.SOUTH,canbas);
00065         Canvas caneast = new Canvas();
00066         caneast.setSize(framedim.width/8, framedim.height/2);
00067         caneast.setBackground(WHITE);
00068     frame.add(BorderLayout.EAST,caneast);
00069         Canvas canwest = new Canvas();
00070         canwest.setSize(framedim.width/8, framedim.height/2);
00071         canwest.setBackground(WHITE);
00072     frame.add(BorderLayout.WEST,canwest);
00073         prgBar = new ProgressBar();
00074    //   prgBar.setPreferredSize(hautdim);
00075         frame.add( prgBar); 
00076         }
00077         
00078         public PocketPCSynchroProgressBar() {
00079         this("Synchronisation");
00080         }
00081         
00082         public void setVisible()        {
00083                 frame.setVisible(true);
00084                 frame.toFront();
00085         }
00086         
00087         public void dispose()   {
00088                 frame.setVisible(false);
00089                 frame.dispose();
00090         }
00091         
00096         public void setProgressBar(int percent) {
00097                 prgBar.updateBar(percent);
00098         }
00099 
00100 }

Generated on Mon Jan 11 21:19:16 2010 for OpenMobileIS by  doxygen 1.5.4