Browse Source

CHART-16595 视觉优化,地图部分自动的背景色,不允许设置不透明度

feature/big-screen
白岳 4 years ago
parent
commit
d7ef3e180f
  1. 60
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java
  2. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java
  3. 34
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java
  4. 20
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java
  5. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  6. 9
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

60
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java

@ -7,6 +7,7 @@ import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
@ -39,6 +40,7 @@ public class VanChartBackgroundPane extends BasicPane {
protected List<BackgroundQuickPane> paneList; protected List<BackgroundQuickPane> paneList;
protected UIComboBox typeComboBox; protected UIComboBox typeComboBox;
private UILabel transparentLabel;
protected UINumberDragPane transparent; protected UINumberDragPane transparent;
protected UIButtonGroup<Boolean> shadow; protected UIButtonGroup<Boolean> shadow;
@ -46,6 +48,8 @@ public class VanChartBackgroundPane extends BasicPane {
private boolean hasAuto; private boolean hasAuto;
private static final int AUTO = 0;
public VanChartBackgroundPane() { public VanChartBackgroundPane() {
this(false); this(false);
} }
@ -58,6 +62,9 @@ public class VanChartBackgroundPane extends BasicPane {
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
public UILabel getTransparentLabel() {
return transparentLabel;
}
public boolean isHasAuto() { public boolean isHasAuto() {
return hasAuto; return hasAuto;
@ -78,6 +85,7 @@ public class VanChartBackgroundPane extends BasicPane {
final CardLayout cardlayout = new CardLayout(); final CardLayout cardlayout = new CardLayout();
paneList = new ArrayList<>(); paneList = new ArrayList<>();
initAutoPane();
initList(); initList();
centerPane = new JPanel(cardlayout) { centerPane = new JPanel(cardlayout) {
@ -100,24 +108,43 @@ public class VanChartBackgroundPane extends BasicPane {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
cardlayout.show(centerPane, (String) typeComboBox.getSelectedItem()); cardlayout.show(centerPane, (String) typeComboBox.getSelectedItem());
fireStateChanged(); fireStateChanged();
checkTransparent();
} }
}); });
transparentLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha"));
transparent = new UINumberDragPane(0, 100); transparent = new UINumberDragPane(0, 100);
} }
protected Component[][] getPaneComponents() { protected Component[][] getPaneComponents() {
shadow = new UIButtonGroup<Boolean>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); shadow = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},
new Component[]{null, centerPane}, new Component[]{null, centerPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}, new Component[]{transparentLabel, transparent},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Shadow")), shadow}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shadow")), shadow},
}; };
} }
protected void initAutoPane() {
if (isHasAuto()) {
paneList.add(new NullBackgroundQuickPane() {
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Automatic");
}
});
}
}
private void checkTransparent() {
if (isHasAuto()) {
boolean enable = typeComboBox.getSelectedIndex() != AUTO;
transparentLabel.setEnabled(enable);
transparent.setEnabled(enable);
}
}
protected void initList() { protected void initList() {
paneList.add(new NullBackgroundQuickPane()); paneList.add(new NullBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane()); paneList.add(new ColorBackgroundQuickPane());
@ -158,7 +185,17 @@ public class VanChartBackgroundPane extends BasicPane {
if (shadow != null) { if (shadow != null) {
shadow.setSelectedIndex(attr.isShadow() == true ? 0 : 1); shadow.setSelectedIndex(attr.isShadow() == true ? 0 : 1);
} }
populateBackground(attr, 0);
if (isHasAuto()) {
if (attr.isAutoBackground()) {
typeComboBox.setSelectedIndex(AUTO);
checkTransparent();
return;
}
populateBackground(attr, 1);
} else {
populateBackground(attr, 0);
}
} }
public void populateBackground(GeneralInfo attr, int begin) { public void populateBackground(GeneralInfo attr, int begin) {
@ -168,20 +205,29 @@ public class VanChartBackgroundPane extends BasicPane {
if (pane.accept(background)) { if (pane.accept(background)) {
pane.populateBean(background); pane.populateBean(background);
typeComboBox.setSelectedIndex(i); typeComboBox.setSelectedIndex(i);
checkTransparent();
return; return;
} }
} }
checkTransparent();
} }
public void update(GeneralInfo attr) { public void update(GeneralInfo attr) {
if (attr == null) { if (attr == null) {
attr = new GeneralInfo(); attr = new GeneralInfo();
} }
updateBackground(attr);
attr.setAlpha((float) (transparent.updateBean() / ALPHA_V)); attr.setAlpha((float) (transparent.updateBean() / ALPHA_V));
if (shadow != null) { if (shadow != null) {
attr.setShadow(shadow.getSelectedIndex() == 0); attr.setShadow(shadow.getSelectedIndex() == 0);
} }
if (isHasAuto()) {
if (typeComboBox.getSelectedIndex() == AUTO) {
attr.setAutoBackground(true);
return;
}
attr.setAutoBackground(false);
}
updateBackground(attr);
} }
public void updateBackground(GeneralInfo attr) { public void updateBackground(GeneralInfo attr) {

13
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java

@ -1,12 +1,10 @@
package com.fr.van.chart.designer.component.background; package com.fr.van.chart.designer.component.background;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Component; import java.awt.Component;
@ -16,6 +14,15 @@ import java.awt.Component;
*/ */
public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgroundPane { public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgroundPane {
public VanChartBackgroundPaneWithOutImageAndShadow() {
this(false);
}
public VanChartBackgroundPaneWithOutImageAndShadow(boolean hasAuto) {
super(hasAuto);
}
@Override @Override
protected JPanel initContentPanel() { protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
@ -49,7 +56,7 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro
return new Component[][]{ return new Component[][]{
new Component[]{typeComboBox, null}, new Component[]{typeComboBox, null},
new Component[]{centerPane, null}, new Component[]{centerPane, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}, new Component[]{getTransparentLabel(), transparent},
}; };
} }

34
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java

@ -1,7 +1,5 @@
package com.fr.van.chart.designer.component.background; package com.fr.van.chart.designer.component.background;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.VanChartGradientPane; import com.fr.design.mainframe.backgroundpane.VanChartGradientPane;
@ -13,8 +11,6 @@ import com.fr.design.mainframe.backgroundpane.VanChartGradientPane;
public class VanChartBackgroundWithOutImagePane extends VanChartBackgroundPane { public class VanChartBackgroundWithOutImagePane extends VanChartBackgroundPane {
private static final long serialVersionUID = 1322979785605013853L; private static final long serialVersionUID = 1322979785605013853L;
private static final int AUTO = 0;
public VanChartBackgroundWithOutImagePane() { public VanChartBackgroundWithOutImagePane() {
this(false); this(false);
} }
@ -24,38 +20,8 @@ public class VanChartBackgroundWithOutImagePane extends VanChartBackgroundPane {
} }
protected void initList() { protected void initList() {
if (isHasAuto()) {
paneList.add(new NullBackgroundQuickPane() {
public String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Automatic");
}
});
}
paneList.add(new NullBackgroundQuickPane()); paneList.add(new NullBackgroundQuickPane());
paneList.add(new ColorBackgroundQuickPane()); paneList.add(new ColorBackgroundQuickPane());
paneList.add(new VanChartGradientPane()); paneList.add(new VanChartGradientPane());
} }
public void populateBackground(GeneralInfo attr, int begin) {
if (isHasAuto()) {
if (attr.isAutoBackground()) {
typeComboBox.setSelectedIndex(AUTO);
return;
}
super.populateBackground(attr, begin + 1);
} else {
super.populateBackground(attr, begin);
}
}
public void updateBackground(GeneralInfo attr) {
if (isHasAuto()) {
if (typeComboBox.getSelectedIndex() == AUTO) {
attr.setAutoBackground(true);
return;
}
attr.setAutoBackground(false);
}
super.updateBackground(attr);
}
} }

20
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java

@ -3,7 +3,7 @@ package com.fr.van.chart.designer.component.background;
import com.fr.chart.chartglyph.GeneralInfo; import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import java.awt.Component; import java.awt.Component;
@ -15,27 +15,27 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg
private UISpinner radius; private UISpinner radius;
public VanChartBackgroundWithOutShadowWithRadiusPane(){ public VanChartBackgroundWithOutShadowWithRadiusPane() {
super(); super();
} }
public VanChartBackgroundWithOutShadowWithRadiusPane(boolean hasAuto){ public VanChartBackgroundWithOutShadowWithRadiusPane(boolean hasAuto) {
super(hasAuto); super(hasAuto);
} }
protected Component[][] getPaneComponents() { protected Component[][] getPaneComponents() {
radius = new UISpinner(0,1000,1,0); radius = new UISpinner(0, 1000, 1, 0);
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},
new Component[]{null, centerPane}, new Component[]{null, centerPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}, new Component[]{getTransparentLabel(), transparent},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")),radius} new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), radius}
}; };
} }
public void populate(GeneralInfo attr) { public void populate(GeneralInfo attr) {
if(attr == null) { if (attr == null) {
return; return;
} }
super.populate(attr); super.populate(attr);
@ -48,7 +48,7 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg
if (attr == null) { if (attr == null) {
attr = new GeneralInfo(); attr = new GeneralInfo();
} }
attr.setRoundRadius((int)radius.getValue()); attr.setRoundRadius((int) radius.getValue());
} }
} }

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -153,7 +153,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},
new Component[]{null, centerPane}, new Component[]{null, centerPane},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}, new Component[]{getTransparentLabel(), transparent},
}; };
} }
}; };

9
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -7,7 +7,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
@ -77,15 +76,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
} }
}; };
backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow() { backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(true) {
@Override @Override
protected void initList() { protected void initList() {
paneList.add(new NullBackgroundQuickPane() {
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic");
}
});
paneList.add(new ColorBackgroundQuickPane()); paneList.add(new ColorBackgroundQuickPane());
} }
}; };

Loading…
Cancel
Save