Révision 2620
tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAParametersDialog.java (revision 2620) | ||
---|---|---|
51 | 51 |
import org.txm.searchengine.cqp.corpus.CQPCorpus; |
52 | 52 |
import org.txm.searchengine.cqp.corpus.Property; |
53 | 53 |
import org.txm.searchengine.cqp.corpus.WordProperty; |
54 |
|
|
54 | 55 |
/** |
55 | 56 |
* Retrieve the property analysis to be used for computing correspondence |
56 | 57 |
* analysis. and also the max number of entries and their minimal frequency |
... | ... | |
59 | 60 |
* @author sloiseau |
60 | 61 |
* |
61 | 62 |
*/ |
63 |
// FIXME: SJ: no more in use, check if some code is needed then remove this class |
|
64 |
@Deprecated |
|
62 | 65 |
public class CAParametersDialog extends Dialog { |
63 |
|
|
66 |
|
|
64 | 67 |
/** The property. */ |
65 | 68 |
private WordProperty property; |
66 | 69 |
|
... | ... | |
84 | 87 |
|
85 | 88 |
/** The corpus. */ |
86 | 89 |
CQPCorpus corpus; |
87 |
|
|
90 |
|
|
88 | 91 |
/** The title. */ |
89 | 92 |
String title; |
90 | 93 |
|
... | ... | |
96 | 99 |
|
97 | 100 |
/** The fmin, default value read from CA preferences. */ |
98 | 101 |
private int fmin = CAPreferences.getInstance().getInt(CAPreferences.F_MIN); |
99 |
|
|
102 |
|
|
100 | 103 |
/** |
101 | 104 |
* Instantiates a new compute correspondence analysis dialog. |
102 | 105 |
* |
... | ... | |
108 | 111 |
try { |
109 | 112 |
this.corpus = corpus; |
110 | 113 |
this.title = title; |
111 |
this.properties = new ArrayList<WordProperty>(corpus.getOrderedProperties()); |
|
112 |
} catch (CqiClientException e) { |
|
114 |
this.properties = new ArrayList<>(corpus.getOrderedProperties()); |
|
115 |
} |
|
116 |
catch (CqiClientException e) { |
|
113 | 117 |
org.txm.utils.logger.Log.printStackTrace(e); |
114 | 118 |
} |
115 | 119 |
} |
116 |
|
|
120 |
|
|
117 | 121 |
/** |
118 | 122 |
* Instantiates a new compute correspondence analysis dialog. |
119 | 123 |
* |
... | ... | |
129 | 133 |
this.title = title; |
130 | 134 |
this.mess = mess; |
131 | 135 |
try { |
132 |
this.properties = new ArrayList<WordProperty>(corpus.getOrderedProperties()); |
|
133 |
} catch (CqiClientException e) { |
|
136 |
this.properties = new ArrayList<>(corpus.getOrderedProperties()); |
|
137 |
} |
|
138 |
catch (CqiClientException e) { |
|
134 | 139 |
org.txm.utils.logger.Log.printStackTrace(e); |
135 | 140 |
} |
136 | 141 |
} |
137 |
|
|
138 |
/* (non-Javadoc) |
|
142 |
|
|
143 |
/* |
|
144 |
* (non-Javadoc) |
|
139 | 145 |
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) |
140 | 146 |
*/ |
141 | 147 |
@Override |
... | ... | |
145 | 151 |
if (title != null) |
146 | 152 |
newShell.setText(title); |
147 | 153 |
} |
148 |
|
|
149 |
/* (non-Javadoc) |
|
154 |
|
|
155 |
/* |
|
156 |
* (non-Javadoc) |
|
150 | 157 |
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) |
151 | 158 |
*/ |
152 | 159 |
@Override |
... | ... | |
154 | 161 |
Composite composite = new Composite(parent, SWT.NONE); |
155 | 162 |
GridLayout layout = new GridLayout(2, false); |
156 | 163 |
composite.setLayout(layout); |
157 |
|
|
164 |
|
|
158 | 165 |
Label anaPropLabel = new Label(composite, SWT.NONE); |
159 | 166 |
if (mess != null) { |
160 | 167 |
anaPropLabel.setText(mess); |
... | ... | |
164 | 171 |
} |
165 | 172 |
anaPropLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, |
166 | 173 |
false, false)); |
167 |
|
|
174 |
|
|
168 | 175 |
anaPropCombo = new Combo(composite, SWT.READ_ONLY); |
169 | 176 |
anaPropCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, |
170 | 177 |
true, false)); |
171 |
int iword= 0; |
|
178 |
int iword = 0;
|
|
172 | 179 |
int i = 0; |
173 | 180 |
for (Property p : properties) { |
174 | 181 |
anaPropCombo.add(p.getName()); |
175 | 182 |
if (p.getName().equals(TXMPreferences.DEFAULT_UNIT_PROPERTY)) { |
176 |
iword=i;
|
|
183 |
iword = i;
|
|
177 | 184 |
} |
178 | 185 |
i++; |
179 | 186 |
} |
180 | 187 |
anaPropCombo.select(iword); |
181 |
|
|
188 |
|
|
182 | 189 |
maxlinesLabel = new Label(composite, SWT.NONE); |
183 | 190 |
maxlinesLabel.setText(TXMCoreMessages.common_numberOfLines); |
184 | 191 |
maxlinesLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false)); |
... | ... | |
197 | 204 |
fminSpinner.setMaximum(9999999); |
198 | 205 |
fminSpinner.setMinimum(1); |
199 | 206 |
fminSpinner.setSelection(fmin); |
200 |
|
|
207 |
|
|
201 | 208 |
return composite; |
202 | 209 |
} |
203 |
|
|
204 |
/* (non-Javadoc) |
|
210 |
|
|
211 |
/* |
|
212 |
* (non-Javadoc) |
|
205 | 213 |
* @see org.eclipse.jface.dialogs.Dialog#okPressed() |
206 | 214 |
*/ |
207 | 215 |
@Override |
... | ... | |
214 | 222 |
return; |
215 | 223 |
} |
216 | 224 |
property = properties.get(propIndex); |
217 |
|
|
225 |
|
|
218 | 226 |
vmax = maxlinesSpinner.getSelection(); |
219 | 227 |
fmin = fminSpinner.getSelection(); |
220 | 228 |
super.okPressed(); |
221 | 229 |
} |
222 |
|
|
230 |
|
|
223 | 231 |
/** |
224 | 232 |
* Gets the property. |
225 | 233 |
* |
... | ... | |
228 | 236 |
public WordProperty getProperty() { |
229 | 237 |
return property; |
230 | 238 |
} |
231 |
|
|
239 |
|
|
232 | 240 |
/** |
233 | 241 |
* Gets the fmin. |
234 | 242 |
* |
... | ... | |
237 | 245 |
public int getFmin() { |
238 | 246 |
return fmin; |
239 | 247 |
} |
240 |
|
|
248 |
|
|
241 | 249 |
/** |
242 | 250 |
* Gets the max lines. |
243 | 251 |
* |
... | ... | |
251 | 259 |
this.fmin = fmin; |
252 | 260 |
this.vmax = vmax; |
253 | 261 |
} |
254 |
} |
|
262 |
} |
Formats disponibles : Unified diff