Revision 810 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FGraphicUtilities.java

View differences:

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 52

  
52 53
        // g2.clearRect(r.x, r.y, r.width, r.height);
53 54
        // System.out.println("r = " + r.toString() + " Color preview:" + symbol.m_Color.toString());
54 55
        // System.out.println("symbol.m_symbolType= "+symbol.m_symbolType);
55 56
        switch (symbol.getSymbolType()) {
56
            case FConstant.SYMBOL_TYPE_MULTIPOINT:
57

  
58
                shp = new FPoint2D(r.x + (r.width / 2),
59
                        r.y + (r.height / 2));
60
                
61

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

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

  
73
                if (bAux22) {
74
                    symbol.setSize(alturaMetros2);
75
                    symbol.setSizeInPixels(bAux22);
76
                }
77

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

  
87
                break;
88

  
89 57
            case FConstant.SYMBOL_TYPE_POINT:
90
            case FConstant.SYMBOL_TYPE_POINTZ:
91

  
92 58
                shp = new FPoint2D(r.x + (r.width / 2),
93 59
                        r.y + (r.height / 2));
94 60

  
......
118 84
                }
119 85

  
120 86
                break;
121

  
122 87
            case FConstant.SYMBOL_TYPE_LINE:
123
            case FConstant.SHAPE_TYPE_POLYLINEZ:
124

  
125 88
                Rectangle rect = mT2.createTransformedShape(r).getBounds();
126 89
                GeneralPathX line = new GeneralPathX();
127 90
                line.moveTo(rect.x, rect.y + (rect.height / 2));
......
140 103
                break;
141 104

  
142 105
            case FConstant.SYMBOL_TYPE_FILL:
143
            case FConstant.SHAPE_TYPE_POLYGONZ:
144 106

  
145 107
                GeneralPathX rectAux = new GeneralPathX(r);
146 108
                rectAux.transform(mT2);
......
150 112
                FGraphicUtilities.DrawShape(g2, mT, shp, symbol);
151 113

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

  
125
                line.curveTo(rect.x + (rect.width / 3),
126
                    rect.y + (2 * rect.height),
127
                    rect.x + ((2 * rect.width) / 3), rect.y - rect.height,
128
                    rect.x + rect.width, rect.y + (rect.height / 2));
129

  
130
                shp = new FPolyline2D(line);
131
                FGraphicUtilities.DrawShape(g2, mT, shp, symbol);
132

  
133
                break;
134
                
153 135
        }
154 136
    }
155 137

  

Also available in: Unified diff