in progress (special coloring is still true)
[jalview.git] / forester / java / src / org / forester / development / AbstractRenderer.java
1 // $Id:
2 // forester -- software libraries and applications
3 // for genomics and evolutionary biology research.
4 //
5 // Copyright (C) 2010 Christian M Zmasek
6 // Copyright (C) 2010 Sanford-Burnham Medical Research Institute
7 // All rights reserved
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 //
23 // Contact: phylosoft @ gmail . com
24 // WWW: https://sites.google.com/site/cmzmasek/home/software/forester
25
26 package org.forester.development;
27
28 import java.awt.Color;
29 import java.awt.Graphics;
30
31 import javax.swing.JComponent;
32
33 public abstract class AbstractRenderer extends JComponent {
34
35     /**
36      * 
37      */
38     private static final long serialVersionUID   = 7236434322552764776L;
39     static final Color        DEFAULT_COLOR      = new Color( 0, 0, 0 );
40     static final Color        MARKED_COLOR       = new Color( 255, 255, 0 );
41     static final Color        USER_FLAGGED_COLOR = new Color( 255, 0, 255 );
42     static final Color        SELECTED_COLOR     = new Color( 255, 0, 0 );
43     int                       _x;
44     int                       _y;
45     int                       _well_size;
46     byte                      _status;
47
48     public AbstractRenderer() {
49     }
50
51     abstract MsaRenderer getParentPlateRenderer();
52
53     byte getStatus() {
54         return _status;
55     }
56
57     int getWellSize() {
58         return _well_size;
59     }
60
61     @Override
62     public int getX() {
63         return _x;
64     }
65
66     @Override
67     public int getY() {
68         return _y;
69     }
70
71     abstract boolean isSelected();
72
73     @Override
74     public abstract void paint( Graphics g );
75
76     abstract void setIsSelected( boolean flag );
77
78     void setStatus( final byte status ) {
79         _status = status;
80     }
81
82     void setWellSize( final int well_size ) {
83         _well_size = well_size;
84     }
85
86     void setX( final int x ) {
87         _x = x;
88     }
89
90     void setY( final int y ) {
91         _y = y;
92     }
93 }