gvsig-raster / org.gvsig.raster / trunk / org.gvsig.raster / org.gvsig.raster.swing / org.gvsig.raster.swing.api / src / main / java / org / gvsig / raster / swing / gcanvas / GCanvas.java @ 2584
History | View | Annotate | Download (5.34 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
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 2
|
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 |
*/
|
22 |
package org.gvsig.raster.swing.gcanvas; |
23 |
|
24 |
import java.awt.Color; |
25 |
import java.awt.Graphics; |
26 |
import java.awt.event.MouseListener; |
27 |
import java.awt.event.MouseMotionListener; |
28 |
import java.util.List; |
29 |
|
30 |
/**
|
31 |
* Canvas where graphic elements are painted
|
32 |
* @author Nacho Brodin (nachobrodin@gmail.com)
|
33 |
*/
|
34 |
public interface GCanvas extends MouseListener, MouseMotionListener { |
35 |
/**
|
36 |
* Creates a border layer to the graphic canvas
|
37 |
* @param color
|
38 |
* @return
|
39 |
*/
|
40 |
public DrawableElement createBorderLayerForGCanvas(Color color); |
41 |
|
42 |
/**
|
43 |
* Creates a information layer for the graphic canvas
|
44 |
* @param colorLayer
|
45 |
* @return
|
46 |
*/
|
47 |
public InfoLayer createInfoLayerForGCanvas(Color colorLayer); |
48 |
|
49 |
/**
|
50 |
* Creates a histogram for the graphic canvas
|
51 |
* @param data
|
52 |
* @param color
|
53 |
* @return
|
54 |
*/
|
55 |
public GraphicHistogram createHistogramForGCanvas(double[] data, Color color); |
56 |
|
57 |
/**
|
58 |
* Creates a minmax layer for the graphic canvas
|
59 |
* @param color
|
60 |
* @return
|
61 |
*/
|
62 |
public MinMaxLines createMinMaxLinesForGCanvas(Color color); |
63 |
|
64 |
/**
|
65 |
* Creates a straight line layer for the graphic canvas
|
66 |
* @param color
|
67 |
* @return
|
68 |
*/
|
69 |
public StraightLine createStraightLineForGCanvas(Color color); |
70 |
|
71 |
/**
|
72 |
* Creates a logaritmic or exponential function layer for the graphic canvas
|
73 |
* @param color
|
74 |
* @return
|
75 |
*/
|
76 |
public LogaritmicExponentialLine createLogaritmicExponentialLineForGCanvas(Color color, double point); |
77 |
|
78 |
/**
|
79 |
* Creates a square root or pow line function for the graphic canvas
|
80 |
* @param color
|
81 |
* @return
|
82 |
*/
|
83 |
public SquareRootPowLine createSquareRootPowLineForGCanvas(Color color, double point); |
84 |
|
85 |
/**
|
86 |
* Creates a density slice function for the graphic canvas
|
87 |
* @param color
|
88 |
* @return
|
89 |
*/
|
90 |
public DensitySlicingLine createDensitySliceForGCanvas(Color color, int levels); |
91 |
|
92 |
|
93 |
public void addBorder(int x1, int y1, int x2, int y2); |
94 |
|
95 |
/**
|
96 |
* A?adir un listener a la lista de eventos
|
97 |
* @param listener
|
98 |
*/
|
99 |
public void addValueChangedListener(IGCanvasListener listener); |
100 |
|
101 |
/**
|
102 |
* Borrar un listener de la lista de eventos
|
103 |
* @param listener
|
104 |
*/
|
105 |
public void removeValueChangedListener(IGCanvasListener listener); |
106 |
|
107 |
/**
|
108 |
* Invocar a los eventos asociados al componente
|
109 |
*/
|
110 |
public void callDataChanged(String key, Object value); |
111 |
|
112 |
/**
|
113 |
* Invocar a los eventos asociados al componente
|
114 |
*/
|
115 |
public void callDataDragged(String key, Object value); |
116 |
|
117 |
/**
|
118 |
* A?ade un elemento dibujable a la lista
|
119 |
* @param element
|
120 |
*/
|
121 |
public void addDrawableElement(DrawableElement element); |
122 |
|
123 |
/**
|
124 |
* Reemplaza un elemento dibujable si encuentra uno de su mismo tipo
|
125 |
* @param element
|
126 |
*/
|
127 |
public void replaceDrawableElement(DrawableElement element); |
128 |
|
129 |
/**
|
130 |
* Obtiene todos los elementos dibujable que sean una instancia de c1
|
131 |
* @param c1
|
132 |
* @return ArrayList de DrawableElements
|
133 |
*/
|
134 |
public List<DrawableElement> getDrawableElements(Class<?> c1); |
135 |
|
136 |
/**
|
137 |
* Reemplaza un elemento dibujable si encuentra uno del tipo especificado en el
|
138 |
* parametro c1
|
139 |
* @param element
|
140 |
* @param c1
|
141 |
*/
|
142 |
public void replaceDrawableElement(DrawableElement element, Class<?> cl); |
143 |
|
144 |
/**
|
145 |
* Elimina un elemento dibujable
|
146 |
* @param Class clase del elemento a eliminar
|
147 |
*/
|
148 |
public void removeDrawableElement(Class<?> cl); |
149 |
|
150 |
/**
|
151 |
* Asigna una lista de elementos dibujables
|
152 |
* @return
|
153 |
*/
|
154 |
public void setDrawableElements(List<DrawableElement> list); |
155 |
|
156 |
/**
|
157 |
* Inicializa el fondo y dibuja el gr?fico sobre el canvas.
|
158 |
*/
|
159 |
public void paint(Graphics g); |
160 |
|
161 |
/**
|
162 |
* Ejecuta las acciones antes del primer dibujado de todos
|
163 |
* los elementos dibujables
|
164 |
*/
|
165 |
public void execFirstDrawActions(); |
166 |
|
167 |
/**
|
168 |
* Obtiene la posici?n m?nima en X del canvas donde comenzar a dibujar
|
169 |
* @return
|
170 |
*/
|
171 |
public int getCanvasMinX(); |
172 |
|
173 |
/**
|
174 |
* Obtiene la posici?n m?nima en Y del canvas donde comenzar a dibujar
|
175 |
* @return
|
176 |
*/
|
177 |
public int getCanvasMinY(); |
178 |
|
179 |
/**
|
180 |
* Obtiene la posici?n m?xima en X del canvas donde terminar el dibujado
|
181 |
* @return
|
182 |
*/
|
183 |
public int getCanvasMaxX(); |
184 |
|
185 |
/**
|
186 |
* Obtiene la posici?n m?xima en Y del canvas donde terminar el dibujado
|
187 |
* @return
|
188 |
*/
|
189 |
public int getCanvasMaxY(); |
190 |
|
191 |
/**
|
192 |
* Obtiene el ancho del canvas sumando a partir de getCanvasX donde termina el ?rea de dibujo
|
193 |
* @return
|
194 |
*/
|
195 |
public int getCanvasWidth(); |
196 |
|
197 |
/**
|
198 |
* Obtiene el alto del canvas sumando a partir de getCanvasY donde termina el ?rea de dibujo
|
199 |
* @return
|
200 |
*/
|
201 |
public int getCanvasHeight(); |
202 |
} |