root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / symbols / AbstractLineSymbol.java @ 10809
History | View | Annotate | Download (4.03 KB)
1 | 9745 | jaume | /* 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$
|
||
45 | * $Log$
|
||
46 | 10809 | jaume | * Revision 1.4 2007-03-20 16:00:00 jaume
|
47 | * rename method
|
||
48 | *
|
||
49 | * Revision 1.3 2007/03/09 11:20:56 jaume
|
||
50 | 10679 | jaume | * Advanced symbology (start committing)
|
51 | *
|
||
52 | * Revision 1.2.2.3 2007/02/21 16:09:02 jaume
|
||
53 | * *** empty log message ***
|
||
54 | *
|
||
55 | * Revision 1.2.2.2 2007/02/15 16:23:44 jaume
|
||
56 | * *** empty log message ***
|
||
57 | *
|
||
58 | * Revision 1.2.2.1 2007/02/09 07:47:04 jaume
|
||
59 | * Isymbol moved
|
||
60 | *
|
||
61 | * Revision 1.2 2007/01/24 17:58:22 jaume
|
||
62 | 9893 | jaume | * new features and architecture error fixes
|
63 | *
|
||
64 | * Revision 1.1 2007/01/16 11:50:44 jaume
|
||
65 | 9745 | jaume | * *** empty log message ***
|
66 | *
|
||
67 | *
|
||
68 | */
|
||
69 | package com.iver.cit.gvsig.fmap.core.symbols; |
||
70 | |||
71 | 9893 | jaume | import java.awt.Color; |
72 | |||
73 | 9745 | jaume | import com.iver.cit.gvsig.fmap.core.FShape; |
74 | import com.iver.cit.gvsig.fmap.core.IGeometry; |
||
75 | 10679 | jaume | import com.iver.cit.gvsig.fmap.core.styles.ILineStyle; |
76 | import com.iver.cit.gvsig.fmap.core.styles.SimpleLineStyle; |
||
77 | 9745 | jaume | import com.iver.cit.gvsig.fmap.core.v02.FConstant; |
78 | |||
79 | 10679 | jaume | /**
|
80 | * @author jaume dominguez faus - jaume.dominguez@iver.es
|
||
81 | */
|
||
82 | public abstract class AbstractLineSymbol extends AbstractSymbol implements ILineSymbol { |
||
83 | /**
|
||
84 | * @uml.property name="color"
|
||
85 | */
|
||
86 | 9893 | jaume | private Color color; |
87 | 10679 | jaume | private ILineStyle lineStyle;
|
88 | 9745 | jaume | |
89 | 10679 | jaume | /* (non-Javadoc)
|
90 | * @see com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol#getColor()
|
||
91 | */
|
||
92 | /**
|
||
93 | * @return
|
||
94 | * @uml.property name="color"
|
||
95 | */
|
||
96 | 9893 | jaume | public final Color getColor() { |
97 | return color;
|
||
98 | } |
||
99 | |||
100 | 10679 | jaume | /* (non-Javadoc)
|
101 | * @see com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol#setColor(java.awt.Color)
|
||
102 | */
|
||
103 | /**
|
||
104 | * @param color
|
||
105 | * @uml.property name="color"
|
||
106 | */
|
||
107 | 10809 | jaume | public final void setLineColor(Color color) { |
108 | 9893 | jaume | this.color = color;
|
109 | } |
||
110 | |||
111 | |||
112 | 10679 | jaume | /* (non-Javadoc)
|
113 | * @see com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol#getSymbolType()
|
||
114 | */
|
||
115 | 9893 | jaume | public final int getSymbolType() { |
116 | 9745 | jaume | return FConstant.SYMBOL_TYPE_LINE;
|
117 | } |
||
118 | |||
119 | 10679 | jaume | /* (non-Javadoc)
|
120 | * @see com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol#isSuitableFor(com.iver.cit.gvsig.fmap.core.IGeometry)
|
||
121 | */
|
||
122 | 9745 | jaume | public boolean isSuitableFor(IGeometry geom) { |
123 | switch(geom.getGeometryType()) {
|
||
124 | // pasted from FSymbol
|
||
125 | case FShape.LINE:
|
||
126 | case FShape.LINE + FShape.Z:
|
||
127 | case FShape.ARC:
|
||
128 | case FShape.ARC + FShape.Z:
|
||
129 | return true; |
||
130 | } |
||
131 | return false; |
||
132 | } |
||
133 | |||
134 | 10679 | jaume | /* (non-Javadoc)
|
135 | * @see com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol#getLineStyle()
|
||
136 | */
|
||
137 | /**
|
||
138 | * @return
|
||
139 | * @uml.property name="lineStyle"
|
||
140 | */
|
||
141 | public ILineStyle getLineStyle() {
|
||
142 | if (lineStyle == null) |
||
143 | lineStyle = new SimpleLineStyle();
|
||
144 | return lineStyle;
|
||
145 | 9893 | jaume | } |
146 | |||
147 | 10679 | jaume | /* (non-Javadoc)
|
148 | * @see com.iver.cit.gvsig.fmap.core.symbols.ILineSymbol#setLineStyle(com.iver.cit.gvsig.fmap.core.styles.SimpleLineStyle)
|
||
149 | */
|
||
150 | /**
|
||
151 | * @param lineStyle
|
||
152 | * @uml.property name="lineStyle"
|
||
153 | */
|
||
154 | public void setLineStyle(ILineStyle lineStyle) { |
||
155 | this.lineStyle = lineStyle;
|
||
156 | 9893 | jaume | } |
157 | 10679 | jaume | |
158 | public int getAlpha() { |
||
159 | return color.getAlpha();
|
||
160 | } |
||
161 | |||
162 | public void setAlpha(int outlineAlpha) { |
||
163 | color = new Color(color.getRed(), color.getGreen(), color.getBlue(), outlineAlpha); |
||
164 | } |
||
165 | 9893 | jaume | |
166 | 9745 | jaume | } |