Browse Source

REPORT-8125 水印 设计器配置界面与实时预览=>改名

master
plough 7 years ago
parent
commit
29f4f6c849
  1. 10
      designer-base/src/com/fr/design/report/WatermarkPane.java
  2. 8
      designer-base/src/com/fr/design/report/WatermarkPreviewPane.java
  3. 4
      designer-form/src/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java
  4. 6
      designer-form/src/com/fr/design/mainframe/widget/wrappers/WatermarkWrapper.java
  5. 4
      designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  6. 8
      designer-form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  7. 10
      designer-realize/src/com/fr/design/actions/report/ReportWatermarkAction.java

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

@ -1,6 +1,6 @@
package com.fr.design.report;
import com.fr.base.iofileattr.WatermarkAttrMark;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.design.dialog.BasicPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.icombobox.UIComboBox;
@ -69,9 +69,9 @@ public class WatermarkPane extends BasicPane {
rightPane.add(initRightPane(), BorderLayout.CENTER);
}
public void populate(WatermarkAttrMark watermark) {
public void populate(WatermarkAttr watermark) {
if (watermark == null) {
watermark = new WatermarkAttrMark();
watermark = new WatermarkAttr();
}
populateFourmula(watermark.getText());
populateFontSize(watermark.getFontSize());
@ -79,8 +79,8 @@ public class WatermarkPane extends BasicPane {
paintPreviewPane();
}
public WatermarkAttrMark update() {
WatermarkAttrMark watermark = new WatermarkAttrMark();
public WatermarkAttr update() {
WatermarkAttr watermark = new WatermarkAttr();
watermark.setText(formulaPane.getUITextField().getText());
watermark.setFontSize((int)fontSizeComboBox.getSelectedItem());
watermark.setColor(colorPane.getColor());

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

@ -1,6 +1,6 @@
package com.fr.design.report;
import com.fr.base.iofileattr.WatermarkAttrMark;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.design.constants.UIConstants;
import com.fr.general.FRFont;
@ -22,18 +22,18 @@ public class WatermarkPreviewPane extends JPanel {
private int horizontalGap = 20; // 水平间隔(一个中文字符宽度)
private int verticalGap = 40; // 垂直间隔(两个中文字符宽度)
private WatermarkAttrMark watermark;
private WatermarkAttr watermark;
public WatermarkPreviewPane() {
this.watermark = new WatermarkAttrMark();
this.watermark = new WatermarkAttr();
repaint();
}
/**
* 重新画
*/
public void repaint(WatermarkAttrMark watermark){
public void repaint(WatermarkAttr watermark){
this.watermark = watermark;
super.repaint();
}

4
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.WatermarkAttrMark;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.widget.editors.ITextComponent;
@ -42,7 +42,7 @@ public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor {
fireStateChanged();
}
});
watermarkPane.populate((WatermarkAttrMark) getValue());
watermarkPane.populate((WatermarkAttr) getValue());
dlg.setVisible(true);
}
}

6
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.WatermarkAttrMark;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder;
@ -12,7 +12,7 @@ import com.fr.stable.StringUtils;
public class WatermarkWrapper implements Encoder, Decoder {
@Override
public Object decode(String txt) {
return new WatermarkAttrMark();
return new WatermarkAttr();
}
@Override
@ -25,6 +25,6 @@ public class WatermarkWrapper implements Encoder, Decoder {
if (v == null) {
return StringUtils.EMPTY;
}
return ((WatermarkAttrMark)v).getText();
return ((WatermarkAttr)v).getText();
}
}

4
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.WatermarkAttrMark;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
@ -125,7 +125,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
}
private void updateWatermark() {
WatermarkAttrMark watermark = (WatermarkAttrMark) watermarkEditor.getValue();
WatermarkAttr watermark = (WatermarkAttr) watermarkEditor.getValue();
if (watermark != null) {
IOFile ioFile = getCurrentIOFile();
ioFile.addAttrMark(watermark);

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

@ -1,7 +1,7 @@
package com.fr.design.widget.ui.designer.layout;
import com.fr.base.io.IOFile;
import com.fr.base.iofileattr.WatermarkAttrMark;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
@ -19,11 +19,8 @@ import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelectionUtils;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
@ -37,7 +34,6 @@ import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.main.FineBook;
import com.fr.report.core.ReportUtils;
import javax.swing.BorderFactory;
@ -215,7 +211,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
}
private void updateWatermark() {
WatermarkAttrMark watermark = (WatermarkAttrMark) watermarkEditor.getValue();
WatermarkAttr watermark = (WatermarkAttr) watermarkEditor.getValue();
if (watermark != null) {
IOFile ioFile = getCurrentIOFile();
ioFile.addAttrMark(watermark);

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

@ -1,21 +1,15 @@
package com.fr.design.actions.report;
import com.fr.base.BaseUtils;
import com.fr.base.IconManager;
import com.fr.base.iofileattr.WatermarkAttrMark;
import com.fr.base.iofileattr.WatermarkAttr;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.actions.ReportComponentAction;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.ReportComponent;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.WatermarkPane;
import com.fr.general.IOUtils;
import com.fr.main.TemplateWorkBook;
import com.fr.main.impl.WorkBook;
import com.fr.report.core.ReportUtils;
import com.fr.report.stable.ReportSettings;
import java.awt.event.ActionEvent;
@ -39,7 +33,7 @@ public class ReportWatermarkAction extends JWorkBookAction {
return;
}
final WorkBook wbTpl = jwb.getTarget();
WatermarkAttrMark watermark = ReportUtils.getWatermarkFromIOFile(wbTpl);
WatermarkAttr watermark = ReportUtils.getWatermarkFromIOFile(wbTpl);
final WatermarkPane watermarkPane = new WatermarkPane();
watermarkPane.populate(watermark);

Loading…
Cancel
Save