|
|
|
@ -37,6 +37,7 @@ import com.fr.van.chart.designer.component.marker.VanChartImageMarkerPane;
|
|
|
|
|
import com.fr.van.chart.designer.other.VanChartInteractivePane; |
|
|
|
|
import com.fr.van.chart.designer.style.series.VanChartColorValueSeriesPane; |
|
|
|
|
import com.fr.van.chart.designer.style.series.VanChartEffectPane; |
|
|
|
|
import com.fr.van.chart.map.designer.style.series.VanChartMapAnchorMarkerPane; |
|
|
|
|
import com.fr.van.chart.map.designer.style.series.VanChartMapScatterMarkerPane; |
|
|
|
|
import com.fr.van.chart.map.line.VanChartCurvePane; |
|
|
|
|
import com.fr.van.chart.map.line.VanChartLineMapEffectPane; |
|
|
|
@ -61,16 +62,24 @@ import java.awt.event.ItemListener;
|
|
|
|
|
* 地图-系列界面 |
|
|
|
|
*/ |
|
|
|
|
public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { |
|
|
|
|
private static final String AREA_STRING = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Region"); |
|
|
|
|
private static final String POINT_STRING = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Point"); |
|
|
|
|
private static final String LINE_STRING = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Flow"); |
|
|
|
|
private static final String AREA_STRING = Toolkit.i18nText("Fine-Design_Chart_Region"); |
|
|
|
|
private static final String POINT_STRING = Toolkit.i18nText("Fine-Design_Chart_Point"); |
|
|
|
|
private static final String LINE_STRING = Toolkit.i18nText("Fine-Design_Chart_Flow"); |
|
|
|
|
|
|
|
|
|
private static final String[] MARKER_TYPES = new String[]{MapMarkerType.DEFAULT.toLocalString(), |
|
|
|
|
private static final String[] MARKER_TYPES = new String[]{MapMarkerType.ANCHOR.toLocalString(), |
|
|
|
|
MapMarkerType.COMMON.toLocalString(), MapMarkerType.BUBBLE.toLocalString(), MapMarkerType.IMAGE.toLocalString()}; |
|
|
|
|
|
|
|
|
|
private static final String[] LARGE_MARKER_TYPES = new String[]{MapMarkerType.DEFAULT.toLocalString(), |
|
|
|
|
private static final String[] LARGE_MARKER_TYPES = new String[]{MapMarkerType.ANCHOR.toLocalString(), |
|
|
|
|
MapMarkerType.COMMON.toLocalString(), MapMarkerType.BUBBLE.toLocalString()}; |
|
|
|
|
|
|
|
|
|
private static final String[] COMPATIBLE_MARKER_TYPES = new String[]{MapMarkerType.DEFAULT.toLocalString(), |
|
|
|
|
MapMarkerType.ANCHOR.toLocalString(), MapMarkerType.COMMON.toLocalString(), |
|
|
|
|
MapMarkerType.BUBBLE.toLocalString(), MapMarkerType.IMAGE.toLocalString()}; |
|
|
|
|
|
|
|
|
|
private static final String[] COMPATIBLE_LARGE_MARKER_TYPES = new String[]{MapMarkerType.DEFAULT.toLocalString(), |
|
|
|
|
MapMarkerType.ANCHOR.toLocalString(), MapMarkerType.COMMON.toLocalString(), |
|
|
|
|
MapMarkerType.BUBBLE.toLocalString()}; |
|
|
|
|
|
|
|
|
|
//custom
|
|
|
|
|
private UIButtonGroup<Integer> areaPointAndLineGroup; |
|
|
|
|
|
|
|
|
@ -85,9 +94,15 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
|
|
|
|
|
//point
|
|
|
|
|
private UIComboBox markerTypeCom; |
|
|
|
|
|
|
|
|
|
private VanChartMapAnchorMarkerPane anchorMarkerPane; |
|
|
|
|
private VanChartMapScatterMarkerPane commonMarkerPane; |
|
|
|
|
private VanChartBubblePane bubblePane; |
|
|
|
|
private VanChartImageMarkerPane imageMarkerPane; |
|
|
|
|
|
|
|
|
|
private CardLayout markerTypeLayout; |
|
|
|
|
private JPanel markerContentPane; |
|
|
|
|
|
|
|
|
|
private UINumberDragPane pointAlphaPane; |
|
|
|
|
private VanChartEffectPane pointEffectPane; |
|
|
|
|
|
|
|
|
@ -147,7 +162,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
checkLineMapLarge(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup); |
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup); |
|
|
|
|
return createLargeDataModelPane(panel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -162,14 +177,11 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
if (pointEffectPane != null) { |
|
|
|
|
GUICoreUtils.setEnabled(pointEffectPane, !largeModel); |
|
|
|
|
} |
|
|
|
|
if (markerTypeCom != null) { |
|
|
|
|
Object selectedItem = markerTypeCom.getSelectedItem(); |
|
|
|
|
markerTypeCom.setModel(new DefaultComboBoxModel(largeModel ? LARGE_MARKER_TYPES : MARKER_TYPES)); |
|
|
|
|
if (ComparatorUtils.equals(MapMarkerType.IMAGE.toLocalString(), selectedItem) && largeModel) { |
|
|
|
|
markerTypeCom.setSelectedItem(MapMarkerType.COMMON.toLocalString()); |
|
|
|
|
} else { |
|
|
|
|
markerTypeCom.setSelectedItem(selectedItem); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VanChartMapPlot mapPlot = (VanChartMapPlot) plot; |
|
|
|
|
refreshMarkerComboboxModel(mapPlot); |
|
|
|
|
if (largeModel) { |
|
|
|
|
checkLargeModelPlotSelectedItem(mapPlot); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -182,6 +194,56 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkLargeModelPlotSelectedItem(VanChartMapPlot plot) { |
|
|
|
|
String selected = plot.getMapMarkerType().toLocalString(); |
|
|
|
|
|
|
|
|
|
if (ComparatorUtils.equals(MapMarkerType.IMAGE.toLocalString(), selected)) { |
|
|
|
|
markerTypeCom.setSelectedItem(MapMarkerType.COMMON.toLocalString()); |
|
|
|
|
} else { |
|
|
|
|
markerTypeCom.setSelectedItem(selected); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean shouldRefreshComboboxModel(VanChartMapPlot plot) { |
|
|
|
|
if (markerTypeCom == null) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MapMarkerType selectedType = plot.getMapMarkerType(); |
|
|
|
|
DefaultComboBoxModel model = (DefaultComboBoxModel) markerTypeCom.getModel(); |
|
|
|
|
|
|
|
|
|
if (selectedType == MapMarkerType.DEFAULT) { |
|
|
|
|
return model.getIndexOf(MapMarkerType.DEFAULT.toLocalString()) < 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return model.getIndexOf(MapMarkerType.DEFAULT.toLocalString()) > -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void refreshMarkerComboboxModel(VanChartMapPlot plot) { |
|
|
|
|
if (largeModel(plot)) { |
|
|
|
|
|
|
|
|
|
if (plot.getMapMarkerType() == MapMarkerType.DEFAULT) { |
|
|
|
|
markerTypeCom.setModel(new DefaultComboBoxModel<>(COMPATIBLE_LARGE_MARKER_TYPES)); |
|
|
|
|
} else { |
|
|
|
|
markerTypeCom.setModel(new DefaultComboBoxModel<>(LARGE_MARKER_TYPES)); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
if (plot.getMapMarkerType() == MapMarkerType.DEFAULT) { |
|
|
|
|
markerTypeCom.setModel(new DefaultComboBoxModel<>(COMPATIBLE_MARKER_TYPES)); |
|
|
|
|
} else { |
|
|
|
|
markerTypeCom.setModel(new DefaultComboBoxModel<>(MARKER_TYPES)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String selected = plot.getMapMarkerType().toLocalString(); |
|
|
|
|
|
|
|
|
|
markerTypeCom.setSelectedItem(selected); |
|
|
|
|
if (markerTypeLayout != null && markerContentPane != null) { |
|
|
|
|
markerTypeLayout.show(markerContentPane, selected); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected JPanel getContentPane(boolean custom) { |
|
|
|
|
JPanel panel = new JPanel(new BorderLayout()); |
|
|
|
@ -272,7 +334,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{getColorPane(MapType.AREA)}, |
|
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)}, |
|
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, row, col); |
|
|
|
@ -357,28 +419,29 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
|
|
|
|
|
private Component createCurvePane() { |
|
|
|
|
curvePane = new VanChartCurvePane(); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Component createAnimationPane() { |
|
|
|
|
lineMapEffectPane = new VanChartLineMapEffectPane(); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), lineMapEffectPane); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Animation"), lineMapEffectPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//不透明度
|
|
|
|
|
private JPanel createPointAlphaPane() { |
|
|
|
|
pointAlphaPane = new UINumberDragPane(0, 100); |
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha"), pointAlphaPane); |
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), pointAlphaPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createPointEffectPane() { |
|
|
|
|
pointEffectPane = new VanChartEffectPane(); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), pointEffectPane); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Animation"), pointEffectPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createMarkerComPane() { |
|
|
|
|
markerTypeCom = new UIComboBox(MARKER_TYPES); |
|
|
|
|
markerTypeCom = new UIComboBox(COMPATIBLE_MARKER_TYPES); |
|
|
|
|
|
|
|
|
|
anchorMarkerPane = new VanChartMapAnchorMarkerPane(); |
|
|
|
|
commonMarkerPane = new VanChartMapScatterMarkerPane(); |
|
|
|
|
commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); |
|
|
|
|
bubblePane = new VanChartBubblePane() { |
|
|
|
@ -396,31 +459,34 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
}; |
|
|
|
|
imageMarkerPane = new VanChartImageMarkerPane(); |
|
|
|
|
|
|
|
|
|
final JPanel[] panes = new JPanel[]{new JPanel(), commonMarkerPane, bubblePane, imageMarkerPane}; |
|
|
|
|
final CardLayout cardLayout = new CardLayout(); |
|
|
|
|
final JPanel cardPane = new JPanel(cardLayout) { |
|
|
|
|
final JPanel[] panes = new JPanel[]{new JPanel(), anchorMarkerPane, commonMarkerPane, bubblePane, imageMarkerPane}; |
|
|
|
|
|
|
|
|
|
markerTypeLayout = new CardLayout(); |
|
|
|
|
markerContentPane = new JPanel(markerTypeLayout) { |
|
|
|
|
@Override |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
return panes[markerTypeCom.getSelectedIndex()].getPreferredSize(); |
|
|
|
|
int index = MapMarkerType.parse((String) markerTypeCom.getSelectedItem()).ordinal(); |
|
|
|
|
|
|
|
|
|
return panes[index].getPreferredSize(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
for (int i = 0, len = MARKER_TYPES.length; i < len; i++) { |
|
|
|
|
cardPane.add(panes[i], MARKER_TYPES[i]); |
|
|
|
|
for (int i = 0, len = COMPATIBLE_MARKER_TYPES.length; i < len; i++) { |
|
|
|
|
markerContentPane.add(panes[i], COMPATIBLE_MARKER_TYPES[i]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
markerTypeCom.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
cardLayout.show(cardPane, MARKER_TYPES[markerTypeCom.getSelectedIndex()]); |
|
|
|
|
markerTypeLayout.show(markerContentPane, (String) markerTypeCom.getSelectedItem()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Point_Style"), markerTypeCom); |
|
|
|
|
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Point_Style"), markerTypeCom); |
|
|
|
|
JPanel markerPane = new JPanel(new BorderLayout(0, 6)); |
|
|
|
|
markerPane.add(northPane, BorderLayout.NORTH); |
|
|
|
|
markerPane.add(cardPane, BorderLayout.CENTER); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); |
|
|
|
|
markerPane.add(markerContentPane, BorderLayout.CENTER); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createCustomPane(Plot plot) { |
|
|
|
@ -500,9 +566,16 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void populateBean(Plot plot) { |
|
|
|
|
if (plot != null && plot instanceof VanChartMapPlot) { |
|
|
|
|
if (plot instanceof VanChartMapPlot) { |
|
|
|
|
VanChartMapPlot mapPlot = (VanChartMapPlot) plot; |
|
|
|
|
|
|
|
|
|
if (markerTypeCom != null) { |
|
|
|
|
markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString()); |
|
|
|
|
|
|
|
|
|
if (shouldRefreshComboboxModel(mapPlot)) { |
|
|
|
|
refreshMarkerComboboxModel(mapPlot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
markerTypeCom.setSelectedItem(mapPlot.getMapMarkerType().toLocalString()); |
|
|
|
|
} |
|
|
|
|
if (nullValueColorBox != null) { |
|
|
|
|
//TODO Bjorn 地图空值背景自动
|
|
|
|
@ -513,29 +586,35 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
} |
|
|
|
|
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); |
|
|
|
|
checkNullValueButton();*/ |
|
|
|
|
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); |
|
|
|
|
nullValueColorBox.setSelectObject(mapPlot.getNullValueColor()); |
|
|
|
|
} |
|
|
|
|
//大数据模式 恢复用注释。下面3行删除。
|
|
|
|
|
if (lineMapLargeDataModelGroup != null) { |
|
|
|
|
lineMapLargeDataModelGroup.setSelectedItem(((VanChartMapPlot) plot).getLineMapDataProcessor()); |
|
|
|
|
lineMapLargeDataModelGroup.setSelectedItem(mapPlot.getLineMapDataProcessor()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
super.populateBean(plot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void updateBean(Plot plot) { |
|
|
|
|
if (plot != null && plot instanceof VanChartMapPlot) { |
|
|
|
|
if (plot instanceof VanChartMapPlot) { |
|
|
|
|
VanChartMapPlot mapPlot = (VanChartMapPlot) plot; |
|
|
|
|
|
|
|
|
|
if (markerTypeCom != null) { |
|
|
|
|
((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parseInt(markerTypeCom.getSelectedIndex())); |
|
|
|
|
mapPlot.setMapMarkerType(MapMarkerType.parse((String) markerTypeCom.getSelectedItem())); |
|
|
|
|
|
|
|
|
|
if (shouldRefreshComboboxModel(mapPlot)) { |
|
|
|
|
refreshMarkerComboboxModel(mapPlot); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (nullValueColorBox != null) { |
|
|
|
|
//TODO Bjorn 地图空值背景自动
|
|
|
|
|
//((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0);
|
|
|
|
|
((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject()); |
|
|
|
|
mapPlot.setNullValueColor(nullValueColorBox.getSelectObject()); |
|
|
|
|
} |
|
|
|
|
//大数据模式 恢复用注释。下面3行删除。
|
|
|
|
|
if (lineMapLargeDataModelGroup != null) { |
|
|
|
|
((VanChartMapPlot) plot).setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem()); |
|
|
|
|
mapPlot.setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
super.updateBean(plot); |
|
|
|
@ -587,6 +666,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class); |
|
|
|
|
|
|
|
|
|
if (anchorMarkerPane != null) { |
|
|
|
|
anchorMarkerPane.populateBean(attrMarker); |
|
|
|
|
} |
|
|
|
|
if (commonMarkerPane != null) { |
|
|
|
|
commonMarkerPane.populateBean(attrMarker); |
|
|
|
|
} |
|
|
|
@ -669,11 +752,16 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class); |
|
|
|
|
defaultAttr.remove(attrBubble); |
|
|
|
|
if (markerTypeCom != null) { |
|
|
|
|
if (markerTypeCom.getSelectedIndex() == 1) { |
|
|
|
|
String selected = (String) markerTypeCom.getSelectedItem(); |
|
|
|
|
MapMarkerType markerType = MapMarkerType.parse(selected); |
|
|
|
|
|
|
|
|
|
if (markerType == MapMarkerType.ANCHOR) { |
|
|
|
|
defaultAttr.addDataSeriesCondition(anchorMarkerPane.updateBean()); |
|
|
|
|
} else if (markerType == MapMarkerType.COMMON) { |
|
|
|
|
defaultAttr.addDataSeriesCondition(commonMarkerPane.updateBean()); |
|
|
|
|
} else if (markerTypeCom.getSelectedIndex() == 2) { |
|
|
|
|
} else if (markerType == MapMarkerType.BUBBLE) { |
|
|
|
|
defaultAttr.addDataSeriesCondition(bubblePane.updateBean()); |
|
|
|
|
} else if (markerTypeCom.getSelectedIndex() == 3) { |
|
|
|
|
} else if (markerType == MapMarkerType.IMAGE) { |
|
|
|
|
defaultAttr.addDataSeriesCondition(imageMarkerPane.updateBean()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|