Browse Source

CHART-2562 空数据提示

master
zheng 6 years ago
parent
commit
1940de61bc
  1. 21
      designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStyleAction.java
  2. 8
      designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java
  3. 24
      designer-chart/src/main/java/com/fr/design/module/ChartPreStyleAction.java
  4. 36
      designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java

21
designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStyleAction.java

@ -1,5 +1,6 @@
package com.fr.design.module;
import com.fr.base.ChartEmptyDataStyleConf;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -7,6 +8,9 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import java.awt.event.ActionEvent;
@ -29,8 +33,21 @@ public class ChartEmptyDataStyleAction extends UpdateAction {
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
pane.updateBean();
Configurations.modify(new WorkerFacade(ChartEmptyDataStyleConf.class) {
@Override
public void run() {
pane.updateBean();
}
}.addCallBack(new CallBackAdaptor() {
@Override
public void afterCommit() {
DesignerFrame frame = DesignerContext.getDesignerFrame();
if (frame != null) {
frame.repaint();
}
}
}));
}
@Override

8
designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java

@ -8,8 +8,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane;
import com.fr.design.utils.ImageUtils;
@ -232,11 +230,5 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
manager.setOpenEmptyDataStyle(emptyData.getSelectedIndex() == 0);
manager.setCustomEmptyDataStyle(customRadioButton.isSelected());
manager.setEmptyDataImage(emptyDataImage);
// 通知报表整个刷新.
DesignerFrame frame = DesignerContext.getDesignerFrame();
if (frame != null) {
frame.repaint();
}
}
}

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

@ -1,5 +1,6 @@
package com.fr.design.module;
import com.fr.base.ChartPreStyleConfig;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -8,6 +9,9 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
@ -38,11 +42,21 @@ public class ChartPreStyleAction extends UpdateAction {
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
pane.updateBean();
}
@Override
public void doCancel() {
Configurations.modify(new WorkerFacade(ChartPreStyleConfig.class) {
@Override
public void run() {
pane.updateBean();
}
}.addCallBack(new CallBackAdaptor() {
@Override
public void afterCommit() {
DesignerFrame frame = DesignerContext.getDesignerFrame();
if (frame != null) {
frame.repaint();
}
}
}));
}
});

36
designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java

@ -3,17 +3,12 @@ package com.fr.design.module;
import com.fr.base.ChartColorMatching;
import com.fr.base.ChartPreStyleConfig;
import com.fr.base.Utils;
import com.fr.config.Configuration;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import java.util.ArrayList;
import java.util.Iterator;
@ -64,33 +59,16 @@ public class ChartPreStyleManagerPane extends JListControlPane {
}
public void updateBean() {
Configurations.update(new Worker() {
@Override
public void run() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
config.setCurrentStyle(getSelectedName());
config.setCurrentStyle(getSelectedName());
Nameable[] values = update();
config.clearAllPreStyle();
for(Nameable value : values) {
config.putPreStyle(value.getName(), ((NameObject) value).getObject());
}
// 通知报表整个刷新.
DesignerFrame frame = DesignerContext.getDesignerFrame();
if(frame != null) {
frame.repaint();
}
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{ChartPreStyleConfig.class};
}
});
Nameable[] values = update();
config.clearAllPreStyle();
for (Nameable value : values) {
config.putPreStyle(value.getName(), ((NameObject) value).getObject());
}
}
}
Loading…
Cancel
Save