Résolution #3 Création de liens
This commit is contained in:
@@ -189,7 +189,7 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>AppThinker</h4>
|
||||
<pre>public AppThinker()</pre>
|
||||
<pre>public software.AppThinker()</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -323,7 +323,7 @@ extends javax.swing.JFrame</pre>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>AppThinkerSplashscreen</h4>
|
||||
<pre>public AppThinkerSplashscreen()</pre>
|
||||
<pre>public software.AppThinkerSplashscreen()</pre>
|
||||
<div class="block">Constructeur - Crée la fenêtre de démarrage</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -324,7 +324,7 @@ extends javax.swing.JPanel</pre>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>AppThinkerStatusbar</h4>
|
||||
<pre>public AppThinkerStatusbar()</pre>
|
||||
<pre>public software.AppThinkerStatusbar()</pre>
|
||||
<div class="block">Constructeur de la classe AppThinkerStatusbar</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -390,7 +390,7 @@ extends javax.swing.JFrame</pre>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>AppThinkerWindow</h4>
|
||||
<pre>public AppThinkerWindow()</pre>
|
||||
<pre>public software.AppThinkerWindow()</pre>
|
||||
<div class="block">Constructeur de la classe AppThinkerWindow</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -258,7 +258,7 @@ implements java.io.Serializable</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>Argument</h4>
|
||||
<pre>public Argument()</pre>
|
||||
<pre>public umlUtilities.Argument()</pre>
|
||||
<div class="block">Constructeur - Crée une instance de Argument.</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -268,7 +268,7 @@ implements java.io.Serializable</pre>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>Argument</h4>
|
||||
<pre>public Argument(java.lang.String type,
|
||||
<pre>public umlUtilities.Argument(java.lang.String type,
|
||||
java.lang.String name)</pre>
|
||||
<div class="block">Constructeur - Crée une instance de Argument avec des paramètres donnés.</div>
|
||||
<dl>
|
||||
|
||||
@@ -394,7 +394,7 @@ implements java.io.Serializable</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>Attribute</h4>
|
||||
<pre>public Attribute()</pre>
|
||||
<pre>public umlUtilities.Attribute()</pre>
|
||||
<div class="block">Constructeur - Crée une instance de Attribute.</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -404,7 +404,7 @@ implements java.io.Serializable</pre>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>Attribute</h4>
|
||||
<pre>public Attribute(java.lang.String name,
|
||||
<pre>public umlUtilities.Attribute(java.lang.String name,
|
||||
java.lang.String access,
|
||||
java.lang.String type)</pre>
|
||||
<div class="block">Constructeur - Crée une instance de Attribute avec des paramètres donnés.</div>
|
||||
|
||||
@@ -481,7 +481,7 @@ implements java.io.Serializable</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>Class</h4>
|
||||
<pre>public Class(int posX,
|
||||
<pre>public umlUtilities.Class(int posX,
|
||||
int posY,
|
||||
int shape)</pre>
|
||||
<div class="block">Constructeur - Crée une instance de Class.</div>
|
||||
|
||||
@@ -458,7 +458,7 @@ implements java.io.Serializable</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>Method</h4>
|
||||
<pre>public Method()</pre>
|
||||
<pre>public umlUtilities.Method()</pre>
|
||||
<div class="block">Constructeur - Crée une instance de Method.</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -316,7 +316,7 @@ implements java.io.Serializable</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>Project</h4>
|
||||
<pre>public Project()</pre>
|
||||
<pre>public software.Project()</pre>
|
||||
<div class="block">Constructeur - Crée une instance de Projet.</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -87,15 +87,15 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="blockList">
|
||||
<h2>Class/Interface</h2>
|
||||
<h2>umlUtilities.Class/Interface</h2>
|
||||
<p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p>
|
||||
<ul>
|
||||
<li>Class inheritance diagram</li>
|
||||
<li>Direct Subclasses</li>
|
||||
<li>All Known Subinterfaces</li>
|
||||
<li>All Known Implementing Classes</li>
|
||||
<li>Class/interface declaration</li>
|
||||
<li>Class/interface description</li>
|
||||
<li>umlUtilities.Class/interface declaration</li>
|
||||
<li>umlUtilities.Class/interface description</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Nested Class Summary</li>
|
||||
|
||||
@@ -77,11 +77,11 @@
|
||||
<dd>
|
||||
<div class="block">Ajoute un argument à la méthode sélectionnée et rafraîchit la liste des arguments.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Method.html#addArgument-Argument-">addArgument(Argument)</a></span> - Method in class <a href="../Method.html" title="class in <Unnamed>">Method</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Method.html#addArgument-Argument-">addArgument(umlUtilities.Argument)</a></span> - Method in class <a href="../Method.html" title="class in <Unnamed>">Method</a></dt>
|
||||
<dd>
|
||||
<div class="block">Ajoute un argument à la méthode.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#addAttribute-Attribute-">addAttribute(Attribute)</a></span> - Method in class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#addAttribute-Attribute-">addAttribute(umlUtilities.Attribute)</a></span> - Method in class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dd>
|
||||
<div class="block">Ajoute un attribut à la classe.</div>
|
||||
</dd>
|
||||
@@ -89,21 +89,21 @@
|
||||
<dd>
|
||||
<div class="block">Ajoute un attribut à la classe et rafraîchit la liste des attributs.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#addClass-Class-">addClass(Class)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#addClass-Class-">addClass(umlUtilities.Class)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dd>
|
||||
<div class="block">Ajoute une classe au projet.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerMenuBar.html#addCompositionMenu-Composition-">addCompositionMenu(Composition)</a></span> - Method in class <a href="../AppThinkerMenuBar.html" title="class in <Unnamed>">AppThinkerMenuBar</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerMenuBar.html#addCompositionMenu-Composition-">addCompositionMenu(software.Composition)</a></span> - Method in class <a href="../AppThinkerMenuBar.html" title="class in <Unnamed>">AppThinkerMenuBar</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#addLink-Link-">addLink(Link)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#addLink-Link-">addLink(umlUtilities.Link)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dd>
|
||||
<div class="block">Ajoute un lien au projet.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#addMethod-Method-">addMethod(Method)</a></span> - Method in class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#addMethod-Method-">addMethod(umlUtilities.Method)</a></span> - Method in class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dd>
|
||||
<div class="block">Ajoute une méthode à la classe.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#addMethod-int-Method-">addMethod(int, Method)</a></span> - Method in class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#addMethod-int-Method-">addMethod(int, umlUtilities.Method)</a></span> - Method in class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dd>
|
||||
<div class="block">Ajoute une méthode à la classe.</div>
|
||||
</dd>
|
||||
@@ -111,7 +111,7 @@
|
||||
<dd>
|
||||
<div class="block">Ajoute une méthode à la classe et rafraîchit la liste des méthodes.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../ClassPropertiesWindow.html#addMethod-int-Method-">addMethod(int, Method)</a></span> - Method in class <a href="../ClassPropertiesWindow.html" title="class in <Unnamed>">ClassPropertiesWindow</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../ClassPropertiesWindow.html#addMethod-int-Method-">addMethod(int, umlUtilities.Method)</a></span> - Method in class <a href="../ClassPropertiesWindow.html" title="class in <Unnamed>">ClassPropertiesWindow</a></dt>
|
||||
<dd>
|
||||
<div class="block">Ajoute une méthode à la classe et rafraîchit la liste des méthodes.</div>
|
||||
</dd>
|
||||
@@ -121,13 +121,13 @@
|
||||
<dd>
|
||||
<div class="block">La classe principale du logiciel AppThinker.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinker.html#AppThinker--">AppThinker()</a></span> - Constructor for class <a href="../AppThinker.html" title="class in <Unnamed>">AppThinker</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinker.html#AppThinker--">software.AppThinker()</a></span> - Constructor for class <a href="../AppThinker.html" title="class in <Unnamed>">AppThinker</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><a href="../AppThinkerMenuBar.html" title="class in <Unnamed>"><span class="typeNameLink">AppThinkerMenuBar</span></a> - Class in <a href="../package-summary.html"><Unnamed></a></dt>
|
||||
<dd>
|
||||
<div class="block">Affiche une barre de menu en entête de la fenêtre.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerMenuBar.html#AppThinkerMenuBar-AppThinkerWindow-">AppThinkerMenuBar(AppThinkerWindow)</a></span> - Constructor for class <a href="../AppThinkerMenuBar.html" title="class in <Unnamed>">AppThinkerMenuBar</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerMenuBar.html#AppThinkerMenuBar-AppThinkerWindow-">software.AppThinkerMenuBar(software.AppThinkerWindow)</a></span> - Constructor for class <a href="../AppThinkerMenuBar.html" title="class in <Unnamed>">AppThinkerMenuBar</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur de la classe AppThinkerMenuBar.</div>
|
||||
</dd>
|
||||
@@ -135,7 +135,7 @@
|
||||
<dd>
|
||||
<div class="block">Ecran de démarrage du logiciel</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerSplashscreen.html#AppThinkerSplashscreen--">AppThinkerSplashscreen()</a></span> - Constructor for class <a href="../AppThinkerSplashscreen.html" title="class in <Unnamed>">AppThinkerSplashscreen</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerSplashscreen.html#AppThinkerSplashscreen--">software.AppThinkerSplashscreen()</a></span> - Constructor for class <a href="../AppThinkerSplashscreen.html" title="class in <Unnamed>">AppThinkerSplashscreen</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée la fenêtre de démarrage</div>
|
||||
</dd>
|
||||
@@ -143,7 +143,7 @@
|
||||
<dd>
|
||||
<div class="block">Affiche une barre de statut au pied de la fenêtre</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerStatusbar.html#AppThinkerStatusbar--">AppThinkerStatusbar()</a></span> - Constructor for class <a href="../AppThinkerStatusbar.html" title="class in <Unnamed>">AppThinkerStatusbar</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerStatusbar.html#AppThinkerStatusbar--">software.AppThinkerStatusbar()</a></span> - Constructor for class <a href="../AppThinkerStatusbar.html" title="class in <Unnamed>">AppThinkerStatusbar</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur de la classe AppThinkerStatusbar</div>
|
||||
</dd>
|
||||
@@ -151,7 +151,7 @@
|
||||
<dd>
|
||||
<div class="block">Affiche une fenêtre du logiciel.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerWindow.html#AppThinkerWindow--">AppThinkerWindow()</a></span> - Constructor for class <a href="../AppThinkerWindow.html" title="class in <Unnamed>">AppThinkerWindow</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerWindow.html#AppThinkerWindow--">software.AppThinkerWindow()</a></span> - Constructor for class <a href="../AppThinkerWindow.html" title="class in <Unnamed>">AppThinkerWindow</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur de la classe AppThinkerWindow</div>
|
||||
</dd>
|
||||
@@ -159,11 +159,11 @@
|
||||
<dd>
|
||||
<div class="block">Gère un argument d'une méthode.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Argument.html#Argument--">Argument()</a></span> - Constructor for class <a href="../Argument.html" title="class in <Unnamed>">Argument</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Argument.html#Argument--">umlUtilities.Argument()</a></span> - Constructor for class <a href="../Argument.html" title="class in <Unnamed>">Argument</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Argument.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Argument.html#Argument-java.lang.String-java.lang.String-">Argument(String, String)</a></span> - Constructor for class <a href="../Argument.html" title="class in <Unnamed>">Argument</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Argument.html#Argument-java.lang.String-java.lang.String-">umlUtilities.Argument(String, String)</a></span> - Constructor for class <a href="../Argument.html" title="class in <Unnamed>">Argument</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Argument avec des paramètres donnés.</div>
|
||||
</dd>
|
||||
@@ -171,7 +171,7 @@
|
||||
<dd>
|
||||
<div class="block">Classe permettant la création de fenêtres pour la modification des arguments d'une méthode d'une classe.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../ArgumentsPropertiesWindow.html#ArgumentsPropertiesWindow-ClassPropertiesWindow-UmlDiagram-Method-">ArgumentsPropertiesWindow(ClassPropertiesWindow, UmlDiagram, Method)</a></span> - Constructor for class <a href="../ArgumentsPropertiesWindow.html" title="class in <Unnamed>">ArgumentsPropertiesWindow</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../ArgumentsPropertiesWindow.html#ArgumentsPropertiesWindow-ClassPropertiesWindow-UmlDiagram-Method-">umlUtilities.ArgumentsPropertiesWindow(ClassPropertiesWindow, UmlDiagram, umlUtilities.Method)</a></span> - Constructor for class <a href="../ArgumentsPropertiesWindow.html" title="class in <Unnamed>">ArgumentsPropertiesWindow</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlToolbar.html#ASSOCIATION_TOOL">ASSOCIATION_TOOL</a></span> - Static variable in class <a href="../UmlToolbar.html" title="class in <Unnamed>">UmlToolbar</a></dt>
|
||||
<dd> </dd>
|
||||
@@ -179,11 +179,11 @@
|
||||
<dd>
|
||||
<div class="block">Gère un attribut.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Attribute.html#Attribute--">Attribute()</a></span> - Constructor for class <a href="../Attribute.html" title="class in <Unnamed>">Attribute</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Attribute.html#Attribute--">umlUtilities.Attribute()</a></span> - Constructor for class <a href="../Attribute.html" title="class in <Unnamed>">Attribute</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Attribute.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Attribute.html#Attribute-java.lang.String-java.lang.String-java.lang.String-">Attribute(String, String, String)</a></span> - Constructor for class <a href="../Attribute.html" title="class in <Unnamed>">Attribute</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Attribute.html#Attribute-java.lang.String-java.lang.String-java.lang.String-">umlUtilities.Attribute(String, String, String)</a></span> - Constructor for class <a href="../Attribute.html" title="class in <Unnamed>">Attribute</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Attribute avec des paramètres donnés.</div>
|
||||
</dd>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
</a>
|
||||
<h2 class="title">O</h2>
|
||||
<dl>
|
||||
<dt><span class="memberNameLink"><a href="../ClassPropertiesWindow.html#openArgumentsWindow-Method-">openArgumentsWindow(Method)</a></span> - Method in class <a href="../ClassPropertiesWindow.html" title="class in <Unnamed>">ClassPropertiesWindow</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../ClassPropertiesWindow.html#openArgumentsWindow-Method-">openArgumentsWindow(umlUtilities.Method)</a></span> - Method in class <a href="../ClassPropertiesWindow.html" title="class in <Unnamed>">ClassPropertiesWindow</a></dt>
|
||||
<dd>
|
||||
<div class="block">Ouvre une fenêtre d'édition des arguments pour la méthode sélectionnée</div>
|
||||
</dd>
|
||||
|
||||
@@ -87,11 +87,11 @@
|
||||
<dd>
|
||||
<div class="block">Gère un projet.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Project.html#Project--">Project()</a></span> - Constructor for class <a href="../Project.html" title="class in <Unnamed>">Project</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Project.html#Project--">software.Project()</a></span> - Constructor for class <a href="../Project.html" title="class in <Unnamed>">Project</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Projet.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Project.html#Project-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-Composition-">Project(String, String, String, String, String, Composition)</a></span> - Constructor for class <a href="../Project.html" title="class in <Unnamed>">Project</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Project.html#Project-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-Composition-">software.Project(String, String, String, String, String, software.Composition)</a></span> - Constructor for class <a href="../Project.html" title="class in <Unnamed>">Project</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Projet avec des paramètres déterminés.</div>
|
||||
</dd>
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<dd>
|
||||
<div class="block">Retire un attribut à la classe et rafraîchit la liste des attributs.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#removeClass-Class-">removeClass(Class)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#removeClass-Class-">removeClass(umlUtilities.Class)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dd>
|
||||
<div class="block">Retire une classe du projet.</div>
|
||||
</dd>
|
||||
@@ -103,7 +103,7 @@
|
||||
<dd>
|
||||
<div class="block">Retire le menu de composition</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#removeLink-Link-">removeLink(Link)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#removeLink-Link-">removeLink(umlUtilities.Link)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dd>
|
||||
<div class="block">Retire un lien du projet.</div>
|
||||
</dd>
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
<dd>
|
||||
<div class="block">Verrouille/Déverrouille la barre d'outil.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Link.html#setEnd-Class-">setEnd(Class)</a></span> - Method in class <a href="../Link.html" title="class in <Unnamed>">Link</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Link.html#setEnd-Class-">setEnd(umlUtilities.Class)</a></span> - Method in class <a href="../Link.html" title="class in <Unnamed>">Link</a></dt>
|
||||
<dd>
|
||||
<div class="block">Paramètre la classe d'arrivée.</div>
|
||||
</dd>
|
||||
@@ -155,7 +155,7 @@
|
||||
<dd>
|
||||
<div class="block">Paramètre la caractéristique final de la méthode.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#setMainClass-Class-">setMainClass(Class)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#setMainClass-Class-">setMainClass(umlUtilities.Class)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dd>
|
||||
<div class="block">Paramétre la classe principale du diagramme.</div>
|
||||
</dd>
|
||||
@@ -239,7 +239,7 @@
|
||||
<dd>
|
||||
<div class="block">Paramètre la taille sur l'axe Y de la classe.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Link.html#setStart-Class-">setStart(Class)</a></span> - Method in class <a href="../Link.html" title="class in <Unnamed>">Link</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Link.html#setStart-Class-">setStart(umlUtilities.Class)</a></span> - Method in class <a href="../Link.html" title="class in <Unnamed>">Link</a></dt>
|
||||
<dd>
|
||||
<div class="block">Paramètre la classe de départ du lien.</div>
|
||||
</dd>
|
||||
@@ -299,7 +299,7 @@
|
||||
<dd>
|
||||
<div class="block">Paramètre la caractéristique volatile de la méthode.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Composition.html#setWindow-AppThinkerWindow-">setWindow(AppThinkerWindow)</a></span> - Method in class <a href="../Composition.html" title="class in <Unnamed>">Composition</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Composition.html#setWindow-AppThinkerWindow-">setWindow(software.AppThinkerWindow)</a></span> - Method in class <a href="../Composition.html" title="class in <Unnamed>">Composition</a></dt>
|
||||
<dd>
|
||||
<div class="block">Paramètre la fenêtre enfant de la composition.</div>
|
||||
</dd>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<dd>
|
||||
<div class="block">Cette classe permet d'afficher les éléments UML du projet.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#UmlDiagram-Project-">UmlDiagram(Project)</a></span> - Constructor for class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#UmlDiagram-Project-">umlUtilities.UmlDiagram(Project)</a></span> - Constructor for class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée un nouveau diagramme UML à partir d'un projet.</div>
|
||||
</dd>
|
||||
@@ -87,7 +87,7 @@
|
||||
<dd>
|
||||
<div class="block">Affiche une barre d'actions en haut de la fenêtre.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlToolbar.html#UmlToolbar-UmlDiagram-">UmlToolbar(UmlDiagram)</a></span> - Constructor for class <a href="../UmlToolbar.html" title="class in <Unnamed>">UmlToolbar</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../UmlToolbar.html#UmlToolbar-UmlDiagram-">umlUtilities.UmlToolbar(umlUtilities.UmlDiagram)</a></span> - Constructor for class <a href="../UmlToolbar.html" title="class in <Unnamed>">UmlToolbar</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur de la classe AppThinkerToolbar</div>
|
||||
</dd>
|
||||
|
||||
@@ -85,11 +85,11 @@
|
||||
<dd>
|
||||
<div class="block">Gère une classe du projet.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#Class-int-int-int-">Class(int, int, int)</a></span> - Constructor for class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#Class-int-int-int-">umlUtilities.Class(int, int, int)</a></span> - Constructor for class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Class.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#Class-java.lang.String-int-int-int-int-int-java.util.ArrayList-java.util.ArrayList-">Class(String, int, int, int, int, int, ArrayList<Attribute>, ArrayList<Method>)</a></span> - Constructor for class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Class.html#Class-java.lang.String-int-int-int-int-int-java.util.ArrayList-java.util.ArrayList-">umlUtilities.Class(String, int, int, int, int, int, ArrayList<umlUtilities.Attribute>, ArrayList<umlUtilities.Method>)</a></span> - Constructor for class <a href="../Class.html" title="class in <Unnamed>">Class</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Class avec les paramètres déterminés.</div>
|
||||
</dd>
|
||||
@@ -99,7 +99,7 @@
|
||||
<dd>
|
||||
<div class="block">Classe permettant la création de fenêtres pour la modification des propriétés des classes.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../ClassPropertiesWindow.html#ClassPropertiesWindow-UmlDiagram-Class-">ClassPropertiesWindow(UmlDiagram, Class)</a></span> - Constructor for class <a href="../ClassPropertiesWindow.html" title="class in <Unnamed>">ClassPropertiesWindow</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../ClassPropertiesWindow.html#ClassPropertiesWindow-UmlDiagram-Class-">umlUtilities.ClassPropertiesWindow(UmlDiagram, umlUtilities.Class)</a></span> - Constructor for class <a href="../ClassPropertiesWindow.html" title="class in <Unnamed>">ClassPropertiesWindow</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de la fenêtre de propriétés de classe à partir d'un diagramme et de la classe à modifier.</div>
|
||||
</dd>
|
||||
@@ -135,7 +135,7 @@
|
||||
<dd>
|
||||
<div class="block">Gère une création qui est ajoutée à un projet</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Composition.html#Composition-Project-">Composition(Project)</a></span> - Constructor for class <a href="../Composition.html" title="class in <Unnamed>">Composition</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Composition.html#Composition-Project-">software.Composition(software.Project)</a></span> - Constructor for class <a href="../Composition.html" title="class in <Unnamed>">Composition</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une nouvelle composition.</div>
|
||||
</dd>
|
||||
|
||||
@@ -73,11 +73,11 @@
|
||||
</a>
|
||||
<h2 class="title">D</h2>
|
||||
<dl>
|
||||
<dt><span class="memberNameLink"><a href="../ClassPropertiesWindow.html#defineMainClass-Class-">defineMainClass(Class)</a></span> - Method in class <a href="../ClassPropertiesWindow.html" title="class in <Unnamed>">ClassPropertiesWindow</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../ClassPropertiesWindow.html#defineMainClass-Class-">defineMainClass(umlUtilities.Class)</a></span> - Method in class <a href="../ClassPropertiesWindow.html" title="class in <Unnamed>">ClassPropertiesWindow</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlToolbar.html#DELETE_TOOL">DELETE_TOOL</a></span> - Static variable in class <a href="../UmlToolbar.html" title="class in <Unnamed>">UmlToolbar</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerWindow.html#displayComposition-Composition-">displayComposition(Composition)</a></span> - Method in class <a href="../AppThinkerWindow.html" title="class in <Unnamed>">AppThinkerWindow</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../AppThinkerWindow.html#displayComposition-Composition-">displayComposition(software.Composition)</a></span> - Method in class <a href="../AppThinkerWindow.html" title="class in <Unnamed>">AppThinkerWindow</a></dt>
|
||||
<dd>
|
||||
<div class="block">Affiche une composition au centre de la fenêtre.</div>
|
||||
</dd>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<dl>
|
||||
<dt><span class="memberNameLink"><a href="../UmlToolbar.html#EDIT_TOOL">EDIT_TOOL</a></span> - Static variable in class <a href="../UmlToolbar.html" title="class in <Unnamed>">UmlToolbar</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#editClass-Class-">editClass(Class)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../UmlDiagram.html#editClass-Class-">editClass(umlUtilities.Class)</a></span> - Method in class <a href="../UmlDiagram.html" title="class in <Unnamed>">UmlDiagram</a></dt>
|
||||
<dd>
|
||||
<div class="block">Modifie les propriétés de la classe.</div>
|
||||
</dd>
|
||||
|
||||
@@ -77,11 +77,11 @@
|
||||
<dd>
|
||||
<div class="block">Gère un lien entre deux classes.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Link.html#Link-Class-Class-">Link(Class, Class)</a></span> - Constructor for class <a href="../Link.html" title="class in <Unnamed>">Link</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Link.html#Link-Class-Class-">umlUtilities.Link(Class, umlUtilities.Class)</a></span> - Constructor for class <a href="../Link.html" title="class in <Unnamed>">Link</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance d'une classe.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Link.html#Link-Class-Class-int-int-int-int-int-">Link(Class, Class, int, int, int, int, int)</a></span> - Constructor for class <a href="../Link.html" title="class in <Unnamed>">Link</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Link.html#Link-Class-Class-int-int-int-int-int-">umlUtilities.Link(Class, Class, int, int, int, int, int)</a></span> - Constructor for class <a href="../Link.html" title="class in <Unnamed>">Link</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance d'une classe avec des paramètres déterminés.</div>
|
||||
</dd>
|
||||
|
||||
@@ -81,15 +81,15 @@
|
||||
<dd>
|
||||
<div class="block">Gère une méthode.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Method.html#Method--">Method()</a></span> - Constructor for class <a href="../Method.html" title="class in <Unnamed>">Method</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Method.html#Method--">umlUtilities.Method()</a></span> - Constructor for class <a href="../Method.html" title="class in <Unnamed>">Method</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Method.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Method.html#Method-java.lang.String-java.lang.String-java.lang.String-java.util.ArrayList-">Method(String, String, String, ArrayList<Argument>)</a></span> - Constructor for class <a href="../Method.html" title="class in <Unnamed>">Method</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Method.html#Method-java.lang.String-java.lang.String-java.lang.String-java.util.ArrayList-">umlUtilities.Method(String, String, String, ArrayList<umlUtilities.Argument>)</a></span> - Constructor for class <a href="../Method.html" title="class in <Unnamed>">Method</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Method avec des paramètres donnés.</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="../Method.html#Method-java.lang.String-java.lang.String-java.lang.String-java.util.List-boolean-boolean-boolean-boolean-boolean-boolean-boolean-">Method(String, String, String, List<Argument>, boolean, boolean, boolean, boolean, boolean, boolean, boolean)</a></span> - Constructor for class <a href="../Method.html" title="class in <Unnamed>">Method</a></dt>
|
||||
<dt><span class="memberNameLink"><a href="../Method.html#Method-java.lang.String-java.lang.String-java.lang.String-java.util.List-boolean-boolean-boolean-boolean-boolean-boolean-boolean-">umlUtilities.Method(String, String, String, List<umlUtilities.Argument>, boolean, boolean, boolean, boolean, boolean, boolean, boolean)</a></span> - Constructor for class <a href="../Method.html" title="class in <Unnamed>">Method</a></dt>
|
||||
<dd>
|
||||
<div class="block">Constructeur - Crée une instance de Method avec des paramètres donnés.</div>
|
||||
</dd>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import javafx.scene.control.TextFormatter;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Ecran de démarrage du logiciel
|
||||
@@ -27,6 +25,8 @@ public class AppThinkerSplashscreen extends JFrame {
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
Graphics2D g2 = (Graphics2D) g;
|
||||
RenderingHints rh = new RenderingHints(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
||||
g2.setRenderingHints(rh);
|
||||
Image img = null;
|
||||
try { img = ImageIO.read(AppThinker.class.getResource("img/splashscreen.png")); } catch (Exception ex) { }
|
||||
g2.drawImage(img, 0, 0, 533, 300, this);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import org.w3c.dom.Attr;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -12,8 +10,6 @@ import java.util.List;
|
||||
public class Class implements Serializable {
|
||||
|
||||
public static int _classId = 0;
|
||||
public static final int RECTANGLE = 0;
|
||||
public static final int CIRCLE = 1;
|
||||
|
||||
private int _id;
|
||||
private String _name;
|
||||
@@ -23,7 +19,6 @@ public class Class implements Serializable {
|
||||
private int _sizeY;
|
||||
private int _minSizeX;
|
||||
private int _minSizeY;
|
||||
private int _shape;
|
||||
|
||||
private List<Attribute> _attributes;
|
||||
private List<Method> _methods;
|
||||
@@ -32,9 +27,8 @@ public class Class implements Serializable {
|
||||
* Constructeur - Crée une instance de Class.
|
||||
* @param posX La position sur l'axe X de la nouvelle classe.
|
||||
* @param posY La position sur l'axe Y de la nouvelle classe.
|
||||
* @param shape La forme de la nouvelle classe (Class.RECTANGLE ou Class.CIRCLE)
|
||||
*/
|
||||
public Class(int posX, int posY, int shape){
|
||||
public Class(int posX, int posY){
|
||||
_classId++;
|
||||
this._id = _classId;
|
||||
this._name = "Class" + _id;
|
||||
@@ -42,7 +36,6 @@ public class Class implements Serializable {
|
||||
this._posY = posY;
|
||||
this._sizeX = 90;
|
||||
this._sizeY = 50;
|
||||
this._shape = shape;
|
||||
this._attributes = new ArrayList<Attribute>();
|
||||
this._methods = new ArrayList<Method>();
|
||||
this.computeMinSize();
|
||||
@@ -55,11 +48,10 @@ public class Class implements Serializable {
|
||||
* @param posY La position sur l'axe Y de la classe importée.
|
||||
* @param sizeX La taille sur l'axe X de la classe importée.
|
||||
* @param sizeY La taille sur l'axe Y de la classe importée.
|
||||
* @param shape La forme de la classe importée (Class.RECTANGLE ou Class.CIRCLE).
|
||||
* @param attributes La liste des attributs de la classe importée.
|
||||
* @param methods La liste des méthodes de la classe importée.
|
||||
*/
|
||||
public Class(String name, int posX, int posY, int sizeX, int sizeY, int shape, ArrayList<Attribute> attributes, ArrayList<Method> methods){
|
||||
public Class(String name, int posX, int posY, int sizeX, int sizeY, ArrayList<Attribute> attributes, ArrayList<Method> methods){
|
||||
_classId++;
|
||||
this._id = _classId;
|
||||
this._name = name;
|
||||
@@ -67,7 +59,6 @@ public class Class implements Serializable {
|
||||
this._posY = posY;
|
||||
this._sizeX = sizeX;
|
||||
this._sizeY = sizeY;
|
||||
this._shape = shape;
|
||||
this._attributes = attributes;
|
||||
this._methods = methods;
|
||||
this.computeMinSize();
|
||||
@@ -211,13 +202,13 @@ public class Class implements Serializable {
|
||||
int maxWidth = fm1.stringWidth(this.getName());
|
||||
//Parcours des attributs
|
||||
for(Attribute a : this.getAttributes()){
|
||||
String chain = a.getAccess() + " " + a.getName() + " : " + a.getType();
|
||||
String chain = " " + a.getAccess() + " " + a.getName() + " : " + a.getType();
|
||||
int temp = fm2.stringWidth(chain);
|
||||
if(temp > maxWidth) maxWidth = temp;
|
||||
}
|
||||
//Parcours des méthodes
|
||||
for(Method m : this.getMethods()){
|
||||
String chain = m.getAccess() + " " + m.getName() + "(";
|
||||
String chain = " " + m.getAccess() + " " + m.getName() + "(";
|
||||
ArrayList<String> listArguments = new ArrayList<String>();
|
||||
for(Argument ar : m.getArguments()){
|
||||
listArguments.add(ar.getName() + " : " + ar.getType());
|
||||
@@ -238,22 +229,6 @@ public class Class implements Serializable {
|
||||
if(this.getSizeY() < this.getMinSizeY()) this.setSizeY(this.getMinSizeY());
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère la forme graphique de la classe.
|
||||
* @return La forme graphique de la classe (Class.RECTANGLE ou Class.CIRCLE).
|
||||
*/
|
||||
public int getShape() {
|
||||
return _shape;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paramètre la forme graphique de la classe.
|
||||
* @param shape La forme graphique de la classe (Class.RECTANGLE ou Class.CIRCLE).
|
||||
*/
|
||||
public void setShape(int shape) {
|
||||
this._shape = shape;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère tous les attributs de la classe.
|
||||
* @return Les attributs de la classe.
|
||||
@@ -431,4 +406,34 @@ public class Class implements Serializable {
|
||||
this.setSizeX(this.getSizeX() + shiftX);
|
||||
if(this.getSizeX() > this.getMinSizeX()) this.setPosX(posX - this.getSizeX()/2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'ensemble des positions pour dessiner les points d'accroche.
|
||||
* @return La liste des positions des points d'accroche pour la classe.
|
||||
*/
|
||||
public List<List<Integer>> getGripsPosition(int gripSize){
|
||||
List<List<Integer>> positions = new ArrayList<List<Integer>>();
|
||||
List<Integer> gripPos = new ArrayList<Integer>();
|
||||
int posX = this.getPosX();
|
||||
int posY = this.getPosY();
|
||||
int sizeX = this.getSizeX();
|
||||
int sizeY = this.getSizeY();
|
||||
//Calcul des positions pour le grip N
|
||||
positions.add(Arrays.asList(posX - gripSize / 2, posY - sizeY / 2 - gripSize / 2));
|
||||
//Calcul des positions pour le grip NE
|
||||
positions.add(Arrays.asList(posX + sizeX / 2 - gripSize / 2, posY - sizeY / 2 - gripSize / 2));
|
||||
//Calcul des positions pour le grip E
|
||||
positions.add(Arrays.asList(posX + sizeX / 2 - gripSize / 2, posY - gripSize / 2));
|
||||
//Calcul des positions pour le grip SE
|
||||
positions.add(Arrays.asList(posX + sizeX / 2 - gripSize / 2, posY + sizeY / 2 - gripSize / 2));
|
||||
//Calcul des positions pour le grip S
|
||||
positions.add(Arrays.asList(posX - gripSize / 2, posY + sizeY / 2 - gripSize / 2));
|
||||
//Calcul des positions pour le grip SW
|
||||
positions.add(Arrays.asList(posX - sizeX / 2 - gripSize / 2, posY + sizeY / 2 - gripSize / 2));
|
||||
//Calcul des positions pour le grip W
|
||||
positions.add(Arrays.asList(posX - sizeX / 2 - gripSize / 2, posY - gripSize / 2));
|
||||
//Calcul des positions pour le grip NW
|
||||
positions.add(Arrays.asList(posX - sizeX / 2 - gripSize / 2, posY - sizeY / 2 - gripSize / 2));
|
||||
return positions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableColumn;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,13 +17,19 @@ public class Link implements Serializable{
|
||||
public static final int CARD_ONE = 1;
|
||||
|
||||
private int _id;
|
||||
private int _type;
|
||||
private String _name;
|
||||
|
||||
private Class _start;
|
||||
private int _minCardinalityStart;
|
||||
private int _maxCardinalityStart;
|
||||
private String _gripStart;
|
||||
|
||||
private Class _end;
|
||||
private int _minCardinalityEnd;
|
||||
private int _maxCardinalityEnd;
|
||||
private int _type;
|
||||
private String _gripEnd;
|
||||
|
||||
|
||||
/**
|
||||
* Constructeur - Crée une instance d'une classe.
|
||||
@@ -35,6 +41,7 @@ public class Link implements Serializable{
|
||||
this._id = _linkId;
|
||||
this._start = start;
|
||||
this._end = end;
|
||||
this._name = "relation" + _linkId;
|
||||
this._minCardinalityStart = Link.CARD_NULL;
|
||||
this._maxCardinalityStart = Link.CARD_UNLIMITED;
|
||||
this._minCardinalityEnd = Link.CARD_NULL;
|
||||
@@ -52,16 +59,19 @@ public class Link implements Serializable{
|
||||
* @param maxCardinalityEnd La cardinalité maximum de la classe d'arrivée.
|
||||
* @param type Le type de lien.
|
||||
*/
|
||||
public Link(Class start, Class end, int minCardinalityStart, int maxCardinalityStart, int minCardinalityEnd, int maxCardinalityEnd, int type){
|
||||
public Link(Class start, Class end, String gripStart, String gripEnd, int minCardinalityStart, int maxCardinalityStart, int minCardinalityEnd, int maxCardinalityEnd, int type){
|
||||
_linkId++;
|
||||
this._id = _linkId;
|
||||
this._start = start;
|
||||
this._end = end;
|
||||
this._gripStart = gripStart;
|
||||
this._gripEnd = gripEnd;
|
||||
this._minCardinalityStart = minCardinalityStart;
|
||||
this._maxCardinalityStart = maxCardinalityStart;
|
||||
this._minCardinalityEnd = minCardinalityEnd;
|
||||
this._maxCardinalityEnd = maxCardinalityEnd;
|
||||
this._type = type;
|
||||
this._name = "relation" + _linkId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,22 +98,6 @@ public class Link implements Serializable{
|
||||
this._start = start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère la classe d'arrivée du lien.
|
||||
* @return La classe d'arrivée du lien.
|
||||
*/
|
||||
public Class getEnd() {
|
||||
return _end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paramètre la classe d'arrivée.
|
||||
* @param end La classe d'arrivée.
|
||||
*/
|
||||
public void setEnd(Class end) {
|
||||
this._end = end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère la cardinalité minimum de la classe de départ.
|
||||
* @return La cardinalité minimum de la classe de départ.
|
||||
@@ -136,6 +130,38 @@ public class Link implements Serializable{
|
||||
this._maxCardinalityStart = maxCardinalityStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le point d'accroche du lien sur la classe de départ.
|
||||
* @return Le point d'accroche du lien sur la classe de départ.
|
||||
*/
|
||||
public String getGripStart(){
|
||||
return _gripStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paramètre le point d'accroche du lien sur la classe de départ.
|
||||
* @param gripStart Le point d'accroche du lien sur la classe de départ.
|
||||
*/
|
||||
public void setGripStart(String gripStart){
|
||||
_gripStart = gripStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère la classe d'arrivée du lien.
|
||||
* @return La classe d'arrivée du lien.
|
||||
*/
|
||||
public Class getEnd() {
|
||||
return _end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paramètre la classe d'arrivée.
|
||||
* @param end La classe d'arrivée.
|
||||
*/
|
||||
public void setEnd(Class end) {
|
||||
this._end = end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère la cardinalité minimum de la classe d'arrivée.
|
||||
* @return La cardinalité minimum de la classe d'arrivée.
|
||||
@@ -168,6 +194,22 @@ public class Link implements Serializable{
|
||||
this._maxCardinalityEnd = maxCardinalityEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le point d'accroche du lien sur la classe d'arrivée.
|
||||
* @return Le point d'accroche du lien sur la classe d'arrivée.
|
||||
*/
|
||||
public String getGripEnd(){
|
||||
return _gripEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paramètre le point d'accroche du lien sur la classe d'arrivée.
|
||||
* @param gripEnd Le point d'accroche du lien sur la classe d'arrivée.
|
||||
*/
|
||||
public void setGripEnd(String gripEnd){
|
||||
_gripEnd = gripEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère le type du lien.
|
||||
* @return Le type du lien.
|
||||
@@ -184,6 +226,22 @@ public class Link implements Serializable{
|
||||
this._type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère le nom du lien.
|
||||
* @return Le nom du lien.
|
||||
*/
|
||||
public String getName() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paramètre le nom du lien
|
||||
* @param name Le nom du lien.
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this._name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifie la direction du lien (permute les classes de départ et d'arrivée).
|
||||
*/
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Gère un projet.
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.lang.Math;
|
||||
|
||||
/**
|
||||
* Cette classe permet d'afficher les éléments UML du projet.
|
||||
@@ -10,8 +11,24 @@ public class UmlDiagram extends Composition {
|
||||
|
||||
private UmlToolbar _umlToolbar;
|
||||
private Object _selected;
|
||||
private String cornerSelection = null;
|
||||
private Object _hovered;
|
||||
private String _gripHovered = null;
|
||||
private String _gripSelected = null;
|
||||
private boolean _viewGrips = false;
|
||||
private int gripSize = 8;
|
||||
|
||||
public static final String GRIP_N = "N";
|
||||
public static final String GRIP_NE = "NE";
|
||||
public static final String GRIP_E = "E";
|
||||
public static final String GRIP_SE = "SE";
|
||||
public static final String GRIP_S = "S";
|
||||
public static final String GRIP_SW = "SW";
|
||||
public static final String GRIP_W = "W";
|
||||
public static final String GRIP_NW = "NW";
|
||||
|
||||
//Type de liens
|
||||
final static float dash[] = {5.0f};
|
||||
final static BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
|
||||
private int _shiftX;
|
||||
private int _shiftY;
|
||||
|
||||
@@ -26,8 +43,8 @@ public class UmlDiagram extends Composition {
|
||||
public UmlDiagram(Project project){
|
||||
super(project);
|
||||
this._toolbar = new UmlToolbar(this);
|
||||
this._type = UML_DIAGRAM;
|
||||
this._name = "Composition " + _compositionId + " (" + _type + ")";
|
||||
this._type = Composition.UML_DIAGRAM;
|
||||
this._name = "Composition " + Composition._compositionId + " (" + _type + ")";
|
||||
_classes = new ArrayList<Class>();
|
||||
_links = new ArrayList<Link>();
|
||||
}
|
||||
@@ -78,7 +95,7 @@ public class UmlDiagram extends Composition {
|
||||
g2.setColor(new Color(39, 76, 94));
|
||||
for(Attribute b : a.getAttributes()){
|
||||
posCounter += font2.getSize();
|
||||
g2.drawString(b.getAccess() + " " + b.getName() + " : " + b.getType(), posX, posCounter);
|
||||
g2.drawString(b.getAccess() + " " + b.getName() + " : " + b.getType(), posX+5, posCounter);
|
||||
//Si l'attribut est statique, on le souligne
|
||||
if(b.isStatic()) g2.drawLine(a.getPosX()-a.getSizeX()/2+10, posCounter+1, a.getPosX()+a.getSizeX()/2-10, posCounter+1);
|
||||
}
|
||||
@@ -101,35 +118,172 @@ public class UmlDiagram extends Composition {
|
||||
listArguments.add(ar.getName() + " : " + ar.getType());
|
||||
}
|
||||
chain += String.join(", ", listArguments) + ") : " + m.getType();
|
||||
g2.drawString(chain, posX, posCounter);
|
||||
g2.drawString(chain, posX+5, posCounter);
|
||||
//Si l'attribut est statique, on le souligne
|
||||
if(m.isStatic()) g2.drawLine(a.getPosX()-a.getSizeX()/2+10, posCounter+1, a.getPosX()+a.getSizeX()/2-10, posCounter+1);
|
||||
}
|
||||
//Si la classe est sélectionnée
|
||||
if(a == (Class)_selected){
|
||||
g2.setColor(new Color(39, 76, 94));
|
||||
//Top Left
|
||||
g2.fillOval(posX-4, posY-4, 8, 8);
|
||||
//Affichage du lien temporaire rouge
|
||||
if(_selected != null && _gripSelected != null){
|
||||
Class b = (Class) _selected;
|
||||
System.out.println(b.getName());
|
||||
List<String> grips = Arrays.asList(GRIP_N, GRIP_NE, GRIP_E, GRIP_SE, GRIP_S, GRIP_SW, GRIP_W, GRIP_NW);
|
||||
List<List<Integer>> gripsPositions = b.getGripsPosition(gripSize);
|
||||
g2.setColor(Color.RED);
|
||||
g2.drawLine(gripsPositions.get(grips.indexOf(_gripSelected)).get(0) + gripSize/2, gripsPositions.get(grips.indexOf(_gripSelected)).get(1) + gripSize/2, this.getMousePosition().x, this.getMousePosition().y);
|
||||
}
|
||||
//Récupération de la liste des positions des points d'accroche pour la classe en cours
|
||||
List<List<Integer>> gripsPositions = a.getGripsPosition(gripSize);
|
||||
for(Link l : _links){
|
||||
List<String> grips = Arrays.asList(GRIP_N, GRIP_NE, GRIP_E, GRIP_SE, GRIP_S, GRIP_SW, GRIP_W, GRIP_NW);
|
||||
List<List<Integer>> gripsPositionsStart = l.getStart().getGripsPosition(gripSize);
|
||||
List<List<Integer>> gripsPositionsEnd = l.getEnd().getGripsPosition(gripSize);
|
||||
int startX = gripsPositionsStart.get(grips.indexOf(l.getGripStart())).get(0) + gripSize / 2;
|
||||
int startY = gripsPositionsStart.get(grips.indexOf(l.getGripStart())).get(1) + gripSize / 2;
|
||||
int endX = gripsPositionsEnd.get(grips.indexOf(l.getGripEnd())).get(0) + gripSize / 2;
|
||||
int endY = gripsPositionsEnd.get(grips.indexOf(l.getGripEnd())).get(1) + gripSize / 2;
|
||||
//Dessin du lien en fonction du type de la relation
|
||||
g2.setColor(Color.BLACK);
|
||||
g2.setStroke(new BasicStroke(1f));
|
||||
//Dessin de la ligne en pointillés si le lien est faible
|
||||
if(l.getType() == Link.WEAK){
|
||||
g2.setStroke(dashed);
|
||||
g2.drawLine(startX, startY, endX, endY);
|
||||
}
|
||||
else if (l.getType() == Link.STRONG) g2.drawLine(startX, startY, endX, endY);
|
||||
|
||||
//Si lien de composition, d'agrégation ou d'héritage, on dessine soit un carré ou un triangle
|
||||
else{
|
||||
//On crée le carré ou le rectangle
|
||||
int[][] posGrip = {{startX, startY}};
|
||||
//Détermination de l'angle pour que la figure s'adapte à la direction du lien
|
||||
float angle = (float) Math.atan2(endX - startX, startY - endY);
|
||||
//Détermination des points des polygones en fonction de l'angle et de la position du point d'accroche
|
||||
float[][] posPol = getPolygonPoints(posGrip, -angle, l.getType());
|
||||
int[] polygonX = new int[posPol.length];
|
||||
int[] polygonY = new int[posPol.length];
|
||||
for(int i = 0; i < posPol.length; i++){
|
||||
polygonX[i] = (int)posPol[i][0];
|
||||
polygonY[i] = (int)posPol[i][1];
|
||||
}
|
||||
//On dessine un polygone vide en agrégation
|
||||
if(l.getType() == Link.AGGREGATION || l.getType() == Link.INHERITANCE) g2.drawPolygon(polygonX, polygonY, posPol.length);
|
||||
//On dessine un polygone plein sinon
|
||||
else g2.fillPolygon(polygonX, polygonY, posPol.length);
|
||||
//Adaptation de la ligne sur le 3e point du polygone
|
||||
g2.drawLine(polygonX[2], polygonY[2], endX, endY);
|
||||
}
|
||||
//Affichage des informations du lien
|
||||
if(l.getType() != Link.INHERITANCE){
|
||||
//Décalage des positions pour mettre en évidence les écritures
|
||||
if(l.getGripStart() == GRIP_NE || l.getGripStart() == GRIP_E || l.getGripStart() == GRIP_SE) startX += 20;
|
||||
else if(l.getGripStart() == GRIP_NW || l.getGripStart() == GRIP_W || l.getGripStart() == GRIP_SW) startX -= 20;
|
||||
else if(l.getGripStart() == GRIP_S) startY += 20;
|
||||
if(l.getGripEnd() == GRIP_NE || l.getGripEnd() == GRIP_E || l.getGripEnd() == GRIP_SE) endX += 20;
|
||||
else if(l.getGripEnd() == GRIP_NW || l.getGripEnd() == GRIP_W || l.getGripEnd() == GRIP_SW) endX -= 20;
|
||||
else if(l.getGripEnd() == GRIP_S) endY += 20;
|
||||
//Affichage des cardinalités sur la fin du lien
|
||||
g2.drawString(l.getMinCardinalityEnd() + ".." + l.getMaxCardinalityEnd(), endX, endY);
|
||||
if(l.getType() == Link.STRONG || l.getType() == Link.WEAK){
|
||||
g2.drawString(l.getMinCardinalityStart() + ".." + l.getMaxCardinalityStart(), startX, startY);
|
||||
g2.drawString(l.getName(), (startX + endX)/2, (startY + endY)/2);
|
||||
}
|
||||
}
|
||||
}
|
||||
g2.setStroke(new BasicStroke(1f));
|
||||
//Affichage des points d'accroche
|
||||
if(_viewGrips || (a == (Class)_selected)) {
|
||||
//Changement de la couleur en fonction du mode
|
||||
g2.setColor((_viewGrips) ? Color.GREEN : new Color(39, 76, 94));
|
||||
//Top
|
||||
g2.fillRect(posX + (a.getSizeX()/2)-4, posY-4, 8, 8);
|
||||
g2.fillOval(gripsPositions.get(0).get(0), gripsPositions.get(0).get(1), gripSize, gripSize);
|
||||
//Top Right
|
||||
g2.fillOval(posX + a.getSizeX()-4, posY-4, 8, 8);
|
||||
g2.fillOval(gripsPositions.get(1).get(0), gripsPositions.get(1).get(1), gripSize, gripSize);
|
||||
//Right
|
||||
g2.fillRect(posX + a.getSizeX()-4, posY + (a.getSizeY()/2)-4, 8, 8);
|
||||
g2.fillOval(gripsPositions.get(2).get(0), gripsPositions.get(2).get(1), gripSize, gripSize);
|
||||
//Bottom Right
|
||||
g2.fillOval(posX + a.getSizeX()-4, posY + a.getSizeY()-4, 8, 8);
|
||||
g2.fillOval(gripsPositions.get(3).get(0), gripsPositions.get(3).get(1), gripSize, gripSize);
|
||||
//Bottom
|
||||
g2.fillRect(posX + (a.getSizeX()/2)-4, posY + a.getSizeY()-4,8, 8);
|
||||
g2.fillOval(gripsPositions.get(4).get(0), gripsPositions.get(4).get(1),gripSize, gripSize);
|
||||
//Bottom Left
|
||||
g2.fillOval(posX - 4, posY + a.getSizeY()-4, 8, 8);
|
||||
g2.fillOval(gripsPositions.get(5).get(0), gripsPositions.get(5).get(1), gripSize, gripSize);
|
||||
//Left
|
||||
g2.fillRect(posX -4, posY + (a.getSizeY()/2)-4, 8, 8);
|
||||
//Total rectangle
|
||||
g2.drawRect(posX, posY, a.getSizeX(), a.getSizeY());
|
||||
g2.fillOval(gripsPositions.get(6).get(0), gripsPositions.get(6).get(1), gripSize, gripSize);
|
||||
//Top Left
|
||||
g2.fillOval(gripsPositions.get(7).get(0), gripsPositions.get(7).get(1), gripSize, gripSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcule les points du polygone à tracer.
|
||||
* @param position La position du point d'accroche.
|
||||
* @param type Le type de relation.
|
||||
* @return Les points du polygone à tracer.
|
||||
*/
|
||||
public float[][] getPolygonPoints(int[][] position, double angle, int type){
|
||||
//Patterns de polygon : carré pour composition et agrégation, triangle pour héritage
|
||||
int[][] squarePattern = {{0,0},{-10,-10},{0,-20},{10,-10},{0,0}};
|
||||
int[][] trianglePattern = {{0,0},{-10,-20},{0,-20},{10,-20},{0,0}};
|
||||
|
||||
//Demande d'un carré ou d'un triangle selon le type de lien
|
||||
float[][] points = null;
|
||||
switch(type){
|
||||
case Link.INHERITANCE:
|
||||
points = rotateMatrice(trianglePattern, angle);
|
||||
break;
|
||||
default:
|
||||
points = rotateMatrice(squarePattern, angle);
|
||||
break;
|
||||
}
|
||||
//Déplacement du pattern à la position du point d'accroche
|
||||
for(int i = 0; i < points.length; i++){
|
||||
points[i][0] += position[0][0];
|
||||
points[i][1] += position[0][1];
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate le polygone sous forme de matrice.
|
||||
* @param matrice Les points du pattern de polygone.
|
||||
* @param angle L'angle de rotation.
|
||||
* @return La matrice tournée correspondant au polygone final.
|
||||
*/
|
||||
public float[][] rotateMatrice(int[][] matrice, double angle){
|
||||
//Matrice de rotation en fonction de l'angle
|
||||
double[][] rotate = {{Math.cos(angle), (-1)*Math.sin(angle)},{Math.sin(angle), Math.cos(angle)}};
|
||||
//Matrice finale
|
||||
float[][] finalMatrice = new float[matrice.length][2];
|
||||
//Multiplication de rotate * finalMatrice
|
||||
for(int i=0; i < matrice.length; i++){
|
||||
for(int j=0; j < 2; j++){
|
||||
finalMatrice[i][j] = 0;
|
||||
for(int k=0; k<2 ;k++)
|
||||
{
|
||||
finalMatrice[i][j] += matrice[i][k] * rotate[k][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
return finalMatrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne si la vue des points d'accroches est activée pour le diagramme
|
||||
* @return true : la vue des points d'accroche est activée, false sinon.
|
||||
*/
|
||||
public boolean viewGripsEnabled(){
|
||||
return _viewGrips;
|
||||
}
|
||||
|
||||
/**
|
||||
* Active/Désactive la vue des points d'accroches pour les classes.
|
||||
* @param enabled La vue des points d'accroches pour les classes.
|
||||
*/
|
||||
public void setViewGripsEnabled(boolean enabled){
|
||||
_viewGrips = enabled;
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la classe principale du diagramme.
|
||||
* @return La classe principale du diagramme.
|
||||
@@ -177,6 +331,12 @@ public class UmlDiagram extends Composition {
|
||||
* @param c La classe à retirer.
|
||||
*/
|
||||
public void removeClass(Class c){
|
||||
//On supprime les liens associés à cette classe
|
||||
Iterator<Link> iter = _links.iterator();
|
||||
while(iter.hasNext()){
|
||||
Link link = iter.next();
|
||||
if(c.equals(link.getStart()) || c.equals(link.getEnd())) iter.remove();
|
||||
}
|
||||
//On supprime la classe principale. Par défaut, la 1ère classe créée devient la classe principale.
|
||||
this._classes.remove(c);
|
||||
if(_mainClass == c && _classes.size() != 0) _mainClass = _classes.get(0);
|
||||
@@ -188,6 +348,7 @@ public class UmlDiagram extends Composition {
|
||||
*/
|
||||
public void clearClasses(){
|
||||
this._classes.clear();
|
||||
this.clearLinks();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,33 +405,32 @@ public class UmlDiagram extends Composition {
|
||||
* @param getY Les coordonnées de la souris sur l'axe Y.
|
||||
*/
|
||||
public void select(int getX, int getY){
|
||||
//On cherche l'objet sélectionné
|
||||
boolean classSelected = false;
|
||||
boolean linkSelected = false;
|
||||
for(Class a : _classes){
|
||||
int posX = a.getPosX()-(a.getSizeX()/2);
|
||||
int posY = a.getPosY()-(a.getSizeY()/2);
|
||||
//Si la souris est dans la classe
|
||||
if (getX >= posX && getX <= (posX + a.getSizeX())) {
|
||||
if (getY >= posY && getY <= (posY + a.getSizeY())) {
|
||||
this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
//On sélectionne la classe
|
||||
classSelected = true;
|
||||
_selected = a;
|
||||
break;
|
||||
//Si un élément est survolé, on le sélectionne
|
||||
for(Class c : _classes){
|
||||
int posX = c.getPosX();
|
||||
int posY = c.getPosY();
|
||||
int sizeX = c.getSizeX();
|
||||
int sizeY = c.getSizeY();
|
||||
//Si cette classe est survolée, on affiche son nom dans la barre de statut et on la sauvegarde temporairement
|
||||
_selected = null;
|
||||
if(getX >= posX - sizeX/2 - gripSize && getX <= posX + sizeX/2 + gripSize && getY >= posY - sizeY/2 - gripSize && getY <= posY + sizeY/2 + gripSize){
|
||||
AppThinker.getWindow().getStatusbar().setStatusMessage("Selected class : " + c.getName());
|
||||
_selected = c;
|
||||
//Si on est en mode édition de liens, on recherche le point d'accroche survolé
|
||||
if(_viewGrips) {
|
||||
checkHoveredGrip((Class) _selected, getX, getY);
|
||||
_gripSelected = _gripHovered;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(classSelected == false && linkSelected == false && cornerSelection == null) _selected = null;
|
||||
//Si la classe est sélectionnée, on enregistre le décalage entre la souris et le centre de la classe
|
||||
AppThinker.getWindow().getStatusbar().setSizeLabel(0, 0);
|
||||
if(_selected instanceof Class){
|
||||
Class a = (Class) _selected;
|
||||
AppThinker.getWindow().getStatusbar().setSizeLabel(a.getSizeX(), a.getSizeY());
|
||||
_shiftX = getX - a.getPosX();
|
||||
_shiftY = getY - a.getPosY();
|
||||
}
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -281,6 +441,49 @@ public class UmlDiagram extends Composition {
|
||||
ClassPropertiesWindow prop = new ClassPropertiesWindow(this, a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie si le curseur est à proximité d'un point d'accroche. Dans ce cas, il enregistre le point survolé.
|
||||
* @param a La classe à vérifier.
|
||||
* @param x L'abscisse du curseur.
|
||||
* @param y L'ordonnée du curseur.
|
||||
*/
|
||||
public void checkHoveredGrip(Class a, int x, int y){
|
||||
int sensibility = 5;
|
||||
int posX = a.getPosX();
|
||||
int posY = a.getPosY();
|
||||
int sizeX = a.getSizeX();
|
||||
int sizeY = a.getSizeY();
|
||||
//Si la souris est à proximité d'un point d'accroche, on affiche le curseur de redimensionnement
|
||||
if (x >= posX - sensibility && x <= posX + sensibility && y >= posY - sizeY/2 - sensibility && y <= posY - sizeY/2 + sensibility) {
|
||||
_gripHovered = GRIP_N;
|
||||
this.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
|
||||
} else if (x >= posX + sizeX/2 - sensibility && x <= posX + sizeX/2 + sensibility && y >= posY - sizeY/2 - sensibility && y <= posY - sizeY/2 + sensibility) {
|
||||
_gripHovered = GRIP_NE;
|
||||
this.setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
|
||||
} else if (x >= posX + sizeX/2 - sensibility && x <= posX + sizeX/2 + sensibility && y >= posY - sensibility && y <= posY + sensibility) {
|
||||
_gripHovered = GRIP_E;
|
||||
this.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
|
||||
} else if (x >= posX + sizeX/2 - sensibility && x <= posX + sizeX/2 + sensibility && y >= posY + sizeY/2 - sensibility && y <= posY + sizeY/2 + sensibility) {
|
||||
_gripHovered = GRIP_SE;
|
||||
this.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
|
||||
} else if (x >= posX - sensibility && x <= posX + sensibility && y >= posY + sizeY/2 - sensibility && y <= posY + sizeY/2 + sensibility) {
|
||||
_gripHovered = GRIP_S;
|
||||
this.setCursor(new Cursor(Cursor.S_RESIZE_CURSOR));
|
||||
} else if (x >= posX - sizeX/2 - sensibility && x <= posX - sizeX/2 + sensibility && y >= posY + sizeY/2 - sensibility && y <= posY + sizeY/2 + sensibility) {
|
||||
_gripHovered = GRIP_SW;
|
||||
this.setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
|
||||
} else if (x >= posX - sizeX/2 - sensibility && x <= posX - sizeX/2 + sensibility && y >= posY - sensibility && y <= posY + sensibility) {
|
||||
_gripHovered = GRIP_W;
|
||||
this.setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
|
||||
} else if (x >= posX - sizeX/2 - sensibility && x <= posX - sizeX/2 + sensibility && y >= posY - sizeY/2 - sensibility && y <= posY - sizeY/2 + sensibility) {
|
||||
_gripHovered = GRIP_NW;
|
||||
this.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
|
||||
} else {
|
||||
_gripHovered = null;
|
||||
this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
}
|
||||
|
||||
//Actions de la souris sur le diagramme UML
|
||||
/**
|
||||
* Action du clic de la souris sur le diagramme.
|
||||
@@ -325,22 +528,27 @@ public class UmlDiagram extends Composition {
|
||||
break;
|
||||
//On essaie d'ajouter une classe
|
||||
case UmlToolbar.CLASS_TOOL:
|
||||
this.addClass(new Class(e.getX(), e.getY(), Class.RECTANGLE));
|
||||
this.addClass(new Class(e.getX(), e.getY()));
|
||||
break;
|
||||
case UmlToolbar.STRONG_TOOL:
|
||||
System.out.println("On ajoute une relation forte.");
|
||||
this.select(e.getX(), e.getY());
|
||||
break;
|
||||
case UmlToolbar.WEAK_TOOL:
|
||||
System.out.println("On ajoute une relation faible.");
|
||||
this.select(e.getX(), e.getY());
|
||||
break;
|
||||
case UmlToolbar.COMPOSITION_TOOL:
|
||||
System.out.println("On ajoute une relation de composition.");
|
||||
this.select(e.getX(), e.getY());
|
||||
break;
|
||||
case UmlToolbar.AGGREGATION_TOOL:
|
||||
System.out.println("On ajoute une relation d'agrégation.");
|
||||
this.select(e.getX(), e.getY());
|
||||
break;
|
||||
case UmlToolbar.INHERITANCE_TOOL:
|
||||
System.out.println("On ajoute une relation d'héritage.");
|
||||
this.select(e.getX(), e.getY());
|
||||
break;
|
||||
default:
|
||||
this.select(e.getX(), e.getY());
|
||||
@@ -351,7 +559,15 @@ public class UmlDiagram extends Composition {
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
|
||||
//Si on lâche le curseur en cours de création de liens, on annule la saisie.
|
||||
if(_viewGrips){
|
||||
if(_gripSelected != null){
|
||||
_gripSelected = null;
|
||||
_selected = null;
|
||||
this.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
|
||||
}
|
||||
this.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -378,51 +594,87 @@ public class UmlDiagram extends Composition {
|
||||
Class a = (Class)_selected;
|
||||
int shiftX = 0;
|
||||
int shiftY = 0;
|
||||
//Si un coin est sélectionné, on redimensionne
|
||||
if(cornerSelection != null){
|
||||
switch(cornerSelection){
|
||||
case "N":
|
||||
a.resizeUp(posY);
|
||||
break;
|
||||
case "NE":
|
||||
a.resizeUp(posY);
|
||||
a.resizeRight(posX);
|
||||
case "E":
|
||||
a.resizeRight(posX);
|
||||
break;
|
||||
case "SE":
|
||||
a.resizeDown(posY);
|
||||
a.resizeRight(posX);
|
||||
case "S":
|
||||
a.resizeDown(posY);
|
||||
break;
|
||||
case "SW":
|
||||
a.resizeDown(posY);
|
||||
a.resizeLeft(posX);
|
||||
break;
|
||||
case "W":
|
||||
a.resizeLeft(posX);
|
||||
break;
|
||||
case "NW":
|
||||
a.resizeUp(posY);
|
||||
a.resizeLeft(posX);
|
||||
break;
|
||||
//Sinon, soit on redimensionne une classe ou on la déplace.
|
||||
if(!_viewGrips){
|
||||
if(_gripHovered != null){
|
||||
switch(_gripHovered){
|
||||
case GRIP_N:
|
||||
a.resizeUp(posY);
|
||||
break;
|
||||
case GRIP_NE:
|
||||
a.resizeUp(posY);
|
||||
a.resizeRight(posX);
|
||||
case GRIP_E:
|
||||
a.resizeRight(posX);
|
||||
break;
|
||||
case GRIP_SE:
|
||||
a.resizeDown(posY);
|
||||
a.resizeRight(posX);
|
||||
case GRIP_S:
|
||||
a.resizeDown(posY);
|
||||
break;
|
||||
case GRIP_SW:
|
||||
a.resizeDown(posY);
|
||||
a.resizeLeft(posX);
|
||||
break;
|
||||
case GRIP_W:
|
||||
a.resizeLeft(posX);
|
||||
break;
|
||||
case GRIP_NW:
|
||||
a.resizeUp(posY);
|
||||
a.resizeLeft(posX);
|
||||
break;
|
||||
}
|
||||
AppThinker.getWindow().getStatusbar().setSizeLabel(a.getSizeX(), a.getSizeY());
|
||||
}
|
||||
//Sinon on déplace
|
||||
else{
|
||||
//On repositionne la classe en prenant en compte le décalage mesuré au clic de la souris
|
||||
a.setPosX(posX - _shiftX);
|
||||
a.setPosY(posY - _shiftY);
|
||||
this.setCursor(new Cursor(Cursor.MOVE_CURSOR));
|
||||
}
|
||||
AppThinker.getWindow().getStatusbar().setSizeLabel(a.getSizeX(), a.getSizeY());
|
||||
}
|
||||
//Sinon on déplace
|
||||
else{
|
||||
//On repositionne la classe en prenant en compte le décalage mesuré au clic de la souris
|
||||
a.setPosX(posX - _shiftX);
|
||||
a.setPosY(posY - _shiftY);
|
||||
this.setCursor(new Cursor(Cursor.MOVE_CURSOR));
|
||||
}
|
||||
//On est en train de créer un lien, on recherche le point d'accroche d'arrivée
|
||||
if(_selected != null && _gripSelected != null){
|
||||
Class selected = (Class) _selected;
|
||||
for(Class hovered : _classes){
|
||||
int posXSelected = hovered.getPosX();
|
||||
int posYSelected = hovered.getPosY();
|
||||
int sizeXSelected = hovered.getSizeX();
|
||||
int sizeYSelected = hovered.getSizeY();
|
||||
//Si cette classe est survolée, on affiche son nom dans la barre de statut et on la sauvegarde temporairement
|
||||
_hovered = null;
|
||||
if(posX >= posXSelected - sizeXSelected/2 - gripSize && posX <= posXSelected + sizeXSelected/2 + gripSize && posY >= posYSelected - sizeYSelected/2 - gripSize && posY <= posYSelected + sizeYSelected/2 + gripSize){
|
||||
AppThinker.getWindow().getStatusbar().setStatusMessage("Approach a target grip on this class to create the link : " + hovered.getName());
|
||||
if(hovered != _selected){
|
||||
_hovered = hovered;
|
||||
//On recherche le point survolé
|
||||
checkHoveredGrip((Class) _hovered, posX, posY);
|
||||
//Si toutes les conditions sont réunies, on crée le lien
|
||||
if(_hovered != null && _gripHovered != null && _selected != null && _gripSelected != null){
|
||||
//Récupération du type de lien
|
||||
UmlToolbar toolbar = (UmlToolbar) _toolbar;
|
||||
int currentTool = toolbar.getCurrentTool();
|
||||
int type = (currentTool == UmlToolbar.STRONG_TOOL) ? Link.STRONG : (currentTool == UmlToolbar.WEAK_TOOL) ? Link.WEAK : (currentTool == UmlToolbar.COMPOSITION_TOOL) ? Link.COMPOSITION : (currentTool == UmlToolbar.AGGREGATION_TOOL) ? Link.AGGREGATION : Link.INHERITANCE;
|
||||
_links.add(new Link((Class) _selected, (Class) _hovered, _gripSelected, _gripHovered, 0, 0, 0, 0, type));
|
||||
_selected = null;
|
||||
_gripSelected = null;
|
||||
_gripHovered = null;
|
||||
_hovered = null;
|
||||
this.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
* La souris bouge dans la grille.
|
||||
* Déclenchée par le mouvement de la souris, cette fonction permet de récupérer la classe actuellement survolée.
|
||||
* @param e L'événement souris.
|
||||
*/
|
||||
@Override
|
||||
@@ -432,41 +684,12 @@ public class UmlDiagram extends Composition {
|
||||
int sens = 5;
|
||||
//Mise à jour des coordonnées de la souris dans la statusbar
|
||||
AppThinker.getWindow().getStatusbar().setPosLabel(e.getX(), e.getY());
|
||||
//Si une classe est sélectionnée
|
||||
//Si une classe est sélectionnée, on recherche si le curseur est à proximité d'un point d'accroche
|
||||
if (_selected instanceof Class) {
|
||||
Class a = (Class) _selected;
|
||||
AppThinker.getWindow().getStatusbar().setSizeLabel(a.getSizeX(), a.getSizeY());
|
||||
int posX = a.getPosX() - (a.getSizeX() / 2);
|
||||
int posY = a.getPosY() - (a.getSizeY() / 2);
|
||||
//Si la souris est à proximité d'un lien, on affiche le curseur de redimensionnement
|
||||
if (getX >= posX - sens && getX <= posX + sens && getY >= posY - sens && getY <= posY + sens) {
|
||||
cornerSelection = "NW";
|
||||
this.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
|
||||
} else if (getX >= posX + a.getSizeX() / 2 - sens && getX <= posX + a.getSizeX() / 2 + sens && getY >= posY - sens && getY <= posY + sens) {
|
||||
cornerSelection = "N";
|
||||
this.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
|
||||
} else if (getX >= posX + a.getSizeX() - sens && getX <= posX + a.getSizeX() + sens && getY >= posY - sens && getY <= posY + sens) {
|
||||
cornerSelection = "NE";
|
||||
this.setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
|
||||
} else if (getX >= posX + a.getSizeX() - sens && getX <= posX + a.getSizeX() + sens && getY >= posY + a.getSizeY() / 2 - sens && getY <= posY + a.getSizeY() / 2 + sens) {
|
||||
cornerSelection = "E";
|
||||
this.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
|
||||
} else if (getX >= posX + a.getSizeX() - sens && getX <= posX + a.getSizeX() + sens && getY >= posY + a.getSizeY() - sens && getY <= posY + a.getSizeY() + sens) {
|
||||
cornerSelection = "SE";
|
||||
this.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
|
||||
} else if (getX >= posX + a.getSizeX() / 2 - sens && getX <= posX + a.getSizeX() / 2 + sens && getY >= posY + a.getSizeY() - sens && getY <= posY + a.getSizeY() + sens) {
|
||||
cornerSelection = "S";
|
||||
this.setCursor(new Cursor(Cursor.S_RESIZE_CURSOR));
|
||||
} else if (getX >= posX - sens && getX <= posX + sens && getY >= posY + a.getSizeY() - sens && getY <= posY + a.getSizeY() + sens) {
|
||||
cornerSelection = "SW";
|
||||
this.setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
|
||||
} else if (getX >= posX - sens && getX <= posX + sens && getY >= posY + a.getSizeY() / 2 - sens && getY <= posY + a.getSizeY() / 2 + sens) {
|
||||
cornerSelection = "W";
|
||||
this.setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
|
||||
} else {
|
||||
cornerSelection = null;
|
||||
this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
}
|
||||
//Si une classe est sélectionnée, on recherche si le curseur est à proximité d'un point d'accroche
|
||||
checkHoveredGrip(a, getX, getY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,6 +259,7 @@ public class UmlToolbar extends JPanel {
|
||||
this._currentTool = currentTool;
|
||||
if(this._currentTool == UmlToolbar.SELECT_TOOL) _umlDiagram.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
|
||||
else _umlDiagram.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
|
||||
_umlDiagram.setViewGripsEnabled(false);
|
||||
switch(currentTool){
|
||||
case EDIT_TOOL:
|
||||
if(_umlDiagram.getSelected() instanceof Class){
|
||||
@@ -282,18 +283,23 @@ public class UmlToolbar extends JPanel {
|
||||
AppThinker.getWindow().getStatusbar().setStatusMessage("Class tool - Click everywhere to add a new class.");
|
||||
break;
|
||||
case STRONG_TOOL:
|
||||
_umlDiagram.setViewGripsEnabled(true);
|
||||
AppThinker.getWindow().getStatusbar().setStatusMessage("Strong relation tool - Click on a class, hold, and release on another class.");
|
||||
break;
|
||||
case WEAK_TOOL:
|
||||
_umlDiagram.setViewGripsEnabled(true);
|
||||
AppThinker.getWindow().getStatusbar().setStatusMessage("Weak relation tool - Click on a class, hold, and release on another class.");
|
||||
break;
|
||||
case COMPOSITION_TOOL:
|
||||
_umlDiagram.setViewGripsEnabled(true);
|
||||
AppThinker.getWindow().getStatusbar().setStatusMessage("Composition relation tool - Click on a class, hold, and release on another class.");
|
||||
break;
|
||||
case AGGREGATION_TOOL:
|
||||
_umlDiagram.setViewGripsEnabled(true);
|
||||
AppThinker.getWindow().getStatusbar().setStatusMessage("Aggregation relation tool - Click on a class, hold, and release on another class.");
|
||||
break;
|
||||
case INHERITANCE_TOOL:
|
||||
_umlDiagram.setViewGripsEnabled(true);
|
||||
AppThinker.getWindow().getStatusbar().setStatusMessage("Inheritance relation tool - Click on a class, hold, and release on another class.");
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user