Revision 42646

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/fill/impl/AbstractFillSymbol.java
43 43

  
44 44
/**
45 45
 * Abstract class that any FILL SYMBOL should extend
46
 * 
46
 *
47 47
 * @author 2005-2008 jaume dominguez faus - jaume.dominguez@iver.es
48 48
 * @author 2009-     <a href="cordinyana@gvsig.org">C?sar Ordi?ana</a> - gvSIG team
49 49
 */
......
78 78
	}
79 79

  
80 80
	public boolean isSuitableFor(Geometry geom) {
81
		return geom.getType() == Geometry.TYPES.SURFACE;
81
	       switch(geom.getType()) {
82
	        case Geometry.TYPES.SURFACE:
83
	        case Geometry.TYPES.POLYGON:
84
	            return true;
85
	        }
86
	        return false;
82 87
	}
83 88

  
84 89
	public int getOnePointRgb() {
......
183 188

  
184 189
	public Object clone() throws CloneNotSupportedException {
185 190
		IFillSymbol copy = (IFillSymbol) super.clone();
186
		
191

  
187 192
		// Clone outline
188 193
		ILineSymbol outline = copy.getOutline();
189 194
		if (outline != null) {
......
191 196
		}
192 197
		return copy;
193 198
	}
194
	
199

  
195 200
	public void loadFromState(PersistentState state)
196 201
			throws PersistenceException {
197 202
		// Set parent symbol properties
......
222 227
						AbstractFillSymbol.class,
223 228
						FILL_SYMBOL_PERSISTENCE_DEFINITION_NAME,
224 229
						FILL_SYMBOL_PERSISTENCE_DEFINITION_NAME+" Persistence definition",
225
						null, 
230
						null,
226 231
						null
227 232
				);
228 233

  
......
240 245
			}
241 246
			return Boolean.TRUE;
242 247
		}
243
		
248

  
244 249
	}
245 250

  
246 251
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/fill/impl/MultiLayerFillSymbol.java
92 92
	}
93 93

  
94 94
	public boolean isSuitableFor(Geometry geom) {
95
		return geom.getType() == Geometry.TYPES.SURFACE;
95
        switch(geom.getType()) {
96
        case Geometry.TYPES.SURFACE:
97
        case Geometry.TYPES.POLYGON:
98
            return true;
99
        }
100
        return false;
96 101
	}
97 102

  
98 103
	public void setFillColor(Color color) {
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/impl/AbstractLineSymbol.java
73 73

  
74 74
    public static final String LINE_SYMBOL_PERSISTENCE_DEFINITION_NAME = "LineSymbol";
75 75

  
76
    
76

  
77 77
	private static final GeometryManager geomManager = GeometryLocator.getGeometryManager();
78 78
	private Color color;
79 79
	private ILineStyle lineStyle = new SimpleLineStyle();
......
93 93
	public void setLineColor(Color color) {
94 94
		this.color = color;
95 95
	}
96
	
96

  
97 97
	public void setColor(Color color) {
98 98
		setLineColor(color);
99 99
	}
......
117 117
		switch(geom.getType()) {
118 118
		case Geometry.TYPES.CURVE:
119 119
		case Geometry.TYPES.ARC:
120
		case Geometry.TYPES.LINE:
120 121
			return true;
121 122
		}
122 123
		return false;
......
148 149

  
149 150
		GeneralPathX gpx = new GeneralPathX();
150 151
		gpx.moveTo(r.x + hPos, r.y + r.height-vPos);
151
		
152

  
152 153
		boolean hasDecorator = (getLineStyle().getArrowDecorator() != null);
153 154
		boolean hasPictureDeco = hasDecorator &&
154 155
		    getLineStyle().getArrowDecorator().getMarker() instanceof IPictureMarkerSymbol;
......
164 165
			} else {
165 166
			    gpx.lineTo(r.x + hPos + splitHSize, (swap ? vPos : r.height-vPos) + r.y);
166 167
			}
167
			
168

  
168 169
			hPos += splitHSize;
169 170
		}
170 171

  
171
		
172

  
172 173
		double old_deco_size = 0;
173 174
		if (hasDecorator) {
174 175
		    old_deco_size = getLineStyle().getArrowDecorator().getMarker().getSize();
......
186 187
		} catch (Exception e) {
187 188
			throw new SymbolDrawingException(SymbolDrawingException.UNSUPPORTED_SET_OF_SETTINGS);
188 189
		}
189
		
190

  
190 191
		if (hasDecorator) {
191 192
            getLineStyle().getArrowDecorator().getMarker().setSize(old_deco_size);
192 193
		}
......
197 198

  
198 199
	public void setCartographicSize(double cartographicSize, Geometry geom) {
199 200
	    float currw = this.getLineStyle().getLineWidth();
200
	    double ratio = cartographicSize / currw; 
201
	    
201
	    double ratio = cartographicSize / currw;
202

  
202 203
		getLineStyle().setLineWidth((float) cartographicSize);
203
		
204

  
204 205
		if (getLineStyle().getArrowDecorator() != null) {
205 206
	        double marker_size = getLineStyle().getArrowDecorator().getMarker().getSize();
206
	        marker_size = marker_size * ratio; 
207
	        marker_size = marker_size * ratio;
207 208
	        getLineStyle().getArrowDecorator().getMarker().setSize(marker_size);
208 209
		}
209 210
	}
......
366 367
		draw(g,at,geom,null, null);
367 368
		setLineWidth(originalSize);
368 369
	}
369
	
370

  
370 371
	public Object clone() throws CloneNotSupportedException {
371 372
		AbstractLineSymbol copy = (AbstractLineSymbol) super.clone();
372
		
373

  
373 374
		// Clone the line style
374 375
		if (lineStyle != null) {
375 376
			copy.lineStyle = (ILineStyle) lineStyle.clone();
376 377
		}
377
		
378

  
378 379
		return copy;
379 380
	}
380 381

  
381
	
382

  
382 383
	public void loadFromState(PersistentState state)
383 384
			throws PersistenceException {
384 385
		// Set parent symbol properties
......
405 406
						AbstractLineSymbol.class,
406 407
						LINE_SYMBOL_PERSISTENCE_DEFINITION_NAME,
407 408
						LINE_SYMBOL_PERSISTENCE_DEFINITION_NAME+" Persistence definition",
408
						null, 
409
						null,
409 410
						null
410 411
				);
411 412

  
......
419 420
			}
420 421
			return Boolean.TRUE;
421 422
		}
422
		
423

  
423 424
	}
424
	
425
	
425

  
426

  
426 427
}
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/impl/MultiLayerLineSymbol.java
178 178
	}
179 179

  
180 180
	public boolean isSuitableFor(Geometry geom) {
181
		return geom.getType() == Geometry.TYPES.CURVE;
181
	      switch(geom.getType()) {
182
	        case Geometry.TYPES.CURVE:
183
	        case Geometry.TYPES.LINE:
184
	            return true;
185
	        }
186
	        return false;
182 187
	}
183 188

  
184 189
	public void print(Graphics2D g, AffineTransform at, Geometry geom, PrintAttributes properties) {

Also available in: Unified diff