@ -32,9 +32,6 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private static final int PREFERRED_WIDTH = 100 ;
private static final int PREFERRED_WIDTH = 100 ;
protected ColorSelectBox horizontalGridLine ;
protected ColorSelectBox verticalGridLine ;
protected AlertLineListControlPane alertLine ;
protected AlertLineListControlPane alertLine ;
private UIButtonGroup isDefaultIntervalBackground ;
private UIButtonGroup isDefaultIntervalBackground ;
@ -44,8 +41,10 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private ColorSelectBox verticalColorBackground ;
private ColorSelectBox verticalColorBackground ;
protected BackgroundListControlPane customIntervalBackground ;
protected BackgroundListControlPane customIntervalBackground ;
private LineTypeComboBox horizonLineType ; //横向线型
private LineTypeComboBox horizonLineType ;
private LineTypeComboBox verticalLineType ; //纵向线型
private LineTypeComboBox verticalLineType ;
private ColorSelectBox horizontalColorBox ;
private ColorSelectBox verticalColorBox ;
private JPanel horizontalColorPane ;
private JPanel horizontalColorPane ;
private JPanel verticalColorPane ;
private JPanel verticalColorPane ;
@ -53,9 +52,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
initComponents ( ) ;
initComponents ( ) ;
}
}
protected void initComponents ( ) {
private void initComponents ( ) {
horizontalGridLine = new ColorSelectBox ( PREFERRED_WIDTH ) ;
horizontalColorBox = new ColorSelectBox ( PREFERRED_WIDTH ) ;
verticalGridLine = new ColorSelectBox ( PREFERRED_WIDTH ) ;
verticalColorBox = new ColorSelectBox ( PREFERRED_WIDTH ) ;
horizonLineType = new LineTypeComboBox ( new LineType [ ] { LineType . NONE , LineType . SOLID , LineType . DASHED } ) ;
horizonLineType = new LineTypeComboBox ( new LineType [ ] { LineType . NONE , LineType . SOLID , LineType . DASHED } ) ;
verticalLineType = new LineTypeComboBox ( new LineType [ ] { LineType . NONE , LineType . SOLID , LineType . DASHED } ) ;
verticalLineType = new LineTypeComboBox ( new LineType [ ] { LineType . NONE , LineType . SOLID , LineType . DASHED } ) ;
@ -77,23 +76,33 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
}
}
protected JPanel createGridLinePane ( ) {
protected JPanel createGridLinePane ( ) {
initGridLineComponents ( ) ;
JPanel panel = new JPanel ( new BorderLayout ( 0 , 4 ) ) ;
panel . add ( createSingleGridLinePane ( Toolkit . i18nText ( "Fine-Design_Chart_Direction_Horizontal" ) , true ) , BorderLayout . NORTH ) ;
panel . add ( createSingleGridLinePane ( Toolkit . i18nText ( "Fine-Design_Chart_Direction_Vertical" ) , false ) , BorderLayout . CENTER ) ;
return TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Grid_Line" ) , panel ) ;
}
protected void initGridLineComponents ( ) {
Component [ ] [ ] upComponent = new Component [ ] [ ] {
Component [ ] [ ] upComponent = new Component [ ] [ ] {
new Component [ ] { null , null } ,
new Component [ ] { null , null } ,
new Component [ ] { null , horizontalGridLine }
new Component [ ] { null , horizontalColorBox }
} ;
} ;
horizontalColorPane = TableLayout4VanChartHelper . createGapTableLayoutPane ( upComponent ) ;
horizontalColorPane = TableLayout4VanChartHelper . createGapTableLayoutPane ( upComponent ) ;
Component [ ] [ ] downComponent = new Component [ ] [ ] {
Component [ ] [ ] downComponent = new Component [ ] [ ] {
new Component [ ] { null , null } ,
new Component [ ] { null , null } ,
new Component [ ] { null , verticalGridLine }
new Component [ ] { null , verticalColorBox }
} ;
} ;
verticalColorPane = TableLayout4VanChartHelper . createGapTableLayoutPane ( downComponent ) ;
verticalColorPane = TableLayout4VanChartHelper . createGapTableLayoutPane ( downComponent ) ;
horizonLineType . addActionListener ( new ActionListener ( ) {
horizonLineType . addActionListener ( new ActionListener ( ) {
@Override
@Override
public void actionPerformed ( ActionEvent e ) {
public void actionPerformed ( ActionEvent e ) {
if ( horizontalGridLine = = null | | horizonLineType = = null ) {
if ( horizontalColorBox = = null | | horizonLineType = = null ) {
return ;
return ;
}
}
horizontalColorPane . setVisible ( horizonLineType . getSelectedItem ( ) ! = LineType . NONE ) ;
horizontalColorPane . setVisible ( horizonLineType . getSelectedItem ( ) ! = LineType . NONE ) ;
@ -103,7 +112,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
verticalLineType . addActionListener ( new ActionListener ( ) {
verticalLineType . addActionListener ( new ActionListener ( ) {
@Override
@Override
public void actionPerformed ( ActionEvent e ) {
public void actionPerformed ( ActionEvent e ) {
if ( verticalGridLine = = null | | verticalLineType = = null ) {
if ( verticalColorBox = = null | | verticalLineType = = null ) {
return ;
return ;
}
}
verticalColorPane . setVisible ( verticalLineType . getSelectedItem ( ) ! = LineType . NONE ) ;
verticalColorPane . setVisible ( verticalLineType . getSelectedItem ( ) ! = LineType . NONE ) ;
@ -111,22 +120,20 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
} ) ;
} ) ;
checkColorBoxVisible ( ) ;
checkColorBoxVisible ( ) ;
}
JPanel horizonLineTypePane = TableLayout4VanChartHelper . createGapTableLayoutPane ( Toolkit . i18nText ( "Fine-Design_Chart_Direction_Horizontal" ) , horizonLineType ) ;
protected JPanel createSingleGridLinePane ( String title , boolean isHorizontal ) {
JPanel horizontal = new JPanel ( new BorderLayout ( ) ) ;
LineTypeComboBox lineTypeComboBox = isHorizontal ? horizonLineType : verticalLineType ;
horizontal . add ( horizonLineTypePane , BorderLayout . NORTH ) ;
JPanel colorSelectPane = isHorizontal ? horizontalColorPane : verticalColorPane ;
horizontal . add ( horizontalColorPane , BorderLayout . CENTER ) ;
JPanel verticalLineTypePane = TableLayout4VanChartHelper . createGapTableLayoutPane ( Toolkit . i18nText ( "Fine-Design_Chart_Direction_Vertical" ) , verticalLineType ) ;
JPanel lineTypePane = TableLayout4VanChartHelper . createGapTableLayoutPane ( title , lineTypeComboBox ) ;
JPanel vertical = new JPanel ( new BorderLayout ( ) ) ;
vertical . add ( verticalLineTypePane , BorderLayout . NORTH ) ;
vertical . add ( verticalColorPane , BorderLayout . CENTER ) ;
JPanel panel = new JPanel ( new BorderLayout ( 0 , 4 ) ) ;
JPanel singleGridLinePane = new JPanel ( new BorderLayout ( ) ) ;
panel . add ( horizontal , BorderLayout . NORTH ) ;
panel . add ( vertical , BorderLayout . CENTER ) ;
return TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Grid_Line" ) , panel ) ;
singleGridLinePane . add ( lineTypePane , BorderLayout . NORTH ) ;
singleGridLinePane . add ( colorSelectPane , BorderLayout . CENTER ) ;
return singleGridLinePane ;
}
}
protected JPanel createAlertLinePane ( ) {
protected JPanel createAlertLinePane ( ) {
@ -213,12 +220,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
VanChartAxis defaultYAxis = rectanglePlot . getDefaultYAxis ( ) ;
VanChartAxis defaultYAxis = rectanglePlot . getDefaultYAxis ( ) ;
if ( defaultXAxis ! = null ) {
if ( defaultXAxis ! = null ) {
verticalGridLine . setSelectObject ( defaultXAxis . getMainGridColor ( ) ) ;
verticalColorBox . setSelectObject ( defaultXAxis . getMainGridColor ( ) ) ;
verticalLineType . setSelectedItem ( defaultXAxis . getGridLineType ( ) ) ;
verticalLineType . setSelectedItem ( defaultXAxis . getGridLineType ( ) ) ;
}
}
if ( defaultYAxis ! = null ) {
if ( defaultYAxis ! = null ) {
horizontalGridLine . setSelectObject ( defaultYAxis . getMainGridColor ( ) ) ;
horizontalColorBox . setSelectObject ( defaultYAxis . getMainGridColor ( ) ) ;
horizonLineType . setSelectedItem ( defaultYAxis . getGridLineType ( ) ) ;
horizonLineType . setSelectedItem ( defaultYAxis . getGridLineType ( ) ) ;
}
}
}
}
@ -246,12 +253,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
VanChartAxis defaultYAxis = rectanglePlot . getDefaultYAxis ( ) ;
VanChartAxis defaultYAxis = rectanglePlot . getDefaultYAxis ( ) ;
if ( defaultXAxis ! = null ) {
if ( defaultXAxis ! = null ) {
defaultXAxis . setMainGridColor ( verticalGridLine . getSelectObject ( ) ) ;
defaultXAxis . setMainGridColor ( verticalColorBox . getSelectObject ( ) ) ;
defaultXAxis . setGridLineType ( ( LineType ) verticalLineType . getSelectedItem ( ) ) ;
defaultXAxis . setGridLineType ( ( LineType ) verticalLineType . getSelectedItem ( ) ) ;
}
}
if ( defaultYAxis ! = null ) {
if ( defaultYAxis ! = null ) {
defaultYAxis . setMainGridColor ( horizontalGridLine . getSelectObject ( ) ) ;
defaultYAxis . setMainGridColor ( horizontalColorBox . getSelectObject ( ) ) ;
defaultYAxis . setGridLineType ( ( LineType ) horizonLineType . getSelectedItem ( ) ) ;
defaultYAxis . setGridLineType ( ( LineType ) horizonLineType . getSelectedItem ( ) ) ;
}
}
}
}