www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit bb4e49d1bfb8df3320d1802a44fdb99f0ddaf842
parent 278b4d4780b3d05de0d81862fe405db47f32ee45
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Wed,  2 Feb 2011 07:26:33 +0100

Merge branch 'master' of github:jsmaniac/2011-m1s2-ter

Diffstat:
Mcode/PtiClic/res/layout/score.xml | 10+++++-----
Mcode/PtiClic/src/org/pticlic/Score.java | 28+++++++++++++++++++++++++---
Mcode/PtiClic/src/org/pticlic/games/BaseGame.java | 61++++++++++++++++++++++++++++++++++++++++++++-----------------
Mcode/PtiClic/src/org/pticlic/model/Constant.java | 7++++++-
Acode/PtiClic/src/org/pticlic/model/DownloadedGame.java | 153+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acode/PtiClic/src/org/pticlic/model/DownloadedScore.java | 11+++++++++++
Dcode/PtiClic/src/org/pticlic/model/Game.java | 143-------------------------------------------------------------------------------
Mcode/PtiClic/src/org/pticlic/model/GamePlayed.java | 25++++++++++++++++++-------
Mcode/PtiClic/src/org/pticlic/model/Network.java | 43++++++++++++++++++++++++++++---------------
Acode/PtiClic/src/org/pticlic/model/Relation.java | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acode/images/Aide36.png | 0
Acode/images/Aide48.png | 0
Acode/images/Aide72.png | 0
Acode/images/Contenant36.png | 0
Acode/images/Contenant48.png | 0
Acode/images/Contenant72.png | 0
Acode/images/Contenu36.png | 0
Acode/images/Contenu48.png | 0
Acode/images/Contenu72.png | 0
Acode/images/Contraire36.png | 0
Acode/images/Contraire48.png | 0
Acode/images/Contraire72.png | 0
Acode/images/FondLogo.png | 0
Acode/images/ModeNormal36.png | 0
Acode/images/ModeNormal48.png | 0
Acode/images/ModeNormal72.png | 0
Acode/images/ModeOmbre36.png | 0
Acode/images/ModeOmbre48.png | 0
Acode/images/ModeOmbre72.png | 0
Acode/images/Rapport36.png | 0
Acode/images/Rapport48.png | 0
Acode/images/Rapport72.png | 0
Acode/images/Synonyme36.png | 0
Acode/images/Synonyme48.png | 0
Acode/images/Synonyme72.png | 0
35 files changed, 365 insertions(+), 191 deletions(-)

diff --git a/code/PtiClic/res/layout/score.xml b/code/PtiClic/res/layout/score.xml @@ -6,22 +6,22 @@ android:layout_height="fill_parent" android:orientation="vertical" android:layout_width="fill_parent" android:id="@+id/LinearLayout01"> -<TextView android:text="@+id/corrects" android:id="@+id/corrects" android:layout_width="fill_parent" +<TextView android:text="@+id/corrects" android:id="@+id/correct" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="20px"></TextView> -<TextView android:text="@+id/manquants" android:id="@+id/manquants" android:layout_width="fill_parent" +<TextView android:text="@+id/manquants" android:id="@+id/missing" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="20px"></TextView> -<TextView android:text="@+id/mauvais" android:id="@+id/mauvais" android:layout_width="fill_parent" +<TextView android:text="@+id/mauvais" android:id="@+id/bad" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="20px"></TextView> <TextView android:text="@+id/total" android:id="@+id/total" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="25px"></TextView> -<TextView android:text="@+id/joueravec" android:id="@+id/joueravec" android:layout_width="wrap_content" +<TextView android:text="@+id/joueravec" android:id="@+id/playedWith" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20px"></TextView> -<Button android:text="J'ai vu !" android:id="@+id/jaivu" android:layout_width="100px" +<Button android:text="J'ai vu !" android:id="@+id/saw" android:layout_width="100px" android:layout_height="40px" android:layout_gravity="center_vertical|center_horizontal|center"></Button> <TextView android:text="@+id/category1" android:id="@+id/category1" android:layout_width="wrap_content" diff --git a/code/PtiClic/src/org/pticlic/Score.java b/code/PtiClic/src/org/pticlic/Score.java @@ -1,14 +1,24 @@ package org.pticlic; import org.pticlic.model.Constant; +import org.pticlic.model.DownloadedScore; import org.pticlic.model.GamePlayed; +import org.pticlic.model.Network; +import org.pticlic.model.Network.Mode; import android.app.Activity; +import android.content.SharedPreferences; import android.os.Bundle; +import android.preference.PreferenceManager; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; +/** + * @author John CHARRON + * + * Permet l'affichage du score obtenu par le joueur lors de sa partie. + */ public class Score extends Activity implements OnClickListener{ private GamePlayed gamePlayed; @@ -18,12 +28,24 @@ public class Score extends Activity implements OnClickListener{ super.onCreate(savedInstanceState); setContentView(R.layout.score); + SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); + String serverURL = sp.getString(Constant.SERVER_URL, "http://dumbs.fr/~bbrun/pticlic.json"); // TODO : Mettre comme valeur par defaut l'adresse reel du serveur + String id = sp.getString(Constant.USER_ID, "joueur"); + String passwd = sp.getString(Constant.USER_PASSWD, ""); + Mode mode = null; + if (getIntent().getExtras() != null) { // Pour JC : GamePlayed contient toutes les infos sur la partie jouee - this.gamePlayed = (GamePlayed) getIntent().getExtras().get(Constant.SCORE_INTENT); + this.gamePlayed = (GamePlayed) getIntent().getExtras().get(Constant.SCORE_GAMEPLAYED); + mode = (Mode) getIntent().getExtras().get(Constant.SCORE_MODE); } + + Network network = new Network(serverURL, mode, id, passwd); + + // FIXME : Pour l'instant ne marche pas, attend de savoir comment est formater le score que l'on recois. + //DownloadedScore score = network.sendGame(gamePlayed); - ((Button)findViewById(R.id.jaivu)).setOnClickListener(this); + ((Button)findViewById(R.id.saw)).setOnClickListener(this); } @@ -41,7 +63,7 @@ public class Score extends Activity implements OnClickListener{ @Override public void onClick(View v) { - if (v.getId()==R.id.jaivu) { + if (v.getId()==R.id.saw) { finish(); } diff --git a/code/PtiClic/src/org/pticlic/games/BaseGame.java b/code/PtiClic/src/org/pticlic/games/BaseGame.java @@ -3,9 +3,10 @@ package org.pticlic.games; import org.pticlic.R; import org.pticlic.Score; import org.pticlic.model.Constant; -import org.pticlic.model.Game; +import org.pticlic.model.DownloadedGame; import org.pticlic.model.GamePlayed; import org.pticlic.model.Network; +import org.pticlic.model.Relation; import org.pticlic.model.Network.Mode; import android.app.Activity; @@ -22,10 +23,24 @@ import android.view.animation.TranslateAnimation; import android.widget.Button; import android.widget.TextView; +/** + * @author Bertrand BRUN et Georges DUPÉRON + * + * Cette classe est le controlleur du premier jeu. + * + * Ce premier jeu appeler "Jeux de Base", permet de creer des relations en selectionnant + * le type de relation d'un mot du nuage de mot par rapport au mot central. + * + * La vue de ce jeu se presente sous la forme d'un fenetre presentant en haut le mot central, + * et les mots du nuage descende en partant du mot central vers le centre du mobile. + * Une fois le mot du nuage afficher, l'utilisateur peut selectionner, parmis les relations + * proposer celle qui lui semble le mieux approprier. + * + */ public class BaseGame extends Activity implements OnClickListener { private int currentWord = 0; private int nbWord = 0; - private Game game; + private DownloadedGame game; private GamePlayed gamePlayed; /** Called when the activity is first created. */ @@ -34,39 +49,46 @@ public class BaseGame extends Activity implements OnClickListener { super.onCreate(savedInstanceState); setContentView(R.layout.game); + // On recupere du PreferenceManager les differentes information dont on a besoin SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); String serverURL = sp.getString(Constant.SERVER_URL, "http://dumbs.fr/~bbrun/pticlic.json"); // TODO : Mettre comme valeur par defaut l'adresse reel du serveur - - Network network = new Network(serverURL, Mode.SIMPLE_GAME); + String id = sp.getString(Constant.USER_ID, "joueur"); + String passwd = sp.getString(Constant.USER_PASSWD, ""); + + // On initialise la classe permettant la communication avec le serveur. + Network network = new Network(serverURL, Mode.SIMPLE_GAME, id, passwd); game = network.getGames(1); int nbrel = game.getNbRelation(); nbWord = game.getNbWord(); + // On initialise la partie. gamePlayed = new GamePlayed(); gamePlayed.setGame(game); + + Relation r = Relation.getInstance(); // Boutons des relations Button r1 = ((Button)findViewById(R.id.relation1)); Button r2 = ((Button)findViewById(R.id.relation2)); Button r3 = ((Button)findViewById(R.id.relation3)); Button r4 = ((Button)findViewById(R.id.relation4)); - Button poubelle = ((Button)findViewById(R.id.poubelle)); + + // TODO : Pour l'instant la poubelle ne fait rien. Il faudra certainement la ranger dans un categorie dans GamePlayed pour calculer le score. + ((Button)findViewById(R.id.poubelle)).setText("Poubelle"); // Écoute des clics sur les relations - if (nbrel > 0) { r1.setOnClickListener(this); } else { r1.setVisibility(View.GONE); } - if (nbrel > 1) { r2.setOnClickListener(this); } else { r2.setVisibility(View.GONE); } - if (nbrel > 2) { r3.setOnClickListener(this); } else { r3.setVisibility(View.GONE); } - if (nbrel > 3) { r4.setOnClickListener(this); } else { r4.setVisibility(View.GONE); } - + if (nbrel > 0) { r1.setOnClickListener(this); r1.setText(r.getRelationName(game.getCat1())); } else { r1.setVisibility(View.GONE); } + if (nbrel > 1) { r2.setOnClickListener(this); r2.setText(r.getRelationName(game.getCat2()));} else { r2.setVisibility(View.GONE); } + if (nbrel > 2) { r3.setOnClickListener(this); r3.setText(r.getRelationName(game.getCat3()));} else { r3.setVisibility(View.GONE); } + if (nbrel > 3) { r4.setOnClickListener(this); r4.setText(r.getRelationName(game.getCat4()));} else { r4.setVisibility(View.GONE); } - //TODO : Faudrait gere dynamiquement la gestion des nom des relations. - r1.setText("Idée"); - r2.setText("Partie"); - poubelle.setText("Poubelle"); - ((TextView)findViewById(R.id.mainWord)).setText(Game.getName(game.getCentre())); + ((TextView)findViewById(R.id.mainWord)).setText(DownloadedGame.getName(game.getCentre())); } + /* (non-Javadoc) + * @see android.app.Activity#onStart() + */ @Override protected void onStart() { super.onStart(); @@ -74,6 +96,9 @@ public class BaseGame extends Activity implements OnClickListener { start(); } + /* (non-Javadoc) + * @see android.app.Activity#onActivityResult(int, int, android.content.Intent) + */ @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); @@ -112,7 +137,7 @@ public class BaseGame extends Activity implements OnClickListener { * Cette methode permet de passer au mot courant suivant et de lancer l'animation. */ private void start() { - ((TextView)findViewById(R.id.currentWord)).setText(Game.getName(game.getWordInCloud(currentWord))); + ((TextView)findViewById(R.id.currentWord)).setText(DownloadedGame.getName(game.getWordInCloud(currentWord))); arrivalView(); } @@ -124,7 +149,9 @@ public class BaseGame extends Activity implements OnClickListener { start(); } else { Intent intent = new Intent(this, Score.class); - intent.putExtra(Constant.SCORE_INTENT, gamePlayed); + intent.putExtra(Constant.SCORE_GAMEPLAYED, gamePlayed); + intent.putExtra(Constant.SCORE_MODE, Mode.SIMPLE_GAME); + startActivityForResult(intent, 0x100); } } diff --git a/code/PtiClic/src/org/pticlic/model/Constant.java b/code/PtiClic/src/org/pticlic/model/Constant.java @@ -3,6 +3,11 @@ package org.pticlic.model; public class Constant { public static final String SERVER_URL = "SERVER_URL"; + // Constant pour les information de l'utilisateur. + public static final String USER_ID = "login"; + public static final String USER_PASSWD = "passwd"; + // Constant pour les intents - public static final String SCORE_INTENT = "SCORE_INTENT"; + public static final String SCORE_GAMEPLAYED = "SCORE_INTENT"; + public static final String SCORE_MODE = "SCORE_MODE"; } diff --git a/code/PtiClic/src/org/pticlic/model/DownloadedGame.java b/code/PtiClic/src/org/pticlic/model/DownloadedGame.java @@ -0,0 +1,153 @@ +package org.pticlic.model; + +import java.io.Serializable; + + +/** + * @author Bertrand BRUN + * + * Classe metier reprensentant le jeu telecharger du serveur. + * + */ +public class DownloadedGame implements Serializable { + + private static final long serialVersionUID = 1L; + + public static class Word implements Serializable { + + private static final long serialVersionUID = 1L; + private int id; + private String name; + + public Word() {} + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + private int id; + private int cat1; + private int cat2; + private int cat3; + private int cat4; + private Word center; + private Word[] cloud; + + + + public DownloadedGame(int id, int cat1, int cat2, int cat3, int cat4, Word center, + Word[] cloud) { + super(); + this.id = id; + this.cat1 = cat1; + this.cat2 = cat2; + this.cat3 = cat3; + this.cat4 = cat4; + this.center = center; + this.cloud = cloud; + } + + /** + * Permet de recupere le nombre de relation que l'on va utiliser. + * + * @return le nombre de relation + */ + public int getNbRelation() { + int res = 0; + + if (cat1 != -1) { + res++; + } + if (cat2 != -1) { + res++; + } + if (cat3 != -1) { + res++; + } + if (cat4 != -1) { + res++; + } + + return res; + } + + public static String getName(Word word) { + return word.getName(); + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getCat1() { + return cat1; + } + + public void setCat1(int cat1) { + this.cat1 = cat1; + } + + public int getCat2() { + return cat2; + } + + public void setCat2(int cat2) { + this.cat2 = cat2; + } + + public int getCat3() { + return cat3; + } + + public void setCat3(int cat3) { + this.cat3 = cat3; + } + + public int getCat4() { + return cat4; + } + + public void setCat4(int cat4) { + this.cat4 = cat4; + } + + public Word getCentre() { + return center; + } + + public void setCentre(Word center) { + this.center = center; + } + + public int getNbWord() { + return cloud.length; + } + + public Word getWordInCloud(int index) { + return cloud[index]; + } + + @Override + public String toString() { + return "Game [id=" + id + ", cat1=" + cat1 + ", cat2=" + cat2 + + ", cat3=" + cat3 + ", cat4=" + cat4 + ", center=" + center + + ", cloud=" + cloud + "]"; + } +} diff --git a/code/PtiClic/src/org/pticlic/model/DownloadedScore.java b/code/PtiClic/src/org/pticlic/model/DownloadedScore.java @@ -0,0 +1,11 @@ +package org.pticlic.model; + +/** + * @author Bertrand BRUN + * + * Classe metier reprensentant le score sous forme json envoyer par le serveur. + * + */ +public class DownloadedScore { + +} diff --git a/code/PtiClic/src/org/pticlic/model/Game.java b/code/PtiClic/src/org/pticlic/model/Game.java @@ -1,143 +0,0 @@ -package org.pticlic.model; - -import java.io.Serializable; -import java.util.ArrayList; - - -public class Game implements Serializable { - - private static final long serialVersionUID = 1L; - - public static class Word implements Serializable { - - private static final long serialVersionUID = 1L; - private int id; - private String name; - - public Word() {} - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - } - - private int id; - private int cat1; - private int cat2; - private int cat3; - private int cat4; - private Word center; - private Word[] cloud; - - - - public Game(int id, int cat1, int cat2, int cat3, int cat4, Word center, - Word[] cloud) { - super(); - this.id = id; - this.cat1 = cat1; - this.cat2 = cat2; - this.cat3 = cat3; - this.cat4 = cat4; - this.center = center; - this.cloud = cloud; - } - - public int getNbRelation() { - int res = 0; - - if (cat1 != -1) { - res++; - } - if (cat2 != -1) { - res++; - } - if (cat3 != -1) { - res++; - } - if (cat4 != -1) { - res++; - } - - return res; - } - - public static String getName(Word word) { - return word.getName(); - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public int getCat1() { - return cat1; - } - - public void setCat1(int cat1) { - this.cat1 = cat1; - } - - public int getCat2() { - return cat2; - } - - public void setCat2(int cat2) { - this.cat2 = cat2; - } - - public int getCat3() { - return cat3; - } - - public void setCat3(int cat3) { - this.cat3 = cat3; - } - - public int getCat4() { - return cat4; - } - - public void setCat4(int cat4) { - this.cat4 = cat4; - } - - public Word getCentre() { - return center; - } - - public void setCentre(Word center) { - this.center = center; - } - - public int getNbWord() { - return cloud.length; - } - - public Word getWordInCloud(int index) { - return cloud[index]; - } - - @Override - public String toString() { - return "Game [id=" + id + ", cat1=" + cat1 + ", cat2=" + cat2 - + ", cat3=" + cat3 + ", cat4=" + cat4 + ", center=" + center - + ", cloud=" + cloud + "]"; - } -} diff --git a/code/PtiClic/src/org/pticlic/model/GamePlayed.java b/code/PtiClic/src/org/pticlic/model/GamePlayed.java @@ -3,6 +3,14 @@ package org.pticlic.model; import java.io.Serializable; import java.util.ArrayList; +/** + * @author Bertrand BRUN + * + * Cette classe represente une partie joue. + * Elle sera envoyer au serveur pour que celui-ci + * puisse calculer le score obtenue. + * + */ public class GamePlayed implements Serializable { private static final long serialVersionUID = 1L; @@ -10,29 +18,32 @@ public class GamePlayed implements Serializable { private ArrayList<CharSequence> relation2; private ArrayList<CharSequence> relation3; private ArrayList<CharSequence> relation4; - private Game game; + private ArrayList<CharSequence> poubelle; + private DownloadedGame game; public GamePlayed() { relation1 = new ArrayList<CharSequence>(); relation2 = new ArrayList<CharSequence>(); relation3 = new ArrayList<CharSequence>(); relation4 = new ArrayList<CharSequence>(); + poubelle = new ArrayList<CharSequence>(); } - public void setGame(Game game) { + public void setGame(DownloadedGame game) { this.game = game; } - public Game getGame() { + public DownloadedGame getGame() { return game; } public void add(int relation, CharSequence word) { switch (relation) { - case 1: relation1.add(word); break; - case 2: relation2.add(word); break; - case 3: relation3.add(word); break; - case 4: relation4.add(word); break; + case 1: relation1.add(word); break; + case 2: relation2.add(word); break; + case 3: relation3.add(word); break; + case 4: relation4.add(word); break; + default: poubelle.add(word); break; } } } diff --git a/code/PtiClic/src/org/pticlic/model/Network.java b/code/PtiClic/src/org/pticlic/model/Network.java @@ -36,16 +36,22 @@ public class Network { private Mode mode; private String serverURL; + private String id; + private String passwd; /** * Constructeur * * @param serverURL Chaine de caractères représentant l'URL où se situe le serveur. * @param mode Le type de partie que l'on veut récupérer. + * @param id L'indentifiant du joueur. + * @param passwd Le mot de passe de l'utilisateur. */ - public Network(String serverURL, Mode mode) { + public Network(String serverURL, Mode mode, String id, String passwd) { this.mode = mode; this.serverURL = serverURL; + this.id = id; + this.passwd = passwd; } /** @@ -53,12 +59,14 @@ public class Network { * @param nbGames Le nombre de parties que l'on veut récupérer. * @return */ - public Game getGames(int nbGames) { - Game game = null; + public DownloadedGame getGames(int nbGames) { + DownloadedGame game = null; try { URL url = new URL(this.serverURL); URLConnection connection = url.openConnection(); connection.addRequestProperty("action", "getparties"); + connection.addRequestProperty("user", this.id); + connection.addRequestProperty("passwd", this.passwd); connection.addRequestProperty("nb", String.valueOf(nbGames)); connection.addRequestProperty("mode", mode.value()); @@ -89,14 +97,14 @@ public class Network { * @return Une nouvelle instance de Game. * @throws IOException */ - private Game makeGame(JsonReader reader, Gson gson) throws IOException { + private DownloadedGame makeGame(JsonReader reader, Gson gson) throws IOException { int id = -1; int cat1 = -1; int cat2 = -1; int cat3 = -1; int cat4 = -1; - Game.Word center = null; - Game.Word[] cloud = null; + DownloadedGame.Word center = null; + DownloadedGame.Word[] cloud = null; reader.beginObject(); while (reader != null && reader.hasNext()) { @@ -112,15 +120,15 @@ public class Network { } else if (name.equals("cat4")) { cat4 = reader.nextInt(); } else if (name.equals("center")) { - center = gson.fromJson(reader, Game.Word.class); + center = gson.fromJson(reader, DownloadedGame.Word.class); } else if (name.equals("cloud")) { - cloud = gson.fromJson(reader, Game.Word[].class); + cloud = gson.fromJson(reader, DownloadedGame.Word[].class); } else { reader.skipValue(); } } reader.endObject(); - return new Game(id, cat1, cat2, cat3, cat4, center, cloud); + return new DownloadedGame(id, cat1, cat2, cat3, cat4, center, cloud); } @@ -128,25 +136,30 @@ public class Network { * Cette méthode permet d'envoyer les parties au serveur pour qu'il puisse les * rajouter à la base de données, et calculer le score. * @param game La partie jouee par l'utilisateur - * @return <code>true</code> si on a pu envoyer la partie au serveur <code>false</code> sinon. + * @return Le score sous forme JSON. */ - public boolean sendGame(GamePlayed game) { + public DownloadedScore sendGame(GamePlayed game) { + DownloadedScore score = null; try { URL url = new URL(this.serverURL); URLConnection connection = url.openConnection(); connection.addRequestProperty("action", "sendpartie"); + connection.addRequestProperty("user", this.id); + connection.addRequestProperty("passwd", this.passwd); connection.addRequestProperty("mode", mode.value()); Gson gson = new Gson(); String json = gson.toJson(game); connection.addRequestProperty("json", json); + JsonReader reader = new JsonReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); + + // TODO : A changer lorsque je serais exactement ce que renvoie le serveur. + score = gson.fromJson(reader, DownloadedScore.class); - // TODO : Regarder si il ne faudrait pas que le serveur renvoie une valeur indiquant si l'action c'est bien derouler. - connection.connect(); } catch (IOException e) { - return false; + return score; } - return true; + return score; } } diff --git a/code/PtiClic/src/org/pticlic/model/Relation.java b/code/PtiClic/src/org/pticlic/model/Relation.java @@ -0,0 +1,75 @@ +package org.pticlic.model; + +import java.util.HashMap; + +import android.widget.ImageView; + +/** + * @author Bertrand BRUN + * + * Cette classe permet de recuperer le noms ou l'image d'un relation en fonction du numero de son id. + * + */ +public class Relation { + // TODO : Penser a peut etre remplacer les HashMap par une BDD. + + private static Relation instance = null; + + HashMap<Integer, String> stringRelations; + HashMap<Integer, ImageView> imageRelations; + + private Relation() { + stringRelations = new HashMap<Integer, String>(); + stringRelations.put(-1, ""); + stringRelations.put(0, "idée"); + stringRelations.put(1, "raffinement sémantique"); + stringRelations.put(2, "raffinement morphologique"); + stringRelations.put(3, "domaine"); + stringRelations.put(4, "r_pos"); + stringRelations.put(5, "synonyme"); + stringRelations.put(6, "générique"); + stringRelations.put(7, "contraire"); + stringRelations.put(8, "spécifique"); + stringRelations.put(9, "partie"); + stringRelations.put(10, "tout"); + stringRelations.put(11, "locution"); + stringRelations.put(12, "potentiel de FL"); + stringRelations.put(13, "action>agent"); + stringRelations.put(14, "action>patient"); + stringRelations.put(15, "chose>lieu"); + stringRelations.put(16, "action>instrument"); + stringRelations.put(17, "caractéristique"); + stringRelations.put(18, "r_data"); + stringRelations.put(19, "r_lemma"); + stringRelations.put(20, "magn"); + stringRelations.put(21, "antimagn"); + stringRelations.put(22, "famille"); + stringRelations.put(29, "predicat"); + stringRelations.put(30, "lieu>action"); + stringRelations.put(31, "action>lieu"); + stringRelations.put(32, "sentiment"); + stringRelations.put(33, "erreur"); + stringRelations.put(34, "manière"); + stringRelations.put(35, "sens/signification"); + stringRelations.put(36, "information potentielle"); + stringRelations.put(37, "rôle télique"); + stringRelations.put(38, "rôle agentif"); + stringRelations.put(41, "conséquence"); + stringRelations.put(42, "cause"); + stringRelations.put(52, "succession"); + stringRelations.put(53, "produit"); + stringRelations.put(54, "est le produit de"); + stringRelations.put(55, "s'oppose à"); + } + + public synchronized static Relation getInstance() { + if (instance == null) { + instance = new Relation(); + } + return instance; + } + + public String getRelationName(int id) { + return stringRelations.get(id); + } +} diff --git a/code/images/Aide36.png b/code/images/Aide36.png Binary files differ. diff --git a/code/images/Aide48.png b/code/images/Aide48.png Binary files differ. diff --git a/code/images/Aide72.png b/code/images/Aide72.png Binary files differ. diff --git a/code/images/Contenant36.png b/code/images/Contenant36.png Binary files differ. diff --git a/code/images/Contenant48.png b/code/images/Contenant48.png Binary files differ. diff --git a/code/images/Contenant72.png b/code/images/Contenant72.png Binary files differ. diff --git a/code/images/Contenu36.png b/code/images/Contenu36.png Binary files differ. diff --git a/code/images/Contenu48.png b/code/images/Contenu48.png Binary files differ. diff --git a/code/images/Contenu72.png b/code/images/Contenu72.png Binary files differ. diff --git a/code/images/Contraire36.png b/code/images/Contraire36.png Binary files differ. diff --git a/code/images/Contraire48.png b/code/images/Contraire48.png Binary files differ. diff --git a/code/images/Contraire72.png b/code/images/Contraire72.png Binary files differ. diff --git a/code/images/FondLogo.png b/code/images/FondLogo.png Binary files differ. diff --git a/code/images/ModeNormal36.png b/code/images/ModeNormal36.png Binary files differ. diff --git a/code/images/ModeNormal48.png b/code/images/ModeNormal48.png Binary files differ. diff --git a/code/images/ModeNormal72.png b/code/images/ModeNormal72.png Binary files differ. diff --git a/code/images/ModeOmbre36.png b/code/images/ModeOmbre36.png Binary files differ. diff --git a/code/images/ModeOmbre48.png b/code/images/ModeOmbre48.png Binary files differ. diff --git a/code/images/ModeOmbre72.png b/code/images/ModeOmbre72.png Binary files differ. diff --git a/code/images/Rapport36.png b/code/images/Rapport36.png Binary files differ. diff --git a/code/images/Rapport48.png b/code/images/Rapport48.png Binary files differ. diff --git a/code/images/Rapport72.png b/code/images/Rapport72.png Binary files differ. diff --git a/code/images/Synonyme36.png b/code/images/Synonyme36.png Binary files differ. diff --git a/code/images/Synonyme48.png b/code/images/Synonyme48.png Binary files differ. diff --git a/code/images/Synonyme72.png b/code/images/Synonyme72.png Binary files differ.