www

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

commit 91b1fb2123d0803ec5fbd09c09e8d16856ac4c6d
parent 766c9eed0b89d94f8221c868a3fdb58a27d9f0c4
Author: Bertrand BRUN <bertrand0brun@gmail.com>
Date:   Tue,  1 Feb 2011 23:31:59 +0100

Ajout d'une classe Relation permettant de recupere des informations sur les relations (le nom notamment)
Diffstat:
Mcode/PtiClic/res/layout/score.xml | 10+++++-----
Mcode/PtiClic/src/org/pticlic/Score.java | 4++--
Acode/PtiClic/src/org/pticlic/model/Relation.java | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 81 insertions(+), 7 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 @@ -23,7 +23,7 @@ public class Score extends Activity implements OnClickListener{ this.gamePlayed = (GamePlayed) getIntent().getExtras().get(Constant.SCORE_INTENT); } - ((Button)findViewById(R.id.jaivu)).setOnClickListener(this); + ((Button)findViewById(R.id.saw)).setOnClickListener(this); } @@ -41,7 +41,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/model/Relation.java b/code/PtiClic/src/org/pticlic/model/Relation.java @@ -0,0 +1,74 @@ +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(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); + } +}