root / branches / v2_0_0_prep / libraries / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / rendering / symbols / styles / IStyle.java @ 30011
History | View | Annotate | Download (3.86 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
|
42 |
/* CVS MESSAGES:
|
43 |
*
|
44 |
* $Id: IStyle.java 20989 2008-05-28 11:05:57Z jmvivo $
|
45 |
* $Log$
|
46 |
* Revision 1.7 2007-09-20 09:33:15 jaume
|
47 |
* Refactored: fixed name of IPersistAnce to IPersistence
|
48 |
*
|
49 |
* Revision 1.6 2007/09/19 16:19:27 jaume
|
50 |
* removed unnecessary imports
|
51 |
*
|
52 |
* Revision 1.5 2007/08/22 09:49:00 jvidal
|
53 |
* javadoc updated
|
54 |
*
|
55 |
* Revision 1.4 2007/08/16 06:55:30 jvidal
|
56 |
* javadoc updated
|
57 |
*
|
58 |
* Revision 1.3 2007/08/13 11:36:41 jvidal
|
59 |
* javadoc
|
60 |
*
|
61 |
* Revision 1.2 2007/04/04 15:41:05 jaume
|
62 |
* *** empty log message ***
|
63 |
*
|
64 |
* Revision 1.1 2007/03/09 11:20:56 jaume
|
65 |
* Advanced symbology (start committing)
|
66 |
*
|
67 |
* Revision 1.1.2.2 2007/02/15 16:23:44 jaume
|
68 |
* *** empty log message ***
|
69 |
*
|
70 |
* Revision 1.1.2.1 2007/02/09 07:47:05 jaume
|
71 |
* Isymbol moved
|
72 |
*
|
73 |
*
|
74 |
*/
|
75 |
package org.gvsig.fmap.mapcontext.rendering.symbols.styles; |
76 |
|
77 |
import java.awt.Graphics2D; |
78 |
import java.awt.Rectangle; |
79 |
|
80 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
81 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException; |
82 |
import org.gvsig.utils.IPersistence; |
83 |
import org.gvsig.tools.lang.Cloneable; |
84 |
|
85 |
/**
|
86 |
* Used by Objects that have to define an style for them.This interface has
|
87 |
* methods to stablish a description and get it,to specify if an object
|
88 |
* that implements this interface is suitable for a kind of symbol and other
|
89 |
* methods to draw symbols.
|
90 |
* @author jaume dominguez faus - jaume.dominguez@iver.es
|
91 |
*/
|
92 |
public interface IStyle extends IPersistence, Cloneable { |
93 |
/**
|
94 |
* Defines the description of a symbol.It will be specified with an
|
95 |
* string.
|
96 |
* @param desc,String
|
97 |
*/
|
98 |
public abstract void setDescription(String desc); |
99 |
/**
|
100 |
* Returns the description of a symbol
|
101 |
* @return Description of a symbol
|
102 |
*/
|
103 |
public abstract String getDescription(); |
104 |
/**
|
105 |
* Useful to render the symbol inside the TOC, or inside little
|
106 |
* rectangles. For example, think about rendering a Label with size
|
107 |
* in meters => You will need to specify a size in pixels.
|
108 |
* Of course. You may also preffer to render a prepared image, etc.
|
109 |
* @param g Graphics2D
|
110 |
* @param r Rectangle
|
111 |
*/
|
112 |
public abstract void drawInsideRectangle(Graphics2D g, Rectangle r) throws SymbolDrawingException; |
113 |
|
114 |
/**
|
115 |
* True if this symbol is ok for the style or class.
|
116 |
* @param symbol ISymbol
|
117 |
*/
|
118 |
|
119 |
public abstract boolean isSuitableFor(ISymbol symbol); |
120 |
|
121 |
/**
|
122 |
* Used to show an outline of the style to graphically show its properties.
|
123 |
* @param g, the Graphics2D where to draw
|
124 |
* @param r, the bounds of the style inside such Graphics2D
|
125 |
*/
|
126 |
public abstract void drawOutline(Graphics2D g, Rectangle r) throws SymbolDrawingException; |
127 |
} |