Revision 1846

View differences:

org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/java/org/gvsig/legend/aggregate/app/AggregateLegendTextExtension.java
1 1

  
2 2
package org.gvsig.legend.aggregate.app;
3 3

  
4
import org.gvsig.andami.IconThemeHelper;
4 5
import org.gvsig.andami.plugins.Extension;
5 6

  
6 7

  
......
8 9

  
9 10
    @Override
10 11
    public void initialize() {
12
        IconThemeHelper.registerIcon("legend", "legend-overview-vectorial-aggregated", this);
11 13
    }
12 14

  
13 15
    @Override
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/resources-plugin/i18n/text.properties
1
_Aggregate_legend_description=Leyenda de agrupaci\u00f3n de marcadores
2
_Aggregate_legend=Agrupaci\u00f3n de marcadores
3
_Use_basic_cluster_mark=Usar estilo b\u00e1sico para la agrupaci\u00f3n de marcadores
4
_Use_styled_cluster_mark=Usar un estilo avanzado para la agrupaci\u00f3n de marcadores
5
_Symbol_size=Tama\u00f1o de simbolo
6
_Outline_color=Color del contorno
7
_Fill_color=Color de relleno
8
_Text_color=Color de texto
9
_Text_font=Fuente del texto
10
_Show_bounds=Mostrar l\u00edmites
11
_Style=Estilo
12
_Operation=Operaci\u00f3n
13
_Attribute=Atributo
14
_Aditional_value=Valor adicional
15
Alpha=Alpha
16
_Average=Media
17
_Calculate_the_average_of_the_selected_attribute_for_the_grouped_features=Calcula la media del atributo seleccionado para las features agrupadas
18
_Count=Cuenta
19
_Count_of_grouped_features=Cuenta de las features agrupadas
20
_Maximum=M\u00e1ximo
21
_Calculate_the_maximum_of_the_selected_attribute_for_the_grouped_features=Calcula el maximo del atributo seleccionado para las features agrupadas
22
_Minimun=Minimo
23
_Calculate_the_minimun_of_the_selected_attribute_for_the_grouped_features=Calcula el minimo del atributo seleccionado para las features agrupadas
24
_Select_style=Seleccion de estilo
25
_Sum=Suma
26
_Calculate_the_sum_of_the_selected_attribute_for_the_grouped_features=Calcula la suma del atributo seleccionado para las features agrupadas
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties
1
_Aggregate_legend_description=Marker clustering legend
2
_Aggregate_legend=Marker clustering
3
_Use_basic_cluster_mark=Use basic style cluster mark
4
_Use_styled_cluster_mark=Use advanced style cluster mark
5
_Symbol_size=Symbol size
6
_Outline_color=Outline color
7
_Fill_color=Fill color
8
_Text_color=Text color
9
_Text_font=Text font
10
_Show_bounds=Show bounds
11
_Style=Style
12
_Operation=Operation
13
_Attribute=Attribute
14
_Aditional_value=Aditional value
15
Alpha=Alpha
16
_Average=Average
17
_Calculate_the_average_of_the_selected_attribute_for_the_grouped_features=Calculate the average of the selected attribute for the grouped features
18
_Count=Count
19
_Count_of_grouped_features=Count of grouped features
20
_Maximum=Maximum
21
_Calculate_the_maximum_of_the_selected_attribute_for_the_grouped_features=Calculate the maximum of the selected attribute for the grouped features
22
_Minimun=Minimun
23
_Calculate_the_minimun_of_the_selected_attribute_for_the_grouped_features=Calculate the minimun of the selected attribute for the grouped features
24
_Select_style=Select style
25
_Calculate_the_sum_of_the_selected_attribute_for_the_grouped_features=Calculate the sum of the selected attribute for the grouped features
26
_Sum=Sum
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/operation/CountOperation.java
1
package org.gvsig.legend.aggregate.lib.impl.operation;
2

  
3
import org.gvsig.fmap.dal.feature.Feature;
4
import org.gvsig.legend.aggregate.lib.api.AbstractOperation;
5

  
6

  
7
public class CountOperation extends AbstractOperation {
8
    int count = 0;
9
    
10
    public CountOperation() {
11
        super("_Count", "_Count_of_grouped_features");
12
    }
13

  
14
    @Override
15
    public void reset() {
16
        count = 0;
17
    }
18
    
19
    @Override
20
    public void perform(Feature feature) {
21
        count++;
22
    }
23

  
24
    @Override
25
    public Object getValue() {
26
        return count;
27
    }
28
    
29
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/operation/AvgOperation.java
1
package org.gvsig.legend.aggregate.lib.impl.operation;
2

  
3
import java.text.MessageFormat;
4
import org.apache.commons.lang3.StringUtils;
5
import org.gvsig.fmap.dal.feature.Feature;
6
import org.gvsig.legend.aggregate.lib.api.AbstractOperation;
7

  
8
public class AvgOperation extends AbstractOperation {
9

  
10
    private double avg = 0;
11
    private int count = 0;
12

  
13
    public AvgOperation() {
14
        super(
15
            "_Average", 
16
            "_Calculate_the_average_of_the_selected_attribute_for_the_grouped_features"
17
        );
18
    }
19

  
20
    @Override
21
    public boolean isAttributeRequiered() {
22
        return true;
23
    }
24

  
25
    @Override
26
    public boolean isAditionalValueRequiered() {
27
        return true;
28
    }
29

  
30
    @Override
31
    public void reset() {
32
        avg = 0;
33
        count = 0;
34
    }
35

  
36
    @Override
37
    public void perform(Feature feature) {
38
            try {
39
                double value = feature.getDouble(this.getAttributeName());
40
                avg = ( avg * count + value ) / (count+1);
41
                count++;
42
            } catch(Exception ex) {
43
            }
44
    }
45

  
46
    @Override
47
    public Object getValue() {
48
        return this.avg;
49
    }
50

  
51
    @Override
52
    public String format() {
53
        if( StringUtils.isEmpty(this.getAditionalValue()) ) {
54
            return super.format(); 
55
        }
56
        try {
57
            return MessageFormat.format("{0,number,"+this.getAditionalValue()+"}", this.getValue());
58
        } catch(Exception ex) {
59
            return super.format(); 
60
        }
61
    }
62
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/operation/MinOperation.java
1
package org.gvsig.legend.aggregate.lib.impl.operation;
2

  
3
import org.gvsig.fmap.dal.feature.Feature;
4
import org.gvsig.legend.aggregate.lib.api.AbstractOperation;
5

  
6
public class MinOperation extends AbstractOperation {
7

  
8
    private int min = 0;
9

  
10
    public MinOperation() {
11
        super("_Minimun", "_Calculate_the_minimum_of_the_selected_attribute_for_the_grouped_features");
12
    }
13

  
14
    @Override
15
    public boolean isAttributeRequiered() {
16
        return true;
17
    }
18

  
19
    @Override
20
    public void reset() {
21
        min = 0;
22
    }
23

  
24
    @Override
25
    public void perform(Feature feature) {
26
        try {
27
            int x = feature.getInt(this.getAttributeName());
28
            if( x > min ) {
29
                min = x;
30
            }
31
        } catch (Exception ex) {
32
        }
33
    }
34

  
35
    @Override
36
    public Object getValue() {
37
        return this.min;
38
    }
39

  
40
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/operation/SumOperation.java
1
package org.gvsig.legend.aggregate.lib.impl.operation;
2

  
3
import java.text.MessageFormat;
4
import org.apache.commons.lang3.StringUtils;
5
import org.gvsig.fmap.dal.feature.Feature;
6
import org.gvsig.legend.aggregate.lib.api.AbstractOperation;
7

  
8

  
9
public class SumOperation extends AbstractOperation {
10
    int sum = 0;
11
    
12
    public SumOperation() {
13
        super("_Sum", "_Calculate_the_sum_of_the_selected_attribute_for_the_grouped_features");
14

  
15
    }
16

  
17
    @Override
18
    public boolean isAttributeRequiered() {
19
        return true;
20
    }
21

  
22
    @Override
23
    public boolean isAditionalValueRequiered() {
24
        return true;
25
    }
26
    
27
    @Override
28
    public void reset() {
29
        sum = 0;
30
    }
31
    
32
    @Override
33
    public void perform(Feature feature) {
34
        try {
35
            double x = feature.getDouble(this.getAttributeName());
36
            sum += x;
37
        } catch (Exception ex) {
38
        }
39
    }
40

  
41
    @Override
42
    public Object getValue() {
43
        return sum;
44
    }
45

  
46
    @Override
47
    public String format() {
48
        if( StringUtils.isEmpty(this.getAditionalValue()) ) {
49
            return super.format(); 
50
        }
51
        try {
52
            return MessageFormat.format("{0,number,"+this.getAditionalValue().trim()+"}", this.getValue());
53
        } catch(Exception ex) {
54
            return super.format(); 
55
        }
56
    }    
57
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/operation/MaxOperation.java
1
package org.gvsig.legend.aggregate.lib.impl.operation;
2

  
3
import org.gvsig.fmap.dal.feature.Feature;
4
import org.gvsig.legend.aggregate.lib.api.AbstractOperation;
5

  
6
public class MaxOperation extends AbstractOperation {
7

  
8
    private int max = 0;
9

  
10
    public MaxOperation() {
11
        super("_Maximum", "_Calculate_the_maximum_of_the_selected_attribute_for_the_grouped_features");
12
    }
13

  
14
    @Override
15
    public boolean isAttributeRequiered() {
16
        return true;
17
    }
18

  
19
    @Override
20
    public void reset() {
21
        max = 0;
22
    }
23

  
24
    @Override
25
    public void perform(Feature feature) {
26
        try {
27
            int x = feature.getInt(this.getAttributeName());
28
            if( x > max ) {
29
                max = x;
30
            }
31
        } catch (Exception ex) {
32
        }
33
    }
34

  
35
    @Override
36
    public Object getValue() {
37
        return this.max;
38
    }
39
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/DefaultAggregateLegendManager.java
22 22
 */
23 23
package org.gvsig.legend.aggregate.lib.impl;
24 24

  
25
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
25
import java.util.Collection;
26
import java.util.HashMap;
27
import java.util.Map;
26 28
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle;
27 29
import org.gvsig.legend.aggregate.lib.api.AggregateLegend;
28 30
import org.gvsig.legend.aggregate.lib.api.AggregateLegendManager;
31
import org.gvsig.legend.aggregate.lib.api.Operation;
32
import org.gvsig.legend.aggregate.lib.impl.operation.AvgOperation;
33
import org.gvsig.legend.aggregate.lib.impl.operation.CountOperation;
34
import org.gvsig.legend.aggregate.lib.impl.operation.MaxOperation;
35
import org.gvsig.legend.aggregate.lib.impl.operation.MinOperation;
36
import org.gvsig.legend.aggregate.lib.impl.operation.SumOperation;
29 37
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.SimpleLabelStyle;
30 38

  
31 39

  
32 40
public class DefaultAggregateLegendManager implements AggregateLegendManager {
33 41

  
34 42
    private ILabelStyle defaultLabelStyle = null;
43
    private Map<String,Operation> operations;
44
    private Operation defaultOperation = null;
35 45
    
36 46
    public DefaultAggregateLegendManager() {
37 47
        this.defaultLabelStyle = new SimpleLabelStyle();
48
        this.addOperation(new CountOperation());
49
        this.addOperation(new MinOperation());
50
        this.addOperation(new MaxOperation());
51
        this.addOperation(new AvgOperation());
52
        this.addOperation(new SumOperation());
38 53
    }
39 54
    
40 55
    @Override
......
56 71
    public void setDefaultLabelStyle(ILabelStyle defaultLabelStyle) {
57 72
        this.defaultLabelStyle = defaultLabelStyle;
58 73
    }
74

  
75
    @Override
76
    public void addOperation(Operation operation) {
77
        if( this.operations == null ) {
78
            this.operations = new HashMap<>();
79
        }
80
        if( this.operations.isEmpty() ) {
81
            this.defaultOperation = operation;
82
        }
83
        this.operations.put(operation.getName(),operation);
84
    }
59 85
    
86
    @Override
87
    public Collection<Operation> getOperations() {
88
        if( this.operations == null ) {
89
            this.operations = new HashMap<>();
90
        }
91
        return this.operations.values();
92
    }
93
    
94
    @Override
95
    public Operation getDefaultOperation() {
96
        return this.defaultOperation;
97
    }
98
    
60 99
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.impl/src/main/java/org/gvsig/legend/aggregate/lib/impl/DefaultAggregateLegend.java
2 2

  
3 3
import java.awt.Color;
4 4
import java.awt.Dimension;
5
import java.awt.Font;
5 6
import java.awt.FontMetrics;
6 7
import java.awt.Graphics2D;
7 8
import java.awt.Rectangle;
8
import java.awt.Stroke;
9 9
import java.awt.geom.AffineTransform;
10 10
import java.awt.geom.Ellipse2D;
11
import java.awt.geom.Point2D;
12 11
import java.awt.geom.Rectangle2D;
13 12
import java.awt.image.BufferedImage;
14 13
import java.util.ArrayList;
15 14
import java.util.List;
16 15
import java.util.Map;
16
import java.util.logging.Level;
17
import javax.swing.UIManager;
17 18

  
18 19
import org.cresques.cts.ICoordTrans;
19 20
import org.slf4j.Logger;
......
30 31
import org.gvsig.fmap.mapcontext.MapContextException;
31 32
import org.gvsig.fmap.mapcontext.ViewPort;
32 33
import org.gvsig.fmap.mapcontext.rendering.legend.LegendException;
34
import org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent;
33 35
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
34
import org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol;
35 36
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle;
36 37
import org.gvsig.legend.aggregate.lib.api.AggregateLegend;
38
import org.gvsig.legend.aggregate.lib.api.AggregateLegendLocator;
39
import org.gvsig.legend.aggregate.lib.api.Operation;
37 40
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend;
38 41
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.DefaultFeatureDrawnNotification;
39
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.impl.SimpleTextSymbol;
42
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.SimpleFillSymbol;
43
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl.SimpleLineSymbol;
40 44
import org.gvsig.tools.exception.BaseException;
41 45
import org.gvsig.tools.logger.FilteredLogger;
42 46
import org.gvsig.tools.task.Cancellable;
......
47 51

  
48 52
    private static class Group {
49 53

  
50
        private final Point pointGeo;
54
//        private final Point pointGeo;
55
//        private final Rectangle2D rectangle;
56
        private Operation op;
51 57
        private final Point pointPixels;
52
        private int count;
53
        private final Rectangle2D rectangle;
54 58
        private final Ellipse2D circle;
55 59

  
56
        public Group(Point pointGeo, Point pointPixels, double distance) {
57
            this.count = 1;
58
            this.pointGeo = pointGeo;
60
        public Group(Point pointGeo, Point pointPixels, double size, Operation op) {
61
            this.op = op;
62
            this.op.reset();
63
//            this.pointGeo = pointGeo;
59 64
            this.pointPixels = pointPixels;
60
            double d2 = distance * 2;
61
            this.rectangle = new Rectangle2D.Double(pointPixels.getX() - distance, pointPixels.getY() - distance, d2, d2);
62
            this.circle = new Ellipse2D.Double(pointPixels.getX() - distance, pointPixels.getY() - distance, d2, d2);
65
            double d2 = size * 2;
66
//            this.rectangle = new Rectangle2D.Double(pointPixels.getX() - distance, pointPixels.getY() - distance, d2, d2);
67
            this.circle = new Ellipse2D.Double(pointPixels.getX() - size, pointPixels.getY() - size, d2, d2);
63 68
        }
64 69

  
65 70
        public boolean contains(Point pointPixels) {
......
68 73
        }
69 74

  
70 75
        public void add(Feature feature) {
71
            this.count++;
76
            op.perform(feature);
72 77
        }
78
        
79
        public Operation getOperation() {
80
            return this.op;
81
        }
73 82
    }
74 83

  
75 84
    private static final Logger LOG = LoggerFactory.getLogger(DefaultAggregateLegend.class);
76 85

  
77
    private int distance; // Pixels
78 86
    private List<Group> groups;
79
    private ITextSymbol textSymbol;
87

  
88
    private int symbolSize; // Pixels
89
    private Color fillColor;
90
    private Color outlineColor;
91
    private Color textColor;
92
    private boolean showBounds;
93
    private Font font;
94

  
95
    private boolean useStyle;
80 96
    private ILabelStyle labelStyle;
97
    
98
    private Operation operation;
99
    
100
    private SimpleFillSymbol defaultSymbol;
81 101

  
82 102
    public DefaultAggregateLegend() {
83
        this.textSymbol = new SimpleTextSymbol();
84
        this.labelStyle = null;
85 103
        this.groups = null;
86
        this.distance = 30;
104
        
105
        this.useStyle = false;
106
        this.symbolSize = 30;
107
        this.fillColor = new Color(0xd0ffcccc, true); // Un rojo
108
        this.outlineColor = new Color(0xff5f60de, true); // un azul
109
        this.textColor = new Color(0xff000000, true); // negro
110
        this.showBounds = false;
111
        this.labelStyle = null;        
112
        this.font = UIManager.getFont("Label.font");
113
        this.operation = AggregateLegendLocator.getAggregateLegendManager().getDefaultOperation().clone();
114
        this.defaultSymbol = new SimpleFillSymbol();
115
        this.defaultSymbol.setOutline(new SimpleLineSymbol());
116
        this.defaultSymbol.getOutline().setLineColor(this.outlineColor);
117
        this.defaultSymbol.setFillColor(this.fillColor);
118
        
87 119
    }
88 120

  
89 121
    @Override
90 122
    protected String[] getRequiredFeatureAttributeNames(FeatureStore featureStore) throws DataException {
123
        if( this.operation.isAttributeRequiered() && this.operation.getAttributeName()!=null ) {
124
            return new String[]{
125
                this.operation.getAttributeName(),
126
                featureStore.getDefaultFeatureType().getDefaultGeometryAttributeName()
127
            };
128
        }
91 129
        return new String[]{
92
            featureStore.getDefaultFeatureType().getDefaultGeometryAttributeName()};
130
            featureStore.getDefaultFeatureType().getDefaultGeometryAttributeName()
131
        };
93 132
    }
94 133

  
95 134
    @Override
96 135
    public ISymbol getDefaultSymbol() {
97
        return this.textSymbol;
136
        return this.defaultSymbol;
98 137
    }
99 138

  
100 139
    @Override
......
103 142

  
104 143
    @Override
105 144
    public ISymbol getSymbolByFeature(Feature ftr) throws MapContextException {
106
        return this.textSymbol;
145
        return this.getDefaultSymbol();
107 146
    }
108 147

  
109 148
    @Override
......
132 171
    @Override
133 172
    protected void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, Map queryParameters, ICoordTrans coordTrans, FeatureStore featureStore, FeatureQuery featureQuery, double dpi) throws LegendException {
134 173
        super.draw(image, g, viewPort, cancel, scale, queryParameters, coordTrans, featureStore, featureQuery, dpi);
135
        this.drawMarkers(image, g, cancel, viewPort.getAffineTransform());
174
        this.drawGroups(image, g, cancel, viewPort.getAffineTransform());
136 175
    }
137 176

  
138 177
    @Override
......
172 211
                        }
173 212
                    }
174 213
                    if( !inGroup ) {
175
                        groups.add(new Group(pointGeo, pointPixels, getDistance()));
214
                        groups.add(new Group(pointGeo, pointPixels, getSymbolSize(), getOperation().clone()));
176 215
                    }
177 216
                }
178 217
            }
179 218
        });
180 219
    }
181 220

  
182
    private void drawMarkers(BufferedImage image, Graphics2D g1, Cancellable cancel, AffineTransform affineTransform) {
221
    private void drawGroups(BufferedImage image, Graphics2D g, Cancellable cancel, AffineTransform affineTransform) {
183 222
        FilteredLogger logger = new FilteredLogger(LOG, "", 10);
184 223
        AffineTransform identity = new AffineTransform();
185
        Stroke stroke = g1.getStroke();
186
        Color circlebg = new Color(0x80e29ea8, true);
224
        
225
        g.setFont(this.font);
226
        FontMetrics fm = g.getFontMetrics();
227
        int fontAscent = fm.getAscent();
228
        int fontAscentAddDescentDiv2 = ((fm.getAscent() + fm.getDescent())) / 2;        
229

  
187 230
        for( Group group : groups ) {
188 231
            if( cancel.isCanceled() ) {
189 232
                return;
190 233
            }
191
            final Graphics2D g = (Graphics2D)g1.create();
192 234
            try {
193 235
                int x = (int) group.pointPixels.getX();
194 236
                int y = (int) group.pointPixels.getY();
195
                this.textSymbol.setDrawWithHalo(false);
196
                String txt = String.valueOf(group.count);
197
                this.textSymbol.setText(txt);
198
                if( this.labelStyle != null ) {
237
                String txt = group.getOperation().format();
238
                if( this.useStyle && this.labelStyle != null ) {
199 239
                    Dimension size = this.labelStyle.getSize();
200
                    this.labelStyle.setTextFields(new String[]{
201
                        txt}
202
                    );
240
                    this.labelStyle.setTextFields(new String[]{txt});
203 241
                    g.setTransform(identity);
204 242
                    g.translate(x-size.getWidth()/2, y-size.getHeight()/2);
205
                    Point2D markerPoint = this.labelStyle.getMarkerPoint();
206 243
                    Rectangle rect = new Rectangle(
207 244
                        0,
208 245
                        0,
......
218 255
                            bound.getWidth()*size.getWidth(),
219 256
                            bound.getHeight()*size.getHeight());
220 257
                        drawCenteredString(txt, expandedBound, g);
221

  
222 258
                    }
223 259
                    g.translate(-(x-size.getWidth()/2), -(y-size.getHeight()/2));
224 260
                } else {
225
                    int r = distance; //2;
226
                    g.setStroke(stroke);
227
                    g.setColor(circlebg);
261
                    int r = symbolSize/2;
262
                    g.setColor(this.fillColor);
228 263
                    g.fillOval( x-r, y-r, 2*r, 2*r);
229
                    g.setColor(Color.BLACK);
264
                    g.setColor(this.outlineColor);
230 265
                    g.drawOval( x-r, y-r, 2*r, 2*r);
231
                    g.drawRect( x-r, y-r, 2*r, 2*r);
232
                    FontMetrics fm = g.getFontMetrics();
266
                    if( this.showBounds ) {
267
                        g.drawRect( x-r, y-r, 2*r, 2*r);
268
                    }
269
                    g.setColor(this.textColor);
233 270
                    int txtX = x - (fm.stringWidth(txt) / 2);
234
                    int txtY = fm.getAscent() + y - ((fm.getAscent() + fm.getDescent())) / 2;
235

  
271
                    int txtY = fontAscent + y - fontAscentAddDescentDiv2; //((fm.getAscent() + fm.getDescent())) / 2;
236 272
                    g.drawString(txt, txtX, txtY);
237 273
                }
238 274
            } catch (Exception ex) {
239 275
                logger.warn("Can't draw group",ex);
240
            } finally {
241
                g.dispose();
242 276
            }
243 277
        }
244 278
    }
......
258 292
      }
259 293

  
260 294
    @Override
261
    public int getDistance() {
262
        return distance;
295
    public ILabelStyle getLabelStyle() {
296
        return this.labelStyle;
263 297
    }
264 298

  
265 299
    @Override
266
    public void setDistance(int distance) {
267
        this.distance = distance;
300
    public void setLabelStyle(ILabelStyle labelStyle) {
301
        this.labelStyle = labelStyle;
268 302
    }
269 303

  
270 304
    @Override
271
    public ILabelStyle getLabelStyle() {
272
        return this.labelStyle;
305
    public int getSymbolSize() {
306
        return this.symbolSize;
273 307
    }
274 308

  
275 309
    @Override
276
    public void setLabelStyle(ILabelStyle labelStyle) {
277
        this.labelStyle = labelStyle;
310
    public void setSymbolSize(int simbolSize) {
311
        boolean changed = (this.symbolSize == simbolSize);
312
        this.symbolSize = simbolSize;
313
        if( changed ) {
314
            this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
315
        }
278 316
    }
279 317

  
280 318
    @Override
281
    public ITextSymbol getTextSymbol() {
282
        return this.textSymbol;
319
    public Operation getOperation() {
320
        return this.operation;
283 321
    }
322
    
323
    @Override
324
    public void setOperation(Operation operation) {
325
        boolean changed = (this.operation.getName().equalsIgnoreCase(operation.getName()));
326
        this.operation = operation;
327
        if( changed ) {
328
            this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
329
        }
330
    }
284 331

  
285 332
    @Override
286
    public void setTextSymbol(ITextSymbol textSymbol) {
287
        this.textSymbol = textSymbol;
333
    public Color getFillColor() {
334
        return fillColor;
288 335
    }
289 336

  
337
    @Override
338
    public void setFillColor(Color fillColor) {
339
        boolean changed = (this.fillColor.equals(fillColor));
340
        this.fillColor = fillColor;
341
        this.defaultSymbol.setFillColor(this.fillColor);
342
        if( changed ) {
343
            this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
344
        }
345
    }
346

  
347
    @Override
348
    public Color getOutlineColor() {
349
        return outlineColor;
350
    }
351

  
352
    @Override
353
    public void setOutlineColor(Color outlineColor) {
354
        boolean changed = (this.outlineColor.equals(outlineColor));
355
        this.outlineColor = outlineColor;
356
        this.defaultSymbol.getOutline().setLineColor(this.outlineColor);
357
        if( changed ) {
358
            this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
359
        }
360
    }
361

  
362
    @Override
363
    public boolean isShowBounds() {
364
        return showBounds;
365
    }
366

  
367
    @Override
368
    public void setShowBounds(boolean showBounds) {
369
        boolean changed = (this.showBounds == showBounds);
370
        this.showBounds = showBounds;
371
        if( changed ) {
372
            this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
373
        }
374
    }
375

  
376
    @Override
377
    public Font getFont() {
378
        return font;
379
    }
380

  
381
    @Override
382
    public void setFont(Font font) {
383
        this.font = font;
384
        this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
385
    }
386

  
387
    @Override
388
    public boolean isUseStyle() {
389
        return useStyle;
390
    }
391

  
392
    @Override
393
    public void setUseStyle(boolean useStyle) {
394
        boolean changed = (this.useStyle == useStyle);
395
        this.useStyle = useStyle;
396
        if( changed ) {
397
            this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
398
        }
399
    }
400

  
401
    @Override
402
    public Color getTextColor() {
403
        return this.textColor;
404
    }
405

  
406
    @Override
407
    public void setTextColor(Color textColor) {
408
        boolean changed = (this.textColor.equals(textColor));
409
        this.textColor = textColor;
410
        if( changed ) {
411
            this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
412
        }
413
    }
290 414
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/AbstractOperation.java
1
package org.gvsig.legend.aggregate.lib.api;
2

  
3
import org.gvsig.tools.ToolsLocator;
4
import org.gvsig.tools.i18n.I18nManager;
5

  
6

  
7
public abstract class AbstractOperation implements Operation {
8
    private final String name;
9
    private final String description;
10
    private String attrName;
11
    private String aditionalValue;
12
    
13
    protected AbstractOperation(String name, String description) {
14
        this.name = name;
15
        this.description = description;
16
        reset();
17
    }
18
    
19
    @Override
20
    public String getName() {
21
        return this.name;
22
    }
23

  
24
    @Override
25
    public String getDescription() {
26
        I18nManager i18n = ToolsLocator.getI18nManager();
27
        return i18n.getTranslation(this.description);
28
    }
29

  
30
    @Override
31
    public boolean isAttributeRequiered() {
32
        return false;
33
    }
34

  
35
    @Override
36
    public boolean isAditionalValueRequiered() {
37
        return false;
38
    }
39

  
40
    @Override
41
    public String getAttributeName() {
42
        return attrName;
43
    }
44

  
45
    @Override
46
    public void setAttributeName(String attributeName) {
47
        this.attrName = attributeName;
48
    }
49

  
50
    @Override
51
    public String getAditionalValue() {
52
        return aditionalValue;
53
    }
54

  
55
    @Override
56
    public void setAditionalValue(String aditionalValue) {
57
        this.aditionalValue = aditionalValue;
58
    }
59

  
60
    @Override
61
    public String format() {
62
        return String.valueOf(getValue());
63
    }
64

  
65
    @Override
66
    public String toString() {
67
        I18nManager i18n = ToolsLocator.getI18nManager();
68
        return i18n.getTranslation(this.getName());
69
    }
70

  
71
    @Override
72
    public Operation clone() {
73
        try {
74
            return (Operation) super.clone();
75
        } catch (CloneNotSupportedException ex) {
76
            return null;
77
        }
78
    }
79
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/AggregateLegend.java
1 1
package org.gvsig.legend.aggregate.lib.api;
2 2

  
3
import java.awt.Color;
4
import java.awt.Font;
3 5
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend;
4
import org.gvsig.fmap.mapcontext.rendering.symbols.ITextSymbol;
6
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
5 7
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle;
6 8

  
7 9
public interface AggregateLegend extends IVectorLegend {
8 10

  
9
    public int getDistance();
10
    public void setDistance(int distance);
11
    public int getSymbolSize();
12
    public void setSymbolSize(int simbolSize);
11 13
    
12 14
    public ILabelStyle getLabelStyle();
13 15
    public void setLabelStyle(ILabelStyle labelStyle);    
14 16

  
15
    public ITextSymbol getTextSymbol();
16
    public void setTextSymbol(ITextSymbol textSymbol);    
17
    Color getFillColor();
18

  
19
    void setFillColor(Color fillColor);
20

  
21
    Color getTextColor();
22

  
23
    void setTextColor(Color textColor);
24

  
25
    Font getFont();
26

  
27
    void setFont(Font font);
28

  
29
    Operation getOperation();
30

  
31
    void setOperation(Operation operation);
32

  
33
    Color getOutlineColor();
34

  
35
    void setOutlineColor(Color outlineColor);
36

  
37
    boolean isShowBounds();
38

  
39
    void setShowBounds(boolean showBounds);
40

  
41
    boolean isUseStyle();
42

  
43
    void setUseStyle(boolean useStyle);
44

  
17 45
}
18 46

  
19 47

  
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/AggregateLegendManager.java
22 22
 */
23 23
package org.gvsig.legend.aggregate.lib.api;
24 24

  
25
import java.util.Collection;
25 26
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle;
26 27

  
27 28

  
......
39 40
    public ILabelStyle getDefaultLabelStyle();
40 41
    
41 42
    public void setDefaultLabelStyle(ILabelStyle defaultLabelStyle);
43

  
44
    public Operation getDefaultOperation();
45

  
46
    void addOperation(Operation operation);
47
    
48
    public Collection<Operation> getOperations();
42 49
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.lib/org.gvsig.legend.aggregate.lib.api/src/main/java/org/gvsig/legend/aggregate/lib/api/Operation.java
1

  
2
package org.gvsig.legend.aggregate.lib.api;
3

  
4
import org.gvsig.fmap.dal.feature.Feature;
5

  
6

  
7
public interface Operation extends org.gvsig.tools.lang.Cloneable {
8
    
9
    public String getName();
10
    
11
    public String getDescription();
12
    
13
    public boolean isAttributeRequiered();
14
    
15
    public boolean isAditionalValueRequiered();
16
    
17
    public void reset();
18
    
19
    public void perform(Feature feature);
20
        
21
    public Object getValue();
22

  
23
    public String format();
24
    
25
    public String getAttributeName();
26
    
27
    public void setAttributeName(String attributeName);
28
    
29
    public String getAditionalValue();
30
    
31
    public void setAditionalValue(String constant);
32

  
33
    @Override
34
    public Operation clone();
35
    
36
    
37
}
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.swing/org.gvsig.legend.aggregate.swing.impl/src/main/java/org/gvsig/legend/aggregate/swing/impl/DefaultAggregateLegendEditor.java
1 1

  
2 2
package org.gvsig.legend.aggregate.swing.impl;
3 3

  
4
import java.awt.Dimension;
4 5
import java.awt.event.ActionEvent;
5 6
import java.awt.event.ActionListener;
7
import java.awt.event.ItemEvent;
8
import java.awt.event.ItemListener;
9
import java.util.Collection;
10
import javax.swing.AbstractButton;
11
import javax.swing.DefaultComboBoxModel;
6 12
import javax.swing.ImageIcon;
13
import javax.swing.JLabel;
7 14
import javax.swing.JPanel;
15
import javax.swing.SwingUtilities;
16
import javax.swing.event.ChangeEvent;
17
import javax.swing.event.ChangeListener;
8 18
import org.gvsig.app.gui.styling.StyleSelector;
19
import org.gvsig.app.project.documents.view.legend.gui.Features;
20
import org.gvsig.fmap.dal.exception.DataException;
21
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
22
import org.gvsig.fmap.dal.feature.FeatureStore;
23
import org.gvsig.fmap.dal.feature.FeatureType;
9 24
import org.gvsig.fmap.geom.Geometry;
10 25
import org.gvsig.fmap.mapcontext.layers.FLayer;
26
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
11 27
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
12 28
import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle;
13 29
import org.gvsig.legend.aggregate.lib.api.AggregateLegend;
14 30
import org.gvsig.legend.aggregate.lib.api.AggregateLegendLocator;
31
import org.gvsig.legend.aggregate.lib.api.Operation;
15 32
import org.gvsig.legend.aggregate.swing.api.AggregateLegendEditor;
16 33
import org.gvsig.tools.ToolsLocator;
17 34
import org.gvsig.tools.i18n.I18nManager;
35
import org.gvsig.tools.swing.api.ColorChooserController;
18 36
import org.gvsig.tools.swing.api.ToolsSwingLocator;
19
import org.gvsig.tools.swing.api.windowmanager.Dialog;
20 37
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
21 38
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2;
39
import org.gvsig.tools.swing.icontheme.IconTheme;
22 40

  
23 41

  
24 42
public class DefaultAggregateLegendEditor extends DefaultAggregateLegendEditorView implements AggregateLegendEditor {
......
29 47
    private AggregateLegend legend;
30 48
    private FLayer layer;
31 49
    private ILabelStyle style;
50
    private final ColorChooserController outlineColor;
51
    private final ColorChooserController fillColor;
52
    private final ColorChooserController textColor;
32 53

  
33 54
    public DefaultAggregateLegendEditor() {
34 55
        this.legendClass = AggregateLegendLocator.getAggregateLegendManager().getLegendClass();
......
38 59
                doSelectLabelStyle();
39 60
            }
40 61
        });
62
        this.outlineColor = ToolsSwingLocator.getToolsSwingManager().createColorChooserController(
63
            txtOutlineColor, btnOutlineColor, sldOutlineColorAlpha
64
        );
65
        this.fillColor = ToolsSwingLocator.getToolsSwingManager().createColorChooserController(
66
            txtFillColor, btnFillColor, sldFillColorAlpha
67
        );
68
        this.textColor = ToolsSwingLocator.getToolsSwingManager().createColorChooserController(
69
            txtTextColor, btnTextColor, sldTextColorAlpha
70
        );
71
        Collection<Operation> operations = AggregateLegendLocator.getAggregateLegendManager().getOperations();
72
        DefaultComboBoxModel<Operation> operationsModel = new DefaultComboBoxModel<>();
73
        for( Operation operation : operations ) {
74
            operationsModel.addElement(operation);
75
        }        
76
        this.cboOperation.setModel(operationsModel);
77
        this.rdbBasic.addChangeListener(new ChangeListener() {
78
            @Override
79
            public void stateChanged(ChangeEvent e) {
80
                doChangeMode();
81
            }
82
        });
83
        this.rdbStyled.addChangeListener(new ChangeListener() {
84
            @Override
85
            public void stateChanged(ChangeEvent e) {
86
                doChangeMode();
87
            }
88
        });
89
        this.btnTextFont.addActionListener(new ActionListener() {
90
            @Override
91
            public void actionPerformed(ActionEvent e) {
92
                showFontChooser();
93
            }
94
        });
95
        this.cboOperation.addItemListener(new ItemListener() {
96
            @Override
97
            public void itemStateChanged(ItemEvent e) {
98
                // Para evitar cuelgues en depuracion
99
                SwingUtilities.invokeLater(new Runnable() {
100
                    @Override
101
                    public void run() {
102
                        doOperationChanged();
103
                    }
104
                });
105
            }
106
        });
107
        this.translateAll();
41 108
    }
109
    
110
    private void translate(AbstractButton component) {
111
        I18nManager i18n = ToolsLocator.getI18nManager();
112
        component.setText(i18n.getTranslation(component.getText()));
113
    }
114
    
115
    private void translate(JLabel component) {
116
        I18nManager i18n = ToolsLocator.getI18nManager();
117
        component.setText(i18n.getTranslation(component.getText()));
118
    }
119
    
120
    private void translateAll() {
121
        this.translate(this.rdbBasic);
122
        this.translate(this.lblSymbolSize);        
123
        this.translate(this.lblFillColor);
124
        this.translate(this.lblFillColorAlpha);
125
        this.translate(this.lblOutlineColor);
126
        this.translate(this.lblOutlineColorAlpha);
127
        this.translate(this.lblTextColor);
128
        this.translate(this.lblTextColorAlpha);
129
        this.translate(this.lblTextFont);
130
        this.translate(this.lblShowBounds);
131
        this.translate(this.rdbStyled);
132
        this.translate(this.lblStyle);
133
        this.translate(this.lblOperation);
134
        this.translate(this.lblOperationAttribute);
135
        this.translate(this.lblOperationValue);
136
    }
42 137

  
43 138
    @Override
44 139
    public void setData(FLayer layer, ILegend legend) {
......
48 143
        } else {
49 144
            this.legend = AggregateLegendLocator.getAggregateLegendManager().createAggregateLegend();
50 145
        }
51
        this.txtDistance.setText(String.valueOf(this.legend.getDistance()));
146
        this.spnSymbolSize.setValue(this.legend.getSymbolSize());
147
        this.outlineColor.set(this.legend.getOutlineColor());
148
        this.fillColor.set(this.legend.getFillColor());
149
        this.textColor.set(this.legend.getTextColor());
150
        this.chkShowBounds.setSelected(this.legend.isShowBounds());
151
        this.txtTextFont.setText(this.legend.getFont().getFontName());
52 152
        if( this.legend.getLabelStyle()!=null ) {
53 153
            this.txtStyle.setText(this.legend.getLabelStyle().getDescription());
54 154
        }
155
        Operation operation = this.legend.getOperation();
156
        this.txtOutlineColor.setText(operation.getAditionalValue()==null? "":operation.getAditionalValue());
157
        if( this.layer instanceof FLyrVect ) {
158
            FeatureStore store = ((FLyrVect)this.layer).getFeatureStore();
159
            try {
160
                FeatureType type = store.getDefaultFeatureType();
161
                DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
162
                for( FeatureAttributeDescriptor attr : type ) {
163
                    model.addElement(attr.getName());
164
                }
165
                this.cboOperationAttribute.setModel(model);
166
            } catch (DataException ex) {
167
                this.cboOperationAttribute.removeAllItems();
168
            }
169
            this.cboOperationAttribute.setSelectedIndex(0);
170
            this.cboOperationAttribute.setSelectedItem(operation.getAttributeName());
171
        }
172
        for( int i=0; i<this.cboOperation.getItemCount(); i++ ) {
173
            Operation x = (Operation) this.cboOperation.getItemAt(i);
174
            if( x.getName().equalsIgnoreCase(this.legend.getOperation().getName()) ) {
175
                this.cboOperation.setSelectedIndex(i);
176
                doOperationChanged();
177
                break;
178
            }
179
        }
180
        this.rdbBasic.setSelected(!this.legend.isUseStyle());
181
        this.rdbStyled.setSelected(this.legend.isUseStyle());
55 182
    }
56 183

  
57 184
    @Override
58 185
    public ILegend getLegend() {
59 186

  
60
        int d;
61
        try {
62
            d = Integer.parseInt(this.txtDistance.getText());
63
        } catch(Throwable th) {
64
            d = 30;
187
        legend.setUseStyle(this.rdbStyled.isSelected());
188
        legend.setSymbolSize((int) this.spnSymbolSize.getValue());
189
        legend.setOutlineColor(this.outlineColor.get());
190
        legend.setFillColor(this.fillColor.get());
191
        legend.setTextColor(this.textColor.get());
192
        legend.setShowBounds(this.chkShowBounds.isSelected());
193
        legend.setLabelStyle(this.style);
194
        Operation operation = (Operation) this.cboOperation.getSelectedItem();
195
        if( operation!=null ) {
196
            operation = operation.clone();
197
            if( operation.isAditionalValueRequiered() ) {
198
                operation.setAditionalValue(this.txtOperationValue.getText());
199
            }
200
            if( operation.isAttributeRequiered() ) {
201
                operation.setAttributeName((String) this.cboOperationAttribute.getSelectedItem());
202
            }
203
            this.legend.setOperation(operation);
65 204
        }
66
        if( d<10 ) {
67
            d = 10;
68
        }
69
        legend.setDistance(d);
70
        legend.setLabelStyle(this.style);
71 205
        return legend;
72 206
    }
73 207

  
208
    private void doChangeMode() {
209
        if( this.rdbBasic.isSelected() ) {
210
            this.spnSymbolSize.setEnabled(true);
211
            this.fillColor.setEnabled(true);
212
            this.outlineColor.setEnabled(true);
213
            this.textColor.setEnabled(true);
214
            this.txtTextFont.setEnabled(true);
215
            this.chkShowBounds.setEnabled(true);
216
            
217
            this.btnStyle.setEnabled(false);
218
        } else {
219
            this.spnSymbolSize.setEnabled(false);
220
            this.fillColor.setEnabled(false);
221
            this.outlineColor.setEnabled(false);
222
            this.textColor.setEnabled(false);
223
            this.txtTextFont.setEnabled(false);
224
            this.chkShowBounds.setEnabled(false);
225
            
226
            this.btnStyle.setEnabled(true);
227
        }
228
    }
229
    
230
    private void doOperationChanged() {
231
        Operation operation = (Operation) this.cboOperation.getSelectedItem();
232
        if( operation==null ) {
233
            this.cboOperationAttribute.setEnabled(false);
234
            this.txtOperationValue.setEnabled(false);
235
            this.lblOperationDescription.setText("");
236
            return;
237
        }
238
        this.txtOperationValue.setEnabled(operation.isAditionalValueRequiered());
239
        this.cboOperationAttribute.setEnabled(operation.isAttributeRequiered());
240
        if( operation.isAttributeRequiered() && this.cboOperationAttribute.getSelectedIndex()<0 ) {
241
            this.cboOperationAttribute.setSelectedIndex(0);
242
        }
243
        //this.lblOperationDescription.setText(operation.getDescription());
244
        this.cboOperation.setToolTipText(operation.getDescription());
245
    }
246
    
247
    private void showFontChooser() {
248
        
249
    }
250
    
74 251
    @Override
75 252
    public String getDescription() {
76 253
        I18nManager i18n = ToolsLocator.getI18nManager();
77
        return i18n.getTranslation( "_Aggregate_legend");
254
        return i18n.getTranslation( "_Aggregate_legend_description");
78 255
    }
79 256

  
80 257
    @Override
81 258
    public ImageIcon getIcon() {
82
        // TODO:
83
        return null;
259
        IconTheme theme = ToolsSwingLocator.getIconThemeManager().getCurrent();
260
        return theme.get("legend-overview-vectorial-aggregated");
84 261
    }
85 262

  
86 263
    @Override
87
    public Class getParentClass() {
88
        return null;
89
    }
264
	public Class getParentClass() {
265
		return Features.class;
266
	}
90 267

  
91 268
    @Override
92 269
    public String getTitle() {
......
110 287
    }
111 288

  
112 289
    private void doSelectLabelStyle() {
290
        I18nManager i18n = ToolsLocator.getI18nManager();
113 291
        WindowManager_v2 winmanager = (WindowManager_v2) ToolsSwingLocator.getWindowManager();
114 292
        final StyleSelector styleSelector = new StyleSelector(this.style, Geometry.TYPES.POINT);
293
        styleSelector.setPreferredSize(new Dimension(600, 350));
115 294
        winmanager.showWindow(
116 295
            styleSelector,
117
            "Select style",
296
            i18n.getTranslation("_Select_style"),
118 297
            WindowManager.MODE.DIALOG
119 298
        );
120 299
        ILabelStyle x = (ILabelStyle) styleSelector.getSelectedObject();
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.swing/org.gvsig.legend.aggregate.swing.impl/src/main/java/org/gvsig/legend/aggregate/swing/impl/DefaultAggregateLegendEditorView.xml
25 25
    <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
26 26
   </super>
27 27
   <at name="id">/home/jjdelcerro/datos/devel/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.swing/org.gvsig.legend.aggregate.swing.impl/src/main/java/org/gvsig/legend/aggregate/swing/impl/DefaultAggregateLegendEditorView.xml</at>
28
   <at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE</at>
29
   <at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE</at>
28
   <at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at>
29
   <at name="colspecs">FILL:4DLU:NONE,FILL:8DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE</at>
30 30
   <at name="components">
31 31
    <object classname="java.util.LinkedList">
32 32
     <item >
......
37 37
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
38 38
           <at name="column">2</at>
39 39
           <at name="row">2</at>
40
           <at name="colspan">1</at>
40
           <at name="colspan">3</at>
41 41
           <at name="rowspan">1</at>
42 42
           <at name="halign">default</at>
43 43
           <at name="valign">default</at>
......
47 47
         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
48 48
        </super>
49 49
        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
50
        <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
50
        <at name="beanclass">javax.swing.JRadioButton</at>
51 51
        <at name="beanproperties">
52 52
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
53
          <at name="classname">com.jeta.forms.components.label.JETALabel</at>
53
          <at name="classname">javax.swing.JRadioButton</at>
54 54
          <at name="properties">
55 55
           <object classname="com.jeta.forms.store.support.PropertyMap">
56 56
            <at name="border">
......
73 73
              </at>
74 74
             </object>
75 75
            </at>
76
            <at name="name">lblDistance</at>
77
            <at name="width">49</at>
78
            <at name="text">Distance</at>
79
            <at name="fill">
80
             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
81
              <at name="name">fill</at>
76
            <at name="actionCommand">Basic</at>
77
            <at name="buttonGroup">
78
             <object classname="com.jeta.forms.store.properties.ButtonGroupProperty">
79
              <at name="name">buttonGroup</at>
80
              <at name="groupname">1</at>
82 81
             </object>
83 82
            </at>
84
            <at name="height">14</at>
83
            <at name="name">rdbBasic</at>
84
            <at name="width">516</at>
85
            <at name="text">_Use_basic_cluster_mark</at>
86
            <at name="height">16</at>
85 87
           </object>
86 88
          </at>
87 89
         </object>
......
95 97
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
96 98
         <at name="cellconstraints">
97 99
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
98
           <at name="column">4</at>
99
           <at name="row">2</at>
100
           <at name="column">2</at>
101
           <at name="row">6</at>
100 102
           <at name="colspan">3</at>
101 103
           <at name="rowspan">1</at>
102 104
           <at name="halign">default</at>
......
107 109
         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
108 110
        </super>
109 111
        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
110
        <at name="beanclass">javax.swing.JTextField</at>
112
        <at name="beanclass">javax.swing.JRadioButton</at>
111 113
        <at name="beanproperties">
112 114
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
113
          <at name="classname">javax.swing.JTextField</at>
115
          <at name="classname">javax.swing.JRadioButton</at>
114 116
          <at name="properties">
115 117
           <object classname="com.jeta.forms.store.support.PropertyMap">
116 118
            <at name="border">
......
133 135
              </at>
134 136
             </object>
135 137
            </at>
136
            <at name="name">txtDistance</at>
137
            <at name="width">446</at>
138
            <at name="height">20</at>
138
            <at name="actionCommand">Styled</at>
139
            <at name="buttonGroup">
140
             <object classname="com.jeta.forms.store.properties.ButtonGroupProperty">
141
              <at name="name">buttonGroup</at>
142
              <at name="groupname">1</at>
143
             </object>
144
            </at>
145
            <at name="name">rdbStyled</at>
146
            <at name="width">516</at>
147
            <at name="text">_Use_styled_cluster_mark</at>
148
            <at name="height">16</at>
139 149
           </object>
140 150
          </at>
141 151
         </object>
......
145 155
     </item>
146 156
     <item >
147 157
      <at name="value">
148
       <object classname="com.jeta.forms.store.memento.BeanMemento">
158
       <object classname="com.jeta.forms.store.memento.FormMemento">
149 159
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
150 160
         <at name="cellconstraints">
151 161
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
152
           <at name="column">2</at>
162
           <at name="column">3</at>
153 163
           <at name="row">4</at>
154
           <at name="colspan">1</at>
164
           <at name="colspan">2</at>
155 165
           <at name="rowspan">1</at>
156 166
           <at name="halign">default</at>
157 167
           <at name="valign">default</at>
158 168
           <at name="insets" object="insets">0,0,0,0</at>
159 169
          </object>
160 170
         </at>
161
         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
171
         <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
162 172
        </super>
163
        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
164
        <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
165
        <at name="beanproperties">
173
        <at name="id">embedded.329209227</at>
174
        <at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE</at>
175
        <at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)</at>
176
        <at name="components">
177
         <object classname="java.util.LinkedList">
178
          <item >
179
           <at name="value">
180
            <object classname="com.jeta.forms.store.memento.BeanMemento">
181
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
182
              <at name="cellconstraints">
183
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
184
                <at name="column">1</at>
185
                <at name="row">3</at>
186
                <at name="colspan">1</at>
187
                <at name="rowspan">1</at>
188
                <at name="halign">default</at>
189
                <at name="valign">default</at>
190
                <at name="insets" object="insets">0,0,0,0</at>
191
               </object>
192
              </at>
193
              <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
194
             </super>
195
             <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
196
             <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
197
             <at name="beanproperties">
198
              <object classname="com.jeta.forms.store.memento.PropertiesMemento">
199
               <at name="classname">com.jeta.forms.components.label.JETALabel</at>
200
               <at name="properties">
201
                <object classname="com.jeta.forms.store.support.PropertyMap">
202
                 <at name="border">
203
                  <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
204
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
205
                    <at name="name">border</at>
206
                   </super>
207
                   <at name="borders">
208
                    <object classname="java.util.LinkedList">
209
                     <item >
210
                      <at name="value">
211
                       <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
212
                        <super classname="com.jeta.forms.store.properties.BorderProperty">
213
                         <at name="name">border</at>
214
                        </super>
215
                       </object>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff