ui.accessibility
Class DialogueAccess

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by ui.accessibility.DialogueAccess
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CaretListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class DialogueAccess
extends javax.swing.JFrame
implements java.awt.event.WindowListener, java.awt.event.ActionListener, javax.swing.event.CaretListener, java.awt.event.KeyListener

Author:
gregoire
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.lang.String fileName
          file name
private  java.lang.Boolean fullTranslation
          full translation
private  javax.swing.JButton jbAddShortcut
          save translation button
private  javax.swing.JButton jbCancel
          cancel button
private  javax.swing.JButton jbDelShortcut
          save translation button
private  javax.swing.JButton jbLoad
          load file button
private  javax.swing.JButton jbSave
          save translation button
private  javax.swing.JButton[] jbShortcuts
          shortcuts
private  javax.swing.JButton jbTranslation
          new translation button
private  javax.swing.JLabel jlLanguage
          language label
private  javax.swing.JLabel jlScreenReader
          screen reader label
private  javax.swing.JLabel jlVerbosity
          verbosity label
private  javax.swing.JTextField jtfLanguage
          language text field
private  javax.swing.JTextField jtfScreenReader
          screen reader text field
private  javax.swing.JTextField jtfVerbosity
          verbosity text field
private  int[] keyCodes
          key codes
private  int[] keyModifiers
          key modifiers
private  java.lang.String[] keys
          keys
private  javax.swing.JLabel[] labels
          jlabels
private  java.lang.String[] locale
          locale (language, verbosity, screen reader)
private  int num
          length
private static long serialVersionUID
          pour la sérialisation (non utilisé)
private  java.lang.Boolean[] shortcutButtonPressed
          true when button's pressed
private  javax.swing.JTextField[] textFields
          textfields
(package private) static Language texts
          Textual contents
private  java.lang.String[] unmodifiedTexts
          initial texts
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DialogueAccess(java.lang.String[] labelList, java.lang.String[] keyList, java.lang.String language, java.lang.String verbosity, java.lang.String screenreader, java.lang.String file, java.lang.Boolean ft)
          Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          buttons action
private  void addShortcut()
          add shortcut
 void caretUpdate(javax.swing.event.CaretEvent ae)
           
private  java.lang.Boolean checkFile()
           
private  java.lang.Boolean checkLocale()
           
private  void checkShortcuts(int j)
          check shortcuts to prevent 2 buttons to have the same shortcut
private  java.lang.Boolean confirm(java.lang.String s)
          opens a confirmation dialog
private  void createDialog()
          creates dialog
private  void delShortcut()
          removes last shortcut
private  void enableComponents(java.lang.Boolean b)
          pas vraiment propre
private  java.lang.String getBasicPath()
           
private  java.lang.String getPath()
           
private  java.lang.String getShortcutPath()
           
private  boolean isModified()
           
 void keyPressed(java.awt.event.KeyEvent ke)
           
 void keyReleased(java.awt.event.KeyEvent ke)
           
 void keyTyped(java.awt.event.KeyEvent arg0)
           
private  java.lang.Boolean knownLanguage(java.lang.String s)
           
private  java.lang.Boolean knownScreenReader(java.lang.String s)
           
private  java.lang.Boolean knownVerbosity(java.lang.String s)
           
private  void load()
          load
private  void loadShortcuts()
          load shortcuts
private  void loadTranslation()
          create whole file, with layout
private  void printShortcuts()
          prints the shortcuts in textfields
private  void save(java.lang.String path, javax.swing.JTextField[] tfs, javax.swing.JLabel[] labels2, java.lang.String[] keys2)
          saves
private  void setShortcutDisplay(int j)
          displays the shortcut
 void windowActivated(java.awt.event.WindowEvent arg0)
           
 void windowClosed(java.awt.event.WindowEvent arg0)
           
 void windowClosing(java.awt.event.WindowEvent arg0)
           
 void windowDeactivated(java.awt.event.WindowEvent arg0)
           
 void windowDeiconified(java.awt.event.WindowEvent arg0)
           
 void windowIconified(java.awt.event.WindowEvent arg0)
           
 void windowOpened(java.awt.event.WindowEvent arg0)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

texts

static Language texts
Textual contents


serialVersionUID

private static final long serialVersionUID
pour la sérialisation (non utilisé)

See Also:
Constant Field Values

fullTranslation

private java.lang.Boolean fullTranslation
full translation


jbSave

private javax.swing.JButton jbSave
save translation button


jbAddShortcut

private javax.swing.JButton jbAddShortcut
save translation button


jbDelShortcut

private javax.swing.JButton jbDelShortcut
save translation button


jbCancel

private javax.swing.JButton jbCancel
cancel button


jbLoad

private javax.swing.JButton jbLoad
load file button


jbTranslation

private javax.swing.JButton jbTranslation
new translation button


labels

private javax.swing.JLabel[] labels
jlabels


textFields

private javax.swing.JTextField[] textFields
textfields


num

private int num
length


unmodifiedTexts

private java.lang.String[] unmodifiedTexts
initial texts


keys

private java.lang.String[] keys
keys


jtfLanguage

private javax.swing.JTextField jtfLanguage
language text field


jlLanguage

private javax.swing.JLabel jlLanguage
language label


jtfVerbosity

private javax.swing.JTextField jtfVerbosity
verbosity text field


jlVerbosity

private javax.swing.JLabel jlVerbosity
verbosity label


jtfScreenReader

private javax.swing.JTextField jtfScreenReader
screen reader text field


jlScreenReader

private javax.swing.JLabel jlScreenReader
screen reader label


fileName

private java.lang.String fileName
file name


locale

private java.lang.String[] locale
locale (language, verbosity, screen reader)


jbShortcuts

private javax.swing.JButton[] jbShortcuts
shortcuts


shortcutButtonPressed

private java.lang.Boolean[] shortcutButtonPressed
true when button's pressed


keyCodes

private int[] keyCodes
key codes


keyModifiers

private int[] keyModifiers
key modifiers

Constructor Detail

DialogueAccess

public DialogueAccess(java.lang.String[] labelList,
                      java.lang.String[] keyList,
                      java.lang.String language,
                      java.lang.String verbosity,
                      java.lang.String screenreader,
                      java.lang.String file,
                      java.lang.Boolean ft)
Constructor

Parameters:
labelList - labels
keyList - keys
language - lang
verbosity - verbosity
screenreader - screen reader
file - file name
ft - : true if full translation.
Method Detail

createDialog

private void createDialog()
creates dialog


windowActivated

public void windowActivated(java.awt.event.WindowEvent arg0)
Specified by:
windowActivated in interface java.awt.event.WindowListener
See Also:
WindowListener.windowActivated(java.awt.event.WindowEvent)

windowClosed

public void windowClosed(java.awt.event.WindowEvent arg0)
Specified by:
windowClosed in interface java.awt.event.WindowListener
See Also:
WindowListener.windowClosed(java.awt.event.WindowEvent)

windowClosing

public void windowClosing(java.awt.event.WindowEvent arg0)
Specified by:
windowClosing in interface java.awt.event.WindowListener
See Also:
WindowListener.windowClosing(java.awt.event.WindowEvent)

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent arg0)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener
See Also:
WindowListener.windowDeactivated(java.awt.event.WindowEvent)

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent arg0)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener
See Also:
WindowListener.windowDeiconified(java.awt.event.WindowEvent)

windowIconified

public void windowIconified(java.awt.event.WindowEvent arg0)
Specified by:
windowIconified in interface java.awt.event.WindowListener
See Also:
WindowListener.windowIconified(java.awt.event.WindowEvent)

windowOpened

public void windowOpened(java.awt.event.WindowEvent arg0)
Specified by:
windowOpened in interface java.awt.event.WindowListener
See Also:
WindowListener.windowOpened(java.awt.event.WindowEvent)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
buttons action

Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

isModified

private boolean isModified()
Returns:
true if modified

checkLocale

private java.lang.Boolean checkLocale()
Returns:
true if user

getShortcutPath

private java.lang.String getShortcutPath()
Returns:
shortcut path (folder/name.properties)

getBasicPath

private java.lang.String getBasicPath()
Returns:
basic path (folder/lang/name_lang.properties)

getPath

private java.lang.String getPath()
Returns:
path to the file

checkFile

private java.lang.Boolean checkFile()
Returns:
true if file exists

loadTranslation

private void loadTranslation()
create whole file, with layout


save

private void save(java.lang.String path,
                  javax.swing.JTextField[] tfs,
                  javax.swing.JLabel[] labels2,
                  java.lang.String[] keys2)
saves

Parameters:
path - : path to the bundle
tfs - textfields to save
labels2 - labels
keys2 - keys

load

private void load()
load


loadShortcuts

private void loadShortcuts()
load shortcuts


printShortcuts

private void printShortcuts()
prints the shortcuts in textfields


setShortcutDisplay

private void setShortcutDisplay(int j)
displays the shortcut

Parameters:
j - : number

caretUpdate

public void caretUpdate(javax.swing.event.CaretEvent ae)
Specified by:
caretUpdate in interface javax.swing.event.CaretListener
See Also:
CaretListener.caretUpdate(javax.swing.event.CaretEvent)

knownVerbosity

private java.lang.Boolean knownVerbosity(java.lang.String s)
Parameters:
s - TODO
Returns:
true if verbosity is known

knownLanguage

private java.lang.Boolean knownLanguage(java.lang.String s)
Parameters:
s - TODO
Returns:
true if language is known

knownScreenReader

private java.lang.Boolean knownScreenReader(java.lang.String s)
Parameters:
s - TODO
Returns:
true if screen reader is known

keyReleased

public void keyReleased(java.awt.event.KeyEvent ke)
Specified by:
keyReleased in interface java.awt.event.KeyListener
See Also:
KeyListener.keyReleased(java.awt.event.KeyEvent)

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Specified by:
keyPressed in interface java.awt.event.KeyListener
See Also:
KeyListener.keyPressed(java.awt.event.KeyEvent)

keyTyped

public void keyTyped(java.awt.event.KeyEvent arg0)
Specified by:
keyTyped in interface java.awt.event.KeyListener
See Also:
KeyListener.keyTyped(java.awt.event.KeyEvent)

confirm

private java.lang.Boolean confirm(java.lang.String s)
opens a confirmation dialog

Parameters:
s - : key of the message
Returns:
boolean : answer (true=yes)

checkShortcuts

private void checkShortcuts(int j)
check shortcuts to prevent 2 buttons to have the same shortcut

Parameters:
j - TODO

addShortcut

private void addShortcut()
add shortcut


delShortcut

private void delShortcut()
removes last shortcut


enableComponents

private void enableComponents(java.lang.Boolean b)
pas vraiment propre

Parameters:
b - : true to enable, false to disable