Browse Source

REPORT-1344 表单报表块翻页改进并增加局部导出

master
frharry 8 years ago
parent
commit
bcbc311cbd
  1. 14
      designer_form/src/com/fr/design/mainframe/FormEditToolBar.java
  2. 6
      designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java
  3. 6
      designer_form/src/com/fr/design/mainframe/FormToolBar.java
  4. 37
      designer_form/src/com/fr/design/mainframe/FormToolBarButton.java
  5. 18
      designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java
  6. 6
      designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java

14
designer_form/src/com/fr/design/mainframe/FormEditToolBar.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -22,6 +21,7 @@ import com.fr.form.ui.*;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.web.button.Export; import com.fr.form.web.button.Export;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -125,12 +125,12 @@ public class FormEditToolBar extends BasicPane {
this.add(splitPane); this.add(splitPane);
list.addListSelectionListener(listSelectionListener); list.addListSelectionListener(listSelectionListener);
JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
UIButton bgButton = new UIButton(Inter.getLocText(new String[]{"Background", "Set"})); UIButton bgButton = new UIButton(Inter.getLocText("FR-Designer-Output_Background_Set"));
defaultCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Default", "Background"})); defaultCheckBox = new UICheckBox(Inter.getLocText("FR-Designer-Output_Default_Background"));
bgButton.addActionListener(actioner); bgButton.addActionListener(actioner);
backgroundPane.add(defaultCheckBox); backgroundPane.add(defaultCheckBox);
backgroundPane.add(bgButton); backgroundPane.add(bgButton);
backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Background", "Set"}))); backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Output_Background_Set")));
this.add(backgroundPane, BorderLayout.SOUTH); this.add(backgroundPane, BorderLayout.SOUTH);
} }
@ -210,7 +210,7 @@ public class FormEditToolBar extends BasicPane {
public MoveUpItemAction() { public MoveUpItemAction() {
this.setName(Inter.getLocText("Utils-Move_Up")); this.setName(Inter.getLocText("Utils-Move_Up"));
this.setMnemonic('U'); this.setMnemonic('U');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png")); this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/up.png"));
} }
/** /**
@ -241,7 +241,7 @@ public class FormEditToolBar extends BasicPane {
public MoveDownItemAction() { public MoveDownItemAction() {
this.setName(Inter.getLocText("Utils-Move_Down")); this.setName(Inter.getLocText("Utils-Move_Down"));
this.setMnemonic('D'); this.setMnemonic('D');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png")); this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/down.png"));
} }
/** /**
@ -275,7 +275,7 @@ public class FormEditToolBar extends BasicPane {
public class RemoveAction extends UpdateAction { public class RemoveAction extends UpdateAction {
public RemoveAction() { public RemoveAction() {
this.setName(Inter.getLocText("FR-Designer_Delete")); this.setName(Inter.getLocText("FR-Designer_Delete"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
} }
/** /**

6
designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java

@ -1,11 +1,11 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
@ -17,8 +17,8 @@ import java.awt.event.ActionListener;
* Created by harry on 2017-3-2. * Created by harry on 2017-3-2.
*/ */
public class FormSettingToolBar extends JPanel { public class FormSettingToolBar extends JPanel {
private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png"); private Icon setIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png");
private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); private Icon delIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png");
private UIButton setButton; private UIButton setButton;
private UIButton delButton; private UIButton delButton;
private FormToolBarPane toolBarPane; private FormToolBarPane toolBarPane;

6
designer_form/src/com/fr/design/mainframe/FormToolBar.java

@ -56,11 +56,11 @@ public class FormToolBar {
} }
public ToolBar getToolBar() { public ToolBar getToolBar() {
Widget[] n = new Widget[this.getButtonlist().size()]; Widget[] widgets = new Widget[this.getButtonlist().size()];
for (int j = 0; j < this.getButtonlist().size(); j++) { for (int j = 0; j < this.getButtonlist().size(); j++) {
n[j] = this.getButtonlist().get(j).getWidget(); widgets[j] = this.getButtonlist().get(j).getWidget();
} }
ToolBar toolBar = new ToolBar(n); ToolBar toolBar = new ToolBar(widgets);
toolBar.setBackground(this.background); toolBar.setBackground(this.background);
toolBar.setDefault(this.isDefault); toolBar.setDefault(this.isDefault);
return toolBar; return toolBar;

37
designer_form/src/com/fr/design/mainframe/FormToolBarButton.java

@ -21,7 +21,7 @@ import java.awt.event.MouseListener;
*/ */
public class FormToolBarButton extends JButton implements MouseListener { public class FormToolBarButton extends JButton implements MouseListener {
private Widget widget; private Widget widget;
private WidgetOption no; private WidgetOption widgetOption;
public FormToolBarButton(Icon icon, Widget widget) { public FormToolBarButton(Icon icon, Widget widget) {
this(null, icon, widget); this(null, icon, widget);
@ -29,7 +29,8 @@ public class FormToolBarButton extends JButton implements MouseListener {
public FormToolBarButton(String text, Icon icon, Widget widget) { public FormToolBarButton(String text, Icon icon, Widget widget) {
super(text, icon); super(text, icon);
init(); setBackground(null);
setRolloverEnabled(true);
this.widget = widget; this.widget = widget;
if (widget instanceof com.fr.form.ui.Button) { if (widget instanceof com.fr.form.ui.Button) {
com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget; com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget;
@ -45,12 +46,6 @@ public class FormToolBarButton extends JButton implements MouseListener {
setMargin(new Insets(0, 0, 0, 0)); setMargin(new Insets(0, 0, 0, 0));
} }
private void init() {
setBackground(null);
setRolloverEnabled(true);
}
/** /**
* 改变按钮的权限细粒度状态 * 改变按钮的权限细粒度状态
* *
@ -81,11 +76,11 @@ public class FormToolBarButton extends JButton implements MouseListener {
} }
public WidgetOption getNameOption() { public WidgetOption getNameOption() {
return this.no; return this.widgetOption;
} }
public void setNameOption(WidgetOption no) { public void setNameOption(WidgetOption widgetOption) {
this.no = no; this.widgetOption = widgetOption;
} }
@ -109,18 +104,16 @@ public class FormToolBarButton extends JButton implements MouseListener {
return; return;
} }
if (e.getClickCount() >= 2) { if (e.getClickCount() >= 2) {
if (this.getParent() instanceof FormToolBarPane) { final FormToolBarPane toolBarPane = (FormToolBarPane) this.getParent();
final FormToolBarPane tb = (FormToolBarPane) this.getParent(); final FormEditToolBar editToolBar = new FormEditToolBar();
final FormEditToolBar etb = new FormEditToolBar(); editToolBar.populate(toolBarPane.getFToolBar(), this);
etb.populate(tb.getFToolBar(), this); BasicDialog dialog = editToolBar.showWindow(DesignerContext.getDesignerFrame());
BasicDialog dialog = etb.showWindow(DesignerContext.getDesignerFrame()); dialog.addDialogActionListener(new DialogActionAdapter() {
dialog.addDialogActionListener(new DialogActionAdapter() { public void doOk() {
public void doOk() { toolBarPane.setFToolBar(editToolBar.update());
tb.setFToolBar(etb.update());
} }
}); });
dialog.setVisible(true); dialog.setVisible(true);
}
} }
} }

18
designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.core.WidgetOptionFactory; import com.fr.design.gui.core.WidgetOptionFactory;
import com.fr.form.ui.CustomToolBarButton; import com.fr.form.ui.CustomToolBarButton;
@ -8,6 +7,7 @@ import com.fr.form.web.button.ExcelO;
import com.fr.form.web.button.ExcelP; import com.fr.form.web.button.ExcelP;
import com.fr.form.web.button.Export; import com.fr.form.web.button.Export;
import com.fr.form.web.button.page.*; import com.fr.form.web.button.page.*;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
/** /**
@ -24,29 +24,29 @@ public class FormWebWidgetConstants {
// 当前页/总页数 // 当前页/总页数
public static final WidgetOption PAGENAVI = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"HJS-Current_Page", "HF-Number_of_Page"}, new String[]{"/", ""}), public static final WidgetOption PAGENAVI = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"HJS-Current_Page", "HF-Number_of_Page"}, new String[]{"/", ""}),
BaseUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class); IOUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class);
// 首页 // 首页
public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-First"), BaseUtils.readIcon("/com/fr/web/images/first.png"), public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-First"), IOUtils.readIcon("/com/fr/web/images/first.png"),
First.class); First.class);
// 末页 // 末页
public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Last"), BaseUtils.readIcon("/com/fr/web/images/last.png"), public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Last"), IOUtils.readIcon("/com/fr/web/images/last.png"),
Last.class); Last.class);
// 前一页 // 前一页
public static final WidgetOption PREVIOUS = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Previous"), public static final WidgetOption PREVIOUS = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Previous"),
BaseUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class); IOUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class);
// 后一页 // 后一页
public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Next"), BaseUtils.readIcon("/com/fr/web/images/next.png"), public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Next"), IOUtils.readIcon("/com/fr/web/images/next.png"),
Next.class); Next.class);
// 导出成Excel 分页导出 // 导出成Excel 分页导出
public static final WidgetOption EXCELP = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Page"}, new String[]{"(", ")"}), public static final WidgetOption EXCELP = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Page"}, new String[]{"(", ")"}),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class); IOUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class);
// 导出成Excel 原样导出 // 导出成Excel 原样导出
public static final WidgetOption EXCELO = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Simple"}, new String[]{"(", ")"}), public static final WidgetOption EXCELO = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Simple"}, new String[]{"(", ")"}),
BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class); IOUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class);
// 导出 // 导出
public static final WidgetOption EXPORT = WidgetOptionFactory public static final WidgetOption EXPORT = WidgetOptionFactory
.createByWidgetClass(Inter.getLocText("FR-Engine_Export"), BaseUtils.readIcon("/com/fr/web/images/export.png"), Export.class); .createByWidgetClass(Inter.getLocText("FR-Engine_Export"), IOUtils.readIcon("/com/fr/web/images/export.png"), Export.class);
public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory
.createByWidgetClass(Inter.getLocText(new String[]{"Custom", "Form-Button"}), CustomToolBarButton.class); .createByWidgetClass(Inter.getLocText(new String[]{"Custom", "Form-Button"}), CustomToolBarButton.class);

6
designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.widget.editors; package com.fr.design.mainframe.widget.editors;
import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -14,6 +13,7 @@ import com.fr.design.mainframe.FormToolBarPane;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.web.FormToolBarManager; import com.fr.form.web.FormToolBarManager;
import com.fr.form.web.Location; import com.fr.form.web.Location;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -79,7 +79,7 @@ public class ElementCaseToolBarPane extends BasicBeanPane<FormToolBarManager[]>
northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
northToolBar.setBackground(Color.lightGray); northToolBar.setBackground(Color.lightGray);
UIButton topButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_up.png")); UIButton topButton = new UIButton(IOUtils.readIcon("com/fr/design/images/arrow/arrow_up.png"));
topButton.setBorder(null); topButton.setBorder(null);
topButton.setOpaque(false); topButton.setOpaque(false);
topButton.setContentAreaFilled(false); topButton.setContentAreaFilled(false);
@ -103,7 +103,7 @@ public class ElementCaseToolBarPane extends BasicBeanPane<FormToolBarManager[]>
} }
}); });
UIButton downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_down.png")); UIButton downButton = new UIButton(IOUtils.readIcon("com/fr/design/images/arrow/arrow_down.png"));
downButton.setBorder(null); downButton.setBorder(null);
downButton.setMargin(null); downButton.setMargin(null);
downButton.setOpaque(false); downButton.setOpaque(false);

Loading…
Cancel
Save