Ejemplo n.º 1
0
 internal virtual void  addViewDecodedStringCommand()
 {
     if (viewDecodedStringCommand == null)
     {
         viewDecodedStringCommand = new Command("Result", Command.SCREEN, 1);
         addCommand(viewDecodedStringCommand);
     }
 }
Ejemplo n.º 2
0
 public virtual void  commandAction(Command c, Displayable d)
 {
     if (c == viewDecodedStringCommand)
     {
         midlet.toDecodedTextBox();
     }
     else
     {
         midlet.displayCanvasBack();
     }
 }
Ejemplo n.º 3
0
 public virtual void  commandAction(Command c, Displayable d)
 {
     if (c == exitCommand)
     {
         midlet.cameraCanvasExit();
     }
     else if (c == captureCommand)
     {
         takeSnapshot();
     }
 }
Ejemplo n.º 4
0
 public CameraCanvas(QRCodeDecoderMIDletExample midlet)
 {
     this.midlet = midlet;
     exitCommand = new Command("Exit", Command.EXIT, 1);
     addCommand(exitCommand);
     setCommandListener(this);
     try
     {
         player = Manager.createPlayer("capture://video");
         player.realize();
         videoControl = (VideoControl)player.getControl("VideoControl");
         if (videoControl == null)
         {
             discardPlayer();
             message1 = "Unsupported:";
             message2 = "Can't get video control";
         }
         else
         {
             videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
             captureCommand = new Command("Capture", Command.SCREEN, 1);
             addCommand(captureCommand);
         }
     }
     catch (System.IO.IOException ioe)
     {
         discardPlayer();
         message1 = "IOException:";
         //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
         message2 = ioe.Message;
     }
     catch (MediaException me)
     {
         discardPlayer();
         message1 = "MediaException:";
         message2 = me.getMessage();
     }
     catch (System.Security.SecurityException se)
     {
         discardPlayer();
         message1 = "SecurityException";
         //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
         message2 = se.Message;
     }
 }
 internal virtual void addViewDecodedStringCommand()
 {
     if (viewDecodedStringCommand == null)
     {
         viewDecodedStringCommand = new Command("Result", Command.SCREEN, 1);
         addCommand(viewDecodedStringCommand);
     }
 }
 public virtual void commandAction(Command c, Displayable d)
 {
     if (c == viewDecodedStringCommand)
     {
         midlet.toDecodedTextBox();
     }
     else
     {
         midlet.displayCanvasBack();
     }
 }
 public virtual void commandAction(Command c, Displayable d)
 {
     midlet.decodedTextBoxBack();
 }
 public virtual void commandAction(Command c, Displayable d)
 {
     if (c == exitCommand)
     {
         midlet.cameraCanvasExit();
     }
     else if (c == captureCommand)
     {
         takeSnapshot();
     }
 }
 public CameraCanvas(QRCodeDecoderMIDletExample midlet)
 {
     this.midlet = midlet;
     exitCommand = new Command("Exit", Command.EXIT, 1);
     addCommand(exitCommand);
     setCommandListener(this);
     try
     {
         player = Manager.createPlayer("capture://video");
         player.realize();
         videoControl = (VideoControl) player.getControl("VideoControl");
         if (videoControl == null)
         {
             discardPlayer();
             message1 = "Unsupported:";
             message2 = "Can't get video control";
         }
         else
         {
             videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
             captureCommand = new Command("Capture", Command.SCREEN, 1);
             addCommand(captureCommand);
         }
     }
     catch (System.IO.IOException ioe)
     {
         discardPlayer();
         message1 = "IOException:";
         //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
         message2 = ioe.Message;
     }
     catch (MediaException me)
     {
         discardPlayer();
         message1 = "MediaException:";
         message2 = me.getMessage();
     }
     catch (System.Security.SecurityException se)
     {
         discardPlayer();
         message1 = "SecurityException";
         //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.getMessage' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
         message2 = se.Message;
     }
 }
Ejemplo n.º 10
0
 public virtual void  commandAction(Command c, Displayable d)
 {
     midlet.decodedTextBoxBack();
 }