|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectui.listener.PerkinsNotifier
public class PerkinsNotifier
This class is a Perkins input observer It notifies registered objects and send them the converted char
Field Summary | |
---|---|
static int |
FILE_NOT_VALID
Braille table file not valid code |
private java.util.ArrayList<PerkinsObserver> |
jcPerkinsObserver
Abonnés à la saisie Perkins MUST extends JComponent Perkins Observers |
protected int |
nbTouches
nombre de touches pressées lors d'une saisie perkins |
protected java.util.HashMap<java.lang.String,java.lang.String> |
ptPerkins
HashTable pour la correspondance entre les caractères braille saisis en mode perkins et leur représentation dans la table braille |
protected int |
res
Code du caractère produit par la saisie Perkins Perkins char code result |
protected java.lang.String |
tableBraille
table braille à utiliser pour la saisie perkins |
protected boolean[] |
tabPoint
tableau destiné à recevoir les codes perkins |
Constructor Summary | |
---|---|
PerkinsNotifier()
Default constructor The braille table is the |
|
PerkinsNotifier(java.lang.String bt)
Constructor that sets up tableBraille by calling setTableBraille(String) |
Method Summary | |
---|---|
void |
addAll(java.util.ArrayList<PerkinsObserver> l)
Adds all PerkinsObserver in jcPerkinsObserver
and restore the input map of each component |
boolean |
addPerkinsObserver(PerkinsObserver po)
Adds a PerkinsObserver to jcPerkinsObserver
po MUST implements PerkinsObserver and MUST be a child of JComponent |
private java.lang.String |
convertitPoint2Int(java.lang.String s)
Outil de conversion des entités 123456 par la notation "binaire" |
java.util.HashMap<java.lang.String,java.lang.String> |
getPtPerkins()
|
protected boolean |
initialiseMap()
Initialise la HashMap d'équivalence entre les entités de la forme &pt123456; et leur valeur en binaire. |
boolean |
initialiseMap(java.lang.String fichierTable,
java.util.HashMap<java.lang.String,java.lang.String> table)
Initialise une HashMap d'équivalence entre les entités de la forme &pt123456; et leur valeur en binaire |
void |
keyPressed(java.awt.event.KeyEvent e)
Méthode redéfinie de KeyListener Gère la navigation L'affichage est réalisé dans la méthode keyReleased |
void |
keyReleased(java.awt.event.KeyEvent e)
Méthode redéfinie de KeyListener Gère la saisie en mode Perkins Réalise l'affichage du caractère braille dans le JTextPane resultat |
void |
keyTyped(java.awt.event.KeyEvent e)
Méthode redéfinie de KeyListener ne fait rien |
void |
removeAllPerkinsObserver()
Removes all PerkinsObserver in jcPerkinsObserver
and restore the input map of each component |
boolean |
removePerkinsObserver(PerkinsObserver po)
Removes a PerkinsObserver to jcPerkinsObserver |
private void |
restoreMap(javax.swing.JComponent jc)
rétablissement de l'action par défaut associée aux touches de la saisie perkins |
private void |
sendError(int errorCode,
java.lang.String message)
Notifies listener that an error occured |
private void |
setPerkinsMap(javax.swing.JComponent jc)
Sets the Perkins Input Map for the component jc |
void |
setTableBraille(java.lang.String tb)
Méthode d'accès, indique le nom de la table braille à utiliser Modifie ensuite la map ptPerkins |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FILE_NOT_VALID
protected boolean[] tabPoint
protected int nbTouches
protected java.lang.String tableBraille
protected java.util.HashMap<java.lang.String,java.lang.String> ptPerkins
protected int res
private java.util.ArrayList<PerkinsObserver> jcPerkinsObserver
Constructor Detail |
---|
public PerkinsNotifier()
public PerkinsNotifier(java.lang.String bt) throws java.lang.NumberFormatException, java.io.IOException
tableBraille
by calling setTableBraille(String)
bt
- the braille table to be used
java.io.IOException
- problème d'entrée sortie avec le fichier table braille
java.lang.NumberFormatException
- problème de conversion des données du fichier table brailleMethod Detail |
---|
public boolean addPerkinsObserver(PerkinsObserver po)
jcPerkinsObserver
po MUST implements PerkinsObserver and MUST be a child of JComponent
po
- the PerkinsObserver to be added
public void addAll(java.util.ArrayList<PerkinsObserver> l)
jcPerkinsObserver
and restore the input map of each component
l
- the PerkinsObserver listpublic boolean removePerkinsObserver(PerkinsObserver po)
jcPerkinsObserver
po
- the PerkinsObserver to be removed
public void removeAllPerkinsObserver()
jcPerkinsObserver
and restore the input map of each component
private void setPerkinsMap(javax.swing.JComponent jc)
jc
- the component to be setprivate void restoreMap(javax.swing.JComponent jc)
jc
- the JComponent to be restoredpublic void setTableBraille(java.lang.String tb) throws java.lang.NumberFormatException, java.io.IOException
ptPerkins
tb
- valeur pour tableBraille
java.io.IOException
- problème d'entrée sortie avec le fichier table braille
java.lang.NumberFormatException
- problème de conversion des données du fichier table brailleprotected boolean initialiseMap() throws java.lang.NumberFormatException, java.io.IOException
initialiseMap(String, HashMap)
avec comme paramètre tableBraille
pour
la table braille et ptPerkins
pour la Hashtable
java.io.IOException
- problème d'entrée sortie avec le fichier table braille
java.lang.NumberFormatException
- problème de conversion des données du fichier table braillepublic boolean initialiseMap(java.lang.String fichierTable, java.util.HashMap<java.lang.String,java.lang.String> table) throws java.io.IOException, java.lang.NumberFormatException
fichierTable
- adresse de la table braille à utilisertable
- la Hashtable cible
java.io.IOException
- problème d'entrée sortie avec le fichier table braille
java.lang.NumberFormatException
- problème de conversion des données du fichier table braille
java.lang.NumberFormatException
- problème lors de la conversion des entités, la table ne doit pas être valideprivate void sendError(int errorCode, java.lang.String message)
errorCode
- the error code (should be a constant of this class)message
- the error messageprivate java.lang.String convertitPoint2Int(java.lang.String s)
s
- La chaine d'origine sous forme 123456
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
e
- L'objet KeyEvent interceptépublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
e
- L'objet KeyEvent interceptépublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
e
- Le KeyEventpublic java.util.HashMap<java.lang.String,java.lang.String> getPtPerkins()
ptPerkins
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |