Revision 10679 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/AbstractFillSymbol.java
AbstractFillSymbol.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.4 2007-03-06 17:08:54 caballero
|
|
47 |
* Exceptions
|
|
46 |
* Revision 1.5 2007-03-09 11:20:56 jaume
|
|
47 |
* Advanced symbology (start committing)
|
|
48 | 48 |
* |
49 |
* Revision 1.3.2.2 2007/02/21 16:09:02 jaume |
|
50 |
* *** empty log message *** |
|
51 |
* |
|
52 |
* Revision 1.3.2.1 2007/02/16 10:54:12 jaume |
|
53 |
* multilayer splitted to multilayerline, multilayermarker,and multilayerfill |
|
54 |
* |
|
49 | 55 |
* Revision 1.3 2007/01/24 17:58:22 jaume |
50 | 56 |
* new features and architecture error fixes |
51 | 57 |
* |
... | ... | |
81 | 87 |
|
82 | 88 |
import com.iver.cit.gvsig.fmap.core.FShape; |
83 | 89 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
90 |
import com.iver.utiles.XMLEntity; |
|
84 | 91 |
|
85 | 92 |
|
86 | 93 |
/** |
... | ... | |
89 | 96 |
* @author jaume dominguez faus - jaume.dominguez@iver.es |
90 | 97 |
* |
91 | 98 |
*/ |
92 |
public abstract class AbstractFillSymbol extends AbstractSymbol { |
|
93 |
Color color = Color.WHITE; |
|
94 |
Color outline = Color.BLACK; // TODO aix? canviar? a AbsrtactLineSymbol quan existisca
|
|
95 |
|
|
99 |
public abstract class AbstractFillSymbol extends AbstractSymbol implements IFillSymbol {
|
|
100 |
private Color color = Color.WHITE;
|
|
101 |
private ILineSymbol outline;
|
|
102 |
|
|
96 | 103 |
public boolean isSuitableFor(IGeometry geom) { |
97 | 104 |
return geom.getGeometryType() == FShape.POLYGON; |
98 | 105 |
} |
99 | 106 |
|
100 | 107 |
public int getOnePointRgb() { |
101 |
return outline.getRGB();
|
|
108 |
return (outline != null) ? outline.getOnePointRgb() : color.getRGB();
|
|
102 | 109 |
} |
103 | 110 |
|
104 |
/** |
|
105 |
* Sets the color that will be used to draw the filling pattern of this symbol. |
|
106 |
* |
|
107 |
* @param Color |
|
108 |
*/ |
|
109 | 111 |
public void setFillColor(Color color) { |
110 | 112 |
this.color = color; |
111 | 113 |
} |
112 | 114 |
|
113 |
/** |
|
114 |
* Sets the color of the outline. |
|
115 |
* @deprectated will be substituted by setOutline(AbstractLineSymbol); |
|
116 |
* @param color |
|
117 |
*/ |
|
118 |
public void setOutlineColor(Color color) { |
|
119 |
// TODO setOutline(AbstractLineSymbol); |
|
120 |
outline = color; |
|
115 |
public void setOutline(ILineSymbol outline) { |
|
116 |
XMLEntity xml = outline.getXMLEntity(); |
|
117 |
xml.putProperty("desc", "outline"); |
|
118 |
this.outline = outline; |
|
121 | 119 |
} |
122 | 120 |
|
123 |
/** |
|
124 |
* @return Returns the color. |
|
125 |
*/ |
|
126 | 121 |
public Color getFillColor() { |
127 | 122 |
return color; |
128 | 123 |
} |
129 | 124 |
|
130 |
/** |
|
131 |
* @deprecated will be substituted by getOutline(AbstractLineSymbol); |
|
132 |
* @return Returns the outline. |
|
133 |
*/ |
|
134 |
public Color getOutlineColor() { |
|
125 |
public ILineSymbol getOutline() { |
|
135 | 126 |
return outline; |
136 | 127 |
} |
128 |
|
|
129 |
public int getFillAlpha() { |
|
130 |
return color.getAlpha(); |
|
131 |
} |
|
137 | 132 |
} |
Also available in: Unified diff