argutia.gui
Class Representation

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
                  extended by javax.swing.JTextField
                      extended by argutia.gui.Representation
All Implemented Interfaces:
AffichableAvecStyle, ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
public class Representation
extends JTextField
implements AffichableAvecStyle

Une représentation est la représentation textuelle d'une unité syntaxique configurable. Cela comprend :

Author:
Geoffroy AUBRY
See Also:
ConfigurableSyntacticUnit, Serialized Form
Implementation Notes:
Le fait d'avoir scindé en deux classes unité syntaxique configurable et sa représentation textuelle permet de séparer les attributs non modifiables des autres. Ainsi les instances de type ConfigurableSyntacticUnit sont candidates au statut d'objets immuables, ce qui n'est pas le cas de celles de la classe Representation.
Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTextField
JTextField.AccessibleJTextField
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
JTextComponent.AccessibleJTextComponent, JTextComponent.KeyBinding
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
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
static int COLUMNS
          The number of columns to use to calculate the preferred width.
private String denomination
          Nom de l'unité syntaxique configurable.
private String enhanced
           
private String oldOrthographe
          Ancienne syntaxe de l'unité syntaxique configurable.
private String orthographe
          Orthographe de l'unité syntaxique configurable.
private static long serialVersionUID
          The serial version of this class.
private String spellingInFile
          Orthographe de l'unité syntaxique configurable au sein des fichiers d'exemples.
private ConfigurableSyntacticUnit uniteSyntaxiqueConfigurable
          Unité syntaxique configurable représentée par cette instance.
 
Fields inherited from class javax.swing.JTextField
notifyAction
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Representation(ConfigurableSyntacticUnit uniteSyntaxiqueConfigurable, String orthographe)
          Crée la représentation textuelle d'une unité syntaxique configurable.
 
Method Summary
 boolean equals(Object o)
           
 String getDenomination()
          Retourne la dénomination, l'intitulé de l'unité syntaxique configurable associée à la représentation.
 String getOldOrthographe()
          Retourne l'ancienne orthographe de l'unité syntaxique configurable associée à la représentation.
 String getOrthographe()
          Retourne l'orthographe de l'unité syntaxique configurable associée à la représentation.
 String getSpellingInFile()
          Retourne la dénomination au sein des fichiers d'exemples de l'unité syntaxique configurable associée à la représentation.
 ConfigurableSyntacticUnit getUniteSyntaxique()
          Retourne l'unité syntaxique configurable associée à la représentation.
 int hashCode()
           
 void ouvertureDeFichier()
          Prépare l'unité syntaxique configurable associée à la représentation lors de l'ouverture d'un fichier pour effectuer la liaison entre son orthographe dans le fichier et celle dans l'application.
 boolean setOrthographe(String newOrthographe)
          Met à jour à l'aide du paramètre newOrthographe l'orthographe de l'unité syntaxique configurable associée à la représentation.
 String toString()
          Retourne l'orthographe de l'instance.
 void toStyledString(BatchStyledDocument doc)
          Ajoute du style au résultat d'un appel à toString() et l'ajoute au BatchedContent passé en paramètre.
 
Methods inherited from class javax.swing.JTextField
addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffset
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Field Detail

serialVersionUID

private static final long serialVersionUID
The serial version of this class.

See Also:
Serializable, Constant Field Values
Constant Field Value:
-1873116156721554427L

COLUMNS

public static final int COLUMNS
The number of columns to use to calculate the preferred width. If columns is set to zero, the preferred width will be whatever naturally results from the component implementation.

See Also:
JTextField.JTextField(int), Constant Field Values
Constant Field Value:
5

uniteSyntaxiqueConfigurable

private final ConfigurableSyntacticUnit uniteSyntaxiqueConfigurable
Unité syntaxique configurable représentée par cette instance.

denomination

private final String denomination
Nom de l'unité syntaxique configurable.

Implementation Notes:
Utilisé pour l'onglet configuration.

orthographe

private String orthographe
Orthographe de l'unité syntaxique configurable. C'est par son biais qu'on le manipule lorsque l'on écrit ou affiche une formule logique.

oldOrthographe

private String oldOrthographe
Ancienne syntaxe de l'unité syntaxique configurable.

Implementation Notes:
La mémoriser permet de mettre à jour les formules saisies.

spellingInFile

private final String spellingInFile
Orthographe de l'unité syntaxique configurable au sein des fichiers d'exemples.

enhanced

private final String enhanced
Constructor Detail

Representation

public Representation(ConfigurableSyntacticUnit uniteSyntaxiqueConfigurable,
                      String orthographe)
Crée la représentation textuelle d'une unité syntaxique configurable.

Parameters:
uniteSyntaxiqueConfigurable - unité syntaxique configurable pour laquelle on crée cette représentation.
denomination - dénomination, intitulé de l'unité syntaxique configurable associée.
orthographe - orthographe de l'unité syntaxique configurable associée.
spellingInFile - dénomination au sein des fichiers d'exemples de l'unité syntaxique configurable associée.
Method Detail

getUniteSyntaxique

public ConfigurableSyntacticUnit getUniteSyntaxique()
Retourne l'unité syntaxique configurable associée à la représentation.

Returns:
l'unité syntaxique configurable associée à la représentation.

getDenomination

public String getDenomination()
Retourne la dénomination, l'intitulé de l'unité syntaxique configurable associée à la représentation.

Returns:
la dénomination de l'unité syntaxique configurable associée.

getOrthographe

public String getOrthographe()
Retourne l'orthographe de l'unité syntaxique configurable associée à la représentation.

Returns:
l'orthographe de l'unité syntaxique configurable associée.

setOrthographe

public boolean setOrthographe(String newOrthographe)
Met à jour à l'aide du paramètre newOrthographe l'orthographe de l'unité syntaxique configurable associée à la représentation. Retourne true s'il s'agit effectivement d'une nouvelle orthographe.

Parameters:
newOrthographe - nouvelle orthographe de l'unité syntaxique configurable associée.
Returns:
true si et seulement si :
getOrthographe().equals(newOrthographe) == false

getOldOrthographe

public String getOldOrthographe()
Retourne l'ancienne orthographe de l'unité syntaxique configurable associée à la représentation. Plus précisément, retourne l'orthographe précédant le dernier appel à setOrthographe(String).

Returns:
l'ancienne orthographe de l'unité syntaxique configurable associée.

getSpellingInFile

public String getSpellingInFile()
Retourne la dénomination au sein des fichiers d'exemples de l'unité syntaxique configurable associée à la représentation.

Returns:
la dénomination au sein des fichiers d'exemples de l'unité syntaxique configurable associée.

ouvertureDeFichier

public void ouvertureDeFichier()
Prépare l'unité syntaxique configurable associée à la représentation lors de l'ouverture d'un fichier pour effectuer la liaison entre son orthographe dans le fichier et celle dans l'application.

See Also:
Files.load(java.io.File), Representations#ouvertureDeFichier()
Implementation Notes:
Réalisé en effectuant :
oldOrthographe = spellingInFile;

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Retourne l'orthographe de l'instance.

Overrides:
toString in class Component
Returns:
l'orthographe de l'instance.

toStyledString

public void toStyledString(BatchStyledDocument doc)
Ajoute du style au résultat d'un appel à toString() et l'ajoute au BatchedContent passé en paramètre.

Specified by:
toStyledString in interface AffichableAvecStyle
See Also:
MyStyles
Parameters:
content - BatchedContent auquel on veut ajouter du texte mis en forme.
Argutia JavaDoc
23 décembre 2007