Revision 44534
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.labeling.app/org.gvsig.labeling.app.mainplugin/src/main/java/org/gvsig/labeling/ExtendedLabelingExtension.java | ||
---|---|---|
18 | 18 |
import org.gvsig.labeling.gui.styling.editortools.PointLabelLowPrecedenceTool; |
19 | 19 |
import org.gvsig.labeling.gui.styling.editortools.PointLabelNormalPrecedenceTool; |
20 | 20 |
import org.gvsig.labeling.label.FeatureDependentLabeled; |
21 |
import org.gvsig.labeling.label.GeneralLabelingFactory; |
|
21 | 22 |
import org.gvsig.labeling.label.GeneralLabelingStrategy; |
22 | 23 |
import org.gvsig.labeling.label.OnSelectionLabeled; |
23 | 24 |
import org.gvsig.labeling.label.SmartTextSymbolLabelClass; |
... | ... | |
38 | 39 |
import org.gvsig.labeling.placements.PolygonPlacementParallel; |
39 | 40 |
import org.gvsig.labeling.symbol.CharacterMarkerSymbol; |
40 | 41 |
import org.gvsig.labeling.symbol.SmartTextSymbol; |
42 |
import org.gvsig.symbology.SymbologyLocator; |
|
41 | 43 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.LabelingFactory; |
42 | 44 |
import org.gvsig.symbology.swing.SymbologySwingLocator; |
43 | 45 |
import org.gvsig.symbology.swing.SymbologySwingManager; |
... | ... | |
85 | 87 |
// LabelingFactory.setDefaultLabelingStrategy(GeneralLabelingStrategy.class); |
86 | 88 |
SymbologySwingManager manager = SymbologySwingLocator.getSwingManager(); |
87 | 89 |
manager.registerLabelClassEditor(new LabelClassPropertiesFactory()); |
90 |
|
|
91 |
SymbologyLocator.getSymbologyManager().registerLabelingStrategy(new GeneralLabelingFactory()); |
|
88 | 92 |
} |
89 | 93 |
|
90 | 94 |
private void registerIcons() { |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.labeling.app/org.gvsig.labeling.app.mainplugin/src/main/java/org/gvsig/labeling/label/IGeneralLabelingStrategy.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.labeling.label; |
|
7 |
|
|
8 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingStrategy; |
|
9 |
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport; |
|
10 |
|
|
11 |
/** |
|
12 |
* |
|
13 |
* @author osc |
|
14 |
*/ |
|
15 |
public interface IGeneralLabelingStrategy extends ILabelingStrategy, Cloneable, |
|
16 |
CartographicSupport { |
|
17 |
|
|
18 |
String NAME = "GeneralLabelingStrategy"; |
|
19 |
|
|
20 |
public boolean isAllowingOverlap(); |
|
21 |
|
|
22 |
public void setAllowOverlapping(boolean allowOverlapping); |
|
23 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.labeling.app/org.gvsig.labeling.app.mainplugin/src/main/java/org/gvsig/labeling/label/GeneralLabelingStrategy.java | ||
---|---|---|
61 | 61 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
62 | 62 |
import org.gvsig.tools.task.Cancellable; |
63 | 63 |
|
64 |
public class GeneralLabelingStrategy implements ILabelingStrategy, Cloneable, |
|
65 |
CartographicSupport { |
|
64 |
public class GeneralLabelingStrategy implements IGeneralLabelingStrategy { |
|
66 | 65 |
|
67 | 66 |
private static final Logger logger = LoggerFactory |
68 | 67 |
.getLogger(GeneralLabelingStrategy.class); |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.labeling.app/org.gvsig.labeling.app.mainplugin/src/main/java/org/gvsig/labeling/label/GeneralLabelingFactory.java | ||
---|---|---|
44 | 44 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingMethod; |
45 | 45 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.IPlacementConstraints; |
46 | 46 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.IZoomConstraints; |
47 |
import org.gvsig.tools.util.Factory; |
|
47 | 48 |
|
48 | 49 |
/** |
49 | 50 |
* |
... | ... | |
53 | 54 |
* @author jaume dominguez faus - jaume.dominguez@iver.es Mar 6, 2008 |
54 | 55 |
* |
55 | 56 |
*/ |
56 |
public class GeneralLabelingFactory { |
|
57 |
public class GeneralLabelingFactory implements Factory {
|
|
57 | 58 |
|
58 |
public static GeneralLabelingStrategy createStrategy(
|
|
59 |
FLayer layer,
|
|
60 |
ILabelingMethod method,
|
|
61 |
IPlacementConstraints placement_c,
|
|
62 |
IZoomConstraints zoom_c) {
|
|
59 |
public static GeneralLabelingStrategy createStrategy(
|
|
60 |
FLayer layer,
|
|
61 |
ILabelingMethod method,
|
|
62 |
IPlacementConstraints placement_c,
|
|
63 |
IZoomConstraints zoom_c) {
|
|
63 | 64 |
|
64 |
GeneralLabelingStrategy resp = new GeneralLabelingStrategy(); |
|
65 |
resp.setLayer(layer); |
|
66 |
if (method != null) { |
|
67 |
resp.setLabelingMethod(method); |
|
68 |
} |
|
69 |
if (placement_c != null) { |
|
70 |
resp.setPlacementConstraints(placement_c); |
|
71 |
} |
|
72 |
if (zoom_c != null) { |
|
73 |
resp.setZoomConstraints(zoom_c); |
|
74 |
} |
|
75 |
return resp; |
|
76 |
} |
|
65 |
GeneralLabelingStrategy resp = new GeneralLabelingStrategy(); |
|
66 |
resp.setLayer(layer); |
|
67 |
if (method != null) { |
|
68 |
resp.setLabelingMethod(method); |
|
69 |
} |
|
70 |
if (placement_c != null) { |
|
71 |
resp.setPlacementConstraints(placement_c); |
|
72 |
} |
|
73 |
if (zoom_c != null) { |
|
74 |
resp.setZoomConstraints(zoom_c); |
|
75 |
} |
|
76 |
return resp; |
|
77 |
} |
|
78 |
|
|
79 |
@Override |
|
80 |
public String getName() { |
|
81 |
return IGeneralLabelingStrategy.NAME; |
|
82 |
} |
|
83 |
|
|
84 |
@Override |
|
85 |
public Object create(Object... parameters) { |
|
86 |
GeneralLabelingStrategy resp = new GeneralLabelingStrategy(); |
|
87 |
|
|
88 |
return resp; |
|
89 |
} |
|
77 | 90 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/SymbologyManager.java | ||
---|---|---|
52 | 52 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.ISimpleLineStyle; |
53 | 53 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol; |
54 | 54 |
import org.gvsig.fmap.mapcontext.rendering.legend.driver.ILegendWriter; |
55 |
import org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend.DynamicSymbol; |
|
56 |
import org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend.DynamicVectorLegend; |
|
55 |
import org.gvsig.tools.util.Factory; |
|
57 | 56 |
|
58 | 57 |
/** |
59 | 58 |
* Basic symbology manager. |
... | ... | |
70 | 69 |
* @return a new interval |
71 | 70 |
*/ |
72 | 71 |
|
73 |
DynamicVectorLegend createDynamicVectorLegend(); |
|
74 |
|
|
75 |
DynamicSymbol createDynamicSymbol(); |
|
76 |
|
|
77 | 72 |
IInterval createInterval(double min, double max); |
78 | 73 |
|
79 | 74 |
IArrowDecoratorStyle createArrowDecoratorStyle(); |
... | ... | |
141 | 136 |
* @return |
142 | 137 |
*/ |
143 | 138 |
ILegendWriter getDefaultLegendWriter(); |
139 |
|
|
140 |
public void registerLabelingStrategy(Factory factory); |
|
141 |
|
|
142 |
public ILabelingStrategy createLabelingStrategy(String nameFactory, Object... parameters); |
|
143 |
|
|
144 | 144 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/IAttrInTableLabelingStrategy.java | ||
---|---|---|
29 | 29 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingStrategy; |
30 | 30 |
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport; |
31 | 31 |
|
32 |
public interface IAttrInTableLabelingStrategy extends ILabelingStrategy, CartographicSupport{ |
|
32 |
public interface IAttrInTableLabelingStrategy extends ILabelingStrategy, CartographicSupport {
|
|
33 | 33 |
|
34 |
public abstract String getRotationField();
|
|
34 |
String NAME = "AttrInTableLabelingStrategy";
|
|
35 | 35 |
|
36 |
public abstract String getTextField();
|
|
36 |
public abstract String getRotationField();
|
|
37 | 37 |
|
38 |
public abstract String getHeightField();
|
|
38 |
public abstract String getTextField();
|
|
39 | 39 |
|
40 |
public abstract String getColorField();
|
|
40 |
public abstract String getHeightField();
|
|
41 | 41 |
|
42 |
public abstract void setTextField(String textFieldName);
|
|
42 |
public abstract String getColorField();
|
|
43 | 43 |
|
44 |
public abstract void setRotationField(String rotationFieldName);
|
|
44 |
public abstract void setTextField(String textFieldName);
|
|
45 | 45 |
|
46 |
/** |
|
47 |
* Sets the field that contains the size of the text. The size is computed |
|
48 |
* in meters. To use any other unit, call setUnit(int) with the scale factor from meters |
|
49 |
* (for centimeters, call <b>setUnitFactor(0.01))</b>. |
|
50 |
* @param heightFieldName |
|
51 |
*/ |
|
52 |
public abstract void setHeightField(String heightFieldName); |
|
46 |
public abstract void setRotationField(String rotationFieldName); |
|
53 | 47 |
|
54 |
public abstract void setColorField(String colorFieldName); |
|
48 |
/** |
|
49 |
* Sets the field that contains the size of the text. The size is computed |
|
50 |
* in meters. To use any other unit, call setUnit(int) with the scale factor |
|
51 |
* from meters (for centimeters, call <b>setUnitFactor(0.01))</b>. |
|
52 |
* |
|
53 |
* @param heightFieldName |
|
54 |
*/ |
|
55 |
public abstract void setHeightField(String heightFieldName); |
|
55 | 56 |
|
56 |
public abstract void setUsesFixedSize(boolean b);
|
|
57 |
public abstract void setColorField(String colorFieldName);
|
|
57 | 58 |
|
58 |
public abstract boolean usesFixedSize();
|
|
59 |
public abstract void setUsesFixedSize(boolean b);
|
|
59 | 60 |
|
60 |
public abstract double getFixedSize();
|
|
61 |
public abstract boolean usesFixedSize();
|
|
61 | 62 |
|
62 |
public abstract void setFixedSize(double fixedSize);
|
|
63 |
public abstract double getFixedSize();
|
|
63 | 64 |
|
64 |
public abstract void setUsesFixedColor(boolean b);
|
|
65 |
public abstract void setFixedSize(double fixedSize);
|
|
65 | 66 |
|
66 |
public abstract boolean usesFixedColor();
|
|
67 |
public abstract void setUsesFixedColor(boolean b);
|
|
67 | 68 |
|
68 |
public abstract Color getFixedColor();
|
|
69 |
public abstract boolean usesFixedColor();
|
|
69 | 70 |
|
70 |
public abstract void setFixedColor(Color fixedColor);
|
|
71 |
public abstract Color getFixedColor();
|
|
71 | 72 |
|
72 |
public abstract Color getColorFont();
|
|
73 |
public abstract void setFixedColor(Color fixedColor);
|
|
73 | 74 |
|
74 |
public abstract void setColorFont(Color colorFont);
|
|
75 |
public abstract Color getColorFont();
|
|
75 | 76 |
|
76 |
public abstract Font getFont();
|
|
77 |
public abstract void setColorFont(Color colorFont);
|
|
77 | 78 |
|
78 |
public abstract void setFont(Font selFont);
|
|
79 |
public abstract Font getFont();
|
|
79 | 80 |
|
80 |
} |
|
81 |
public abstract void setFont(Font selFont); |
|
82 |
|
|
83 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DynamicLabelingStrategy.java | ||
---|---|---|
11 | 11 |
import org.gvsig.fmap.dal.feature.Feature; |
12 | 12 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingStrategy; |
13 | 13 |
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport; |
14 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
14 | 15 |
|
15 | 16 |
/** |
16 | 17 |
* |
17 | 18 |
* @author osc |
18 | 19 |
*/ |
19 |
public abstract class DynamicLabelingStrategy implements ILabelingStrategy, CartographicSupport {
|
|
20 |
public interface DynamicLabelingStrategy extends ILabelingStrategy, CartographicSupport {
|
|
20 | 21 |
|
21 |
public abstract void setFeature(Feature f);
|
|
22 |
String NAME = "DynamicLabelingStrategy";
|
|
22 | 23 |
|
23 |
public abstract Expression getRotation();
|
|
24 |
public void setFeature(Feature f);
|
|
24 | 25 |
|
25 |
public abstract int getComputedRotation();
|
|
26 |
public Expression getRotation();
|
|
26 | 27 |
|
27 |
public abstract Expression getUnitExp();
|
|
28 |
public int getComputedRotation();
|
|
28 | 29 |
|
29 |
public abstract int getComputedUnit();
|
|
30 |
public Expression getUnitExp();
|
|
30 | 31 |
|
31 |
public abstract Expression getText();
|
|
32 |
public int getComputedUnit();
|
|
32 | 33 |
|
33 |
public abstract String getComputedText();
|
|
34 |
public Expression getText();
|
|
34 | 35 |
|
35 |
public abstract Expression getHeight();
|
|
36 |
public String getComputedText();
|
|
36 | 37 |
|
37 |
public abstract int getComputedHeight();
|
|
38 |
public Expression getHeight();
|
|
38 | 39 |
|
39 |
public abstract Expression getColor();
|
|
40 |
public int getComputedHeight();
|
|
40 | 41 |
|
41 |
public abstract Color getComputedColor();
|
|
42 |
public Expression getColor();
|
|
42 | 43 |
|
43 |
public abstract Expression getFixedSize();
|
|
44 |
public Color getComputedColor();
|
|
44 | 45 |
|
45 |
public abstract double getComputedFixedSize();
|
|
46 |
public Expression getFixedSize();
|
|
46 | 47 |
|
47 |
public abstract Expression getFontStyle();
|
|
48 |
public double getComputedFixedSize();
|
|
48 | 49 |
|
49 |
public abstract int getComputedFontStyle(); |
|
50 |
public Expression getFontStyle(); |
|
51 |
|
|
52 |
public int getComputedFontStyle(); |
|
50 | 53 |
|
51 |
public abstract void setFontStyle(int style);
|
|
54 |
public void setFontStyle(int style); |
|
52 | 55 |
|
53 |
public abstract void setFontStyle(Expression expression);
|
|
56 |
public void setFontStyle(Expression expression); |
|
54 | 57 |
|
55 |
public abstract void setText(Expression expression);
|
|
58 |
public void setText(Expression expression); |
|
56 | 59 |
|
57 |
public abstract void setRotation(Expression expression);
|
|
60 |
public void setRotation(Expression expression); |
|
58 | 61 |
|
59 |
public abstract void setHeight(Expression expression);
|
|
62 |
public void setHeight(Expression expression); |
|
60 | 63 |
|
61 |
public abstract void setColor(Expression expression);
|
|
64 |
public void setColor(Expression expression); |
|
62 | 65 |
|
63 |
public abstract void setUsesFixedSize(boolean b);
|
|
66 |
public void setUsesFixedSize(boolean b); |
|
64 | 67 |
|
65 |
public abstract boolean usesFixedSize();
|
|
68 |
public boolean usesFixedSize(); |
|
66 | 69 |
|
67 |
public abstract void setFixedSize(double fixedSize);
|
|
70 |
public void setFixedSize(double fixedSize); |
|
68 | 71 |
|
69 |
public abstract void setUsesFixedColor(boolean b);
|
|
72 |
public void setUsesFixedColor(boolean b); |
|
70 | 73 |
|
71 |
public abstract boolean usesFixedColor();
|
|
74 |
public boolean usesFixedColor(); |
|
72 | 75 |
|
73 |
public abstract Expression getFixedColor();
|
|
76 |
public Expression getFixedColor(); |
|
74 | 77 |
|
75 |
public abstract Color getComputedFixedColor();
|
|
78 |
public Color getComputedFixedColor(); |
|
76 | 79 |
|
77 |
public abstract void setFixedColor(Color fixedColor);
|
|
80 |
public void setFixedColor(Color fixedColor); |
|
78 | 81 |
|
79 |
public abstract Expression getColorFont();
|
|
82 |
public Expression getColorFont(); |
|
80 | 83 |
|
81 |
public abstract Color getComputedColorFont();
|
|
84 |
public Color getComputedColorFont(); |
|
82 | 85 |
|
83 |
public abstract void setColorFont(Color colorFont);
|
|
86 |
public void setColorFont(Color colorFont); |
|
84 | 87 |
|
85 |
public abstract Expression getFont();
|
|
88 |
public Expression getFont(); |
|
86 | 89 |
|
87 |
public abstract Font getComputedFont();
|
|
90 |
public Font getComputedFont(); |
|
88 | 91 |
|
89 |
public abstract void setFont(Font selFont);
|
|
92 |
public void setFont(Font selFont); |
|
90 | 93 |
|
91 |
public abstract void setFont(Expression expression);
|
|
94 |
public void setFont(Expression expression); |
|
92 | 95 |
|
93 |
public abstract void setReferenceSystem(Expression expression);
|
|
96 |
public void setReferenceSystem(Expression expression); |
|
94 | 97 |
|
95 |
public abstract void setUnit(Expression expression);
|
|
98 |
public void setUnit(Expression expression); |
|
96 | 99 |
|
97 | 100 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DynamicVectorLegend.java | ||
---|---|---|
12 | 12 |
* @author osc |
13 | 13 |
*/ |
14 | 14 |
public interface DynamicVectorLegend extends IVectorLegend { |
15 |
String NAME = "DynamicVectorLegend"; |
|
15 | 16 |
|
16 | 17 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DynamicSymbol.java | ||
---|---|---|
17 | 17 |
* @author osc |
18 | 18 |
*/ |
19 | 19 |
public interface DynamicSymbol extends ISymbol { |
20 |
|
|
21 |
String NAME = "DynamicSymbol"; |
|
20 | 22 |
|
21 | 23 |
public List<String> getRequiredFeatureAttributeNames(FeatureStore featureStore) throws DataException; |
22 | 24 |
// public Expression getColor(); |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/impl/SymbologyDefaultImplLibrary.java | ||
---|---|---|
35 | 35 |
import org.gvsig.symbology.SymbologyLibrary; |
36 | 36 |
import org.gvsig.symbology.SymbologyLocator; |
37 | 37 |
import org.gvsig.symbology.SymbologyManager; |
38 |
import org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend.DefaultDynamicLabelingStrategy; |
|
39 |
import org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend.DefaultDynamicSymbol; |
|
40 |
import org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend.DefaultDynamicVectorLegend; |
|
41 |
import org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend.DynamicLabelingStrategyFactory; |
|
42 |
import org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend.DynamicSymbol; |
|
38 | 43 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.driver.impl.PersistenceBasedLegendReader; |
39 | 44 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.driver.impl.PersistenceBasedLegendWriter; |
40 | 45 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractClassifiedVectorLegend; |
... | ... | |
46 | 51 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.VectorialIntervalLegend; |
47 | 52 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.VectorialUniqueValueLegend; |
48 | 53 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy; |
54 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategyFactory; |
|
49 | 55 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.DefaultLabelingMethod; |
50 | 56 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.LabelClass; |
51 | 57 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.LabelClassFactory; |
... | ... | |
197 | 203 |
* Default impl of simple label style |
198 | 204 |
*/ |
199 | 205 |
caller.add(new SimpleLabelStyle.RegisterPersistence()); |
206 |
|
|
207 |
/* |
|
208 |
* Add impl of labeling strategy |
|
209 |
*/ |
|
210 |
DynamicLabelingStrategyFactory.selfRegister(); |
|
211 |
AttrInTableLabelingStrategyFactory.selfRegister(); |
|
212 |
|
|
213 |
/* |
|
214 |
* Add symbol |
|
215 |
*/ |
|
216 |
DefaultDynamicSymbol.selfRegister(); |
|
217 |
|
|
218 |
/* |
|
219 |
* Add legend |
|
220 |
*/ |
|
221 |
DefaultDynamicVectorLegend.selfRegister(); |
|
200 | 222 |
|
223 |
|
|
201 | 224 |
/* |
202 | 225 |
* Do register of all |
203 | 226 |
*/ |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/impl/DefaultSymbologyManager.java | ||
---|---|---|
108 | 108 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.ISimpleTextSymbol; |
109 | 109 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.impl.SimpleTextSymbol; |
110 | 110 |
import org.gvsig.tools.util.Callable; |
111 |
import org.gvsig.tools.util.Factory; |
|
111 | 112 |
|
112 | 113 |
/** |
113 | 114 |
* Default {@link SymbologyManager} implementation. |
... | ... | |
117 | 118 |
public class DefaultSymbologyManager implements SymbologyManager { |
118 | 119 |
|
119 | 120 |
private Map labelClassFactories = new HashMap(); |
121 |
private Map<String, Factory> labelStrategyFactories = new HashMap<>(); |
|
120 | 122 |
private ILabelClassFactory defaultLabelClassFactory; |
121 | 123 |
|
122 | 124 |
public IInterval createInterval(double min, double max) { |
123 | 125 |
return new FInterval(min, max); |
124 | 126 |
} |
125 | 127 |
|
128 |
|
|
129 |
@Override |
|
130 |
public void registerLabelingStrategy(Factory factory) { |
|
131 |
labelStrategyFactories.put(factory.getName(), factory); |
|
132 |
} |
|
133 |
|
|
134 |
@Override |
|
135 |
public ILabelingStrategy createLabelingStrategy(String nameFactory, Object... parameters) { |
|
136 |
Factory factory = labelStrategyFactories.get(nameFactory); |
|
137 |
return (ILabelingStrategy) factory.create(parameters); |
|
138 |
} |
|
139 |
|
|
126 | 140 |
public static class RegisterSymbologyManager implements Callable { |
127 | 141 |
|
128 | 142 |
public Object call() throws Exception { |
... | ... | |
133 | 147 |
} |
134 | 148 |
|
135 | 149 |
} |
136 |
|
|
137 |
public DynamicVectorLegend createDynamicVectorLegend() { |
|
138 |
return new DefaultDynamicVectorLegend(); |
|
139 |
} |
|
140 | 150 |
|
141 | 151 |
public DynamicLabelingStrategy createDynamicLabelingStrategy() { |
142 | 152 |
return new DefaultDynamicLabelingStrategy(); |
143 | 153 |
} |
144 | 154 |
|
145 |
public DynamicSymbol createDynamicSymbol() { |
|
146 |
return new DefaultDynamicSymbol(); |
|
147 |
} |
|
148 |
|
|
149 | 155 |
public IArrowDecoratorStyle createArrowDecoratorStyle() { |
150 | 156 |
return new ArrowDecoratorStyle(); |
151 | 157 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/AttrInTableLabelingStrategyFactory.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling; |
|
7 |
|
|
8 |
import org.gvsig.symbology.SymbologyLocator; |
|
9 |
import org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend.DynamicLabelingStrategyFactory; |
|
10 |
import org.gvsig.tools.util.Factory; |
|
11 |
|
|
12 |
/** |
|
13 |
* |
|
14 |
* @author osc |
|
15 |
*/ |
|
16 |
public class AttrInTableLabelingStrategyFactory implements Factory { |
|
17 |
|
|
18 |
@Override |
|
19 |
public String getName() { |
|
20 |
return AttrInTableLabelingStrategy.NAME; |
|
21 |
} |
|
22 |
|
|
23 |
@Override |
|
24 |
public Object create(Object... parameters) { |
|
25 |
return new AttrInTableLabelingStrategy(); |
|
26 |
} |
|
27 |
|
|
28 |
public static void selfRegister() { |
|
29 |
SymbologyLocator.getSymbologyManager().registerLabelingStrategy(new AttrInTableLabelingStrategyFactory()); |
|
30 |
} |
|
31 |
|
|
32 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DynamicLabelingStrategyFactory.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.symbology.fmap.mapcontext.rendering.dynamiclegend; |
|
7 |
|
|
8 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
|
9 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorManager; |
|
10 |
import org.gvsig.symbology.SymbologyLocator; |
|
11 |
import org.gvsig.tools.util.Factory; |
|
12 |
|
|
13 |
/** |
|
14 |
* |
|
15 |
* @author osc |
|
16 |
*/ |
|
17 |
public class DynamicLabelingStrategyFactory implements Factory { |
|
18 |
|
|
19 |
@Override |
|
20 |
public String getName() { |
|
21 |
return DynamicLabelingStrategy.NAME; |
|
22 |
} |
|
23 |
|
|
24 |
@Override |
|
25 |
public Object create(Object... parameters) { |
|
26 |
return new DefaultDynamicLabelingStrategy(); |
|
27 |
} |
|
28 |
|
|
29 |
public static void selfRegister() { |
|
30 |
SymbologyLocator.getSymbologyManager().registerLabelingStrategy(new DynamicLabelingStrategyFactory()); |
|
31 |
} |
|
32 |
|
|
33 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DefaultDynamicSymbol.java | ||
---|---|---|
32 | 32 |
import org.gvsig.fmap.geom.primitive.Envelope; |
33 | 33 |
import org.gvsig.fmap.geom.primitive.Point; |
34 | 34 |
import org.gvsig.fmap.mapcontext.MapContext; |
35 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
35 | 36 |
import org.gvsig.fmap.mapcontext.ViewPort; |
36 | 37 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
37 | 38 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException; |
... | ... | |
429 | 430 |
this.listRequiredAttributeNames = listRequiredAttributeNames; |
430 | 431 |
|
431 | 432 |
} |
433 |
|
|
434 |
public static void selfRegister() { |
|
435 |
MapContextLocator.getSymbolManager().registerSymbol(NAME, DefaultDynamicSymbol.class); |
|
436 |
} |
|
432 | 437 |
|
433 | 438 |
|
434 | 439 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DefaultDynamicLabelingStrategy.java | ||
---|---|---|
40 | 40 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingMethod; |
41 | 41 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.IPlacementConstraints; |
42 | 42 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.IZoomConstraints; |
43 |
import org.gvsig.symbology.SymbologyLocator; |
|
43 | 44 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy; |
44 | 45 |
import static org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy.MIN_TEXT_SIZE; |
45 | 46 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.CartographicSupportToolkit; |
... | ... | |
57 | 58 |
* |
58 | 59 |
* @author osc |
59 | 60 |
*/ |
60 |
public class DefaultDynamicLabelingStrategy extends DynamicLabelingStrategy {
|
|
61 |
public class DefaultDynamicLabelingStrategy implements DynamicLabelingStrategy {
|
|
61 | 62 |
|
62 | 63 |
private Feature feature; |
63 | 64 |
public String LROTATION = "LROTATION"; |
... | ... | |
85 | 86 |
private static final Logger logger = LoggerFactory.getLogger(AttrInTableLabelingStrategy.class); |
86 | 87 |
private int referenceSystem; |
87 | 88 |
private String textField; |
89 |
|
|
88 | 90 |
|
89 | 91 |
public SymbolTable getFeatureSymbolTable() { |
90 | 92 |
if (symbolTable == null) { |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/dynamiclegend/DefaultDynamicVectorLegend.java | ||
---|---|---|
21 | 21 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
22 | 22 |
import org.gvsig.fmap.mapcontext.MapContextManager; |
23 | 23 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
24 |
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager; |
|
24 | 25 |
import org.gvsig.symbology.SymbologyLocator; |
25 | 26 |
import org.gvsig.symbology.SymbologyManager; |
26 | 27 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend; |
... | ... | |
45 | 46 |
|
46 | 47 |
public static final String DYNAMIC_VECTOR_PERSISTENCE_DEFINITION_NAME |
47 | 48 |
= "SingleSymbolLegend"; |
48 |
public static final String LEGEND_NAME = "DynamicSymbol"; |
|
49 | 49 |
private ISymbol defaultSymbol; |
50 | 50 |
private int shapeType = Geometry.TYPES.SURFACE; // Por defecto, tipo pol?gono |
51 | 51 |
|
... | ... | |
90 | 90 |
@Override |
91 | 91 |
public ISymbol getDefaultSymbol() { |
92 | 92 |
if (defaultSymbol == null) { |
93 |
SymbologyManager symbolManager = SymbologyLocator.getSymbologyManager();
|
|
94 |
defaultSymbol = symbolManager.createDynamicSymbol();
|
|
93 |
SymbolManager symbolManager = MapContextLocator.getSymbolManager();
|
|
94 |
defaultSymbol = symbolManager.createSymbol(DynamicSymbol.NAME);
|
|
95 | 95 |
} |
96 | 96 |
return defaultSymbol; |
97 | 97 |
} |
... | ... | |
257 | 257 |
|
258 | 258 |
} |
259 | 259 |
|
260 |
public static class RegisterLegend implements Callable { |
|
261 |
|
|
262 |
@Override |
|
263 |
public Object call() throws Exception { |
|
260 |
public static void selfRegister() { |
|
264 | 261 |
MapContextManager manager = MapContextLocator.getMapContextManager(); |
265 | 262 |
|
266 |
manager.registerLegend(LEGEND_NAME, |
|
267 |
DynamicVectorLegend.class); |
|
268 |
|
|
269 |
return Boolean.TRUE; |
|
270 |
} |
|
271 |
|
|
263 |
manager.registerLegend(NAME, |
|
264 |
DefaultDynamicVectorLegend.class); |
|
272 | 265 |
} |
273 | 266 |
|
274 | 267 |
} |
Also available in: Unified diff