2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.molecular
.editor
;
12 import info
.bioinfweb
.libralign
.dataarea
.implementations
.pherogram
.PherogramArea
;
13 import info
.bioinfweb
.tic
.input
.TICMouseAdapter
;
14 import info
.bioinfweb
.tic
.input
.TICMouseEvent
;
16 import org
.eclipse
.ui
.PartInitException
;
18 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
19 import eu
.etaxonomy
.taxeditor
.molecular
.TaxeditorMolecularPlugin
;
20 import eu
.etaxonomy
.taxeditor
.molecular
.handler
.ShowPherogramHandler
;
21 import eu
.etaxonomy
.taxeditor
.molecular
.l10n
.Messages
;
26 * Listens to mouse events on data areas displaying a pherogram in {@link AlignmentEditor}.
31 public class PherogramMouseListener
extends TICMouseAdapter
{
32 private final PherogramArea area
;
35 public PherogramMouseListener(PherogramArea area
) {
42 public boolean mousePressed(TICMouseEvent event
) {
43 if (event
.getClickCount() == 2) { // Double click
45 ShowPherogramHandler
.showPherogram(area
.getModel());
47 catch (PartInitException e
) {
48 MessagingUtils
.errorDialog(Messages
.PherogramMouseListener_UNABLE_TO_CREATE_VIEW
, null, e
.getLocalizedMessage(),
49 TaxeditorMolecularPlugin
.PLUGIN_ID
, e
, false); //TODO set pluginID