Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / project / documents / view / legend / gui / ILegendPanel.java @ 28407

History | View | Annotate | Download (4.07 KB)

1 7304 caballero
/*
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 com.iver.cit.gvsig.project.documents.view.legend.gui;
48
49 18623 jdominguez
import javax.swing.ImageIcon;
50 10679 jaume
import javax.swing.JPanel;
51
52 7304 caballero
import com.iver.cit.gvsig.fmap.layers.FLayer;
53 11558 jaume
import com.iver.cit.gvsig.fmap.rendering.ILegend;
54 7304 caballero
55
/**
56 10679 jaume
 * @author jaume dominguez faus - jaume.dominguez@iver.es
57 7304 caballero
 *
58
 * Este interfaz es el que debe cumplir cualquier panel que empleemos
59 10679 jaume
 * para confeccionar una leyenda. Se le pasa una capa para que
60 7304 caballero
 * tome su leyenda, y con el m?todo getLegend tomamos la leyenda
61
 * que ha confeccionado el usuario.
62
 */
63
public interface ILegendPanel {
64 10679 jaume
        /**
65
         * Initializes the data required for this legend panel. That is, the layer that
66
         * will adopt the changes and the current legend that this layer has. If the
67 20779 vcaballero
         * legend is not the type of legend that this panel manages then it initializes
68 10679 jaume
         * the panel with the default values. In case it is, then the panel should
69
         * refresh its components with the current values of the Legend.
70
         * @param lyr,  target layer
71
         * @param legend, the legend currently applied to lyr
72
         */
73 11558 jaume
        public void setData(FLayer lyr, ILegend legend);
74 7304 caballero
75 10679 jaume
        /**
76
         * Returns an instance of Legend
77
         * @return Legend, the legend result of the settings
78
         */
79 11558 jaume
        public ILegend getLegend();
80 10679 jaume
81
        /**
82
         * Returns a brief human-readable description about what kind of legend builds this panel
83
         * @return String with a brief description
84
         */
85
        public String getDescription();
86
87
        /**
88
         * Returns the icon which should graphically describe what this panel's legend does.
89
         * @return ImageIcon with the icon to be displayed
90
         */
91 18623 jdominguez
        public ImageIcon getIcon();
92 10679 jaume
93
        /**
94
         * If this panel should appear as a subnode of the legends tree, in other words it is not
95
         * a first-level node, then this method would return <b>its parent's class</b>. Otherwise, if
96
         * it is a first-level node, then it will return <b>null</b>.
97
         * @return String containing the parent's title.
98
         */
99
        public Class getParentClass();
100
101
        /**
102
         * Returns the title (a human-readable one) of this panel.
103
         */
104
        public String getTitle();
105
106
        /**
107
         * <p>If this is a complete panel (it is a child node in the legend tree) to set up a legend
108
         * this method will return a <b>JPanel</b> containing the necessary components. Otherwise, if
109
         * it is just a classification node (it has children) in the legend tree it will return
110
         * just <b>null</b>.<br></p>
111
         *
112
         * <p>If <b>null</b> is returned, the ILegendPanel that will be shown and selected each time
113
         * it is selected is the very first child of this parent node.</p>
114
         */
115
        public JPanel getPanel();
116
117
        /**
118
         * Returns the class of the legend produced by this ILegendPanel.
119
         */
120
        public Class getLegendClass();
121 11704 jaume
122
        /**
123
         * Returns <b>true</b> if this legend is applicable to this layer, <b>false</b> otherwise.
124
         */
125
        public boolean isSuitableFor(FLayer layer);
126 7304 caballero
}