|
|
@ -1,7 +1,6 @@ |
|
|
|
package com.fr.van.chart.designer.style; |
|
|
|
package com.fr.van.chart.designer.style; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.Style; |
|
|
|
|
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.gui.frpane.UIBubbleFloatPane; |
|
|
|
import com.fr.design.gui.frpane.UIBubbleFloatPane; |
|
|
@ -61,6 +60,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
private UIButtonGroup<LayoutType> layoutButton; |
|
|
|
private UIButtonGroup<LayoutType> layoutButton; |
|
|
|
private JPanel layoutPane; |
|
|
|
private JPanel layoutPane; |
|
|
|
private VanChartFloatPositionPane customFloatPositionPane; |
|
|
|
private VanChartFloatPositionPane customFloatPositionPane; |
|
|
|
|
|
|
|
private UIBubbleFloatPane uiBubbleFloatPane; |
|
|
|
|
|
|
|
|
|
|
|
//区域显示策略 恢复用注释。下面4行删除。
|
|
|
|
//区域显示策略 恢复用注释。下面4行删除。
|
|
|
|
private UIButtonGroup<Integer> customSize; |
|
|
|
private UIButtonGroup<Integer> customSize; |
|
|
@ -80,7 +80,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
initComponents(); |
|
|
|
initComponents(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public VanChartPlotLegendPane(VanChartStylePane parent){ |
|
|
|
public VanChartPlotLegendPane(VanChartStylePane parent) { |
|
|
|
this.parent = parent; |
|
|
|
this.parent = parent; |
|
|
|
initComponents(); |
|
|
|
initComponents(); |
|
|
|
} |
|
|
|
} |
|
|
@ -118,9 +118,9 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
new Component[]{legendPane}, |
|
|
|
new Component[]{legendPane}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,row,col); |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(panel,BorderLayout.CENTER); |
|
|
|
this.add(panel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
addLegendListener(); |
|
|
|
addLegendListener(); |
|
|
|
} |
|
|
|
} |
|
|
@ -133,7 +133,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createLegendPaneWithoutHighlight(){ |
|
|
|
protected JPanel createLegendPaneWithoutHighlight() { |
|
|
|
borderPane = new VanChartBorderWithRadiusPane(); |
|
|
|
borderPane = new VanChartBorderWithRadiusPane(); |
|
|
|
backgroundPane = new VanChartBackgroundWithOutImagePane(); |
|
|
|
backgroundPane = new VanChartBackgroundWithOutImagePane(); |
|
|
|
|
|
|
|
|
|
|
@ -141,19 +141,19 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
double[] columnSize = {f, e}; |
|
|
|
double[] columnSize = {f, e}; |
|
|
|
double[] rowSize = { p,p,p,p,p,p,p}; |
|
|
|
double[] rowSize = {p, p, p, p, p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{createTitlePositionPane(new double[]{p,p,p},columnSize),null}, |
|
|
|
new Component[]{createTitlePositionPane(new double[]{p, p, p}, columnSize), null}, |
|
|
|
new Component[]{createTitleStylePane(),null} , |
|
|
|
new Component[]{createTitleStylePane(), null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane), null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane), null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), createDisplayStrategy()),null} |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), createDisplayStrategy()), null} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createLegendPane(){ |
|
|
|
protected JPanel createLegendPane() { |
|
|
|
borderPane = new VanChartBorderWithRadiusPane(); |
|
|
|
borderPane = new VanChartBorderWithRadiusPane(); |
|
|
|
backgroundPane = new VanChartBackgroundWithOutImagePane(); |
|
|
|
backgroundPane = new VanChartBackgroundWithOutImagePane(); |
|
|
|
highlightPane = createHighlightPane(); |
|
|
|
highlightPane = createHighlightPane(); |
|
|
@ -166,14 +166,14 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
double[] columnSize = {f, e}; |
|
|
|
double[] columnSize = {f, e}; |
|
|
|
double[] rowSize = { p,p,p,p,p,p,p,p}; |
|
|
|
double[] rowSize = {p, p, p, p, p, p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{createTitlePositionPane(new double[]{p,p,p},columnSize),null}, |
|
|
|
new Component[]{createTitlePositionPane(new double[]{p, p, p}, columnSize), null}, |
|
|
|
new Component[]{createTitleStylePane(),null} , |
|
|
|
new Component[]{createTitleStylePane(), null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane), null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane), null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel),null}, |
|
|
|
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel), null}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
} |
|
|
|
} |
|
|
@ -205,9 +205,9 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
customFloatPositionButton.setEventBannded(true); |
|
|
|
customFloatPositionButton.setEventBannded(true); |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null,null}, |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),location}, |
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), location}, |
|
|
|
new Component[]{null,customFloatPositionButton} |
|
|
|
new Component[]{null, customFloatPositionButton} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
customFloatPositionPane = new VanChartFloatPositionPane(); |
|
|
|
customFloatPositionPane = new VanChartFloatPositionPane(); |
|
|
@ -241,7 +241,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{f, e}); |
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{f, e}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initPositionListener(){ |
|
|
|
private void initPositionListener() { |
|
|
|
|
|
|
|
|
|
|
|
location.addChangeListener(new ChangeListener() { |
|
|
|
location.addChangeListener(new ChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -262,18 +262,20 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
checkLayoutPaneVisible(); |
|
|
|
checkLayoutPaneVisible(); |
|
|
|
checkDisplayStrategyUse(); |
|
|
|
checkDisplayStrategyUse(); |
|
|
|
|
|
|
|
|
|
|
|
if(customFloatPositionPane == null) { |
|
|
|
if (customFloatPositionPane == null) { |
|
|
|
customFloatPositionPane = new VanChartFloatPositionPane(); |
|
|
|
customFloatPositionPane = new VanChartFloatPositionPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (uiBubbleFloatPane == null) { |
|
|
|
Point comPoint = customFloatPositionButton.getLocationOnScreen(); |
|
|
|
Point comPoint = customFloatPositionButton.getLocationOnScreen(); |
|
|
|
Point arrowPoint = new Point(comPoint.x + customFloatPositionButton.getWidth()/2 - GAP, comPoint.y + customFloatPositionButton.getHeight()); |
|
|
|
Point arrowPoint = new Point(comPoint.x + customFloatPositionButton.getWidth() / 2 - GAP, comPoint.y + customFloatPositionButton.getHeight()); |
|
|
|
UIBubbleFloatPane<Style> pane = new UIBubbleFloatPane(Constants.TOP, arrowPoint, customFloatPositionPane, WIDTH, HEIGHT) { |
|
|
|
uiBubbleFloatPane = new UIBubbleFloatPane(Constants.TOP, arrowPoint, customFloatPositionPane, WIDTH, HEIGHT) { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void updateContentPane() { |
|
|
|
public void updateContentPane() { |
|
|
|
parent.attributeChanged(); |
|
|
|
parent.attributeChanged(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
pane.show(VanChartPlotLegendPane.this, null); |
|
|
|
} |
|
|
|
|
|
|
|
uiBubbleFloatPane.show(VanChartPlotLegendPane.this, null); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -309,19 +311,19 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
// return limitPane;
|
|
|
|
// return limitPane;
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createHighlightPane(){ |
|
|
|
private JPanel createHighlightPane() { |
|
|
|
highlightButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); |
|
|
|
highlightButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); |
|
|
|
highlightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight")); |
|
|
|
highlightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Highlight")); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
double[] columnSize = {f, e}; |
|
|
|
double[] columnSize = {f, e}; |
|
|
|
double[] rowSize = {p,p}; |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null,null}, |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{highlightLabel, highlightButton} |
|
|
|
new Component[]{highlightLabel, highlightButton} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); |
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void checkAllUse() { |
|
|
|
protected void checkAllUse() { |
|
|
@ -368,6 +370,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 标题 |
|
|
|
* 标题 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 标题 |
|
|
|
* @return 标题 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public String title4PopupWindow() { |
|
|
|
public String title4PopupWindow() { |
|
|
@ -375,7 +378,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void updateBean(VanChartLegend legend) { |
|
|
|
public void updateBean(VanChartLegend legend) { |
|
|
|
if(legend == null) { |
|
|
|
if (legend == null) { |
|
|
|
legend = new VanChartLegend(); |
|
|
|
legend = new VanChartLegend(); |
|
|
|
} |
|
|
|
} |
|
|
|
legend.setLegendVisible(isLegendVisible.isSelected()); |
|
|
|
legend.setLegendVisible(isLegendVisible.isSelected()); |
|
|
@ -383,7 +386,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
borderPane.update(legend); |
|
|
|
borderPane.update(legend); |
|
|
|
backgroundPane.update(legend); |
|
|
|
backgroundPane.update(legend); |
|
|
|
|
|
|
|
|
|
|
|
if(!customFloatPositionButton.isSelected()){ |
|
|
|
if (!customFloatPositionButton.isSelected()) { |
|
|
|
legend.setPosition(location.getSelectedItem()); |
|
|
|
legend.setPosition(location.getSelectedItem()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
legend.setPosition(-1); |
|
|
|
legend.setPosition(-1); |
|
|
@ -397,7 +400,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
//legend.setLimitAttribute(limitPane.updateBean());
|
|
|
|
//legend.setLimitAttribute(limitPane.updateBean());
|
|
|
|
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); |
|
|
|
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); |
|
|
|
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); |
|
|
|
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); |
|
|
|
if(highlightButton != null && highlightButton.getSelectedItem() != null){ |
|
|
|
if (highlightButton != null && highlightButton.getSelectedItem() != null) { |
|
|
|
legend.setHighlight(highlightButton.getSelectedItem()); |
|
|
|
legend.setHighlight(highlightButton.getSelectedItem()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -408,7 +411,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
textAttrPane.populate(legend.getFRFont()); |
|
|
|
textAttrPane.populate(legend.getFRFont()); |
|
|
|
borderPane.populate(legend); |
|
|
|
borderPane.populate(legend); |
|
|
|
backgroundPane.populate(legend); |
|
|
|
backgroundPane.populate(legend); |
|
|
|
if(!legend.isFloating()){ |
|
|
|
if (!legend.isFloating()) { |
|
|
|
location.setSelectedItem(legend.getPosition()); |
|
|
|
location.setSelectedItem(legend.getPosition()); |
|
|
|
} |
|
|
|
} |
|
|
|
customFloatPositionButton.setSelected(legend.isFloating()); |
|
|
|
customFloatPositionButton.setSelected(legend.isFloating()); |
|
|
@ -420,7 +423,7 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
maxProportion.setValue(legend.getMaxHeight()); |
|
|
|
maxProportion.setValue(legend.getMaxHeight()); |
|
|
|
//区域显示策略 恢复用注释。取消注释。
|
|
|
|
//区域显示策略 恢复用注释。取消注释。
|
|
|
|
//limitPane.populateBean(legend.getLimitAttribute());
|
|
|
|
//limitPane.populateBean(legend.getLimitAttribute());
|
|
|
|
if(highlightButton != null){ |
|
|
|
if (highlightButton != null) { |
|
|
|
highlightButton.setSelectedItem(legend.isHighlight()); |
|
|
|
highlightButton.setSelectedItem(legend.isHighlight()); |
|
|
|
boolean largeDataModel = PlotFactory.largeDataModel(plot); |
|
|
|
boolean largeDataModel = PlotFactory.largeDataModel(plot); |
|
|
|
highlightButton.setEnabled(!largeDataModel); |
|
|
|
highlightButton.setEnabled(!largeDataModel); |
|
|
|