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 @ 40596

History | View | Annotate | Download (2.87 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
package org.gvsig.app.project.documents.view.toc.gui;
26

    
27
import java.awt.BorderLayout;
28
import java.awt.Color;
29
import java.awt.Dimension;
30

    
31
import javax.swing.JPanel;
32

    
33

    
34
/**
35
 * DOCUMENT ME!
36
 *
37
 * @author vcn To change the template for this generated type comment go to
38
 *         Window>Preferences>Java>Code Generation>Code and
39
 *         Comments
40
 */
41
public class PanelColor extends JPanel {
42
    public Color[] m_colores = new Color[100];
43
    public Color m_color;
44
    private Integer numReg;
45
    private int numreg;
46
    public int a = 155;
47
    public int b = 205;
48
    public int c = 255;
49

    
50
    /**
51
     * Creates a new PanelColor object.
52
     *
53
     * @param numReg DOCUMENT ME!
54
     */
55
    public PanelColor(int numReg) {
56
        //numReg=numReg+1;
57
        //m_color = new Color((numReg*numReg+100)%255,(numReg+(3*numReg+100))%255,numReg%255);
58
        //this.setBackground(m_color);
59
        setLayout(new BorderLayout());
60
                
61
        //add(oneColorPanel);
62
        setMaximumSize(new Dimension(12, 12));
63
        setMinimumSize(new Dimension(12, 12));
64
        setPreferredSize(new Dimension(12, 12));
65
    }
66

    
67
    //private ColorPanel oneColorPanel = new ColorPanel();
68
    //private FourColorPanel fourColorPanel = new LayerColorPanel.FourColorPanel();
69
    public void setColor(Color color) {
70
        m_color = color;
71
        a=color.getRed();
72
        System.out.println("a=color.getRed();"+a);
73
                b=color.getGreen();
74
                System.out.println("b=color.getGreen();"+b);
75
        c=color.getBlue();
76
                System.out.println("c=color.getBlue();"+c);
77
        this.setBackground(color);
78
    }
79

    
80
    /**
81
     * DOCUMENT ME!
82
     */
83
    public void setColorinicial() {
84
        a=155;
85
                b=205;
86
                c=255;
87
        m_color = new Color(a, b, c);
88
        this.setBackground(m_color);
89
    }
90

    
91
    /**
92
     * DOCUMENT ME!
93
     */
94
    public void setColorfin() {
95
        this.m_color = new Color(45, 95, 145);
96
        a=45;
97
        b=95;
98
        c=145;
99
        this.setBackground(m_color);
100
    }
101
}