Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / toc / gui / PanelColor.java @ 40558

History | View | Annotate | Download (4.22 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
/*
25
 * Created on 27-feb-2004
26
 *
27
 * To change the template for this generated file go to
28
 * Window>Preferences>Java>Code Generation>Code and Comments
29
 */
30
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
31
 *
32
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
33
 *
34
 * This program is free software; you can redistribute it and/or
35
 * modify it under the terms of the GNU General Public License
36
 * as published by the Free Software Foundation; either version 2
37
 * of the License, or (at your option) any later version.
38
 *
39
 * This program is distributed in the hope that it will be useful,
40
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
42
 * GNU General Public License for more details.
43
 *
44
 * You should have received a copy of the GNU General Public License
45
 * along with this program; if not, write to the Free Software
46
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
47
 *
48
 * For more information, contact:
49
 *
50
 *  Generalitat Valenciana
51
 *   Conselleria d'Infraestructures i Transport
52
 *   Av. Blasco Ib??ez, 50
53
 *   46010 VALENCIA
54
 *   SPAIN
55
 *
56
 *      +34 963862235
57
 *   gvsig@gva.es
58
 *      www.gvsig.gva.es
59
 *
60
 *    or
61
 *
62
 *   IVER T.I. S.A
63
 *   Salamanca 50
64
 *   46005 Valencia
65
 *   Spain
66
 *
67
 *   +34 963163400
68
 *   dac@iver.es
69
 */
70
package org.gvsig.app.project.documents.view.toc.gui;
71

    
72
import java.awt.BorderLayout;
73
import java.awt.Color;
74
import java.awt.Dimension;
75

    
76
import javax.swing.JPanel;
77

    
78

    
79
/**
80
 * DOCUMENT ME!
81
 *
82
 * @author vcn To change the template for this generated type comment go to
83
 *         Window>Preferences>Java>Code Generation>Code and
84
 *         Comments
85
 */
86
public class PanelColor extends JPanel {
87
    public Color[] m_colores = new Color[100];
88
    public Color m_color;
89
    private Integer numReg;
90
    private int numreg;
91
    public int a = 155;
92
    public int b = 205;
93
    public int c = 255;
94

    
95
    /**
96
     * Creates a new PanelColor object.
97
     *
98
     * @param numReg DOCUMENT ME!
99
     */
100
    public PanelColor(int numReg) {
101
        //numReg=numReg+1;
102
        //m_color = new Color((numReg*numReg+100)%255,(numReg+(3*numReg+100))%255,numReg%255);
103
        //this.setBackground(m_color);
104
        setLayout(new BorderLayout());
105
                
106
        //add(oneColorPanel);
107
        setMaximumSize(new Dimension(12, 12));
108
        setMinimumSize(new Dimension(12, 12));
109
        setPreferredSize(new Dimension(12, 12));
110
    }
111

    
112
    //private ColorPanel oneColorPanel = new ColorPanel();
113
    //private FourColorPanel fourColorPanel = new LayerColorPanel.FourColorPanel();
114
    public void setColor(Color color) {
115
        m_color = color;
116
        a=color.getRed();
117
        System.out.println("a=color.getRed();"+a);
118
                b=color.getGreen();
119
                System.out.println("b=color.getGreen();"+b);
120
        c=color.getBlue();
121
                System.out.println("c=color.getBlue();"+c);
122
        this.setBackground(color);
123
    }
124

    
125
    /**
126
     * DOCUMENT ME!
127
     */
128
    public void setColorinicial() {
129
        a=155;
130
                b=205;
131
                c=255;
132
        m_color = new Color(a, b, c);
133
        this.setBackground(m_color);
134
    }
135

    
136
    /**
137
     * DOCUMENT ME!
138
     */
139
    public void setColorfin() {
140
        this.m_color = new Color(45, 95, 145);
141
        a=45;
142
        b=95;
143
        c=145;
144
        this.setBackground(m_color);
145
    }
146
}