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. 29
      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;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
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.web.button.Export;
import com.fr.general.Background;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
@ -125,12 +125,12 @@ public class FormEditToolBar extends BasicPane {
this.add(splitPane);
list.addListSelectionListener(listSelectionListener);
JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
UIButton bgButton = new UIButton(Inter.getLocText(new String[]{"Background", "Set"}));
defaultCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Default", "Background"}));
UIButton bgButton = new UIButton(Inter.getLocText("FR-Designer-Output_Background_Set"));
defaultCheckBox = new UICheckBox(Inter.getLocText("FR-Designer-Output_Default_Background"));
bgButton.addActionListener(actioner);
backgroundPane.add(defaultCheckBox);
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);
}
@ -210,7 +210,7 @@ public class FormEditToolBar extends BasicPane {
public MoveUpItemAction() {
this.setName(Inter.getLocText("Utils-Move_Up"));
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() {
this.setName(Inter.getLocText("Utils-Move_Down"));
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 RemoveAction() {
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;
import com.fr.base.BaseUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import javax.swing.*;
@ -17,8 +17,8 @@ import java.awt.event.ActionListener;
* Created by harry on 2017-3-2.
*/
public class FormSettingToolBar extends JPanel {
private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png");
private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png");
private Icon setIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png");
private Icon delIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png");
private UIButton setButton;
private UIButton delButton;
private FormToolBarPane toolBarPane;

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

@ -56,11 +56,11 @@ public class FormToolBar {
}
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++) {
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.setDefault(this.isDefault);
return toolBar;

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

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

@ -1,6 +1,5 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.core.WidgetOptionFactory;
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.Export;
import com.fr.form.web.button.page.*;
import com.fr.general.IOUtils;
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[]{"/", ""}),
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);
// 末页
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);
// 前一页
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);
// 导出成Excel 分页导出
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 原样导出
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
.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
.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;
import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.core.WidgetOption;
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.web.FormToolBarManager;
import com.fr.form.web.Location;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
@ -79,7 +79,7 @@ public class ElementCaseToolBarPane extends BasicBeanPane<FormToolBarManager[]>
northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
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.setOpaque(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.setMargin(null);
downButton.setOpaque(false);

Loading…
Cancel
Save