@ -16,14 +16,6 @@ import com.fr.design.gui.chart.ChartEditPaneProvider;
import com.fr.design.gui.frpane.UITitlePanel ;
import com.fr.design.gui.frpane.UITitlePanel ;
import com.fr.design.mainframe.chart.ChartEditPane ;
import com.fr.design.mainframe.chart.ChartEditPane ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.general.GeneralContext ;
import com.fr.plugin.context.PluginContext ;
import com.fr.plugin.injectable.PluginModule ;
import com.fr.plugin.manage.PluginFilter ;
import com.fr.plugin.observer.PluginEvent ;
import com.fr.plugin.observer.PluginEventListener ;
import com.fr.plugin.observer.PluginEventType ;
import com.fr.stable.AssistUtils ;
import javax.swing.BorderFactory ;
import javax.swing.BorderFactory ;
import javax.swing.Icon ;
import javax.swing.Icon ;
@ -43,12 +35,8 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
protected ChartEditPane chartEditPane ;
protected ChartEditPane chartEditPane ;
//ID一样的话 不用新建chartEditPane
private String currentID ;
private ChartPropertyPane ( ) {
private ChartPropertyPane ( ) {
initComponent ( ) ;
initComponent ( ) ;
addListener ( ) ;
}
}
protected void initComponent ( ) {
protected void initComponent ( ) {
@ -56,33 +44,11 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
this . setBorder ( BorderFactory . createEmptyBorder ( 10 , 0 , 0 , 0 ) ) ;
this . setBorder ( BorderFactory . createEmptyBorder ( 10 , 0 , 0 , 0 ) ) ;
}
}
private void addListener ( ) {
GeneralContext . listenPlugin ( PluginEventType . AfterRun , new PluginEventListener ( ) {
@Override
public void on ( PluginEvent event ) {
//禁用启用图表插件 这边id置空。这样展示图表配置属性不管和上一个id是否一样 都新建chartEditPane
currentID = null ;
}
} , new PluginFilter ( ) {
@Override
public boolean accept ( PluginContext context ) {
return context . contain ( PluginModule . ExtraChartDesign ) ;
}
} ) ;
}
@Override
@Override
public void updateChartEditPane ( String plotID ) {
public void updateChartEditPane ( String plotID ) {
if ( ! AssistUtils . equals ( currentID , plotID ) ) {
chartEditPane = ChartTypeInterfaceManager . getInstance ( ) . getChartEditPane ( plotID ) ;
chartEditPane = ChartTypeInterfaceManager . getInstance ( ) . getChartEditPane ( plotID ) ;
chartEditPane . setContainer ( container ) ;
chartEditPane . setContainer ( container ) ;
currentID = plotID ;
resetChartEditPane ( ) ;
resetChartEditPane ( ) ;
} else {
chartEditPane . resetLastChartCollection ( ) ;
}
}
}
@Override
@Override