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