Revision 597

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/toc/FPopupMenu.java
55 55
                            true, colorChooser, null, null);
56 56
                    dlg.show(true);
57 57
		
58
                    ((FSymbol) menu.nodo.getUserObject()).m_Color = (Color) colorChooser.getColor();
58
                    ((FSymbol) menu.nodo.getUserObject()).setColor((Color) colorChooser.getColor());
59 59
                    menu.getMapContext().fireLegendEvent();
60 60
                    menu.getMapContext().fireInvalidEvent();
61 61

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendDefault.java
171 171

  
172 172
								FPoint2D shp = new FPoint2D(panel.getWidth()/2, 
173 173
										panel.getHeight()/2);
174
								myFSymbol.m_Color = m_FSymbol.m_Color;
174
								myFSymbol.setColor(m_FSymbol.getColor());
175 175
								FGraphicUtilities.DrawShape(g2,mT, shp,myFSymbol);
176 176
							}
177 177
						};
......
181 181
						JList list, Object value, int index,
182 182
						boolean isSelected, boolean cellHasFocus) {
183 183
						pointType = (Integer) value;
184
						myFSymbol.m_Style = pointType.intValue();
184
						myFSymbol.setStyle(pointType.intValue());
185 185
						// Le hacemos que se dibuje siempre con 10 pixels
186 186
						
187
						myFSymbol.m_bUseSize = false;
188
						myFSymbol.m_Size = 10;
189
						myFSymbol.m_Stroke = new BasicStroke();
187
						myFSymbol.setSizeInPixels(false);
188
						myFSymbol.setSize(10);
189
						myFSymbol.setStroke(new BasicStroke());
190 190
						panel.setForeground(UIManager.getColor(isSelected
191 191
								? "ComboBox.selectionForeground"
192 192
								: "ComboBox.foreground"));
......
620 620
		updateControls();
621 621
	}
622 622
	private void updateFillPatternColors() {
623
		if ((m_FSymbol != null) && (m_FSymbol.m_Color != null))
623
		if ((m_FSymbol != null) && (m_FSymbol.getColor() != null))
624 624
		{ 
625
			fillPatterns = FSymbolFactory.createPatternFills(m_FSymbol.m_Color);
625
			fillPatterns = FSymbolFactory.createPatternFills(m_FSymbol.getColor());
626 626
			fillPatternComboBox.setModel(new DefaultComboBoxModel(fillPatterns));
627
			fillPatternComboBox.getModel().setSelectedItem(m_FSymbol.m_Fill);
627
			fillPatternComboBox.getModel().setSelectedItem(m_FSymbol.getFill());
628 628
			// fillPatternComboBox.setSelectedItem(m_FSymbol.m_Fill);					
629 629
		}
630 630
		
......
649 649
		}
650 650
		if (m_FSymbol != null)
651 651
		{		
652
			if (m_FSymbol.m_symbolType == FConstant.SYMBOL_TYPE_POINT)
652
			if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_POINT)
653 653
			{
654
				m_FSymbol.m_Size = Integer.parseInt(getJTextField().getText());
654
				m_FSymbol.setSize(Integer.parseInt(getJTextField().getText()));
655 655
				 
656 656
				//System.out.println("Asigno el m_Size = " + getJTextField().getText());
657 657
				
658 658
				if (pointTypeComboBox.getSelectedItem() instanceof Integer)
659 659
				{
660 660
					Integer styleSelected = (Integer) pointTypeComboBox.getSelectedItem();
661
					m_FSymbol.m_Style = styleSelected.intValue();
661
					m_FSymbol.setStyle(styleSelected.intValue());
662 662
				}
663 663
				else
664 664
				{
665 665
					Integer styleSelected = pointTypeToInt((String) pointTypeComboBox.getSelectedItem());
666
					m_FSymbol.m_Style = styleSelected.intValue();
666
					m_FSymbol.setStyle(styleSelected.intValue());
667 667
				}
668
				if (m_FSymbol.m_Style == FConstant.SYMBOL_STYLE_MARKER_IMAGEN)
668
				if (m_FSymbol.getStyle() == FConstant.SYMBOL_STYLE_MARKER_IMAGEN)
669 669
				{
670 670
					jTxtImagen.setVisible(true);
671 671
					jLblImagen.setVisible(true);
672 672
					jBtnImagen.setVisible(true);
673 673
					if (jTxtImagen.getText().compareTo("") != 0)
674 674
					{
675
						m_FSymbol.m_Icon = new ImageIcon(jTxtImagen.getText()).getImage();
675
						m_FSymbol.setIcon(new ImageIcon(jTxtImagen.getText()).getImage());
676 676
					}
677 677
				}
678
				m_FSymbol.m_Color = pointColorChooserPanel.getColor();
679
				m_FSymbol.m_bUseSize = getJCheckBox().isSelected();
678
				m_FSymbol.setColor(pointColorChooserPanel.getColor());
679
				m_FSymbol.setSizeInPixels(getJCheckBox().isSelected());
680 680
				pointColorChooserPanel.repaint();
681 681
				m_previewSymbol.setSymbol(m_FSymbol);				
682 682
				return;
683 683
			}
684
			m_FSymbol.m_useOutline = lineCheckBox.isSelected();
685
			m_FSymbol.m_outlineColor = lineColorChooserPanel.getColor();
684
			m_FSymbol.setOutlined(lineCheckBox.isSelected());
685
			m_FSymbol.setOutlineColor(lineColorChooserPanel.getColor());
686 686
			if (fillCheckBox.isSelected())
687 687
			{			
688
				m_FSymbol.m_Color = new Color(theColor.getRed(),
688
				m_FSymbol.setColor(new Color(theColor.getRed(),
689 689
											theColor.getGreen(),
690 690
											  theColor.getBlue(),
691
											  	getAlpha());
691
											  	getAlpha()));
692 692
			}
693 693
			else
694 694
			{
695
				m_FSymbol.m_Color = null;
695
				m_FSymbol.setColor(null);
696 696
			}
697 697
			if (fillPatternCheckBox.isSelected())
698 698
			{	
699 699
				Paint fillAux = (Paint) fillPatternComboBox.getSelectedItem();
700 700
				if (fillAux != null)
701 701
				{				
702
					m_FSymbol.m_Fill = (Paint) fillPatternComboBox.getSelectedItem();
702
					m_FSymbol.setFill((Paint) fillPatternComboBox.getSelectedItem());
703 703
					// Rellenamos el m_Style para que luego podamos escribir
704 704
					// el tipo de relleno que lleva.
705
					m_FSymbol.m_Style = fillPatternComboBox.getSelectedIndex()+3;
705
					m_FSymbol.setStyle(fillPatternComboBox.getSelectedIndex()+3);
706 706
					//System.out.println("Asigno m_Fill=" + m_FSymbol.m_Fill.toString());
707 707
				}
708 708
			}	
709 709
			else
710
				m_FSymbol.m_Fill = null;
710
				m_FSymbol.setFill(null);
711 711
				 
712 712
			float lineWidth = lineWidthSlider.getValue();
713 713
			if (linePatternCheckBox.isSelected())
714 714
			{			
715 715
				String linePattern = (String) linePatternComboBox.getSelectedItem();
716 716
				// System.out.println(m_FSymbol.m_Stroke.toString());
717
				m_FSymbol.m_Stroke = new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
717
				m_FSymbol.setStroke(new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
718 718
											BasicStroke.JOIN_BEVEL, 1.0f,
719
												toArray(linePattern, lineWidth), 0);
719
												toArray(linePattern, lineWidth), 0));
720 720
												
721 721
				m_FSymbol.m_LinePattern = linePattern;
722 722
			}
723 723
			else
724 724
			{	
725 725
				if (lineWidth <=1)		
726
					m_FSymbol.m_Stroke = null;
726
					m_FSymbol.setStroke(null);
727 727
				else
728
					m_FSymbol.m_Stroke = new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
729
								BasicStroke.JOIN_BEVEL);
728
					m_FSymbol.setStroke(new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
729
								BasicStroke.JOIN_BEVEL));
730 730
			}
731 731
			// System.out.println(fillPatternComboBox.getSelectedItem().toString() + " " + linePatternComboBox.getSelectedItem().toString());
732 732
			// JOptionPane.showMessageDialog(this,"HOla","Colega", JOptionPane.INFORMATION_MESSAGE);
......
741 741
	{
742 742
		m_FSymbol = s.cloneSymbol();
743 743
		m_previewSymbol.setSymbol(m_FSymbol);
744
		if (m_FSymbol.m_symbolType == FConstant.SYMBOL_TYPE_FILL)
744
		if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_FILL)
745 745
		{		
746 746
			// Deber?amos habilitar la pesta?a de pol?gonos
747 747
			getJPanelPoint().setVisible(false);
......
753 753
			lineCheckBox.setVisible(true);
754 754
			lineColorChooserPanel.setVisible(true);
755 755
			
756
			lineCheckBox.setSelected(m_FSymbol.m_useOutline);
757
			lineColorChooserPanel.setColor(m_FSymbol.m_outlineColor);
758
			if (m_FSymbol.m_Color != null)
756
			lineCheckBox.setSelected(m_FSymbol.isOutlined());
757
			lineColorChooserPanel.setColor(m_FSymbol.geOutlineColor());
758
			if (m_FSymbol.getColor() != null)
759 759
			{
760 760
				fillCheckBox.setSelected(true);		
761
				fillColorChooserPanel.setColor(m_FSymbol.m_Color);
762
				setAlpha(m_FSymbol.m_Color.getAlpha());
761
				fillColorChooserPanel.setColor(m_FSymbol.getColor());
762
				setAlpha(m_FSymbol.getColor().getAlpha());
763 763
				fillColorChooserPanel.setAlpha(getAlpha());
764 764
				lineColorChooserPanel.setAlpha(getAlpha());			
765 765
			}
......
769 769
			}
770 770
			
771 771
			linePatternCheckBox.setSelected(false);
772
			if (m_FSymbol.m_Stroke != null)
772
			if (m_FSymbol.getStroke() != null)
773 773
			{
774
				BasicStroke aux = (BasicStroke) m_FSymbol.m_Stroke;
774
				BasicStroke aux = (BasicStroke) m_FSymbol.getStroke();
775 775
				if (aux.getDashArray() != null)
776 776
				{			
777 777
					linePatternCheckBox.setSelected(true);		
......
779 779
				}
780 780
			}
781 781
		}
782
		if (m_FSymbol.m_symbolType == FConstant.SYMBOL_TYPE_LINE)
782
		if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_LINE)
783 783
		{
784 784
			getJPanelPoint().setVisible(false);
785 785
			getCenterPanel().setVisible(true);			
......
790 790
			fillPatternComboBox.setVisible(false);
791 791
			lineCheckBox.setSelected(true);
792 792
			lineCheckBox.setVisible(false);
793
			fillColorChooserPanel.setColor(m_FSymbol.m_Color);
793
			fillColorChooserPanel.setColor(m_FSymbol.getColor());
794 794
			lineColorChooserPanel.setVisible(false);
795
			if (m_FSymbol.m_Color != null)
795
			if (m_FSymbol.getColor() != null)
796 796
			{
797
				lineColorChooserPanel.setColor(m_FSymbol.m_Color);
798
				setAlpha(m_FSymbol.m_Color.getAlpha());
797
				lineColorChooserPanel.setColor(m_FSymbol.getColor());
798
				setAlpha(m_FSymbol.getColor().getAlpha());
799 799
				lineColorChooserPanel.setAlpha(getAlpha());			
800 800
			}
801 801
			
802 802
			linePatternCheckBox.setSelected(false);
803
			if (m_FSymbol.m_Stroke != null)
803
			if (m_FSymbol.getStroke() != null)
804 804
			{
805
				BasicStroke aux = (BasicStroke) m_FSymbol.m_Stroke;
805
				BasicStroke aux = (BasicStroke) m_FSymbol.getStroke();
806 806
				if (aux.getDashArray() != null)
807 807
				{			
808 808
					linePatternCheckBox.setSelected(true);		
......
810 810
				}
811 811
			}
812 812
		}
813
		if (m_FSymbol.m_symbolType == FConstant.SYMBOL_TYPE_POINT)
813
		if (m_FSymbol.getSymbolType() == FConstant.SYMBOL_TYPE_POINT)
814 814
		{
815 815
			getCenterPanel().setVisible(false);
816 816
			getJPanelPoint().setVisible(true);
817
			if (m_FSymbol.m_Color!=null){
818
			pointColorChooserPanel.setColor(m_FSymbol.m_Color);
817
			if (m_FSymbol.getColor()!=null){
818
			pointColorChooserPanel.setColor(m_FSymbol.getColor());
819 819
			}
820
			getJTextField().setText("" + m_FSymbol.m_Size);
821
			getJCheckBox().setSelected(m_FSymbol.m_bUseSize);
822
			getJComboBox_pointType().setSelectedItem(new Integer(m_FSymbol.m_Style));
820
			getJTextField().setText("" + m_FSymbol.getSize());
821
			getJCheckBox().setSelected(m_FSymbol.isSizeInPixels());
822
			getJComboBox_pointType().setSelectedItem(new Integer(m_FSymbol.getStyle()));
823 823
			
824 824
		}
825 825
		
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FCellEditor.java
71 71
			//The user has clicked the cell, so
72 72
			//bring up the dialog.
73 73
			
74
			button.setBackground(currentSymbol.m_Color);
74
			button.setBackground(currentSymbol.getColor());
75 75
			m_panelDefault.setVisible(true);
76 76
			m_panelDefault.setFSymbol(currentSymbol);
77 77
			// colorChooser.setColor(currentSymbol.m_Color);
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendBreaks.java
404 404
				// if (!m_Renderer.m_symbolList.containsKey(elIntervalo)) {
405 405
				//si no esta creado el simbolo se crea
406 406
				theSymbol = new FSymbol(symbolType, new Color(r, g, b));
407
				theSymbol.m_Descrip = NumberFormat.getInstance().format(elIntervalo.getMin()) +
407
				theSymbol.setDescription(NumberFormat.getInstance().format(elIntervalo.getMin()) +
408 408
					" - " +
409
					NumberFormat.getInstance().format(elIntervalo.getMax());
409
					NumberFormat.getInstance().format(elIntervalo.getMax()));
410 410

  
411 411
				//////////////////////////////////////
412 412
				// CALCULAMOS UN COLOR APROPIADO
......
416 416

  
417 417
				/////////////////////////////////
418 418
				m_Renderer.addSymbol(elIntervalo, theSymbol);
419
				System.out.println("addSymbol = "+elIntervalo+" theSymbol = "+theSymbol.m_Descrip);
419
				System.out.println("addSymbol = "+elIntervalo+" theSymbol = "+theSymbol.getDescription());
420 420
				numSymbols++;
421 421

  
422 422
				if (numSymbols > 100) {
......
477 477
			// clave = m_symbolTable.getFieldValue(row,1);
478 478
			theInterval = (FInterval) m_symbolTable.getFieldValue(row, 1);
479 479
			theSymbol = (FSymbol) m_symbolTable.getFieldValue(row, 0);
480
			theSymbol.m_Descrip = (String) m_symbolTable.getFieldValue(row, 2);
480
			theSymbol.setDescription((String) m_symbolTable.getFieldValue(row, 2));
481 481
			m_Renderer.addSymbol(theInterval, theSymbol);
482 482

  
483 483
			///m_Renderer.m_legendIntervals.add(theInterval);
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.m_bUseSize = false;
103
		cloneSym.m_Size = 10; // pixels
102
		cloneSym.setSizeInPixels(false);
103
		cloneSym.setSize(10); // pixels
104 104
		
105 105
		m_FSymbol = cloneSym;
106 106
		m_bUseFSymbol = true;
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/legendmanager/panels/FPanelLegendValues.java
227 227
							break;							
228 228
					}
229 229
									
230
					theSymbol.m_Descrip = clave.toString();
230
					theSymbol.setDescription(clave.toString());
231 231
					auxLegend.addSymbol(clave,theSymbol);
232 232
									
233 233
					numSymbols++;
......
285 285
		{ 
286 286
			clave = (Value) m_symbolTable.getFieldValue(row,1);
287 287
			theSymbol = (FSymbol) m_symbolTable.getFieldValue(row,0);
288
			theSymbol.m_Descrip = (String) m_symbolTable.getFieldValue(row,2);
288
			theSymbol.setDescription((String) m_symbolTable.getFieldValue(row,2));
289 289
			m_Renderer.addSymbol(clave,theSymbol);
290 290
			System.out.println(clave);
291 291
		}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/VectorialUniqueValueLegend.java
147 147
        if (resul != null) {
148 148
            System.err.println("Error: la clave " + key +
149 149
                " ya exist?a. Resul = " + resul);
150
            System.err.println("symbol nuevo:" + symbol.m_Descrip +
151
                " Sviejo= " + ((FSymbol) resul).m_Descrip);
150
            System.err.println("symbol nuevo:" + symbol.getDescription() +
151
                " Sviejo= " + ((FSymbol) resul).getDescription());
152 152
        } else {
153 153
            keys.add(key);
154 154
        }
......
169 169
    	String[] descriptions = new String[symbols.size()];
170 170
    	FSymbol[] auxSym = getSymbols();
171 171
    	for (int i=0; i< descriptions.length; i++)
172
    		descriptions[i] = auxSym[i].m_Descrip;
172
    		descriptions[i] = auxSym[i].getDescription();
173 173
        return descriptions;
174 174
    }
175 175

  
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/VectorialIntervalLegend.java
151 151
		FSymbol[] auxSym = getSymbols();
152 152

  
153 153
		for (int i = 0; i < descriptions.length; i++)
154
			descriptions[i] = auxSym[i].m_Descrip;
154
			descriptions[i] = auxSym[i].getDescription();
155 155

  
156 156
		return descriptions;
157 157
	}
......
329 329
            		auxInterval = FInterval.create(sk[i]);
330 330
					symbols.put(auxInterval, FSymbol.createFromXML(xml.getChild(i+useDefaultSymbol)));
331 331
					keys.add(auxInterval);
332
					System.out.println("auxInterval =" + auxInterval+ "Symbol ="+ FSymbol.createFromXML(xml.getChild(i+useDefaultSymbol)).m_Descrip);
332
					System.out.println("auxInterval =" + auxInterval+ "Symbol ="+ FSymbol.createFromXML(xml.getChild(i+useDefaultSymbol)).getDescription());
333 333
            }
334 334
    		
335 335
    	}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/DemoSHPDriver.java
438 438
        switch (type) {
439 439
            case (SHP.POINT2D):
440 440
                auxType = auxType | FShape.POINT;
441

  
442 441
                break;
443 442

  
444 443
            case (SHP.POLYLINE2D):
445 444
                auxType = auxType | FShape.LINE;
446

  
447 445
                break;
448 446

  
449 447
            case (SHP.POLYGON2D):
450 448
                auxType = auxType | FShape.POLYGON;
449
                break;
450
            case (SHP.POINT3D):
451
                auxType = auxType | FShape.POINT;
452
            	break;
453
            case (SHP.POLYLINE3D):
454
                auxType = auxType | FShape.LINE;
455
            	break;
451 456

  
452
                break;
457
            case (SHP.MULTIPOINT2D):
458
                auxType = auxType | FShape.MULTI;
459
            	break;
460

  
461
            case (SHP.MULTIPOINT3D):
462
                auxType = auxType | FShape.MULTI;
463
            	break;
464
                
453 465
        }
454 466

  
455 467
        return auxType;
......
671 683
		
672 684
		return new File(str.substring(0, str.length() - 3)+ "dbf");
673 685
	}
686

  
687
	/* (non-Javadoc)
688
	 * @see com.iver.cit.gvsig.fmap.drivers.BoundedShapes#getShapeType(int)
689
	 */
690
	public int getShapeType(int index) {
691
		// Por ahora todos los fichero .shp contienen
692
		// entidades del mismo tipo. Si trabajamos con
693
		// alguno mixto, tendremos que cambiar esta funci?n.
694
		return getShapeType();
695
	}
674 696
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/BoundedShapes.java
21 21
	 * @throws IOException DOCUMENT ME!
22 22
	 */
23 23
	Rectangle2D getShapeBounds(int index) throws IOException;
24
	
25
	
26
	/**
27
	 * Devuelve el tipo de la geometr?a. Con .shp est? claro.
28
	 * Con PostGIS, existe una funci?n: 
29
	 * GeometryType(geometry)
30
	 * Returns the type of the geometry as a string. Eg: 'LINESTRING', 'POLYGON', 'MULTIPOINT', etc.
31

  
32
	 * OGC SPEC s2.1.1.1 - Returns the name of the instantiable subtype of Geometry of which this Geometry instance is a member. The name of the instantiable subtype of Geometry is returned as a string.
33
	 * NOTA: CREO QUE ESTO NO TIENE SENTIDO CON BASES DE DATOS.
34
	 * LA ESTRATEGIA CON BASES DE DATOS DEBE SER PEDIR
35
	 * LAS GEOMETRIES CONTENIDAS EN UN RECTANGULO, Y 
36
	 * PREGUNTARLE A CADA GEOMETRY SU BOUNDINGBOX (Y GUARDARLO
37
	 * CON UN SHAPEINFO).
38
	 * TENGO LA SENSACI?N QUE ESTO LO VAMOS A USAR SOLO
39
	 * CON SHAPES
40
 
41
	 * @param index
42
	 * @return
43
	 */
44
	int getShapeType(int index);
45
	
24 46
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/operations/strategies/ShpStrategy.java
4 4

  
5 5
import java.awt.Graphics2D;
6 6
import java.awt.geom.AffineTransform;
7
import java.awt.geom.Point2D;
7 8
import java.awt.geom.Rectangle2D;
8 9
import java.awt.image.BufferedImage;
9 10
import java.io.IOException;
......
13 14
import com.hardcode.driverManager.DriverLoadException;
14 15
import com.hardcode.gdbms.engine.data.DriverException;
15 16
import com.iver.cit.gvsig.fmap.ViewPort;
17
import com.iver.cit.gvsig.fmap.core.FShape;
16 18
import com.iver.cit.gvsig.fmap.core.IGeometry;
17 19
import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
18 20
import com.iver.cit.gvsig.fmap.drivers.BoundedShapes;
......
106 108
					} */
107 109
					
108 110
					FSymbol symbol = l.getSymbol(i); // Cambiar esto
109
					
110
		            // if ((bounds.getHeight() > viewPort.getDist1pixel()) ||
111
		            //          (bounds.getWidth() > viewPort.getDist1pixel()))
111
					boolean bPoint = (shapeBounds.getShapeType(i) == FShape.POINT);
112
					if (bPoint || ((bounds.getHeight() > viewPort.getDist1pixel()) ||
113
		                      (bounds.getWidth() > viewPort.getDist1pixel())))
112 114
		            {	
113 115
		            	geom = driver.getShape(i);
114 116
		            	if (((Selectable)getCapa()).isSelected(i)){
......
117 119
			            	geom.draw(g, viewPort, symbol);
118 120
		            	}
119 121
		            }
120
	                /* else
122
	                else
121 123
	                {
122 124
	                    Point2D.Double pOrig = new Point2D.Double(bounds.getMinX(),
123 125
	                    		bounds.getMinY());
......
130 132

  
131 133
	                    if ((pixX > 0) && (pixX < image.getWidth())) {
132 134
	                        if ((pixY > 0) && (pixY < image.getHeight())) {
133
	                            // theSymbol = getAssociatedSymbol(numReg);
134 135
	                            image.setRGB(pixX, pixY,
135 136
	                                symbol.getRgb());
136 137
	                        }
137 138
	                    }
138
	                } */ 	
139
	                }  	
139 140
					
140 141
					
141 142
					
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FSymbol.java
9 9
import java.awt.BasicStroke;
10 10
import java.awt.Color;
11 11
import java.awt.Font;
12
import java.awt.Graphics2D;
12 13
import java.awt.Image;
13 14
import java.awt.Paint;
15
import java.awt.Rectangle;
14 16
import java.awt.Stroke;
17
import java.awt.image.BufferedImage;
15 18

  
19
import com.iver.cit.gvsig.fmap.rendering.FStyledShapePainter;
16 20
import com.iver.utiles.StringUtilities;
17 21
import com.iver.utiles.XMLEntity;
18 22

  
......
25 29
 *         Comments
26 30
 */
27 31
public class FSymbol {
28
    public int m_symbolType;
29
    public int m_Style;
30
    public boolean m_useOutline;
31
    public Color m_Color;
32
    public Color m_outlineColor;
33
    public Font m_Font;
34
    public Color m_FontColor;
32
	
33
	private static BufferedImage img = new BufferedImage(1,1,BufferedImage.TYPE_INT_ARGB);
34
	private static Rectangle rect = new Rectangle(0,0,1,1);
35
	
36
    private int m_symbolType;
37
    private int m_Style;
38
    private boolean m_useOutline;
39
    private Color m_Color;
40
    private Color m_outlineColor;
41
    private Font m_Font;
42
    private Color m_FontColor;
35 43
    public float m_FontSize;
44
    private int rgb;
36 45
    /**
37 46
     * Si <code>m_bUseFontSize</code> viene a true entonces m_FontSize viene en unidades de mapa (metros)
38 47
     */
39
    public boolean m_bUseFontSize; 
48
    private boolean m_bUseFontSize; 
40 49
    /**
41 50
     * <code>m_bDrawShape</code> indica si queremos dibujar el shape de fondo. Es ?til
42 51
     * cuando est?s etiquetando y no quieres que se dibuje el s?mbolo que te sirve de
43 52
     * base para etiquetar.
44 53
     */
45
    public boolean m_bDrawShape = true;
46
    public int m_Size;
47
    public Image m_Icon;
48
    public int m_Rotation;
49
    public Paint m_Fill;
54
    private boolean m_bDrawShape = true;
55
    private int m_Size;
56
    private Image m_Icon;
57
    private int m_Rotation;
58
    private Paint m_Fill;
50 59
    public String m_LinePattern = "0"; // Solo para poder mostrarlo cuando vamos a seleccionar un s?mbolo
51 60
    									// En realidad lo podemos ver de BasicStroke, pero....
52 61
    									// ya veremos si luego lo quitamos.
53
    public Stroke m_Stroke;
62
    private Stroke m_Stroke;
54 63
    //private float m_stroke=0;
55 64
    // public int m_Transparency; // Ya la lleva dentro del Color
56
    public boolean m_bUseSize;	// Si est? a true, m_Size viene en coordenadas de mundo real.
57
    public int m_AlingVert;
58
    public int m_AlingHoriz;
59
    public String m_Descrip;
65
    private boolean m_bUseSize;	// Si est? a true, m_Size viene en coordenadas de mundo real.
66
    private int m_AlingVert;
67
    private int m_AlingHoriz;
68
    private String m_Descrip;
60 69
    public Color m_BackColor;
61 70
    public Paint m_BackFill;
62 71

  
......
65 74
		FSymbol nS = new FSymbol();
66 75

  
67 76
		
68
		nS.m_symbolType = m_symbolType; 
69
		nS.m_Style = m_Style;
70
		nS.m_useOutline = m_useOutline;
71
		nS.m_Color = m_Color;
72
		nS.m_outlineColor = m_outlineColor;
73
		nS.m_Font = m_Font;
74
		nS.m_FontColor = m_FontColor;
77
		nS.setSymbolType(m_symbolType); 
78
		nS.setStyle(m_Style);
79
		nS.setOutlined(m_useOutline);
80
		nS.setColor(m_Color);
81
		nS.setOutlineColor(m_outlineColor);
82
		nS.setFont(m_Font);
83
		nS.setFontColor(m_FontColor);
75 84
		nS.m_FontSize = m_FontSize;
76
		nS.m_bUseFontSize = m_bUseFontSize;
77
		nS.m_bDrawShape = m_bDrawShape;
78
		nS.m_Size = m_Size;
79
		nS.m_Icon = m_Icon;
80
		nS.m_Rotation = m_Rotation;
81
		nS.m_Fill = m_Fill;
82
		nS.m_Stroke = m_Stroke;
85
		nS.setFontSizeInPixels(m_bUseFontSize);
86
		nS.setShapeVisible(m_bDrawShape);
87
		nS.setSize(m_Size);
88
		nS.setIcon(m_Icon);
89
		nS.setRotation(m_Rotation);
90
		nS.setFill(m_Fill);
91
		nS.setStroke(m_Stroke);
83 92
		// nS.m_Transparency =m_Transparency ;
84
		nS.m_bUseSize = m_bUseSize;
85
		nS.m_AlingVert = m_AlingVert;
86
		nS.m_AlingHoriz = m_AlingHoriz;
87
		nS.m_Descrip = m_Descrip;
93
		nS.setSizeInPixels(m_bUseSize);
94
		nS.setAlingVert(m_AlingVert);
95
		nS.setAlingHoriz(m_AlingHoriz);
96
		nS.setDescription(m_Descrip);
88 97
		nS.m_BackColor = m_BackColor;
89 98
		nS.m_BackFill = m_BackFill;
90 99
		
91 100
		nS.m_LinePattern = m_LinePattern;
92 101
		
102
		nS.rgb = rgb;
103
		
93 104
		return nS;
94 105
	}
95 106
	
......
100 111
	private void createSymbol(int tipoSymbol, Color c)
101 112
	{
102 113
		// Tipo de simbolo
103
		m_symbolType = tipoSymbol;
114
		setSymbolType(tipoSymbol);
104 115
        
105 116
		// Ponemos un estilo por defecto
106
		m_useOutline = true;
107
		m_Color = c;
108
		m_Stroke = null;
109
		m_Fill = null;
117
		setOutlined(true);
118
		setColor(c);
119
		setStroke(null);
120
		setFill(null);
110 121
		
111
		m_FontColor = Color.BLACK;
122
		setFontColor(Color.BLACK);
112 123
            
113
		m_Size = 0;
124
		setSize(0);
114 125
		
115
		switch (m_symbolType)
126
		switch (getSymbolType())
116 127
		{        
117 128
			case FConstant.SYMBOL_TYPE_POINT:
118 129
			case FConstant.SYMBOL_TYPE_POINTZ:
119 130
			case FConstant.SYMBOL_TYPE_MULTIPOINT:
120
				m_useOutline = false;
121
				m_Style = FConstant.SYMBOL_STYLE_MARKER_SQUARE;
122
				m_Size = 5; //pixels
131
				setOutlined(false);
132
				setStyle(FConstant.SYMBOL_STYLE_MARKER_SQUARE);
133
				setSize(5); //pixels
123 134
				break;
124 135
			case FConstant.SYMBOL_TYPE_LINE:
125 136
			case FConstant.SYMBOL_TYPE_POLYLINEZ:
126 137
			case FConstant.SYMBOL_TYPE_POLYGONZ:
127
				m_Stroke = new BasicStroke();
128
				m_Style = FConstant.SYMBOL_STYLE_LINE_SOLID;
138
				setStroke(new BasicStroke());
139
				setStyle(FConstant.SYMBOL_STYLE_LINE_SOLID);
129 140
				break;
130 141
			case FConstant.SYMBOL_TYPE_FILL:
131
				m_Style = FConstant.SYMBOL_STYLE_FILL_SOLID;
142
				setStyle(FConstant.SYMBOL_STYLE_FILL_SOLID);
132 143
				break;		
133 144
		}
134
		m_outlineColor = c.darker();
145
		setOutlineColor(c.darker());
146
		
147
		calculateRgb();
148

  
135 149
	}
136 150

  
151
	private void calculateRgb()
152
	{
153
		// Recalculamos el RGB
154
		Graphics2D g2 = img.createGraphics();
155
		
156
		FGraphicUtilities.DrawSymbol(g2,g2.getTransform(), rect,this);		
157
		rgb = img.getRGB(0,0);
158
		
159
	}
160
	
137 161
    /**
138 162
     * Creates a new FSymbol object.
139 163
     *
......
153 177
			// }
154 178
	}
155 179
        
156
                
180
	public int getRgb()
181
	{
182
		return rgb;
183
	}
157 184

  
158
    /**
159
     * DOCUMENT ME!
160
     */
161
    public void onChangeSymbol() {
162
    }
163 185
	/**
164 186
		 * @see com.iver.cit.gvsig.gui.layout.fframes.IFFrame#getXMLEntity()
165 187
		 */
166 188
		public XMLEntity getXMLEntity(){
167 189
			XMLEntity xml=new XMLEntity();
168
			xml.putProperty("m_symbolType",m_symbolType);
169
			xml.putProperty("m_Style",m_Style);
170
			xml.putProperty("m_useOutline",m_useOutline);
171
			if (m_Color!=null){
172
			xml.putProperty("m_Color",StringUtilities.color2String(m_Color));
190
			xml.putProperty("m_symbolType",getSymbolType());
191
			xml.putProperty("m_Style",getStyle());
192
			xml.putProperty("m_useOutline",isOutlined());
193
			if (getColor()!=null){
194
			xml.putProperty("m_Color",StringUtilities.color2String(getColor()));
173 195
			}
174
			if (m_outlineColor!=null){
175
			xml.putProperty("m_outlineColor",StringUtilities.color2String(m_outlineColor));
196
			if (geOutlineColor()!=null){
197
			xml.putProperty("m_outlineColor",StringUtilities.color2String(geOutlineColor()));
176 198
			}
177
			if (m_Font!=null){
178
			xml.putProperty("fontname",m_Font.getName());
179
			xml.putProperty("fontstyle",m_Font.getStyle());
199
			if (getFont()!=null){
200
			xml.putProperty("fontname",getFont().getName());
201
			xml.putProperty("fontstyle",getFont().getStyle());
180 202
			xml.putProperty("m_FontSize",m_FontSize);
181
			xml.putProperty("m_FontColor",StringUtilities.color2String(m_FontColor));
203
			xml.putProperty("m_FontColor",StringUtilities.color2String(getFontColor()));
182 204
			}
183 205
			
184
			xml.putProperty("m_bUseFontSize",m_bUseFontSize);
185
			xml.putProperty("m_bDrawShape",m_bDrawShape);
186
			xml.putProperty("m_Size",m_Size);
206
			xml.putProperty("m_bUseFontSize",isFontSizeInPixels());
207
			xml.putProperty("m_bDrawShape",isShapeVisible());
208
			xml.putProperty("m_Size",getSize());
187 209
			//xml.putProperty("m_Icon",m_Icon.);
188
			xml.putProperty("m_Rotation",m_Rotation);
189
			if (m_Fill instanceof Color){
190
				xml.putProperty("m_Fill",StringUtilities.color2String((Color)m_Fill));	
210
			xml.putProperty("m_Rotation",geRotation());
211
			if (getFill() instanceof Color){
212
				xml.putProperty("m_Fill",StringUtilities.color2String((Color)getFill()));	
191 213
			}
192 214
			xml.putProperty("m_LinePattern",m_LinePattern);
193 215
			//Ancho del stroke en float
194
			if (m_Stroke!=null){
195
			xml.putProperty("m_stroke",((BasicStroke)m_Stroke).getLineWidth());
216
			if (getStroke()!=null){
217
			xml.putProperty("m_stroke",((BasicStroke)getStroke()).getLineWidth());
196 218
			}else{
197 219
				
198 220
				xml.putProperty("m_stroke",0f);
199 221
			}
200
			xml.putProperty("m_bUseSize",m_bUseSize);
201
			xml.putProperty("m_AlingVert",m_AlingVert);
202
			xml.putProperty("m_AlingHoriz",m_AlingHoriz);
203
			xml.putProperty("m_Descrip",m_Descrip);
222
			xml.putProperty("m_bUseSize",isSizeInPixels());
223
			xml.putProperty("m_AlingVert",getAlingVert());
224
			xml.putProperty("m_AlingHoriz",getAlingHoriz());
225
			xml.putProperty("m_Descrip",getDescription());
204 226
			if (m_BackColor!=null){
205 227
			xml.putProperty("m_BackColor",StringUtilities.color2String(m_BackColor));
206 228
			}
......
214 236
		}
215 237
	public static FSymbol createFromXML(XMLEntity xml) {
216 238
			FSymbol symbol = new FSymbol();
217
		symbol.m_symbolType=xml.getIntProperty("m_symbolType");
218
		symbol.m_Style=	xml.getIntProperty("m_Style");
219
		symbol.m_useOutline=xml.getBooleanProperty("m_useOutline");
239
		symbol.setSymbolType(xml.getIntProperty("m_symbolType"));
240
		symbol.setStyle(xml.getIntProperty("m_Style"));
241
		symbol.setOutlined(xml.getBooleanProperty("m_useOutline"));
220 242
		if (xml.getStringProperty("m_Color")!=null){
221
		symbol.m_Color=StringUtilities.string2Color(xml.getStringProperty("m_Color"));
243
		symbol.setColor(StringUtilities.string2Color(xml.getStringProperty("m_Color")));
222 244
		}
223 245
		if (xml.getStringProperty("m_outlineColor")!=null){
224
		symbol.m_outlineColor=StringUtilities.string2Color(xml.getStringProperty("m_outlineColor"));
246
		symbol.setOutlineColor(StringUtilities.string2Color(xml.getStringProperty("m_outlineColor")));
225 247
		}
226 248
		if (xml.getStringProperty("m_FontColor")!=null){
227
		symbol.m_Font=new Font(xml.getStringProperty("fontname"),xml.getIntProperty("fontstyle"),(int)xml.getFloatProperty("m_FontSize"));
228
		symbol.m_FontColor=StringUtilities.string2Color(xml.getStringProperty("m_FontColor"));
249
		symbol.setFont(new Font(xml.getStringProperty("fontname"),xml.getIntProperty("fontstyle"),(int)xml.getFloatProperty("m_FontSize")));
250
		symbol.setFontColor(StringUtilities.string2Color(xml.getStringProperty("m_FontColor")));
229 251
		symbol.m_FontSize=xml.getFloatProperty("m_FontSize");
230 252
		}
231
		symbol.m_bUseFontSize=xml.getBooleanProperty("m_bUseFontSize");
232
		symbol.m_bDrawShape=xml.getBooleanProperty("m_bDrawShape");
233
		symbol.m_Size=xml.getIntProperty("m_Size");
253
		symbol.setFontSizeInPixels(xml.getBooleanProperty("m_bUseFontSize"));
254
		symbol.setShapeVisible(xml.getBooleanProperty("m_bDrawShape"));
255
		symbol.setSize(xml.getIntProperty("m_Size"));
234 256
		//xml.putProperty("m_Icon",m_Icon.);
235
		symbol.m_Rotation=xml.getIntProperty("m_Rotation");
257
		symbol.setRotation(xml.getIntProperty("m_Rotation"));
236 258
		if (xml.getStringProperty("m_Fill")!=null){
237
			symbol.m_Fill=StringUtilities.string2Color(xml.getStringProperty("m_Fill"));	
259
			symbol.setFill(StringUtilities.string2Color(xml.getStringProperty("m_Fill")));	
238 260
		}
239 261
		symbol.m_LinePattern=xml.getStringProperty("m_LinePattern");
240 262
		//Ancho del stroke en float
241
		symbol.m_Stroke=new BasicStroke(xml.getFloatProperty("m_stroke"));
242
		symbol.m_bUseSize=xml.getBooleanProperty("m_bUseSize");
243
		symbol.m_AlingVert=xml.getIntProperty("m_AlingVert");
244
		symbol.m_AlingHoriz=xml.getIntProperty("m_AlingHoriz");
245
		symbol.m_Descrip=xml.getStringProperty("m_Descrip");
263
		symbol.setStroke(new BasicStroke(xml.getFloatProperty("m_stroke")));
264
		symbol.setSizeInPixels(xml.getBooleanProperty("m_bUseSize"));
265
		symbol.setAlingVert(xml.getIntProperty("m_AlingVert"));
266
		symbol.setAlingHoriz(xml.getIntProperty("m_AlingHoriz"));
267
		symbol.setDescription(xml.getStringProperty("m_Descrip"));
246 268
		if (xml.getStringProperty("m_BackColor")!=null){
247 269
		symbol.m_BackColor=StringUtilities.string2Color(xml.getStringProperty("m_BackColor"));
248 270
		}
......
251 273
		}
252 274
			return symbol;
253 275
		}
276

  
277
	/**
278
	 * @param m_Style The m_Style to set.
279
	 */
280
	public void setStyle(int m_Style) {
281
		this.m_Style = m_Style;
282
		calculateRgb();
283
	}
284

  
285
	/**
286
	 * @return Returns the m_Style.
287
	 */
288
	public int getStyle() {
289
		return m_Style;
290
	}
291

  
292
	/**
293
	 * @param m_symbolType The m_symbolType to set.
294
	 */
295
	public void setSymbolType(int m_symbolType) {
296
		this.m_symbolType = m_symbolType;
297
	}
298

  
299
	/**
300
	 * @return Returns the m_symbolType.
301
	 */
302
	public int getSymbolType() {
303
		return m_symbolType;
304
	}
305

  
306
	/**
307
	 * @param m_useOutline The m_useOutline to set.
308
	 */
309
	public void setOutlined(boolean m_useOutline) {
310
		this.m_useOutline = m_useOutline;
311
		calculateRgb();
312
	}
313

  
314
	/**
315
	 * @return Returns the m_useOutline.
316
	 */
317
	public boolean isOutlined() {
318
		return m_useOutline;
319
	}
320

  
321
	/**
322
	 * @param m_Color The m_Color to set.
323
	 */
324
	public void setColor(Color m_Color) {
325
		this.m_Color = m_Color;
326
		calculateRgb();
327
	}
328

  
329
	/**
330
	 * @return Returns the m_Color.
331
	 */
332
	public Color getColor() {
333
		return m_Color;
334
	}
335

  
336
	/**
337
	 * @param m_outlineColor The m_outlineColor to set.
338
	 */
339
	public void setOutlineColor(Color m_outlineColor) {
340
		this.m_outlineColor = m_outlineColor;
341
		calculateRgb();
342
	}
343

  
344
	/**
345
	 * @return Returns the m_outlineColor.
346
	 */
347
	public Color geOutlineColor() {
348
		return m_outlineColor;
349
	}
350

  
351
	/**
352
	 * @param m_Font The m_Font to set.
353
	 */
354
	public void setFont(Font m_Font) {
355
		this.m_Font = m_Font;
356
		calculateRgb();
357
	}
358

  
359
	/**
360
	 * @return Returns the m_Font.
361
	 */
362
	public Font getFont() {
363
		return m_Font;
364
	}
365

  
366
	/**
367
	 * @param m_FontColor The m_FontColor to set.
368
	 */
369
	public void setFontColor(Color m_FontColor) {
370
		this.m_FontColor = m_FontColor;
371
		calculateRgb();
372
	}
373

  
374
	/**
375
	 * @return Returns the m_FontColor.
376
	 */
377
	public Color getFontColor() {
378
		return m_FontColor;
379
	}
380

  
381
	/**
382
	 * @param m_bUseFontSize The m_bUseFontSize to set.
383
	 */
384
	public void setFontSizeInPixels(boolean m_bUseFontSize) {
385
		this.m_bUseFontSize = m_bUseFontSize;
386
		calculateRgb();
387
	}
388

  
389
	/**
390
	 * @return Returns the m_bUseFontSize.
391
	 */
392
	public boolean isFontSizeInPixels() {
393
		return m_bUseFontSize;
394
	}
395

  
396
	/**
397
	 * @param m_bDrawShape The m_bDrawShape to set.
398
	 */
399
	public void setShapeVisible(boolean m_bDrawShape) {
400
		this.m_bDrawShape = m_bDrawShape;
401
		calculateRgb();
402
	}
403

  
404
	/**
405
	 * @return Returns the m_bDrawShape.
406
	 */
407
	public boolean isShapeVisible() {
408
		return m_bDrawShape;
409
	}
410

  
411
	/**
412
	 * @param m_Size The m_Size to set.
413
	 */
414
	public void setSize(int m_Size) {
415
		this.m_Size = m_Size;
416
		calculateRgb();
417
	}
418

  
419
	/**
420
	 * @return Returns the m_Size.
421
	 */
422
	public int getSize() {
423
		return m_Size;
424
	}
425

  
426
	/**
427
	 * @param m_Icon The m_Icon to set.
428
	 */
429
	public void setIcon(Image m_Icon) {
430
		this.m_Icon = m_Icon;
431
		calculateRgb();
432
	}
433

  
434
	/**
435
	 * @return Returns the m_Icon.
436
	 */
437
	public Image geIcon() {
438
		return m_Icon;
439
	}
440

  
441
	/**
442
	 * @param m_Rotation The m_Rotation to set.
443
	 */
444
	public void setRotation(int m_Rotation) {
445
		this.m_Rotation = m_Rotation;
446
		calculateRgb();
447
	}
448

  
449
	/**
450
	 * @return Returns the m_Rotation.
451
	 */
452
	public int geRotation() {
453
		return m_Rotation;
454
	}
455

  
456
	/**
457
	 * @param m_Fill The m_Fill to set.
458
	 */
459
	public void setFill(Paint m_Fill) {
460
		this.m_Fill = m_Fill;
461
		calculateRgb();
462
	}
463

  
464
	/**
465
	 * @return Returns the m_Fill.
466
	 */
467
	public Paint getFill() {
468
		return m_Fill;
469
	}
470

  
471
	/**
472
	 * @param m_Stroke The m_Stroke to set.
473
	 */
474
	public void setStroke(Stroke m_Stroke) {
475
		this.m_Stroke = m_Stroke;
476
		calculateRgb();
477
	}
478

  
479
	/**
480
	 * @return Returns the m_Stroke.
481
	 */
482
	public Stroke getStroke() {
483
		return m_Stroke;
484
	}
485

  
486
	/**
487
	 * @param m_bUseSize The m_bUseSize to set.
488
	 */
489
	public void setSizeInPixels(boolean m_bUseSize) {
490
		this.m_bUseSize = m_bUseSize;
491
		calculateRgb();
492
	}
493

  
494
	/**
495
	 * @return Returns the m_bUseSize.
496
	 */
497
	public boolean isSizeInPixels() {
498
		return m_bUseSize;
499
	}
500

  
501
	/**
502
	 * @param m_Descrip The m_Descrip to set.
503
	 */
504
	public void setDescription(String m_Descrip) {
505
		this.m_Descrip = m_Descrip;
506
	}
507

  
508
	/**
509
	 * @return Returns the m_Descrip.
510
	 */
511
	public String getDescription() {
512
		return m_Descrip;
513
	}
514

  
515
	/**
516
	 * @param m_AlingVert The m_AlingVert to set.
517
	 */
518
	public void setAlingVert(int m_AlingVert) {
519
		this.m_AlingVert = m_AlingVert;
520
		calculateRgb();
521
	}
522

  
523
	/**
524
	 * @return Returns the m_AlingVert.
525
	 */
526
	public int getAlingVert() {
527
		return m_AlingVert;
528
	}
529

  
530
	/**
531
	 * @param m_AlingHoriz The m_AlingHoriz to set.
532
	 */
533
	public void setAlingHoriz(int m_AlingHoriz) {
534
		this.m_AlingHoriz = m_AlingHoriz;
535
		calculateRgb();
536
	}
537

  
538
	/**
539
	 * @return Returns the m_AlingHoriz.
540
	 */
541
	public int getAlingHoriz() {
542
		return m_AlingHoriz;
543
	}
254 544
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FGraphicUtilities.java
50 50
        // g2.clearRect(r.x, r.y, r.width, r.height);
51 51
        // System.out.println("r = " + r.toString() + " Color preview:" + symbol.m_Color.toString());
52 52
        // System.out.println("symbol.m_symbolType= "+symbol.m_symbolType);
53
        switch (symbol.m_symbolType) {
53
        switch (symbol.getSymbolType()) {
54 54
            case FConstant.SYMBOL_TYPE_MULTIPOINT:
55 55

  
56 56
                shp = new FPoint2D(r.x + (r.width / 2),
......
58 58
                
59 59

  
60 60
                //  Para no tener que clonarlo si viene en unidades de mapa
61
                boolean bAux22 = symbol.m_bUseSize;
62
                int alturaMetros2 = symbol.m_Size; // Nota: Cambiar m_Size a float
61
                boolean bAux22 = symbol.isSizeInPixels();
62
                int alturaMetros2 = symbol.getSize(); // Nota: Cambiar m_Size a float
63 63

  
64
                if (symbol.m_bUseSize) {
65
                    symbol.m_Size = 8; // tama?o fijo
66
                    symbol.m_bUseSize = false;
64
                if (symbol.isSizeInPixels()) {
65
                    symbol.setSize(8); // tama?o fijo
66
                    symbol.setSizeInPixels(false);
67 67
                }
68 68
				//FShape auxshp=new FShape(shp.multipoint.getPoint(0));
69 69
                FGraphicUtilities.DrawShape(g2, mT, shp, symbol);
70 70

  
71 71
                if (bAux22) {
72
                    symbol.m_Size = alturaMetros2;
73
                    symbol.m_bUseSize = bAux22;
72
                    symbol.setSize(alturaMetros2);
73
                    symbol.setSizeInPixels(bAux22);
74 74
                }
75 75

  
76
                if (symbol.m_Font != null) {
76
                if (symbol.getFont() != null) {
77 77
                    // Para no tener que clonarlo si viene en unidades de mapa
78
                    boolean bAux = symbol.m_bUseFontSize;
79
                    symbol.m_bUseFontSize = false;
78
                    boolean bAux = symbol.isFontSizeInPixels();
79
                    symbol.setFontSizeInPixels(false);
80 80
                    FGraphicUtilities.DrawLabel(g2, mT, shp, symbol,
81 81
                        new FLabel("Abcd"));
82
                    symbol.m_bUseFontSize = bAux;
82
                    symbol.setFontSizeInPixels(bAux);
83 83
                }
84 84

  
85 85
                break;
......
91 91
                        r.y + (r.height / 2));
92 92

  
93 93
                //  Para no tener que clonarlo si viene en unidades de mapa
94
                boolean bAux2 = symbol.m_bUseSize;
95
                int alturaMetros = symbol.m_Size; // Nota: Cambiar m_Size a float
94
                boolean bAux2 = symbol.isSizeInPixels();
95
                int alturaMetros = symbol.getSize(); // Nota: Cambiar m_Size a float
96 96

  
97
                if (symbol.m_bUseSize) {
98
                    symbol.m_Size = 8; // tama?o fijo
99
                    symbol.m_bUseSize = false;
97
                if (symbol.isSizeInPixels()) {
98
                    symbol.setSize(8); // tama?o fijo
99
                    symbol.setSizeInPixels(false);
100 100
                }
101 101

  
102 102
                FGraphicUtilities.DrawShape(g2, mT, shp, symbol);
103 103

  
104 104
                if (bAux2) {
105
                    symbol.m_Size = alturaMetros;
106
                    symbol.m_bUseSize = bAux2;
105
                    symbol.setSize(alturaMetros);
106
                    symbol.setSizeInPixels(bAux2);
107 107
                }
108 108

  
109
                if (symbol.m_Font != null) {
109
                if (symbol.getFont() != null) {
110 110
                    // Para no tener que clonarlo si viene en unidades de mapa
111
                    boolean bAux = symbol.m_bUseFontSize;
112
                    symbol.m_bUseFontSize = false;
111
                    boolean bAux = symbol.isFontSizeInPixels();
112
                    symbol.setFontSizeInPixels(false);
113 113
                    FGraphicUtilities.DrawLabel(g2, mT, shp, symbol,
114 114
                        new FLabel("Abcd"));
115
                    symbol.m_bUseFontSize = bAux;
115
                    symbol.setFontSizeInPixels(bAux);
116 116
                }
117 117

  
118 118
                break;
......
166 166
            return;
167 167
        }
168 168

  
169
        g2.setColor(theSymbol.m_Color);
169
        g2.setColor(theSymbol.getColor());
170 170

  
171 171
        switch (shp.getShapeType()) {
172 172
            case FShape.POINT: //Tipo punto
......
177 177

  
178 178
                // Shape theShp = mT.createTransformedShape(shp.m_Polyline);
179 179
                // g2.setColor(theSymbol.m_Color);
180
                if (theSymbol.m_Stroke != null) {
181
                    g2.setStroke(theSymbol.m_Stroke);
180
                if (theSymbol.getStroke() != null) {
181
                    g2.setStroke(theSymbol.getStroke());
182 182
                }
183 183

  
184 184
                g2.draw(shp);
......
187 187
                
188 188

  
189 189
            case FShape.POLYGON:
190
                g2.setPaint(theSymbol.m_Fill);
190
                g2.setPaint(theSymbol.getFill());
191 191

  
192
                if (theSymbol.m_Color != null) {
192
                if (theSymbol.getColor() != null) {
193 193
                    g2.fill(shp);
194 194
                }
195 195

  
196
                if (theSymbol.m_useOutline) {
197
                    g2.setColor(theSymbol.m_outlineColor);
196
                if (theSymbol.isOutlined()) {
197
                    g2.setColor(theSymbol.geOutlineColor());
198 198

  
199
                    if (theSymbol.m_Stroke != null) {
200
                        g2.setStroke(theSymbol.m_Stroke);
199
                    if (theSymbol.getStroke() != null) {
200
                        g2.setStroke(theSymbol.getStroke());
201 201
                    }
202 202

  
203 203
                    g2.draw(shp);
......
237 237
        int height = metrics.getMaxAscent();
238 238

  
239 239
        // int height = metrics.getHeight();
240
        g2.setFont(theSymbol.m_Font);
241
        g2.setColor(theSymbol.m_FontColor);
240
        g2.setFont(theSymbol.getFont());
241
        g2.setColor(theSymbol.getFontColor());
242 242

  
243 243
        // Aqu? hay que mirar m_Size y m_useSize...
244
        if (theSymbol.m_bUseFontSize) {
244
        if (theSymbol.isFontSizeInPixels()) {
245 245
            // Suponemos que m_Size viene en coordenadas de mundo real
246 246
            // Esto habr? que cambiarlo. Probablemente usar Style2d de geotools en lugar
247 247
            // de FSymbol.
......
255 255
                return; // No leemos nada
256 256
            }
257 257

  
258
            Font nuevaFuente = theSymbol.m_Font.deriveFont(alturaPixels);
258
            Font nuevaFuente = theSymbol.getFont().deriveFont(alturaPixels);
259 259
            g2.setFont(nuevaFuente);
260 260
            width = g2.getFontMetrics().stringWidth(theLabel.getString());
261 261
        }
......
409 409

  
410 410
        // Aqu? hay que mirar m_Size y m_useSize...
411 411
        float radio_simbolo;
412
        radio_simbolo = theSymbol.m_Size / 2;
412
        radio_simbolo = theSymbol.getSize() / 2;
413 413

  
414
        if (theSymbol.m_bUseSize) {
414
        if (theSymbol.isSizeInPixels()) {
415 415
            // Suponemos que m_Size viene en coordenadas de mundo real
416
            radio_simbolo = (float) (theSymbol.m_Size * mT.getScaleX());
416
            radio_simbolo = (float) (theSymbol.getSize() * mT.getScaleX());
417 417

  
418 418
            /* System.out.println("m_bUseSize = " + theSymbol.m_bUseSize +
419 419
               " Escala: " + mT.getScaleX() + " alturaPixels = " + alturaPixels); */
......
423 423
        } else {
424 424
            // m_Size viene en pixels
425 425
            rectAux.setRect(x - radio_simbolo, y - radio_simbolo,
426
                theSymbol.m_Size, theSymbol.m_Size);
426
                theSymbol.getSize(), theSymbol.getSize());
427 427
        }
428 428

  
429 429
        // 	continue; //radioSimbolo_en_pixels = 3;
430
        if (theSymbol.m_Fill != null) {
431
            g2.setPaint(theSymbol.m_Fill);
430
        if (theSymbol.getFill() != null) {
431
            g2.setPaint(theSymbol.getFill());
432 432
        }
433 433

  
434
        if (theSymbol.m_Stroke != null) {
435
            g2.setStroke(theSymbol.m_Stroke);
434
        if (theSymbol.getStroke() != null) {
435
            g2.setStroke(theSymbol.getStroke());
436 436
        }
437 437

  
438 438
        if (radio_simbolo < 2) {
......
441 441
            return;
442 442
        }
443 443

  
444
        switch (theSymbol.m_Style) {
444
        switch (theSymbol.getStyle()) {
445 445
            case FConstant.SYMBOL_STYLE_MARKER_CIRCLE: // Circulito
446 446

  
447
                if (theSymbol.m_Color != null) {
447
                if (theSymbol.getColor() != null) {
448 448
                    g2.fillOval(rectAux.x, rectAux.y, rectAux.width,
449 449
                        rectAux.height);
450 450
                }
451 451

  
452
                if (theSymbol.m_useOutline) {
453
                    g2.setColor(theSymbol.m_outlineColor);
452
                if (theSymbol.isOutlined()) {
453
                    g2.setColor(theSymbol.geOutlineColor());
454 454
                    g2.drawOval(rectAux.x, rectAux.y, rectAux.width,
455 455
                        rectAux.height);
456 456
                }
......
460 460
            case FConstant.SYMBOL_STYLE_MARKER_SQUARE: // Cuadrado
461 461
                g2.fillRect(rectAux.x, rectAux.y, rectAux.width, rectAux.height);
462 462

  
463
                if (theSymbol.m_useOutline) {
464
                    g2.setColor(theSymbol.m_outlineColor);
463
                if (theSymbol.isOutlined()) {
464
                    g2.setColor(theSymbol.geOutlineColor());
465 465
                    g2.drawRect(rectAux.x, rectAux.y, rectAux.width,
466 466
                        rectAux.height);
467 467
                }
......
514 514
               break; */
515 515
            case FConstant.SYMBOL_STYLE_MARKER_IMAGEN: // Icono
516 516
            {
517
            	if (theSymbol.m_Icon != null)
517
            	if (theSymbol.geIcon() != null)
518 518
            	{
519 519
            		float w, h;
520
                    if (theSymbol.m_bUseSize) {
520
                    if (theSymbol.isSizeInPixels()) {
521 521
                        // Suponemos que m_Size viene en coordenadas de mundo real
522 522
                    	// Por ejemplo, nos valemos del ancho para fijar la escala
523
                        w = (float) (theSymbol.m_Size * mT.getScaleX());
524
                        h = theSymbol.m_Icon.getHeight(null) * w / theSymbol.m_Icon.getWidth(null);  
523
                        w = (float) (theSymbol.getSize() * mT.getScaleX());
524
                        h = theSymbol.geIcon().getHeight(null) * w / theSymbol.geIcon().getWidth(null);  
525 525

  
526 526
                        rectAux.setRect(x - w, y - h,
527 527
                            w * 2, h * 2);
528 528
                    } else {
529 529
                        // m_Size viene en pixels
530
                    	w = theSymbol.m_Size;
531
                        h = theSymbol.m_Icon.getHeight(null) * w / theSymbol.m_Icon.getWidth(null);                    	
530
                    	w = theSymbol.getSize();
531
                        h = theSymbol.geIcon().getHeight(null) * w / theSymbol.geIcon().getWidth(null);                    	
532 532
                        rectAux.setRect(x - w, y - h, w, h);
533 533
                    }
534 534
            		
535
            		g2.drawImage(theSymbol.m_Icon, rectAux.x, rectAux.y, rectAux.width, rectAux.height, null);
535
            		g2.drawImage(theSymbol.geIcon(), rectAux.x, rectAux.y, rectAux.width, rectAux.height, null);
536 536
            	}
537 537
            	else
538 538
            	{
......
551 551
               break; */
552 552
            case FConstant.SYMBOL_STYLE_POINTZ: // Circulito
553 553

  
554
                if (theSymbol.m_Color != null) {
554
                if (theSymbol.getColor() != null) {
555 555
                    g2.fillOval(rectAux.x, rectAux.y, rectAux.width,
556 556
                        rectAux.height);
557 557
                }
558 558

  
559
                if (theSymbol.m_useOutline) {
560
                    g2.setColor(theSymbol.m_outlineColor);
559
                if (theSymbol.isOutlined()) {
560
                    g2.setColor(theSymbol.geOutlineColor());
561 561
                    g2.drawOval(rectAux.x, rectAux.y, rectAux.width,
562 562
                        rectAux.height);
563 563
                }
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/FShape.java
13 13
    public final static int LINE = 2;
14 14
    public final static int POLYGON = 4;
15 15
    public final static int TEXT = 8;
16
    public final static int MULTI = 16;
16 17

  
17 18
    /**
18 19
     * Obtiene el tipo de shape que contiene. Puede ser una

Also available in: Unified diff