|
|
|
@ -1,17 +1,16 @@
|
|
|
|
|
package com.fr.van.chart.map; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineLayoutBuilder; |
|
|
|
|
import com.fr.base.chart.chartdata.model.DataProcessor; |
|
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
|
import com.fr.chart.chartglyph.ConditionAttr; |
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
import com.fr.design.gui.frpane.UINumberDragPane; |
|
|
|
|
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
|
|
|
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
@ -45,7 +44,6 @@ 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; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.DefaultComboBoxModel; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
@ -57,8 +55,10 @@ import java.awt.Component;
|
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.awt.event.ItemEvent; |
|
|
|
|
import java.awt.event.ItemListener; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Created by Mitisky on 16/5/4. |
|
|
|
@ -165,7 +165,8 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
checkLineMapLarge(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup); |
|
|
|
|
JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, |
|
|
|
|
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Large_Model")), lineMapLargeDataModelGroup); |
|
|
|
|
return createLargeDataModelPane(panel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -264,7 +265,6 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
mapType = ((VanChartMapPlot) plot).getAllLayersMapType(); |
|
|
|
|
if (mapType == MapType.CUSTOM || mapType == MapType.DRILL_CUSTOM) { |
|
|
|
|
JPanel pane = createColorChoosePane(); |
|
|
|
|
pane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); |
|
|
|
|
panel.add(pane, BorderLayout.NORTH); |
|
|
|
|
} |
|
|
|
|
panel.add(getContentInPlotType(), BorderLayout.CENTER); |
|
|
|
@ -283,8 +283,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
setColorPaneContent(panel, paneType); |
|
|
|
|
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0)); |
|
|
|
|
JPanel colorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Color"), panel, true); |
|
|
|
|
return panel.getComponentCount() == 0 ? null : colorPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -323,33 +322,22 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
//不透明度
|
|
|
|
|
protected JPanel createAlphaPane() { |
|
|
|
|
setTransparent(new UINumberDragPaneWithPercent(0, 100)); |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] columnSize = {f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; |
|
|
|
|
double[] rowSize = {p, p}; |
|
|
|
|
UILabel label = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Alpha")); |
|
|
|
|
label.setVerticalAlignment(SwingConstants.TOP); |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{label, UIComponentUtils.wrapWithBorderLayoutPane(getTransparent())}, |
|
|
|
|
}; |
|
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, TableLayout4VanChartHelper.COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createAreaPane() { |
|
|
|
|
borderWithAlphaPane = new VanChartBorderWithAlphaPane(true); |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] row = {p, p, p, p, p}; |
|
|
|
|
double[] col = {f}; |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{getColorPane(MapType.AREA)}, |
|
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)}, |
|
|
|
|
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Border"), borderWithAlphaPane)}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, row, col); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createNullValueColorPane() { |
|
|
|
@ -358,19 +346,12 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
initNullValueListener(); |
|
|
|
|
nullValueColorBox = new ColorSelectBox(80); |
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_NULL_Value_Color"), SwingConstants.LEFT); |
|
|
|
|
Component[][] components = { |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{text, nullValueAuto}, |
|
|
|
|
new Component[]{null, nullValueColorBox}, |
|
|
|
|
}; |
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -385,16 +366,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
|
|
|
|
|
private void checkNullValueButton() { |
|
|
|
|
nullValueColorBox.setVisible(nullValueAuto.getSelectedIndex() == 1); |
|
|
|
|
nullValueColorBox.setPreferredSize(nullValueAuto.getSelectedIndex() == 1 ? new Dimension(0, 20) : new Dimension(0, 0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createPointPane() { |
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] row = {p, p, p, p, p, p, p}; |
|
|
|
|
double[] col = {f}; |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{getColorPane(MapType.POINT)}, |
|
|
|
|
new Component[]{createMarkerComPane()}, |
|
|
|
@ -403,15 +378,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
new Component[]{createPointEffectPane()}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, row, col); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createLinePane() { |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] row = {p, p, p, p, p}; |
|
|
|
|
double[] col = {f}; |
|
|
|
|
|
|
|
|
|
curvePane = new VanChartCurvePane(); |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
@ -422,28 +392,29 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
new Component[]{createAnimationPane()} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, row, col); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Component createCurvePane() { |
|
|
|
|
curvePane = new VanChartCurvePane(); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane); |
|
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Component createAnimationPane() { |
|
|
|
|
lineMapEffectPane = new VanChartLineMapEffectPane(); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Animation"), lineMapEffectPane); |
|
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Animation"), lineMapEffectPane, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//不透明度
|
|
|
|
|
private JPanel createPointAlphaPane() { |
|
|
|
|
pointAlphaPane = new UINumberDragPaneWithPercent(0, 100); |
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), pointAlphaPane); |
|
|
|
|
return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, |
|
|
|
|
new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), pointAlphaPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createPointEffectPane() { |
|
|
|
|
pointEffectPane = new VanChartEffectPane(); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Animation"), pointEffectPane); |
|
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Animation"), pointEffectPane, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createMarkerComPane() { |
|
|
|
@ -454,15 +425,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); |
|
|
|
|
bubblePane = new VanChartBubblePane() { |
|
|
|
|
protected JPanel getContentPane() { |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; |
|
|
|
|
double[] row = {p, p, p, p, p}; |
|
|
|
|
double[] col = {f, e}; |
|
|
|
|
|
|
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(getComponent(), row, col); |
|
|
|
|
panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); |
|
|
|
|
return panel; |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, getComponent(), new double[]{1.2, 3}); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
imageMarkerPane = new VanChartImageMarkerPane(); |
|
|
|
@ -483,19 +446,19 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
markerContentPane.add(panes[i], COMPATIBLE_MARKER_TYPES[i]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
markerTypeCom.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
markerTypeCom.addItemListener(e -> { |
|
|
|
|
markerTypeLayout.show(markerContentPane, (String) markerTypeCom.getSelectedItem()); |
|
|
|
|
checkPointEffectPane(plot); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
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(markerContentPane, BorderLayout.CENTER); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); |
|
|
|
|
JPanel markerPane = column(10, |
|
|
|
|
row( |
|
|
|
|
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Point_Style"))).weight(1.2), |
|
|
|
|
cell(markerTypeCom).weight(3) |
|
|
|
|
), |
|
|
|
|
cell(markerContentPane) |
|
|
|
|
).getComponent(); |
|
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createCustomPane(Plot plot) { |
|
|
|
@ -503,9 +466,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
JPanel pointPane = createPointPane(); |
|
|
|
|
JPanel linePane = createLinePane(); |
|
|
|
|
|
|
|
|
|
JPanel panel = createGroupPane(plot, areaPane, pointPane, linePane); |
|
|
|
|
|
|
|
|
|
return panel; |
|
|
|
|
return createGroupPane(plot, areaPane, pointPane, linePane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createGroupPane(Plot plot, JPanel areaPane, JPanel pointPane, JPanel linePane) { |
|
|
|
@ -515,7 +476,6 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
} else { |
|
|
|
|
panel = createMapCustomGroupPane(areaPane, pointPane, linePane); |
|
|
|
|
} |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); |
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -542,10 +502,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 4)); |
|
|
|
|
panel.add(areaPointAndLineGroup, BorderLayout.NORTH); |
|
|
|
|
panel.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
return panel; |
|
|
|
|
return column(10,cell(areaPointAndLineGroup), cell(centerPane)).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createDrillMapCustomGroupPane(JPanel areaPane, JPanel pointPane) { |
|
|
|
@ -567,11 +524,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 4)); |
|
|
|
|
panel.add(areaAndPointGroup, BorderLayout.NORTH); |
|
|
|
|
panel.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
return panel; |
|
|
|
|
return column(10,cell(areaAndPointGroup), cell(centerPane)).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void populateBean(Plot plot) { |
|
|
|
|