## Class UmlDiagram

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - javax.swing.JComponent
      - - javax.swing.JPanel
        - - Composition
          - - UmlDiagram

All Implemented Interfaces:
  java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

    public class UmlDiagram
    extends Composition

Cette classe permet d'afficher les éléments UML du projet.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class javax.swing.JPanel

`javax.swing.JPanel.AccessibleJPanel`

### Nested classes/interfaces inherited from class javax.swing.JComponent

`javax.swing.JComponent.AccessibleJComponent`

### 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

### Fields inherited from class Composition

`_compositionId, _name, _toolbar, _type, _window, UML_DIAGRAM`

### Fields inherited from class javax.swing.JComponent

`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

`accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

### Fields inherited from interface java.awt.image.ImageObserver

`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

### Constructor Summary

Constructors
Constructor and Description
`UmlDiagram(Project project)` Constructeur - Crée un nouveau diagramme UML à partir d'un projet.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addClass(Class c)` Ajoute une classe au projet.
`void` `addLink(Link l)` Ajoute un lien au projet.
`void` `clearClasses()` Supprime toutes les classes du projet.
`void` `clearLinks()` Supprime tous les liens du projet.
`void` `editClass(Class a)` Modifie les propriétés de la classe.
`java.util.List<Class>` `getClasses()` Récupère toutes les classes du projet.
`java.util.List<Link>` `getLinks()` Récupère tous les liens du projet.
`Class` `getMainClass()` Retourne la classe principale du diagramme.
`java.lang.Object` `getSelected()` Récupère l'élément sélectionné dans la grille.
`UmlToolbar` `getToolbar()` Récupère la toolbar du diagramme.
`void` `mouseClicked(java.awt.event.MouseEvent e)` Action du clic de la souris sur le diagramme.
`void` `mouseDragged(java.awt.event.MouseEvent e)` Déplacer un élément en cliquant et déplaçant la souris.
`void` `mouseEntered(java.awt.event.MouseEvent e)`
`void` `mouseExited(java.awt.event.MouseEvent e)`
`void` `mouseMoved(java.awt.event.MouseEvent e)` La souris bouge dans la grille.
`void` `mousePressed(java.awt.event.MouseEvent e)` Bouton de la souris pressé sur la grille.
`void` `mouseReleased(java.awt.event.MouseEvent e)`
`void` `paintComponent(java.awt.Graphics g)` Dessine les classes et les liens UML.
`void` `removeClass(Class c)` Retire une classe du projet.
`void` `removeLink(int index)` Retire un lien du projet.
`void` `removeLink(Link l)` Retire un lien du projet.
`void` `select(int getX, int getY)` Récupération de l'objet cliqué
`void` `setMainClass(Class a)` Paramétre la classe principale du diagramme.

### Methods inherited from class Composition

`getProject, getScrollPanel, getType, setWindow`

### Methods inherited from class javax.swing.JPanel

`getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI`

### 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, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, 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, 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, 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, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### UmlDiagram

    public UmlDiagram(Project project)

Constructeur - Crée un nouveau diagramme UML à partir d'un projet.

Parameters:
  `project` - Le projet contenant ce diagramme UML.

### Method Detail

#### paintComponent

    public void paintComponent(java.awt.Graphics g)

Dessine les classes et les liens UML.

Overrides:
  `paintComponent` in class `javax.swing.JComponent`
Parameters:
  `g` - L'objet graphique

#### getMainClass

    public Class getMainClass()

Retourne la classe principale du diagramme.

Returns:
  La classe principale du diagramme.

#### setMainClass

    public void setMainClass(Class a)

Paramétre la classe principale du diagramme.

Parameters:
  `a` - La nouvelle classe principale du diagramme.

#### getToolbar

    public UmlToolbar getToolbar()

Récupère la toolbar du diagramme.

Overrides:
  `getToolbar` in class `Composition`
Returns:
  La toolbar du diagramme.

#### getClasses

    public java.util.List<Class> getClasses()

Récupère toutes les classes du projet.

Returns:
  Les classes du projet.

#### addClass

    public void addClass(Class c)

Ajoute une classe au projet.

Parameters:
  `c` - La classe à ajouter.

#### removeClass

    public void removeClass(Class c)

Retire une classe du projet.

Parameters:
  `c` - La classe à retirer.

#### clearClasses

    public void clearClasses()

Supprime toutes les classes du projet.

#### getLinks

    public java.util.List<Link> getLinks()

Récupère tous les liens du projet.

Returns:
  Les liens du projet.

#### addLink

    public void addLink(Link l)

Ajoute un lien au projet.

Parameters:
  `l` - Le lien à ajouter.

#### removeLink

    public void removeLink(Link l)

Retire un lien du projet.

Parameters:
  `l` - Le lien à retirer.

#### removeLink

    public void removeLink(int index)

Retire un lien du projet.

Parameters:
  `index` - L'index du lien à retirer.

#### clearLinks

    public void clearLinks()

Supprime tous les liens du projet.

#### getSelected

    public java.lang.Object getSelected()

Récupère l'élément sélectionné dans la grille.

Returns:
  L'élément sélectionné dan sla grille.

#### select

    public void select(int getX,
                       int getY)

Récupération de l'objet cliqué

Parameters:
  `getX` - Les coordonnées de la souris sur l'axe X.
  `getY` - Les coordonnées de la souris sur l'axe Y.

#### editClass

    public void editClass(Class a)

Modifie les propriétés de la classe.

Parameters:
  `a` - La classe a modifier.

#### mouseClicked

    public void mouseClicked(java.awt.event.MouseEvent e)

Action du clic de la souris sur le diagramme.

Specified by:
  `mouseClicked` in interface `java.awt.event.MouseListener`
Overrides:
  `mouseClicked` in class `Composition`
Parameters:
  `e` - L'événement souris.

#### mousePressed

    public void mousePressed(java.awt.event.MouseEvent e)

Bouton de la souris pressé sur la grille. On récupère l'outil sélectionné pour parvenir à l'action.

Specified by:
  `mousePressed` in interface `java.awt.event.MouseListener`
Overrides:
  `mousePressed` in class `Composition`
Parameters:
  `e` - L'événement souris.

#### mouseReleased

    public void mouseReleased(java.awt.event.MouseEvent e)

Specified by:
  `mouseReleased` in interface `java.awt.event.MouseListener`
Overrides:
  `mouseReleased` in class `Composition`

#### mouseEntered

    public void mouseEntered(java.awt.event.MouseEvent e)

Specified by:
  `mouseEntered` in interface `java.awt.event.MouseListener`
Overrides:
  `mouseEntered` in class `Composition`

#### mouseExited

    public void mouseExited(java.awt.event.MouseEvent e)

Specified by:
  `mouseExited` in interface `java.awt.event.MouseListener`
Overrides:
  `mouseExited` in class `Composition`

#### mouseDragged

    public void mouseDragged(java.awt.event.MouseEvent e)

Déplacer un élément en cliquant et déplaçant la souris.

Specified by:
  `mouseDragged` in interface `java.awt.event.MouseMotionListener`
Overrides:
  `mouseDragged` in class `Composition`
Parameters:
  `e` - Evénement souris

#### mouseMoved

    public void mouseMoved(java.awt.event.MouseEvent e)

La souris bouge dans la grille.

Specified by:
  `mouseMoved` in interface `java.awt.event.MouseMotionListener`
Overrides:
  `mouseMoved` in class `Composition`
Parameters:
  `e` - L'événement souris.