Browse Source

Pull request #1645: CHART-13814 标记点配置面板调整

Merge in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit '9de0f783bf02d8b495c6a17fc4e6d8fda4e781df':
  CHART-13814 标记点配置面板调整
feature/big-screen
Bjorn 5 years ago
parent
commit
813f5f8222
  1. 50
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java

50
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java

@ -1,12 +1,14 @@
package com.fr.van.chart.designer.component.marker;
import com.fr.chart.chartglyph.Marker;
import com.fr.design.i18n.Toolkit;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -42,11 +44,12 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
MarkerType.MARKER_TRIANGLE_HOLLOW
};
private static Marker[] normalMarkers = null;
protected static Marker[] getNormalMarkers() {
if(normalMarkers == null){
if (normalMarkers == null) {
normalMarkers = new Marker[NORMAL_TYPES.length];
int i = 0;
for(MarkerType markerType : NORMAL_TYPES){
for (MarkerType markerType : NORMAL_TYPES) {
normalMarkers[i++] = Marker.createMarker(markerType);
}
}
@ -80,11 +83,12 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
MarkerType.MARKER_TRIANGLE_HOLLOW
};
private static Marker[] mapMarkers = null;
protected static Marker[] getMapScatterMarkers() {
if(mapMarkers == null){
if (mapMarkers == null) {
mapMarkers = new Marker[MAP_TYPES.length];
int i = 0;
for(MarkerType markerType : MAP_TYPES){
for (MarkerType markerType : MAP_TYPES) {
mapMarkers[i++] = Marker.createMarker(markerType);
}
}
@ -99,11 +103,12 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
MarkerType.MARKER_STAR
};
private static Marker[] ganttMarkers = null;
protected static Marker[] getGanttMarkers() {
if(ganttMarkers == null){
if (ganttMarkers == null) {
ganttMarkers = new Marker[GANTT_TYPES.length];
int i = 0;
for(MarkerType markerType : GANTT_TYPES){
for (MarkerType markerType : GANTT_TYPES) {
ganttMarkers[i++] = Marker.createMarker(markerType);
}
}
@ -120,11 +125,23 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
public VanChartCommonMarkerPane() {
markerTypeComboBox = new MarkerComboBox(getMarkers());
markerFillColor = new VanChartMarkerBackgroundPane(){
markerFillColor = new VanChartMarkerBackgroundPane() {
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
return TableLayoutHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize, 0, LayoutConstants.VGAP_MEDIUM);
}
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{typeComboBox, null},
new Component[]{centerPane, null},
return new Component[][]{
new Component[]{null, null},
new Component[]{null, typeComboBox},
new Component[]{null, centerPane},
};
}
};
@ -174,7 +191,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
protected double[] getColumnSize() {
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH;
return new double[] {d, e};
return new double[]{d, e};
}
protected Marker[] getMarkers() {
@ -196,7 +213,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
@Override
public void populateBean(VanChartAttrMarker marker) {
if(marker == null){
if (marker == null) {
marker = new VanChartAttrMarker();
marker.setCommon(true);
}
@ -211,9 +228,10 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
markerFillColor.populate(marker.getColorBackground());
}
protected MarkerType populateMarkType(VanChartAttrMarker marker){
protected MarkerType populateMarkType(VanChartAttrMarker marker) {
return marker.getMarkerType();
}
/**
* Update.
*/
@ -224,14 +242,14 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
return marker;
}
public void updateBean(VanChartAttrMarker marker){
public void updateBean(VanChartAttrMarker marker) {
marker.setCommon(true);
updateColor(marker);
marker.setRadius(radius.getValue());
marker.setMarkerType(MarkerType.parse(markerTypeComboBox.getSelectedMarkder().getMarkerType()));
}
protected void updateColor(VanChartAttrMarker marker){
protected void updateColor(VanChartAttrMarker marker) {
marker.setColorBackground(markerFillColor.update());
}
}

Loading…
Cancel
Save