Browse Source

CHART-13814 标记点配置面板调整

feature/big-screen
白岳 5 years ago
parent
commit
ccef564ff4
  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);
}
}
@ -79,11 +82,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);
}
}
@ -98,11 +102,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);
}
}
@ -119,11 +124,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},
};
}
};
@ -173,7 +190,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() {
@ -195,7 +212,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);
}
@ -210,9 +227,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.
*/
@ -223,14 +241,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