@ -1,7 +1,6 @@
package com.fr.van.chart.designer.style ;
import com.fr.base.BaseUtils ;
import com.fr.base.Style ;
import com.fr.chart.chartattr.Plot ;
import com.fr.design.dialog.BasicPane ;
import com.fr.design.gui.frpane.UIBubbleFloatPane ;
@ -61,6 +60,7 @@ public class VanChartPlotLegendPane extends BasicPane {
private UIButtonGroup < LayoutType > layoutButton ;
private JPanel layoutPane ;
private VanChartFloatPositionPane customFloatPositionPane ;
private UIBubbleFloatPane uiBubbleFloatPane ;
//区域显示策略 恢复用注释。下面4行删除。
private UIButtonGroup < Integer > customSize ;
@ -80,7 +80,7 @@ public class VanChartPlotLegendPane extends BasicPane {
initComponents ( ) ;
}
public VanChartPlotLegendPane ( VanChartStylePane parent ) {
public VanChartPlotLegendPane ( VanChartStylePane parent ) {
this . parent = parent ;
initComponents ( ) ;
}
@ -118,9 +118,9 @@ public class VanChartPlotLegendPane extends BasicPane {
new Component [ ] { legendPane } ,
} ;
JPanel panel = TableLayoutHelper . createTableLayoutPane ( components , row , col ) ;
JPanel panel = TableLayoutHelper . createTableLayoutPane ( components , row , col ) ;
this . setLayout ( new BorderLayout ( ) ) ;
this . add ( panel , BorderLayout . CENTER ) ;
this . add ( panel , BorderLayout . CENTER ) ;
addLegendListener ( ) ;
}
@ -133,7 +133,7 @@ public class VanChartPlotLegendPane extends BasicPane {
} ) ;
}
protected JPanel createLegendPaneWithoutHighlight ( ) {
protected JPanel createLegendPaneWithoutHighlight ( ) {
borderPane = new VanChartBorderWithRadiusPane ( ) ;
backgroundPane = new VanChartBackgroundWithOutImagePane ( ) ;
@ -141,19 +141,19 @@ public class VanChartPlotLegendPane extends BasicPane {
double f = TableLayout . FILL ;
double e = TableLayout4VanChartHelper . EDIT_AREA_WIDTH ;
double [ ] columnSize = { f , e } ;
double [ ] rowSize = { p , p , p , p , p , p , p } ;
double [ ] rowSize = { p , p , p , p , p , p , p } ;
Component [ ] [ ] components = new Component [ ] [ ] {
new Component [ ] { createTitlePositionPane ( new double [ ] { p , p , p } , columnSize ) , null } ,
new Component [ ] { createTitleStylePane ( ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Border" ) , borderPane ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Background" ) , backgroundPane ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Display_Strategy" ) , createDisplayStrategy ( ) ) , null }
new Component [ ] { createTitlePositionPane ( new double [ ] { p , p , p } , columnSize ) , null } ,
new Component [ ] { createTitleStylePane ( ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Border" ) , borderPane ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Background" ) , backgroundPane ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Display_Strategy" ) , createDisplayStrategy ( ) ) , null }
} ;
return TableLayoutHelper . createTableLayoutPane ( components , rowSize , columnSize ) ;
}
protected JPanel createLegendPane ( ) {
protected JPanel createLegendPane ( ) {
borderPane = new VanChartBorderWithRadiusPane ( ) ;
backgroundPane = new VanChartBackgroundWithOutImagePane ( ) ;
highlightPane = createHighlightPane ( ) ;
@ -166,14 +166,14 @@ public class VanChartPlotLegendPane extends BasicPane {
double f = TableLayout . FILL ;
double e = TableLayout4VanChartHelper . EDIT_AREA_WIDTH ;
double [ ] columnSize = { f , e } ;
double [ ] rowSize = { p , p , p , p , p , p , p , p } ;
double [ ] rowSize = { p , p , p , p , p , p , p , p } ;
Component [ ] [ ] components = new Component [ ] [ ] {
new Component [ ] { createTitlePositionPane ( new double [ ] { p , p , p } , columnSize ) , null } ,
new Component [ ] { createTitleStylePane ( ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Border" ) , borderPane ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Background" ) , backgroundPane ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Display_Strategy" ) , panel ) , null } ,
new Component [ ] { createTitlePositionPane ( new double [ ] { p , p , p } , columnSize ) , null } ,
new Component [ ] { createTitleStylePane ( ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Border" ) , borderPane ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Background" ) , backgroundPane ) , null } ,
new Component [ ] { TableLayout4VanChartHelper . createExpandablePaneWithTitle ( Toolkit . i18nText ( "Fine-Design_Chart_Display_Strategy" ) , panel ) , null } ,
} ;
return TableLayoutHelper . createTableLayoutPane ( components , rowSize , columnSize ) ;
}
@ -205,9 +205,9 @@ public class VanChartPlotLegendPane extends BasicPane {
customFloatPositionButton . setEventBannded ( true ) ;
Component [ ] [ ] components = new Component [ ] [ ] {
new Component [ ] { null , null } ,
new Component [ ] { new UILabel ( Toolkit . i18nText ( "Fine-Design_Chart_Layout_Position" ) ) , location } ,
new Component [ ] { null , customFloatPositionButton }
new Component [ ] { null , null } ,
new Component [ ] { new UILabel ( Toolkit . i18nText ( "Fine-Design_Chart_Layout_Position" ) ) , location } ,
new Component [ ] { null , customFloatPositionButton }
} ;
customFloatPositionPane = new VanChartFloatPositionPane ( ) ;
@ -241,7 +241,7 @@ public class VanChartPlotLegendPane extends BasicPane {
return TableLayout4VanChartHelper . createGapTableLayoutPane ( components , new double [ ] { p , p } , new double [ ] { f , e } ) ;
}
private void initPositionListener ( ) {
private void initPositionListener ( ) {
location . addChangeListener ( new ChangeListener ( ) {
@Override
@ -262,18 +262,20 @@ public class VanChartPlotLegendPane extends BasicPane {
checkLayoutPaneVisible ( ) ;
checkDisplayStrategyUse ( ) ;
if ( customFloatPositionPane = = null ) {
if ( customFloatPositionPane = = null ) {
customFloatPositionPane = new VanChartFloatPositionPane ( ) ;
}
if ( uiBubbleFloatPane = = null ) {
Point comPoint = customFloatPositionButton . getLocationOnScreen ( ) ;
Point arrowPoint = new Point ( comPoint . x + customFloatPositionButton . getWidth ( ) / 2 - GAP , comPoint . y + customFloatPositionButton . getHeight ( ) ) ;
UIBubbleFloatPane < Style > p ane = new UIBubbleFloatPane ( Constants . TOP , arrowPoint , customFloatPositionPane , WIDTH , HEIGHT ) {
Point arrowPoint = new Point ( comPoint . x + customFloatPositionButton . getWidth ( ) / 2 - GAP , comPoint . y + customFloatPositionButton . getHeight ( ) ) ;
uiBubbleFloatP ane = new UIBubbleFloatPane ( Constants . TOP , arrowPoint , customFloatPositionPane , WIDTH , HEIGHT ) {
@Override
public void updateContentPane ( ) {
parent . attributeChanged ( ) ;
}
} ;
pane . show ( VanChartPlotLegendPane . this , null ) ;
}
uiBubbleFloatPane . show ( VanChartPlotLegendPane . this , null ) ;
}
} ) ;
}
@ -309,19 +311,19 @@ public class VanChartPlotLegendPane extends BasicPane {
// return limitPane;
}
private JPanel createHighlightPane ( ) {
private JPanel createHighlightPane ( ) {
highlightButton = new UIButtonGroup < > ( new String [ ] { Toolkit . i18nText ( "Fine-Design_Chart_On" ) , Toolkit . i18nText ( "Fine-Design_Chart_Off" ) } , new Boolean [ ] { true , false } ) ;
highlightLabel = new UILabel ( Toolkit . i18nText ( "Fine-Design_Chart_Highlight" ) ) ;
double p = TableLayout . PREFERRED ;
double f = TableLayout . FILL ;
double e = TableLayout4VanChartHelper . EDIT_AREA_WIDTH ;
double [ ] columnSize = { f , e } ;
double [ ] rowSize = { p , p } ;
double [ ] rowSize = { p , p } ;
Component [ ] [ ] components = new Component [ ] [ ] {
new Component [ ] { null , null } ,
new Component [ ] { null , null } ,
new Component [ ] { highlightLabel , highlightButton }
} ;
return TableLayout4VanChartHelper . createGapTableLayoutPane ( components , rowSize , columnSize ) ;
return TableLayout4VanChartHelper . createGapTableLayoutPane ( components , rowSize , columnSize ) ;
}
protected void checkAllUse ( ) {
@ -368,6 +370,7 @@ public class VanChartPlotLegendPane extends BasicPane {
/ * *
* 标题
*
* @return 标题
* /
public String title4PopupWindow ( ) {
@ -375,7 +378,7 @@ public class VanChartPlotLegendPane extends BasicPane {
}
public void updateBean ( VanChartLegend legend ) {
if ( legend = = null ) {
if ( legend = = null ) {
legend = new VanChartLegend ( ) ;
}
legend . setLegendVisible ( isLegendVisible . isSelected ( ) ) ;
@ -383,7 +386,7 @@ public class VanChartPlotLegendPane extends BasicPane {
borderPane . update ( legend ) ;
backgroundPane . update ( legend ) ;
if ( ! customFloatPositionButton . isSelected ( ) ) {
if ( ! customFloatPositionButton . isSelected ( ) ) {
legend . setPosition ( location . getSelectedItem ( ) ) ;
} else {
legend . setPosition ( - 1 ) ;
@ -397,7 +400,7 @@ public class VanChartPlotLegendPane extends BasicPane {
//legend.setLimitAttribute(limitPane.updateBean());
legend . setFloatPercentX ( customFloatPositionPane . getFloatPosition_x ( ) ) ;
legend . setFloatPercentY ( customFloatPositionPane . getFloatPosition_y ( ) ) ;
if ( highlightButton ! = null & & highlightButton . getSelectedItem ( ) ! = null ) {
if ( highlightButton ! = null & & highlightButton . getSelectedItem ( ) ! = null ) {
legend . setHighlight ( highlightButton . getSelectedItem ( ) ) ;
}
}
@ -408,7 +411,7 @@ public class VanChartPlotLegendPane extends BasicPane {
textAttrPane . populate ( legend . getFRFont ( ) ) ;
borderPane . populate ( legend ) ;
backgroundPane . populate ( legend ) ;
if ( ! legend . isFloating ( ) ) {
if ( ! legend . isFloating ( ) ) {
location . setSelectedItem ( legend . getPosition ( ) ) ;
}
customFloatPositionButton . setSelected ( legend . isFloating ( ) ) ;
@ -420,7 +423,7 @@ public class VanChartPlotLegendPane extends BasicPane {
maxProportion . setValue ( legend . getMaxHeight ( ) ) ;
//区域显示策略 恢复用注释。取消注释。
//limitPane.populateBean(legend.getLimitAttribute());
if ( highlightButton ! = null ) {
if ( highlightButton ! = null ) {
highlightButton . setSelectedItem ( legend . isHighlight ( ) ) ;
boolean largeDataModel = PlotFactory . largeDataModel ( plot ) ;
highlightButton . setEnabled ( ! largeDataModel ) ;