|
|
@ -39,18 +39,14 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
if (mapPlot == null) { |
|
|
|
if (mapPlot == null) { |
|
|
|
return contentPane; |
|
|
|
return contentPane; |
|
|
|
} |
|
|
|
} |
|
|
|
switch (mapPlot.getAllLayersMapType()){ |
|
|
|
switch (mapPlot.getAllLayersMapType()) { |
|
|
|
case POINT: |
|
|
|
case POINT: |
|
|
|
pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); |
|
|
|
pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); |
|
|
|
contentPane.add(pointLabelPane, BorderLayout.NORTH); |
|
|
|
contentPane.add(pointLabelPane, BorderLayout.NORTH); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case CUSTOM: |
|
|
|
case CUSTOM: |
|
|
|
areaLabelPane = createAreaMapPlotLabelPane(); |
|
|
|
|
|
|
|
pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); |
|
|
|
|
|
|
|
contentPane.add(new VanMapAreaAndPointGroupPane(areaLabelPane, pointLabelPane), BorderLayout.NORTH); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case DRILL_CUSTOM: |
|
|
|
case DRILL_CUSTOM: |
|
|
|
areaLabelPane = new VanChartPlotLabelPane(mapPlot, parent); |
|
|
|
areaLabelPane = createAreaMapPlotLabelPane(); |
|
|
|
pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); |
|
|
|
pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); |
|
|
|
contentPane.add(new VanMapAreaAndPointGroupPane(areaLabelPane, pointLabelPane), BorderLayout.NORTH); |
|
|
|
contentPane.add(new VanMapAreaAndPointGroupPane(areaLabelPane, pointLabelPane), BorderLayout.NORTH); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -64,7 +60,7 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private VanChartPlotLabelPane createAreaMapPlotLabelPane() { |
|
|
|
private VanChartPlotLabelPane createAreaMapPlotLabelPane() { |
|
|
|
return new VanChartPlotLabelPane(mapPlot, parent){ |
|
|
|
return new VanChartPlotLabelPane(mapPlot, parent) { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected boolean checkEnabled4Large() { |
|
|
|
protected boolean checkEnabled4Large() { |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -75,7 +71,7 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void populateBean(Chart chart) { |
|
|
|
public void populateBean(Chart chart) { |
|
|
|
Plot plot = chart.getPlot(); |
|
|
|
Plot plot = chart.getPlot(); |
|
|
|
if(plot instanceof VanChartMapPlot){ |
|
|
|
if (plot instanceof VanChartMapPlot) { |
|
|
|
mapPlot = (VanChartMapPlot) plot; |
|
|
|
mapPlot = (VanChartMapPlot) plot; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -85,11 +81,11 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
parent.initAllListeners(); |
|
|
|
parent.initAllListeners(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
AttrMapLabel attrMapLabel = (AttrMapLabel)plot.getConditionCollection().getDefaultAttr().getExisted(AttrMapLabel.class); |
|
|
|
AttrMapLabel attrMapLabel = (AttrMapLabel) plot.getConditionCollection().getDefaultAttr().getExisted(AttrMapLabel.class); |
|
|
|
if(attrMapLabel == null){ |
|
|
|
if (attrMapLabel == null) { |
|
|
|
attrMapLabel = new AttrMapLabel(); |
|
|
|
attrMapLabel = new AttrMapLabel(); |
|
|
|
} |
|
|
|
} |
|
|
|
if(pointLabelPane != null){ |
|
|
|
if (pointLabelPane != null) { |
|
|
|
pointLabelPane.populate(attrMapLabel.getPointLabel()); |
|
|
|
pointLabelPane.populate(attrMapLabel.getPointLabel()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (areaLabelPane != null) { |
|
|
|
if (areaLabelPane != null) { |
|
|
@ -103,17 +99,17 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane<Chart> { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
ConditionAttr defaultAttr = chart.getPlot().getConditionCollection().getDefaultAttr(); |
|
|
|
ConditionAttr defaultAttr = chart.getPlot().getConditionCollection().getDefaultAttr(); |
|
|
|
AttrMapLabel attrMapLabel = (AttrMapLabel)defaultAttr.getExisted(AttrMapLabel.class); |
|
|
|
AttrMapLabel attrMapLabel = (AttrMapLabel) defaultAttr.getExisted(AttrMapLabel.class); |
|
|
|
if (attrMapLabel != null) { |
|
|
|
if (attrMapLabel != null) { |
|
|
|
defaultAttr.remove(attrMapLabel); |
|
|
|
defaultAttr.remove(attrMapLabel); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
attrMapLabel = new AttrMapLabel(); |
|
|
|
attrMapLabel = new AttrMapLabel(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(areaLabelPane != null){ |
|
|
|
if (areaLabelPane != null) { |
|
|
|
attrMapLabel.setAreaLabel(areaLabelPane.update()); |
|
|
|
attrMapLabel.setAreaLabel(areaLabelPane.update()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(pointLabelPane != null){ |
|
|
|
if (pointLabelPane != null) { |
|
|
|
attrMapLabel.setPointLabel(pointLabelPane.update()); |
|
|
|
attrMapLabel.setPointLabel(pointLabelPane.update()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|