fr.lip6.sma.simulacion.app
Class LocalizedWindow

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 fr.lip6.sma.simulacion.app.LocalizedWindow
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
ApplicationChooser, ApplicationConsole, ApplicationWindow, HTTPSetupFrame, ModalWindow

public class LocalizedWindow
extends JFrame

Classe pour une fenêtre dans la langue de l'utilisateur. C'est la classe de base pour presque toutes les fenêtres des applications Simulación.

Version:
$Revision: 3 $
Author:
Paul Guyot
See Also:
"aucun test défini.", Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  LocalizationEngine mLocalizationEngine
          Engine to localize strings.
private  boolean mShown
          Si on est visible.
 
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
LocalizedWindow()
          Constructeur par défaut.
LocalizedWindow(String inConfigPath)
          Constructeur à partir du chemin vers le fichier de configuration.
 
Method Summary
 void addNotify()
          Méthode appelée lorsque la fenêtre est rendue visible.
protected  void centerWindow()
          Méthode pour centrer la fenêtre.
 void doQuit()
          Méthode appelée pour quitter.
private  void init()
          Initialise la fenêtre.
protected  void localizeAbstractButton(AbstractButton inButton)
          Traduit le texte d'un AbstractButton fraîchement initialisé.
protected  void localizeComponent(Component inComponent)
          Traduit un composant fraîchement initialisé.
protected  void localizeCompoundBorder(CompoundBorder inBorder)
          Translate the title of titled borders when they are embedded in border compounds.
 void localizeContainer(Container inContainer)
          Traduit un conteneur fraîchement initialisé.
protected  void localizeFrame(Frame inFrame)
          Traduit le texte d'une Frame fraîchement initialisée.
protected  void localizeJComponent(JComponent inJComponent)
          Traduit le texte de la bulle d'aide d'un composant swing.
protected  void localizeJProgressBar(JProgressBar inPBar)
          Traduit le texte d'une JProgressBar fraîchement initialisé.
protected  void localizeLabel(JLabel inLabel)
          Traduit le texte d'une étiquette JLabel fraîchement initialisée.
protected  void localizeMenuElement(MenuElement inMenuElement)
          Traduit un élément de menu fraîchement initialisé.
 String localizeString(String inKeyString)
          Translate a string.
protected  void localizeTextComponent(JTextComponent inTextComponent)
          Traduit le texte d'un objet inTextComponent fraîchement initialisé.
 void pack()
          Méthode pour redimensionner la fenêtre avec tous les éléments dedans.
protected  void resetDefaultLocale()
          Réinitialise la traduction.
protected  void thisWindowClosing()
          Méthode appelée lorsque la case de fermeture est cliquée.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
finalize, 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, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, paint, 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, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

mLocalizationEngine

private final LocalizationEngine mLocalizationEngine
Engine to localize strings.


mShown

private boolean mShown
Si on est visible.

Constructor Detail

LocalizedWindow

public LocalizedWindow()
Constructeur par défaut.


LocalizedWindow

public LocalizedWindow(String inConfigPath)
Constructeur à partir du chemin vers le fichier de configuration.

Parameters:
inConfigPath - chemin vers le fichier de configuration.
Method Detail

resetDefaultLocale

protected void resetDefaultLocale()
Réinitialise la traduction.


init

private void init()
Initialise la fenêtre.


localizeString

public final String localizeString(String inKeyString)
Translate a string.

Parameters:
inKeyString - string to translate.
Returns:
translated string or the original string if the key doesn't exist.

localizeJComponent

protected final void localizeJComponent(JComponent inJComponent)
Traduit le texte de la bulle d'aide d'un composant swing. Cette méthode récupère le texte original et l'utilise comme clé pour récupérer la traduction. Si aucune traduction n'est disponible, le texte original est utilisé.

Parameters:
inJComponent - composant à traduire

localizeAbstractButton

protected final void localizeAbstractButton(AbstractButton inButton)
Traduit le texte d'un AbstractButton fraîchement initialisé. Cette méthode récupère le texte original et l'utilise comme clé pour récupérer la traduction. Si aucune traduction n'est disponible, le texte original est utilisé.

Parameters:
inButton - objet à traduire

localizeCompoundBorder

protected final void localizeCompoundBorder(CompoundBorder inBorder)
Translate the title of titled borders when they are embedded in border compounds.

Parameters:
inBorder - The compound border to (perhaps) translate.

localizeJProgressBar

protected final void localizeJProgressBar(JProgressBar inPBar)
Traduit le texte d'une JProgressBar fraîchement initialisé. Cette méthode récupère le texte original et l'utilise comme clé pour récupérer la traduction. Si aucune traduction n'est disponible, le texte original est utilisé.

Parameters:
inPBar - objet à traduire

localizeLabel

protected final void localizeLabel(JLabel inLabel)
Traduit le texte d'une étiquette JLabel fraîchement initialisée. Cette méthode fonctionne comme la précédente.

Parameters:
inLabel - objet à traduire

localizeTextComponent

protected final void localizeTextComponent(JTextComponent inTextComponent)
Traduit le texte d'un objet inTextComponent fraîchement initialisé. Cette méthode fonctionne comme la précédente.

Parameters:
inTextComponent - objet à traduire

localizeFrame

protected void localizeFrame(Frame inFrame)
Traduit le texte d'une Frame fraîchement initialisée. Cette méthode fonctionne comme la précédente.

Parameters:
inFrame - objet à traduire

localizeContainer

public void localizeContainer(Container inContainer)
Traduit un conteneur fraîchement initialisé. Cette méthode itère sur tous les éléments du conteneurs et appelle les précédentes pour ces éléments.

Parameters:
inContainer - objet à traduire

localizeMenuElement

protected final void localizeMenuElement(MenuElement inMenuElement)
Traduit un élément de menu fraîchement initialisé. Cette méthode appelle les méthodes précédentes si la classe correspond.

Parameters:
inMenuElement - objet à traduire

localizeComponent

protected final void localizeComponent(Component inComponent)
Traduit un composant fraîchement initialisé. Cette méthode appelle les méthodes précédentes si la classe correspond.

Parameters:
inComponent - objet à traduire

addNotify

public void addNotify()
Méthode appelée lorsque la fenêtre est rendue visible. On déplace tout si le menu est à l'intérieur de l'application.

Overrides:
addNotify in class Frame

thisWindowClosing

protected void thisWindowClosing()
Méthode appelée lorsque la case de fermeture est cliquée. On quitte.


centerWindow

protected final void centerWindow()
Méthode pour centrer la fenêtre.


doQuit

public void doQuit()
Méthode appelée pour quitter. On ferme la fenêtre puis on quitte l'application.


pack

public final void pack()
Méthode pour redimensionner la fenêtre avec tous les éléments dedans. La fenêtre ne peut être agrandie ou rétrécie.

Overrides:
pack in class Window