javauis/lcdui_qt/src/javax/microedition/lcdui/CanvasKeypad.java
changeset 47 f40128debb5d
parent 26 dc7c549001d5
child 61 bf7ee68962da
equal deleted inserted replaced
35:85266cc22c7f 47:f40128debb5d
   187 
   187 
   188     /**
   188     /**
   189              * Constructs a canvas kepad based on the JAD attribute
   189              * Constructs a canvas kepad based on the JAD attribute
   190              *
   190              *
   191              * @param canvas - canvas for which the keypad is required.
   191              * @param canvas - canvas for which the keypad is required.
   192              * @param canvasComp - Composite corresponding to the canvas.
       
   193              * @param mode- the jad attribute as a string.
   192              * @param mode- the jad attribute as a string.
   194              */
   193              */
   195     CanvasKeypad(Canvas canvas, Composite canvasComp, String mode)
   194     CanvasKeypad(Canvas canvas, String mode)
   196     {
   195     {
   197 
   196 
   198         this.canvas = canvas;
   197         this.canvas = canvas;
   199         display = ESWTUIThreadRunner.getInstance().getDisplay();
   198         display = ESWTUIThreadRunner.getInstance().getDisplay();
   200 
   199 
   242         FormData canvasData = new FormData();
   241         FormData canvasData = new FormData();
   243         canvasData.right = new FormAttachment(100);
   242         canvasData.right = new FormAttachment(100);
   244         canvasData.left = new FormAttachment(0);
   243         canvasData.left = new FormAttachment(0);
   245         canvasData.top = new FormAttachment(0);
   244         canvasData.top = new FormAttachment(0);
   246         canvasData.bottom = new FormAttachment(keypadComposite);
   245         canvasData.bottom = new FormAttachment(keypadComposite);
   247         canvasComp.setLayoutData(canvasData);
   246         canvas.getContentComp().setLayoutData(canvasData);
   248 
   247 
   249         FormData navKeyData = new FormData();
   248         FormData navKeyData = new FormData();
   250         navKeyData.right = new FormAttachment(100);
   249         navKeyData.right = new FormAttachment(100);
   251         navKeyData.left = new FormAttachment(0);
   250         navKeyData.left = new FormAttachment(0);
   252 
   251 
   436         gameD.setLayoutData(gameDFormData);
   435         gameD.setLayoutData(gameDFormData);
   437 
   436 
   438         gameKeysComposite.layout();
   437         gameKeysComposite.layout();
   439     }
   438     }
   440 
   439 
       
   440 
   441     /**
   441     /**
   442              * Handles orientation changes.
   442              * Handles orientation changes.
   443              */
   443              */
   444     void handleOrientationChange(int mode)
   444     void handleOrientationChange(int mode)
   445     {
   445     {
   446         //change the layout as per orientation mode
   446         //change the layout as per orientation mode
       
   447     }
       
   448 
       
   449 
       
   450     /**
       
   451              * Sets the currect Canvas for Key events.
       
   452              * @param canvas - Current Canvas to which the key events needs to be delivered.
       
   453              */
       
   454     void setCurrentCanvas(Canvas canvas)
       
   455     {
       
   456         this.canvas = canvas;
   447     }
   457     }
   448 
   458 
   449 
   459 
   450     /**
   460     /**
   451              * Adds LSk and RSK keys to navigation keypad if the canvas is set to full screen mode.
   461              * Adds LSk and RSK keys to navigation keypad if the canvas is set to full screen mode.