Révision 1939
| tmp/org.txm.ca.rcp/src/org/txm/ca/rcp/editors/CAFactorialMapChartEditor.java (revision 1939) | ||
|---|---|---|
| 4 | 4 |
import java.awt.event.ComponentEvent; |
| 5 | 5 |
import java.awt.event.ComponentListener; |
| 6 | 6 |
|
| 7 |
import org.eclipse.jface.viewers.ArrayContentProvider; |
|
| 8 |
import org.eclipse.jface.viewers.ComboViewer; |
|
| 9 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
|
| 10 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
|
| 11 | 7 |
import org.eclipse.swt.SWT; |
| 12 | 8 |
import org.eclipse.swt.custom.CLabel; |
| 13 | 9 |
import org.eclipse.swt.events.SelectionEvent; |
| ... | ... | |
| 184 | 180 |
|
| 185 | 181 |
|
| 186 | 182 |
// Factors plane selection |
| 187 |
new ToolItem(this.chartToolBar, SWT.SEPARATOR); |
|
| 188 |
|
|
| 189 | 183 |
CLabel factorsLabel = new CLabel(this.chartToolBar, SWT.CENTER); |
| 190 | 184 |
factorsLabel.setText(CAUIMessages.axesColon); |
| 191 | 185 |
this.chartToolBar.addControl(factorsLabel); |
| 192 | 186 |
|
| 193 |
String items[] = { "(1,2)", "(1,3)", "(2,3)" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
| 194 |
|
|
| 195 |
|
|
| 196 |
// |
|
| 197 |
// ToolItem renderingComboItem = new ToolItem(this.chartToolBar, SWT.SEPARATOR); |
|
| 198 |
// |
|
| 199 |
// final ComboViewer plansComboViewer = new ComboViewer(this.chartToolBar); |
|
| 200 |
// plansComboViewer.setContentProvider(ArrayContentProvider.getInstance()); |
|
| 201 |
// plansComboViewer.setInput(items); |
|
| 202 |
// //this.chartToolBar.addControl(plansComboViewer.getCombo()); |
|
| 203 |
// |
|
| 204 |
// renderingComboItem.setControl(plansComboViewer.getControl()); |
|
| 205 |
// plansComboViewer.getControl().pack(); |
|
| 206 |
// renderingComboItem.setWidth(plansComboViewer.getControl().getBounds().width); |
|
| 207 |
// |
|
| 208 |
// |
|
| 209 |
// // Preselect the plan from the CA data |
|
| 210 |
// if(this.getIntParameterValue(CAPreferences.FIRST_DIMENSION) == 2) {
|
|
| 211 |
// plansComboViewer.getCombo().select(2); |
|
| 212 |
// } |
|
| 213 |
// else if(this.getIntParameterValue(CAPreferences.SECOND_DIMENSION) == 3) {
|
|
| 214 |
// plansComboViewer.getCombo().select(1); |
|
| 215 |
// } |
|
| 216 |
// else {
|
|
| 217 |
// plansComboViewer.getCombo().select(0); |
|
| 218 |
// } |
|
| 219 |
// |
|
| 220 |
// plansComboViewer.getControl().pack(); |
|
| 221 |
// |
|
| 222 |
// plansComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
|
|
| 223 |
// |
|
| 224 |
// @Override |
|
| 225 |
// public void selectionChanged(SelectionChangedEvent e) {
|
|
| 226 |
// // TODO Auto-generated method stub |
|
| 227 |
// boolean resetView = false; |
|
| 228 |
// |
|
| 229 |
// // Change factors |
|
| 230 |
// if(e.getSource() == plansComboViewer) {
|
|
| 231 |
// |
|
| 232 |
// Combo plans = (Combo) ((ComboViewer) e.getSource()).getCombo(); |
|
| 233 |
// |
|
| 234 |
// int dimension1 = 1; |
|
| 235 |
// int dimension2 = 2; |
|
| 236 |
// |
|
| 237 |
// String str = plans.getItem(plans.getSelectionIndex()); |
|
| 238 |
// str = str.substring(1, str.length() -1); // remove ( and ) |
|
| 239 |
// String[] split = str.split(","); // 2 items //$NON-NLS-1$
|
|
| 240 |
// dimension1 = Integer.parseInt(split[0]); |
|
| 241 |
// dimension2 = Integer.parseInt(split[1]); |
|
| 242 |
// |
|
| 243 |
// getResult().setFirstDimension(dimension1); |
|
| 244 |
// getResult().setSecondDimension(dimension2); |
|
| 245 |
// |
|
| 246 |
// resetView = true; |
|
| 247 |
// } |
|
| 248 |
// getResult().setChartDirty(); |
|
| 249 |
// getResult().setNeedsToResetView(resetView); |
|
| 250 |
// compute(true); |
|
| 251 |
// } |
|
| 252 |
// }); |
|
| 253 |
|
|
| 254 |
ToolItem plansComboItem = new ToolItem(this.chartToolBar, SWT.SEPARATOR); |
|
| 255 | 187 |
final Combo plansCombo = new Combo(this.chartToolBar, SWT.READ_ONLY); |
| 256 | 188 |
|
| 257 |
plansComboItem.setControl(plansCombo); |
|
| 258 |
plansCombo.pack(); |
|
| 259 |
plansComboItem.setWidth(plansCombo.getBounds().width); |
|
| 260 |
|
|
| 261 | 189 |
// FIXME: commented because the infos panel is not ready to manage more axes |
| 262 | 190 |
// ArrayList<String> planes = null; |
| 263 | 191 |
// try {
|
| ... | ... | |
| 277 | 205 |
// } |
| 278 | 206 |
// String [] items = planes.toArray(new String[planes.size()]); |
| 279 | 207 |
|
| 208 |
String items[] = { "(1,2)", "(1,3)", "(2,3)" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
|
| 280 | 209 |
|
| 281 | 210 |
// TODO : commented because the infos panel is not ready to manage more axes |
| 282 | 211 |
// if(couples != null && couples.size() > 3) {
|
| ... | ... | |
| 297 | 226 |
plansCombo.select(0); |
| 298 | 227 |
} |
| 299 | 228 |
|
| 300 |
//this.chartToolBar.addControl(plansCombo);
|
|
| 229 |
this.chartToolBar.addControl(plansCombo); |
|
| 301 | 230 |
|
| 302 | 231 |
// Listeners |
| 303 | 232 |
SelectionListener listener = new SelectionListener() {
|
| ... | ... | |
| 349 | 278 |
this.vMaxSpinner.setMinimum(1); |
| 350 | 279 |
} |
| 351 | 280 |
|
| 281 |
this.chartToolBar.pack(); |
|
| 282 |
|
|
| 352 | 283 |
} |
| 353 | 284 |
|
| 354 | 285 |
@Override |
Formats disponibles : Unified diff