Browse Source

REPORT-8881 com.fr.file.FileNodeFILE#listFiles有问题

master
ju 6 years ago
parent
commit
88c6ca5423
  1. 4
      designer-base/pom.xml
  2. 7
      designer-base/src/com/fr/design/data/datapane/ChoosePane.java
  3. BIN
      designer-base/src/com/fr/design/images/dialog/watermark/watermark_background.png
  4. 2
      designer-base/src/com/fr/design/mainframe/JTemplate.java
  5. 2
      designer-base/src/com/fr/design/report/WatermarkPane.java
  6. 2
      designer-base/src/com/fr/design/report/WatermarkPreviewPane.java
  7. 28
      designer-base/src/com/fr/start/BaseDesigner.java
  8. 13
      designer-base/src/com/fr/start/SplashFxActionListener.java
  9. 6
      designer-chart/pom.xml
  10. 7
      designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java
  11. 20
      designer-chart/src/com/fr/design/module/ChartDesignerModule.java
  12. 6
      designer-form/pom.xml
  13. 2
      designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
  14. 2
      designer-form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  15. 21
      designer-form/src/com/fr/design/mainframe/FormDesignerUI.java
  16. 2
      designer-form/src/com/fr/design/mainframe/ShareWidgetButton.java
  17. 2
      designer-form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java
  18. 2
      designer-form/src/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java
  19. 2
      designer-form/src/com/fr/design/mainframe/widget/wrappers/WatermarkWrapper.java
  20. 2
      designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  21. 31
      designer-form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  22. 8
      designer-realize/pom.xml
  23. 2
      designer-realize/src/com/fr/design/actions/report/ReportMobileAttrAction.java
  24. 2
      designer-realize/src/com/fr/design/actions/report/ReportWatermarkAction.java
  25. 20
      designer-realize/src/com/fr/grid/GridUI.java
  26. 8
      designer-realize/src/com/fr/start/fx/SplashFx.java
  27. 18
      designer-realize/src/com/fr/start/fx/SplashFxWindow.java
  28. 3
      designer-realize/src/com/fr/start/module/DesignerModuleActivator.java
  29. 6
      designer-realize/src/com/fr/start/module/DesignerStartup.java
  30. 4
      pom.xml

4
designer-base/pom.xml

@ -6,7 +6,7 @@
<parent>
<groupId>com.fr.report</groupId>
<artifactId>design</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
@ -17,5 +17,5 @@
</dependencies>
<groupId>com.fr.report</groupId>
<artifactId>designer-base</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</project>

7
designer-base/src/com/fr/design/data/datapane/ChoosePane.java

@ -489,9 +489,12 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
protected String getTableName() {
String tableName = "";
Object obj = this.tableNameComboBox.getSelectedItem();
Object obj = this.tableNameComboBox.getSelectedItemObject();
if (obj == null) {
obj = this.tableNameComboBox.getEditor().getItem();
obj = this.tableNameComboBox.getSelectedItem();
if (obj == null) {
obj = this.tableNameComboBox.getEditor().getItem();
}
}
if (obj instanceof TreePath) {
Object tp = ((ExpandMutableTreeNode) ((TreePath) obj).getLastPathComponent()).getUserObject();

BIN
designer-base/src/com/fr/design/images/dialog/watermark/watermark_background.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 121 KiB

2
designer-base/src/com/fr/design/mainframe/JTemplate.java

@ -5,7 +5,7 @@ import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.base.ScreenResolution;
import com.fr.base.io.BaseBook;
import com.fr.base.iofileattr.TemplateIdAttrMark;
import com.fr.base.iofile.attr.TemplateIdAttrMark;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;

2
designer-base/src/com/fr/design/report/WatermarkPane.java

@ -1,6 +1,6 @@
package com.fr.design.report;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.dialog.BasicPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.icombobox.UIComboBox;

2
designer-base/src/com/fr/design/report/WatermarkPreviewPane.java

@ -1,6 +1,6 @@
package com.fr.design.report;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.constants.UIConstants;
import com.fr.page.WatermarkPainter;

28
designer-base/src/com/fr/start/BaseDesigner.java

@ -25,8 +25,6 @@ import com.fr.module.ModuleEvent;
import com.fr.stable.OperatingSystem;
import java.awt.Window;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.lang.reflect.Method;
import java.util.concurrent.ExecutorService;
@ -76,20 +74,12 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
}
public void show(final String[] args) {
ExecutorService executorService = Executors.newSingleThreadExecutor();
executorService.submit(new Runnable() {
@Override
public void run() {
collectUserInformation();
showDesignerFrame(args, DesignerContext.getDesignerFrame(), false);
DesignerContext.getDesignerFrame().refreshEnv();
for (int i = 0; !TemplateTreePane.getInstance().getTemplateFileTree().isTemplateShowing() && i < LOAD_TREE_MAXNUM; i++) {
TemplateTreePane.getInstance().getTemplateFileTree().refresh();
}
}
});
executorService.shutdown();
DesignerContext.getDesignerFrame().setVisible(true);
collectUserInformation();
showDesignerFrame(args, DesignerContext.getDesignerFrame(), false);
DesignerContext.getDesignerFrame().refreshEnv();
for (int i = 0; !TemplateTreePane.getInstance().getTemplateFileTree().isTemplateShowing() && i < LOAD_TREE_MAXNUM; i++) {
TemplateTreePane.getInstance().getTemplateFileTree().refresh();
}
}
@ -160,11 +150,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
if (OperatingSystem.isMacOS()) {
enableFullScreenMode(df);
}
df.addWindowListener(new WindowAdapter() {
public void windowOpened(WindowEvent e) {
df.getSelectedJTemplate().requestGridFocus();
}
});
df.getSelectedJTemplate().requestGridFocus();
return isException;
}

13
designer-base/src/com/fr/start/SplashFxActionListener.java

@ -0,0 +1,13 @@
package com.fr.start;
/**
* 启动动画监听
* Created by zack on 2018/6/14.
*/
public interface SplashFxActionListener {
/**
* 启动动画关闭
*/
void splashClose();
}

6
designer-chart/pom.xml

@ -6,16 +6,16 @@
<parent>
<groupId>com.fr.report</groupId>
<artifactId>design</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</parent>
<groupId>com.fr.report</groupId>
<artifactId>designer-chart</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.fr.report</groupId>
<artifactId>designer-base</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

7
designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -27,7 +27,6 @@ import com.fr.design.chartinterface.RangeIndependentChartInterface;
import com.fr.design.chartinterface.StockIndependentChartInterface;
import com.fr.design.chartinterface.XYScatterIndependentChartInterface;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -60,7 +59,6 @@ import com.fr.plugin.chart.radar.VanChartRadarPlot;
import com.fr.plugin.chart.scatter.VanChartScatterPlot;
import com.fr.plugin.chart.structure.VanChartStructurePlot;
import com.fr.plugin.chart.treemap.VanChartTreeMapPlot;
import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent;
import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.injectable.PluginSingleInjection;
@ -69,7 +67,6 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.DownloadOnlineSourcesHelper;
import com.fr.van.chart.area.AreaIndependentVanChartInterface;
import com.fr.van.chart.bar.BarIndependentVanChartInterface;
import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface;
@ -133,13 +130,11 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
public void envChanged() {
//重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance());
DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
}
});
}
private static WidgetOption[] initWidgetOption() {
public static WidgetOption[] initWidgetOption() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];

20
designer-chart/src/com/fr/design/module/ChartDesignerModule.java

@ -9,15 +9,18 @@ import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.ChartDialog;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent;
import com.fr.stable.ArrayUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.DownloadOnlineSourcesHelper;
import com.fr.van.chart.map.server.ChartMapEditorAction;
import javax.swing.Icon;
@ -30,19 +33,11 @@ import javax.swing.Icon;
* Time: 上午9:13
*/
public class ChartDesignerModule extends DesignModule {
public void start() {
super.start();
dealBeforeRegister();
register();
registerFloatEditor();
}
protected void dealBeforeRegister(){
public static void register(){
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class);
StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
@ -54,10 +49,13 @@ public class ChartDesignerModule extends DesignModule {
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction());
}
protected void registerFloatEditor() {
ActionFactory.registerChartCollection(ChartCollection.class);
DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption());
DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance());
DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
}
/**

6
designer-form/pom.xml

@ -6,16 +6,16 @@
<parent>
<groupId>com.fr.report</groupId>
<artifactId>design</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</parent>
<groupId>com.fr.report</groupId>
<artifactId>designer-form</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.fr.report</groupId>
<artifactId>designer-base</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

2
designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -4,7 +4,7 @@
package com.fr.design.designer.creator;
import com.fr.base.GraphHelper;
import com.fr.base.iofileattr.SharableAttrMark;
import com.fr.base.iofile.attr.SharableAttrMark;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;

2
designer-form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -4,7 +4,7 @@
package com.fr.design.designer.creator.cardlayout;
import com.fr.base.GraphHelper;
import com.fr.base.iofileattr.SharableAttrMark;
import com.fr.base.iofile.attr.SharableAttrMark;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;

21
designer-form/src/com/fr/design/mainframe/FormDesignerUI.java

@ -1,14 +1,12 @@
package com.fr.design.mainframe;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.Area;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import javax.swing.JComponent;
@ -19,6 +17,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.Utils;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
@ -31,10 +30,11 @@ import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.utils.ComponentUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.page.WatermarkPainter;
import com.fr.report.core.ReportUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper;
/**
* FormDesigner的UI类是一个有状态的UI类它根据FormDesigner的当前状态画出
@ -46,6 +46,7 @@ public class FormDesignerUI extends ComponentUI {
private FormDesigner designer;
private SelectionModel selectionModel;
private Rectangle2D.Double back_or_selection_rect = new Rectangle2D.Double(0, 0, 0, 0);
private WatermarkPainter watermarkPainter;
private float time;
public FormDesignerUI() {
@ -111,6 +112,18 @@ public class FormDesignerUI extends ComponentUI {
// 当前正在添加的组件
paintAddingBean(g, addingModel);
}
paintWatermark((Graphics2D) g);
}
// 绘制水印
private void paintWatermark(Graphics2D g) {
WatermarkAttr watermark = ReportUtils.getWatermarkFromAttrMarkFile(designer.getTarget());
// 不要每次都 new 一个 WatermarkPainter
if (watermarkPainter == null || !ComparatorUtils.equals(watermarkPainter.getWatermark(), watermark)) {
watermarkPainter = new WatermarkPainter(watermark);
}
watermarkPainter.paint(g, 0, designer.getParaHeight(), designer.getArea().getBounds());
}
private int[] getActualLine(int i) {

2
designer-form/src/com/fr/design/mainframe/ShareWidgetButton.java

@ -1,7 +1,7 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.iofileattr.SharableAttrMark;
import com.fr.base.iofile.attr.SharableAttrMark;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.gui.ilable.UILabel;

2
designer-form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java

@ -1,7 +1,7 @@
package com.fr.design.mainframe.actions;
import com.fr.base.BaseUtils;
import com.fr.base.iofileattr.MobileOnlyTemplateAttrMark;
import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;

2
designer-form/src/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java

@ -1,6 +1,6 @@
package com.fr.design.mainframe.widget.accessibles;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.widget.editors.ITextComponent;

2
designer-form/src/com/fr/design/mainframe/widget/wrappers/WatermarkWrapper.java

@ -1,6 +1,6 @@
package com.fr.design.mainframe.widget.wrappers;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder;

2
designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -1,7 +1,7 @@
package com.fr.design.widget.ui.designer.layout;
import com.fr.base.io.IOFile;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;

31
designer-form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -1,5 +1,7 @@
package com.fr.design.widget.ui.designer.layout;
import com.fr.base.io.IOFile;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
@ -20,6 +22,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelectionUtils;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
@ -30,8 +33,9 @@ import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.log.FineLoggerFactory;
import com.fr.general.Inter;
import com.fr.report.core.ReportUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
@ -51,6 +55,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
private UISpinner componentIntervel;
private PaddingBoundPane paddingBound;
private AccessibleWLayoutBorderStyleEditor stylePane;
private AccessibleBodyWatermarkEditor watermarkEditor;
public FRFitLayoutDefinePane(XCreator xCreator) {
super(xCreator);
@ -72,9 +77,13 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
stylePane = new AccessibleWLayoutBorderStyleEditor();
watermarkEditor = new AccessibleBodyWatermarkEditor();
paddingBound = new PaddingBoundPane();
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")), stylePane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")), stylePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), watermarkEditor}
}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
jp2.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
jPanel.add(paddingBound, BorderLayout.CENTER);
jPanel.add(jp2, BorderLayout.NORTH);
@ -135,6 +144,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval());
stylePane.setValue(ob.getBorderStyle());
watermarkEditor.setValue(ReportUtils.getWatermarkFromAttrMarkFile(getCurrentIOFile()));
}
private XLayoutContainer selectedBodyLayout(FormDesigner formDesigner) {
@ -156,6 +166,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
if(borderStyle != null){
layout.setBorderStyle(borderStyle);
}
updateWatermark();
Item item = (Item) layoutComboBox.getSelectedItem();
Object value = item.getValue();
int state = 0;
@ -187,7 +198,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{wAbsoluteBodyLayout}));
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
FineLoggerFactory.getLogger().error(e.getMessage());
}
//todo 验证下
@ -203,6 +214,18 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
return layout;
}
private void updateWatermark() {
WatermarkAttr watermark = (WatermarkAttr) watermarkEditor.getValue();
if (watermark != null) {
IOFile ioFile = getCurrentIOFile();
ioFile.addAttrMark(watermark);
}
}
private IOFile getCurrentIOFile() {
return WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
}
private void setLayoutGap(int value) {
int interval = wFitLayout.getCompInterval();
if (value != interval) {

8
designer-realize/pom.xml

@ -6,21 +6,21 @@
<parent>
<groupId>com.fr.report</groupId>
<artifactId>design</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</parent>
<groupId>com.fr.report</groupId>
<artifactId>designer-realize</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.fr.report</groupId>
<artifactId>designer-form</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.fr.report</groupId>
<artifactId>designer-chart</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

2
designer-realize/src/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.report;
import com.fr.base.iofileattr.MobileOnlyTemplateAttrMark;
import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;

2
designer-realize/src/com/fr/design/actions/report/ReportWatermarkAction.java

@ -1,7 +1,7 @@
package com.fr.design.actions.report;
import com.fr.base.BaseUtils;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;

20
designer-realize/src/com/fr/grid/GridUI.java

@ -10,6 +10,7 @@ import com.fr.base.PaperSize;
import com.fr.base.Utils;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.ImageFileBackground;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.DesignerContext;
@ -21,8 +22,10 @@ import com.fr.general.ComparatorUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.main.FineBook;
import com.fr.page.PaperSettingProvider;
import com.fr.page.ReportSettingsProvider;
import com.fr.page.WatermarkPainter;
import com.fr.report.ReportHelper;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.FloatElement;
@ -95,6 +98,7 @@ public class GridUI extends ComponentUI {
protected int resolution;
private boolean isAuthority = false;
private WatermarkPainter watermarkPainter;
public GridUI(int resolution) {
super();
@ -1089,9 +1093,25 @@ public class GridUI extends ComponentUI {
// 画Drag格子的边框.
this.paintDragCellBorder(g2d, grid);
// 画水印
if (elementCase instanceof WorkSheet) {
paintWatermark(g2d, ((WorkSheet) elementCase).getBook());
}
grid.ajustEditorComponentBounds(); // refresh size
}
// 绘制水印
private void paintWatermark(Graphics2D g2d, FineBook book) {
WatermarkAttr watermark = ReportUtils.getWatermarkFromAttrMarkFile(book);
// 不要每次都 new 一个 WatermarkPainter
if (watermarkPainter == null || !ComparatorUtils.equals(watermarkPainter.getWatermark(), watermark)) {
watermarkPainter = new WatermarkPainter(watermark);
}
watermarkPainter.paint(g2d, gridSize.width, gridSize.height);
}
private void dealWithSizeBeforePaint(Grid grid, TemplateElementCase elementCase) {
// 取出所有的行高和列宽的List

8
designer-realize/src/com/fr/start/fx/SplashFx.java

@ -1,5 +1,7 @@
package com.fr.start.fx;
import com.fr.design.mainframe.DesignerContext;
import com.fr.start.SplashFxActionListener;
import com.fr.start.SplashStrategy;
import javafx.application.Application;
import javafx.application.Platform;
@ -31,6 +33,12 @@ public class SplashFx implements SplashStrategy {
}
});
fxWindow = SplashFxWindow.waitForStartUpTest();
fxWindow.addSplashActionListener(new SplashFxActionListener() {
@Override
public void splashClose() {
DesignerContext.getDesignerFrame().setVisible(true);
}
});
}
@Override

18
designer-realize/src/com/fr/start/fx/SplashFxWindow.java

@ -4,6 +4,7 @@ import com.bulenkov.iconloader.util.JBUI;
import com.fr.base.FRContext;
import com.fr.stable.OperatingSystem;
import com.fr.start.SplashContext;
import com.fr.start.SplashFxActionListener;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.geometry.Rectangle2D;
@ -18,6 +19,8 @@ import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
@ -48,6 +51,7 @@ public class SplashFxWindow extends Application {
private Text moduleInfo;
private Text thanks;
private List<SplashFxActionListener> listeners = new ArrayList<SplashFxActionListener>();
private static int uiScale(int i) {
return (int) (i * JBUI_INIT_SCALE);
@ -125,6 +129,7 @@ public class SplashFxWindow extends Application {
public void run() {
try {
((Stage) moduleInfo.getScene().getWindow()).close();
fireSplashClose();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
@ -176,4 +181,17 @@ public class SplashFxWindow extends Application {
});
}
/**
* 添加一个动画状态监听
* @param listener
*/
public void addSplashActionListener(SplashFxActionListener listener) {
listeners.add(listener);
}
public void fireSplashClose() {
for (SplashFxActionListener listener : listeners) {
listener.splashClose();
}
}
}

3
designer-realize/src/com/fr/start/module/DesignerModuleActivator.java

@ -1,6 +1,7 @@
package com.fr.start.module;
import com.fr.design.mainframe.loghandler.socketio.DesignerSocketIO;
import com.fr.design.module.ChartDesignerModule;
import com.fr.design.module.DesignerModule;
import com.fr.general.ModuleContext;
import com.fr.locale.InterMutableKey;
@ -19,6 +20,8 @@ public class DesignerModuleActivator extends Activator implements Prepare {
ModuleContext.startModule(DesignerModule.class.getName());
DesignerSocketIO.init();
ChartDesignerModule.register();
}
@Override

6
designer-realize/src/com/fr/start/module/DesignerStartup.java

@ -1,5 +1,6 @@
package com.fr.start.module;
import com.fr.design.mainframe.DesignerContext;
import com.fr.event.Event;
import com.fr.event.Listener;
import com.fr.module.Activator;
@ -27,10 +28,11 @@ public class DesignerStartup extends Activator {
startSub(EnvBasedModule.class);
getRoot().getSingleton(EnvSwitcher.class).switch2LastEnv();
registerEnvListener();
//启动设计器界面
designer.show(args);
DesignerContext.getDesignerFrame().setVisible(true);
//启动画面结束
SplashContext.getInstance().hide();
//启动设计器界面
designer.show(args);
startSub(StartFinishActivator.class);
}

4
pom.xml

@ -7,7 +7,7 @@
<parent>
<groupId>com.fr.report</groupId>
<artifactId>fine-report-designer</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
<relativePath>../design-settings/fine-report-designer</relativePath>
</parent>
@ -19,6 +19,6 @@
</modules>
<groupId>com.fr.report</groupId>
<artifactId>design</artifactId>
<version>10.0-FEATURE-SNAPSHOT</version>
<version>10.0-RELEASE-SNAPSHOT</version>
<packaging>pom</packaging>
</project>
Loading…
Cancel
Save