Revert "Bug 378401: Implementation of time graph widget."
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / colors / ColorsView.java
1 /*******************************************************************************
2 * Copyright (c) 2010 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ui.views.colors;
14
15 import java.util.ArrayList;
16 import java.util.Arrays;
17 import java.util.List;
18 import java.util.Map;
19
20 import org.eclipse.jface.action.Action;
21 import org.eclipse.jface.action.IToolBarManager;
22 import org.eclipse.jface.action.Separator;
23 import org.eclipse.jface.dialogs.Dialog;
24 import org.eclipse.jface.dialogs.MessageDialog;
25 import org.eclipse.jface.resource.ImageDescriptor;
26 import org.eclipse.linuxtools.internal.tmf.ui.Messages;
27 import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
28 import org.eclipse.linuxtools.tmf.ui.views.TmfView;
29 import org.eclipse.linuxtools.tmf.ui.views.filter.FilterDialog;
30 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphProvider;
31 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphProvider;
32 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
33 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
34 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.TimeGraphColorScheme;
35 import org.eclipse.swt.SWT;
36 import org.eclipse.swt.custom.ScrolledComposite;
37 import org.eclipse.swt.events.MouseAdapter;
38 import org.eclipse.swt.events.MouseEvent;
39 import org.eclipse.swt.events.MouseListener;
40 import org.eclipse.swt.events.PaintEvent;
41 import org.eclipse.swt.events.PaintListener;
42 import org.eclipse.swt.events.SelectionAdapter;
43 import org.eclipse.swt.events.SelectionEvent;
44 import org.eclipse.swt.graphics.Color;
45 import org.eclipse.swt.graphics.GC;
46 import org.eclipse.swt.graphics.Image;
47 import org.eclipse.swt.graphics.Point;
48 import org.eclipse.swt.graphics.Rectangle;
49 import org.eclipse.swt.layout.GridData;
50 import org.eclipse.swt.layout.GridLayout;
51 import org.eclipse.swt.widgets.Button;
52 import org.eclipse.swt.widgets.Canvas;
53 import org.eclipse.swt.widgets.ColorDialog;
54 import org.eclipse.swt.widgets.Composite;
55 import org.eclipse.swt.widgets.Control;
56 import org.eclipse.swt.widgets.Display;
57 import org.eclipse.swt.widgets.FileDialog;
58 import org.eclipse.swt.widgets.Label;
59 import org.eclipse.swt.widgets.Shell;
60 import org.eclipse.ui.IActionBars;
61
62 public class ColorsView extends TmfView {
63
64 public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.colors"; //$NON-NLS-1$
65
66 private static final Image ADD_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$
67 private static final Image DELETE_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$
68 private static final Image MOVE_UP_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/moveup_button.gif"); //$NON-NLS-1$
69 private static final Image MOVE_DOWN_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/movedown_button.gif"); //$NON-NLS-1$
70 private static final Image IMPORT_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/import_button.gif"); //$NON-NLS-1$
71 private static final Image EXPORT_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/export_button.gif"); //$NON-NLS-1$
72
73 // ------------------------------------------------------------------------
74 // Main data structures
75 // ------------------------------------------------------------------------
76
77 protected Shell fShell;
78 protected ScrolledComposite fScrolledComposite;
79 protected Composite fListComposite;
80 protected Composite fFillerComposite;
81
82 private ColorSettingRow fSelectedRow = null;
83
84 private TimeGraphColorScheme traceColorScheme = new TimeGraphColorScheme();
85 private ITimeGraphProvider timeAnalysisProvider = new TimeGraphProvider() {
86 @Override
87 public StateColor getEventColor(ITimeEvent event) {
88 return null;
89 }
90 @Override
91 public String getTraceClassName(ITimeGraphEntry trace) {
92 return null;
93 }
94 @Override
95 public String getEventName(ITimeEvent event, boolean upper, boolean extInfo) {
96 return null;
97 }
98 @Override
99 public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) {
100 return null;
101 }
102 @Override
103 public String getStateName(StateColor color) {
104 return null;
105 }};
106
107 Action fAddAction;
108 Action fDeleteAction;
109 Action fMoveUpAction;
110 Action fMoveDownAction;
111 Action fImportAction;
112 Action fExportAction;
113
114 protected List<ColorSetting> fColorSettings;
115
116 // ------------------------------------------------------------------------
117 // Constructor
118 // ------------------------------------------------------------------------
119
120 /**
121 * Default Constructor
122 */
123 public ColorsView() {
124 super("Colors"); //$NON-NLS-1$
125 }
126
127 /* (non-Javadoc)
128 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(Composite)
129 */
130 @Override
131 public void createPartControl(Composite parent) {
132 fShell = parent.getShell();
133
134 fScrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
135 fScrolledComposite.setExpandHorizontal(true);
136 fScrolledComposite.setExpandVertical(true);
137 fListComposite = new Composite(fScrolledComposite, SWT.NONE);
138 fScrolledComposite.setContent(fListComposite);
139
140 GridLayout gl = new GridLayout();
141 gl.marginHeight = 0;
142 gl.marginWidth = 0;
143 gl.verticalSpacing = 1;
144 fListComposite.setLayout(gl);
145
146 fColorSettings = new ArrayList<ColorSetting>(Arrays.asList(ColorSettingsManager.getColorSettings()));
147 for (ColorSetting colorSetting : fColorSettings) {
148 new ColorSettingRow(fListComposite, colorSetting);
149 }
150
151 fFillerComposite = new Composite(fListComposite, SWT.NONE);
152 GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
153 gd.heightHint = 0;
154 fFillerComposite.setLayoutData(gd);
155 gl = new GridLayout();
156 gl.marginHeight = 1;
157 gl.marginWidth = 1;
158 fFillerComposite.setLayout(gl);
159 Label fillerLabel = new Label(fFillerComposite, SWT.NONE);
160 fillerLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
161 fillerLabel.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
162
163 fFillerComposite.addPaintListener(new PaintListener() {
164 @Override
165 public void paintControl(PaintEvent e) {
166 if (fSelectedRow == null) {
167 Color lineColor = Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
168 Point p = fFillerComposite.getSize();
169 GC gc = e.gc;
170 gc.setForeground(lineColor);
171 gc.drawLine(0, 0, p.x - 1, 0);
172 }
173 }
174 });
175
176 MouseListener mouseListener = new MouseAdapter() {
177 @Override
178 public void mouseDown(MouseEvent e) {
179 fSelectedRow = null;
180 refresh();
181 }
182 };
183 fillerLabel.addMouseListener(mouseListener);
184
185 fScrolledComposite.setMinSize(fListComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
186
187 fillToolBar();
188 }
189
190 /* (non-Javadoc)
191 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
192 */
193 @Override
194 public void setFocus() {
195 fScrolledComposite.setFocus();
196 }
197
198 public void refresh() {
199 fListComposite.layout();
200 fScrolledComposite.setMinSize(fListComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
201 fListComposite.redraw(0, 0, fListComposite.getBounds().width, fListComposite.getBounds().height, true);
202 if (fSelectedRow == null) {
203 fDeleteAction.setEnabled(false);
204 fMoveUpAction.setEnabled(false);
205 fMoveDownAction.setEnabled(false);
206 } else {
207 fDeleteAction.setEnabled(true);
208 fMoveUpAction.setEnabled(true);
209 fMoveDownAction.setEnabled(true);
210 }
211 }
212
213 private void fillToolBar() {
214
215 fAddAction = new AddAction();
216 fAddAction.setImageDescriptor(ImageDescriptor.createFromImage(ADD_IMAGE));
217 fAddAction.setToolTipText(Messages.ColorsView_AddActionToolTipText);
218
219 fDeleteAction = new DeleteAction();
220 fDeleteAction.setImageDescriptor(ImageDescriptor.createFromImage(DELETE_IMAGE));
221 fDeleteAction.setToolTipText(Messages.ColorsView_DeleteActionToolTipText);
222 fDeleteAction.setEnabled(false);
223
224 fMoveUpAction = new MoveUpAction();
225 fMoveUpAction.setImageDescriptor(ImageDescriptor.createFromImage(MOVE_UP_IMAGE));
226 fMoveUpAction.setToolTipText(Messages.ColorsView_MoveUpActionToolTipText);
227 fMoveUpAction.setEnabled(false);
228
229 fMoveDownAction = new MoveDownAction();
230 fMoveDownAction.setImageDescriptor(ImageDescriptor.createFromImage(MOVE_DOWN_IMAGE));
231 fMoveDownAction.setToolTipText(Messages.ColorsView_MoveDownActionToolTipText);
232 fMoveDownAction.setEnabled(false);
233
234 fExportAction = new ExportAction();
235 fExportAction.setImageDescriptor(ImageDescriptor.createFromImage(EXPORT_IMAGE));
236 fExportAction.setToolTipText(Messages.ColorsView_ExportActionToolTipText);
237
238 fImportAction = new ImportAction();
239 fImportAction.setImageDescriptor(ImageDescriptor.createFromImage(IMPORT_IMAGE));
240 fImportAction.setToolTipText(Messages.ColorsView_ImportActionToolTipText);
241
242 IActionBars bars = getViewSite().getActionBars();
243 IToolBarManager manager = bars.getToolBarManager();
244 manager.add(fAddAction);
245 manager.add(fDeleteAction);
246 manager.add(fMoveUpAction);
247 manager.add(fMoveDownAction);
248 manager.add(new Separator());
249 manager.add(fExportAction);
250 manager.add(fImportAction);
251 }
252
253 private class AddAction extends Action {
254 @Override
255 public void run() {
256 ColorSetting colorSetting = new ColorSetting(
257 Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB(),
258 Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB(),
259 TimeGraphColorScheme.BLACK_STATE,
260 null);
261 ColorSettingRow row = new ColorSettingRow(fListComposite, colorSetting);
262 if (fSelectedRow == null) {
263 fColorSettings.add(colorSetting);
264 row.moveAbove(fFillerComposite);
265 } else {
266 fColorSettings.add(fColorSettings.indexOf(fSelectedRow.getColorSetting()), colorSetting);
267 row.moveAbove(fSelectedRow);
268 }
269 fSelectedRow = row;
270 refresh();
271 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
272 }
273 }
274
275 private class DeleteAction extends Action {
276 @Override
277 public void run() {
278 if (fSelectedRow != null) {
279 int index = fColorSettings.indexOf(fSelectedRow.getColorSetting());
280 fColorSettings.remove(index);
281 fSelectedRow.fColorSetting.dispose();
282 fSelectedRow.dispose();
283 if (index < fColorSettings.size()) {
284 fSelectedRow = (ColorSettingRow) fListComposite.getChildren()[index];
285 } else {
286 fSelectedRow = null;
287 }
288 refresh();
289 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
290 }
291 }
292 }
293
294 private class MoveUpAction extends Action {
295 @Override
296 public void run() {
297 if (fSelectedRow != null) {
298 int index = fColorSettings.indexOf(fSelectedRow.getColorSetting());
299 if (index > 0) {
300 fColorSettings.add(index - 1, fColorSettings.remove(index));
301 fSelectedRow.moveAbove(fListComposite.getChildren()[index - 1]);
302 refresh();
303 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
304 }
305 }
306 }
307 }
308
309 private class MoveDownAction extends Action {
310 @Override
311 public void run() {
312 if (fSelectedRow != null) {
313 int index = fColorSettings.indexOf(fSelectedRow.getColorSetting());
314 if (index < fColorSettings.size() - 1) {
315 fColorSettings.add(index + 1, fColorSettings.remove(index));
316 fSelectedRow.moveBelow(fListComposite.getChildren()[index + 1]);
317 refresh();
318 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
319 }
320 }
321 }
322 }
323
324 private class ExportAction extends Action {
325 @Override
326 public void run() {
327 FileDialog fileDialog = new FileDialog(fShell, SWT.SAVE);
328 fileDialog.setFilterExtensions(new String[] {"*.xml"}); //$NON-NLS-1$
329 fileDialog.setOverwrite(true);
330 String pathName = fileDialog.open();
331 if (pathName != null) {
332 ColorSettingsXML.save(pathName, fColorSettings.toArray(new ColorSetting[0]));
333 }
334 }
335 }
336
337 private class ImportAction extends Action {
338 @Override
339 public void run() {
340 FileDialog fileDialog = new FileDialog(fShell, SWT.OPEN);
341 fileDialog.setFilterExtensions(new String[] {"*.xml"}); //$NON-NLS-1$
342 String pathName = fileDialog.open();
343 if (pathName != null) {
344 ColorSetting[] colorSettings = ColorSettingsXML.load(pathName);
345 if (colorSettings.length > 0) {
346 if (fColorSettings.size() > 0) {
347 boolean overwrite = MessageDialog.openQuestion(fShell,
348 Messages.ColorsView_ImportOverwriteDialogTitle,
349 Messages.ColorsView_ImportOverwriteDialogMessage1 +
350 Messages.ColorsView_ImportOverwriteDialogMessage2);
351 if (overwrite) {
352 for (Control control : fListComposite.getChildren()) {
353 if (control instanceof ColorSettingRow) {
354 ((ColorSettingRow) control).fColorSetting.dispose();
355 control.dispose();
356 }
357 }
358 fColorSettings = new ArrayList<ColorSetting>();
359 fSelectedRow = null;
360 }
361 }
362 for (ColorSetting colorSetting : colorSettings) {
363 ColorSettingRow row = new ColorSettingRow(fListComposite, colorSetting);
364 if (fSelectedRow == null) {
365 fColorSettings.add(colorSetting);
366 row.moveAbove(fFillerComposite);
367 } else {
368 fColorSettings.add(fColorSettings.indexOf(fSelectedRow.getColorSetting()), colorSetting);
369 row.moveAbove(fSelectedRow);
370 }
371 }
372 refresh();
373 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
374 }
375 }
376 }
377 }
378
379 private class ColorSettingRow extends Composite {
380
381 ColorSetting fColorSetting;
382
383 public ColorSettingRow(final Composite parent, final ColorSetting colorSetting) {
384 super(parent, SWT.NONE);
385 fColorSetting = colorSetting;
386
387 setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
388
389 setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
390 GridLayout gl = new GridLayout(7, false);
391 gl.marginHeight = 1;
392 gl.marginWidth = 1;
393 gl.horizontalSpacing = 1;
394 gl.verticalSpacing = 0;
395 setLayout(gl);
396
397 final Button fgButton = new Button(this, SWT.PUSH);
398 fgButton.setText(Messages.ColorsView_ForegroundButtonText);
399 fgButton.setSize(fgButton.computeSize(SWT.DEFAULT, 19));
400 fgButton.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
401
402 final Button bgButton = new Button(this, SWT.PUSH);
403 bgButton.setText(Messages.ColorsView_BackgroundButtonText);
404 bgButton.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
405
406 final Composite labelComposite = new Composite(this, SWT.NONE);
407 labelComposite.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, false, false));
408 gl = new GridLayout();
409 gl.marginHeight = 0;
410 gl.marginWidth = 0;;
411 labelComposite.setLayout(gl);
412 labelComposite.setBackground(colorSetting.getBackgroundColor());
413
414 final Label label = new Label(labelComposite, SWT.NONE);
415 label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, true));
416 label.setText(" Text "); //$NON-NLS-1$
417 label.setForeground(colorSetting.getForegroundColor());
418 label.setBackground(colorSetting.getBackgroundColor());
419
420 fgButton.addSelectionListener(new SelectionAdapter() {
421 @Override
422 public void widgetSelected(SelectionEvent e) {
423 fSelectedRow = ColorSettingRow.this;
424 refresh();
425 ColorDialog dialog = new ColorDialog(fShell);
426 dialog.setRGB(colorSetting.getForegroundRGB());
427 dialog.setText(Messages.ColorsView_ForegroundDialogText);
428 dialog.open();
429 colorSetting.setForegroundRGB(dialog.getRGB());
430 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
431 label.setForeground(colorSetting.getForegroundColor());
432 }});
433
434 bgButton.addSelectionListener(new SelectionAdapter() {
435 @Override
436 public void widgetSelected(SelectionEvent e) {
437 fSelectedRow = ColorSettingRow.this;
438 refresh();
439 ColorDialog dialog = new ColorDialog(fShell);
440 dialog.setRGB(colorSetting.getBackgroundRGB());
441 dialog.setText(Messages.ColorsView_BackgroundDialogText);
442 dialog.open();
443 colorSetting.setBackgroundRGB(dialog.getRGB());
444 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
445 labelComposite.setBackground(colorSetting.getBackgroundColor());
446 label.setBackground(colorSetting.getBackgroundColor());
447 }});
448
449 final Button tickButton = new Button(this, SWT.PUSH);
450 tickButton.setText(Messages.ColorsView_TickButtonText);
451 tickButton.setSize(tickButton.computeSize(SWT.DEFAULT, 19));
452 tickButton.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
453
454 final Canvas tickCanvas = new Canvas(this, SWT.NONE);
455 GridData gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
456 gd.widthHint = 12;
457 gd.heightHint = bgButton.getSize().y;
458 tickCanvas.setLayoutData(gd);
459 tickCanvas.setBackground(traceColorScheme.getBkColor(false, false, false));
460 tickCanvas.addPaintListener(new PaintListener() {
461 @Override
462 public void paintControl(PaintEvent e) {
463 Rectangle bounds = tickCanvas.getBounds();
464 e.gc.setForeground(traceColorScheme.getColor(TimeGraphColorScheme.MID_LINE));
465 int midy = bounds.y + bounds.height / 2 - 1;
466 //int midy = e.y + e.height / 2;
467 e.gc.drawLine(e.x, midy, e.x + e.width, midy);
468 Rectangle rect = new Rectangle(e.x + 1, bounds.y + 2, 0, bounds.height - 6);
469 for (int i = 1; i <= 3; i++) {
470 rect.x += i;
471 rect.width = i;
472 timeAnalysisProvider.drawState(traceColorScheme, fColorSetting.getTickColorIndex(), rect, e.gc, false, false, false);
473 }
474 }});
475
476 tickButton.addSelectionListener(new SelectionAdapter() {
477 @Override
478 public void widgetSelected(SelectionEvent e) {
479 fSelectedRow = ColorSettingRow.this;
480 refresh();
481 TickColorDialog dialog = new TickColorDialog(fShell);
482 dialog.setColorIndex(colorSetting.getTickColorIndex());
483 dialog.open();
484 if (dialog.getReturnCode() == Dialog.OK) {
485 if (dialog.getColorIndex() != colorSetting.getTickColorIndex()) {
486 colorSetting.setTickColorIndex(dialog.getColorIndex());
487 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
488 refresh();
489 }
490 }
491 }});
492
493 final Button filterButton = new Button(this, SWT.PUSH);
494 filterButton.setText(Messages.ColorsView_FilterButtonText);
495 filterButton.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
496
497 final Label filterText = new Label(this, SWT.NONE);
498 if (colorSetting.getFilter() != null) {
499 filterText.setText(colorSetting.getFilter().toString());
500 filterText.setToolTipText(colorSetting.getFilter().toString());
501 }
502 filterText.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
503 filterText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
504
505 filterButton.addSelectionListener(new SelectionAdapter() {
506 @Override
507 public void widgetSelected(SelectionEvent e) {
508 fSelectedRow = ColorSettingRow.this;
509 refresh();
510 FilterDialog dialog = new FilterDialog(fShell);
511 dialog.setFilter(colorSetting.getFilter());
512 dialog.open();
513 if (dialog.getReturnCode() == Dialog.OK) {
514 if (dialog.getFilter() != null) {
515 colorSetting.setFilter(dialog.getFilter());
516 filterText.setText(dialog.getFilter().toString());
517 filterText.setToolTipText(dialog.getFilter().toString());
518 } else {
519 colorSetting.setFilter(null);
520 filterText.setText(""); //$NON-NLS-1$
521 filterText.setToolTipText(""); //$NON-NLS-1$
522 }
523 ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
524 refresh();
525 }
526 }});
527
528 addPaintListener(new PaintListener() {
529 @Override
530 public void paintControl(PaintEvent e) {
531 if (fSelectedRow == ColorSettingRow.this) {
532 Color borderColor = Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
533 Point p = ColorSettingRow.this.getSize();
534 Rectangle rect = new Rectangle(0, 0, p.x - 1, p.y - 1);
535 GC gc = e.gc;
536 gc.setForeground(borderColor);
537 gc.drawRectangle(rect);
538 }
539 }
540 });
541
542 MouseListener mouseListener = new MouseAdapter() {
543 @Override
544 public void mouseDown(MouseEvent e) {
545 fSelectedRow = ColorSettingRow.this;
546 refresh();
547 }
548 };
549 addMouseListener(mouseListener);
550 label.addMouseListener(mouseListener);
551 tickCanvas.addMouseListener(mouseListener);
552 filterText.addMouseListener(mouseListener);
553 }
554
555 /**
556 * @return the ColorSetting
557 */
558 public ColorSetting getColorSetting() {
559 return fColorSetting;
560 }
561
562 }
563 }
This page took 0.055021 seconds and 6 git commands to generate.