Browse Source

CHART-13535 代码质量

feature/big-screen
白岳 5 years ago
parent
commit
a84c814f20
  1. 25
      designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java
  2. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java

25
designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java

@ -1,6 +1,7 @@
package com.fr.design.module;
import com.fr.base.ChartPreStyleConfig;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -8,11 +9,14 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import com.fr.module.ModuleContext;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import com.fr.van.chart.designer.component.VanChartFillStylePane;
import javax.swing.KeyStroke;
import java.util.concurrent.ExecutorService;
import java.awt.event.ActionEvent;
/**
@ -22,6 +26,9 @@ import java.awt.event.ActionEvent;
*/
public class ChartPreStyleAction extends UpdateAction {
private static ExecutorService refreshDesignPool = ModuleContext.getExecutor().newFixedThreadPool(
10, new NamedThreadFactory("refreshChartStylePane"));
public ChartPreStyleAction() {
this.setMenuKeySet(CHART_DEFAULT_STYLE);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
@ -54,12 +61,20 @@ public class ChartPreStyleAction extends UpdateAction {
if (frame != null) {
frame.repaint();
}
new Thread() {
@Override
if (refreshDesignPool.isTerminated()) {
synchronized (refreshDesignPool) {
if (refreshDesignPool.isTerminated()) {
refreshDesignPool = ModuleContext.getExecutor().newFixedThreadPool(
10, new NamedThreadFactory("refreshChartStylePane"));
}
}
}
refreshDesignPool.execute(new Runnable() {
@Override
public void run() {
DesignerContext.getDesignerBean("vanChartFillStyle").refreshBeanElement();
}
}.start();
DesignerContext.getDesignerBean(VanChartFillStylePane.name).refreshBeanElement();
}
});
}
}));
}

5
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java

@ -37,6 +37,7 @@ import java.awt.event.ActionListener;
*/
public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> implements DesignerBean {
public static final String name = "vanChartFillStyle";
protected ColorSchemeComboBox styleSelectBox;
protected JPanel customPane;
@ -75,6 +76,8 @@ public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> implemen
customPane.add(changeColorSetPane, BorderLayout.CENTER);
initListener();
initLayout();
DesignerContext.setDesignerBean(name, this);
}
private void initListener() {
@ -128,8 +131,6 @@ public class VanChartFillStylePane extends BasicBeanPane<AttrFillStyle> implemen
VanChartFillStylePane.this.revalidate();
}
});
DesignerContext.setDesignerBean("vanChartFillStyle", this);
}
protected void initLayout() {

Loading…
Cancel
Save