svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / toc / PanelColor.java @ 4496
History | View | Annotate | Download (3.26 KB)
1 |
/*
|
---|---|
2 |
* Created on 27-feb-2004
|
3 |
*
|
4 |
* To change the template for this generated file go to
|
5 |
* Window>Preferences>Java>Code Generation>Code and Comments
|
6 |
*/
|
7 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
8 |
*
|
9 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
10 |
*
|
11 |
* This program is free software; you can redistribute it and/or
|
12 |
* modify it under the terms of the GNU General Public License
|
13 |
* as published by the Free Software Foundation; either version 2
|
14 |
* of the License, or (at your option) any later version.
|
15 |
*
|
16 |
* This program is distributed in the hope that it will be useful,
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19 |
* GNU General Public License for more details.
|
20 |
*
|
21 |
* You should have received a copy of the GNU General Public License
|
22 |
* along with this program; if not, write to the Free Software
|
23 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
24 |
*
|
25 |
* For more information, contact:
|
26 |
*
|
27 |
* Generalitat Valenciana
|
28 |
* Conselleria d'Infraestructures i Transport
|
29 |
* Av. Blasco Ib??ez, 50
|
30 |
* 46010 VALENCIA
|
31 |
* SPAIN
|
32 |
*
|
33 |
* +34 963862235
|
34 |
* gvsig@gva.es
|
35 |
* www.gvsig.gva.es
|
36 |
*
|
37 |
* or
|
38 |
*
|
39 |
* IVER T.I. S.A
|
40 |
* Salamanca 50
|
41 |
* 46005 Valencia
|
42 |
* Spain
|
43 |
*
|
44 |
* +34 963163400
|
45 |
* dac@iver.es
|
46 |
*/
|
47 |
package com.iver.cit.gvsig.gui.toc; |
48 |
|
49 |
import java.awt.BorderLayout; |
50 |
import java.awt.Color; |
51 |
import java.awt.Dimension; |
52 |
|
53 |
import javax.swing.JPanel; |
54 |
|
55 |
|
56 |
/**
|
57 |
* DOCUMENT ME!
|
58 |
*
|
59 |
* @author vcn To change the template for this generated type comment go to
|
60 |
* Window>Preferences>Java>Code Generation>Code and
|
61 |
* Comments
|
62 |
*/
|
63 |
public class PanelColor extends JPanel { |
64 |
public Color[] m_colores = new Color[100]; |
65 |
public Color m_color; |
66 |
private Integer numReg; |
67 |
private int numreg; |
68 |
public int a = 155; |
69 |
public int b = 205; |
70 |
public int c = 255; |
71 |
|
72 |
/**
|
73 |
* Creates a new PanelColor object.
|
74 |
*
|
75 |
* @param numReg DOCUMENT ME!
|
76 |
*/
|
77 |
public PanelColor(int numReg) { |
78 |
//numReg=numReg+1;
|
79 |
//m_color = new Color((numReg*numReg+100)%255,(numReg+(3*numReg+100))%255,numReg%255);
|
80 |
//this.setBackground(m_color);
|
81 |
setLayout(new BorderLayout()); |
82 |
|
83 |
//add(oneColorPanel);
|
84 |
setMaximumSize(new Dimension(12, 12)); |
85 |
setMinimumSize(new Dimension(12, 12)); |
86 |
setPreferredSize(new Dimension(12, 12)); |
87 |
} |
88 |
|
89 |
//private ColorPanel oneColorPanel = new ColorPanel();
|
90 |
//private FourColorPanel fourColorPanel = new LayerColorPanel.FourColorPanel();
|
91 |
public void setColor(Color color) { |
92 |
m_color = color; |
93 |
a=color.getRed(); |
94 |
System.out.println("a=color.getRed();"+a); |
95 |
b=color.getGreen(); |
96 |
System.out.println("b=color.getGreen();"+b); |
97 |
c=color.getBlue(); |
98 |
System.out.println("c=color.getBlue();"+c); |
99 |
this.setBackground(color);
|
100 |
} |
101 |
|
102 |
/**
|
103 |
* DOCUMENT ME!
|
104 |
*/
|
105 |
public void setColorinicial() { |
106 |
a=155;
|
107 |
b=205;
|
108 |
c=255;
|
109 |
m_color = new Color(a, b, c); |
110 |
this.setBackground(m_color);
|
111 |
} |
112 |
|
113 |
/**
|
114 |
* DOCUMENT ME!
|
115 |
*/
|
116 |
public void setColorfin() { |
117 |
this.m_color = new Color(45, 95, 145); |
118 |
a=45;
|
119 |
b=95;
|
120 |
c=145;
|
121 |
this.setBackground(m_color);
|
122 |
} |
123 |
} |