@ -1,12 +1,14 @@
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.Style ;
import com.fr.base.Utils ;
import com.fr.chart.base.ChartBaseUtils ;
import com.fr.chart.base.TextAttr ;
import com.fr.chart.chartattr.Axis ;
import com.fr.design.constants.LayoutConstants ;
import com.fr.design.dialog.BasicPane ;
import com.fr.design.event.UIObserver ;
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.itextfield.UITextField ;
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.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.ActionListener ;
import java.awt.event.ItemEvent ;
@ -155,33 +159,26 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
}
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 [ ] [ ] {
new Component [ ] { null , new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Chart_Axis_Label_Show" ) ) , showWay , null } ,
new Component [ ] { null , new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_StyleAlignment_Text_Rotation" ) ) , labelOrientationChoose , null } ,
new Component [ ] { null , orientationSpinner , orientationBar , null } ,
new Component [ ] { null , textAttrPane , null , null } ,
new Component [ ] { new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Chart_Axis_Label_Show" ) ) , showWay } ,
new Component [ ] { new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_StyleAlignment_Text_Rotation" ) ) , labelOrientationChoose } ,
new Component [ ] { null , createorientionRow ( ) } ,
new Component [ ] { textAttrPane , null , null } ,
} ;
return TableLayoutHelper . createTableLayoutPane ( components , rowSize , columnSize ) ;
return FineLayoutBuilder . compatibleTableLayout ( 10 , components , new double [ ] { 1 . 2 , 3 } ) ;
}
private JPanel getIntervalShowWayPane ( ) {
double p = TableLayout . PREFERRED ;
double f = TableLayout . FILL ;
double [ ] columnSize = { f } ;
double [ ] rowSize = { p , p , p } ;
private Row createorientionRow ( ) {
return FineLayoutBuilder . createHorizontalLayout ( 10 , new double [ ] { 1 , 1 . 5 } , orientationSpinner , orientationBar ) ;
}
private JPanel getIntervalShowWayPane ( ) {
Component [ ] [ ] components = new Component [ ] [ ] {
new Component [ ] { getCombox ( ) } ,
new Component [ ] { getTowChoose ( ) } ,
new Component [ ] { getOther ( ) }
} ;
return TableLayoutHelper . createTableLayoutPane ( components , rowSize , columnSize ) ;
return FineLayoutBuilder . compatibleTableLayout ( 10 , components , new double [ ] { 1 } ) ;
}
private JPanel getTowChoose ( ) {
@ -192,46 +189,30 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
custom . setSelected ( false ) ;
customLabelSamleTime . setVisible ( true ) ;
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 [ ] [ ] {
new Component [ ] { custom , customLabelSamleTime , null } ,
} , new double [ ] { p } , new double [ ] { p , p , f } ) ;
JPanel customPane = FineLayoutBuilder . createHorizontalLayout ( 10 , custom , customLabelSamleTime ) ;
Component [ ] [ ] components = new Component [ ] [ ] {
new Component [ ] { null , auto , } ,
new Component [ ] { null , customPane }
new Component [ ] { auto , } ,
new Component [ ] { customPane }
} ;
return TableLayoutHelper . createTableLayoutPane ( components , rowSize , columnSize ) ;
return FineLayoutBuilder . compatibleTableLayout ( 10 , components , new double [ ] { 1 } ) ;
}
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 [ ] [ ] {
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 ( ) {
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 [ ] [ ] {
new Component [ ] { null , new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_StyleAlignment_Text_Rotation" ) ) , labelOrientationChoose , null } ,
new Component [ ] { null , orientationSpinner , orientationBar , null } ,
new Component [ ] { null , textAttrPane , null , null } ,
new Component [ ] { new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_StyleAlignment_Text_Rotation" ) ) , labelOrientationChoose } ,
new Component [ ] { null , createorientionRow ( ) } ,
new Component [ ] { textAttrPane , null , null } ,
} ;
return TableLayoutHelper . createTableLayoutPane ( components , rowSize , columnSize ) ;
return FineLayoutBuilder . compatibleTableLayout ( 10 , components , new double [ ] { 1 . 2 , 3 } ) ;
}
private void checkShowWay ( ) {
@ -246,18 +227,13 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
} else {
labelPane = getWrapShowWayPane ( ) ;
}
double p = TableLayout . PREFERRED ;
double f = TableLayout . FILL ;
double [ ] row = { p , p } ;
double [ ] col = { f } ;
showWayPane = TableLayoutHelper . createTableLayoutPane ( new Component [ ] [ ] {
new Component [ ] { isLabelShow } , new Component [ ] { labelPane } } , row , col ) ;
labelPane . setBorder ( new ScaledEmptyBorder ( 0 , 10 , 0 , 0 ) ) ;
showWayPane = FineLayoutBuilder . createVerticalLayout ( 10 , isLabelShow , labelPane ) ;
this . add ( showWayPane , BorderLayout . CENTER ) ;
this . validate ( ) ;
}
private void checkOrientationField ( ) {
if ( labelOrientationChoose . getSelectedIndex ( ) ! = 2 ) {
orientationBar . setVisible ( false ) ;
@ -283,23 +259,17 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
customLabelSamleTime . registerChangeListener ( this . observerListener ) ;
orientationSpinner . 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 [ ] [ ] {
new Component [ ] { null , new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Chart_Label_Interval" ) ) , labelSampleChoose , customLabelSamleTime } ,
new Component [ ] { null , new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_StyleAlignment_Text_Rotation" ) ) , labelOrientationChoose , null } ,
new Component [ ] { null , orientationSpinner , orientationBar , null } ,
new Component [ ] { null , textAttrPane , null , null } ,
new Component [ ] { new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Chart_Label_Interval" ) ) ,
FineLayoutBuilder . createHorizontalLayout ( 10 , labelSampleChoose , customLabelSamleTime ) } ,
new Component [ ] { new UILabel ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_StyleAlignment_Text_Rotation" ) ) , labelOrientationChoose } ,
new Component [ ] { null , createorientionRow ( ) } ,
new Component [ ] { textAttrPane , null } ,
} ;
labelPane = TableLayoutHelper . createTableLayoutPane ( components , rowSize , columnSize ) ;
double [ ] row = { p , p } ;
double [ ] col = { f } ;
return TableLayoutHelper . createTableLayoutPane ( new Component [ ] [ ] {
new Component [ ] { isLabelShow } , new Component [ ] { labelPane } } , row , col ) ;
labelPane = FineLayoutBuilder . commonLeftRightLayout ( components ) ;
labelPane . setBorder ( new ScaledEmptyBorder ( 0 , 10 , 0 , 0 ) ) ;
return FineLayoutBuilder . createVerticalLayout ( 10 , isLabelShow , labelPane ) ;
}
private void checkCustomSampleField ( ) {