Statistics
| Revision:

root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / documents / view / legend / gui / ILegendPanel.java @ 29598

History | View | Annotate | Download (4.07 KB)

1
/*
2
 * Created on 14-dic-2004
3
 *
4
 * TODO 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 org.gvsig.app.project.documents.view.legend.gui;
48

    
49
import javax.swing.ImageIcon;
50
import javax.swing.JPanel;
51

    
52
import org.gvsig.fmap.mapcontext.layers.FLayer;
53
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
54

    
55

    
56
/**
57
 * @author jaume dominguez faus - jaume.dominguez@iver.es
58
 *
59
 * Este interfaz es el que debe cumplir cualquier panel que empleemos
60
 * para confeccionar una leyenda. Se le pasa una capa para que
61
 * tome su leyenda, y con el m?todo getLegend tomamos la leyenda
62
 * que ha confeccionado el usuario.
63
 */
64
public interface ILegendPanel {
65
        /**
66
         * Initializes the data required for this legend panel. That is, the layer that
67
         * will adopt the changes and the current legend that this layer has. If the
68
         * legend is not the type of legend that this panel manages then it initializes
69
         * the panel with the default values. In case it is, then the panel should
70
         * refresh its components with the current values of the Legend.
71
         * @param lyr,  target layer
72
         * @param legend, the legend currently applied to lyr
73
         */
74
        public void setData(FLayer lyr, ILegend legend);
75

    
76
        /**
77
         * Returns an instance of Legend
78
         * @return Legend, the legend result of the settings
79
         */
80
        public ILegend getLegend();
81

    
82
        /**
83
         * Returns a brief human-readable description about what kind of legend builds this panel
84
         * @return String with a brief description
85
         */
86
        public String getDescription();
87

    
88
        /**
89
         * Returns the icon which should graphically describe what this panel's legend does.
90
         * @return ImageIcon with the icon to be displayed
91
         */
92
        public ImageIcon getIcon();
93

    
94
        /**
95
         * If this panel should appear as a subnode of the legends tree, in other words it is not
96
         * a first-level node, then this method would return <b>its parent's class</b>. Otherwise, if
97
         * it is a first-level node, then it will return <b>null</b>.
98
         * @return String containing the parent's title.
99
         */
100
        public Class getParentClass();
101

    
102
        /**
103
         * Returns the title (a human-readable one) of this panel.
104
         */
105
        public String getTitle();
106

    
107
        /**
108
         * <p>If this is a complete panel (it is a child node in the legend tree) to set up a legend
109
         * this method will return a <b>JPanel</b> containing the necessary components. Otherwise, if
110
         * it is just a classification node (it has children) in the legend tree it will return
111
         * just <b>null</b>.<br></p>
112
         *
113
         * <p>If <b>null</b> is returned, the ILegendPanel that will be shown and selected each time
114
         * it is selected is the very first child of this parent node.</p>
115
         */
116
        public JPanel getPanel();
117

    
118
        /**
119
         * Returns the class of the legend produced by this ILegendPanel.
120
         */
121
        public Class getLegendClass();
122

    
123
        /**
124
         * Returns <b>true</b> if this legend is applicable to this layer, <b>false</b> otherwise.
125
         */
126
        public boolean isSuitableFor(FLayer layer);
127
}
128