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 @ 40558
History | View | Annotate | Download (5.01 KB)
1 | 40558 | jjdelcerro | /**
|
---|---|---|---|
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 | 40435 | jjdelcerro | /*
|
25 | * Created on 14-dic-2004
|
||
26 | *
|
||
27 | * TODO To change the template for this generated file go to
|
||
28 | * Window - Preferences - Java - Code Generation - Code and Comments
|
||
29 | */
|
||
30 | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
||
31 | *
|
||
32 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
33 | *
|
||
34 | * This program is free software; you can redistribute it and/or
|
||
35 | * modify it under the terms of the GNU General Public License
|
||
36 | * as published by the Free Software Foundation; either version 2
|
||
37 | * of the License, or (at your option) any later version.
|
||
38 | *
|
||
39 | * This program is distributed in the hope that it will be useful,
|
||
40 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
41 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
42 | * GNU General Public License for more details.
|
||
43 | *
|
||
44 | * You should have received a copy of the GNU General Public License
|
||
45 | * along with this program; if not, write to the Free Software
|
||
46 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
47 | *
|
||
48 | * For more information, contact:
|
||
49 | *
|
||
50 | * Generalitat Valenciana
|
||
51 | * Conselleria d'Infraestructures i Transport
|
||
52 | * Av. Blasco Ib??ez, 50
|
||
53 | * 46010 VALENCIA
|
||
54 | * SPAIN
|
||
55 | *
|
||
56 | * +34 963862235
|
||
57 | * gvsig@gva.es
|
||
58 | * www.gvsig.gva.es
|
||
59 | *
|
||
60 | * or
|
||
61 | *
|
||
62 | * IVER T.I. S.A
|
||
63 | * Salamanca 50
|
||
64 | * 46005 Valencia
|
||
65 | * Spain
|
||
66 | *
|
||
67 | * +34 963163400
|
||
68 | * dac@iver.es
|
||
69 | */
|
||
70 | package org.gvsig.app.project.documents.view.legend.gui; |
||
71 | |||
72 | import javax.swing.ImageIcon; |
||
73 | import javax.swing.JPanel; |
||
74 | |||
75 | import org.gvsig.fmap.mapcontext.layers.FLayer; |
||
76 | import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
||
77 | |||
78 | |||
79 | /**
|
||
80 | * @author jaume dominguez faus - jaume.dominguez@iver.es
|
||
81 | *
|
||
82 | * Este interfaz es el que debe cumplir cualquier panel que empleemos
|
||
83 | * para confeccionar una leyenda. Se le pasa una capa para que
|
||
84 | * tome su leyenda, y con el m?todo getLegend tomamos la leyenda
|
||
85 | * que ha confeccionado el usuario.
|
||
86 | */
|
||
87 | public interface ILegendPanel { |
||
88 | /**
|
||
89 | * Initializes the data required for this legend panel. That is, the layer that
|
||
90 | * will adopt the changes and the current legend that this layer has. If the
|
||
91 | * legend is not the type of legend that this panel manages then it initializes
|
||
92 | * the panel with the default values. In case it is, then the panel should
|
||
93 | * refresh its components with the current values of the Legend.
|
||
94 | * @param lyr, target layer
|
||
95 | * @param legend, the legend currently applied to lyr
|
||
96 | */
|
||
97 | public void setData(FLayer lyr, ILegend legend); |
||
98 | |||
99 | /**
|
||
100 | * Returns an instance of Legend
|
||
101 | * @return Legend, the legend result of the settings
|
||
102 | */
|
||
103 | public ILegend getLegend();
|
||
104 | |||
105 | /**
|
||
106 | * Returns a brief human-readable description about what kind of legend builds this panel
|
||
107 | * @return String with a brief description
|
||
108 | */
|
||
109 | public String getDescription(); |
||
110 | |||
111 | /**
|
||
112 | * Returns the icon which should graphically describe what this panel's legend does.
|
||
113 | * @return ImageIcon with the icon to be displayed
|
||
114 | */
|
||
115 | public ImageIcon getIcon(); |
||
116 | |||
117 | /**
|
||
118 | * If this panel should appear as a subnode of the legends tree, in other words it is not
|
||
119 | * a first-level node, then this method would return <b>its parent's class</b>. Otherwise, if
|
||
120 | * it is a first-level node, then it will return <b>null</b>.
|
||
121 | * @return String containing the parent's title.
|
||
122 | */
|
||
123 | public Class getParentClass(); |
||
124 | |||
125 | /**
|
||
126 | * Returns the title (a human-readable one) of this panel.
|
||
127 | */
|
||
128 | public String getTitle(); |
||
129 | |||
130 | /**
|
||
131 | * <p>If this is a complete panel (it is a child node in the legend tree) to set up a legend
|
||
132 | * this method will return a <b>JPanel</b> containing the necessary components. Otherwise, if
|
||
133 | * it is just a classification node (it has children) in the legend tree it will return
|
||
134 | * just <b>null</b>.<br></p>
|
||
135 | *
|
||
136 | * <p>If <b>null</b> is returned, the ILegendPanel that will be shown and selected each time
|
||
137 | * it is selected is the very first child of this parent node.</p>
|
||
138 | */
|
||
139 | public JPanel getPanel(); |
||
140 | |||
141 | /**
|
||
142 | * Returns the class of the legend produced by this ILegendPanel.
|
||
143 | */
|
||
144 | public Class getLegendClass(); |
||
145 | |||
146 | /**
|
||
147 | * Returns <b>true</b> if this legend is applicable to this layer, <b>false</b> otherwise.
|
||
148 | */
|
||
149 | public boolean isSuitableFor(FLayer layer); |
||
150 | } |