Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / fmap / mapcontext / rendering / symbols / styles / IStyle.java @ 40769

History | View | Annotate | Download (2.83 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
package org.gvsig.fmap.mapcontext.rendering.symbols.styles;
25

    
26
import java.awt.Graphics2D;
27
import java.awt.Rectangle;
28

    
29
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
30
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException;
31
import org.gvsig.tools.lang.Cloneable;
32
import org.gvsig.tools.persistence.Persistent;
33

    
34
/**
35
 * Used by Objects that have to define an style for them.This interface has
36
 * methods to stablish a description and get it,to specify if an object
37
 * that implements this interface is suitable for a kind of symbol and other
38
 * methods to draw symbols.
39
 * @author   jaume dominguez faus - jaume.dominguez@iver.es
40
 */
41
public interface IStyle extends Persistent, Cloneable {
42
        /**
43
         * Defines the description of a symbol.It will be specified with an
44
         * string.
45
         * @param desc,String
46
         */
47
        public abstract void setDescription(String desc);
48
        /**
49
         * Returns the description of a symbol
50
         * @return Description of a symbol
51
         */
52
        public abstract String getDescription();
53
        /**
54
         * Useful to render the symbol inside the TOC, or inside little
55
         * rectangles. For example, think about rendering a Label with size
56
         * in meters => You will need to specify a size in pixels.
57
         * Of course. You may also preffer to render a prepared image, etc.
58
         * @param g Graphics2D
59
         * @param r Rectangle
60
         */
61
        public abstract void drawInsideRectangle(Graphics2D g, Rectangle r) throws SymbolDrawingException;
62

    
63
        /**
64
         * True if this symbol is ok for the style or class.
65
         * @param symbol ISymbol
66
         */
67

    
68
        public abstract boolean isSuitableFor(ISymbol symbol);
69

    
70
        /**
71
         * Used to show an outline of the style to graphically show its properties.
72
         * @param g, the Graphics2D where to draw
73
         * @param r, the bounds of the style inside such Graphics2D
74
         */
75
        public abstract void drawOutline(Graphics2D g, Rectangle r) throws SymbolDrawingException;
76
}