modele
Class AfficherTexteLong
java.lang.Object
javax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
modele.AfficherTexteLong
public class AfficherTexteLong
- extends javax.microedition.lcdui.Canvas
Permet d'afficher un texte long en fonction de la taille de l'écran
Fields inherited from class javax.microedition.lcdui.Canvas |
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
Method Summary |
void |
afficher(Stratego stratego,
javax.microedition.lcdui.Graphics g,
java.lang.String txt,
int x,
int y,
int width,
javax.microedition.lcdui.Font font,
int couleur,
int alignment,
int depart)
Affiche le texte en fonction de la taille de l'écran |
private boolean |
aPlusDeLignes()
Vérifie s'il y a encore des lignes à afficher |
private int |
caractereSuivant()
Retourne la position du curseur du caractere suivant |
int |
getCompteurLignes()
|
private int |
getMotSuivant(int startIndex)
|
private java.lang.String |
nextLine()
Récupère la prochaine ligne à afficher |
protected void |
paint(javax.microedition.lcdui.Graphics arg0)
|
Methods inherited from class javax.microedition.lcdui.Canvas |
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setCommandListener, setFullScreenMode, showNotify, sizeChanged |
Methods inherited from class javax.microedition.lcdui.Displayable |
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setTicker, setTitle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
policeTexte
private javax.microedition.lcdui.Font policeTexte
texte
private java.lang.String texte
longeurTexte
private int longeurTexte
largeurAffichageTexte
private int largeurAffichageTexte
positionCurseur
private int positionCurseur
positionDepartTexte
private int positionDepartTexte
compteurLignes
private int compteurLignes
AfficherTexteLong
public AfficherTexteLong()
- Constructeur sans paramètre
afficher
public void afficher(Stratego stratego,
javax.microedition.lcdui.Graphics g,
java.lang.String txt,
int x,
int y,
int width,
javax.microedition.lcdui.Font font,
int couleur,
int alignment,
int depart)
- Affiche le texte en fonction de la taille de l'écran
- Parameters:
stratego
- : instance de Stratégog
- élements Graphicstxt
- le texte à afficherx
- coordonnées en abscissesy
- coordonnées en ordonnéeswidth
- largeur de l'écranfont
- police de caractèrecouleur
- couleur de la policealignment
- alignement du textedepart
- ligne de départ.
aPlusDeLignes
private boolean aPlusDeLignes()
- Vérifie s'il y a encore des lignes à afficher
nextLine
private java.lang.String nextLine()
- Récupère la prochaine ligne à afficher
- Returns:
- la chaine à afficher
caractereSuivant
private int caractereSuivant()
- Retourne la position du curseur du caractere suivant
- Returns:
- position du curseur
getMotSuivant
private int getMotSuivant(int startIndex)
- Parameters:
startIndex
- position de depart du curseur
- Returns:
- une nouvelle ligne
paint
protected void paint(javax.microedition.lcdui.Graphics arg0)
- Specified by:
paint
in class javax.microedition.lcdui.Canvas
getCompteurLignes
public int getCompteurLignes()