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 / legend / gui / ILegendPanel.java @ 40596
History | View | Annotate | Download (3.66 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.legend.gui; |
26 |
|
27 |
import javax.swing.ImageIcon; |
28 |
import javax.swing.JPanel; |
29 |
|
30 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
31 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
32 |
|
33 |
|
34 |
/**
|
35 |
* @author jaume dominguez faus - jaume.dominguez@iver.es
|
36 |
*
|
37 |
* Este interfaz es el que debe cumplir cualquier panel que empleemos
|
38 |
* para confeccionar una leyenda. Se le pasa una capa para que
|
39 |
* tome su leyenda, y con el m?todo getLegend tomamos la leyenda
|
40 |
* que ha confeccionado el usuario.
|
41 |
*/
|
42 |
public interface ILegendPanel { |
43 |
/**
|
44 |
* Initializes the data required for this legend panel. That is, the layer that
|
45 |
* will adopt the changes and the current legend that this layer has. If the
|
46 |
* legend is not the type of legend that this panel manages then it initializes
|
47 |
* the panel with the default values. In case it is, then the panel should
|
48 |
* refresh its components with the current values of the Legend.
|
49 |
* @param lyr, target layer
|
50 |
* @param legend, the legend currently applied to lyr
|
51 |
*/
|
52 |
public void setData(FLayer lyr, ILegend legend); |
53 |
|
54 |
/**
|
55 |
* Returns an instance of Legend
|
56 |
* @return Legend, the legend result of the settings
|
57 |
*/
|
58 |
public ILegend getLegend();
|
59 |
|
60 |
/**
|
61 |
* Returns a brief human-readable description about what kind of legend builds this panel
|
62 |
* @return String with a brief description
|
63 |
*/
|
64 |
public String getDescription(); |
65 |
|
66 |
/**
|
67 |
* Returns the icon which should graphically describe what this panel's legend does.
|
68 |
* @return ImageIcon with the icon to be displayed
|
69 |
*/
|
70 |
public ImageIcon getIcon(); |
71 |
|
72 |
/**
|
73 |
* If this panel should appear as a subnode of the legends tree, in other words it is not
|
74 |
* a first-level node, then this method would return <b>its parent's class</b>. Otherwise, if
|
75 |
* it is a first-level node, then it will return <b>null</b>.
|
76 |
* @return String containing the parent's title.
|
77 |
*/
|
78 |
public Class getParentClass(); |
79 |
|
80 |
/**
|
81 |
* Returns the title (a human-readable one) of this panel.
|
82 |
*/
|
83 |
public String getTitle(); |
84 |
|
85 |
/**
|
86 |
* <p>If this is a complete panel (it is a child node in the legend tree) to set up a legend
|
87 |
* this method will return a <b>JPanel</b> containing the necessary components. Otherwise, if
|
88 |
* it is just a classification node (it has children) in the legend tree it will return
|
89 |
* just <b>null</b>.<br></p>
|
90 |
*
|
91 |
* <p>If <b>null</b> is returned, the ILegendPanel that will be shown and selected each time
|
92 |
* it is selected is the very first child of this parent node.</p>
|
93 |
*/
|
94 |
public JPanel getPanel(); |
95 |
|
96 |
/**
|
97 |
* Returns the class of the legend produced by this ILegendPanel.
|
98 |
*/
|
99 |
public Class getLegendClass(); |
100 |
|
101 |
/**
|
102 |
* Returns <b>true</b> if this legend is applicable to this layer, <b>false</b> otherwise.
|
103 |
*/
|
104 |
public boolean isSuitableFor(FLayer layer); |
105 |
} |
106 |
|