Revision 42981 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.labeling.app/org.gvsig.labeling.app.mainplugin/src/main/java/org/gvsig/labeling/gui/layerproperties/OnSelection.java
OnSelection.java | ||
---|---|---|
44 | 44 |
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingMethod; |
45 | 45 |
import org.gvsig.i18n.Messages; |
46 | 46 |
import org.gvsig.labeling.label.OnSelectionLabeled; |
47 |
import org.gvsig.symbology.SymbologyLocator; |
|
48 | 47 |
|
48 |
/** |
|
49 |
* @author gvSIG Team |
|
50 |
* |
|
51 |
*/ |
|
49 | 52 |
public class OnSelection extends DefaultLabeling{ |
50 | 53 |
|
51 | 54 |
private static final long serialVersionUID = -3619706540747109386L; |
... | ... | |
60 | 63 |
return OnSelectionLabeled.class; |
61 | 64 |
} |
62 | 65 |
|
63 |
@Override |
|
64 |
public ILabelingMethod getMethod() { |
|
65 |
|
|
66 |
OnSelectionLabeled resp = null; |
|
67 |
if (super.getMethod() instanceof OnSelectionLabeled) { |
|
68 |
resp = (OnSelectionLabeled) super.getMethod(); |
|
69 |
} else { |
|
70 |
resp = new OnSelectionLabeled(); |
|
71 |
} |
|
72 |
|
|
73 |
if (resp.getLabelClasses() == null || resp.getLabelClasses().length == 0) { |
|
74 |
ILabelClass lc = null; |
|
75 |
lc = SymbologyLocator.getSymbologyManager().createDefaultLabel(); |
|
76 |
resp.addLabelClass(lc); |
|
77 |
} |
|
78 |
return resp; |
|
79 |
} |
|
80 |
|
|
81 | 66 |
protected ILabelingMethod newMethodForThePreview(ILabelClass defaultLabel) { |
82 | 67 |
OnSelectionLabeled method = new OnSelectionLabeled(); |
83 | 68 |
method.addLabelClass(defaultLabel); |
Also available in: Unified diff