|
|
@ -1,12 +1,14 @@ |
|
|
|
package com.fr.design.mainframe.chart.gui.style; |
|
|
|
package com.fr.design.mainframe.chart.gui.style; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fine.swing.ui.layout.Row; |
|
|
|
|
|
|
|
import com.fine.theme.utils.FineLayoutBuilder; |
|
|
|
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
import com.fr.base.BaseFormula; |
|
|
|
import com.fr.base.BaseFormula; |
|
|
|
import com.fr.base.Style; |
|
|
|
import com.fr.base.Style; |
|
|
|
import com.fr.base.Utils; |
|
|
|
import com.fr.base.Utils; |
|
|
|
import com.fr.chart.base.ChartBaseUtils; |
|
|
|
import com.fr.chart.base.ChartBaseUtils; |
|
|
|
import com.fr.chart.base.TextAttr; |
|
|
|
import com.fr.chart.base.TextAttr; |
|
|
|
import com.fr.chart.chartattr.Axis; |
|
|
|
import com.fr.chart.chartattr.Axis; |
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.event.UIObserver; |
|
|
|
import com.fr.design.event.UIObserver; |
|
|
|
import com.fr.design.event.UIObserverListener; |
|
|
|
import com.fr.design.event.UIObserverListener; |
|
|
@ -16,14 +18,16 @@ import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ispinner.UIBasicSpinner; |
|
|
|
import com.fr.design.gui.ispinner.UIBasicSpinner; |
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
import com.fr.design.gui.style.NumberDragBar; |
|
|
|
import com.fr.design.gui.style.NumberDragBar; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import javax.swing.SpinnerNumberModel; |
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.Component; |
|
|
|
|
|
|
|
import java.awt.Container; |
|
|
|
|
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ItemEvent; |
|
|
|
import java.awt.event.ItemEvent; |
|
|
@ -155,33 +159,26 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel getWrapShowWayPane() { |
|
|
|
private JPanel getWrapShowWayPane() { |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, p, f}; |
|
|
|
|
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), showWay, null}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), showWay}, |
|
|
|
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose, null}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose}, |
|
|
|
new Component[]{null, orientationSpinner, orientationBar, null}, |
|
|
|
new Component[]{null, createorientionRow()}, |
|
|
|
new Component[]{null, textAttrPane, null, null}, |
|
|
|
new Component[]{textAttrPane, null, null}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel getIntervalShowWayPane() { |
|
|
|
private Row createorientionRow() { |
|
|
|
|
|
|
|
return FineLayoutBuilder.createHorizontalLayout(10, new double[]{1, 1.5}, orientationSpinner, orientationBar); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
} |
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double[] columnSize = {f}; |
|
|
|
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel getIntervalShowWayPane() { |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{getCombox()}, |
|
|
|
new Component[]{getCombox()}, |
|
|
|
new Component[]{getTowChoose()}, |
|
|
|
new Component[]{getTowChoose()}, |
|
|
|
new Component[]{getOther()} |
|
|
|
new Component[]{getOther()} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel getTowChoose() { |
|
|
|
private JPanel getTowChoose() { |
|
|
@ -192,46 +189,30 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{ |
|
|
|
custom.setSelected(false); |
|
|
|
custom.setSelected(false); |
|
|
|
customLabelSamleTime.setVisible(true); |
|
|
|
customLabelSamleTime.setVisible(true); |
|
|
|
customLabelSamleTime.setEnabled(false); |
|
|
|
customLabelSamleTime.setEnabled(false); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, f}; |
|
|
|
|
|
|
|
double[] rowSize = {p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel customPane = TableLayoutHelper.createTableLayoutPane(new Component[][]{ |
|
|
|
JPanel customPane = FineLayoutBuilder.createHorizontalLayout(10, custom, customLabelSamleTime); |
|
|
|
new Component[]{custom, customLabelSamleTime, null}, |
|
|
|
|
|
|
|
}, new double[]{p}, new double[]{p, p, f}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null, auto,}, |
|
|
|
new Component[]{auto,}, |
|
|
|
new Component[]{null, customPane} |
|
|
|
new Component[]{customPane} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel getCombox() { |
|
|
|
private JPanel getCombox() { |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, p, f}; |
|
|
|
|
|
|
|
double[] rowSize = {p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), showWay, null} |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), showWay} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return FineLayoutBuilder.commonLeftRightLayout(components); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel getOther() { |
|
|
|
private JPanel getOther() { |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, p, f}; |
|
|
|
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose, null}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose}, |
|
|
|
new Component[]{null, orientationSpinner, orientationBar, null}, |
|
|
|
new Component[]{null, createorientionRow()}, |
|
|
|
new Component[]{null, textAttrPane, null, null}, |
|
|
|
new Component[]{textAttrPane, null, null}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkShowWay() { |
|
|
|
private void checkShowWay() { |
|
|
@ -246,18 +227,13 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{ |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
labelPane = getWrapShowWayPane(); |
|
|
|
labelPane = getWrapShowWayPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0)); |
|
|
|
double f = TableLayout.FILL; |
|
|
|
showWayPane = FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane); |
|
|
|
double[] row = {p, p}; |
|
|
|
|
|
|
|
double[] col = {f}; |
|
|
|
|
|
|
|
showWayPane = TableLayoutHelper.createTableLayoutPane(new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{isLabelShow}, new Component[]{labelPane}}, row, col); |
|
|
|
|
|
|
|
this.add(showWayPane, BorderLayout.CENTER); |
|
|
|
this.add(showWayPane, BorderLayout.CENTER); |
|
|
|
this.validate(); |
|
|
|
this.validate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void checkOrientationField() { |
|
|
|
private void checkOrientationField() { |
|
|
|
if (labelOrientationChoose.getSelectedIndex() != 2) { |
|
|
|
if (labelOrientationChoose.getSelectedIndex() != 2) { |
|
|
|
orientationBar.setVisible(false); |
|
|
|
orientationBar.setVisible(false); |
|
|
@ -283,23 +259,17 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{ |
|
|
|
customLabelSamleTime.registerChangeListener(this.observerListener); |
|
|
|
customLabelSamleTime.registerChangeListener(this.observerListener); |
|
|
|
orientationSpinner.registerChangeListener(this.observerListener); |
|
|
|
orientationSpinner.registerChangeListener(this.observerListener); |
|
|
|
labelOrientationChoose.registerChangeListener(this.observerListener); |
|
|
|
labelOrientationChoose.registerChangeListener(this.observerListener); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, p, f}; |
|
|
|
|
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelSampleChoose, customLabelSamleTime}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), |
|
|
|
new Component[]{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose, null}, |
|
|
|
FineLayoutBuilder.createHorizontalLayout(10,labelSampleChoose, customLabelSamleTime)}, |
|
|
|
new Component[]{null,orientationSpinner, orientationBar, null}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose}, |
|
|
|
new Component[]{null,textAttrPane, null, null}, |
|
|
|
new Component[]{null, createorientionRow()}, |
|
|
|
|
|
|
|
new Component[]{textAttrPane, null}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
labelPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
labelPane = FineLayoutBuilder.commonLeftRightLayout(components); |
|
|
|
|
|
|
|
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0)); |
|
|
|
double[] row = {p,p}; |
|
|
|
return FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane); |
|
|
|
double[] col = {f}; |
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{isLabelShow}, new Component[]{labelPane}}, row, col); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void checkCustomSampleField() { |
|
|
|
private void checkCustomSampleField() { |
|
|
|