Revision 843

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendDefault.java
186 186
						myFSymbol.setStyle(pointType.intValue());
187 187
						// Le hacemos que se dibuje siempre con 10 pixels
188 188
						
189
						myFSymbol.setSizeInPixels(false);
189
						myFSymbol.setSizeInPixels(true);
190 190
						myFSymbol.setSize(10);
191 191
						myFSymbol.setStroke(new BasicStroke());
192 192
						panel.setForeground(UIManager.getColor(isSelected
......
678 678
					}
679 679
				}
680 680
				m_FSymbol.setColor(pointColorChooserPanel.getColor());
681
				m_FSymbol.setSizeInPixels(getJCheckBox().isSelected());
681
				m_FSymbol.setSizeInPixels(!getJCheckBox().isSelected());
682 682
				pointColorChooserPanel.repaint();
683 683
				m_previewSymbol.setSymbol(m_FSymbol);				
684 684
				return;
......
824 824
			pointColorChooserPanel.setColor(m_FSymbol.getColor());
825 825
			}
826 826
			getJTextField().setText("" + m_FSymbol.getSize());
827
			getJCheckBox().setSelected(m_FSymbol.isSizeInPixels());
827
			getJCheckBox().setSelected(!m_FSymbol.isSizeInPixels());
828 828
			getJComboBox_pointType().setSelectedItem(new Integer(m_FSymbol.getStyle()));
829 829
			
830 830
		}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPreviewSymbol.java
99 99
		// (m_bUseSize = true), dibujarlo con un tama?o fijo en pixels.
100 100
		
101 101
		FSymbol cloneSym = symbol.cloneSymbol();
102
		cloneSym.setSizeInPixels(false);
102
		cloneSym.setSizeInPixels(true);
103 103
		cloneSym.setSize(10); // pixels
104 104
		
105 105
		m_FSymbol = cloneSym;
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/TocItemLeaf.java
78 78
				FGraphicUtilities.DrawSymbol(g2, AffineTransform.getScaleInstance(0.8,0.8), r, symbol);
79 79
				break;									
80 80
			case FShape.MULTI:
81
				img = new BufferedImage(2*w_1symbol, h_1symbol, BufferedImage.TYPE_INT_ARGB);
81
				img = new BufferedImage(3*w_1symbol, h_1symbol, BufferedImage.TYPE_INT_ARGB);
82 82
				g2 = img.createGraphics();
83
				r = new Rectangle(2*w_1symbol, h_1symbol);
83
				r = new Rectangle(3*w_1symbol, h_1symbol);
84 84
				
85 85
				FGraphicUtilities.DrawSymbol(g2, AffineTransform.getScaleInstance(0.8,0.8), r, symbol);
86 86
				break;					
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dgn/DgnMemoryDriver.java
19 19
import com.iver.cit.gvsig.fmap.core.FPolyline2D;
20 20
import com.iver.cit.gvsig.fmap.core.FShape;
21 21
import com.iver.cit.gvsig.fmap.core.GeneralPathX;
22
import com.iver.cit.gvsig.fmap.core.v02.FConstant;
22 23
import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
23 24
import com.iver.cit.gvsig.fmap.drivers.MemoryDriver;
24 25
import com.iver.cit.gvsig.fmap.drivers.WithDefaultLegend;
......
433 434
		defaultLegend.getDefaultSymbol().setFont(new Font("SansSerif", Font.PLAIN, 9));
434 435
		defaultLegend.getDefaultSymbol().setFontColor(Color.BLACK);
435 436
		defaultLegend.getDefaultSymbol().setFontSize(heightText);
437
		defaultLegend.getDefaultSymbol().setStyle(FConstant.SYMBOL_STYLE_MARKER_SQUARE);
436 438
		
437 439
		defaultLegend.setLabelHeightField("HeightText");
438 440
		defaultLegend.setLabelRotationField("RotationText");
......
449 451
					theSymbol = new FSymbol(getShapeType());	
450 452
					theSymbol.setDescription(clave.toString());
451 453
					theSymbol.setColor(m_DgnReader.DGNLookupColor(clave.getValue()));
454
					theSymbol.setStyle(FConstant.SYMBOL_STYLE_MARKER_SQUARE);
452 455
					defaultLegend.addSymbol(clave, theSymbol);
453 456
				}
454 457
			} // for
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FSymbol.java
149 149
			case FConstant.SYMBOL_TYPE_POINT:
150 150
			case FConstant.SYMBOL_TYPE_POINTZ:
151 151
			case FConstant.SYMBOL_TYPE_MULTIPOINT:
152
				setOutlined(false);
153
				setStyle(FConstant.SYMBOL_STYLE_MARKER_SQUARE);
152
				
153
				m_bUseSize = true; // Esto es lo primero que hay que hacer siempre
154
										// para evitar un StackOverflow
155
				m_useOutline = false;
156
				setStyle(FConstant.SYMBOL_STYLE_MARKER_SQUARE);				
154 157
				setSize(5); //pixels
155 158
				break;
156 159
			case FConstant.SYMBOL_TYPE_LINE:
......
170 173

  
171 174
	}
172 175

  
173
	private void calculateRgb()
176
	public void calculateRgb()
174 177
	{
175 178
		// Recalculamos el RGB
176 179
		Graphics2D g2 = img.createGraphics();
......
301 304
	 */
302 305
	public void setStyle(int m_Style) {
303 306
		this.m_Style = m_Style;
304
		calculateRgb();
307
//		 calculateRgb();
305 308
	}
306 309

  
307 310
	/**
......
330 333
	 */
331 334
	public void setOutlined(boolean m_useOutline) {
332 335
		this.m_useOutline = m_useOutline;
333
		calculateRgb();
336
//		 calculateRgb();
334 337
	}
335 338

  
336 339
	/**
......
345 348
	 */
346 349
	public void setColor(Color m_Color) {
347 350
		this.m_Color = m_Color;
348
		calculateRgb();
351
//		 calculateRgb();
349 352
	}
350 353

  
351 354
	/**
......
360 363
	 */
361 364
	public void setOutlineColor(Color m_outlineColor) {
362 365
		this.m_outlineColor = m_outlineColor;
363
		calculateRgb();
366
//		 calculateRgb();
364 367
	}
365 368

  
366 369
	/**
......
375 378
	 */
376 379
	public void setFont(Font m_Font) {
377 380
		this.m_Font = m_Font;
378
		calculateRgb();
381
//		 calculateRgb();
379 382
	}
380 383

  
381 384
	/**
......
390 393
	 */
391 394
	public void setFontColor(Color m_FontColor) {
392 395
		this.m_FontColor = m_FontColor;
393
		calculateRgb();
396
//		 calculateRgb();
394 397
	}
395 398

  
396 399
	/**
......
420 423
	 */
421 424
	public void setShapeVisible(boolean m_bDrawShape) {
422 425
		this.m_bDrawShape = m_bDrawShape;
423
		calculateRgb();
426
//		 calculateRgb();
424 427
	}
425 428

  
426 429
	/**
......
435 438
	 */
436 439
	public void setSize(int m_Size) {
437 440
		this.m_Size = m_Size;
438
		calculateRgb();
441
//		 calculateRgb();
439 442
	}
440 443

  
441 444
	/**
......
450 453
	 */
451 454
	public void setIcon(Image m_Icon) {
452 455
		this.m_Icon = m_Icon;
453
		calculateRgb();
456
//		 calculateRgb();
454 457
	}
455 458

  
456 459
	/**
......
465 468
	 */
466 469
	public void setRotation(int m_Rotation) {
467 470
		this.m_Rotation = m_Rotation;
468
		calculateRgb();
471
//		 calculateRgb();
469 472
	}
470 473

  
471 474
	/**
......
480 483
	 */
481 484
	public void setFill(Paint m_Fill) {
482 485
		this.m_Fill = m_Fill;
483
		calculateRgb();
486
//		 calculateRgb();
484 487
	}
485 488

  
486 489
	/**
......
495 498
	 */
496 499
	public void setStroke(Stroke m_Stroke) {
497 500
		this.m_Stroke = m_Stroke;
498
		calculateRgb();
501
//		 calculateRgb();
499 502
	}
500 503

  
501 504
	/**
......
510 513
	 */
511 514
	public void setSizeInPixels(boolean m_bUseSize) {
512 515
		this.m_bUseSize = m_bUseSize;
513
		calculateRgb();
516
//		 calculateRgb();
514 517
	}
515 518

  
516 519
	/**
......
539 542
	 */
540 543
	public void setAlingVert(int m_AlingVert) {
541 544
		this.m_AlingVert = m_AlingVert;
542
		calculateRgb();
545
//		 calculateRgb();
543 546
	}
544 547

  
545 548
	/**
......
554 557
	 */
555 558
	public void setAlingHoriz(int m_AlingHoriz) {
556 559
		this.m_AlingHoriz = m_AlingHoriz;
557
		calculateRgb();
560
		// calculateRgb();
558 561
	}
559 562

  
560 563
	/**
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FGraphicUtilities.java
48 48

  
49 49
        AffineTransform mT = new AffineTransform();
50 50
        mT.setToIdentity();
51
        Rectangle r2 = new Rectangle(r.x + 2 + r.width/2, r.y, r.width/2, r.height);
51
        Rectangle r2 = new Rectangle(r.x + 2 + r.width/3, r.y, r.width/3, r.height);
52
        Rectangle r3 = new Rectangle(r.x + 2 + 2*r.width/3, r.y, r.width/3, r.height);
52 53

  
53 54
        // g2.clearRect(r.x, r.y, r.width, r.height);
54 55
        // System.out.println("r = " + r.toString() + " Color preview:" + symbol.m_Color.toString());
......
62 63
                boolean bAux2 = symbol.isSizeInPixels();
63 64
                int alturaMetros = symbol.getSize(); // Nota: Cambiar m_Size a float
64 65

  
65
                if (symbol.isSizeInPixels()) {
66
                if (!bAux2) {
67
                    symbol.setSizeInPixels(true);
66 68
                    symbol.setSize(8); // tama?o fijo
67
                    symbol.setSizeInPixels(false);
68 69
                }
69 70

  
70 71
                FGraphicUtilities.DrawShape(g2, mT, shp, symbol);
71 72

  
72
                if (bAux2) {
73
                if (!bAux2) {
73 74
                    symbol.setSize(alturaMetros);
74 75
                    symbol.setSizeInPixels(bAux2);
75 76
                }
......
77 78
                if (symbol.getFont() != null) {
78 79
                    // Para no tener que clonarlo si viene en unidades de mapa
79 80
                    boolean bAux = symbol.isFontSizeInPixels();
80
                    symbol.setFontSizeInPixels(false);
81
                    symbol.setFontSizeInPixels(true);
81 82
                    FGraphicUtilities.DrawLabel(g2, mT, shp, symbol,
82 83
                        new FLabel("Abcd"));
83 84
                    symbol.setFontSizeInPixels(bAux);
......
113 114

  
114 115
                break;
115 116
            case FShape.MULTI:
116
            	r.resize(r.width/2, r.height);
117
            	// Pol?gono
118
            	r.resize(r.width/3, r.height);
117 119
                GeneralPathX rectAux2 = new GeneralPathX(r);
118 120
                rectAux2.transform(mT2);
119 121
                shp = new FPolygon2D( rectAux2);
120 122
                FGraphicUtilities.DrawShape(g2, mT, shp, symbol);
123
                // L?nea
121 124
                rect = mT2.createTransformedShape(r2).getBounds();
122 125
                line = new GeneralPathX();
123 126
                line.moveTo(rect.x, rect.y + (rect.height / 2));
......
129 132

  
130 133
                shp = new FPolyline2D(line);
131 134
                FGraphicUtilities.DrawShape(g2, mT, shp, symbol);
135
                // Punto:
136
                shp = new FPoint2D(r3.x + (r3.width / 2),
137
                        r3.y + (r3.height / 2));
132 138

  
139
                //  Para no tener que clonarlo si viene en unidades de mapa
140
                bAux2 = symbol.isSizeInPixels();
141
                alturaMetros = symbol.getSize(); // Nota: Cambiar m_Size a float
142

  
143
                if (!bAux2) {
144
                    symbol.setSizeInPixels(true);
145
                    symbol.setSize(8); // tama?o fijo
146
                }
147

  
148
                FGraphicUtilities.DrawShape(g2, mT, shp, symbol);
149

  
150
                if (!bAux2) {
151
                    symbol.setSize(alturaMetros);
152
                    symbol.setSizeInPixels(bAux2);
153
                }
154

  
155
                if (symbol.getFont() != null) {
156
                    // Para no tener que clonarlo si viene en unidades de mapa
157
                    boolean bAux = symbol.isFontSizeInPixels();
158
                    symbol.setFontSizeInPixels(true);
159
                    FGraphicUtilities.DrawLabel(g2, mT, shp, symbol,
160
                        new FLabel("Abcd"));
161
                    symbol.setFontSizeInPixels(bAux);
162
                }
163

  
164

  
165

  
133 166
                break;
134 167
                
135 168
        }
......
400 433
        float radio_simbolo;
401 434
        radio_simbolo = theSymbol.getSize() / 2;
402 435

  
403
        if (theSymbol.isSizeInPixels()) {
436
        if (!theSymbol.isSizeInPixels()) {
404 437
            // Suponemos que m_Size viene en coordenadas de mundo real
405 438
            radio_simbolo = (float) (theSymbol.getSize() * mT.getScaleX());
406 439

  

Also available in: Unified diff