Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / styles / IStyle.java @ 13100

History | View | Annotate | Download (3.29 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 13100 2007-08-16 06:55:30Z jvidal $
45
* $Log$
46
* Revision 1.4  2007-08-16 06:55:30  jvidal
47
* javadoc updated
48
*
49
* Revision 1.3  2007/08/13 11:36:41  jvidal
50
* javadoc
51
*
52
* Revision 1.2  2007/04/04 15:41:05  jaume
53
* *** empty log message ***
54
*
55
* Revision 1.1  2007/03/09 11:20:56  jaume
56
* Advanced symbology (start committing)
57
*
58
* Revision 1.1.2.2  2007/02/15 16:23:44  jaume
59
* *** empty log message ***
60
*
61
* Revision 1.1.2.1  2007/02/09 07:47:05  jaume
62
* Isymbol moved
63
*
64
*
65
*/
66
package com.iver.cit.gvsig.fmap.core.styles;
67

    
68
import java.awt.Graphics2D;
69
import java.awt.Rectangle;
70
import java.awt.geom.AffineTransform;
71

    
72
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
73
import com.iver.utiles.IPersistance;
74

    
75
/**
76
 * Used by Objects that have to define an style for them.This interface has
77
 * methods to stablish a description and get it,to specify if an object
78
 * that implements this interface is suitable for a kind of symbol and other
79
 * methods to draw symbols.
80
 * @author   jaume dominguez faus - jaume.dominguez@iver.es
81
 */
82
public interface IStyle extends IPersistance{
83
        /**
84
         * Defines the description of a symbol.It will be specified with an
85
         * string.
86
         * @param desc,String
87
         */
88
        public abstract void setDescription(String desc);
89
        /**
90
         * Returns the description of a symbol
91
         * @return Description of a symbol
92
         */
93
        public abstract String getDescription();
94
        /**
95
         * Useful to render the symbol inside the TOC, or inside little
96
         * rectangles. For example, think about rendering a Label with size
97
         * in meters => You will need to specify a size in pixels.
98
         * Of course. You may also preffer to render a prepared image, etc.
99
         * @param g2
100
         * @param scaleInstance
101
         * @param r
102
         */
103
        public abstract void drawInsideRectangle(Graphics2D g, Rectangle r);
104

    
105
        /**
106
         * True if this symbol is ok for the style or class.
107
         * @param symbol ISymbol
108
         */
109

    
110
        public abstract boolean isSuitableFor(ISymbol symbol);
111

    
112
        /**
113
         * Used to show an outline of the style to graphically show its properties.
114
         * @param g, the Graphics2D where to draw
115
         * @param r, the bounds of the style inside such Graphics2D
116
         */
117
        public abstract void drawOutline(Graphics2D g, Rectangle r);
118
}