~ubuntu-branches/debian/jessie/ugene/jessie

« back to all changes in this revision

Viewing changes to src/corelibs/U2View/src/util_ov_msaedit/MSAEditorNameList.h

  • Committer: Package Import Robot
  • Author(s): Steffen Moeller
  • Date: 2011-11-02 13:29:07 UTC
  • mfrom: (1.2.1) (3.1.11 natty)
  • Revision ID: package-import@ubuntu.com-20111102132907-o34gwnt0uj5g6hen
Tags: 1.9.8+repack-1
* First release to Debian
  - added README.Debian
  - increased policy version to 3.9.2
  - added URLs for version control system
* Added debug package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * UGENE - Integrated Bioinformatics Tools.
 
3
 * Copyright (C) 2008-2011 UniPro <ugene@unipro.ru>
 
4
 * http://ugene.unipro.ru
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
19
 * MA 02110-1301, USA.
 
20
 */
 
21
 
 
22
#ifndef _U2_MSA_EDITOR_NAME_LIST_H_
 
23
#define _U2_MSA_EDITOR_NAME_LIST_H_
 
24
 
 
25
#include <U2Core/global.h>
 
26
#include <U2Core/U2Region.h>
 
27
 
 
28
#include <QtGui/QMenu>
 
29
#include <QtGui/QScrollBar>
 
30
#include <QtGui/QRubberBand>
 
31
 
 
32
namespace U2 {
 
33
 
 
34
class MSAEditor;
 
35
class MSAEditorUI;
 
36
class GObjectView;
 
37
class MAlignment;
 
38
class MAlignmentModInfo;
 
39
class MSAEditorSelection;
 
40
 
 
41
class MSAEditorNameList: public QWidget {
 
42
    Q_OBJECT
 
43
public:
 
44
    MSAEditorNameList(MSAEditorUI* ui, QScrollBar* nhBar);
 
45
    ~MSAEditorNameList();
 
46
 
 
47
private slots:
 
48
    void sl_buildStaticMenu(GObjectView* v, QMenu* m);
 
49
    void sl_buildContextMenu(GObjectView* v, QMenu* m);
 
50
    void sl_copyCurrentSequence();
 
51
    void sl_editSequenceName();
 
52
    void sl_lockedStateChanged();
 
53
    void sl_removeCurrentSequence();
 
54
    void sl_alignmentChanged(const MAlignment&, const MAlignmentModInfo&);
 
55
    void sl_onScrollBarActionTriggered( int scrollAction );
 
56
    
 
57
    void sl_startChanged(const QPoint& p, const QPoint& prev);
 
58
    void sl_selectionChanged(const MSAEditorSelection& current, const MSAEditorSelection& prev);
 
59
 
 
60
    void sl_nameBarMoved(int n);
 
61
    void sl_fontChanged();
 
62
 
 
63
protected:
 
64
    void resizeEvent(QResizeEvent* e);
 
65
    void paintEvent(QPaintEvent* e);
 
66
    void keyPressEvent (QKeyEvent *e);
 
67
    void mousePressEvent(QMouseEvent *e);
 
68
    void mouseMoveEvent(QMouseEvent* e);
 
69
    void mouseReleaseEvent(QMouseEvent *e);
 
70
    void mouseDoubleClickEvent(QMouseEvent *e);
 
71
    void focusOutEvent(QFocusEvent* fe);
 
72
    void focusInEvent(QFocusEvent* fe);
 
73
    void wheelEvent (QWheelEvent * we);
 
74
    //todo context menu?
 
75
 
 
76
private:
 
77
    bool isRowInSelection(int row);
 
78
    void updateActions();
 
79
    void buildMenu(QMenu* m);
 
80
    void updateScrollBar();
 
81
    void updateSelection(int newSeqNum);
 
82
    void moveSelectedRegion( int shift );
 
83
    void drawAll();
 
84
    void drawContent(QPainter& p);
 
85
    void drawSelection(QPainter& p);
 
86
    void drawSequenceItem(QPainter& p, int n, bool selected);
 
87
    void drawFocus(QPainter& p);
 
88
    
 
89
    MSAEditor*          editor;
 
90
    MSAEditorUI*        ui;
 
91
    QScrollBar*         nhBar;
 
92
    int                 curSeq;
 
93
    QPoint              origin;
 
94
    bool                scribbling,shifting;
 
95
 
 
96
    QRubberBand*        rubberBand;
 
97
    QAction*            editSequenceNameAction;
 
98
    QAction*            copyCurrentSequenceAction;
 
99
    QAction*            removeCurrentSequenceAction;
 
100
    QPixmap*            cachedView;
 
101
    bool                completeRedraw;
 
102
 
 
103
};
 
104
 
 
105
}//namespace
 
106
#endif