|
|
|
@ -1,11 +1,12 @@
|
|
|
|
|
package com.fr.van.chart.designer.style.axis.gauge; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineLayoutBuilder; |
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
import com.fr.chart.base.TextAttr; |
|
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
|
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.PaneTitleConstants; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto; |
|
|
|
@ -17,12 +18,10 @@ import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis;
|
|
|
|
|
import com.fr.plugin.chart.gauge.VanChartGaugePlot; |
|
|
|
|
import com.fr.plugin.chart.type.FontAutoType; |
|
|
|
|
import com.fr.plugin.chart.type.GaugeStyle; |
|
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
|
import com.fr.van.chart.designer.style.axis.VanChartValueAxisPane; |
|
|
|
|
import com.fr.van.chart.designer.style.axis.component.VanChartMinMaxValuePane; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
@ -49,20 +48,16 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
|
|
|
|
|
if (gaugeStyle == null) { |
|
|
|
|
gaugeStyle = GaugeStyle.POINTER; |
|
|
|
|
} |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] columnSize = {f, p}; |
|
|
|
|
double[] rowSize = {p, p, p, p, p, p, p, p}; |
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(getPanelComponents(p, f, columnSize), rowSize, columnSize); |
|
|
|
|
return FineLayoutBuilder.compatibleTableLayout(0, getPanelComponents(), new double[]{1}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Component[][] getPanelComponents(double p, double f, double[] columnSize) { |
|
|
|
|
private Component[][] getPanelComponents() { |
|
|
|
|
switch (gaugeStyle) { |
|
|
|
|
case THERMOMETER: |
|
|
|
|
return new Component[][]{ |
|
|
|
|
new Component[]{createLabelPane(new double[]{p, p}, columnSize), null}, |
|
|
|
|
new Component[]{createLabelPane(), null}, |
|
|
|
|
new Component[]{createValueDefinition(), null}, |
|
|
|
|
new Component[]{createTickColorPane(new double[]{p, p, p}, new double[]{p, f}), null}, |
|
|
|
|
new Component[]{createTickColorPane(), null}, |
|
|
|
|
new Component[]{createValueStylePane()}, |
|
|
|
|
}; |
|
|
|
|
case RING: |
|
|
|
@ -75,21 +70,21 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
|
|
|
|
|
}; |
|
|
|
|
default: |
|
|
|
|
return new Component[][]{ |
|
|
|
|
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, |
|
|
|
|
new Component[]{createLabelPane(), null}, |
|
|
|
|
new Component[]{createValueDefinition(), null}, |
|
|
|
|
new Component[]{createValueStylePane()}, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createLabelPane(double[] row, double[] col) { |
|
|
|
|
protected JPanel createLabelPane() { |
|
|
|
|
showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); |
|
|
|
|
labelTextAttrPane = getChartTextAttrPane(); |
|
|
|
|
labelContentPane = new JPanel(new BorderLayout()); |
|
|
|
|
labelContentPane.add(labelTextAttrPane); |
|
|
|
|
labelContentPane.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0)); |
|
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 6)); |
|
|
|
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel), BorderLayout.NORTH); |
|
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10))); |
|
|
|
|
panel.add(FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, |
|
|
|
|
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label")), showLabel), BorderLayout.NORTH); |
|
|
|
|
panel.add(labelContentPane, BorderLayout.CENTER); |
|
|
|
|
showLabel.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
@ -97,9 +92,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
|
|
|
|
|
checkLabelPane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); |
|
|
|
|
return jPanel; |
|
|
|
|
return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected ChartTextAttrPane getChartTextAttrPane() { |
|
|
|
@ -149,20 +142,18 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
|
|
|
|
|
minMaxValuePane = new VanChartMinMaxValuePane(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), minMaxValuePane); |
|
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), minMaxValuePane, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createTickColorPane(double[] row, double[] col) { |
|
|
|
|
private JPanel createTickColorPane() { |
|
|
|
|
mainTickColor = new ColorSelectBox(100); |
|
|
|
|
secTickColor = new ColorSelectBox(100); |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTickColor}, |
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secTickColor}, |
|
|
|
|
}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); |
|
|
|
|
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); |
|
|
|
|
return jPanel; |
|
|
|
|
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
|
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isMulti(GaugeStyle style) { |
|
|
|
|