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 @ 40559
History | View | Annotate | Download (3.59 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
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 | 40559 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * 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 | 40559 | jjdelcerro | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | * MA 02110-1301, USA.
|
||
20 | 40435 | jjdelcerro | *
|
21 | 40559 | jjdelcerro | * For any additional information, do not hesitate to contact us
|
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | /* CVS MESSAGES:
|
||
25 | *
|
||
26 | * $Id: IStyle.java 20989 2008-05-28 11:05:57Z jmvivo $
|
||
27 | * $Log$
|
||
28 | * Revision 1.7 2007-09-20 09:33:15 jaume
|
||
29 | * Refactored: fixed name of IPersistAnce to IPersistence
|
||
30 | *
|
||
31 | * Revision 1.6 2007/09/19 16:19:27 jaume
|
||
32 | * removed unnecessary imports
|
||
33 | *
|
||
34 | * Revision 1.5 2007/08/22 09:49:00 jvidal
|
||
35 | * javadoc updated
|
||
36 | *
|
||
37 | * Revision 1.4 2007/08/16 06:55:30 jvidal
|
||
38 | * javadoc updated
|
||
39 | *
|
||
40 | * Revision 1.3 2007/08/13 11:36:41 jvidal
|
||
41 | * javadoc
|
||
42 | *
|
||
43 | * Revision 1.2 2007/04/04 15:41:05 jaume
|
||
44 | * *** empty log message ***
|
||
45 | *
|
||
46 | * Revision 1.1 2007/03/09 11:20:56 jaume
|
||
47 | * Advanced symbology (start committing)
|
||
48 | *
|
||
49 | * Revision 1.1.2.2 2007/02/15 16:23:44 jaume
|
||
50 | * *** empty log message ***
|
||
51 | *
|
||
52 | * Revision 1.1.2.1 2007/02/09 07:47:05 jaume
|
||
53 | * Isymbol moved
|
||
54 | *
|
||
55 | *
|
||
56 | */
|
||
57 | package org.gvsig.fmap.mapcontext.rendering.symbols.styles; |
||
58 | |||
59 | import java.awt.Graphics2D; |
||
60 | import java.awt.Rectangle; |
||
61 | |||
62 | import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
||
63 | import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException; |
||
64 | import org.gvsig.tools.lang.Cloneable; |
||
65 | import org.gvsig.tools.persistence.Persistent; |
||
66 | |||
67 | /**
|
||
68 | * Used by Objects that have to define an style for them.This interface has
|
||
69 | * methods to stablish a description and get it,to specify if an object
|
||
70 | * that implements this interface is suitable for a kind of symbol and other
|
||
71 | * methods to draw symbols.
|
||
72 | * @author jaume dominguez faus - jaume.dominguez@iver.es
|
||
73 | */
|
||
74 | public interface IStyle extends Persistent, Cloneable { |
||
75 | /**
|
||
76 | * Defines the description of a symbol.It will be specified with an
|
||
77 | * string.
|
||
78 | * @param desc,String
|
||
79 | */
|
||
80 | public abstract void setDescription(String desc); |
||
81 | /**
|
||
82 | * Returns the description of a symbol
|
||
83 | * @return Description of a symbol
|
||
84 | */
|
||
85 | public abstract String getDescription(); |
||
86 | /**
|
||
87 | * Useful to render the symbol inside the TOC, or inside little
|
||
88 | * rectangles. For example, think about rendering a Label with size
|
||
89 | * in meters => You will need to specify a size in pixels.
|
||
90 | * Of course. You may also preffer to render a prepared image, etc.
|
||
91 | * @param g Graphics2D
|
||
92 | * @param r Rectangle
|
||
93 | */
|
||
94 | public abstract void drawInsideRectangle(Graphics2D g, Rectangle r) throws SymbolDrawingException; |
||
95 | |||
96 | /**
|
||
97 | * True if this symbol is ok for the style or class.
|
||
98 | * @param symbol ISymbol
|
||
99 | */
|
||
100 | |||
101 | public abstract boolean isSuitableFor(ISymbol symbol); |
||
102 | |||
103 | /**
|
||
104 | * Used to show an outline of the style to graphically show its properties.
|
||
105 | * @param g, the Graphics2D where to draw
|
||
106 | * @param r, the bounds of the style inside such Graphics2D
|
||
107 | */
|
||
108 | public abstract void drawOutline(Graphics2D g, Rectangle r) throws SymbolDrawingException; |
||
109 | } |