root / tmp / org.txm.analec.rcp / src / visuAnalec / Message.java @ 1005
Historique | Voir | Annoter | Télécharger (3,21 ko)
| 1 |
/*
|
|---|---|
| 2 |
* To change this template, choose Tools | Templates
|
| 3 |
* and open the template in the editor.
|
| 4 |
*/
|
| 5 |
package visuAnalec; |
| 6 |
|
| 7 |
import java.util.*; |
| 8 |
import visuAnalec.elements.*; |
| 9 |
|
| 10 |
/**
|
| 11 |
*
|
| 12 |
* @author Bernard
|
| 13 |
*/
|
| 14 |
public class Message extends EventObject { |
| 15 |
public enum TypeMessage { |
| 16 |
CLEAR_CORPUS, |
| 17 |
NEW_CORPUS, |
| 18 |
MODIF_TEXTE, |
| 19 |
MODIF_ELEMENT, |
| 20 |
MODIF_STRUCTURE, |
| 21 |
MODIF_VUE, |
| 22 |
CORPUS_SAVED // corpus annotation and structure are saved
|
| 23 |
} |
| 24 |
|
| 25 |
public enum TypeModifElement { |
| 26 |
AJOUT_UNITE, |
| 27 |
SUP_UNITE, |
| 28 |
BORNES_UNITE, |
| 29 |
AJOUT_RELATION, |
| 30 |
SUP_RELATION, |
| 31 |
AJOUT_SCHEMA, |
| 32 |
MODIF_SCHEMA, |
| 33 |
SUP_SCHEMA, |
| 34 |
MODIF_VALEUR, |
| 35 |
} |
| 36 |
|
| 37 |
public enum TypeModifStructure { |
| 38 |
AJOUT_TYPE_ET_ELEMENTS, |
| 39 |
AJOUT_TYPE, |
| 40 |
AJOUT_PROP, |
| 41 |
AJOUT_FORME_UNITE, |
| 42 |
AJOUT_VALEUR, |
| 43 |
RENOM_TYPE, |
| 44 |
RENOM_PROP, |
| 45 |
RENOM_VALEUR, |
| 46 |
FUSION_TYPE, |
| 47 |
FUSION_PROP, |
| 48 |
FUSION_VALEUR, |
| 49 |
SUPPR_TYPE, |
| 50 |
SUPPR_PROP, |
| 51 |
SUPPR_VALEUR, |
| 52 |
VALEUR_PAR_DEFAUT, |
| 53 |
} |
| 54 |
|
| 55 |
public enum TypeModifVue { |
| 56 |
EXTRACTION, |
| 57 |
NEW_VUE, |
| 58 |
VUE_DEFAUT, |
| 59 |
} |
| 60 |
TypeMessage type; |
| 61 |
public Message(Object source, TypeMessage type) { |
| 62 |
super(source);
|
| 63 |
this.type = type;
|
| 64 |
} |
| 65 |
public TypeMessage getType() {
|
| 66 |
return type;
|
| 67 |
} |
| 68 |
|
| 69 |
public static class VueEvent extends Message { |
| 70 |
private TypeModifVue modif;
|
| 71 |
private Unite unite;
|
| 72 |
private String[] args; |
| 73 |
public VueEvent(Object source, TypeModifVue modif, String... args) { |
| 74 |
super(source, TypeMessage.MODIF_VUE);
|
| 75 |
this.modif = modif;
|
| 76 |
this.args = args;
|
| 77 |
} |
| 78 |
public VueEvent(Object source, TypeModifVue modif, Unite unite, String... args) { |
| 79 |
super(source, TypeMessage.MODIF_VUE);
|
| 80 |
this.unite = unite;
|
| 81 |
this.modif = modif;
|
| 82 |
this.args = args;
|
| 83 |
} |
| 84 |
public TypeModifVue getModif() {
|
| 85 |
return modif;
|
| 86 |
} |
| 87 |
public Unite getUnite() {
|
| 88 |
return unite;
|
| 89 |
} |
| 90 |
public String getArg() { |
| 91 |
return args[0]; |
| 92 |
} |
| 93 |
public String getArg(int i) { |
| 94 |
return args[i];
|
| 95 |
} |
| 96 |
} |
| 97 |
|
| 98 |
public static class ElementEvent extends Message { |
| 99 |
private TypeModifElement modif;
|
| 100 |
private Element element; |
| 101 |
private String[] args; |
| 102 |
public ElementEvent(Object source, TypeModifElement modif, Element element, String... args) { |
| 103 |
super(source, TypeMessage.MODIF_ELEMENT);
|
| 104 |
this.modif = modif;
|
| 105 |
this.element = element;
|
| 106 |
this.args = args;
|
| 107 |
} |
| 108 |
public TypeModifElement getModif() {
|
| 109 |
return modif;
|
| 110 |
} |
| 111 |
public Element getElement() { |
| 112 |
return element;
|
| 113 |
} |
| 114 |
public String getArg() { |
| 115 |
return args[0]; |
| 116 |
} |
| 117 |
public String getArg(int i) { |
| 118 |
return args[i];
|
| 119 |
} |
| 120 |
} |
| 121 |
|
| 122 |
public static class StructureEvent extends Message { |
| 123 |
private TypeModifStructure modif;
|
| 124 |
private Class<? extends Element> classe; |
| 125 |
private String[] args; |
| 126 |
public StructureEvent(Object source, TypeModifStructure modif, Class<? extends Element> classe, String... args) { |
| 127 |
super(source, TypeMessage.MODIF_STRUCTURE);
|
| 128 |
this.modif = modif;
|
| 129 |
this.classe = classe;
|
| 130 |
this.args = args;
|
| 131 |
} |
| 132 |
public TypeModifStructure getModif() {
|
| 133 |
return modif;
|
| 134 |
} |
| 135 |
public Class<? extends Element> getClasse() { |
| 136 |
return classe;
|
| 137 |
} |
| 138 |
public String getArg() { |
| 139 |
return args[0]; |
| 140 |
} |
| 141 |
public String getArg(int i) { |
| 142 |
return args[i];
|
| 143 |
} |
| 144 |
} |
| 145 |
} |
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|