Browse Source

修改包名, 移除ReportFitAttrProvider接口

research/10.0
XiaXiang 6 years ago
parent
commit
0c07b58512
  1. 4
      designer-base/src/main/java/com/fr/design/reportfit/FitType.java
  2. 19
      designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java
  3. 10
      designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java
  4. 8
      designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java
  5. 11
      designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java
  6. 8
      designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java
  7. 10
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  8. 8
      designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java

4
designer-base/src/main/java/com/fr/design/reportfit/FitType.java

@ -1,7 +1,7 @@
package com.fr.design.reportfit;
import com.fr.design.designer.properties.items.Item;
import com.fr.report.fun.ReportFitAttrProvider;
import com.fr.report.reportfit.ReportFitAttr;
import com.fr.stable.StringUtils;
/**
@ -45,7 +45,7 @@ public enum FitType {
this.state = state;
}
public static FitType parse(ReportFitAttrProvider attr) {
public static FitType parse(ReportFitAttr attr) {
if (attr == null) {
return DEFAULT;

19
designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java

@ -10,9 +10,8 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.log.FineLoggerFactory;
import com.fr.main.ReportFitAttr;
import com.fr.main.ReportFitConfig;
import com.fr.report.fun.ReportFitAttrProvider;
import com.fr.report.reportfit.ReportFitAttr;
import com.fr.reportfit.ReportFitConfig;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
@ -28,13 +27,13 @@ import java.awt.event.MouseEvent;
/**
* Created by Administrator on 2016/5/5/0005.
*/
public class BrowserFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
public class BrowserFitAttrPane extends BasicBeanPane<ReportFitAttr> {
protected FontRadioGroup fontRadioGroup;
protected FitRadioGroup fitRadionGroup;
protected UICheckBox globalCheck;
protected FitPreviewPane fitPreviewPane;
protected ReportFitAttrProvider localFitAttr;
protected ReportFitAttr localFitAttr;
protected UIRadioButton defaultRadio;
protected UIRadioButton horizonRadio;
protected UIRadioButton doubleRadio;
@ -118,14 +117,14 @@ public class BrowserFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
boolean isLocalConfig = !globalCheck.isSelected();
//勾选全局时,采用全局保存的自适应属性更新界面
if (!isLocalConfig) {
ReportFitAttrProvider attr = globalFitAttr;
ReportFitAttr attr = globalFitAttr;
fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont());
fitRadionGroup.selectIndexButton(attr.fitStateInPC());
fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled());
remove(BrowserFitAttrPane.this.borderPane);
initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Global"));
} else {
ReportFitAttrProvider attr = localFitAttr;
ReportFitAttr attr = localFitAttr;
fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont());
fitRadionGroup.selectIndexButton(attr.fitStateInPC());
fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled());
@ -169,7 +168,7 @@ public class BrowserFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
}
@Override
public void populateBean(ReportFitAttrProvider attr) {
public void populateBean(ReportFitAttr attr) {
if (attr == null) {
//如果为空, 就用全局的
attr = ReportFitConfig.getInstance().getFrmFitAttr();
@ -178,7 +177,7 @@ public class BrowserFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Local"));
}
this.localFitAttr = attr;
fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont());
fontRadioGroup.selectFontFit((attr).isFitFont());
fitRadionGroup.selectIndexButton(attr.fitStateInPC());
fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled());
}
@ -207,7 +206,7 @@ public class BrowserFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
}
@Override
public ReportFitAttrProvider updateBean() {
public ReportFitAttr updateBean() {
ReportFitAttr attr = new ReportFitAttr();
attr.setFitFont(fontRadioGroup.isFontFit());
attr.setFitStateInPC(fitRadionGroup.getSelectRadioIndex());

10
designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java

@ -8,8 +8,8 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.MenuKeySet;
import com.fr.report.fun.FitProvider;
import com.fr.report.fun.ReportFitAttrProvider;
import com.fr.report.reportfit.FitProvider;
import com.fr.report.reportfit.ReportFitAttr;
import javax.swing.KeyStroke;
import java.awt.Dimension;
@ -81,7 +81,7 @@ public class ReportFitAttrAction extends JTemplateAction {
return;
}
final FitProvider wbTpl = (FitProvider) jwb.getTarget();
ReportFitAttrProvider fitAttr = wbTpl.getFitAttr();
ReportFitAttr fitAttr = wbTpl.getReportFitAttr();
if (jwb.isJWorkBook()) {
final TemplateFitAttrPane attrPane = new TemplateFitAttrPane();
showReportFitDialog(fitAttr, jwb, wbTpl, attrPane);
@ -91,12 +91,12 @@ public class ReportFitAttrAction extends JTemplateAction {
}
}
private void showReportFitDialog(ReportFitAttrProvider fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane<ReportFitAttrProvider> attrPane) {
private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane<ReportFitAttr> attrPane) {
attrPane.populateBean(fitAttr);
UIDialog dialog = attrPane.showUnsizedWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
wbTpl.setFitAttr(attrPane.updateBean());
wbTpl.setReportFitAttr(attrPane.updateBean());
jwb.fireTargetModified();
}
});

8
designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java

@ -1,7 +1,7 @@
package com.fr.design.reportfit.menupane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.report.fun.ReportFitAttrProvider;
import com.fr.report.reportfit.ReportFitAttr;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
@ -9,7 +9,7 @@ import javax.swing.BoxLayout;
/**
* Created by Administrator on 2015/7/6 0006.
*/
public class ReportFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
public class ReportFitAttrPane extends BasicBeanPane<ReportFitAttr> {
private BrowserFitAttrPane attrPane;
@ -31,7 +31,7 @@ public class ReportFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
*
* @param fitAttr 自适应属性
*/
public void populateBean(ReportFitAttrProvider fitAttr) {
public void populateBean(ReportFitAttr fitAttr) {
attrPane.populateBean(fitAttr);
}
@ -40,7 +40,7 @@ public class ReportFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
*
* @return 界面上的更新数据
*/
public ReportFitAttrProvider updateBean() {
public ReportFitAttr updateBean() {
return attrPane.updateBean();
}

11
designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java

@ -2,9 +2,8 @@ package com.fr.design.reportfit.menupane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.log.FineLoggerFactory;
import com.fr.main.ReportFitAttr;
import com.fr.main.ReportFitConfig;
import com.fr.report.fun.ReportFitAttrProvider;
import com.fr.report.reportfit.ReportFitAttr;
import com.fr.reportfit.ReportFitConfig;
import java.awt.Component;
@ -28,12 +27,12 @@ public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane {
}
@Override
public void populateBean(ReportFitAttrProvider attr) {
public void populateBean(ReportFitAttr attr) {
//模板界面,自适应选项去掉了默认,这边的判断为了兼容之前的设置
if (attr != null && attr.fitStateInPC() == 0) {
attr.setFitStateInPC(3);
}
ReportFitAttrProvider fitAttr = ReportFitConfig.getInstance().getCptFitAttr();
ReportFitAttr fitAttr = ReportFitConfig.getInstance().getCptFitAttr();
if (attr == null) {
//如果为空, 就用全局的
attr = fitAttr;
@ -52,7 +51,7 @@ public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane {
}
@Override
public ReportFitAttrProvider updateBean() {
public ReportFitAttr updateBean() {
ReportFitAttr attr = new ReportFitAttr();
attr.setFitFont(fontRadioGroup.isFontFit());
attr.setFitStateInPC(fitRadionGroup.getSelectRadioIndex());

8
designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java

@ -1,7 +1,7 @@
package com.fr.design.reportfit.menupane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.report.fun.ReportFitAttrProvider;
import com.fr.report.reportfit.ReportFitAttr;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
@ -9,7 +9,7 @@ import javax.swing.BoxLayout;
/**
* Created by 夏翔 on 2016/6/24.
*/
public class TemplateFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
public class TemplateFitAttrPane extends BasicBeanPane<ReportFitAttr> {
private TemplateBrowserFitAttrPane attrPane;
@ -30,7 +30,7 @@ public class TemplateFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
*
* @param fitAttr 自适应属性
*/
public void populateBean(ReportFitAttrProvider fitAttr) {
public void populateBean(ReportFitAttr fitAttr) {
attrPane.populateBean(fitAttr);
}
@ -40,7 +40,7 @@ public class TemplateFitAttrPane extends BasicBeanPane<ReportFitAttrProvider> {
*
* @return 界面上的更新数据
*/
public ReportFitAttrProvider updateBean() {
public ReportFitAttr updateBean() {
return attrPane.updateBean();
}

10
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -19,11 +19,11 @@ import com.fr.form.FormProvider;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.ElementCaseEditorProvider;
import com.fr.report.reportfit.ReportFitAttr;
import com.fr.stable.ArrayUtils;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.report.fun.FitProvider;
import com.fr.report.fun.ReportFitAttrProvider;
import com.fr.report.reportfit.FitProvider;
import javax.swing.*;
import java.awt.*;
@ -120,17 +120,17 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
private CRPropertyDescriptor getReportFitEditor() {
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
FitProvider wbTpl = designer.getTarget();
ReportFitAttrProvider fitAttr = wbTpl.getFitAttr();
ReportFitAttr fitAttr = wbTpl.getReportFitAttr();
ElementCaseEditor editor = this.toData();
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttrProvider reportFit = editor.getReportFitAttr();
ReportFitAttr reportFit = editor.getReportFitAttr();
if(fitAttr != null){
reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr;
}
ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit;
ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit;
BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor();
CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr);
if (editor.getReportFitAttr() == null) {

8
designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java

@ -2,8 +2,8 @@ package com.fr.design.mainframe.widget.propertypane;
import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.main.ReportFitConfig;
import com.fr.report.fun.ReportFitAttrProvider;
import com.fr.report.reportfit.ReportFitAttr;
import com.fr.reportfit.ReportFitConfig;
import java.beans.IntrospectionException;
@ -19,7 +19,7 @@ public class BrowserFitPropertyEditor {
* @param reportFitAttr 传入的自适应属性
* @return 返回属性表
*/
public CRPropertyDescriptor createPropertyDescriptor(Class<?> temp, ReportFitAttrProvider reportFitAttr) {
public CRPropertyDescriptor createPropertyDescriptor(Class<?> temp, ReportFitAttr reportFitAttr) {
if (getFitStateInPC(reportFitAttr) == 0) {
return null;
}
@ -33,7 +33,7 @@ public class BrowserFitPropertyEditor {
}
}
public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) {
public int getFitStateInPC(ReportFitAttr fitAttrProvider) {
if (fitAttrProvider != null) {
return fitAttrProvider.fitStateInPC();
}

Loading…
Cancel
Save