From 3c7e985f6d7de062759f1567de35b526c88c168e Mon Sep 17 00:00:00 2001 From: hzzz Date: Tue, 1 Aug 2017 11:04:46 +0800 Subject: [PATCH 01/29] REPORT-2419-bug --- designer/src/com/fr/design/parameter/ParameterDefinitePane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java index 394c6facc9..5464436d1f 100644 --- a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java @@ -250,6 +250,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus bridge.setPosition(reportParameterAttr.getAlign()); bridge.setDisplay(reportParameterAttr.isShowWindow()); bridge.setBackground(reportParameterAttr.getBackground()); + bridge.setUseParamsTemplate(reportParameterAttr.isUseParamsTemplate()); } } From 63b72565d5bfe45f57d66d7322a5bc13396bf915 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 2 Aug 2017 09:53:58 +0800 Subject: [PATCH 02/29] =?UTF-8?q?REPORT-3293=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E9=87=8D=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/CellWidgetPropertyPane.java | 146 ++++++++++++++++++ .../mainframe/ElementCasePaneDelegate.java | 16 +- .../fr/design/widget/CellWidgetCardPane.java | 88 ++++++++--- .../widget/WidgetDefinePaneFactory.java | 6 +- .../src/com/fr/design/widget/WidgetPane.java | 43 +++++- .../fr/design/widget/ui/ButtonDefinePane.java | 6 +- .../design/widget/ui/CheckBoxDefinePane.java | 10 +- .../widget/ui/CheckBoxGroupDefinePane.java | 4 +- .../ui/CustomWritableRepeatEditorPane.java | 2 +- .../widget/ui/DateEditorDefinePane.java | 36 +++-- .../ui/DirectWriteEditorDefinePane.java | 14 +- .../widget/ui/FieldEditorDefinePane.java | 139 +++++++++-------- .../widget/ui/IframeEditorDefinePane.java | 32 ++-- .../design/widget/ui/MultiFileEditorPane.java | 23 ++- .../widget/ui/NoneWidgetDefinePane.java | 4 - .../widget/ui/NumberEditorDefinePane.java | 44 ++++-- .../fr/design/widget/ui/RadioDefinePane.java | 4 - .../widget/ui/RadioGroupDefinePane.java | 11 +- .../widget/ui/TextFieldEditorDefinePane.java | 22 +-- .../widget/ui/TreeEditorDefinePane.java | 4 +- .../widget/ui/UserEditorDefinePane.java | 4 - .../design/widget/ui/WaterMarkDictPane.java | 6 +- .../ui/WriteUnableRepeatEditorPane.java | 4 +- .../ui/btn/ButtonDetailPaneFactory.java | 3 +- .../ui/btn/DefineAppendColumnRowPane.java | 12 +- .../widget/ui/btn/FreeButtonDetailPane.java | 4 +- .../btn/TreeNodeToogleButtonDefinePane.java | 30 +++- 27 files changed, 475 insertions(+), 242 deletions(-) create mode 100644 designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java diff --git a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java new file mode 100644 index 0000000000..4cf88436c2 --- /dev/null +++ b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -0,0 +1,146 @@ +package com.fr.design.mainframe; + +import com.fr.base.FRContext; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.present.CellWriteAttrPane; +import com.fr.design.widget.WidgetPane; +import com.fr.form.ui.NoneWidget; +import com.fr.form.ui.Widget; +import com.fr.general.FRLogger; +import com.fr.general.Inter; +import com.fr.grid.selection.CellSelection; +import com.fr.grid.selection.Selection; +import com.fr.privilege.finegrain.WidgetPrivilegeControl; +import com.fr.report.cell.DefaultTemplateCellElement; +import com.fr.report.cell.TemplateCellElement; +import com.fr.report.elementcase.TemplateElementCase; + +import java.awt.*; + +/** + * Created by ibm on 2017/7/20. + */ +public class CellWidgetPropertyPane extends BasicPane { + + private static CellWidgetPropertyPane singleton; + + private TemplateCellElement cellElement; + private WidgetPane cellEditorDefPane; + + public static CellWidgetPropertyPane getInstance(){ + if (singleton == null) { + singleton = new CellWidgetPropertyPane(); + } + return singleton; + } + + public CellWidgetPropertyPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); +// this.addAttributeChangeListener(listener); +// cellEditorDefPane = new WidgetPane(elementCasePane); + } + + public void clear (){ + singleton = null; + } + + public WidgetPane getCellEditorDefPane() { + return cellEditorDefPane; + } + + public void setCellEditorDefPane(WidgetPane cellEditorDefPane) { + this.cellEditorDefPane = cellEditorDefPane; + } + + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Designer-Widget_Settings"); + } + + public void populate(TemplateCellElement cellElement) { + if (cellElement == null) {// 利用默认的CellElement. + cellElement = new DefaultTemplateCellElement(0, 0, null); + } + + Widget cellWidget = cellElement.getWidget(); + + if(cellWidget == null){ + return; + } + + // 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变 + if (cellWidget != null) { + try { + cellWidget = (Widget) cellWidget.clone(); + } catch (CloneNotSupportedException e) { + FRContext.getLogger().error(e.getMessage(), e); + } + } + cellEditorDefPane.populate(cellWidget); + + } + + + public void populate(ElementCasePane ePane) { + + + cellEditorDefPane = new WidgetPane(ePane); + this.add(cellEditorDefPane, BorderLayout.CENTER); + + CellSelection cs = (CellSelection) ePane.getSelection(); + final TemplateElementCase tplEC = ePane.getEditingElementCase(); + TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); + if (editCellElement == null) { + editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); + tplEC.addCellElement(editCellElement); + } + this.cellElement = editCellElement; + this.populate(editCellElement); + } + + public void update() { + if (cellElement == null) {// 利用默认的CellElement. + return; + } + + Widget cellWidget = this.cellEditorDefPane.update(); + // p:最后把这个cellEditorDef设置到CellGUIAttr. + if (cellWidget instanceof NoneWidget) { + cellElement.setWidget(null); + } else { + if (cellElement.getWidget() != null) { + cellWidget = upDateWidgetAuthority(cellElement, cellWidget); + } + cellElement.setWidget(cellWidget); + } + + } + + + private Widget upDateWidgetAuthority(TemplateCellElement cellElement, Widget newWidget) { + try { + Widget oldWidget = (Widget) cellElement.getWidget().clone(); + if (newWidget.getClass() == oldWidget.getClass()) { + newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone()); + } + } catch (Exception e) { + FRLogger.getLogger().error(e.getMessage()); + } + return newWidget; + } + + @Override + /** + *检测是否有效 + */ + public void checkValid() throws Exception { + this.cellEditorDefPane.checkValid(); + } + + + +} \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 7cd32d6272..cf63c4448e 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -6,7 +6,6 @@ import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.menu.KeySetUtils; import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.general.Inter; -import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.page.ReportSettingsProvider; @@ -22,25 +21,13 @@ import com.fr.design.actions.edit.merge.UnmergeCellAction; import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; -import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.fun.MenuHandler; -import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.mainframe.cell.QuickEditorRegion; -import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; -import com.fr.report.cell.DefaultTemplateCellElement; -import com.fr.report.cell.TemplateCellElement; -import com.fr.report.core.SheetUtils; -import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.worksheet.WorkSheet; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; -import com.fr.general.Inter; -import com.fr.grid.selection.FloatSelection; -import com.fr.page.ReportSettingsProvider; -import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ArrayUtils; import javax.swing.*; @@ -69,7 +56,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); return; } - + CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); QuickEditorRegion.getInstance().populate(getCurrentEditor()); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); @@ -94,6 +81,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane); + EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance()); } EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane); EastRegionContainerPane.getInstance().removeParameterPane(); diff --git a/designer/src/com/fr/design/widget/CellWidgetCardPane.java b/designer/src/com/fr/design/widget/CellWidgetCardPane.java index d286cc1900..ec47be2045 100644 --- a/designer/src/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer/src/com/fr/design/widget/CellWidgetCardPane.java @@ -2,8 +2,9 @@ package com.fr.design.widget; import com.fr.design.data.DataCreatorUI; import com.fr.design.dialog.BasicPane; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.TreeSettingPane; -import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.present.dict.DictionaryPane; @@ -15,6 +16,7 @@ import com.fr.general.Inter; import javax.swing.*; import java.awt.*; +import java.util.ArrayList; /* * carl :单独弄出来 @@ -23,7 +25,10 @@ public class CellWidgetCardPane extends BasicPane { //当前的编辑器属性定义面板 private DataModify currentEditorDefinePane; //属性配置切换面板 - private JTabbedPane tabbedPane; + private ArrayList paneList; + private JPanel center; + private UIHeadGroup tabsHeaderIconPane; + private CardLayout tabbedPane; private BasicWidgetPropertySettingPane widgetPropertyPane; //通用属性容器 @@ -43,54 +48,87 @@ public class CellWidgetCardPane extends BasicPane { private JPanel eventTabPane; private WidgetEventPane eventPane; + private ElementCasePane pane; + public CellWidgetCardPane(ElementCasePane pane) { - this.initComponents(pane); + this.pane = pane; +// this.initComponents(pane); + } + + public BasicWidgetPropertySettingPane initBasicWidgetPropertyPane(){ + return new BasicWidgetPropertySettingPane(); } + private void initComponents(ElementCasePane pane) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); - tabbedPane = new UITabbedPane(); - this.add(tabbedPane, BorderLayout.CENTER); + //k + tabbedPane = new CardLayout(); + center = new JPanel(tabbedPane); + this.add(center, BorderLayout.CENTER); + attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + initPaneList(); eventPane = new WidgetEventPane(pane); eventTabPane.add(eventPane, BorderLayout.CENTER); - tabbedPane.add(Inter.getLocText("FR-Designer_Attribute"), attriTabPane); - tabbedPane.add(Inter.getLocText("FR-Designer_Form_Editing_Listeners"), eventTabPane); + //k + center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute")); + center.add(eventTabPane, Inter.getLocText("FR-Designer_Form_Editing_Listeners")); + final String [] tabTitles = new String[]{Inter.getLocText("FR-Designer_Attribute"), Inter.getLocText("FR-Designer_Form_Editing_Listeners")}; + + tabsHeaderIconPane = new UIHeadGroup(tabTitles) { + @Override + public void tabChanged(int index) { + tabbedPane.show(center, tabTitles[index]); + } + }; + tabsHeaderIconPane.setNeedLeftRightOutLine(false); + this.add(tabsHeaderIconPane, BorderLayout.NORTH); + //数据字典 dictTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dictCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); dictTabPane.add(dictCardPane, BorderLayout.CENTER); dictCardLayout = new CardLayout(); dictCardPane.setLayout(dictCardLayout); + //构建树 treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); widgetPropertyPane = new BasicWidgetPropertySettingPane(); - JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8)); - JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties")); - northPane.add(basic); - basic.add(widgetPropertyPane); - attriTabPane.add(northPane, BorderLayout.NORTH); + + UIExpandablePane uiExpandablePane = new UIExpandablePane("基本", 280, 20, widgetPropertyPane); + + attriTabPane.add(uiExpandablePane, BorderLayout.NORTH); + attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriTabPane.add(attriCardPane, BorderLayout.CENTER); attriCardLayout = (CardLayout) attriCardPane.getLayout(); this.setPreferredSize(new Dimension(600, 450)); } + private void initPaneList(){ + paneList = new ArrayList(); + paneList.add(attriTabPane); + paneList.add(eventPane); + } + @Override protected String title4PopupWindow() { return "Widget"; } public void populate(Widget cellWidget) { + initComponents(pane); +// super.populate(cellWidget); currentEditorDefinePane = null; if (cellWidget instanceof NoneWidget) { - this.tabbedPane.setEnabled(false); +// this.tabbedPane.setEnabled(false); } else { - this.tabbedPane.setEnabled(true); +// this.tabbedPane.setEnabled(true); } WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { @@ -117,7 +155,7 @@ public class CellWidgetCardPane extends BasicPane { currentEditorDefinePane = definePane; eventPane.populate(cellWidget); widgetPropertyPane.populate(cellWidget); - tabbedPane.setSelectedIndex(0); + tabsHeaderIconPane.setSelectedIndex(0); } private void showDictPane(DataCreatorUI ui, String cardName) { @@ -142,6 +180,7 @@ public class CellWidgetCardPane extends BasicPane { return null; } widgetPropertyPane.update(widget); +// super.update(widget); Listener[] listener = eventPane == null ? new Listener[0] : eventPane.updateListeners(); widget.clearListeners(); @@ -164,21 +203,26 @@ public class CellWidgetCardPane extends BasicPane { private void addDictAttriPane() { - tabbedPane.add(this.dictTabPane, 1); - tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_DS_Dictionary")); + center.add(this.dictTabPane, Inter.getLocText("FR-Designer_DS_Dictionary")); + reInitHeaderPane(this.dictTabPane); } private void addTreeAttriPane() { - tabbedPane.add(this.treeTabPane, 1); - tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_Create_Tree")); + center.add(this.dictTabPane, Inter.getLocText("FR-Designer_Create_Tree")); + reInitHeaderPane(this.treeTabPane); } private void removeDictAttriPane() { - tabbedPane.remove(this.dictTabPane); + center.remove(this.dictTabPane); } private void removeTreeAttriPane() { - tabbedPane.remove(this.treeTabPane); + center.remove(this.treeTabPane); + } + + private void reInitHeaderPane(JPanel jPanel){ + paneList.add(jPanel); +// tabsHeaderIconPane = new } } diff --git a/designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java b/designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java index 8d598d718a..93dd3dcb1e 100644 --- a/designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java +++ b/designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java @@ -4,8 +4,6 @@ import com.fr.base.FRContext; import com.fr.design.ExtraDesignClassManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.core.WidgetConstants; -import com.fr.design.gui.frpane.TreeSettingPane; -import com.fr.design.present.dict.DictionaryPane; import com.fr.design.widget.ui.*; import com.fr.form.ui.*; import com.fr.report.web.button.form.TreeNodeToggleButton; @@ -77,10 +75,10 @@ public class WidgetDefinePaneFactory { } public static class RN { - private DataModify definePane; + private DataModify definePane; private String cardName; - public RN(DataModify definePane, String cardName) { + public RN(DataModify definePane, String cardName) { this.definePane = definePane; this.cardName = cardName; } diff --git a/designer/src/com/fr/design/widget/WidgetPane.java b/designer/src/com/fr/design/widget/WidgetPane.java index 4b5ca44332..ff9140da92 100644 --- a/designer/src/com/fr/design/widget/WidgetPane.java +++ b/designer/src/com/fr/design/widget/WidgetPane.java @@ -1,14 +1,17 @@ package com.fr.design.widget; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.dialog.BasicPane; import com.fr.design.fun.WidgetDesignHandler; import com.fr.design.gui.core.WidgetOption; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; +import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.CellWidgetPropertyPane; import com.fr.design.widget.btn.ButtonConstants; import com.fr.form.ui.Button; import com.fr.form.ui.*; @@ -25,11 +28,11 @@ import java.util.Vector; /** * CellEditorDef Pane. */ -public class WidgetPane extends BasicPane implements ItemListener { +public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener { private EditorTypeComboBox editorTypeComboBox; private CellWidgetCardPane cellEditorCardPane; - private boolean shouldFireSelectedEvent; + private boolean shouldFireSelectedEvent = true; protected JPanel northPane; public WidgetPane() { @@ -45,7 +48,7 @@ public class WidgetPane extends BasicPane implements ItemListener { protected void initComponents(ElementCasePane pane) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); this.add(northPane, BorderLayout.NORTH); @@ -58,8 +61,23 @@ public class WidgetPane extends BasicPane implements ItemListener { cellEditorCardPane = new CellWidgetCardPane(pane); this.add(cellEditorCardPane, BorderLayout.CENTER); + this.addAttributeChangeListener(listener); } + protected JPanel createContentPane(){ + return new JPanel(); + } + + + + AttributeChangeListener listener = new AttributeChangeListener() { + @Override + public void attributeChange() { + CellWidgetPropertyPane.getInstance().update(); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + }; + /** * 状态改变 * @@ -84,13 +102,13 @@ public class WidgetPane extends BasicPane implements ItemListener { } @Override - protected String title4PopupWindow() { + public String title4PopupWindow() { return Inter.getLocText("FR-Designer_Widget"); } public void populate(Widget widget) { if (widget == null) { - widget = new TextEditor(); + return; } if (widget instanceof NameWidget) { @@ -106,11 +124,16 @@ public class WidgetPane extends BasicPane implements ItemListener { if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) { clazz = Button.class; } + cellEditorCardPane.populate(widget); + shouldFireSelectedEvent = false; editorTypeComboBox.setSelectedItemByWidgetClass(clazz); shouldFireSelectedEvent = true; - cellEditorCardPane.populate(widget); + removeAttributeChangeListener(); + initAllListeners(); + this.addAttributeChangeListener(listener); + } public Widget update() { @@ -118,7 +141,7 @@ public class WidgetPane extends BasicPane implements ItemListener { } protected void populateWidgetConfig(Widget widget) { - cellEditorCardPane.populate(widget); + this.populate(widget); } @@ -244,4 +267,8 @@ public class WidgetPane extends BasicPane implements ItemListener { && ComparatorUtils.equals(((Item) o).name, name); } } + public String getIconPath(){ + return ""; + } + } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java b/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java index 5d5c8d2fad..b53e003e60 100644 --- a/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/ButtonDefinePane.java @@ -1,14 +1,10 @@ package com.fr.design.widget.ui; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.present.dict.DictionaryPane; +import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory; import com.fr.form.ui.Button; import com.fr.form.ui.FreeButton; -import com.fr.design.widget.DataModify; import com.fr.design.widget.btn.ButtonDetailPane; -import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java index 3032e7e5cb..abcc5f986c 100644 --- a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java @@ -1,17 +1,14 @@ package com.fr.design.widget.ui; -import com.fr.design.gui.frpane.TreeSettingPane; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; import javax.swing.*; -import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.present.dict.DictionaryPane; import com.fr.form.ui.CheckBox; import com.fr.general.Inter; -import com.fr.design.widget.DataModify; public class CheckBoxDefinePane extends AbstractDataModify { private UITextField text; @@ -25,12 +22,11 @@ public class CheckBoxDefinePane extends AbstractDataModify { this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); - JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced")); - advancedPane.add(textPane); + UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, textPane); textPane.add(new UILabel(Inter.getLocText("Text") + ":")); text = new UITextField(8); textPane.add(text); - this.add(advancedPane); + this.add(uiExpandablePane); } @Override diff --git a/designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java b/designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java index e625c2490a..fa7a189c0e 100644 --- a/designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java @@ -41,8 +41,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane extends WritableRepeatEditorPane { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } \ No newline at end of file +package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane extends WritableRepeatEditorPane { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } public JPanel setValidatePane(){ JPanel otherContentPane = super.setValidatePane(); otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 5)); return otherContentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java index b85a18a52d..a006bc9ec8 100644 --- a/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java @@ -3,12 +3,14 @@ package com.fr.design.widget.ui; import com.fr.base.FRContext; import com.fr.base.Formula; import com.fr.data.core.FormatField; +import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.DateEditor; import com.fr.general.DateUtils; @@ -19,8 +21,6 @@ import com.fr.stable.StringUtils; import com.fr.stable.UtilEvalError; import javax.swing.*; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -50,16 +50,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane e contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false); directWriteCheckBox.setPreferredSize(new Dimension(100, 30)); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 5)); - JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); + waterMarkDictPane = new WaterMarkDictPane(); - advancedPane.add(contentPane); contentPane.add(waterMarkDictPane); JPanel otherContentPane = this.setSecondContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane); } - return advancedPane; + return contentPane; + } + + + + public JPanel setValidatePane(){ + JPanel otherContentPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 5)); + return otherContentPane; } protected abstract JPanel setSecondContentPane(); diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index bb3565c82c..22db6df8ce 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -7,6 +7,8 @@ import java.awt.event.ItemListener; import javax.swing.*; import com.fr.base.GraphHelper; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; import javax.swing.event.DocumentEvent; @@ -15,18 +17,18 @@ import javax.swing.event.DocumentListener; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.FieldEditor; import com.fr.general.Inter; public abstract class FieldEditorDefinePane extends AbstractDataModify { private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30; private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; - private UICheckBox allowBlankCheckBox; + protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - private UITextField errorMsgTextField; - private UITextField regErrorMsgTextField; - private JPanel validatePane; + protected UITextField errorMsgTextField; + protected JPanel validatePane; public FieldEditorDefinePane() { this.initComponents(); @@ -34,47 +36,19 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); - - initRegErrorMsgTextField(); - - //JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); - allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); - allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); - allowBlankCheckBox.addItemListener(new ItemListener() { - - @Override - public void itemStateChanged(ItemEvent e) { - errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); - } - }); - initErrorMsgPane(); + JPanel contentPane = this.setFirstContentPane(); + if (contentPane != null) { + UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); + this.add(uiExpandablePane, BorderLayout.NORTH); + } + this.addValidatePane(); } - protected void initRegErrorMsgTextField() { - regErrorMsgTextField = new UITextField(16); - regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { - public void changedUpdate(DocumentEvent e) { - regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText()); - } - - public void insertUpdate(DocumentEvent e) { - regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText()); - } - - public void removeUpdate(DocumentEvent e) { - regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText()); - } - }); - } protected void initErrorMsgPane() { // 错误信息 - JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); - errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":")); - errorMsgTextField = new UITextField(16); - errorMsgPane.add(errorMsgTextField); + errorMsgTextField = new UITextField(10); // richer:主要为了方便查看比较长的错误信息 errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { @@ -91,20 +65,13 @@ public abstract class FieldEditorDefinePane extends Abstr errorMsgTextField.setToolTipText(errorMsgTextField.getText()); } }); - this.addAllowBlankPane(allowBlankCheckBox); - JPanel contentPane = this.setFirstContentPane(); - if (contentPane != null) { - //contentPane.add(firstPanel); - this.add(contentPane, BorderLayout.NORTH); - } else { - //this.add(firstPanel, BorderLayout.CENTER); - } + } @Override public void populateBean(T ob) { this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); - errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); +// errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); this.errorMsgTextField.setText(ob.getErrorMessage()); populateSubFieldEditorBean(ob); @@ -126,30 +93,72 @@ public abstract class FieldEditorDefinePane extends Abstr protected abstract JPanel setFirstContentPane(); + @Override public void checkValid() throws Exception { } - public void addAllowBlankPane(UICheckBox allowBlankCheckBox) { - JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate")); - validatePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); - validatePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - northPane.add(validatePane); - this.add(northPane, BorderLayout.CENTER); - JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5); - validatePane.add(firstPane); - JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24); - secondPane.setPreferredSize(new Dimension(400, 23)); - validatePane.add(secondPane); - } + protected void addValidatePane() { + validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"); + errorMsgTextField = new UITextField(10); + allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); + allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5)); + allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); + allowBlankCheckBox.addItemListener(new ItemListener() { - public JPanel getValidatePane() { - return validatePane; + @Override + public void itemStateChanged(ItemEvent e) { + boolean isSelected = allowBlankCheckBox.isSelected(); + uiLabel.setVisible(!isSelected); + errorMsgTextField.setVisible(!isSelected); + if(isSelected){ + uiLabel.setPreferredSize(new Dimension(0, 0)); + errorMsgTextField.setPreferredSize(new Dimension(0, 0)); + }else{ + uiLabel.setPreferredSize(new Dimension(66, 20)); + errorMsgTextField.setPreferredSize(new Dimension(150, 20)); + } + } + }); + + + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + Component[][] components = new Component[][]{ + new Component[]{allowBlankCheckBox, null }, + new Component[]{uiLabel, errorMsgTextField}, + }; + double[] rowSize = {p, p}; + double[] columnSize = {p,f}; + int[][] rowCount = {{1, 1},{1, 1}}; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1); + validatePane.add(panel, BorderLayout.NORTH); + + JPanel contentPane = this.setValidatePane(); + if (contentPane != null) { + validatePane.add(contentPane, BorderLayout.CENTER); + } + + + UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Validate"), 280, 20, validatePane); + this.add(uiExpandablePane, BorderLayout.CENTER); + +// JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5); +// validatePane.add(firstPane); +// JPanel secondPane = new JPanel(FRGUIPaneFactory.createLabelFlowLayout()); +// secondPane.add(new UILabel("错误提示" + ":")); +// secondPane.add(errorMsgTextField); +// JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24); +// secondPane.setPreferredSize(new Dimension(400, 23)); +// validatePane.add(secondPane); } - public UITextField getRegErrorMsgTextField() { - return regErrorMsgTextField; + public JPanel setValidatePane(){ + return null; } + + } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java index 367b04ae9e..cf7797e813 100644 --- a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java @@ -5,23 +5,20 @@ import java.util.List; import javax.swing.BorderFactory; -import com.fr.design.gui.frpane.TreeSettingPane; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; import javax.swing.JPanel; -import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.present.dict.DictionaryPane; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.IframeEditor; import com.fr.general.Inter; import com.fr.stable.ParameterProvider; -import com.fr.design.widget.DataModify; public class IframeEditorDefinePane extends AbstractDataModify { private UITextField srcTextField; @@ -35,7 +32,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { private void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); + this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); @@ -44,22 +41,23 @@ public class IframeEditorDefinePane extends AbstractDataModify { contentPane.add(attr); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] rowSize = { p, TableLayout.PREFERRED }; + double[] rowSize = { p, p, p, p }; double[] columnSize = { p, f }; java.awt.Component[][] coms = { + { horizontalCheck, null }, + { verticalCheck, null }, { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; - parameterViewPane.setPreferredSize(new Dimension(400, 256)); - JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); - centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - centerPane.add(GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField(16), FlowLayout.LEFT)); - centerPane.add(GUICoreUtils.createFlowPane( new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane(), FlowLayout.LEFT)); - parameterViewPane.setPreferredSize(new Dimension(540, 235)); - JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); - advancedPane.add(contentPane); - contentPane.add(centerPane); - this.add(advancedPane, BorderLayout.CENTER); + int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}}; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); + + + contentPane.add(panel); + + UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); + this.add(uiExpandablePane, BorderLayout.NORTH); + } diff --git a/designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java b/designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java index 38da354307..533a854994 100644 --- a/designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java +++ b/designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java @@ -2,6 +2,7 @@ package com.fr.design.widget.ui; import java.awt.*; +import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ilable.UILabel; import javax.swing.*; @@ -11,7 +12,8 @@ import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.MultiFileEditor; import com.fr.general.Inter; @@ -38,27 +40,36 @@ public class MultiFileEditorPane extends FieldEditorDefinePane fileSizeField = new UINumberField(); fileSizeField.setPreferredSize(new Dimension(80, 18)); - JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); singleFilePane.add(singleFileCheckBox); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{singleFilePane}, FlowLayout.LEFT,0)); JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":")); allowTypePane.add(acceptType); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{allowTypePane}, FlowLayout.LEFT,5)); JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":")); fileSizePane.add(fileSizeField); fileSizePane.add(new UILabel(" KB")); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{fileSizePane}, FlowLayout.LEFT,11)); - return centerPane; + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + Component[][] components = new Component[][]{ + new Component[]{singleFileCheckBox, null }, + new Component[]{new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"), acceptType}, + new Component[]{new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"), fileSizeField}, + }; + double[] rowSize = {p, p,p}; + double[] columnSize = {p,f}; + int[][] rowCount = {{1, 1},{1, 1},{1, 1}}; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); + + + return panel; } @Override diff --git a/designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java b/designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java index 9f7c4bb356..60eb9ee0b5 100644 --- a/designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java @@ -1,10 +1,6 @@ package com.fr.design.widget.ui; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.frpane.TreeSettingPane; -import com.fr.design.present.dict.DictionaryPane; import com.fr.form.ui.NoneWidget; -import com.fr.design.widget.DataModify; /** * diff --git a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java index 2bd2956cba..86a8bf50f1 100644 --- a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java @@ -19,9 +19,10 @@ import javax.swing.text.DefaultFormatter; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.NumberEditor; import com.fr.general.Inter; -import com.fr.design.utils.gui.GUICoreUtils; public class NumberEditorDefinePane extends FieldEditorDefinePane { /** @@ -141,7 +142,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane }; public NumberEditorDefinePane() { - this.initComponents(); + super(); } @@ -156,23 +157,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); content.setLayout(FRGUIPaneFactory.createBorderLayout()); // richer:数字的允许直接编辑没有意义 + waterMarkDictPane = new WaterMarkDictPane(); - JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); - content.add(northPane, BorderLayout.NORTH); - waterMarkDictPane = new WaterMarkDictPane(); - northPane.add(waterMarkDictPane); - content.add(northPane, BorderLayout.NORTH); + return waterMarkDictPane; + } + + + public JPanel setValidatePane() { + this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength.setColumns(4); - limitNumberPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"}) + ":"), this.decimalLength}, - FlowLayout.LEFT, 4); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowDecimalsCheckBox, limitNumberPane}, FlowLayout.LEFT, 4)); this.allowDecimalsCheckBox.addActionListener(actionListener1); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowNegativeCheckBox}, FlowLayout.LEFT, 4)); this.allowNegativeCheckBox.addActionListener(actionListener2); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); @@ -180,7 +179,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); maxValueSpinner.setPreferredSize(new Dimension(120, 20)); setNotAllowsInvalid(this.maxValueSpinner); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMaxValueCheckBox, this.maxValueSpinner}, FlowLayout.LEFT, 4)); this.maxValueSpinner.setVisible(false); this.setMaxValueCheckBox.addActionListener(actionListener3); this.maxValueSpinner.addChangeListener(changeListener1); @@ -189,15 +187,29 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); minValueSpinner.setPreferredSize(new Dimension(120, 20)); setNotAllowsInvalid(this.minValueSpinner); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMinValueCheckBox, this.minValueSpinner}, FlowLayout.LEFT, 4)); this.minValueSpinner.setVisible(false); this.setMinValueCheckBox.addActionListener(actionListener4); this.minValueSpinner.addChangeListener(changeListener2); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24)); - return content; + + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + Component[][] components = new Component[][]{ + new Component[]{allowDecimalsCheckBox, null }, + new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength }, + new Component[]{allowNegativeCheckBox, null}, + new Component[]{setMaxValueCheckBox, maxValueSpinner}, + new Component[]{setMinValueCheckBox, minValueSpinner}, + }; + double[] rowSize = {p, p, p, p, p}; + double[] columnSize = {p,f}; + int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 1); + return panel; + } + @Override protected void populateSubFieldEditorBean(NumberEditor e) { allowDecimalsCheckBox.setSelected(e.isAllowDecimals()); @@ -229,7 +241,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane minValueSpinner.setVisible(true); minValueSpinner.setValue(new Double(e.getMinValue())); } - this.getRegErrorMsgTextField().setText(e.getRegErrorMessage()); this.waterMarkDictPane.populate(e); } @@ -257,7 +268,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane this.waterMarkDictPane.update(ob); - ob.setRegErrorMessage(this.getRegErrorMsgTextField().getText()); return ob; } diff --git a/designer/src/com/fr/design/widget/ui/RadioDefinePane.java b/designer/src/com/fr/design/widget/ui/RadioDefinePane.java index 4cdcdb0345..b31c81557e 100644 --- a/designer/src/com/fr/design/widget/ui/RadioDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/RadioDefinePane.java @@ -1,12 +1,8 @@ package com.fr.design.widget.ui; import com.fr.base.FRContext; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.present.dict.DictionaryPane; -import com.fr.design.widget.DataModify; import com.fr.form.ui.Radio; import com.fr.general.FRFont; import com.fr.general.Inter; diff --git a/designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java b/designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java index d9c7ca8651..460065ba6e 100644 --- a/designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java @@ -1,16 +1,13 @@ package com.fr.design.widget.ui; -import java.awt.BorderLayout; import java.awt.FlowLayout; -import javax.swing.BorderFactory; import javax.swing.JPanel; import com.fr.design.data.DataCreatorUI; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.present.dict.DictionaryPane; import com.fr.form.ui.RadioGroup; -import com.fr.general.Inter; public class RadioGroupDefinePane extends FieldEditorDefinePane { private DictionaryPane dictPane; @@ -30,16 +27,12 @@ public class RadioGroupDefinePane extends FieldEditorDefinePane { @Override protected JPanel setFirstContentPane() { - JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); - JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); centerPane.add(buttonGroupDictPane); - advancedPane.add(centerPane); - attrPane.add(advancedPane, BorderLayout.CENTER); - return attrPane; + return centerPane; } @Override diff --git a/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java index c9128627cc..482f96c252 100644 --- a/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java @@ -1,16 +1,12 @@ package com.fr.design.widget.ui; import com.fr.design.gui.frpane.RegPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.TextEditor; import com.fr.form.ui.reg.RegExp; import com.fr.general.Inter; import com.fr.stable.StringUtils; import javax.swing.*; -import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; @@ -26,7 +22,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane @Override protected JPanel setFirstContentPane() { - JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); regPane = createRegPane(); final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() { @@ -46,9 +41,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane } }; regPane.addPhoneRegListener(pl); - getValidatePane().add(GUICoreUtils.createFlowPane(regPane, FlowLayout.LEFT)); - getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24)); - JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane.addInputKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { @@ -61,15 +53,19 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane regPane.getRegComboBox().addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem(); - getRegErrorMsgTextField().setEnabled(regExp.errorMessageEditable()); } }); - advancedPane.add(waterMarkDictPane); - attrPane.add(advancedPane, BorderLayout.NORTH); - return attrPane; + + return waterMarkDictPane; + } + + public JPanel setValidatePane(){ + return regPane; } + + protected RegPane createRegPane() { return new RegPane(); } @@ -82,14 +78,12 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane @Override protected void populateSubFieldEditorBean(TextEditor e) { this.regPane.populate(e.getRegex()); - getRegErrorMsgTextField().setText(e.getRegErrorMessage()); waterMarkDictPane.populate(e); } @Override protected TextEditor updateSubFieldEditorBean() { TextEditor ob = newTextEditorInstance(); - ob.setRegErrorMessage(this.getRegErrorMsgTextField().getText()); ob.setRegex(this.regPane.update()); waterMarkDictPane.update(ob); diff --git a/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java index 10210738f0..f68c45ccc1 100644 --- a/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java @@ -50,9 +50,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { } protected JPanel setSecondContentPane() { - JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - advancedPane.add(contentPane); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); contentPane.add(contenter,BorderLayout.NORTH); @@ -62,7 +60,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } - return advancedPane; + return contentPane; } protected JPanel setThirdContentPane() { diff --git a/designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java index 027cfd8dd8..d777df9745 100644 --- a/designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java @@ -1,12 +1,8 @@ package com.fr.design.widget.ui; import com.fr.base.FRContext; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.present.dict.DictionaryPane; -import com.fr.design.widget.DataModify; import com.fr.form.ui.NameWidget; import com.fr.general.FRFont; import com.fr.general.Inter; diff --git a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java index bd73301e80..0fb1845fb6 100644 --- a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java +++ b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java @@ -3,7 +3,8 @@ package com.fr.design.widget.ui; import java.awt.event.KeyListener; import com.fr.design.gui.ilable.UILabel; -import javax.swing.JPanel; + +import javax.swing.*; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; @@ -16,8 +17,9 @@ public class WaterMarkDictPane extends JPanel{ public WaterMarkDictPane() { this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); + this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); this.add(new UILabel(Inter.getLocText("WaterMark") + ":")); - waterMarkTextField = new UITextField(16); + waterMarkTextField = new UITextField(13); this.add(waterMarkTextField); } diff --git a/designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java b/designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java index 2e4a839a92..633572e0fc 100644 --- a/designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java +++ b/designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java @@ -20,9 +20,7 @@ public abstract class WriteUnableRepeatEditorPane { - private ButtonSytleDefinedPane stylePane; + private com.fr.design.widget.ui.designer.btn.ButtonSytleDefinedPane stylePane; @Override protected Component createCenterPane() { - return stylePane = new ButtonSytleDefinedPane(); + return stylePane = new com.fr.design.widget.ui.designer.btn.ButtonSytleDefinedPane(); } @Override diff --git a/designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java b/designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java index c7700f7e7f..d28b505de0 100644 --- a/designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java @@ -1,5 +1,6 @@ package com.fr.design.widget.ui.btn; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; @@ -27,16 +28,33 @@ public class TreeNodeToogleButtonDefinePane exte protected void initComponents() { setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4)); + double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double rowSize[] = {p}; - double columnSize[] = {p, 184}; + double columnSize[] = {p, f}; Component[][] n_components = { - {new UILabel(Inter.getLocText(new String[]{"Form-Button", "Type"}) + ":"), createButtonTypeComboBox()} + {new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()}, }; - JPanel northPane = TableLayoutHelper.createTableLayoutPane(n_components, rowSize, columnSize); - JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); - advancedPane.add(northPane); - add(advancedPane, BorderLayout.CENTER); + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 8); + UIExpandablePane advancedPane = new UIExpandablePane("高级", 280, 20, panel); + this.add(advancedPane); + + + + +// setLayout(FRGUIPaneFactory.createBorderLayout()); +// double p = TableLayout.PREFERRED; +// double rowSize[] = {p}; +// double columnSize[] = {p, 184}; +// Component[][] n_components = { +// {new UILabel(Inter.getLocText(new String[]{"Form-Button", "Type"}) + ":"), createButtonTypeComboBox()} +// }; +// JPanel northPane = TableLayoutHelper.createTableLayoutPane(n_components, rowSize, columnSize); +// JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); +//// advancedPane.add(northPane); +// add(northPane); } @Override From 6848398c4e143f9d4c8ce7d9462a5c75abd64645 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 2 Aug 2017 12:35:15 +0800 Subject: [PATCH 03/29] =?UTF-8?q?REPORT-3293=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE=E9=87=8D=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/ui/btn/ButtonDetailPaneFactory.java | 3 +-- .../src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/btn/ButtonDetailPaneFactory.java b/designer/src/com/fr/design/widget/ui/btn/ButtonDetailPaneFactory.java index 406cbcc67d..c20aa322e9 100644 --- a/designer/src/com/fr/design/widget/ui/btn/ButtonDetailPaneFactory.java +++ b/designer/src/com/fr/design/widget/ui/btn/ButtonDetailPaneFactory.java @@ -3,7 +3,6 @@ package com.fr.design.widget.ui.btn; import com.fr.base.FRContext; import com.fr.design.module.DesignModuleFactory; import com.fr.design.widget.btn.ButtonDetailPane; -import com.fr.design.widget.ui.designer.btn.DefaultButtonDetailPane; import com.fr.form.ui.Button; import com.fr.form.ui.FreeButton; import com.fr.form.ui.Widget; @@ -28,7 +27,7 @@ public class ButtonDetailPaneFactory { static { detailMap.put(Button.class.getName(), DefaultButtonDetailPane.class); - detailMap.put(FreeButton.class.getName(), com.fr.design.widget.ui.designer.btn.FreeButtonDetailPane.class); + detailMap.put(FreeButton.class.getName(), FreeButtonDetailPane.class); if (StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class) != null) { detailMap.put(StableFactory.getMarkedClass(BridgeMark.SUBMIT_BUTTON, Widget.class).getName(), DesignModuleFactory.getButtonDetailPaneClass()); } diff --git a/designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java b/designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java index 660cf91236..5caf4ba70b 100644 --- a/designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java +++ b/designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java @@ -7,11 +7,11 @@ import com.fr.form.ui.FreeButton; import com.fr.design.widget.btn.ButtonWithHotkeysDetailPane; public class FreeButtonDetailPane extends ButtonWithHotkeysDetailPane { - private com.fr.design.widget.ui.designer.btn.ButtonSytleDefinedPane stylePane; + private ButtonSytleDefinedPane stylePane; @Override protected Component createCenterPane() { - return stylePane = new com.fr.design.widget.ui.designer.btn.ButtonSytleDefinedPane(); + return stylePane = new ButtonSytleDefinedPane(); } @Override From 12a8c71c60549400ef0ba0465f78ab0ca918c64e Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 2 Aug 2017 16:07:13 +0800 Subject: [PATCH 04/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E6=9D=83=E9=99=90=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E3=80=81=E7=BC=A9=E6=94=BE=E6=9D=A1=E9=83=A8=E5=88=86?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/cell/CleanAuthorityAction.java | 2 +- .../mainframe/AuthorityEditToolBarPane.java | 65 +++----- .../mainframe/AuthoritySheetEditedPane.java | 2 +- .../mainframe/AuthorityToolBarPane.java | 8 +- .../ElementCasePaneAuthorityEditPane.java | 155 ++++++++++++++---- .../com/fr/design/mainframe/JWorkBook.java | 5 +- .../mainframe/SheetAuthorityEditPane.java | 33 +++- .../fr/design/mainframe/SheetNameTabPane.java | 5 +- .../cell/settingpane/CellExpandAttrPane.java | 4 +- .../cell/settingpane/CellOtherSetPane.java | 2 +- designer/src/com/fr/poly/PolyDesigner.java | 6 +- .../com/fr/poly/creator/ChartBlockEditor.java | 3 +- .../src/com/fr/poly/creator/ECBlockPane.java | 6 +- .../fr/design/foldablepane/HeaderPane.java | 34 ++-- .../com/fr/design/gui/ibutton/UIButton.java | 1 + .../fr/design/gui/style/AlignmentPane.java | 4 +- .../com/fr/design/gui/style/BorderPane.java | 4 +- .../design/images/data/source/hoverDown.png | Bin 0 -> 219 bytes .../design/images/data/source/hoverDown20.png | Bin 0 -> 198 bytes .../images/data/source/hoverDown@2x.png | Bin 0 -> 344 bytes .../fr/design/images/data/source/hoverUp.png | Bin 0 -> 240 bytes .../design/images/data/source/hoverUp20.png | Bin 0 -> 232 bytes .../design/images/data/source/hoverUp@2x.png | Bin 0 -> 406 bytes .../design/images/data/source/normalDown.png | Bin 0 -> 221 bytes .../images/data/source/normalDown20.png | Bin 0 -> 197 bytes .../images/data/source/normalDown@2x.png | Bin 0 -> 326 bytes .../fr/design/images/data/source/normalUp.png | Bin 0 -> 220 bytes .../design/images/data/source/normalUp20.png | Bin 0 -> 235 bytes .../design/images/data/source/normalUp@2x.png | Bin 0 -> 387 bytes .../design/images/data/source/scaleDown.png | Bin 0 -> 118 bytes .../fr/design/images/data/source/scaleUp.png | Bin 0 -> 166 bytes .../com/fr/design/locale/designer.properties | 7 - .../design/locale/designer_en_US.properties | 7 - .../design/locale/designer_ja_JP.properties | 29 +--- .../design/locale/designer_ko_KR.properties | 28 ---- .../design/locale/designer_zh_CN.properties | 5 + .../design/locale/designer_zh_TW.properties | 9 - .../design/mainframe/AuthorityEditPane.java | 2 +- .../mainframe/AuthorityPropertyPane.java | 2 +- .../mainframe/EastRegionContainerPane.java | 7 +- .../com/fr/design/mainframe/JSliderPane.java | 87 +++++----- .../mainframe/NoSupportAuthorityEdit.java | 2 +- .../roleAuthority/RolesAlreadyEditedPane.java | 2 +- .../src/com/fr/start/BaseDesigner.java | 8 +- .../FormWidgetAuthorityEditPane.java | 86 +++++----- .../com/fr/design/mainframe/FormDesigner.java | 14 +- .../src/com/fr/design/mainframe/JForm.java | 8 +- 47 files changed, 338 insertions(+), 304 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/data/source/hoverDown.png create mode 100644 designer_base/src/com/fr/design/images/data/source/hoverDown20.png create mode 100644 designer_base/src/com/fr/design/images/data/source/hoverDown@2x.png create mode 100644 designer_base/src/com/fr/design/images/data/source/hoverUp.png create mode 100644 designer_base/src/com/fr/design/images/data/source/hoverUp20.png create mode 100644 designer_base/src/com/fr/design/images/data/source/hoverUp@2x.png create mode 100644 designer_base/src/com/fr/design/images/data/source/normalDown.png create mode 100644 designer_base/src/com/fr/design/images/data/source/normalDown20.png create mode 100644 designer_base/src/com/fr/design/images/data/source/normalDown@2x.png create mode 100644 designer_base/src/com/fr/design/images/data/source/normalUp.png create mode 100644 designer_base/src/com/fr/design/images/data/source/normalUp20.png create mode 100644 designer_base/src/com/fr/design/images/data/source/normalUp@2x.png create mode 100644 designer_base/src/com/fr/design/images/data/source/scaleDown.png create mode 100644 designer_base/src/com/fr/design/images/data/source/scaleUp.png diff --git a/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java b/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java index f403fcb9c2..a7b22cfbe7 100644 --- a/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java +++ b/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java @@ -1 +1 @@ -package com.fr.design.actions.cell; import java.awt.Rectangle; import java.awt.event.ActionEvent; import com.fr.design.actions.ElementCaseAction; import com.fr.design.mainframe.AuthorityPropertyPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; /** * Author : daisy * Date: 13-9-23 * Time: 下午2:41 */ public class CleanAuthorityAction extends ElementCaseAction { public CleanAuthorityAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText(new String[]{"Clear", "DashBoard-Potence"})); } /** * 清楚权限动作 * * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { ElementCasePane reportPane = getEditingComponent(); Selection selection = reportPane.getSelection(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (selection instanceof FloatSelection) { String name = ((FloatSelection) selection).getSelectedFloatName(); TemplateElementCase ec = reportPane.getEditingElementCase(); FloatElement fe = ec.getFloatElement(name); if (fe.isDoneAuthority(selectedRoles)) { fe.cleanAuthority(selectedRoles); } doAfterAuthority(reportPane); return; } CellSelection cellSelection = (CellSelection) selection; boolean isChooseColumnRow = cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN || cellSelection.getSelectedType() == CellSelection.CHOOSE_ROW; if (isChooseColumnRow && cellSelection.getCellRectangleCount() == 1) { cleanColumnRow(cellSelection, reportPane, selectedRoles); } else { cleanCell(cellSelection, reportPane, selectedRoles); } doAfterAuthority(reportPane); } private void doAfterAuthority(ElementCasePane reportPane) { reportPane.repaint(); reportPane.fireTargetModified(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().repaint(); if (EastRegionContainerPane.getInstance().getUpPane() instanceof AuthorityPropertyPane) { AuthorityPropertyPane authorityPropertyPane = (AuthorityPropertyPane) EastRegionContainerPane.getInstance().getUpPane(); authorityPropertyPane.populate(); EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane); } } /** * 清除单元格对应的角色的权限 * * @param cellSelection * @param reportPane */ private void cleanCell(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); int cellRectangleCount = cellSelection.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { Rectangle cellRectangle = cellSelection.getCellRectangle(rect); for (int j = 0; j < cellRectangle.height; j++) { for (int i = 0; i < cellRectangle.width; i++) { int column = i + cellRectangle.x; int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { continue; } //清除权限 if (cellElement.isDoneAuthority(selectedRoles) || cellElement.isDoneNewValueAuthority(selectedRoles)) { cellElement.cleanAuthority(selectedRoles); } if (cellElement.getWidget() == null) { continue; } boolean isDoneAuthority = cellElement.getWidget().isDoneVisibleAuthority(selectedRoles) || cellElement.getWidget().isDoneUsableAuthority(selectedRoles); if (isDoneAuthority) { cellElement.getWidget().cleanAuthority(selectedRoles); } } } } } private void cleanColumnRow(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); if (cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { for (int col = cellSelection.getColumn(); col < cellSelection.getColumn() + cellSelection.getColumnSpan(); col++) { elementCase.removeColumnPrivilegeControl(col, selectedRoles); } } else { for (int row = cellSelection.getRow(); row < cellSelection.getRow() + cellSelection.getRowSpan(); row++) { elementCase.removeRowPrivilegeControl(row, selectedRoles); } } } /** * 是否需要撤销动作 * * @return 不需要 */ public boolean executeActionReturnUndoRecordNeeded() { return false; } } \ No newline at end of file +package com.fr.design.actions.cell; import java.awt.Rectangle; import java.awt.event.ActionEvent; import com.fr.design.actions.ElementCaseAction; import com.fr.design.mainframe.AuthorityPropertyPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; /** * Author : daisy * Date: 13-9-23 * Time: 下午2:41 */ public class CleanAuthorityAction extends ElementCaseAction { public CleanAuthorityAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText(new String[]{"Clear", "DashBoard-Potence"})); } /** * 清楚权限动作 * * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { ElementCasePane reportPane = getEditingComponent(); Selection selection = reportPane.getSelection(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (selection instanceof FloatSelection) { String name = ((FloatSelection) selection).getSelectedFloatName(); TemplateElementCase ec = reportPane.getEditingElementCase(); FloatElement fe = ec.getFloatElement(name); if (fe.isDoneAuthority(selectedRoles)) { fe.cleanAuthority(selectedRoles); } doAfterAuthority(reportPane); return; } CellSelection cellSelection = (CellSelection) selection; boolean isChooseColumnRow = cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN || cellSelection.getSelectedType() == CellSelection.CHOOSE_ROW; if (isChooseColumnRow && cellSelection.getCellRectangleCount() == 1) { cleanColumnRow(cellSelection, reportPane, selectedRoles); } else { cleanCell(cellSelection, reportPane, selectedRoles); } doAfterAuthority(reportPane); } private void doAfterAuthority(ElementCasePane reportPane) { reportPane.repaint(); reportPane.fireTargetModified(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().repaint(); if (EastRegionContainerPane.getInstance().getUpPane() instanceof AuthorityPropertyPane) { AuthorityPropertyPane authorityPropertyPane = (AuthorityPropertyPane) EastRegionContainerPane.getInstance().getUpPane(); authorityPropertyPane.populate(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); } } /** * 清除单元格对应的角色的权限 * * @param cellSelection * @param reportPane */ private void cleanCell(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); int cellRectangleCount = cellSelection.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { Rectangle cellRectangle = cellSelection.getCellRectangle(rect); for (int j = 0; j < cellRectangle.height; j++) { for (int i = 0; i < cellRectangle.width; i++) { int column = i + cellRectangle.x; int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { continue; } //清除权限 if (cellElement.isDoneAuthority(selectedRoles) || cellElement.isDoneNewValueAuthority(selectedRoles)) { cellElement.cleanAuthority(selectedRoles); } if (cellElement.getWidget() == null) { continue; } boolean isDoneAuthority = cellElement.getWidget().isDoneVisibleAuthority(selectedRoles) || cellElement.getWidget().isDoneUsableAuthority(selectedRoles); if (isDoneAuthority) { cellElement.getWidget().cleanAuthority(selectedRoles); } } } } } private void cleanColumnRow(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); if (cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { for (int col = cellSelection.getColumn(); col < cellSelection.getColumn() + cellSelection.getColumnSpan(); col++) { elementCase.removeColumnPrivilegeControl(col, selectedRoles); } } else { for (int row = cellSelection.getRow(); row < cellSelection.getRow() + cellSelection.getRowSpan(); row++) { elementCase.removeRowPrivilegeControl(row, selectedRoles); } } } /** * 是否需要撤销动作 * * @return 不需要 */ public boolean executeActionReturnUndoRecordNeeded() { return false; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java b/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java index a760e0043b..317bed8d9f 100644 --- a/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java +++ b/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java @@ -31,6 +31,7 @@ import java.util.List; public class AuthorityEditToolBarPane extends AuthorityPropertyPane { private static final int TITLE_HEIGHT = 19; + private static final int RIGHT_GAP = 10; private AuthorityEditPane authorityEditPane = null; private AuthorityToolBarPane authorityToolBarPane; private String[] selectedPathArray; @@ -51,7 +52,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); - this.add(northPane, BorderLayout.NORTH); +// this.add(northPane, BorderLayout.NORTH); authorityEditPane = new AuthorityEditPane(buttonlists); this.add(authorityEditPane, BorderLayout.CENTER); } @@ -81,13 +82,13 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { private class AuthorityEditPane extends JPanel { private static final int TOP_GAP = 11; - private static final int LEFT_GAP = 8; - private static final int ALIGNMENT_GAP = -3; + private static final int LEFT_GAP = 4; + private static final int LEFT_CHECKPANE = 3; private UILabel type = null; private UILabel name = null; private JPanel checkPane = null; private List buttonlists; - private UICheckBox buttonVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); + private UICheckBox buttonVisible = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Visible")); private ItemListener itemListener = new ItemListener() { public void itemStateChanged(ItemEvent e) { String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); @@ -143,43 +144,30 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { public AuthorityEditPane(List buttonlists) { setLayout(new BorderLayout()); type = new UILabel(); + type.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); + name.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); - this.add(layoutText(), BorderLayout.WEST); - this.add(layoutPane(), BorderLayout.CENTER); - this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); + this.add(centerPane(), BorderLayout.NORTH); + this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); this.buttonlists = buttonlists; buttonVisible.addItemListener(itemListener); } - private JPanel layoutText() { - double p = TableLayout.PREFERRED; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Type") + ":", SwingConstants.RIGHT)}, - new Component[]{new UILabel(Inter.getLocText("FR-Designer_WF_Name") + ":", SwingConstants.RIGHT)}, - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Permissions") + ":", SwingConstants - .RIGHT)}, - }; - double[] rowSize = {p, p, p}; - double[] columnSize = {p}; - int[][] rowCount = {{1}, {1}, {1}}; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); - } - - - private JPanel layoutPane() { + private JPanel centerPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ - new Component[]{type}, - new Component[]{name}, - new Component[]{checkPane}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), type}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), name}, + new Component[]{checkPane, null}, }; - double[] rowSize = {p, p, p}; - double[] columnSize = {f}; - int[][] rowCount = {{1}, {1}, {1}}; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); } /** @@ -212,7 +200,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { if (name.getText() == "") { type.setText(""); } else { - type.setText(Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"})); + type.setText(" " + Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"})); } } @@ -226,7 +214,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { if (names != "") { names = names.substring(1); } - name.setText(names); + name.setText(" " + names); } public void populateCheckPane() { @@ -237,15 +225,14 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Form_Button"), SwingConstants.LEFT), - buttonVisible}, + new Component[]{buttonVisible}, }; - double[] rowSize = {p, p}; - double[] columnSize = {p, p, f}; - int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; - JPanel check = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + double[] rowSize = {p}; + double[] columnSize = {p}; + int[][] rowCount = {{1}}; + JPanel check = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL); checkPane.add(check, BorderLayout.CENTER); - checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); } } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java b/designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java index aba809df51..7d4aca1a65 100644 --- a/designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java +++ b/designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java @@ -41,7 +41,7 @@ public class AuthoritySheetEditedPane extends AuthorityPropertyPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); - this.add(northPane, BorderLayout.NORTH); +// this.add(northPane, BorderLayout.NORTH); authorityEditPane = new SheetAuthorityEditPane(editingWorkBook, selectedIndex); this.add(authorityEditPane, BorderLayout.CENTER); diff --git a/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java b/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java index fcb6988b95..79e52bfe14 100644 --- a/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java +++ b/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java @@ -76,7 +76,9 @@ public class AuthorityToolBarPane extends BasicBeanPane extends BasicBeanPane { } } if (BaseUtils.isAuthorityEditing()) { - EastRegionContainerPane.getInstance().replaceUpPane(allowAuthorityUpPane()); - EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(allowAuthorityUpPane()); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); } centerPane.needToShowCoverAndHidPane(); diff --git a/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java b/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java index c6ed737192..871b51cc66 100644 --- a/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java +++ b/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java @@ -28,10 +28,10 @@ import java.awt.event.ItemListener; */ public class SheetAuthorityEditPane extends AuthorityEditPane { private static final int TOP_GAP = 11; - private static final int LEFT_GAP = 8; + private static final int LEFT_GAP = 4; private static final int ALIGNMENT_GAP = -3; - private UICheckBox sheetVisible = new UICheckBox(Inter.getLocText("Widget-Visible")); + private UICheckBox sheetVisible = new UICheckBox("sheet" + Inter.getLocText("Widget-Visible")); private WorkBook workBook = null; private int selectedIndex = -1; @@ -66,17 +66,34 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); setLayout(new BorderLayout()); type = new UILabel(); + type.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); + name.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); - this.add(layoutText(), BorderLayout.WEST); - this.add(layoutPane(), BorderLayout.CENTER); - this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); +// this.add(layoutText(), BorderLayout.WEST); +// this.add(layoutPane(), BorderLayout.CENTER); + this.add(centerPane(), BorderLayout.CENTER); + this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); this.workBook = editingWorkBook; sheetVisible.addItemListener(itemListener); this.selectedIndex = selectedIndex; } + private JPanel centerPane() { + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), type}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), name}, + new Component[]{checkPane, null}, + }; + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); + } private JPanel layoutText() { double p = TableLayout.PREFERRED; @@ -121,7 +138,7 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { return; } checkPane.add(populateCheckPane(), BorderLayout.CENTER); - checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); checkVisibleCheckBoxes(); } @@ -129,14 +146,14 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { * 刷新类型 */ public void populateType() { - type.setText("sheet"); + type.setText(" " + "sheet"); } /** * 更新名字 */ public void populateName() { - name.setText(workBook.getReportName(selectedIndex)); + name.setText(" " + workBook.getReportName(selectedIndex)); } /** diff --git a/designer/src/com/fr/design/mainframe/SheetNameTabPane.java b/designer/src/com/fr/design/mainframe/SheetNameTabPane.java index aac628037e..cbb0309ee9 100644 --- a/designer/src/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer/src/com/fr/design/mainframe/SheetNameTabPane.java @@ -215,8 +215,9 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private void doWithAuthority() { AuthoritySheetEditedPane sheetEditedPane = new AuthoritySheetEditedPane(reportComposite.getEditingWorkBook(), selectedIndex); sheetEditedPane.populate(); - EastRegionContainerPane.getInstance().replaceUpPane(sheetEditedPane); - EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(sheetEditedPane); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); } diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java index 3ca8bff0c8..9de87e092c 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java @@ -84,8 +84,8 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { layoutPane = new JPanel(new BorderLayout()); basicPane = new JPanel(); seniorPane = new JPanel(); - basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,20,basicPane()); - seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,20,seniorPane()); + basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,24,basicPane()); + seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,24,seniorPane()); layoutPane.add(basicPane,BorderLayout.NORTH); layoutPane.add(seniorPane,BorderLayout.CENTER); return layoutPane; diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 33d11b5e5f..26f4918ff5 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -36,7 +36,7 @@ import java.awt.event.ItemListener; public class CellOtherSetPane extends AbstractCellAttrPane { private static final int HEAD_WDITH = 290; - private static final int HEAD_HEIGTH = 20; + private static final int HEAD_HEIGTH = 24; // normal private UIButtonGroup autoshrik; diff --git a/designer/src/com/fr/poly/PolyDesigner.java b/designer/src/com/fr/poly/PolyDesigner.java index 088ef95e0e..d5d1b063a4 100644 --- a/designer/src/com/fr/poly/PolyDesigner.java +++ b/designer/src/com/fr/poly/PolyDesigner.java @@ -395,7 +395,8 @@ public class PolyDesigner extends ReportComponentqVep#gQYE{FC(`x?>w+!4IvwW?BH|7#Z&R^kSel?I9gw9w Q2k1ZsPgg&ebxsLQ0QnkEbN~PV literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/hoverDown20.png b/designer_base/src/com/fr/design/images/data/source/hoverDown20.png new file mode 100644 index 0000000000000000000000000000000000000000..815dae49683e2b6cc6185645c0953e4d03764b83 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1Ig22U5q5DUTN zJ;l!(pYQ))pZ@p%d45Fl4LUyNf8r1Q<8OY zFPx$5=lfsR9Fe^SFsL)Fc7^XMt3$7HiM4JANWe9-nLV&%R%LH=Nf3G?M zGI%G&6gK}6HK@m zBAJ5tg;}HZoOcbCVt`Q$!E+Atej>NGaOaLfUainboFyt=akR{0Gvl#IRF3v literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/hoverUp20.png b/designer_base/src/com/fr/design/images/data/source/hoverUp20.png new file mode 100644 index 0000000000000000000000000000000000000000..f5b2ad6c5276a9ca9e2b1751cb848ea5840293e9 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1IgMV>B>Ar^wk zdy1boKHvYpKK<|i^9qL@7!y)bDh?evG3Qvt>u-0DPmy9PX1@`TCCO$ak|HL2rX=ek zbNYjei`_dvv0T)fW0fjY%Byn9WP#G6Sc?QUqkDTwzuWJ6yMRMM?aZd)PZDd^t_|Fh zY%1W&Iz?Di^4x};pI$jZ8cEIeJnZLMfvVU9WHpaSumw5S>Nj(_CgrLx;fp!Y)Sas( d!L^!+LGFc-)RFmjl7Oyd@O1TaS?83{1OQ&WQ=I?+ literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/hoverUp@2x.png b/designer_base/src/com/fr/design/images/data/source/hoverUp@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..cff495dd24cb4439a1ffe86119c6eec06bcddd0c GIT binary patch literal 406 zcmV;H0crk;P)Px$P)S5VR9Fe^SIvsTFc6**(Yv<=Z=!p2eFNWO(FZ9$g7iTw`xd@|yGIpog16rF zV9Z!D%`{q!bQLs#lFU!$n|?`$DL@$S&H&m3tk>JNQu|l|4gu7MZM%PsI|MaHY)0K~ zds~dd2@v>E9sV?MtLRjXjA;!U{bCX|6P(`s|G)`FwK5EYn9X?tXWFH)Op4P(+9>mdQGvPdJ2w&X`D-wMD4MY1 zv)5rvQa<1a1Rf`17HqW{FvhZZJo-MHXUR{Qn`3(d15OS?@qi-`c#aSf2n;-(0jndz zolhrB6%K&Qh;zFyD+oglPJmixU5iK3d|k53>vb<_Aq=UpN-_2A`i;_}Lv=Ey8HS9= zcYykJ>f1G`iB80!N^bL!=*I+-OaBBuQC`>g1RE7jX^40$FaQ7m07*qoM6N<$g7WvR AaR2}S literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/normalDown.png b/designer_base/src/com/fr/design/images/data/source/normalDown.png new file mode 100644 index 0000000000000000000000000000000000000000..47925133888aaa6b4dd90f2556eb2491fb410257 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|rhB?LhFAzD zCrD%*;3zuKFK=)2|L<@6*Z=F;B%Sz@Qc@}o9XT@N*ujGvWtWKM9N3#@gOsn4qvT;Q?<#qh;;)cXxTtp7k}*^V_v;Ti?N}S4H*s`&!q> z@BiQ4EpYO|vu7-?Wq%kf=;LPx$07*naR9FdPU>F4>Jp>q$1K``Y|1t~=Kf3<^XK(t5A#_Dl;=f~LZ3yxz^faqj)2R4{rdesRuxnhKz0pa1{> literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/normalUp.png b/designer_base/src/com/fr/design/images/data/source/normalUp.png new file mode 100644 index 0000000000000000000000000000000000000000..3daa63733f5cb4c488bf51a5770e21f907062026 GIT binary patch literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|rg^$JhFAzD zCrD%*;3zuKFK=)2|L<@6*Z=F;B%Sz@Qc@}o9XT@N*ujGvWtU9jba`-TPxbe_2_{?& zkxW7S!YsQVyuSYaeyHVq*iH z7*;oGXf2SjwvKLdZs$v$>?A1tC()unkHwY2u;GP=;xU5>Qm?8dLo|f4trbfr1WAYF g1Ro6ONbJdExXoj1xk|KWC(ywRp00i_>zopr0N)H(0RR91 literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/normalUp@2x.png b/designer_base/src/com/fr/design/images/data/source/normalUp@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..901f6a1db1a01373ed4b490a4d4b726694aa6528 GIT binary patch literal 387 zcmV-}0et?6P)Px$JxN4CR9Fe^S4|GVKoou>7Fs(yi96V`(6|Qoz!`84y@s%0>kbk-yH1vkxCLGN{T|HcOY)mdhcGetg)PwV zh)8TumMah^v#y>uxTQCnZC06)t3UyRgBJM07HD{eV+mLVDp!C{L?`u#8WW50*xmzp z!U51R@~kWwM+|LIhcLXX)XX;0vL!oeJojDK8S}P`K*eJ@&g(e0BTL25kczV|Xyb>8 hpY}~qu+NW{UjZChNj$R3Z!`b^002ovPDHLkV1iHTpH%<= literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/scaleDown.png b/designer_base/src/com/fr/design/images/data/source/scaleDown.png new file mode 100644 index 0000000000000000000000000000000000000000..32cd12b8007f8fb002f2da8b49d63498f24a05c0 GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|3_M*NLo5W7 z6C_vyONsnN1EsH<3<1fr^i))d-L(ML8Y2R@)Ws?iVO@)3>+*T2TVnP PdKo-j{an^LB{Ts5)lMP? literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/scaleUp.png b/designer_base/src/com/fr/design/images/data/source/scaleUp.png new file mode 100644 index 0000000000000000000000000000000000000000..d4b553694589d212139a228330fb29395cbc95de GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|55icDuGPgG#)hoYL-Zhk$l5 Nc)I$ztaD0e0sufhIQako literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 9bee11543a..968e44ba69 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2092,16 +2092,9 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML FR-Designer_Datasource_Other_Attributes=Other_Attributes FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing FR-Designer_CellElement_Property_Table=CellElement_Property_Table -FR-Designer_Add_Condition=Add Condition -FR-Designer_Use_Params_Template= -FR-Designer_Label_Name= FR-Designer_T_Insert_Float=Insert_Float FR-Designer_Add_FloatElement=Add_FloatElement FR-Designer_Insert_Image=Insert_Image FR-Designer_Insert-Chart=Insert-Chart FR-Designer_Insert-Text=Insert-Text FR-Designer_Insert_Formula=Insert_Formula - -FR-Designer_Insert_Chart= -FR-Designer_Insert_Text= -FR-Designer_Double= diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 6a96057ed9..c72a2b2944 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2093,16 +2093,9 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML FR-Designer_Datasource_Other_Attributes=Other_Attributes FR-Designer_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing FR-Designer_CellElement_Property_Table=CellElement_Property_Table -FR-Designer_Add_Condition=Add Condition -FR-Designer_Use_Params_Template=use parameter template -FR-Designer_Label_Name=label name FR-Designer_T_Insert_Float=Insert_Float FR-Designer_Add_FloatElement=Add_FloatElement FR-Designer_Insert_Image=Insert_Image FR-Designer_Insert_Chart=Insert-Chart FR-Designer_Insert_Text=Insert-Text FR-Designer_Insert_Formula=Insert_Formula - -FR-Designer_Insert-Chart= -FR-Designer_Insert-Text= -FR-Designer_Double= diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 991092322c..d299a90935 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -1982,6 +1982,7 @@ FR-Base_UnSignIn=\ \u672A\u30ED\u30B0\u30A4\u30F3 Every=\u6BCE CellWrite-Preview_Cell_Content=\u30BB\u30EB\u5185\u5BB9 FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9 +FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9 FR-Designer_Permissions=\u6A29\u9650 FR-Designer_Form_Button=\u30DC\u30BF\u30F3 FR-Designer_WF_Name=\u540D @@ -2074,36 +2075,8 @@ FR-Designer_CellWrite_Show_As_HTML= FR-Designer_Datasource_Other_Attributes= FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_CellElement_Property_Table= -FR-Designer_Add_Condition= FR-Designer_T_Insert_Float= FR-Designer_Add_FloatElement= FR-Designer_Insert_Image= FR-Designer_Insert_Chart= FR-Designer_Insert_Text= - -FR-Designer_AlphaFine_Enable= -FR-Designer_AlphaFine_EnableAlphaFine= -FR-Designer_AlphaFine_EnableInternet= -FR-Designer_AlphaFine_EnableInternetSearch= -FR-Designer_AlphaFine_Shortcut_Config= -FR-Designer_AlphaFine_SearchRange= -FR-Designer_AlphaFine_Recommend= -FR-Designer-Plugin_Addon= -FR-Designer_Templates= -FR-Designer_Templates_Content= -FR-Designer_AlphaFine_ShowAll= -FR-Designer_AlphaFine_Latest= -FR-Designer_AlphaFine_ShowLess= -FR-Designer_AlphaFine= -FR-Designer-Alphafine_No_Remind= -FR-Designer_AlphaFine_NoResult= -FR-Designer_ConnectionFailed= -FR-Designer_NoResult= -FR-Designer-AlphaFine_SetShortcuts= -FR-Designer_Write_Enhance_Preview= -FR-Designer-StyleAlignment_Style_PartSpacing= -FR-Designer_Use_Params_Template= -FR-Designer_Label_Name= -FR-Designer_Insert-Chart= -FR-Designer_Insert-Text= -FR-Designer_Insert_Formula= diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 521e8e4015..bf72a516b7 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2073,37 +2073,9 @@ FR-Designer_CellWrite_Show_As_HTML= FR-Designer_Datasource_Other_Attributes= FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_CellElement_Property_Table= -FR-Designer_Add_Condition= FR-Designer_T_Insert_Float= FR-Designer_Add_FloatElement= FR-Designer_Insert_Image= FR-Designer_Insert_Chart= FR-Designer_Insert_Text= FR-Designer_Insert_Formula= - -FR-Designer_AlphaFine_Enable= -FR-Designer_AlphaFine_EnableAlphaFine= -FR-Designer_AlphaFine_EnableInternet= -FR-Designer_AlphaFine_EnableInternetSearch= -FR-Designer_AlphaFine_Shortcut_Config= -FR-Designer_AlphaFine_SearchRange= -FR-Designer_AlphaFine_Recommend= -FR-Designer-Plugin_Addon= -FR-Designer_Templates= -FR-Designer_Templates_Content= -FR-Designer_AlphaFine_ShowAll= -FR-Designer_AlphaFine_Latest= -FR-Designer_AlphaFine_ShowLess= -FR-Designer_AlphaFine= -FR-Designer-Alphafine_No_Remind= -FR-Designer_AlphaFine_NoResult= -FR-Designer_ConnectionFailed= -FR-Designer_NoResult= -FR-Designer-AlphaFine_SetShortcuts= -FR-Designer_Write_Enhance_Preview= -FR-Designer_Scale_customButton= -FR-Designer-StyleAlignment_Style_PartSpacing= -FR-Designer_Use_Params_Template= -FR-Designer_Label_Name= -FR-Designer_Insert-Chart= -FR-Designer_Insert-Text= diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 10506bc897..7d1d62e970 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2101,3 +2101,8 @@ FR-Designer_Insert_Image=\u63D2\u5165\u56FE\u7247 FR-Designer_Insert_Chart=\u63D2\u5165\u56FE\u8868 FR-Designer_Insert_Text=\u63D2\u5165\u666E\u901A\u6587\u672C FR-Designer_Insert_Formula=\u63D2\u5165\u516C\u5F0F +FR-Designer_Cell_Visible=\u5355\u5143\u683C\u53EF\u89C1 +FR-Designer_Float_Visible=\u60AC\u6D6E\u5143\u7D20\u53EF\u89C1 +FR-Designer_Cell_Value=\u5355\u5143\u683C\u503C +FR-Designer_Widget_Visible=\u63A7\u4EF6\u53EF\u89C1 +FR-Designer_Widget_Enabled=\u63A7\u4EF6\u53EF\u7528 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index bfd296c08d..186bc20bc2 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2092,18 +2092,9 @@ FR-Designer_CellWrite_Show_As_HTML= FR-Designer_Datasource_Other_Attributes= FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_CellElement_Property_Table= -FR-Designer_Add_Condition= FR-Designer_T_Insert_Float= FR-Designer_Add_FloatElement= FR-Designer_Insert_Image= FR-Designer_Insert_Chart= FR-Designer_Insert_Text= FR-Designer_Insert_Formula= - -FR-Designer_AlphaFine_EnableInternet= -FR-Designer_Scale_EnlargeOrReduce= -FR-Designer-StyleAlignment_Style_PartSpacing= -FR-Designer_Use_Params_Template= -FR-Designer_Label_Name= -FR-Designer_Insert-Chart= -FR-Designer_Insert-Text= diff --git a/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java b/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java index 18d223518b..ce6a905433 100644 --- a/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java +++ b/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java @@ -1 +1 @@ -package com.fr.design.mainframe; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:21 */ public abstract class AuthorityEditPane extends JPanel { protected static final int TOP_GAP = 11; protected static final int LEFT_GAP = 8; protected static final int ALIGNMENT_GAP = -3; protected UILabel type = null; protected UILabel name = null; protected JPanel checkPane = null; private TargetComponent target; public AuthorityEditPane(TargetComponent target) { this.target = target; setLayout(new BorderLayout()); type = new UILabel(); name = new UILabel(); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); this.add(layoutText(), BorderLayout.WEST); this.add(layoutPane(), BorderLayout.CENTER); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); } private JPanel layoutText() { double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{new UILabel(Inter.getLocText("Type") + ":", SwingConstants.RIGHT)}, new Component[]{new UILabel(Inter.getLocText("WF-Name") + ":", SwingConstants.RIGHT)}, new Component[]{new UILabel(Inter.getLocText("DashBoard-Potence") + ":", SwingConstants.RIGHT)}, }; double[] rowSize = {p, p, p}; double[] columnSize = {p}; int[][] rowCount = {{1}, {1}, {1}}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); } private JPanel layoutPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{type}, new Component[]{name}, new Component[]{checkPane}, }; double[] rowSize = {p, p, p}; double[] columnSize = {f}; int[][] rowCount = {{1}, {1}, {1}}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); } /** * 更新权限编辑面板的具体内容:类型、名称、权限面板 */ public void populateDetials() { populateType(); populateName(); checkPane.removeAll(); populateCheckPane(); checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); } public abstract void populateType(); public abstract void populateName(); public abstract JPanel populateCheckPane(); } \ No newline at end of file +package com.fr.design.mainframe; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:21 */ public abstract class AuthorityEditPane extends JPanel { protected static final int TOP_GAP = 11; protected static final int LEFT_GAP = 4; protected static final int RIGHT_GAP = 10; protected static final int ALIGNMENT_GAP = -3; protected static final int LEFT_CHECKPANE = 3; protected UILabel type = null; protected UILabel name = null; protected JPanel checkPane = null; private TargetComponent target; public AuthorityEditPane(TargetComponent target) { this.target = target; setLayout(new BorderLayout()); type = new UILabel(); type.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); name.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); // this.add(layoutText(), BorderLayout.WEST); // this.add(layoutPane(), BorderLayout.CENTER); this.add(centerPane(), BorderLayout.NORTH); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); } private JPanel centerPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p, p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), type}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), name}, new Component[]{checkPane, null}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); } /** * 更新权限编辑面板的具体内容:类型、名称、权限面板 */ public void populateDetials() { populateType(); populateName(); checkPane.removeAll(); populateCheckPane(); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); } public abstract void populateType(); public abstract void populateName(); public abstract JPanel populateCheckPane(); } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java b/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java index 62b356927e..162e2603cc 100644 --- a/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java +++ b/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java @@ -1 +1 @@ -package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:14 */ public class AuthorityPropertyPane extends JPanel { private static final int TITLE_HEIGHT = 19; private AuthorityEditPane authorityEditPane = null; public AuthorityPropertyPane(TargetComponent t) { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); authorityTitle.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); this.add(northPane, BorderLayout.NORTH); authorityEditPane = t.createAuthorityEditPane(); UIScrollPane scrollPane = new UIScrollPane(authorityEditPane); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void populate() { authorityEditPane.populateDetials(); } } \ No newline at end of file +package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:14 */ public class AuthorityPropertyPane extends JPanel { private static final int TITLE_HEIGHT = 19; private AuthorityEditPane authorityEditPane = null; public AuthorityPropertyPane(TargetComponent t) { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); authorityTitle.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); // this.add(northPane, BorderLayout.NORTH); authorityEditPane = t.createAuthorityEditPane(); UIScrollPane scrollPane = new UIScrollPane(authorityEditPane); scrollPane.setBorder(null); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void populate() { authorityEditPane.populateDetials(); } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java index b0d87fc853..ddad370b22 100644 --- a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java @@ -54,7 +54,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { POLY, // 聚合报表 POLY_REPORT, // 聚合报表-报表块 POLY_CHART, // 聚合报表-图表块 - AUTHORITY_EDITION // 权限编辑 + AUTHORITY_EDITION, // 权限编辑 + AUTHORITY_EDITION_DISABLED // 权限编辑 } private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板) @@ -115,11 +116,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { new PropertyMode[]{PropertyMode.FORM}); // 权限编辑 PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, Inter.getLocText("FR-Designer_Permissions_Edition"), - "authorityedit", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, + "authorityedit", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION_DISABLED}, new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}); // 已配置角色 PropertyItem configuredRoles = new PropertyItem(KEY_CONFIGURED_ROLES, Inter.getLocText("FR-Designer_Configured_Roles"), - "configuredroles", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, + "configuredroles", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION_DISABLED}, new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}); propertyItemMap.put(KEY_CELL_ELEMENT, cellElement); diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 3feba5efa4..dff24b1a22 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -16,12 +16,14 @@ import javax.swing.*; import javax.swing.border.MatteBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.basic.BasicSliderUI; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.awt.geom.RoundRectangle2D; import java.math.BigDecimal; /** @@ -35,7 +37,7 @@ public class JSliderPane extends JPanel { private static final int ONE_EIGHT = 18; private static final int FONT_SIZE = 14; private static final int SPINNER_WIDTH = 45; - private static final int SPINNER_HEIGHT = 20; + private static final int SPINNER_HEIGHT = 16; private static final int HALF_HUNDRED = 50; private static final int HUNDRED = 100; private static final int TWO_HUNDRED = 200; @@ -43,8 +45,12 @@ public class JSliderPane extends JPanel { private static final int FOUR_HUNDRED = 400; private static final int DIALOG_WIDTH = 150; private static final int DIALOG_HEIGHT = 240; - private static final int SHOWVALBUTTON_WIDTH = 70; - private static final int SHOWVALBUTTON_HEIGHTH = 25; + private static final int SLIDER_WIDTH = 220; + private static final int SLIDER_HEIGHT = 20; + private static final int SHOWVALBUTTON_WIDTH = 40; + private static final int SHOWVALBUTTON_HEIGHTH = 20; + private static final int SLIDER_GAP = 5; + private static final Color BACK_COLOR = new Color(245,245,247); public int showValue = 100; public double resolutionTimes = 1.0; private static JSliderPane THIS; @@ -55,7 +61,7 @@ public class JSliderPane extends JPanel { private int sliderValue; private UIButton downButton; private UIButton upButton; - private UIButton showValButton; + private JButton showValButton; private UIRadioButton twoHundredButton; private UIRadioButton oneHundredButton; private UIRadioButton SevenFiveButton; @@ -75,7 +81,9 @@ public class JSliderPane extends JPanel { slider = new UISlider(0, HUNDRED, HALF_HUNDRED); slider.setUI(new JSliderPaneUI(slider)); slider.addChangeListener(listener); - + slider.setPreferredSize(new Dimension(220, 20)); + //去掉虚线框 + slider.setFocusable(false); showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)); showValSpinner.setEnabled(true); showValSpinner.addChangeListener(showValSpinnerChangeListener); @@ -88,26 +96,37 @@ public class JSliderPane extends JPanel { // DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory(); // NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter(); // formatter.setAllowsInvalid(false); - downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/moveDown.png")); - upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/moveUp.png")); + downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")); +// downButton.setPreferredSize(new Dimension(16,16)); + downButton.setOpaque(false); + downButton.setBorderPainted(false); + upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")); +// upButton.setPreferredSize(new Dimension(21,21)); + upButton.setOpaque(false); + upButton.setBorderPainted(false); downButton.setActionCommand("less"); upButton.setActionCommand("more"); downButton.addActionListener(buttonActionListener); upButton.addActionListener(buttonActionListener); - showValButton = new UIButton(showValSpinner.getValue() + "%"); + showValButton = new JButton(showValSpinner.getValue() + "%"); + showValButton.setOpaque(false); + showValButton.setMargin(new Insets(0,0,0,0)); + showValButton.setFont(new Font("OpenSans", Font.PLAIN, 12)); + showValButton.setBackground(BACK_COLOR); showValButton.setBorderPainted(false); showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); showValButton.addActionListener(showValButtonActionListener); initUIRadioButton(); initPane(); - JPanel panel = new JPanel(new FlowLayout(1, 1, 0)); + JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); panel.add(downButton); panel.add(slider); panel.add(upButton); panel.add(showValButton); + panel.setBackground(BACK_COLOR); this.add(panel, BorderLayout.NORTH); - this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT); +// this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT); } public static final JSliderPane getInstance() { @@ -314,14 +333,14 @@ public class JSliderPane extends JPanel { dialog = new PopupPane(upButton, dialogContentPanel); if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); } } else { if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); } else { - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); } } } @@ -341,6 +360,7 @@ public class JSliderPane extends JPanel { class JSliderPaneUI extends BasicSliderUI { + private static final Color BACK_COLOR = new Color(245,245,247); private static final int VERTICAL_WIDTH = 11; private static final int VERTICAL_HEIGHT = 16; private static final int FOUR = 4; @@ -356,33 +376,18 @@ class JSliderPaneUI extends BasicSliderUI { * 绘制指示物 */ - public Dimension getThumbSize() { - Dimension size = new Dimension(); - - if (slider.getOrientation() == JSlider.VERTICAL) { - size.width = VERTICAL_WIDTH; - size.height = VERTICAL_HEIGHT; - } else { - size.width = VERTICAL_WIDTH; - size.height = VERTICAL_HEIGHT; - } - - return size; - } - public void paintThumb(Graphics g) { Rectangle knobBounds = thumbRect; int w = knobBounds.width; int h = knobBounds.height; - - g.translate(knobBounds.x, knobBounds.y); - if (slider.isEnabled()) { - g.setColor(slider.getBackground()); - } else { - g.setColor(slider.getBackground().darker()); - } - g.setColor(Color.darkGray); - g.fillRect(0, 1, w - SIX, h + 1); + Graphics2D g2d = (Graphics2D) g; + + g2d.translate(knobBounds.x, knobBounds.y); +// g2d.setColor(slider.getBackground()); +// g2d.fillRect(0, FOUR, FOUR, 9); + g2d.setColor(new Color(51,51,52)); + g2d.drawRoundRect(0,SIX,FOUR,9,2,2); + g2d.fillRoundRect(0,SIX,FOUR,9,2,2); } /** */ @@ -396,8 +401,10 @@ class JSliderPaneUI extends BasicSliderUI { Graphics2D g2 = (Graphics2D) g; cy = (trackBounds.height / 2); cw = trackBounds.width; - g.setColor(Color.lightGray); - g.drawLine(0, cy, cw + FIVE, cy); + g2.setPaint(BACK_COLOR); + g2.fillRect(0, -cy, cw + 10, cy * 4); + g.setColor(new Color(216,216,216)); + g.drawLine(0, cy, cw +3, cy); g.drawLine(FIVE + cw / 2, cy - FOUR, FIVE + cw / 2, cy + FOUR); } else { super.paintTrack(g); @@ -409,13 +416,13 @@ class JSliderPaneUI extends BasicSliderUI { class PopupPane extends JPopupMenu { private JComponent contentPane; private static final int UPLABEL_HEIGHT = 25; - private static final int DIALOG_WIDTH = 150; + private static final int DIALOG_WIDTH = 157; private static final int DIALOG_HEIGHT = 240; private static final int UPLABEL_WIDTH = 300; private JComponent centerPane; private UILabel upLabel; - PopupPane(UIButton b, JPanel dialogContentPanel) { + PopupPane(JButton b, JPanel dialogContentPanel) { contentPane = new JPanel(new BorderLayout()); centerPane = new JPanel(new BorderLayout()); upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce")); diff --git a/designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java b/designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java index 893d63425a..da3c49782c 100644 --- a/designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java +++ b/designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java @@ -1 +1 @@ -package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-22 * Time: 上午10:05 */ public class NoSupportAuthorityEdit extends AuthorityEditPane { private static final int TITLE_HEIGHT = 19; public NoSupportAuthorityEdit() { super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); this.setLayout(new BorderLayout()); this.setBorder(null); UILabel title = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; title.setHorizontalAlignment(SwingConstants.CENTER); title.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(title, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); this.add(northPane, BorderLayout.NORTH); this.add(createTextPane(), BorderLayout.CENTER); } private JPanel createTextPane() { JPanel panel = new JPanel(new BorderLayout()); UILabel uiLabel = new UILabel(Inter.getLocText("not_support_authority_edit")); uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setVerticalAlignment(SwingConstants.CENTER); panel.add(uiLabel, BorderLayout.CENTER); return panel; } @Override public void populateType() { } @Override public void populateName() { } @Override public JPanel populateCheckPane() { return null; } } \ No newline at end of file +package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-22 * Time: 上午10:05 */ public class NoSupportAuthorityEdit extends AuthorityEditPane { private static final int TITLE_HEIGHT = 19; public NoSupportAuthorityEdit() { super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); this.setLayout(new BorderLayout()); this.setBorder(null); UILabel title = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; title.setHorizontalAlignment(SwingConstants.CENTER); title.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(title, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); // this.add(northPane, BorderLayout.NORTH); this.add(createTextPane(), BorderLayout.CENTER); } private JPanel createTextPane() { JPanel panel = new JPanel(new BorderLayout()); UILabel uiLabel = new UILabel(Inter.getLocText("not_support_authority_edit")); uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setVerticalAlignment(SwingConstants.CENTER); panel.add(uiLabel, BorderLayout.CENTER); return panel; } @Override public void populateType() { } @Override public void populateName() { } @Override public JPanel populateCheckPane() { return null; } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java b/designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java index 540c3bd8f3..4dd2450c43 100644 --- a/designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java +++ b/designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java @@ -1 +1 @@ -package com.fr.design.roleAuthority; import com.fr.base.BaseUtils; import com.fr.general.NameObject; import com.fr.design.constants.UIConstants; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DockingView; import com.fr.general.Inter; import javax.swing.*; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import java.awt.*; import java.util.Enumeration; /** * Author : daisy * Date: 13-9-25 * Time: 下午4:34 */ public class RolesAlreadyEditedPane extends JPanel { private static final int TITLE_HEIGHT = 19; private static final int LEFT_GAP = 11; private static final int TOP_GAP = -1; private static RolesAlreadyEditedPane THIS; private RolesEditedPane rolesEditedPane; /** * 得到实例 * * @return */ public static final RolesAlreadyEditedPane getInstance() { if (THIS == null) { THIS = new RolesAlreadyEditedPane(); } return THIS; } public RolesAlreadyEditedPane() { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText("roles_already_authority_edited")) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); authorityTitle.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); this.add(northPane, BorderLayout.NORTH); rolesEditedPane = new RolesEditedPane(); this.add(rolesEditedPane, BorderLayout.CENTER); } public RoleTree getRoleTree() { return rolesEditedPane.roleTree; } public void refreshDockingView() { rolesEditedPane.refreshDockingView(); } public void setReportAndFSSelectedRoles() { rolesEditedPane.setSelectedRole(); } private class RolesEditedPane extends DockingView { private RoleTree roleTree; private RolesEditedSourceOP op; private DefaultTreeCellRenderer roleTreeRenderer = new DefaultTreeCellRenderer() { private static final long serialVersionUID = 2L; public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); ExpandMutableTreeNode treeNode = (ExpandMutableTreeNode) value; Object userObj = treeNode.getUserObject(); if (userObj instanceof String) { // p:这个是column field. this.setIcon(null); this.setText((String) userObj); } else if (userObj instanceof NameObject) { NameObject nameObject = (NameObject) userObj; this.setText(nameObject.getName()); if (nameObject.getName() == Inter.getLocText("M_Server-Platform_Manager")) { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/platform_16_16.png")); } else { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/demo.png")); } } // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); this.setForeground(UIConstants.FONT_COLOR); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); return this; } }; public RolesEditedPane() { roleTree = new RoleTree() { public void refreshRoleTree(String selectedRole) { super.refreshRoleTree(selectedRole); RoleTree roleTree = ReportAndFSManagePane.getInstance().getRoleTree(); TreeNode root = (TreeNode) roleTree.getModel().getRoot(); TreePath parent = new TreePath(root); roleTree.setSelectedRole(selectedRole, parent); } }; roleTree.setCellRenderer(roleTreeRenderer); roleTree.setEditable(false); op = new RolesEditedSourceOP(); UIScrollPane scrollPane = new UIScrollPane(roleTree) { public Dimension getPreferredSize() { return new Dimension(RolesEditedPane.this.getWidth(), RolesEditedPane.this.getHeight()); } }; scrollPane.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void refreshDockingView() { this.op = new RolesEditedSourceOP(); roleTree.populate(op); expandTree(roleTree, true); } private void setSelectedRole() { String name = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); TreeNode root = (TreeNode) roleTree.getModel().getRoot(); TreePath parent = new TreePath(root); roleTree.setSelectedRole(name, parent); } public String getViewTitle() { return null; } public Icon getViewIcon() { return null; } public Location preferredLocation() { return null; } public void expandTree(JTree tree, boolean isExpand) { TreeNode root = (TreeNode) tree.getModel().getRoot(); expandAll(tree, new TreePath(root), isExpand); } private void expandAll(JTree tree, TreePath parent, boolean expand) { TreeNode node = (TreeNode) parent.getLastPathComponent(); if (node.getChildCount() >= 0) { for (Enumeration e = node.children(); e.hasMoreElements(); ) { TreeNode n = (TreeNode) e.nextElement(); TreePath path = parent.pathByAddingChild(n); expandAll(tree, path, expand); } } if (expand) { tree.expandPath(parent); } else { tree.collapsePath(parent); } } } } \ No newline at end of file +package com.fr.design.roleAuthority; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DockingView; import com.fr.general.Inter; import com.fr.general.NameObject; import javax.swing.*; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import java.awt.*; import java.util.Enumeration; /** * Author : daisy * Date: 13-9-25 * Time: 下午4:34 */ public class RolesAlreadyEditedPane extends JPanel { private static final int TITLE_HEIGHT = 19; private static final int LEFT_GAP = 8; private static final int TOP_GAP = -1; private static RolesAlreadyEditedPane THIS; private RolesEditedPane rolesEditedPane; /** * 得到实例 * * @return */ public static final RolesAlreadyEditedPane getInstance() { if (THIS == null) { THIS = new RolesAlreadyEditedPane(); } return THIS; } public RolesAlreadyEditedPane() { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText("roles_already_authority_edited")) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); authorityTitle.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); // this.add(northPane, BorderLayout.NORTH); rolesEditedPane = new RolesEditedPane(); this.add(rolesEditedPane, BorderLayout.CENTER); } public RoleTree getRoleTree() { return rolesEditedPane.roleTree; } public void refreshDockingView() { rolesEditedPane.refreshDockingView(); } public void setReportAndFSSelectedRoles() { rolesEditedPane.setSelectedRole(); } private class RolesEditedPane extends DockingView { private RoleTree roleTree; private RolesEditedSourceOP op; private DefaultTreeCellRenderer roleTreeRenderer = new DefaultTreeCellRenderer() { private static final long serialVersionUID = 2L; public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); ExpandMutableTreeNode treeNode = (ExpandMutableTreeNode) value; Object userObj = treeNode.getUserObject(); if (userObj instanceof String) { // p:这个是column field. this.setIcon(null); this.setText((String) userObj); } else if (userObj instanceof NameObject) { NameObject nameObject = (NameObject) userObj; this.setText(nameObject.getName()); if (nameObject.getName() == Inter.getLocText("M_Server-Platform_Manager")) { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/platform_16_16.png")); } else { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/demo.png")); } } // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); this.setForeground(UIConstants.FONT_COLOR); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); return this; } }; public RolesEditedPane() { roleTree = new RoleTree() { public void refreshRoleTree(String selectedRole) { super.refreshRoleTree(selectedRole); RoleTree roleTree = ReportAndFSManagePane.getInstance().getRoleTree(); TreeNode root = (TreeNode) roleTree.getModel().getRoot(); TreePath parent = new TreePath(root); roleTree.setSelectedRole(selectedRole, parent); } }; roleTree.setCellRenderer(roleTreeRenderer); roleTree.setEditable(false); op = new RolesEditedSourceOP(); UIScrollPane scrollPane = new UIScrollPane(roleTree) { public Dimension getPreferredSize() { return new Dimension(RolesEditedPane.this.getWidth(), RolesEditedPane.this.getHeight()); } }; scrollPane.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void refreshDockingView() { this.op = new RolesEditedSourceOP(); roleTree.populate(op); expandTree(roleTree, true); } private void setSelectedRole() { String name = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); TreeNode root = (TreeNode) roleTree.getModel().getRoot(); TreePath parent = new TreePath(root); roleTree.setSelectedRole(name, parent); } public String getViewTitle() { return null; } public Icon getViewIcon() { return null; } public Location preferredLocation() { return null; } public void expandTree(JTree tree, boolean isExpand) { TreeNode root = (TreeNode) tree.getModel().getRoot(); expandAll(tree, new TreePath(root), isExpand); } private void expandAll(JTree tree, TreePath parent, boolean expand) { TreeNode node = (TreeNode) parent.getLastPathComponent(); if (node.getChildCount() >= 0) { for (Enumeration e = node.children(); e.hasMoreElements(); ) { TreeNode n = (TreeNode) e.nextElement(); TreePath path = parent.pathByAddingChild(n); expandAll(tree, path, expand); } } if (expand) { tree.expandPath(parent); } else { tree.collapsePath(parent); } } } } \ No newline at end of file diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index f79baf4606..76d7aec454 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -57,10 +57,10 @@ public abstract class BaseDesigner extends ToolBarMenuDock { DesignUtils.setPort(getStartPort()); // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 - if (DesignUtils.isStarted()) { - DesignUtils.clientSend(args); - return; - } +// if (DesignUtils.isStarted()) { +// DesignUtils.clientSend(args); +// return; +// } BuildContext.setBuildFilePath(buildPropertiesPath()); //下面这两句的位置不能随便调换,因为会影响语言切换的问题 diff --git a/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java b/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java index 64decd2afc..38c33c4448 100644 --- a/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java +++ b/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java @@ -34,8 +34,8 @@ import com.fr.general.Inter; public class FormWidgetAuthorityEditPane extends AuthorityEditPane { private FormDesigner designer; private Widget[] widgets = null; - private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); - private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Enabled")); + private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Visible")); + private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Enabled")); private ItemListener visibleItemListener = new ItemListener() { public void itemStateChanged(ItemEvent e) { String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); @@ -88,23 +88,19 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { } /** - * 更新类型面板 - * - * - * @date 2014-12-21-下午6:19:43 - * - */ + * 更新类型面板 + * + * @date 2014-12-21-下午6:19:43 + */ public void populateType() { - type.setText(Inter.getLocText("Widget-Form_Widget_Config")); + type.setText(" " + Inter.getLocText("Widget-Form_Widget_Config")); } /** - * 更新名称面板 - * - * - * @date 2014-12-21-下午7:12:27 - * - */ + * 更新名称面板 + * + * @date 2014-12-21-下午7:12:27 + */ public void populateName() { String nameText = ""; if (widgets == null || widgets.length <= 0) { @@ -113,33 +109,31 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { for (int i = 0; i < widgets.length; i++) { nameText += "," + widgets[i].getClass().getSimpleName(); } - name.setText(nameText.substring(1)); + name.setText(" " + nameText.substring(1)); } /** - * 更新checkbox所在的面板 - * - * @return 面板 - * - * - * @date 2014-12-21-下午6:19:03 - * - */ + * 更新checkbox所在的面板 + * + * @return 面板 + * @date 2014-12-21-下午6:19:03 + */ public JPanel populateCheckPane() { - checkPane.add(populateWidgetCheckPane(), BorderLayout.WEST); + checkPane.add(populateWidgetCheckPane(), BorderLayout.CENTER); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); return checkPane; } private JPanel populateWidgetCheckPane() { - double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget"), SwingConstants.LEFT), widgetVisible, widgetAvailable} + new Component[]{widgetVisible}, + new Component[]{widgetAvailable} }; - double[] rowSize = {p}; - double[] columnSize = {p, p, f}; - int[][] rowCount = {{1, 1, 1}}; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + double[] rowSize = {p, p}; + double[] columnSize = {p}; + int[][] rowCount = {{1},{1}}; + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL); } @@ -157,7 +151,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { populateName(); checkPane.removeAll(); populateCheckPane(); - checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); checkCheckBoxes(); } @@ -169,25 +163,25 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { widgetVisible.addItemListener(visibleItemListener); widgetAvailable.addItemListener(usableItemListener); } - - private void populateWidgetButton(String selected){ + + private void populateWidgetButton(String selected) { if (widgets == null || widgets.length == 0) { - return; + return; } - + //选中多个, 界面上只取第一个 Widget widget = widgets[0]; - - if(widget.isVisible()){ - widgetVisible.setSelected(!widget.isDoneVisibleAuthority(selected)); - }else{ - widgetVisible.setSelected(widget.isVisibleAuthority(selected)); + + if (widget.isVisible()) { + widgetVisible.setSelected(!widget.isDoneVisibleAuthority(selected)); + } else { + widgetVisible.setSelected(widget.isVisibleAuthority(selected)); } - - if(widget.isEnabled()){ - widgetAvailable.setSelected(!widget.isDoneUsableAuthority(selected)); - }else{ - widgetAvailable.setSelected(widget.isUsableAuthority(selected)); + + if (widget.isEnabled()) { + widgetAvailable.setSelected(!widget.isDoneUsableAuthority(selected)); + } else { + widgetAvailable.setSelected(widget.isUsableAuthority(selected)); } } diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 986b91f0ba..7572cc2042 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -475,7 +475,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection paraHeight = 0; paraComponent = null; formLayoutContainer.setSize(rootComponent.getWidth(), rootComponent.getHeight()); - EastRegionContainerPane.getInstance().replaceDownPane(this.getEastDownPane()); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(this.getEastDownPane()); //atat //EastRegionContainerPane.getInstance().addTitlePane(ParameterPropertyPane.getInstance(FormDesigner.this)); //删除后重绘下 @@ -1042,11 +1042,13 @@ public class FormDesigner extends TargetComponent implements TreeSelection if (isSupportAuthority()) { AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(this); authorityPropertyPane.populate(); - EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); } else { - EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit()); } - EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); } /** @@ -1259,13 +1261,13 @@ public class FormDesigner extends TargetComponent implements TreeSelection pane.setLayout(new BorderLayout()); pane.add(FormWidgetDetailPane.getInstance(FormDesigner.this), BorderLayout.CENTER); - EastRegionContainerPane.getInstance().replaceDownPane(pane); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(pane); } }.start(); } else { pane.setLayout(new BorderLayout()); pane.add(FormWidgetDetailPane.getInstance(this), BorderLayout.CENTER); - EastRegionContainerPane.getInstance().replaceDownPane(pane); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(pane); } return pane; diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 23299f30b1..93b51fbf60 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -649,11 +649,13 @@ public class JForm extends JTemplate implements BaseJForm { WidgetToolBarPane.getInstance(formDesign); if (BaseUtils.isAuthorityEditing()) { if (formDesign.isSupportAuthority()) { - EastRegionContainerPane.getInstance().replaceUpPane(new AuthorityPropertyPane(this)); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new AuthorityPropertyPane(this)); } else { - EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit()); } - EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); return; } From 3ac3f2df15da1b968248a3b2d242e11ec833b7cf Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 2 Aug 2017 17:07:32 +0800 Subject: [PATCH 05/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E6=9D=83=E9=99=90=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E3=80=81=E7=BC=A9=E6=94=BE=E6=9D=A1=E9=83=A8=E5=88=86?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/foldablepane/HeaderPane.java | 2 +- .../design/images/data/source/hoverDown20.png | Bin 198 -> 0 bytes .../fr/design/images/data/source/hoverUp.png | Bin 240 -> 0 bytes .../design/images/data/source/hoverUp20.png | Bin 232 -> 0 bytes .../design/images/data/source/hoverUp@2x.png | Bin 406 -> 0 bytes .../images/data/source/normalDown20.png | Bin 197 -> 0 bytes .../fr/design/images/data/source/normalUp.png | Bin 220 -> 0 bytes .../design/images/data/source/normalUp20.png | Bin 235 -> 0 bytes .../design/images/data/source/normalUp@2x.png | Bin 387 -> 0 bytes .../com/fr/design/mainframe/JSliderPane.java | 22 ++++++++---------- 10 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 designer_base/src/com/fr/design/images/data/source/hoverDown20.png delete mode 100644 designer_base/src/com/fr/design/images/data/source/hoverUp.png delete mode 100644 designer_base/src/com/fr/design/images/data/source/hoverUp20.png delete mode 100644 designer_base/src/com/fr/design/images/data/source/hoverUp@2x.png delete mode 100644 designer_base/src/com/fr/design/images/data/source/normalDown20.png delete mode 100644 designer_base/src/com/fr/design/images/data/source/normalUp.png delete mode 100644 designer_base/src/com/fr/design/images/data/source/normalUp20.png delete mode 100644 designer_base/src/com/fr/design/images/data/source/normalUp@2x.png diff --git a/designer_base/src/com/fr/design/foldablepane/HeaderPane.java b/designer_base/src/com/fr/design/foldablepane/HeaderPane.java index 0b7d92ab6b..929b3b9d32 100644 --- a/designer_base/src/com/fr/design/foldablepane/HeaderPane.java +++ b/designer_base/src/com/fr/design/foldablepane/HeaderPane.java @@ -55,7 +55,7 @@ public class HeaderPane extends JPanel { g2d.fillRect(0, 0, headWidth, headHeight); g2d.drawImage(UIConstants.DRAG_BAR, 0, 0, headWidth, headHeight, null); - g2d.setFont(new Font("OpenSans", 0, fontSize)); + g2d.setFont(new Font("SimSun", 0, fontSize)); g2d.setPaint(bgColor); // g2d.drawString(this.title, fontSize/2, headHeight-fontSize/3); g2d.drawString(this.title, 0, headHeight - fontSize / 2 - 1); diff --git a/designer_base/src/com/fr/design/images/data/source/hoverDown20.png b/designer_base/src/com/fr/design/images/data/source/hoverDown20.png deleted file mode 100644 index 815dae49683e2b6cc6185645c0953e4d03764b83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1Ig22U5q5DUTN zJ;l!(pYQ))pZ@p%d45Fl4LUyNf8r1Q<8OY zFGI%G&6gK}6HK@m zBAJ5tg;}HZoOcbCVt`Q$!E+Atej>NGaOaLfUainboFyt=akR{0Gvl#IRF3v diff --git a/designer_base/src/com/fr/design/images/data/source/hoverUp20.png b/designer_base/src/com/fr/design/images/data/source/hoverUp20.png deleted file mode 100644 index f5b2ad6c5276a9ca9e2b1751cb848ea5840293e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1IgMV>B>Ar^wk zdy1boKHvYpKK<|i^9qL@7!y)bDh?evG3Qvt>u-0DPmy9PX1@`TCCO$ak|HL2rX=ek zbNYjei`_dvv0T)fW0fjY%Byn9WP#G6Sc?QUqkDTwzuWJ6yMRMM?aZd)PZDd^t_|Fh zY%1W&Iz?Di^4x};pI$jZ8cEIeJnZLMfvVU9WHpaSumw5S>Nj(_CgrLx;fp!Y)Sas( d!L^!+LGFc-)RFmjl7Oyd@O1TaS?83{1OQ&WQ=I?+ diff --git a/designer_base/src/com/fr/design/images/data/source/hoverUp@2x.png b/designer_base/src/com/fr/design/images/data/source/hoverUp@2x.png deleted file mode 100644 index cff495dd24cb4439a1ffe86119c6eec06bcddd0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 406 zcmV;H0crk;P)Px$P)S5VR9Fe^SIvsTFc6**(Yv<=Z=!p2eFNWO(FZ9$g7iTw`xd@|yGIpog16rF zV9Z!D%`{q!bQLs#lFU!$n|?`$DL@$S&H&m3tk>JNQu|l|4gu7MZM%PsI|MaHY)0K~ zds~dd2@v>E9sV?MtLRjXjA;!U{bCX|6P(`s|G)`FwK5EYn9X?tXWFH)Op4P(+9>mdQGvPdJ2w&X`D-wMD4MY1 zv)5rvQa<1a1Rf`17HqW{FvhZZJo-MHXUR{Qn`3(d15OS?@qi-`c#aSf2n;-(0jndz zolhrB6%K&Qh;zFyD+oglPJmixU5iK3d|k53>vb<_Aq=UpN-_2A`i;_}Lv=Ey8HS9= zcYykJ>f1G`iB80!N^bL!=*I+-OaBBuQC`>g1RE7jX^40$FaQ7m07*qoM6N<$g7WvR AaR2}S diff --git a/designer_base/src/com/fr/design/images/data/source/normalDown20.png b/designer_base/src/com/fr/design/images/data/source/normalDown20.png deleted file mode 100644 index 0e4e114e0217f53b9bdcb19634bae91d083e691c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1IgdQTU}5DUTN zKOY~rKi^;fKmG6j^9qL@7!y)bDh?evGUM2fx3|9^pCZLp%zh%^*!uYW|JykOn$s4w zDV|8{k?N3yHVq*iH z7*;oGXf2SjwvKLdZs$v$>?A1tC()unkHwY2u;GP=;xU5>Qm?8dLo|f4trbfr1WAYF g1Ro6ONbJdExXoj1xk|KWC(ywRp00i_>zopr0N)H(0RR91 diff --git a/designer_base/src/com/fr/design/images/data/source/normalUp@2x.png b/designer_base/src/com/fr/design/images/data/source/normalUp@2x.png deleted file mode 100644 index 901f6a1db1a01373ed4b490a4d4b726694aa6528..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 387 zcmV-}0et?6P)Px$JxN4CR9Fe^S4|GVKoou>7Fs(yi96V`(6|Qoz!`84y@s%0>kbk-yH1vkxCLGN{T|HcOY)mdhcGetg)PwV zh)8TumMah^v#y>uxTQCnZC06)t3UyRgBJM07HD{eV+mLVDp!C{L?`u#8WW50*xmzp z!U51R@~kWwM+|LIhcLXX)XX;0vL!oeJojDK8S}P`K*eJ@&g(e0BTL25kczV|Xyb>8 hpY}~qu+NW{UjZChNj$R3Z!`b^002ovPDHLkV1iHTpH%<= diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index dff24b1a22..2d17bd43c9 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; @@ -35,16 +36,16 @@ public class JSliderPane extends JPanel { private static final int SIX = 6; private static final int TEN = 10; private static final int ONE_EIGHT = 18; - private static final int FONT_SIZE = 14; + private static final int FONT_SIZE = 12; private static final int SPINNER_WIDTH = 45; - private static final int SPINNER_HEIGHT = 16; + private static final int SPINNER_HEIGHT = 20; private static final int HALF_HUNDRED = 50; private static final int HUNDRED = 100; private static final int TWO_HUNDRED = 200; private static final int THREE_HUNDRED = 300; private static final int FOUR_HUNDRED = 400; private static final int DIALOG_WIDTH = 150; - private static final int DIALOG_HEIGHT = 240; + private static final int DIALOG_HEIGHT = 200; private static final int SLIDER_WIDTH = 220; private static final int SLIDER_HEIGHT = 20; private static final int SHOWVALBUTTON_WIDTH = 40; @@ -97,22 +98,19 @@ public class JSliderPane extends JPanel { // NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter(); // formatter.setAllowsInvalid(false); downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")); -// downButton.setPreferredSize(new Dimension(16,16)); downButton.setOpaque(false); downButton.setBorderPainted(false); upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")); -// upButton.setPreferredSize(new Dimension(21,21)); upButton.setOpaque(false); upButton.setBorderPainted(false); downButton.setActionCommand("less"); upButton.setActionCommand("more"); downButton.addActionListener(buttonActionListener); upButton.addActionListener(buttonActionListener); - showValButton = new JButton(showValSpinner.getValue() + "%"); showValButton.setOpaque(false); showValButton.setMargin(new Insets(0,0,0,0)); - showValButton.setFont(new Font("OpenSans", Font.PLAIN, 12)); + showValButton.setFont(new Font("SimSun", Font.PLAIN, 12)); showValButton.setBackground(BACK_COLOR); showValButton.setBorderPainted(false); showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); @@ -126,7 +124,6 @@ public class JSliderPane extends JPanel { panel.add(showValButton); panel.setBackground(BACK_COLOR); this.add(panel, BorderLayout.NORTH); -// this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT); } public static final JSliderPane getInstance() { @@ -144,7 +141,9 @@ public class JSliderPane extends JPanel { fiveTenButton = new UIRadioButton("50%"); twoFiveButton = new UIRadioButton("25%"); selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton")); + selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); customButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton")); + customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); twoHundredButton.addItemListener(radioButtonItemListener); oneHundredButton.addItemListener(radioButtonItemListener); SevenFiveButton.addItemListener(radioButtonItemListener); @@ -178,14 +177,14 @@ public class JSliderPane extends JPanel { new Component[]{selfAdaptButton, null}, new Component[]{customButton, createSpinnerPanel()} }; - dialogContentPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); } private JPanel createSpinnerPanel() { JPanel spinnerPanel = new JPanel(new FlowLayout()); spinnerPanel.add(showValSpinner); UILabel percent = new UILabel("%"); - percent.setFont(new Font("Dialog", Font.PLAIN, FONT_SIZE)); + percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); spinnerPanel.add(percent); return spinnerPanel; } @@ -417,7 +416,7 @@ class PopupPane extends JPopupMenu { private JComponent contentPane; private static final int UPLABEL_HEIGHT = 25; private static final int DIALOG_WIDTH = 157; - private static final int DIALOG_HEIGHT = 240; + private static final int DIALOG_HEIGHT = 200; private static final int UPLABEL_WIDTH = 300; private JComponent centerPane; private UILabel upLabel; @@ -433,7 +432,6 @@ class PopupPane extends JPopupMenu { centerPane.add(dialogContentPanel, BorderLayout.NORTH); contentPane.add(upLabel, BorderLayout.NORTH); contentPane.add(centerPane, BorderLayout.CENTER); -// contentPane.setBorder(new MatteBorder(1,1,1,1,Color.darkGray)); this.add(contentPane, BorderLayout.CENTER); this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); this.setOpaque(false); From e1f026dc7c9131d73c78200923831d24fa5052c9 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 2 Aug 2017 17:54:37 +0800 Subject: [PATCH 06/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E7=BC=A9=E6=94=BE=E6=9D=A1?= =?UTF-8?q?=E9=83=A8=E5=88=86=E8=A7=86=E8=A7=89png?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/images/data/source/hoverDown20.png | Bin 0 -> 198 bytes .../design/images/data/source/hoverUp20.png | Bin 0 -> 232 bytes .../images/data/source/normalDown20.png | Bin 0 -> 197 bytes .../design/images/data/source/normalUp20.png | Bin 0 -> 235 bytes .../com/fr/design/mainframe/JSliderPane.java | 45 ++++++++++-------- 5 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/data/source/hoverDown20.png create mode 100644 designer_base/src/com/fr/design/images/data/source/hoverUp20.png create mode 100644 designer_base/src/com/fr/design/images/data/source/normalDown20.png create mode 100644 designer_base/src/com/fr/design/images/data/source/normalUp20.png diff --git a/designer_base/src/com/fr/design/images/data/source/hoverDown20.png b/designer_base/src/com/fr/design/images/data/source/hoverDown20.png new file mode 100644 index 0000000000000000000000000000000000000000..815dae49683e2b6cc6185645c0953e4d03764b83 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1Ig22U5q5DUTN zJ;l!(pYQ))pZ@p%d45Fl4LUyNf8r1Q<8OY zFB>Ar^wk zdy1boKHvYpKK<|i^9qL@7!y)bDh?evG3Qvt>u-0DPmy9PX1@`TCCO$ak|HL2rX=ek zbNYjei`_dvv0T)fW0fjY%Byn9WP#G6Sc?QUqkDTwzuWJ6yMRMM?aZd)PZDd^t_|Fh zY%1W&Iz?Di^4x};pI$jZ8cEIeJnZLMfvVU9WHpaSumw5S>Nj(_CgrLx;fp!Y)Sas( d!L^!+LGFc-)RFmjl7Oyd@O1TaS?83{1OQ&WQ=I?+ literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/data/source/normalDown20.png b/designer_base/src/com/fr/design/images/data/source/normalDown20.png new file mode 100644 index 0000000000000000000000000000000000000000..0e4e114e0217f53b9bdcb19634bae91d083e691c GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1IgdQTU}5DUTN zKOY~rKi^;fKmG6j^9qL@7!y)bDh?evGUM2fx3|9^pCZLp%zh%^*!uYW|JykOn$s4w zDV|8{k?N3yHVq*iH z7*;oGXf2SjwvKLdZs$v$>?A1tC()unkHwY2u;GP=;xU5>Qm?8dLo|f4trbfr1WAYF g1Ro6ONbJdExXoj1xk|KWC(ywRp00i_>zopr0N)H(0RR91 literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 2d17bd43c9..de0aca7344 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -44,8 +44,8 @@ public class JSliderPane extends JPanel { private static final int TWO_HUNDRED = 200; private static final int THREE_HUNDRED = 300; private static final int FOUR_HUNDRED = 400; - private static final int DIALOG_WIDTH = 150; - private static final int DIALOG_HEIGHT = 200; + private static final int DIALOG_WIDTH = 157; + private static final int DIALOG_HEIGHT = 192; private static final int SLIDER_WIDTH = 220; private static final int SLIDER_HEIGHT = 20; private static final int SHOWVALBUTTON_WIDTH = 40; @@ -167,8 +167,24 @@ public class JSliderPane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p, p, p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p, p, p, p}; + UILabel upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce")); + upLabel.setOpaque(false); + JPanel septPane = new JPanel(new BorderLayout()); + JSeparator sept = new JSeparator(); + sept.setBackground(new Color(232,232,233)); + septPane.add(sept,BorderLayout.NORTH); + septPane.setBorder(BorderFactory.createEmptyBorder(2, 5, 1, 5)); + twoHundredButton.setBackground(BACK_COLOR); + oneHundredButton.setBackground(BACK_COLOR); + SevenFiveButton.setBackground(BACK_COLOR); + fiveTenButton.setBackground(BACK_COLOR); + twoFiveButton.setBackground(BACK_COLOR); + selfAdaptButton.setBackground(BACK_COLOR); + customButton.setBackground(BACK_COLOR); Component[][] components = new Component[][]{ + new Component[]{upLabel, null}, + new Component[]{septPane, null}, new Component[]{twoHundredButton, null}, new Component[]{oneHundredButton, null}, new Component[]{SevenFiveButton, null}, @@ -178,6 +194,7 @@ public class JSliderPane extends JPanel { new Component[]{customButton, createSpinnerPanel()} }; dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); + dialogContentPanel.setBackground(BACK_COLOR); } private JPanel createSpinnerPanel() { @@ -186,6 +203,7 @@ public class JSliderPane extends JPanel { UILabel percent = new UILabel("%"); percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); spinnerPanel.add(percent); + spinnerPanel.setBackground(BACK_COLOR); return spinnerPanel; } @@ -414,27 +432,14 @@ class JSliderPaneUI extends BasicSliderUI { class PopupPane extends JPopupMenu { private JComponent contentPane; - private static final int UPLABEL_HEIGHT = 25; private static final int DIALOG_WIDTH = 157; - private static final int DIALOG_HEIGHT = 200; - private static final int UPLABEL_WIDTH = 300; - private JComponent centerPane; - private UILabel upLabel; + private static final int DIALOG_HEIGHT = 192; PopupPane(JButton b, JPanel dialogContentPanel) { - contentPane = new JPanel(new BorderLayout()); - centerPane = new JPanel(new BorderLayout()); - upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce")); - upLabel.setOpaque(true); - upLabel.setPreferredSize(new Dimension(UPLABEL_WIDTH, UPLABEL_HEIGHT)); - upLabel.setBackground(Color.LIGHT_GRAY); - upLabel.setBorder(new MatteBorder(0, 0, 1, 0, Color.gray)); - centerPane.add(dialogContentPanel, BorderLayout.NORTH); - contentPane.add(upLabel, BorderLayout.NORTH); - contentPane.add(centerPane, BorderLayout.CENTER); - this.add(contentPane, BorderLayout.CENTER); + this.add(dialogContentPanel, BorderLayout.CENTER); this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); - this.setOpaque(false); + this.setBackground(new Color(245,245,247)); +// this.setOpaque(false); } From 010b07270f525be6ea3837656a51381a96964539 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 2 Aug 2017 20:00:59 +0800 Subject: [PATCH 07/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E7=BC=A9=E6=94=BE=E6=9D=A1?= =?UTF-8?q?=E9=83=A8=E5=88=86=E8=A7=86=E8=A7=89=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/locale/designer.properties | 4 + .../design/locale/designer_en_US.properties | 4 + .../design/locale/designer_ja_JP.properties | 4 + .../design/locale/designer_ko_KR.properties | 4 + .../design/locale/designer_zh_CN.properties | 4 + .../design/locale/designer_zh_TW.properties | 4 + .../fr/design/mainframe/JFormSliderPane.java | 120 ++++++++++-------- .../com/fr/design/mainframe/JSliderPane.java | 54 ++++---- 8 files changed, 118 insertions(+), 80 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 968e44ba69..8836399b6e 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2098,3 +2098,7 @@ FR-Designer_Insert_Image=Insert_Image FR-Designer_Insert-Chart=Insert-Chart FR-Designer_Insert-Text=Insert-Text FR-Designer_Insert_Formula=Insert_Formula +FR-Designer_Scale_Down=Scale_Down +FR-Designer_Scale_Up=Scale_Up +FR-Designer_Scale_Slider=Scale_Slider +FR-Designer_Scale_Grade=Scale_Grade diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index c72a2b2944..695c42724c 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2099,3 +2099,7 @@ FR-Designer_Insert_Image=Insert_Image FR-Designer_Insert_Chart=Insert-Chart FR-Designer_Insert_Text=Insert-Text FR-Designer_Insert_Formula=Insert_Formula +FR-Designer_Scale_Down=Scale_Down +FR-Designer_Scale_Up=Scale_Up +FR-Designer_Scale_Slider=Scale_Slider +FR-Designer_Scale_Grade=Scale_Grade diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index d299a90935..c89b90b0a1 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2080,3 +2080,7 @@ FR-Designer_Add_FloatElement= FR-Designer_Insert_Image= FR-Designer_Insert_Chart= FR-Designer_Insert_Text= +FR-Designer_Scale_Down= +FR-Designer_Scale_Up= +FR-Designer_Scale_Slider= +FR-Designer_Scale_Grade= diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index bf72a516b7..08aaa5c657 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2079,3 +2079,7 @@ FR-Designer_Insert_Image= FR-Designer_Insert_Chart= FR-Designer_Insert_Text= FR-Designer_Insert_Formula= +FR-Designer_Scale_Down= +FR-Designer_Scale_Up= +FR-Designer_Scale_Slider= +FR-Designer_Scale_Grade= diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 7d1d62e970..6add40ade0 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2106,3 +2106,7 @@ FR-Designer_Float_Visible=\u60AC\u6D6E\u5143\u7D20\u53EF\u89C1 FR-Designer_Cell_Value=\u5355\u5143\u683C\u503C FR-Designer_Widget_Visible=\u63A7\u4EF6\u53EF\u89C1 FR-Designer_Widget_Enabled=\u63A7\u4EF6\u53EF\u7528 +FR-Designer_Scale_Down=\u7F29\u5C0F +FR-Designer_Scale_Up=\u653E\u5927 +FR-Designer_Scale_Slider=\u7F29\u653E\u6ED1\u5757 +FR-Designer_Scale_Grade=\u7F29\u653E\u7EA7\u522B\uFF0C\u5355\u51FB\u540E\u8C03\u8282\u663E\u793A\u6BD4\u4F8B\u3002 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 186bc20bc2..899a752036 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2098,3 +2098,7 @@ FR-Designer_Insert_Image= FR-Designer_Insert_Chart= FR-Designer_Insert_Text= FR-Designer_Insert_Formula= +FR-Designer_Scale_Down= +FR-Designer_Scale_Up= +FR-Designer_Scale_Slider= +FR-Designer_Scale_Grade= diff --git a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java index 6088ac01ef..b3be6c760f 100644 --- a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; @@ -13,7 +14,6 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import javax.swing.*; -import javax.swing.border.MatteBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; @@ -32,7 +32,7 @@ public class JFormSliderPane extends JPanel { private static final int SIX = 6; private static final int TEN = 10; private static final int ONE_EIGHT = 18; - private static final int FONT_SIZE = 14; + private static final int FONT_SIZE = 12; private static final int SPINNER_WIDTH = 45; private static final int SPINNER_HEIGHT = 20; private static final int HALF_HUNDRED = 50; @@ -40,10 +40,14 @@ public class JFormSliderPane extends JPanel { private static final int TWO_HUNDRED = 200; private static final int THREE_HUNDRED = 300; private static final int FOUR_HUNDRED = 400; - private static final int DIALOG_WIDTH = 150; - private static final int DIALOG_HEIGHT = 220; - private static final int SHOWVALBUTTON_WIDTH = 70; - private static final int SHOWVALBUTTON_HEIGHTH = 25; + private static final int DIALOG_WIDTH = 157; + private static final int DIALOG_HEIGHT = 172; + private static final int SLIDER_WIDTH = 220; + private static final int SLIDER_HEIGHT = 20; + private static final int SHOWVALBUTTON_WIDTH = 40; + private static final int SHOWVALBUTTON_HEIGHTH = 20; + private static final int SLIDER_GAP = 5; + private static final Color BACK_COLOR = new Color(245, 245, 247); public int showValue = 100; public double resolutionTimes = 1.0; private static JFormSliderPane THIS; @@ -54,7 +58,7 @@ public class JFormSliderPane extends JPanel { private int sliderValue; private UIButton downButton; private UIButton upButton; - private UIButton showValButton; + private JButton showValButton; private UIRadioButton twoHundredButton; private UIRadioButton oneHundredButton; private UIRadioButton SevenFiveButton; @@ -74,45 +78,50 @@ public class JFormSliderPane extends JPanel { slider = new UISlider(0, HUNDRED, HALF_HUNDRED); slider.setUI(new JSliderPaneUI(slider)); slider.addChangeListener(listener); - + slider.setPreferredSize(new Dimension(220, 20)); + //去掉虚线框 + slider.setFocusable(false); + slider.setToolTipText(Inter.getLocText("FR-Designer_Scale_Slider")); showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)); showValSpinner.setEnabled(true); showValSpinner.addChangeListener(showValSpinnerChangeListener); showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT)); - //MoMeak:控制只能输入10-400,但是用起来感觉不舒服,先注释掉吧 -// JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0"); -// showValSpinner.setEditor(editor); -// JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); -// textField.setEditable(true); -// DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory(); -// NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter(); -// formatter.setAllowsInvalid(false); - downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/moveDown.png")); - upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/moveUp.png")); + downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")); + downButton.setOpaque(false); + downButton.setBorderPainted(false); + downButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Down")); + upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")); + upButton.setOpaque(false); + upButton.setBorderPainted(false); + upButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Up")); downButton.setActionCommand("less"); upButton.setActionCommand("more"); downButton.addActionListener(buttonActionListener); upButton.addActionListener(buttonActionListener); - - showValButton = new UIButton(showValSpinner.getValue() + "%"); + showValButton = new JButton(showValSpinner.getValue() + "%"); + showValButton.setOpaque(false); + showValButton.setMargin(new Insets(0, 0, 0, 0)); + showValButton.setFont(new Font("SimSun", Font.PLAIN, 12)); + showValButton.setBackground(BACK_COLOR); showValButton.setBorderPainted(false); showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); showValButton.addActionListener(showValButtonActionListener); - + //TODO 先注释,需要自定义tooltip + showValButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Grade")); initUIRadioButton(); initPane(); - JPanel panel = new JPanel(new FlowLayout(1, 1, 0)); + JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); panel.add(downButton); panel.add(slider); panel.add(upButton); panel.add(showValButton); + panel.setBackground(BACK_COLOR); this.add(panel, BorderLayout.NORTH); - this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT); } public static final JFormSliderPane getInstance() { // if (THIS == null) { -// THIS = new JFormSliderPane(); +// THIS = new JSliderPane(); // } THIS = new JFormSliderPane(); return THIS; @@ -124,8 +133,10 @@ public class JFormSliderPane extends JPanel { SevenFiveButton = new UIRadioButton("75%"); fiveTenButton = new UIRadioButton("50%"); twoFiveButton = new UIRadioButton("25%"); -// selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton")); + selfAdaptButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_selfAdaptButton")); + selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); customButton = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton")); + customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); twoHundredButton.addItemListener(radioButtonItemListener); oneHundredButton.addItemListener(radioButtonItemListener); SevenFiveButton.addItemListener(radioButtonItemListener); @@ -140,7 +151,7 @@ public class JFormSliderPane extends JPanel { bg.add(SevenFiveButton); bg.add(fiveTenButton); bg.add(twoFiveButton); -// bg.add(selfAdaptButton); + bg.add(selfAdaptButton); bg.add(customButton); customButton.setSelected(true); } @@ -149,25 +160,44 @@ public class JFormSliderPane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p, p, p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p, p, p}; + UILabel upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce")); + upLabel.setOpaque(false); + JPanel septPane = new JPanel(new BorderLayout()); + JSeparator sept = new JSeparator(); + sept.setBackground(new Color(232, 232, 233)); + septPane.add(sept, BorderLayout.NORTH); + septPane.setBorder(BorderFactory.createEmptyBorder(2, 5, 1, 10)); + septPane.setBackground(BACK_COLOR); + twoHundredButton.setBackground(BACK_COLOR); + oneHundredButton.setBackground(BACK_COLOR); + SevenFiveButton.setBackground(BACK_COLOR); + fiveTenButton.setBackground(BACK_COLOR); + twoFiveButton.setBackground(BACK_COLOR); +// selfAdaptButton.setBackground(BACK_COLOR); + customButton.setBackground(BACK_COLOR); Component[][] components = new Component[][]{ + new Component[]{upLabel, null}, + new Component[]{septPane, null}, new Component[]{twoHundredButton, null}, new Component[]{oneHundredButton, null}, new Component[]{SevenFiveButton, null}, new Component[]{fiveTenButton, null}, new Component[]{twoFiveButton, null}, -// new Component[]{selfAdaptButton,null}, new Component[]{customButton, createSpinnerPanel()} }; - dialogContentPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); + dialogContentPanel.setBackground(BACK_COLOR); + dialogContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); } private JPanel createSpinnerPanel() { JPanel spinnerPanel = new JPanel(new FlowLayout()); spinnerPanel.add(showValSpinner); UILabel percent = new UILabel("%"); - percent.setFont(new Font("Dialog", Font.PLAIN, FONT_SIZE)); + percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); spinnerPanel.add(percent); + spinnerPanel.setBackground(BACK_COLOR); return spinnerPanel; } @@ -314,14 +344,14 @@ public class JFormSliderPane extends JPanel { dialog = new FormPopupPane(upButton, dialogContentPanel); if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); } } else { if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); } else { - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); } } } @@ -341,29 +371,13 @@ public class JFormSliderPane extends JPanel { class FormPopupPane extends JPopupMenu { - private JComponent contentPane; - private static final int UPLABEL_HEIGHT = 25; - private static final int DIALOG_WIDTH = 150; - private static final int DIALOG_HEIGHT = 220; - private static final int UPLABEL_WIDTH = 300; - private JComponent centerPane; - private UILabel upLabel; + private static final int DIALOG_WIDTH = 157; + private static final int DIALOG_HEIGHT = 172; FormPopupPane(UIButton b, JPanel dialogContentPanel) { - contentPane = new JPanel(new BorderLayout()); - centerPane = new JPanel(new BorderLayout()); - upLabel = new UILabel(" " + Inter.getLocText("FR-Designer_Scale_EnlargeOrReduce")); - upLabel.setOpaque(true); - upLabel.setPreferredSize(new Dimension(UPLABEL_WIDTH, UPLABEL_HEIGHT)); - upLabel.setBackground(Color.LIGHT_GRAY); - upLabel.setBorder(new MatteBorder(0, 0, 1, 0, Color.gray)); - centerPane.add(dialogContentPanel, BorderLayout.NORTH); - contentPane.add(upLabel, BorderLayout.NORTH); - contentPane.add(centerPane, BorderLayout.CENTER); -// contentPane.setBorder(new MatteBorder(1,1,1,1,Color.darkGray)); - this.add(contentPane, BorderLayout.CENTER); + this.add(dialogContentPanel, BorderLayout.CENTER); this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); - this.setOpaque(false); + this.setBackground(new Color(245, 245, 247)); } diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index de0aca7344..50ca69a9e7 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -14,17 +14,14 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import javax.swing.*; -import javax.swing.border.MatteBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.basic.BasicSliderUI; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.awt.geom.RoundRectangle2D; import java.math.BigDecimal; /** @@ -51,7 +48,7 @@ public class JSliderPane extends JPanel { private static final int SHOWVALBUTTON_WIDTH = 40; private static final int SHOWVALBUTTON_HEIGHTH = 20; private static final int SLIDER_GAP = 5; - private static final Color BACK_COLOR = new Color(245,245,247); + private static final Color BACK_COLOR = new Color(245, 245, 247); public int showValue = 100; public double resolutionTimes = 1.0; private static JSliderPane THIS; @@ -85,36 +82,33 @@ public class JSliderPane extends JPanel { slider.setPreferredSize(new Dimension(220, 20)); //去掉虚线框 slider.setFocusable(false); + slider.setToolTipText(Inter.getLocText("FR-Designer_Scale_Slider")); showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)); showValSpinner.setEnabled(true); showValSpinner.addChangeListener(showValSpinnerChangeListener); showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT)); - //MoMeak:控制只能输入10-400,但是用起来感觉不舒服,先注释掉吧 -// JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0"); -// showValSpinner.setEditor(editor); -// JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); -// textField.setEditable(true); -// DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory(); -// NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter(); -// formatter.setAllowsInvalid(false); - downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")); + downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")); downButton.setOpaque(false); downButton.setBorderPainted(false); - upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"),BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")); + downButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Down")); + upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")); upButton.setOpaque(false); upButton.setBorderPainted(false); + upButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Up")); downButton.setActionCommand("less"); upButton.setActionCommand("more"); downButton.addActionListener(buttonActionListener); upButton.addActionListener(buttonActionListener); showValButton = new JButton(showValSpinner.getValue() + "%"); showValButton.setOpaque(false); - showValButton.setMargin(new Insets(0,0,0,0)); + showValButton.setMargin(new Insets(0, 0, 0, 0)); showValButton.setFont(new Font("SimSun", Font.PLAIN, 12)); showValButton.setBackground(BACK_COLOR); showValButton.setBorderPainted(false); showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); showValButton.addActionListener(showValButtonActionListener); + //TODO 先注释,需要自定义tooltip +// showValButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Grade")); initUIRadioButton(); initPane(); JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); @@ -126,6 +120,12 @@ public class JSliderPane extends JPanel { this.add(panel, BorderLayout.NORTH); } + public JToolTip createToolTip() { + JToolTip tip = new JToolTip(); + tip.setComponent(this); + return tip; + } + public static final JSliderPane getInstance() { // if (THIS == null) { // THIS = new JSliderPane(); @@ -172,9 +172,10 @@ public class JSliderPane extends JPanel { upLabel.setOpaque(false); JPanel septPane = new JPanel(new BorderLayout()); JSeparator sept = new JSeparator(); - sept.setBackground(new Color(232,232,233)); - septPane.add(sept,BorderLayout.NORTH); - septPane.setBorder(BorderFactory.createEmptyBorder(2, 5, 1, 5)); + sept.setBackground(new Color(232, 232, 233)); + septPane.add(sept, BorderLayout.NORTH); + septPane.setBorder(BorderFactory.createEmptyBorder(2, 5, 1, 10)); + septPane.setBackground(BACK_COLOR); twoHundredButton.setBackground(BACK_COLOR); oneHundredButton.setBackground(BACK_COLOR); SevenFiveButton.setBackground(BACK_COLOR); @@ -195,6 +196,7 @@ public class JSliderPane extends JPanel { }; dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); dialogContentPanel.setBackground(BACK_COLOR); + dialogContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); } private JPanel createSpinnerPanel() { @@ -377,7 +379,7 @@ public class JSliderPane extends JPanel { class JSliderPaneUI extends BasicSliderUI { - private static final Color BACK_COLOR = new Color(245,245,247); + private static final Color BACK_COLOR = new Color(245, 245, 247); private static final int VERTICAL_WIDTH = 11; private static final int VERTICAL_HEIGHT = 16; private static final int FOUR = 4; @@ -402,9 +404,9 @@ class JSliderPaneUI extends BasicSliderUI { g2d.translate(knobBounds.x, knobBounds.y); // g2d.setColor(slider.getBackground()); // g2d.fillRect(0, FOUR, FOUR, 9); - g2d.setColor(new Color(51,51,52)); - g2d.drawRoundRect(0,SIX,FOUR,9,2,2); - g2d.fillRoundRect(0,SIX,FOUR,9,2,2); + g2d.setColor(new Color(51, 51, 52)); + g2d.drawRoundRect(0, SIX, FOUR, 9, 2, 2); + g2d.fillRoundRect(0, SIX, FOUR, 9, 2, 2); } /** */ @@ -420,8 +422,8 @@ class JSliderPaneUI extends BasicSliderUI { cw = trackBounds.width; g2.setPaint(BACK_COLOR); g2.fillRect(0, -cy, cw + 10, cy * 4); - g.setColor(new Color(216,216,216)); - g.drawLine(0, cy, cw +3, cy); + g.setColor(new Color(216, 216, 216)); + g.drawLine(0, cy, cw + 3, cy); g.drawLine(FIVE + cw / 2, cy - FOUR, FIVE + cw / 2, cy + FOUR); } else { super.paintTrack(g); @@ -431,15 +433,13 @@ class JSliderPaneUI extends BasicSliderUI { } class PopupPane extends JPopupMenu { - private JComponent contentPane; private static final int DIALOG_WIDTH = 157; private static final int DIALOG_HEIGHT = 192; PopupPane(JButton b, JPanel dialogContentPanel) { this.add(dialogContentPanel, BorderLayout.CENTER); this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); - this.setBackground(new Color(245,245,247)); -// this.setOpaque(false); + this.setBackground(new Color(245, 245, 247)); } From 7d76f7d6f23ff4a1a150a5964b8f01b1e39d5819 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 1 Aug 2017 11:23:13 +0800 Subject: [PATCH 08/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=EF=BC=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=EF=BC=89=E5=88=9D=E6=AD=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/WidgetEventPane.java | 12 ++-- .../gui/controlpane/ObjectUIControlPane.java | 72 +++++++++++++++++++ .../design/gui/controlpane/UIControlPane.java | 11 ++- 3 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java diff --git a/designer/src/com/fr/design/widget/WidgetEventPane.java b/designer/src/com/fr/design/widget/WidgetEventPane.java index 2665057b3f..5d9845c3c8 100644 --- a/designer/src/com/fr/design/widget/WidgetEventPane.java +++ b/designer/src/com/fr/design/widget/WidgetEventPane.java @@ -4,10 +4,10 @@ package com.fr.design.widget; import java.util.ArrayList; import java.util.List; +import com.fr.design.gui.controlpane.ObjectUIControlPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.SmartInsertDBManipulationInWidgetEventPane; import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.gui.controlpane.ObjectJControlPane; import com.fr.design.gui.frpane.ListenerUpdatePane; import com.fr.design.javascript.JavaScriptActionPane; import com.fr.design.mainframe.DesignerContext; @@ -19,7 +19,7 @@ import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.stable.Nameable; -public class WidgetEventPane extends ObjectJControlPane { +public class WidgetEventPane extends ObjectUIControlPane { public WidgetEventPane() { this(null); @@ -38,8 +38,12 @@ public class WidgetEventPane extends ObjectJControlPane { EventCreator.STATECHANGE }; } - - @Override + + @Override + public void saveSettings() { + } + + @Override protected String title4PopupWindow() { return Inter.getLocText("Event"); } diff --git a/designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java new file mode 100644 index 0000000000..46b41d020a --- /dev/null +++ b/designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java @@ -0,0 +1,72 @@ +package com.fr.design.gui.controlpane; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import com.fr.design.beans.BasicBeanPane; + +/** + * Created by plough on 2017/8/1. + */ +public abstract class ObjectUIControlPane extends UIListControlPane { + private Object object; + + public ObjectUIControlPane() { + this(null); + } + + public ObjectUIControlPane(Object object) { + super(); + this.object = object; + } + + @Override + protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + try { + if (object == null) { + return super.createPaneByCreators(creator); + } else if (object.getClass().isArray()) { + return creator.getUpdatePane().getConstructor(object.getClass()).newInstance(object); + } else { + Constructor constructor = getConstructor(creator.getUpdatePane(), object.getClass()); + return constructor == null ? super.createPaneByCreators(creator) : constructor.newInstance(object); + } + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (IllegalArgumentException e) { + throw new RuntimeException(e); + } catch (SecurityException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); + } + } + + /** + * 传进BasicBeanPane的构造函数的参数,可能是 + * + * @param clazz + * @param cls + * @return + */ + private Constructor getConstructor(Class clazz, Class cls) { + Constructor constructor = null; + try { + constructor = clazz.getConstructor(cls); + } catch (SecurityException e) { + } catch (NoSuchMethodException e) { + } + if (constructor != null) { + return constructor; + } else { + if (cls.getName() == Object.class.getName()) { + return null; + } + return getConstructor(clazz, cls.getSuperclass()); + } + } + +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java index 42d7e97bd2..02273477bb 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java @@ -28,6 +28,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH private ToolBarDef toolbarDef; private UIToolbar toolBar; + private UIToolbar topToolBar; protected PopupEditDialog popupEditDialog; // peter:这是整体的一个cardLayout Pane protected CardLayout cardLayout; @@ -146,7 +147,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH // leftContentPane.setBorder(BorderFactory.createLineBorder(new Color(201, 198, 184))); // 顶部标签及add按钮 - UIToolbar topToolBar = new UIToolbar(); + topToolBar = new UIToolbar(); topToolBar.setLayout(new BorderLayout()); ShortCut addItem = addItemShortCut().getShortCut(); addItem.intoJToolBar(topToolBar); @@ -246,6 +247,14 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH toolbarDef.updateToolBar(toolBar); toolBar.validate(); toolBar.repaint(); + + + // 顶部按钮 + topToolBar.removeAll(); + ShortCut addItem = addItemShortCut().getShortCut(); + addItem.intoJToolBar(topToolBar); + topToolBar.validate(); + this.repaint(); } From dd1bfadd21d82ace400e84677c315735b78ef614 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 1 Aug 2017 21:28:12 +0800 Subject: [PATCH 09/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=EF=BC=88?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=EF=BC=89=3D>=E5=88=9D=E6=AD=A5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/WidgetEventPane.java | 4 +- .../com/fr/design/widget/EventCreator.java | 151 ++++++------- .../properties/EventPropertyTable.java | 208 +++++------------- 3 files changed, 128 insertions(+), 235 deletions(-) rename {designer => designer_base}/src/com/fr/design/widget/EventCreator.java (57%) diff --git a/designer/src/com/fr/design/widget/WidgetEventPane.java b/designer/src/com/fr/design/widget/WidgetEventPane.java index 5d9845c3c8..20fd5cc4e2 100644 --- a/designer/src/com/fr/design/widget/WidgetEventPane.java +++ b/designer/src/com/fr/design/widget/WidgetEventPane.java @@ -35,7 +35,7 @@ public class WidgetEventPane extends ObjectUIControlPane { */ public NameableCreator[] createNameableCreators() { return new NameableCreator[]{ - EventCreator.STATECHANGE + new EventCreator(Widget.EVENT_STATECHANGE, WidgetEventListenerUpdatePane.class) }; } @@ -108,7 +108,7 @@ public class WidgetEventPane extends ObjectUIControlPane { return; } - this.refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents())); + this.refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents(), WidgetEventListenerUpdatePane.class)); List list = new ArrayList(); Listener listener; diff --git a/designer/src/com/fr/design/widget/EventCreator.java b/designer_base/src/com/fr/design/widget/EventCreator.java similarity index 57% rename from designer/src/com/fr/design/widget/EventCreator.java rename to designer_base/src/com/fr/design/widget/EventCreator.java index 3826d7b6fb..530bd34aa2 100644 --- a/designer/src/com/fr/design/widget/EventCreator.java +++ b/designer_base/src/com/fr/design/widget/EventCreator.java @@ -1,76 +1,77 @@ -package com.fr.design.widget; - -import com.fr.base.FRContext; -import com.fr.design.gui.controlpane.NameableSelfCreator; -import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.design.gui.ilist.ListModelElement; -import com.fr.form.event.Listener; -import com.fr.form.ui.FileEditor; -import com.fr.form.ui.Widget; -import com.fr.general.Inter; -import com.fr.general.NameObject; -import com.fr.stable.Nameable; - -public class EventCreator extends NameableSelfCreator { - private String eventName; - - public EventCreator(String eventName) { - super(switchLang(eventName), Listener.class, WidgetEventPane.WidgetEventListenerUpdatePane.class); - this.eventName = eventName; - } - - @Override - public Nameable createNameable(UnrepeatedNameHelper helper) { - return new NameObject(helper.createUnrepeatedName(this.menuName()),new Listener(this.eventName)) ; - } - - public static EventCreator[] createEventCreator(String[] supportedEvents) { - EventCreator[] creators = new EventCreator[supportedEvents.length]; - - for (int i = 0; i < supportedEvents.length; i++) { - creators[i] = new EventCreator(supportedEvents[i]); - } - - return creators; - } - - /* - * richer:国际化事件名称,所有需要国际化的事件都应按格式Event-eventName来进行国际化 - */ - public static final String switchLang(String eventName) { - try { - return Inter.getLocText("Event-" + eventName); - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); - return eventName; - } - } - @Override - public void saveUpdatedBean(ListModelElement wrapper, Object bean) { - ((NameObject)wrapper.wrapper).setObject(bean); - } - - - public static final EventCreator BEFOREEDIT = new EventCreator(Widget.BEFOREEDIT); - - public static final EventCreator AFTEREDIT = new EventCreator(Widget.AFTEREDIT); - - public static final EventCreator CHANGE = new EventCreator(Widget.CHANGE); - - public static final EventCreator CLICK = new EventCreator(Widget.EVENT_CLICK); - - public static final EventCreator SUCCESS = new EventCreator("success"); - - public static final EventCreator AFTERINIT = new EventCreator(Widget.AFTERINIT); - - public static final EventCreator STOPEDIT = new EventCreator(Widget.STOPEDIT); - - public static final EventCreator STATECHANGE = new EventCreator(Widget.EVENT_STATECHANGE); - - public static final EventCreator CALLBACK = new EventCreator(FileEditor.EVENT_UPLOAD_CALLBACK); - - @Override - public String createTooltip() { - return null; - } +package com.fr.design.widget; + +import com.fr.base.FRContext; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameableSelfCreator; +import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.design.gui.ilist.ListModelElement; +import com.fr.form.event.Listener; +import com.fr.form.ui.FileEditor; +import com.fr.form.ui.Widget; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.stable.Nameable; + +public class EventCreator extends NameableSelfCreator { + private String eventName; + + public EventCreator(String eventName, Class updatePane) { + super(switchLang(eventName), Listener.class, updatePane); + this.eventName = eventName; + } + + @Override + public Nameable createNameable(UnrepeatedNameHelper helper) { + return new NameObject(helper.createUnrepeatedName(this.menuName()),new Listener(this.eventName)) ; + } + + public static EventCreator[] createEventCreator(String[] supportedEvents, Class updatePane) { + EventCreator[] creators = new EventCreator[supportedEvents.length]; + + for (int i = 0; i < supportedEvents.length; i++) { + creators[i] = new EventCreator(supportedEvents[i], updatePane); + } + + return creators; + } + + /* + * richer:国际化事件名称,所有需要国际化的事件都应按格式Event-eventName来进行国际化 + */ + public static final String switchLang(String eventName) { + try { + return Inter.getLocText("Event-" + eventName); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage(), e); + return eventName; + } + } + @Override + public void saveUpdatedBean(ListModelElement wrapper, Object bean) { + ((NameObject)wrapper.wrapper).setObject(bean); + } + + +// public static final EventCreator BEFOREEDIT = new EventCreator(Widget.BEFOREEDIT); +// +// public static final EventCreator AFTEREDIT = new EventCreator(Widget.AFTEREDIT); +// +// public static final EventCreator CHANGE = new EventCreator(Widget.CHANGE); +// +// public static final EventCreator CLICK = new EventCreator(Widget.EVENT_CLICK); +// +// public static final EventCreator SUCCESS = new EventCreator("success"); +// +// public static final EventCreator AFTERINIT = new EventCreator(Widget.AFTERINIT); +// +// public static final EventCreator STOPEDIT = new EventCreator(Widget.STOPEDIT); +// +// public static final EventCreator STATECHANGE = new EventCreator(Widget.EVENT_STATECHANGE); +// +// public static final EventCreator CALLBACK = new EventCreator(FileEditor.EVENT_UPLOAD_CALLBACK); + + @Override + public String createTooltip() { + return null; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java index bec1b44f84..4fd1a8fabe 100644 --- a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java @@ -3,6 +3,9 @@ package com.fr.design.designer.properties; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.ShortCut4JControlPane; +import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.frpane.ListenerUpdatePane; import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.itoolbar.UIToolbar; @@ -12,6 +15,7 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; +import com.fr.design.widget.EventCreator; import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; @@ -39,11 +43,11 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.IOException; -public class EventPropertyTable extends BasicPane { +public class EventPropertyTable extends UIListControlPane { private ShortCut[] shorts; private XCreator creator; - private JNameEdList nameableList; +// private JNameEdList nameableList; private ToolBarDef toolbarDef; private AddItemMenuDef itemMenu; private ShortCut editItemAction; @@ -59,27 +63,22 @@ public class EventPropertyTable extends BasicPane { this.initComponents(); } - protected void initComponents() { - this.setLayout(new BorderLayout()); - nameableList = new JNameEdList(new DefaultListModel()); - this.add(new JScrollPane(nameableList), BorderLayout.CENTER); - - nameableList.setCellRenderer(new NameableListCellRenderer()); - nameableList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); - nameableList.addMouseListener(listMouseListener); - nameableList.setTransferHandler(new DnDTransferHandler()); - nameableList.setDropMode(DropMode.INSERT); - nameableList.setDragEnabled(true); - + @Override + protected void initComponentPane() { toolbarDef = new ToolBarDef(); - shorts = new ShortCut[] { itemMenu = new AddItemMenuDef(), editItemAction = new EditItemMenuDef(), - copyItemAction = new CopyItemAction(), removeItemAction = new RemoveItemAction() }; +// shorts = new ShortCut[] { itemMenu = new AddItemMenuDef(), editItemAction = new EditItemMenuDef(), +// copyItemAction = new CopyItemAction(), removeItemAction = new RemoveItemAction() }; + shorts = new ShortCut[] { itemMenu = new AddItemMenuDef()}; for (ShortCut sj : shorts) { toolbarDef.addShortCut(sj); } toolbar = ToolBarDef.createJToolBar(); toolbarDef.updateToolBar(toolbar); - this.add(toolbar, BorderLayout.NORTH); + + super.initComponentPane(); + } + + protected void initComponents() { } /** @@ -110,74 +109,41 @@ public class EventPropertyTable extends BasicPane { this.repaint(); } - private void checkButtonEnabled() { - boolean enable = nameableList.getSelectedValue() instanceof NameObject; - itemMenu.setEnabled(this.creator != null && itemMenu.getShortCutCount() > 0); - editItemAction.setEnabled(enable); - copyItemAction.setEnabled(enable); - removeItemAction.setEnabled(enable); - } + public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane { - private MouseListener listMouseListener = new MouseAdapter() { @Override - public void mouseReleased(MouseEvent evt) { - checkButtonEnabled(); - if (evt.getClickCount() >= 2 && SwingUtilities.isLeftMouseButton(evt)) { - NameObject object = (NameObject) nameableList.getSelectedValue(); - showEventPane(object); - } - } - }; + protected JavaScriptActionPane createJavaScriptActionPane() { + return new JavaScriptActionPane() { - private void showEventPane(final NameObject object) { - if (listenerPane == null) { - listenerPane = new ListenerUpdatePane() { + @Override + protected DBManipulationPane createDBManipulationPane() { + return new DBManipulationPane(ValueEditorPaneFactory.formEditors()); + } @Override - protected JavaScriptActionPane createJavaScriptActionPane() { - return new JavaScriptActionPane() { - - @Override - protected DBManipulationPane createDBManipulationPane() { - return new DBManipulationPane(ValueEditorPaneFactory.formEditors()); - } - - @Override - protected String title4PopupWindow() { - return Inter.getLocText("Set_Callback_Function"); - } - @Override - protected EmailPane initEmaiPane() { - return new FormEmailPane(); - } - @Override - public boolean isForm() { - return true; - } - - protected String[] getDefaultArgs() { - return new String[0]; - } - - }; + protected String title4PopupWindow() { + return Inter.getLocText("Set_Callback_Function"); + } + @Override + protected EmailPane initEmaiPane() { + return new FormEmailPane(); } @Override - protected boolean supportCellAction() { - return false; + public boolean isForm() { + return true; + } + + protected String[] getDefaultArgs() { + return new String[0]; } - + }; } - listenerPane.populateBean((Listener) object.getObject()); - BasicDialog dialog = listenerPane.showWindow(SwingUtilities.getWindowAncestor(this)); - dialog.addDialogActionListener(new DialogActionAdapter() { - @Override - public void doOk() { - object.setObject(listenerPane.updateBean()); - updateWidgetListener(creator); - } - }); - dialog.setVisible(true); + + @Override + protected boolean supportCellAction() { + return false; + } } private class NameableListCellRenderer extends DefaultListCellRenderer { @@ -226,20 +192,6 @@ public class EventPropertyTable extends BasicPane { } } } - - protected class EditItemMenuDef extends UpdateAction { - public EditItemMenuDef() { - this.setName(Inter.getLocText("Edit")); - this.setMnemonic('E'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/edit.png")); - } - - public void actionPerformed(ActionEvent evt) { - if (nameableList.getSelectedValue() instanceof NameObject) { - showEventPane((NameObject) nameableList.getSelectedValue()); - } - } - } private String switchLang(String eventName) { return Inter.getLocText("Event-" + eventName); @@ -261,7 +213,7 @@ public class EventPropertyTable extends BasicPane { } Widget widget = creator.toData(); - refreshNameableCreator(widget.supportedEvents()); + refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents(), WidgetEventListenerUpdatePane.class)); ((DefaultListModel) nameableList.getModel()).removeAllElements(); for (int i = 0, size = widget.getListenerSize(); i < size; i++) { @@ -288,81 +240,21 @@ public class EventPropertyTable extends BasicPane { checkButtonEnabled(); } - private class RemoveItemAction extends UpdateAction { - public RemoveItemAction() { - this.setName(Inter.getLocText("Remove")); - this.setMnemonic('R'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); - } - - public void actionPerformed(ActionEvent evt) { - GUICoreUtils.removeJListSelectedNodes(SwingUtilities.getWindowAncestor(EventPropertyTable.this), - nameableList); - updateWidgetListener(creator); - } - - } - - /* - * CopyItem - */ - private class CopyItemAction extends UpdateAction { - public CopyItemAction() { - this.setName(Inter.getLocText("Copy")); - this.setMnemonic('C'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/copy.png")); - } - - public void actionPerformed(ActionEvent evt) { - NameObject selectedNameObject = (NameObject) nameableList.getSelectedValue(); - - // p: 用反射机制实现 - try { - NameObject newNameObject = (NameObject) BaseUtils.cloneObject(selectedNameObject); - newNameObject.setName("CopyOf" + selectedNameObject.getName()); - - EventPropertyTable.this.addNameObject(newNameObject, nameableList.getSelectedIndex() + 1); - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); - } - updateWidgetListener(creator); - } - } - @Override protected String title4PopupWindow() { return "Event"; } - /** - * 生成不重复名字 - * @param prefix 字符 - * @return 返回 - */ - public String createUnrepeatedName(String prefix) { - DefaultListModel model = (DefaultListModel) nameableList.getModel(); - Nameable[] all = new Nameable[model.getSize()]; - for (int i = 0; i < model.size(); i++) { - all[i] = (Nameable) model.get(i); - } - int count = 1; - while (true) { - String name_test = prefix + count; - boolean repeated = false; - for (int i = 0, len = model.size(); i < len; i++) { - Nameable nameable = all[i]; - if (ComparatorUtils.equals(nameable.getName(), name_test)) { - repeated = true; - break; - } - } + @Override + public NameableCreator[] createNameableCreators() { + return new NameableCreator[]{ + new EventCreator(Widget.EVENT_STATECHANGE, WidgetEventListenerUpdatePane.class) + }; + } - if (!repeated) { - return name_test; - } + @Override + public void saveSettings() { - count++; - } } private class DnDTransferHandler extends TransferHandler { From 957bf499887d6e6a5d022debeaf6233a6c929b85 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 11:48:08 +0800 Subject: [PATCH 10/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=EF=BC=88?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=EF=BC=89=3D>=E5=8F=AF=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=EF=BC=8C=E4=BD=86=E6=9C=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/WidgetEventPane.java | 73 +++++++++++++++++++ .../properties/EventPropertyTable.java | 30 ++++++-- 2 files changed, 95 insertions(+), 8 deletions(-) diff --git a/designer/src/com/fr/design/widget/WidgetEventPane.java b/designer/src/com/fr/design/widget/WidgetEventPane.java index 20fd5cc4e2..176422ff49 100644 --- a/designer/src/com/fr/design/widget/WidgetEventPane.java +++ b/designer/src/com/fr/design/widget/WidgetEventPane.java @@ -4,7 +4,9 @@ package com.fr.design.widget; import java.util.ArrayList; import java.util.List; +import com.fr.design.dialog.BasicPane; import com.fr.design.gui.controlpane.ObjectUIControlPane; +import com.fr.design.present.CellWriteAttrPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.SmartInsertDBManipulationInWidgetEventPane; import com.fr.design.gui.controlpane.NameableCreator; @@ -15,17 +17,27 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JTemplate; import com.fr.form.event.Listener; import com.fr.form.ui.Widget; +import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.general.NameObject; +import com.fr.grid.GridUtils; +import com.fr.grid.selection.CellSelection; +import com.fr.privilege.finegrain.WidgetPrivilegeControl; +import com.fr.report.cell.DefaultTemplateCellElement; +import com.fr.report.cell.TemplateCellElement; +import com.fr.report.elementcase.TemplateElementCase; +import com.fr.report.stable.ReportConstants; import com.fr.stable.Nameable; public class WidgetEventPane extends ObjectUIControlPane { + private ElementCasePane ePane; public WidgetEventPane() { this(null); } public WidgetEventPane(ElementCasePane pane) { super(pane); + ePane = pane; this.setNameListEditable(false); } @@ -41,8 +53,69 @@ public class WidgetEventPane extends ObjectUIControlPane { @Override public void saveSettings() { + + final TemplateElementCase tplEC = ePane.getEditingElementCase(); + final CellSelection finalCS = (CellSelection) ePane.getSelection(); + TemplateCellElement editCellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow()); + if (editCellElement == null) { + editCellElement = new DefaultTemplateCellElement(finalCS.getColumn(), finalCS.getRow()); + tplEC.addCellElement(editCellElement); + } + final BasicPane bp = populateBasicPane(editCellElement); + + // 需要先行后列地增加新元素。 + for (int j = 0; j < finalCS.getRowSpan(); j++) { + for (int i = 0; i < finalCS.getColumnSpan(); i++) { + int column = i + finalCS.getColumn(); + int row = j + finalCS.getRow(); + editCellElement = tplEC.getTemplateCellElement(column, row); + if (editCellElement == null) { + editCellElement = new DefaultTemplateCellElement(column, row); + tplEC.addCellElement(editCellElement); + } + // alex:不加这一句话会导致跨行跨列的格子被多次update + if (editCellElement.getColumn() != column || editCellElement.getRow() != row) { + continue; + } + updateBasicPane(bp, editCellElement); + + Object editElementValue = editCellElement.getValue(); + if (editElementValue != null && (editElementValue instanceof String || editElementValue instanceof Number)) { + // TODO ALEX_SEP 暂时用FIT_DEFAULT替代,不取reportsetting里面的设置,因为也不知道是应该放在report里面还是elementcase里面 + GridUtils.shrinkToFit(ReportConstants.AUTO_SHRINK_TO_FIT_DEFAULT, tplEC, editCellElement); + } + } + } + ePane.fireTargetModified(); } + private BasicPane populateBasicPane(TemplateCellElement cellElement) { + CellWriteAttrPane pane = new CellWriteAttrPane(ePane); + //got simple cell element from column and row. + pane.populate(cellElement); + + return pane; + } + + private void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) { + CellWriteAttrPane pane = (CellWriteAttrPane) bp; + if (cellElement.getWidget() == null) { + pane.update(cellElement); + return; + } + try { + Widget oldWidget = (Widget) cellElement.getWidget().clone(); + pane.update(cellElement); + //这边需要重新设置权限细粒度的hashset是因为Update是直接生成一个新的来update的,所以以前里面的hashset都没有了 + Widget newWidget = cellElement.getWidget(); + if (newWidget.getClass() == oldWidget.getClass()) { + newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone()); + } + } catch (Exception e) { + FRLogger.getLogger().error(e.getMessage()); + } + } + @Override protected String title4PopupWindow() { return Inter.getLocText("Event"); diff --git a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java index 4fd1a8fabe..97320585b3 100644 --- a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java @@ -8,6 +8,7 @@ import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.frpane.ListenerUpdatePane; import com.fr.design.gui.ilist.JNameEdList; +import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptActionPane; @@ -42,6 +43,7 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.IOException; +import java.util.ArrayList; public class EventPropertyTable extends UIListControlPane { @@ -89,7 +91,8 @@ public class EventPropertyTable extends UIListControlPane { public void addNameObject(NameObject nameObject, int index) { DefaultListModel model = (DefaultListModel) nameableList.getModel(); - model.add(index, nameObject); +// model.add(index, nameObject); + model.add(index, new ListModelElement(nameObject)); nameableList.setSelectedIndex(index); nameableList.ensureIndexIsVisible(index); @@ -201,6 +204,7 @@ public class EventPropertyTable extends UIListControlPane { * 刷新 */ public void refresh() { + isPopulating = true; int selectionSize = designer.getSelectionModel().getSelection().size(); if (selectionSize == 0 || selectionSize == 1) { this.creator = selectionSize == 0 ? designer.getRootComponent() : designer.getSelectionModel() @@ -215,31 +219,41 @@ public class EventPropertyTable extends UIListControlPane { refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents(), WidgetEventListenerUpdatePane.class)); - ((DefaultListModel) nameableList.getModel()).removeAllElements(); +// ((DefaultListModel) nameableList.getModel()).removeAllElements(); + ArrayList nameObjectList = new ArrayList<>(); for (int i = 0, size = widget.getListenerSize(); i < size; i++) { Listener listener = widget.getListener(i); if (!listener.isDefault()) { - addNameObject(new NameObject(switchLang(listener.getEventName()) + (i + 1), listener), i); - } +// addNameObject(new NameObject(switchLang(listener.getEventName()) + (i + 1), listener), i); + nameObjectList.add(i, new NameObject(switchLang(listener.getEventName()) + (i + 1), listener)); + + } } + populate(nameObjectList.toArray(new NameObject[widget.getListenerSize()])); checkButtonEnabled(); this.repaint(); + isPopulating = false; } /** * 更新控件事件 * @param creator 控件 */ - public void updateWidgetListener(XCreator creator) { + public void updateWidgetListener(XCreator creator, boolean isSaving) { DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); (creator.toData()).clearListeners(); for (int i = 0, len = listModel.getSize(); i < len; i++) { - (creator.toData()).addListener((Listener) ((NameObject) listModel.getElementAt(i)).getObject()); + NameObject nameObject = isSaving ? (NameObject)((ListModelElement) listModel.getElementAt(i)).wrapper : (NameObject)(listModel.getElementAt(i)); + (creator.toData()).addListener((Listener) nameObject.getObject()); } designer.fireTargetModified(); checkButtonEnabled(); } + public void updateWidgetListener(XCreator creator) { + updateWidgetListener(creator, true); + } + @Override protected String title4PopupWindow() { return "Event"; @@ -254,8 +268,8 @@ public class EventPropertyTable extends UIListControlPane { @Override public void saveSettings() { - - } + updateWidgetListener(creator, true); + } private class DnDTransferHandler extends TransferHandler { private int action; From 9d402867265bad1de94da30fe3a22db0fb7233f1 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 11:49:01 +0800 Subject: [PATCH 11/29] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E6=A8=A1=E7=89=88=E4=BF=A1=E6=81=AF=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=BA=94=E8=AF=A5=E5=BD=B1=E5=93=8D=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/mainframe/JTemplate.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index 1df95805b1..b5d1f4cabb 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -126,7 +126,10 @@ public abstract class JTemplate> ex return; } long saveTime = System.currentTimeMillis(); // 保存模板的时间点 - tic.collectInfo(template, this, openTime, saveTime); + try { + tic.collectInfo(template, this, openTime, saveTime); + } catch (Exception ex) { // 不管收集过程中出现任何异常,都不应该影响模版保存 + } openTime = saveTime; // 更新 openTime,准备下一次计算 } From fd3e790bb4cbfe743b7d3c1c20f7e1ea9ec0d4a3 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 14:16:35 +0800 Subject: [PATCH 12/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=96=B0=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=9D=A2=E6=9D=BF=3D=E3=80=8B=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86=E7=9A=84=E5=B0=BA=E5=AF=B8=E5=92=8C?= =?UTF-8?q?=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/controlpane/UIControlPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java index 02273477bb..af47f1de8a 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java @@ -261,13 +261,13 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH // 点击"编辑"按钮,弹出面板 protected class PopupEditDialog extends JDialog { private JComponent editPane; - private static final int WIDTH = 490; - private static final int HEIGHT = 570; + private static final int WIDTH = 570; + private static final int HEIGHT = 490; PopupEditDialog(JComponent pane) { super(DesignerContext.getDesignerFrame()); setUndecorated(true); - pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10)); this.editPane = pane; this.getContentPane().add(editPane, BorderLayout.CENTER); setSize(WIDTH, HEIGHT); From 4af854aee97766c37a697adcfc3d0d71ad801bbe Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 16:44:18 +0800 Subject: [PATCH 13/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=EF=BC=88?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=EF=BC=89=3D>bug=E8=A7=A3=E5=86=B3=EF=BC=9B?= =?UTF-8?q?=E6=95=88=E7=8E=87=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/controlpane/UIListControlPane.java | 2 +- .../properties/EventPropertyTable.java | 33 +++++++++++++------ .../src/com/fr/design/mainframe/JForm.java | 9 +++-- .../design/mainframe/WidgetPropertyPane.java | 16 +++++---- 4 files changed, 41 insertions(+), 19 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java index 1968dc6356..25369a550c 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java @@ -210,7 +210,7 @@ public abstract class UIListControlPane extends UIControlPane { listModel.addElement(new ListModelElement(aNameableArray)); } - if (listModel.size() > 0) { + if (listModel.size() > 0 || this.nameableList.getSelectedIndex() != 0) { this.nameableList.setSelectedIndex(0); } this.checkButtonEnabled(); diff --git a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java index 97320585b3..a0a29fc4cb 100644 --- a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java @@ -204,7 +204,8 @@ public class EventPropertyTable extends UIListControlPane { * 刷新 */ public void refresh() { - isPopulating = true; +// isPopulating = true; + System.out.println("in refresh..."); int selectionSize = designer.getSelectionModel().getSelection().size(); if (selectionSize == 0 || selectionSize == 1) { this.creator = selectionSize == 0 ? designer.getRootComponent() : designer.getSelectionModel() @@ -232,21 +233,30 @@ public class EventPropertyTable extends UIListControlPane { populate(nameObjectList.toArray(new NameObject[widget.getListenerSize()])); checkButtonEnabled(); this.repaint(); - isPopulating = false; - } +// isPopulating = false; + System.out.println("out refresh..."); + } /** * 更新控件事件 * @param creator 控件 */ public void updateWidgetListener(XCreator creator, boolean isSaving) { - DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); - (creator.toData()).clearListeners(); - for (int i = 0, len = listModel.getSize(); i < len; i++) { - NameObject nameObject = isSaving ? (NameObject)((ListModelElement) listModel.getElementAt(i)).wrapper : (NameObject)(listModel.getElementAt(i)); - (creator.toData()).addListener((Listener) nameObject.getObject()); - } - designer.fireTargetModified(); +// DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); +// (creator.toData()).clearListeners(); +// for (int i = 0, len = listModel.getSize(); i < len; i++) { +// NameObject nameObject = isSaving ? (NameObject)((ListModelElement) listModel.getElementAt(i)).wrapper : (NameObject)(listModel.getElementAt(i)); +// (creator.toData()).addListener((Listener) nameObject.getObject()); +// } + + (creator.toData()).clearListeners(); + Nameable[] res = this.update(); + for (int i = 0; i < res.length; i++) { + NameObject nameObject = (NameObject)res[i]; + (creator.toData()).addListener((Listener) nameObject.getObject()); + } + + designer.fireTargetModified(); checkButtonEnabled(); } @@ -268,6 +278,9 @@ public class EventPropertyTable extends UIListControlPane { @Override public void saveSettings() { + if (isPopulating) { + return; + } updateWidgetListener(creator, true); } diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 23299f30b1..439ebe9a66 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -221,14 +221,19 @@ public class JForm extends JTemplate implements BaseJForm { } }); formDesign.addDesignerEditListener(new DesignerEditListener() { - + private XComponent lastAffectedCreator; @Override public void fireCreatorModified(DesignerEvent evt) { if (evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED || evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { setPropertyPaneChange(formDesign.getRootComponent()); } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { - setPropertyPaneChange(evt.getAffectedCreator()); + // 防止多次触发 + if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) { + return; + } + lastAffectedCreator = evt.getAffectedCreator(); + setPropertyPaneChange(lastAffectedCreator); } } }); diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index 201ab203e4..40bdff39c5 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -4,10 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.designer.creator.*; import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.WidgetPropertyTable; import com.fr.design.fun.WidgetPropertyUIProvider; @@ -314,6 +311,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper */ private class EventPropertyDesignerAdapter implements DesignerEditListener { EventPropertyTable propertyTable; + private XComponent lastAffectedCreator; EventPropertyDesignerAdapter(EventPropertyTable eventTable) { this.propertyTable = eventTable; @@ -321,8 +319,14 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper @Override public void fireCreatorModified(DesignerEvent evt) { - if (evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { + if (evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED) { + propertyTable.refresh(); + } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { + // 防止多次触发 + if (lastAffectedCreator != null && lastAffectedCreator == evt.getAffectedCreator()) { + return; + } + lastAffectedCreator = evt.getAffectedCreator(); propertyTable.refresh(); } } From 1281a70691fa1a370169abda2cad9a911c7a3ff5 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 17:20:06 +0800 Subject: [PATCH 14/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=3D>?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=EF=BC=9B=E6=95=B4=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/WidgetEventPane.java | 5 + .../com/fr/design/locale/designer.properties | 1 + .../design/locale/designer_en_US.properties | 1 + .../design/locale/designer_ja_JP.properties | 1 + .../design/locale/designer_ko_KR.properties | 1 + .../design/locale/designer_zh_CN.properties | 1 + .../design/locale/designer_zh_TW.properties | 1 + .../properties/EventPropertyTable.java | 201 +----------------- 8 files changed, 19 insertions(+), 193 deletions(-) diff --git a/designer/src/com/fr/design/widget/WidgetEventPane.java b/designer/src/com/fr/design/widget/WidgetEventPane.java index 176422ff49..449e599e83 100644 --- a/designer/src/com/fr/design/widget/WidgetEventPane.java +++ b/designer/src/com/fr/design/widget/WidgetEventPane.java @@ -41,6 +41,11 @@ public class WidgetEventPane extends ObjectUIControlPane { this.setNameListEditable(false); } + @Override + public String getAddItemText() { + return Inter.getLocText("FR-Designer_Add_Event"); + } + /** * 生成添加按钮的NameableCreator * @return 按钮的NameableCreator diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 9bee11543a..c5fc60a42b 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2105,3 +2105,4 @@ FR-Designer_Insert_Formula=Insert_Formula FR-Designer_Insert_Chart= FR-Designer_Insert_Text= FR-Designer_Double= +FR-Designer_Add_Event=Add Event diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 6a96057ed9..5813cbb324 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2106,3 +2106,4 @@ FR-Designer_Insert_Formula=Insert_Formula FR-Designer_Insert-Chart= FR-Designer_Insert-Text= FR-Designer_Double= +FR-Designer_Add_Event=Add Event diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 991092322c..c5ca8622e7 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2107,3 +2107,4 @@ FR-Designer_Label_Name= FR-Designer_Insert-Chart= FR-Designer_Insert-Text= FR-Designer_Insert_Formula= +FR-Designer_Add_Event= diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 521e8e4015..e1745cef3b 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2107,3 +2107,4 @@ FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_Insert-Chart= FR-Designer_Insert-Text= +FR-Designer_Add_Event= diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 10506bc897..fcdb415a27 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2101,3 +2101,4 @@ FR-Designer_Insert_Image=\u63D2\u5165\u56FE\u7247 FR-Designer_Insert_Chart=\u63D2\u5165\u56FE\u8868 FR-Designer_Insert_Text=\u63D2\u5165\u666E\u901A\u6587\u672C FR-Designer_Insert_Formula=\u63D2\u5165\u516C\u5F0F +FR-Designer_Add_Event=\u6DFB\u52A0\u4E8B\u4EF6 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index bfd296c08d..bf4e166330 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2107,3 +2107,4 @@ FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_Insert-Chart= FR-Designer_Insert-Text= +FR-Designer_Add_Event= \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java index a0a29fc4cb..41057748fc 100644 --- a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java @@ -1,13 +1,9 @@ package com.fr.design.designer.properties; -import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.frpane.ListenerUpdatePane; -import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.javascript.EmailPane; @@ -18,59 +14,42 @@ import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; import com.fr.design.widget.EventCreator; import com.fr.design.write.submit.DBManipulationPane; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.BasicPane; -import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.designer.creator.XCreator; import com.fr.form.event.Listener; import com.fr.design.form.javascript.FormEmailPane; import com.fr.form.ui.Widget; -import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.js.JavaScriptImpl; import com.fr.stable.Nameable; -import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; -import java.awt.*; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.Transferable; -import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.event.ActionEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.io.IOException; import java.util.ArrayList; public class EventPropertyTable extends UIListControlPane { private ShortCut[] shorts; private XCreator creator; -// private JNameEdList nameableList; private ToolBarDef toolbarDef; - private AddItemMenuDef itemMenu; - private ShortCut editItemAction; - private ShortCut copyItemAction; - private ShortCut removeItemAction; private UIToolbar toolbar; - private ListenerUpdatePane listenerPane; private FormDesigner designer; public EventPropertyTable(FormDesigner designer) { super(); this.designer = designer; - this.initComponents(); } + @Override + public String getAddItemText() { + return Inter.getLocText("FR-Designer_Add_Event"); + } + @Override protected void initComponentPane() { toolbarDef = new ToolBarDef(); -// shorts = new ShortCut[] { itemMenu = new AddItemMenuDef(), editItemAction = new EditItemMenuDef(), -// copyItemAction = new CopyItemAction(), removeItemAction = new RemoveItemAction() }; - shorts = new ShortCut[] { itemMenu = new AddItemMenuDef()}; + shorts = new ShortCut[] {new AddItemMenuDef()}; for (ShortCut sj : shorts) { toolbarDef.addShortCut(sj); } @@ -80,9 +59,6 @@ public class EventPropertyTable extends UIListControlPane { super.initComponentPane(); } - protected void initComponents() { - } - /** * 指定索引添加对象 * @param nameObject 对象名 @@ -91,7 +67,6 @@ public class EventPropertyTable extends UIListControlPane { public void addNameObject(NameObject nameObject, int index) { DefaultListModel model = (DefaultListModel) nameableList.getModel(); -// model.add(index, nameObject); model.add(index, new ListModelElement(nameObject)); nameableList.setSelectedIndex(index); nameableList.ensureIndexIsVisible(index); @@ -99,19 +74,6 @@ public class EventPropertyTable extends UIListControlPane { nameableList.repaint(); } - /** - * 刷新控件 - * @param strings 字符数组 - */ - public void refreshNameableCreator(String[] strings) { - itemMenu.populate(strings); - - toolbarDef.updateToolBar(toolbar); - toolbar.validate(); - toolbar.repaint(); - this.repaint(); - } - public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane { @Override @@ -149,20 +111,6 @@ public class EventPropertyTable extends UIListControlPane { } } - private class NameableListCellRenderer extends DefaultListCellRenderer { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, - boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof NameObject) { - Nameable wrappee = (NameObject) value; - this.setText(wrappee.getName()); - } - return this; - } - } - /* * 增加项的MenuDef */ @@ -204,8 +152,6 @@ public class EventPropertyTable extends UIListControlPane { * 刷新 */ public void refresh() { -// isPopulating = true; - System.out.println("in refresh..."); int selectionSize = designer.getSelectionModel().getSelection().size(); if (selectionSize == 0 || selectionSize == 1) { this.creator = selectionSize == 0 ? designer.getRootComponent() : designer.getSelectionModel() @@ -220,35 +166,23 @@ public class EventPropertyTable extends UIListControlPane { refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents(), WidgetEventListenerUpdatePane.class)); -// ((DefaultListModel) nameableList.getModel()).removeAllElements(); ArrayList nameObjectList = new ArrayList<>(); for (int i = 0, size = widget.getListenerSize(); i < size; i++) { Listener listener = widget.getListener(i); if (!listener.isDefault()) { -// addNameObject(new NameObject(switchLang(listener.getEventName()) + (i + 1), listener), i); nameObjectList.add(i, new NameObject(switchLang(listener.getEventName()) + (i + 1), listener)); - } } populate(nameObjectList.toArray(new NameObject[widget.getListenerSize()])); checkButtonEnabled(); this.repaint(); -// isPopulating = false; - System.out.println("out refresh..."); } /** * 更新控件事件 * @param creator 控件 */ - public void updateWidgetListener(XCreator creator, boolean isSaving) { -// DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); -// (creator.toData()).clearListeners(); -// for (int i = 0, len = listModel.getSize(); i < len; i++) { -// NameObject nameObject = isSaving ? (NameObject)((ListModelElement) listModel.getElementAt(i)).wrapper : (NameObject)(listModel.getElementAt(i)); -// (creator.toData()).addListener((Listener) nameObject.getObject()); -// } - + public void updateWidgetListener(XCreator creator) { (creator.toData()).clearListeners(); Nameable[] res = this.update(); for (int i = 0; i < res.length; i++) { @@ -260,10 +194,6 @@ public class EventPropertyTable extends UIListControlPane { checkButtonEnabled(); } - public void updateWidgetListener(XCreator creator) { - updateWidgetListener(creator, true); - } - @Override protected String title4PopupWindow() { return "Event"; @@ -281,121 +211,6 @@ public class EventPropertyTable extends UIListControlPane { if (isPopulating) { return; } - updateWidgetListener(creator, true); + updateWidgetListener(creator); } - - private class DnDTransferHandler extends TransferHandler { - private int action; - - public DnDTransferHandler() { - this(TransferHandler.MOVE); - } - - public DnDTransferHandler(int action) { - this.action = action; - } - - @Override - public int getSourceActions(JComponent comp) { - return action; - } - - @Override - public Transferable createTransferable(JComponent comp) { - - int index = nameableList.getSelectedIndex(); - if (index < 0 || index >= nameableList.getModel().getSize()) { - return null; - } - - return new DnDListItem((NameObject) nameableList.getSelectedValue()); - } - - @Override - public boolean canImport(TransferSupport support) { - if (!support.isDrop()) { - return false; - } - - if (!support.isDataFlavorSupported(DnDListItem.FLAVOR)) { - return false; - } - - boolean actionSupported = (action & support.getSourceDropActions()) == action; - if (actionSupported) { - support.setDropAction(action); - return true; - } - - return false; - } - - @Override - public boolean importData(TransferHandler.TransferSupport support) { - if (!canImport(support)) { - return false; - } - JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); - - int importIndex = dl.getIndex(); - - try { - NameObject item = (NameObject) support.getTransferable().getTransferData(DnDListItem.FLAVOR); - JList list = (JList) support.getComponent(); - DefaultListModel model = (DefaultListModel) list.getModel(); - for (int i = 0; i <= importIndex; i++) { - if (ComparatorUtils.equals(item,model.getElementAt(i))) { - importIndex--; - break; - } - } - model.removeElement(item); - model.insertElementAt(item, importIndex); - updateWidgetListener(creator); - } catch (UnsupportedFlavorException e) { - return false; - } catch (java.io.IOException e) { - return false; - } - - return true; - } - } - - public static class DnDListItem implements Transferable { - private NameObject no; - public static final DataFlavor FLAVOR = new DataFlavor(DnDListItem.class, "DnDListItem.class"); - - public DnDListItem(NameObject no) { - this.no = no; - } - - @Override - public DataFlavor[] getTransferDataFlavors() { - return new DataFlavor[] { FLAVOR }; - } - - @Override - /** - *是否支持 dataFlavor - *@param DataFlavor类 - *@return 支持返回true - */ - public boolean isDataFlavorSupported(DataFlavor flavor) { - if (ComparatorUtils.equals(flavor,FLAVOR)) { - return true; - } - - return false; - } - - @Override - public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { - if (ComparatorUtils.equals(flavor,FLAVOR)) { - return no; - } - - return null; - } - } } \ No newline at end of file From 25b278e3c01633fbcc56ab299450d258d717a769 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 17:35:56 +0800 Subject: [PATCH 15/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=EF=BC=88?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=EF=BC=89=3D>=E5=8E=BB=E6=8E=89=E5=86=97?= =?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../properties/EventPropertyTable.java | 73 ------------------- 1 file changed, 73 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java index 41057748fc..435f42cfe6 100644 --- a/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/EventPropertyTable.java @@ -1,17 +1,11 @@ package com.fr.design.designer.properties; -import com.fr.design.actions.UpdateAction; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.frpane.ListenerUpdatePane; -import com.fr.design.gui.ilist.ListModelElement; -import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptActionPane; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.menu.MenuDef; -import com.fr.design.menu.ShortCut; -import com.fr.design.menu.ToolBarDef; import com.fr.design.widget.EventCreator; import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.editor.ValueEditorPaneFactory; @@ -21,19 +15,14 @@ import com.fr.design.form.javascript.FormEmailPane; import com.fr.form.ui.Widget; import com.fr.general.Inter; import com.fr.general.NameObject; -import com.fr.js.JavaScriptImpl; import com.fr.stable.Nameable; import javax.swing.*; -import java.awt.event.ActionEvent; import java.util.ArrayList; public class EventPropertyTable extends UIListControlPane { - private ShortCut[] shorts; private XCreator creator; - private ToolBarDef toolbarDef; - private UIToolbar toolbar; private FormDesigner designer; public EventPropertyTable(FormDesigner designer) { @@ -46,40 +35,11 @@ public class EventPropertyTable extends UIListControlPane { return Inter.getLocText("FR-Designer_Add_Event"); } - @Override - protected void initComponentPane() { - toolbarDef = new ToolBarDef(); - shorts = new ShortCut[] {new AddItemMenuDef()}; - for (ShortCut sj : shorts) { - toolbarDef.addShortCut(sj); - } - toolbar = ToolBarDef.createJToolBar(); - toolbarDef.updateToolBar(toolbar); - - super.initComponentPane(); - } - - /** - * 指定索引添加对象 - * @param nameObject 对象名 - * @param index 索引 - */ - public void addNameObject(NameObject nameObject, int index) { - DefaultListModel model = (DefaultListModel) nameableList.getModel(); - - model.add(index, new ListModelElement(nameObject)); - nameableList.setSelectedIndex(index); - nameableList.ensureIndexIsVisible(index); - - nameableList.repaint(); - } - public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane { @Override protected JavaScriptActionPane createJavaScriptActionPane() { return new JavaScriptActionPane() { - @Override protected DBManipulationPane createDBManipulationPane() { return new DBManipulationPane(ValueEditorPaneFactory.formEditors()); @@ -110,39 +70,6 @@ public class EventPropertyTable extends UIListControlPane { return false; } } - - /* - * 增加项的MenuDef - */ - protected class AddItemMenuDef extends MenuDef { - public AddItemMenuDef() { - this.setName(Inter.getLocText("Add")); - this.setMnemonic('A'); - this.setIconPath("/com/fr/design/images/control/addPopup.png"); - } - - public void populate(String[] eventNames) { - this.clearShortCuts(); - for (int i = 0; i < eventNames.length; i++) { - final String eventname = eventNames[i]; - - this.addShortCut(new UpdateAction() { - { - this.setName(switchLang(eventname)); - } - - public void actionPerformed(ActionEvent e) { - NameObject nameable = new NameObject(createUnrepeatedName(switchLang(eventname)), new Listener( - eventname,new JavaScriptImpl())); - - EventPropertyTable.this.addNameObject(nameable, EventPropertyTable.this.nameableList.getModel() - .getSize()); - updateWidgetListener(creator); - } - }); - } - } - } private String switchLang(String eventName) { return Inter.getLocText("Event-" + eventName); From f5a98631691448389440f52289d58742d30174b4 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 17:57:04 +0800 Subject: [PATCH 16/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=EF=BC=88?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=EF=BC=89=3D>=E8=BE=B9=E6=A1=86=E6=A0=A1?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/WidgetPropertyPane.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index 40bdff39c5..8b959deec9 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -127,9 +127,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper private void createEventTable() { eventTable = new EventPropertyTable(designer); designer.addDesignerEditListener(new EventPropertyDesignerAdapter(eventTable)); - eventTable.setBorder(null); - esp = new UIScrollPane(eventTable); //用来装载事件table - esp.setBorder(null); } /** @@ -239,7 +236,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper tabbedPane.setBorder(null); tabbedPane.setTabPlacement(SwingConstants.BOTTOM); tabbedPane.addTab(Inter.getLocText("FR-Designer_Properties"), psp); - tabbedPane.addTab(Inter.getLocText("FR-Designer_Event"), esp); + tabbedPane.addTab(Inter.getLocText("FR-Designer_Event"), eventTable); tabbedPane.addTab(Inter.getLocText("FR-Widget_Mobile_Terminal"), wsp); } From 601fab68d132601fb6c5763e703f9fd20fbf9491 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 2 Aug 2017 20:06:12 +0800 Subject: [PATCH 17/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6=E7=BC=96=E8=BE=91=EF=BC=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=EF=BC=89=3D=E3=80=8B=E6=95=B4=E5=90=88?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=AE=9E=E7=8E=B0=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/WidgetEventPane.java | 75 +------------------ 1 file changed, 4 insertions(+), 71 deletions(-) diff --git a/designer/src/com/fr/design/widget/WidgetEventPane.java b/designer/src/com/fr/design/widget/WidgetEventPane.java index 449e599e83..3d37770b06 100644 --- a/designer/src/com/fr/design/widget/WidgetEventPane.java +++ b/designer/src/com/fr/design/widget/WidgetEventPane.java @@ -6,6 +6,7 @@ import java.util.List; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.controlpane.ObjectUIControlPane; +import com.fr.design.mainframe.CellWidgetPropertyPane; import com.fr.design.present.CellWriteAttrPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.SmartInsertDBManipulationInWidgetEventPane; @@ -30,14 +31,9 @@ import com.fr.report.stable.ReportConstants; import com.fr.stable.Nameable; public class WidgetEventPane extends ObjectUIControlPane { - private ElementCasePane ePane; - - public WidgetEventPane() { - this(null); - } + public WidgetEventPane(ElementCasePane pane) { super(pane); - ePane = pane; this.setNameListEditable(false); } @@ -58,67 +54,7 @@ public class WidgetEventPane extends ObjectUIControlPane { @Override public void saveSettings() { - - final TemplateElementCase tplEC = ePane.getEditingElementCase(); - final CellSelection finalCS = (CellSelection) ePane.getSelection(); - TemplateCellElement editCellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow()); - if (editCellElement == null) { - editCellElement = new DefaultTemplateCellElement(finalCS.getColumn(), finalCS.getRow()); - tplEC.addCellElement(editCellElement); - } - final BasicPane bp = populateBasicPane(editCellElement); - - // 需要先行后列地增加新元素。 - for (int j = 0; j < finalCS.getRowSpan(); j++) { - for (int i = 0; i < finalCS.getColumnSpan(); i++) { - int column = i + finalCS.getColumn(); - int row = j + finalCS.getRow(); - editCellElement = tplEC.getTemplateCellElement(column, row); - if (editCellElement == null) { - editCellElement = new DefaultTemplateCellElement(column, row); - tplEC.addCellElement(editCellElement); - } - // alex:不加这一句话会导致跨行跨列的格子被多次update - if (editCellElement.getColumn() != column || editCellElement.getRow() != row) { - continue; - } - updateBasicPane(bp, editCellElement); - - Object editElementValue = editCellElement.getValue(); - if (editElementValue != null && (editElementValue instanceof String || editElementValue instanceof Number)) { - // TODO ALEX_SEP 暂时用FIT_DEFAULT替代,不取reportsetting里面的设置,因为也不知道是应该放在report里面还是elementcase里面 - GridUtils.shrinkToFit(ReportConstants.AUTO_SHRINK_TO_FIT_DEFAULT, tplEC, editCellElement); - } - } - } - ePane.fireTargetModified(); - } - - private BasicPane populateBasicPane(TemplateCellElement cellElement) { - CellWriteAttrPane pane = new CellWriteAttrPane(ePane); - //got simple cell element from column and row. - pane.populate(cellElement); - - return pane; - } - - private void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) { - CellWriteAttrPane pane = (CellWriteAttrPane) bp; - if (cellElement.getWidget() == null) { - pane.update(cellElement); - return; - } - try { - Widget oldWidget = (Widget) cellElement.getWidget().clone(); - pane.update(cellElement); - //这边需要重新设置权限细粒度的hashset是因为Update是直接生成一个新的来update的,所以以前里面的hashset都没有了 - Widget newWidget = cellElement.getWidget(); - if (newWidget.getClass() == oldWidget.getClass()) { - newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone()); - } - } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); - } + CellWidgetPropertyPane.getInstance().update(); } @Override @@ -127,10 +63,7 @@ public class WidgetEventPane extends ObjectUIControlPane { } public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane { - private ElementCasePane epane; - public WidgetEventListenerUpdatePane() { - this(null); - } + private ElementCasePane epane; public WidgetEventListenerUpdatePane(ElementCasePane epane){ this.epane = epane; super.initComponents(); From 3dfeeccbd3032880d6a8af6a5e73ead9a72333ab Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 3 Aug 2017 10:40:37 +0800 Subject: [PATCH 18/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E7=BC=A9=E6=94=BE=E6=9D=A1toolti?= =?UTF-8?q?p=E9=83=A8=E5=88=86=E8=A7=86=E8=A7=89=E4=BC=98=E5=8C=96=20pr?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/cell/CleanAuthorityAction.java | 2 +- .../mainframe/AuthorityEditToolBarPane.java | 20 ++-- .../ElementCasePaneAuthorityEditPane.java | 14 +-- .../mainframe/SheetAuthorityEditPane.java | 47 +++------ .../design/mainframe/AuthorityEditPane.java | 2 +- .../com/fr/design/mainframe/JSliderPane.java | 98 ++++++++++++------- 6 files changed, 101 insertions(+), 82 deletions(-) diff --git a/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java b/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java index a7b22cfbe7..0251654f40 100644 --- a/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java +++ b/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java @@ -1 +1 @@ -package com.fr.design.actions.cell; import java.awt.Rectangle; import java.awt.event.ActionEvent; import com.fr.design.actions.ElementCaseAction; import com.fr.design.mainframe.AuthorityPropertyPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; /** * Author : daisy * Date: 13-9-23 * Time: 下午2:41 */ public class CleanAuthorityAction extends ElementCaseAction { public CleanAuthorityAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText(new String[]{"Clear", "DashBoard-Potence"})); } /** * 清楚权限动作 * * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { ElementCasePane reportPane = getEditingComponent(); Selection selection = reportPane.getSelection(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (selection instanceof FloatSelection) { String name = ((FloatSelection) selection).getSelectedFloatName(); TemplateElementCase ec = reportPane.getEditingElementCase(); FloatElement fe = ec.getFloatElement(name); if (fe.isDoneAuthority(selectedRoles)) { fe.cleanAuthority(selectedRoles); } doAfterAuthority(reportPane); return; } CellSelection cellSelection = (CellSelection) selection; boolean isChooseColumnRow = cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN || cellSelection.getSelectedType() == CellSelection.CHOOSE_ROW; if (isChooseColumnRow && cellSelection.getCellRectangleCount() == 1) { cleanColumnRow(cellSelection, reportPane, selectedRoles); } else { cleanCell(cellSelection, reportPane, selectedRoles); } doAfterAuthority(reportPane); } private void doAfterAuthority(ElementCasePane reportPane) { reportPane.repaint(); reportPane.fireTargetModified(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().repaint(); if (EastRegionContainerPane.getInstance().getUpPane() instanceof AuthorityPropertyPane) { AuthorityPropertyPane authorityPropertyPane = (AuthorityPropertyPane) EastRegionContainerPane.getInstance().getUpPane(); authorityPropertyPane.populate(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); } } /** * 清除单元格对应的角色的权限 * * @param cellSelection * @param reportPane */ private void cleanCell(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); int cellRectangleCount = cellSelection.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { Rectangle cellRectangle = cellSelection.getCellRectangle(rect); for (int j = 0; j < cellRectangle.height; j++) { for (int i = 0; i < cellRectangle.width; i++) { int column = i + cellRectangle.x; int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { continue; } //清除权限 if (cellElement.isDoneAuthority(selectedRoles) || cellElement.isDoneNewValueAuthority(selectedRoles)) { cellElement.cleanAuthority(selectedRoles); } if (cellElement.getWidget() == null) { continue; } boolean isDoneAuthority = cellElement.getWidget().isDoneVisibleAuthority(selectedRoles) || cellElement.getWidget().isDoneUsableAuthority(selectedRoles); if (isDoneAuthority) { cellElement.getWidget().cleanAuthority(selectedRoles); } } } } } private void cleanColumnRow(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); if (cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { for (int col = cellSelection.getColumn(); col < cellSelection.getColumn() + cellSelection.getColumnSpan(); col++) { elementCase.removeColumnPrivilegeControl(col, selectedRoles); } } else { for (int row = cellSelection.getRow(); row < cellSelection.getRow() + cellSelection.getRowSpan(); row++) { elementCase.removeRowPrivilegeControl(row, selectedRoles); } } } /** * 是否需要撤销动作 * * @return 不需要 */ public boolean executeActionReturnUndoRecordNeeded() { return false; } } \ No newline at end of file +package com.fr.design.actions.cell; import com.fr.design.actions.ElementCaseAction; import com.fr.design.mainframe.AuthorityPropertyPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; import java.awt.*; import java.awt.event.ActionEvent; /** * Author : daisy * Date: 13-9-23 * Time: 下午2:41 */ public class CleanAuthorityAction extends ElementCaseAction { public CleanAuthorityAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText(new String[]{"Clear", "DashBoard-Potence"})); } /** * 清楚权限动作 * * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { ElementCasePane reportPane = getEditingComponent(); Selection selection = reportPane.getSelection(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (selection instanceof FloatSelection) { String name = ((FloatSelection) selection).getSelectedFloatName(); TemplateElementCase ec = reportPane.getEditingElementCase(); FloatElement fe = ec.getFloatElement(name); if (fe.isDoneAuthority(selectedRoles)) { fe.cleanAuthority(selectedRoles); } doAfterAuthority(reportPane); return; } CellSelection cellSelection = (CellSelection) selection; boolean isChooseColumnRow = cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN || cellSelection.getSelectedType() == CellSelection.CHOOSE_ROW; if (isChooseColumnRow && cellSelection.getCellRectangleCount() == 1) { cleanColumnRow(cellSelection, reportPane, selectedRoles); } else { cleanCell(cellSelection, reportPane, selectedRoles); } doAfterAuthority(reportPane); } private void doAfterAuthority(ElementCasePane reportPane) { reportPane.repaint(); reportPane.fireTargetModified(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().repaint(); if (EastRegionContainerPane.getInstance().getUpPane() instanceof AuthorityPropertyPane) { AuthorityPropertyPane authorityPropertyPane = (AuthorityPropertyPane) EastRegionContainerPane.getInstance().getUpPane(); authorityPropertyPane.populate(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); } } /** * 清除单元格对应的角色的权限 * * @param cellSelection * @param reportPane */ private void cleanCell(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); int cellRectangleCount = cellSelection.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { Rectangle cellRectangle = cellSelection.getCellRectangle(rect); for (int j = 0; j < cellRectangle.height; j++) { for (int i = 0; i < cellRectangle.width; i++) { int column = i + cellRectangle.x; int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { continue; } //清除权限 if (cellElement.isDoneAuthority(selectedRoles) || cellElement.isDoneNewValueAuthority(selectedRoles)) { cellElement.cleanAuthority(selectedRoles); } if (cellElement.getWidget() == null) { continue; } boolean isDoneAuthority = cellElement.getWidget().isDoneVisibleAuthority(selectedRoles) || cellElement.getWidget().isDoneUsableAuthority(selectedRoles); if (isDoneAuthority) { cellElement.getWidget().cleanAuthority(selectedRoles); } } } } } private void cleanColumnRow(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); if (cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { for (int col = cellSelection.getColumn(); col < cellSelection.getColumn() + cellSelection.getColumnSpan(); col++) { elementCase.removeColumnPrivilegeControl(col, selectedRoles); } } else { for (int row = cellSelection.getRow(); row < cellSelection.getRow() + cellSelection.getRowSpan(); row++) { elementCase.removeRowPrivilegeControl(row, selectedRoles); } } } /** * 是否需要撤销动作 * * @return 不需要 */ public boolean executeActionReturnUndoRecordNeeded() { return false; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java b/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java index 317bed8d9f..2632316771 100644 --- a/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java +++ b/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java @@ -84,6 +84,8 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { private static final int TOP_GAP = 11; private static final int LEFT_GAP = 4; private static final int LEFT_CHECKPANE = 3; + private JPanel typePane; + private JPanel namePane; private UILabel type = null; private UILabel name = null; private JPanel checkPane = null; @@ -144,9 +146,15 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { public AuthorityEditPane(List buttonlists) { setLayout(new BorderLayout()); type = new UILabel(); - type.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + typePane = new JPanel(new BorderLayout()); + typePane.add(type, BorderLayout.CENTER); + type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); + typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); - name.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + namePane = new JPanel(new BorderLayout()); + namePane.add(name, BorderLayout.CENTER); + name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); + namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); this.add(centerPane(), BorderLayout.NORTH); @@ -162,8 +170,8 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), type}, - new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), name}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane}, new Component[]{checkPane, null}, }; @@ -200,7 +208,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { if (name.getText() == "") { type.setText(""); } else { - type.setText(" " + Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"})); + type.setText(Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"})); } } @@ -214,7 +222,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { if (names != "") { names = names.substring(1); } - name.setText(" " + names); + name.setText(names); } public void populateCheckPane() { diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java b/designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java index 59df5f06f2..ef9e6610cd 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java @@ -427,13 +427,13 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane { */ public void populateType() { if (selectionType == CellSelection.NORMAL) { - type.setText(" "+Inter.getLocText("FR-Designer_Cell")); + type.setText(Inter.getLocText("FR-Designer_Cell")); } else if (selectionType == CellSelection.CHOOSE_ROW) { - type.setText(" "+Inter.getLocText("FR-Designer_Row")); + type.setText(Inter.getLocText("FR-Designer_Row")); } else if (selectionType == CellSelection.CHOOSE_COLUMN) { - type.setText(" "+Inter.getLocText("FR-Designer_Column")); + type.setText(Inter.getLocText("FR-Designer_Column")); } else { - type.setText(" "+Inter.getLocText("M_Insert-Float")); + type.setText(Inter.getLocText("M_Insert-Float")); } } @@ -442,11 +442,11 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane { */ public void populateName() { if (selectionType == CellSelection.NORMAL) { - name.setText(" "+getCellSelectionName()); + name.setText(getCellSelectionName()); } else if (selectionType == CellSelection.CHOOSE_ROW || selectionType == CellSelection.CHOOSE_COLUMN) { - name.setText(" "+getCellColumnRowName()); + name.setText(getCellColumnRowName()); } else { - name.setText(" "+getFloatSelectionName()); + name.setText(getFloatSelectionName()); } } diff --git a/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java b/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java index 871b51cc66..66d9f8d95a 100644 --- a/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java +++ b/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java @@ -34,6 +34,8 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { private UICheckBox sheetVisible = new UICheckBox("sheet" + Inter.getLocText("Widget-Visible")); private WorkBook workBook = null; private int selectedIndex = -1; + private JPanel typePane; + private JPanel namePane; private ItemListener itemListener = new ItemListener() { @Override @@ -66,9 +68,15 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); setLayout(new BorderLayout()); type = new UILabel(); - type.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + typePane = new JPanel(new BorderLayout()); + typePane.add(type, BorderLayout.CENTER); + type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); + typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); - name.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + namePane = new JPanel(new BorderLayout()); + namePane.add(name, BorderLayout.CENTER); + name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); + namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); // this.add(layoutText(), BorderLayout.WEST); @@ -87,41 +95,14 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), type}, - new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), name}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane}, new Component[]{checkPane, null}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); } - private JPanel layoutText() { - double p = TableLayout.PREFERRED; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Type") + ":", SwingConstants.RIGHT)}, - new Component[]{new UILabel(Inter.getLocText("WF-Name") + ":", SwingConstants.RIGHT)}, - new Component[]{new UILabel(Inter.getLocText("DashBoard-Potence") + ":", SwingConstants.RIGHT)}, - }; - double[] rowSize = {p, p, p}; - double[] columnSize = {p}; - int[][] rowCount = {{1}, {1}, {1}}; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); - } - - - private JPanel layoutPane() { - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - Component[][] components = new Component[][]{ - new Component[]{type}, - new Component[]{name}, - new Component[]{checkPane}, - }; - double[] rowSize = {p, p, p}; - double[] columnSize = {f}; - int[][] rowCount = {{1}, {1}, {1}}; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); - } /** @@ -146,14 +127,14 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { * 刷新类型 */ public void populateType() { - type.setText(" " + "sheet"); + type.setText("sheet"); } /** * 更新名字 */ public void populateName() { - name.setText(" " + workBook.getReportName(selectedIndex)); + name.setText(workBook.getReportName(selectedIndex)); } /** diff --git a/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java b/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java index ce6a905433..25b5912551 100644 --- a/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java +++ b/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java @@ -1 +1 @@ -package com.fr.design.mainframe; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:21 */ public abstract class AuthorityEditPane extends JPanel { protected static final int TOP_GAP = 11; protected static final int LEFT_GAP = 4; protected static final int RIGHT_GAP = 10; protected static final int ALIGNMENT_GAP = -3; protected static final int LEFT_CHECKPANE = 3; protected UILabel type = null; protected UILabel name = null; protected JPanel checkPane = null; private TargetComponent target; public AuthorityEditPane(TargetComponent target) { this.target = target; setLayout(new BorderLayout()); type = new UILabel(); type.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); name.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); // this.add(layoutText(), BorderLayout.WEST); // this.add(layoutPane(), BorderLayout.CENTER); this.add(centerPane(), BorderLayout.NORTH); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); } private JPanel centerPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p, p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), type}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), name}, new Component[]{checkPane, null}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); } /** * 更新权限编辑面板的具体内容:类型、名称、权限面板 */ public void populateDetials() { populateType(); populateName(); checkPane.removeAll(); populateCheckPane(); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); } public abstract void populateType(); public abstract void populateName(); public abstract JPanel populateCheckPane(); } \ No newline at end of file +package com.fr.design.mainframe; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:21 */ public abstract class AuthorityEditPane extends JPanel { protected static final int TOP_GAP = 11; protected static final int LEFT_GAP = 4; protected static final int RIGHT_GAP = 10; protected static final int ALIGNMENT_GAP = -3; protected static final int LEFT_CHECKPANE = 3; protected UILabel type = null; protected UILabel name = null; protected JPanel checkPane = null; private TargetComponent target; private JPanel typePane; private JPanel namePane; public AuthorityEditPane(TargetComponent target) { this.target = target; setLayout(new BorderLayout()); type = new UILabel(); typePane = new JPanel(new BorderLayout()); typePane.add(type, BorderLayout.CENTER); type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); namePane = new JPanel(new BorderLayout()); namePane.add(name, BorderLayout.CENTER); name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); // this.add(layoutText(), BorderLayout.WEST); // this.add(layoutPane(), BorderLayout.CENTER); this.add(centerPane(), BorderLayout.NORTH); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); } private JPanel centerPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p, p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane}, new Component[]{checkPane, null}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); } /** * 更新权限编辑面板的具体内容:类型、名称、权限面板 */ public void populateDetials() { populateType(); populateName(); checkPane.removeAll(); populateCheckPane(); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); } public abstract void populateType(); public abstract void populateName(); public abstract JPanel populateCheckPane(); } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 50ca69a9e7..2e54054eaf 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -18,10 +18,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.plaf.basic.BasicSliderUI; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; +import java.awt.event.*; import java.math.BigDecimal; /** @@ -48,6 +45,8 @@ public class JSliderPane extends JPanel { private static final int SHOWVALBUTTON_WIDTH = 40; private static final int SHOWVALBUTTON_HEIGHTH = 20; private static final int SLIDER_GAP = 5; + private static final int TOOLTIP_Y = 25; + private static final Color BACK_COLOR = new Color(245, 245, 247); public int showValue = 100; public double resolutionTimes = 1.0; @@ -76,22 +75,70 @@ public class JSliderPane extends JPanel { public JSliderPane() { this.setLayout(new BorderLayout()); - slider = new UISlider(0, HUNDRED, HALF_HUNDRED); + initSlider(); + initShowValSpinner(); + initDownUpButton(); + initShowValButton(); + initUIRadioButton(); + initPane(); + JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); + panel.add(downButton); + panel.add(slider); + panel.add(upButton); + panel.add(showValButton); + panel.setBackground(BACK_COLOR); + this.add(panel, BorderLayout.NORTH); + } + + + + public static final JSliderPane getInstance() { +// if (THIS == null) { +// THIS = new JSliderPane(); +// } + THIS = new JSliderPane(); + return THIS; + } + + private void initSlider() { + slider = new UISlider(0, HUNDRED, HALF_HUNDRED){ + public Point getToolTipLocation(MouseEvent event){ + return new Point(event.getX(), event.getY() - TOOLTIP_Y); + } + }; slider.setUI(new JSliderPaneUI(slider)); slider.addChangeListener(listener); slider.setPreferredSize(new Dimension(220, 20)); //去掉虚线框 slider.setFocusable(false); slider.setToolTipText(Inter.getLocText("FR-Designer_Scale_Slider")); - showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)); + } + + private void initShowValSpinner() { + showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)){ + public Point getToolTipLocation(MouseEvent event){ + return new Point(event.getX(), event.getY() - TOOLTIP_Y); + } + }; showValSpinner.setEnabled(true); showValSpinner.addChangeListener(showValSpinnerChangeListener); showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT)); - downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")); + } + + private void initDownUpButton() { + downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")){ + public Point getToolTipLocation(MouseEvent event){ + return new Point(event.getX(), event.getY() - TOOLTIP_Y); + } + }; downButton.setOpaque(false); downButton.setBorderPainted(false); downButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Down")); - upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")); + upButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverUp20.png")){ + public Point getToolTipLocation(MouseEvent event){ + return new Point(event.getX(), event.getY() - TOOLTIP_Y); + } + }; upButton.setOpaque(false); upButton.setBorderPainted(false); upButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Up")); @@ -99,7 +146,14 @@ public class JSliderPane extends JPanel { upButton.setActionCommand("more"); downButton.addActionListener(buttonActionListener); upButton.addActionListener(buttonActionListener); - showValButton = new JButton(showValSpinner.getValue() + "%"); + } + + private void initShowValButton() { + showValButton = new JButton(showValSpinner.getValue() + "%"){ + public Point getToolTipLocation(MouseEvent event){ + return new Point(event.getX(), event.getY() - TOOLTIP_Y); + } + }; showValButton.setOpaque(false); showValButton.setMargin(new Insets(0, 0, 0, 0)); showValButton.setFont(new Font("SimSun", Font.PLAIN, 12)); @@ -107,31 +161,7 @@ public class JSliderPane extends JPanel { showValButton.setBorderPainted(false); showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); showValButton.addActionListener(showValButtonActionListener); - //TODO 先注释,需要自定义tooltip -// showValButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Grade")); - initUIRadioButton(); - initPane(); - JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); - panel.add(downButton); - panel.add(slider); - panel.add(upButton); - panel.add(showValButton); - panel.setBackground(BACK_COLOR); - this.add(panel, BorderLayout.NORTH); - } - - public JToolTip createToolTip() { - JToolTip tip = new JToolTip(); - tip.setComponent(this); - return tip; - } - - public static final JSliderPane getInstance() { -// if (THIS == null) { -// THIS = new JSliderPane(); -// } - THIS = new JSliderPane(); - return THIS; + showValButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Grade")); } private void initUIRadioButton() { From be2ab9031440ee29f7f66aa4badeafe9aa7aafdd Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 3 Aug 2017 10:43:10 +0800 Subject: [PATCH 19/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/controlpane/ObjectUIControlPane.java | 12 +----------- .../com/fr/design/mainframe/JTemplate.java | 2 +- .../com/fr/design/widget/EventCreator.java | 19 ------------------- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java index 46b41d020a..3b2a1b0711 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/ObjectUIControlPane.java @@ -30,17 +30,7 @@ public abstract class ObjectUIControlPane extends UIListControlPane { Constructor constructor = getConstructor(creator.getUpdatePane(), object.getClass()); return constructor == null ? super.createPaneByCreators(creator) : constructor.newInstance(object); } - } catch (InstantiationException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (IllegalArgumentException e) { - throw new RuntimeException(e); - } catch (SecurityException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (NoSuchMethodException e) { + } catch (Exception e) { throw new RuntimeException(e); } } diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index b5d1f4cabb..aa42804dbb 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -128,7 +128,7 @@ public abstract class JTemplate> ex long saveTime = System.currentTimeMillis(); // 保存模板的时间点 try { tic.collectInfo(template, this, openTime, saveTime); - } catch (Exception ex) { // 不管收集过程中出现任何异常,都不应该影响模版保存 + } catch (Throwable th) { // 不管收集过程中出现任何异常,都不应该影响模版保存 } openTime = saveTime; // 更新 openTime,准备下一次计算 } diff --git a/designer_base/src/com/fr/design/widget/EventCreator.java b/designer_base/src/com/fr/design/widget/EventCreator.java index 530bd34aa2..84f6120a75 100644 --- a/designer_base/src/com/fr/design/widget/EventCreator.java +++ b/designer_base/src/com/fr/design/widget/EventCreator.java @@ -50,25 +50,6 @@ public class EventCreator extends NameableSelfCreator { public void saveUpdatedBean(ListModelElement wrapper, Object bean) { ((NameObject)wrapper.wrapper).setObject(bean); } - - -// public static final EventCreator BEFOREEDIT = new EventCreator(Widget.BEFOREEDIT); -// -// public static final EventCreator AFTEREDIT = new EventCreator(Widget.AFTEREDIT); -// -// public static final EventCreator CHANGE = new EventCreator(Widget.CHANGE); -// -// public static final EventCreator CLICK = new EventCreator(Widget.EVENT_CLICK); -// -// public static final EventCreator SUCCESS = new EventCreator("success"); -// -// public static final EventCreator AFTERINIT = new EventCreator(Widget.AFTERINIT); -// -// public static final EventCreator STOPEDIT = new EventCreator(Widget.STOPEDIT); -// -// public static final EventCreator STATECHANGE = new EventCreator(Widget.EVENT_STATECHANGE); -// -// public static final EventCreator CALLBACK = new EventCreator(FileEditor.EVENT_UPLOAD_CALLBACK); @Override public String createTooltip() { From c4a82d0ea0251db5a7c0d586e4210edb5feed09d Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 3 Aug 2017 10:50:02 +0800 Subject: [PATCH 20/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/properties/FormWidgetAuthorityEditPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java b/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java index 38c33c4448..d156636da6 100644 --- a/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java +++ b/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java @@ -93,7 +93,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { * @date 2014-12-21-下午6:19:43 */ public void populateType() { - type.setText(" " + Inter.getLocText("Widget-Form_Widget_Config")); + type.setText(Inter.getLocText("Widget-Form_Widget_Config")); } /** @@ -109,7 +109,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { for (int i = 0; i < widgets.length; i++) { nameText += "," + widgets[i].getClass().getSimpleName(); } - name.setText(" " + nameText.substring(1)); + name.setText(nameText.substring(1)); } /** From 864d41a7a39008a169bd558149f1aa1ee94a420b Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 3 Aug 2017 10:54:10 +0800 Subject: [PATCH 21/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E6=8D=A2=E8=A1=8C=E7=AC=A6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/cell/CleanAuthorityAction.java | 142 +++++++++++++++++- 1 file changed, 141 insertions(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java b/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java index 0251654f40..e941068d45 100644 --- a/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java +++ b/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java @@ -1 +1,141 @@ -package com.fr.design.actions.cell; import com.fr.design.actions.ElementCaseAction; import com.fr.design.mainframe.AuthorityPropertyPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; import java.awt.*; import java.awt.event.ActionEvent; /** * Author : daisy * Date: 13-9-23 * Time: 下午2:41 */ public class CleanAuthorityAction extends ElementCaseAction { public CleanAuthorityAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText(new String[]{"Clear", "DashBoard-Potence"})); } /** * 清楚权限动作 * * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { ElementCasePane reportPane = getEditingComponent(); Selection selection = reportPane.getSelection(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (selection instanceof FloatSelection) { String name = ((FloatSelection) selection).getSelectedFloatName(); TemplateElementCase ec = reportPane.getEditingElementCase(); FloatElement fe = ec.getFloatElement(name); if (fe.isDoneAuthority(selectedRoles)) { fe.cleanAuthority(selectedRoles); } doAfterAuthority(reportPane); return; } CellSelection cellSelection = (CellSelection) selection; boolean isChooseColumnRow = cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN || cellSelection.getSelectedType() == CellSelection.CHOOSE_ROW; if (isChooseColumnRow && cellSelection.getCellRectangleCount() == 1) { cleanColumnRow(cellSelection, reportPane, selectedRoles); } else { cleanCell(cellSelection, reportPane, selectedRoles); } doAfterAuthority(reportPane); } private void doAfterAuthority(ElementCasePane reportPane) { reportPane.repaint(); reportPane.fireTargetModified(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().repaint(); if (EastRegionContainerPane.getInstance().getUpPane() instanceof AuthorityPropertyPane) { AuthorityPropertyPane authorityPropertyPane = (AuthorityPropertyPane) EastRegionContainerPane.getInstance().getUpPane(); authorityPropertyPane.populate(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); } } /** * 清除单元格对应的角色的权限 * * @param cellSelection * @param reportPane */ private void cleanCell(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); int cellRectangleCount = cellSelection.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { Rectangle cellRectangle = cellSelection.getCellRectangle(rect); for (int j = 0; j < cellRectangle.height; j++) { for (int i = 0; i < cellRectangle.width; i++) { int column = i + cellRectangle.x; int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { continue; } //清除权限 if (cellElement.isDoneAuthority(selectedRoles) || cellElement.isDoneNewValueAuthority(selectedRoles)) { cellElement.cleanAuthority(selectedRoles); } if (cellElement.getWidget() == null) { continue; } boolean isDoneAuthority = cellElement.getWidget().isDoneVisibleAuthority(selectedRoles) || cellElement.getWidget().isDoneUsableAuthority(selectedRoles); if (isDoneAuthority) { cellElement.getWidget().cleanAuthority(selectedRoles); } } } } } private void cleanColumnRow(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); if (cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { for (int col = cellSelection.getColumn(); col < cellSelection.getColumn() + cellSelection.getColumnSpan(); col++) { elementCase.removeColumnPrivilegeControl(col, selectedRoles); } } else { for (int row = cellSelection.getRow(); row < cellSelection.getRow() + cellSelection.getRowSpan(); row++) { elementCase.removeRowPrivilegeControl(row, selectedRoles); } } } /** * 是否需要撤销动作 * * @return 不需要 */ public boolean executeActionReturnUndoRecordNeeded() { return false; } } \ No newline at end of file +package com.fr.design.actions.cell; + +import com.fr.design.actions.ElementCaseAction; +import com.fr.design.mainframe.AuthorityPropertyPane; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.roleAuthority.ReportAndFSManagePane; +import com.fr.design.roleAuthority.RolesAlreadyEditedPane; +import com.fr.general.Inter; +import com.fr.grid.selection.CellSelection; +import com.fr.grid.selection.FloatSelection; +import com.fr.grid.selection.Selection; +import com.fr.report.cell.FloatElement; +import com.fr.report.cell.TemplateCellElement; +import com.fr.report.elementcase.TemplateElementCase; + +import java.awt.*; +import java.awt.event.ActionEvent; + +/** + * Author : daisy + * Date: 13-9-23 + * Time: 下午2:41 + */ +public class CleanAuthorityAction extends ElementCaseAction { + + public CleanAuthorityAction(ElementCasePane t) { + super(t); + this.setName(Inter.getLocText(new String[]{"Clear", "DashBoard-Potence"})); + } + + + /** + * 清楚权限动作 + * + * @param evt 事件 + */ + public void actionPerformed(ActionEvent evt) { + ElementCasePane reportPane = getEditingComponent(); + Selection selection = reportPane.getSelection(); + String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); + if (selection instanceof FloatSelection) { + String name = ((FloatSelection) selection).getSelectedFloatName(); + TemplateElementCase ec = reportPane.getEditingElementCase(); + FloatElement fe = ec.getFloatElement(name); + if (fe.isDoneAuthority(selectedRoles)) { + fe.cleanAuthority(selectedRoles); + } + doAfterAuthority(reportPane); + return; + } + CellSelection cellSelection = (CellSelection) selection; + boolean isChooseColumnRow = cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN + || cellSelection.getSelectedType() == CellSelection.CHOOSE_ROW; + if (isChooseColumnRow && cellSelection.getCellRectangleCount() == 1) { + cleanColumnRow(cellSelection, reportPane, selectedRoles); + } else { + cleanCell(cellSelection, reportPane, selectedRoles); + } + doAfterAuthority(reportPane); + } + + + private void doAfterAuthority(ElementCasePane reportPane) { + reportPane.repaint(); + reportPane.fireTargetModified(); + RolesAlreadyEditedPane.getInstance().refreshDockingView(); + RolesAlreadyEditedPane.getInstance().repaint(); + if (EastRegionContainerPane.getInstance().getUpPane() instanceof AuthorityPropertyPane) { + AuthorityPropertyPane authorityPropertyPane = (AuthorityPropertyPane) EastRegionContainerPane.getInstance().getUpPane(); + authorityPropertyPane.populate(); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); + } + } + + /** + * 清除单元格对应的角色的权限 + * + * @param cellSelection + * @param reportPane + */ + private void cleanCell(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { + if (selectedRoles == null) { + return; + } + TemplateElementCase elementCase = reportPane.getEditingElementCase(); + int cellRectangleCount = cellSelection.getCellRectangleCount(); + for (int rect = 0; rect < cellRectangleCount; rect++) { + Rectangle cellRectangle = cellSelection.getCellRectangle(rect); + for (int j = 0; j < cellRectangle.height; j++) { + for (int i = 0; i < cellRectangle.width; i++) { + int column = i + cellRectangle.x; + int row = j + cellRectangle.y; + TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); + if (cellElement == null) { + continue; + } + //清除权限 + if (cellElement.isDoneAuthority(selectedRoles) || cellElement.isDoneNewValueAuthority(selectedRoles)) { + cellElement.cleanAuthority(selectedRoles); + } + if (cellElement.getWidget() == null) { + continue; + } + boolean isDoneAuthority = cellElement.getWidget().isDoneVisibleAuthority(selectedRoles) || + cellElement.getWidget().isDoneUsableAuthority(selectedRoles); + + if (isDoneAuthority) { + cellElement.getWidget().cleanAuthority(selectedRoles); + } + } + } + } + } + + private void cleanColumnRow(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { + if (selectedRoles == null) { + return; + } + TemplateElementCase elementCase = reportPane.getEditingElementCase(); + if (cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { + for (int col = cellSelection.getColumn(); col < cellSelection.getColumn() + cellSelection.getColumnSpan(); col++) { + elementCase.removeColumnPrivilegeControl(col, selectedRoles); + } + } else { + for (int row = cellSelection.getRow(); row < cellSelection.getRow() + cellSelection.getRowSpan(); row++) { + elementCase.removeRowPrivilegeControl(row, selectedRoles); + } + } + } + + /** + * 是否需要撤销动作 + * + * @return 不需要 + */ + public boolean executeActionReturnUndoRecordNeeded() { + return false; + } +} \ No newline at end of file From 7c60065b64ac3b1f1098fb179101369698f97545 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 3 Aug 2017 11:07:01 +0800 Subject: [PATCH 22/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E5=8E=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E5=BC=BA=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/poly/PolyDesigner.java | 2 +- .../fr/design/mainframe/JFormSliderPane.java | 88 +++++++++++++------ 2 files changed, 61 insertions(+), 29 deletions(-) diff --git a/designer/src/com/fr/poly/PolyDesigner.java b/designer/src/com/fr/poly/PolyDesigner.java index d5d1b063a4..038cb46e42 100644 --- a/designer/src/com/fr/poly/PolyDesigner.java +++ b/designer/src/com/fr/poly/PolyDesigner.java @@ -139,7 +139,7 @@ public class PolyDesigner extends ReportComponent Date: Thu, 3 Aug 2017 11:48:29 +0800 Subject: [PATCH 23/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E4=BB=A3=E7=A0=81=E8=B4=A8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/NoSupportAuthorityEdit.java | 63 +++++- .../roleAuthority/RolesAlreadyEditedPane.java | 186 +++++++++++++++++- .../src/com/fr/start/BaseDesigner.java | 8 +- 3 files changed, 251 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java b/designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java index da3c49782c..a25ed9c781 100644 --- a/designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java +++ b/designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java @@ -1 +1,62 @@ -package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-22 * Time: 上午10:05 */ public class NoSupportAuthorityEdit extends AuthorityEditPane { private static final int TITLE_HEIGHT = 19; public NoSupportAuthorityEdit() { super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); this.setLayout(new BorderLayout()); this.setBorder(null); UILabel title = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; title.setHorizontalAlignment(SwingConstants.CENTER); title.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(title, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); // this.add(northPane, BorderLayout.NORTH); this.add(createTextPane(), BorderLayout.CENTER); } private JPanel createTextPane() { JPanel panel = new JPanel(new BorderLayout()); UILabel uiLabel = new UILabel(Inter.getLocText("not_support_authority_edit")); uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setVerticalAlignment(SwingConstants.CENTER); panel.add(uiLabel, BorderLayout.CENTER); return panel; } @Override public void populateType() { } @Override public void populateName() { } @Override public JPanel populateCheckPane() { return null; } } \ No newline at end of file +package com.fr.design.mainframe; + +import com.fr.design.constants.UIConstants; +import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Author : daisy + * Date: 13-9-22 + * Time: 上午10:05 + */ +public class NoSupportAuthorityEdit extends AuthorityEditPane { + + private static final int TITLE_HEIGHT = 19; + + public NoSupportAuthorityEdit() { + super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + this.setLayout(new BorderLayout()); + this.setBorder(null); + UILabel title = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { + @Override + public Dimension getPreferredSize() { + return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); + } + }; + title.setHorizontalAlignment(SwingConstants.CENTER); + title.setVerticalAlignment(SwingConstants.CENTER); + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + northPane.add(title, BorderLayout.CENTER); + northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); +// this.add(northPane, BorderLayout.NORTH); + this.add(createTextPane(), BorderLayout.CENTER); + } + + + private JPanel createTextPane() { + JPanel panel = new JPanel(new BorderLayout()); + UILabel uiLabel = new UILabel(Inter.getLocText("not_support_authority_edit")); + uiLabel.setHorizontalAlignment(SwingConstants.CENTER); + uiLabel.setVerticalAlignment(SwingConstants.CENTER); + panel.add(uiLabel, BorderLayout.CENTER); + return panel; + } + + @Override + public void populateType() { + } + + @Override + public void populateName() { + } + + @Override + public JPanel populateCheckPane() { + return null; + } +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java b/designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java index 4dd2450c43..b9bc53c707 100644 --- a/designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java +++ b/designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java @@ -1 +1,185 @@ -package com.fr.design.roleAuthority; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DockingView; import com.fr.general.Inter; import com.fr.general.NameObject; import javax.swing.*; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import java.awt.*; import java.util.Enumeration; /** * Author : daisy * Date: 13-9-25 * Time: 下午4:34 */ public class RolesAlreadyEditedPane extends JPanel { private static final int TITLE_HEIGHT = 19; private static final int LEFT_GAP = 8; private static final int TOP_GAP = -1; private static RolesAlreadyEditedPane THIS; private RolesEditedPane rolesEditedPane; /** * 得到实例 * * @return */ public static final RolesAlreadyEditedPane getInstance() { if (THIS == null) { THIS = new RolesAlreadyEditedPane(); } return THIS; } public RolesAlreadyEditedPane() { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText("roles_already_authority_edited")) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); authorityTitle.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); // this.add(northPane, BorderLayout.NORTH); rolesEditedPane = new RolesEditedPane(); this.add(rolesEditedPane, BorderLayout.CENTER); } public RoleTree getRoleTree() { return rolesEditedPane.roleTree; } public void refreshDockingView() { rolesEditedPane.refreshDockingView(); } public void setReportAndFSSelectedRoles() { rolesEditedPane.setSelectedRole(); } private class RolesEditedPane extends DockingView { private RoleTree roleTree; private RolesEditedSourceOP op; private DefaultTreeCellRenderer roleTreeRenderer = new DefaultTreeCellRenderer() { private static final long serialVersionUID = 2L; public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); ExpandMutableTreeNode treeNode = (ExpandMutableTreeNode) value; Object userObj = treeNode.getUserObject(); if (userObj instanceof String) { // p:这个是column field. this.setIcon(null); this.setText((String) userObj); } else if (userObj instanceof NameObject) { NameObject nameObject = (NameObject) userObj; this.setText(nameObject.getName()); if (nameObject.getName() == Inter.getLocText("M_Server-Platform_Manager")) { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/platform_16_16.png")); } else { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/demo.png")); } } // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); this.setForeground(UIConstants.FONT_COLOR); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); return this; } }; public RolesEditedPane() { roleTree = new RoleTree() { public void refreshRoleTree(String selectedRole) { super.refreshRoleTree(selectedRole); RoleTree roleTree = ReportAndFSManagePane.getInstance().getRoleTree(); TreeNode root = (TreeNode) roleTree.getModel().getRoot(); TreePath parent = new TreePath(root); roleTree.setSelectedRole(selectedRole, parent); } }; roleTree.setCellRenderer(roleTreeRenderer); roleTree.setEditable(false); op = new RolesEditedSourceOP(); UIScrollPane scrollPane = new UIScrollPane(roleTree) { public Dimension getPreferredSize() { return new Dimension(RolesEditedPane.this.getWidth(), RolesEditedPane.this.getHeight()); } }; scrollPane.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void refreshDockingView() { this.op = new RolesEditedSourceOP(); roleTree.populate(op); expandTree(roleTree, true); } private void setSelectedRole() { String name = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); TreeNode root = (TreeNode) roleTree.getModel().getRoot(); TreePath parent = new TreePath(root); roleTree.setSelectedRole(name, parent); } public String getViewTitle() { return null; } public Icon getViewIcon() { return null; } public Location preferredLocation() { return null; } public void expandTree(JTree tree, boolean isExpand) { TreeNode root = (TreeNode) tree.getModel().getRoot(); expandAll(tree, new TreePath(root), isExpand); } private void expandAll(JTree tree, TreePath parent, boolean expand) { TreeNode node = (TreeNode) parent.getLastPathComponent(); if (node.getChildCount() >= 0) { for (Enumeration e = node.children(); e.hasMoreElements(); ) { TreeNode n = (TreeNode) e.nextElement(); TreePath path = parent.pathByAddingChild(n); expandAll(tree, path, expand); } } if (expand) { tree.expandPath(parent); } else { tree.collapsePath(parent); } } } } \ No newline at end of file +package com.fr.design.roleAuthority; + +import com.fr.base.BaseUtils; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DockingView; +import com.fr.general.Inter; +import com.fr.general.NameObject; + +import javax.swing.*; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.TreeNode; +import javax.swing.tree.TreePath; +import java.awt.*; +import java.util.Enumeration; + +/** + * Author : daisy + * Date: 13-9-25 + * Time: 下午4:34 + */ +public class RolesAlreadyEditedPane extends JPanel { + private static final int TITLE_HEIGHT = 19; + private static final int LEFT_GAP = 8; + private static final int TOP_GAP = -1; + private static RolesAlreadyEditedPane THIS; + private RolesEditedPane rolesEditedPane; + + /** + * 得到实例 + * + * @return + */ + public static final RolesAlreadyEditedPane getInstance() { + if (THIS == null) { + THIS = new RolesAlreadyEditedPane(); + } + return THIS; + } + + + public RolesAlreadyEditedPane() { + this.setLayout(new BorderLayout()); + this.setBorder(null); + UILabel authorityTitle = new UILabel(Inter.getLocText("roles_already_authority_edited")) { + @Override + public Dimension getPreferredSize() { + return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); + } + }; + authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); + authorityTitle.setVerticalAlignment(SwingConstants.CENTER); + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + northPane.add(authorityTitle, BorderLayout.CENTER); + northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); +// this.add(northPane, BorderLayout.NORTH); + rolesEditedPane = new RolesEditedPane(); + this.add(rolesEditedPane, BorderLayout.CENTER); + + } + + public RoleTree getRoleTree() { + return rolesEditedPane.roleTree; + } + + public void refreshDockingView() { + rolesEditedPane.refreshDockingView(); + } + + public void setReportAndFSSelectedRoles() { + rolesEditedPane.setSelectedRole(); + } + + + private class RolesEditedPane extends DockingView { + private RoleTree roleTree; + private RolesEditedSourceOP op; + private DefaultTreeCellRenderer roleTreeRenderer = new DefaultTreeCellRenderer() { + private static final long serialVersionUID = 2L; + + + public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { + super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); + ExpandMutableTreeNode treeNode = (ExpandMutableTreeNode) value; + Object userObj = treeNode.getUserObject(); + if (userObj instanceof String) { + // p:这个是column field. + this.setIcon(null); + this.setText((String) userObj); + } else if (userObj instanceof NameObject) { + NameObject nameObject = (NameObject) userObj; + this.setText(nameObject.getName()); + if (nameObject.getName() == Inter.getLocText("M_Server-Platform_Manager")) { + this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/platform_16_16.png")); + } else { + this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/demo.png")); + } + } + + + // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." + this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); + this.setForeground(UIConstants.FONT_COLOR); + this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); + return this; + } + }; + + + public RolesEditedPane() { + roleTree = new RoleTree() { + public void refreshRoleTree(String selectedRole) { + super.refreshRoleTree(selectedRole); + RoleTree roleTree = ReportAndFSManagePane.getInstance().getRoleTree(); + TreeNode root = (TreeNode) roleTree.getModel().getRoot(); + TreePath parent = new TreePath(root); + roleTree.setSelectedRole(selectedRole, parent); + } + }; + roleTree.setCellRenderer(roleTreeRenderer); + roleTree.setEditable(false); + op = new RolesEditedSourceOP(); + UIScrollPane scrollPane = new UIScrollPane(roleTree) { + public Dimension getPreferredSize() { + return new Dimension(RolesEditedPane.this.getWidth(), RolesEditedPane.this.getHeight()); + } + }; + scrollPane.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + this.add(scrollPane, BorderLayout.CENTER); + } + + public void refreshDockingView() { + this.op = new RolesEditedSourceOP(); + roleTree.populate(op); + expandTree(roleTree, true); + } + + private void setSelectedRole() { + String name = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); + TreeNode root = (TreeNode) roleTree.getModel().getRoot(); + TreePath parent = new TreePath(root); + roleTree.setSelectedRole(name, parent); + } + + + public String getViewTitle() { + return null; + } + + public Icon getViewIcon() { + return null; + } + + public Location preferredLocation() { + return null; + } + + public void expandTree(JTree tree, boolean isExpand) { + TreeNode root = (TreeNode) tree.getModel().getRoot(); + expandAll(tree, new TreePath(root), isExpand); + } + + + private void expandAll(JTree tree, TreePath parent, boolean expand) { + TreeNode node = (TreeNode) parent.getLastPathComponent(); + if (node.getChildCount() >= 0) { + for (Enumeration e = node.children(); e.hasMoreElements(); ) { + TreeNode n = (TreeNode) e.nextElement(); + TreePath path = parent.pathByAddingChild(n); + expandAll(tree, path, expand); + } + } + if (expand) { + tree.expandPath(parent); + } else { + tree.collapsePath(parent); + } + } + } +} \ No newline at end of file diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index 76d7aec454..f79baf4606 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -57,10 +57,10 @@ public abstract class BaseDesigner extends ToolBarMenuDock { DesignUtils.setPort(getStartPort()); // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 -// if (DesignUtils.isStarted()) { -// DesignUtils.clientSend(args); -// return; -// } + if (DesignUtils.isStarted()) { + DesignUtils.clientSend(args); + return; + } BuildContext.setBuildFilePath(buildPropertiesPath()); //下面这两句的位置不能随便调换,因为会影响语言切换的问题 From 92d520eeb42166d5665c4be93a98f03f340cccc8 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 3 Aug 2017 11:51:01 +0800 Subject: [PATCH 24/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E4=BF=AE=E6=94=B9=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/AuthorityEditPane.java | 86 ++++++++++++++++++- .../mainframe/AuthorityPropertyPane.java | 50 ++++++++++- 2 files changed, 134 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java b/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java index 25b5912551..5dea2fab91 100644 --- a/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java +++ b/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java @@ -1 +1,85 @@ -package com.fr.design.mainframe; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:21 */ public abstract class AuthorityEditPane extends JPanel { protected static final int TOP_GAP = 11; protected static final int LEFT_GAP = 4; protected static final int RIGHT_GAP = 10; protected static final int ALIGNMENT_GAP = -3; protected static final int LEFT_CHECKPANE = 3; protected UILabel type = null; protected UILabel name = null; protected JPanel checkPane = null; private TargetComponent target; private JPanel typePane; private JPanel namePane; public AuthorityEditPane(TargetComponent target) { this.target = target; setLayout(new BorderLayout()); type = new UILabel(); typePane = new JPanel(new BorderLayout()); typePane.add(type, BorderLayout.CENTER); type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); namePane = new JPanel(new BorderLayout()); namePane.add(name, BorderLayout.CENTER); name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); // this.add(layoutText(), BorderLayout.WEST); // this.add(layoutPane(), BorderLayout.CENTER); this.add(centerPane(), BorderLayout.NORTH); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); } private JPanel centerPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p, p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane}, new Component[]{checkPane, null}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); } /** * 更新权限编辑面板的具体内容:类型、名称、权限面板 */ public void populateDetials() { populateType(); populateName(); checkPane.removeAll(); populateCheckPane(); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); } public abstract void populateType(); public abstract void populateName(); public abstract JPanel populateCheckPane(); } \ No newline at end of file +package com.fr.design.mainframe; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.TargetComponent; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Author : daisy + * Date: 13-9-12 + * Time: 下午6:21 + */ +public abstract class AuthorityEditPane extends JPanel { + protected static final int TOP_GAP = 11; + protected static final int LEFT_GAP = 4; + protected static final int RIGHT_GAP = 10; + protected static final int ALIGNMENT_GAP = -3; + protected static final int LEFT_CHECKPANE = 3; + + protected UILabel type = null; + protected UILabel name = null; + protected JPanel checkPane = null; + private TargetComponent target; + private JPanel typePane; + private JPanel namePane; + + public AuthorityEditPane(TargetComponent target) { + this.target = target; + setLayout(new BorderLayout()); + type = new UILabel(); + typePane = new JPanel(new BorderLayout()); + typePane.add(type, BorderLayout.CENTER); + type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); + typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + name = new UILabel(); + namePane = new JPanel(new BorderLayout()); + namePane.add(name, BorderLayout.CENTER); + name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); + namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + checkPane = new JPanel(); + checkPane.setLayout(new BorderLayout()); +// this.add(layoutText(), BorderLayout.WEST); +// this.add(layoutPane(), BorderLayout.CENTER); + this.add(centerPane(), BorderLayout.NORTH); + this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); + } + + private JPanel centerPane() { + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane}, + new Component[]{checkPane, null}, + }; + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); + } + + /** + * 更新权限编辑面板的具体内容:类型、名称、权限面板 + */ + public void populateDetials() { + populateType(); + populateName(); + checkPane.removeAll(); + populateCheckPane(); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); + } + + public abstract void populateType(); + + public abstract void populateName(); + + public abstract JPanel populateCheckPane(); + +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java b/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java index 162e2603cc..d802b7f9a1 100644 --- a/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java +++ b/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java @@ -1 +1,49 @@ -package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:14 */ public class AuthorityPropertyPane extends JPanel { private static final int TITLE_HEIGHT = 19; private AuthorityEditPane authorityEditPane = null; public AuthorityPropertyPane(TargetComponent t) { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); authorityTitle.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); // this.add(northPane, BorderLayout.NORTH); authorityEditPane = t.createAuthorityEditPane(); UIScrollPane scrollPane = new UIScrollPane(authorityEditPane); scrollPane.setBorder(null); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void populate() { authorityEditPane.populateDetials(); } } \ No newline at end of file +package com.fr.design.mainframe; + +import com.fr.design.constants.UIConstants; +import com.fr.design.designer.TargetComponent; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Author : daisy + * Date: 13-9-12 + * Time: 下午6:14 + */ +public class AuthorityPropertyPane extends JPanel { + private static final int TITLE_HEIGHT = 19; + private AuthorityEditPane authorityEditPane = null; + + public AuthorityPropertyPane(TargetComponent t) { + this.setLayout(new BorderLayout()); + this.setBorder(null); + UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { + @Override + public Dimension getPreferredSize() { + return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); + } + }; + authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); + authorityTitle.setVerticalAlignment(SwingConstants.CENTER); + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + northPane.add(authorityTitle, BorderLayout.CENTER); + northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); +// this.add(northPane, BorderLayout.NORTH); + authorityEditPane = t.createAuthorityEditPane(); + UIScrollPane scrollPane = new UIScrollPane(authorityEditPane); + scrollPane.setBorder(null); + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + this.add(scrollPane, BorderLayout.CENTER); + } + + public void populate() { + authorityEditPane.populateDetials(); + } + + +} \ No newline at end of file From eca840b58f155ae6168a92dabf3b31a1523f9d1a Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 3 Aug 2017 12:23:17 +0800 Subject: [PATCH 25/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E7=BC=A9=E6=94=BE=E6=9D=A1?= =?UTF-8?q?=E9=83=A8=E5=88=86=E8=A7=86=E8=A7=89=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/locale/designer_en_US.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index d796e80dab..542ea4e74c 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2099,6 +2099,7 @@ FR-Designer_Insert_Image=Insert_Image FR-Designer_Insert_Chart=Insert-Chart FR-Designer_Insert_Text=Insert-Text FR-Designer_Insert_Formula=Insert_Formula +FR-Designer_Double=Double FR-Designer_Scale_Down=Scale_Down FR-Designer_Scale_Up=Scale_Up FR-Designer_Scale_Slider=Scale_Slider From eccf8d8e1d0f0562296e4efaaccce6d39e6c0f68 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 3 Aug 2017 12:26:11 +0800 Subject: [PATCH 26/29] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=20=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/locale/designer_ko_KR.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index db34f10938..bab5eca97c 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -1995,7 +1995,7 @@ FR-Designer_Parameter=\uB9E4\uAC1C\uBCC0\uC218 FR-Designer-Plugin_Plugin=\uD50C\uB7EC\uADF8\uC778 FR-Designer_Background=\uBC30\uACBD Template=\uD15C\uD50C\uB9BF - +FR-Designer_Double=\uC18C\uC218 FR-Designer_Original_Marked_Filed=\uCD08\uAE30\uD0DC\uADF8\uD544\uB4DC FR-Designer_Build_Tree_Accord_Marked_Filed_Length=\uC120\uD0DD\uD55C\uB370\uC774\uD130\uC138\uD2B8\uC758\uD0DC\uADF8\uD544\uB4DC\uAE38\uC774\uC5D0\uB530\uB77C\uD2B8\uB9AC\uC0DD\uC131 FR-Designer_Tree_Data_Field=\uD2B8\uB9AC\uB370\uC774\uD130\uD544\uB4DC From adee1bff1360ba6a2380d76ab4c09f0966b1acb5 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 3 Aug 2017 15:29:49 +0800 Subject: [PATCH 27/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=A4=96=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=3D=E3=80=8B=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/constants/UIConstants.java | 3 + .../icontainer/UIEastResizableContainer.java | 3 +- .../design/images/buttonicon/popdownarrow.png | Bin 0 -> 315 bytes .../design/images/buttonicon/popuparrow.png | Bin 0 -> 308 bytes .../mainframe/EastRegionContainerPane.java | 72 ++++++------------ 5 files changed, 30 insertions(+), 48 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png create mode 100644 designer_base/src/com/fr/design/images/buttonicon/popuparrow.png diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index c63dcdea79..77ae663502 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -88,6 +88,7 @@ public interface UIConstants { public static final Color DEFAULT_BG_RULER = new Color(0xf7f7f7); public static final Color RULER_LINE_COLOR = new Color(0xababab); public static final Color RULER_SCALE_COLOR = new Color(0x4e504f); + public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd); @@ -104,6 +105,8 @@ public interface UIConstants { public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.png"); public static final BufferedImage DRAG_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png"); public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png"); + public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png"); + public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png"); public static final int MODEL_NORMAL = 0; public static final int MODEL_PRESS = 1; public static final Icon ARROW_DOWN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png"); diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 19390a7849..8e9fb6ffab 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -63,11 +63,12 @@ public class UIEastResizableContainer extends JPanel { } public UIEastResizableContainer(JComponent leftPane, JComponent rightPane) { - setBackground(UIConstants.NORMAL_BACKGROUND); + setBackground(UIConstants.PROPERTY_PANE_BACKGROUND); this.leftPane = leftPane; this.rightPane = rightPane; this.topToolPane = new TopToolPane(); + topToolPane.setBackground(UIConstants.PROPERTY_PANE_BACKGROUND); setLayout(containerLayout); add(topToolPane); diff --git a/designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png b/designer_base/src/com/fr/design/images/buttonicon/popdownarrow.png new file mode 100644 index 0000000000000000000000000000000000000000..d89d951399c6249a3d6a854b477f5f24c663bfd6 GIT binary patch literal 315 zcmV-B0mS}^P)Px#^+`lQR5%gUP`wTTK^Xi#aS}m8t3ypMk%)+R0F^|i^$hnQ5|OBMN`-_MP$?vy zLE|Ul_T1RLOluH>w)IA%G#!zXgyYTH$I<@=8U-^fNJ5TV{zWobAJ z`ANV9I#6m>A2=nyFv2(Vs9CaZT} znE&>$1q48xl6UPS0anvSA8DDr!e9hop`EXpuqTcjJdMht_$%V?%&rsfcq5g<{k#AG N002ovPDHLkV1iQ9j647U literal 0 HcmV?d00001 diff --git a/designer_base/src/com/fr/design/images/buttonicon/popuparrow.png b/designer_base/src/com/fr/design/images/buttonicon/popuparrow.png new file mode 100644 index 0000000000000000000000000000000000000000..76f831bf02678c128bbdf7461551fa4f549e5bb0 GIT binary patch literal 308 zcmV-40n7f0P)Px#?ny*JR5%f1U>Nd%k&qAE=KR$8^Ph1d10w?u1H*sb{|pQ~Kuy>8rLen$^fD1L zU}rMhRiK(%|Ns9t`~ROoli@#u?En9aaD8wFE`t~u8UHh}v$g~2uP`-?4F5mF*aQvm zT=HM$-_KwBfG*$$YPt{B$jJDGC<8#6e}4aU0O)UJMh3=Js)lUpKzatyE1zHnu)rAT zG`eOx71rnm6UIM4mt^@YV-SF;#~KS*H9Io?foVdfF$^F@Gsqwm14z{jG5{V6K)*5m z{PBA$EWp5i#^G#`Mi_t_0E+Mb4F8`oFfvXfRx`|yfu#Zelx;@}NP{c@0000= ARROW_RANGE_START) { setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - model = UIConstants.MODEL_PRESS; } else if (isMovable) { setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); setBackground(Color.pink); } else { setCursor(Cursor.getDefaultCursor()); - model = UIConstants.MODEL_NORMAL; } repaint(); } @@ -808,13 +797,12 @@ public class EastRegionContainerPane extends UIEastResizableContainer { super(); this.propertyItem = propertyItem; this.title = propertyItem.getTitle(); - this.contentPane = propertyItem.getContentPane(); - originColor = getBackground(); + originColor = Color.white; + setBackground(originColor); setLayout(new BorderLayout()); UILabel label = new UILabel(title); - label.setForeground(new Color(69, 135, 255)); add(label, BorderLayout.WEST); - setBorder(new EmptyBorder(5, 10, 0, 0)); + setBorder(new EmptyBorder(5, 10, 5, 0)); initToolButton(buttonType); } @@ -857,27 +845,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer { Image button; g.setColor(new Color(69, 135, 255)); g.setFont(FRFont.getInstance().applySize(14)); -// g.drawString(title, 5, 20); -// g.drawImage(UIConstants.DRAG_BAR, 0, 0, CONTENT_WIDTH, POPUP_TOOLPANE_HEIGHT, null); - if (buttonType.equals(NO_BUTTON)) { return; } if (buttonType.equals(DOWN_BUTTON)) { - if (model == UIConstants.MODEL_NORMAL) { - button = UIConstants.DRAG_LEFT_NORMAL; - } else { - button = UIConstants.DRAG_LEFT_PRESS; - } + button = UIConstants.POP_BUTTON_DOWN; } else { - if (model == UIConstants.MODEL_NORMAL) { - button = UIConstants.DRAG_RIGHT_NORMAL; - } else { - button = UIConstants.DRAG_RIGHT_PRESS; - } + button = UIConstants.POP_BUTTON_UP; } -// g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null); - g.drawImage(button, ARROW_RANGE_START + 12, 7, 5, 5, null); + g.drawImage(button, ARROW_RANGE_START + 8, 4, 16, 16, null); } } @@ -887,7 +863,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private Cursor originCursor; private Cursor southResizeCursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR); private Point mouseDownCompCoords; - private int minHeight; // 对话框最小高度 + private JComponent contentPane; private PropertyItem propertyItem; public PopupDialog(PropertyItem propertyItem) { @@ -900,8 +876,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { contentPane = propertyItem.getContentPane(); container.add(popupToolPane, BorderLayout.NORTH); container.add(contentPane, BorderLayout.CENTER); - minHeight = container.getPreferredSize().height; - setSize(CONTENT_WIDTH, minHeight); + setSize(CONTENT_WIDTH, POPUP_DEFAULT_HEIGHT); // validate(); adjustLocation(); @@ -941,8 +916,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { Point currCoords = e.getLocationOnScreen(); bounds.height = currCoords.y - mouseDownCompCoords.y + bounds.height; // 校正位置 - if (bounds.height < minHeight) { - bounds.height = minHeight; + if (bounds.height < POPUP_MIN_HEIGHT) { + bounds.height = POPUP_MIN_HEIGHT; + } + if (bounds.height > POPUP_MAX_HEIGHT) { + bounds.height = POPUP_MAX_HEIGHT; } mouseDownCompCoords.y = currCoords.y; setBounds(bounds); From 51050c403e905793cfd9302d0f2dfba9cda2fefb Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 3 Aug 2017 17:28:47 +0800 Subject: [PATCH 28/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=A4=96=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=3D=E3=80=8B=E5=88=97=E8=A1=A8=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/constants/UIConstants.java | 2 + .../design/gui/controlpane/UIControlPane.java | 13 +++++-- .../UINameableListCellRenderer.java | 39 +++++-------------- .../icontainer/UIEastResizableContainer.java | 4 +- 4 files changed, 23 insertions(+), 35 deletions(-) diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index 77ae663502..4b4a1b5f87 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -135,6 +135,8 @@ public interface UIConstants { public static final Icon EDIT_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/edit.png"); public static final Icon SEARCH_ICON = BaseUtils.readIcon("/com/fr/design/images/data/search.png"); public static final Icon CLEAR_ICON = BaseUtils.readIcon("/com/fr/design/images/data/source/delete.png"); + public static final Icon LIST_EDIT_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png"); + public static final Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png"); public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127); public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45); public static final Color BARNOMAL = new Color(153, 153, 153); diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java index af47f1de8a..0a04ea4460 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java @@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; @@ -112,7 +113,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH // mainSplitPane.setOneTouchExpandable(true); this.add(getLeftPane(), BorderLayout.CENTER); - this.setBorder(BorderFactory.createEmptyBorder(0, 10, 12, 10)); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 12, 10)); // mainSplitPane.setDividerLocation(getLeftPreferredSize()); this.checkButtonEnabled(); } @@ -137,14 +138,20 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH toolbarDef.addShortCut(sj.getShortCut()); } toolBar = ToolBarDef.createJToolBar(); -// toolBar.setLayout(new FlowLayout(FlowLayout.LEFT)); + toolBar.setUI(new UIToolBarUI(){ + @Override + public void paint(Graphics g, JComponent c) { + Graphics2D g2 = (Graphics2D) g; + g2.setColor(Color.white); + g2.fillRect(0, 0, c.getWidth(), c.getHeight()); + } + }); toolbarDef.updateToolBar(toolBar); // 封装一层,加边框 JPanel toolBarPane = new JPanel(new BorderLayout()); toolBarPane.add(toolBar, BorderLayout.CENTER); toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, new Color(201, 198, 184))); leftContentPane.add(toolBarPane, BorderLayout.NORTH); -// leftContentPane.setBorder(BorderFactory.createLineBorder(new Color(201, 198, 184))); // 顶部标签及add按钮 topToolBar = new UIToolbar(); diff --git a/designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java b/designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java index 8da13e6812..086cd5a77b 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UINameableListCellRenderer.java @@ -1,6 +1,7 @@ package com.fr.design.gui.controlpane; import com.fr.base.BaseUtils; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.ListModelElement; @@ -31,6 +32,7 @@ public class UINameableListCellRenderer extends private UILabel editButton; // "编辑按钮",实际上是一个 UILabel,由列表项(UIListControlPane)统一处理点击事件 private UILabel label; private UIListControlPane listControlPane; + private Color initialLabelForeground; public UINameableListCellRenderer(UIListControlPane listControlPane) { super(); @@ -47,39 +49,19 @@ public class UINameableListCellRenderer extends return new Dimension(BUTTON_WIDTH, BUTTON_WIDTH); } }; -// editButton.set4LargeToolbarButton(); - editButton.setIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); + editButton.setIcon(UIConstants.LIST_EDIT_ICON); editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, BORDER_COLOR)); editButton.setHorizontalAlignment(SwingConstants.CENTER); -// editButton.addActionListener(new ActionListener() { -// @Override -// public void actionPerformed(ActionEvent e) { -// popupEditDialog(); -// } -// }); label = new UILabel(); label.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); -// label.setEditable(false); + initialLabelForeground = label.getForeground(); this.setLayout(new BorderLayout()); this.add(editButton, BorderLayout.WEST); this.add(label, BorderLayout.CENTER); } private Border getNoFocusBorder() { -// return BorderFactory.createLineBorder(new Color(201, 198, 184)); return BorderFactory.createMatteBorder(0, 0, 1, 0, BORDER_COLOR); - // Border border = DefaultLookup.getBorder(this, ui, "List.cellNoFocusBorder"); -// if (System.getSecurityManager() != null) { -// if (border != null) return border; -// return SAFE_NO_FOCUS_BORDER; -// } else { -// if (border != null && -// (noFocusBorder == null || -// noFocusBorder == DEFAULT_NO_FOCUS_BORDER)) { -// return border; -// } -// return noFocusBorder; -// } } private void setText(String t) { @@ -108,20 +90,17 @@ public class UINameableListCellRenderer extends if (isSelected) { setBackground(bg == null ? list.getSelectionBackground() : bg); setForeground(fg == null ? list.getSelectionForeground() : fg); + label.setForeground(Color.white); + editButton.setIcon(UIConstants.LIST_EDIT_WHITE_ICON); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); + label.setForeground(initialLabelForeground); + editButton.setIcon(UIConstants.LIST_EDIT_ICON); } -// if (value instanceof Icon) { -// setIcon((Icon)value); -// setText(""); -// } -// else { -// setIcon(null); - setText((value == null) ? "" : value.toString()); -// } + setText((value == null) ? "" : value.toString()); setEnabled(list.isEnabled()); setFont(list.getFont()); diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 8e9fb6ffab..8f82b1b097 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -20,7 +20,7 @@ public class UIEastResizableContainer extends JPanel { private static final long serialVersionUID = 1854340560790476907L; private int containerWidth = 240; private int preferredWidth = 240; - private int topToolPaneHeight = 20; + private int topToolPaneHeight = 25; private int leftPaneWidth = 40; private JComponent leftPane; @@ -308,7 +308,7 @@ public class UIEastResizableContainer extends JPanel { } } // g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, 5, toolPaneHeight, null); - g.drawImage(button, 18, 7, 5, 5, null); + g.drawImage(button, 18, 9, 5, 5, null); } } From 6fdbd438e5c28ec9d51ff6a98be5055560e9936b Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 3 Aug 2017 20:57:18 +0800 Subject: [PATCH 29/29] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=A4=96=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=3D=E3=80=8B=E5=A2=9E=E5=8A=A0=E2=80=98=E8=AF=A5?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E4=B8=8D=E6=94=AF=E6=8C=81=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E2=80=99=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/locale/designer.properties | 1 + .../design/locale/designer_en_US.properties | 1 + .../design/locale/designer_ja_JP.properties | 2 +- .../design/locale/designer_ko_KR.properties | 1 + .../design/locale/designer_zh_CN.properties | 1 + .../design/locale/designer_zh_TW.properties | 1 + .../mainframe/EastRegionContainerPane.java | 33 ++++++++++++++----- 7 files changed, 30 insertions(+), 10 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index b70b141a94..83d7dbc8e8 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2104,3 +2104,4 @@ FR-Designer_Insert_Chart=Insert_Chart FR-Designer_Insert_Text=Insert_Text FR-Designer_Double=Double FR-Designer_Add_Event=Add Event +FR-Designer_Not_Support_Authority_Edit=this element does not support authority edit diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 542ea4e74c..915b1eac93 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2105,3 +2105,4 @@ FR-Designer_Scale_Up=Scale_Up FR-Designer_Scale_Slider=Scale_Slider FR-Designer_Scale_Grade=Scale_Grade FR-Designer_Add_Event=Add Event +FR-Designer_Not_Support_Authority_Edit=this element does not support authority edit diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 4d9423cfeb..0e6bbf7f31 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2108,4 +2108,4 @@ FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_Insert_Formula= -FR-Designer_Add_Event= +FR-Designer_Not_Support_Authority_Edit=\u3053\u306E\u8981\u7D20\u306F\u6A29\u9650\u5236\u5FA1\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093 diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index bab5eca97c..d27bb8fd44 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2108,3 +2108,4 @@ FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_Add_Event= +FR-Designer_Not_Support_Authority_Edit=\uD574\uB2F9\uC694\uC18C\uB294\uAD8C\uD55C\uCEE8\uD2B8\uB864\uC744\uC9C0\uC6D0\uD558\uC9C0\uC54A\uC2B5\uB2C8\uB2E4. diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index d94854149a..8f128d45ab 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2111,3 +2111,4 @@ FR-Designer_Scale_Down=\u7F29\u5C0F FR-Designer_Scale_Up=\u653E\u5927 FR-Designer_Scale_Slider=\u7F29\u653E\u6ED1\u5757 FR-Designer_Scale_Grade=\u7F29\u653E\u7EA7\u522B\uFF0C\u5355\u51FB\u540E\u8C03\u8282\u663E\u793A\u6BD4\u4F8B\u3002 +FR-Designer_Not_Support_Authority_Edit=\u8BE5\u5143\u7D20\u4E0D\u652F\u6301\u6743\u9650\u63A7\u5236 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 72e78228a1..d525837958 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2108,3 +2108,4 @@ FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_Add_Event= +FR-Designer_Not_Support_Authority_Edit=\u8A72\u5143\u7D20\u4E0D\u652F\u63F4\u8A31\u53EF\u6B0A\u63A7\u5236 diff --git a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java index 4dcf2332ff..3866471149 100644 --- a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java @@ -48,7 +48,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private static final String KEY_WIDGET_LIB = "widgetLib"; private static final String KEY_AUTHORITY_EDITION = "authorityEdition"; private static final String KEY_CONFIGURED_ROLES = "editedRoles"; - private static final String DEFAULT_PANE = "defaultPane"; // "无可用配置项"面板 + private static final String DEFAULT_PANE = "defaultPane"; + private static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane"; + + private JPanel defaultPane; // "无可用配置项"面板 + private JPanel defaultAuthorityPane; // "该元素不支持权限编辑" public enum PropertyMode { REPORT, // 报表 @@ -83,6 +87,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { super(); // setVerticalDragEnabled(false); initPropertyItemList(); + defaultPane = getDefaultPane(Inter.getLocText("FR-Designer_No_Settings_Available")); + defaultAuthorityPane = getDefaultPane(Inter.getLocText("FR-Designer_Not_Support_Authority_Edit")); switchMode(PropertyMode.REPORT); // initContentPane(); // super(leftPane, rightPane); @@ -140,9 +146,9 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } // "无可用配置项"面板 - private JPanel getDefaultPane() { + private JPanel getDefaultPane(String prompt) { JPanel defaultPane = new JPanel(); - UILabel label = new UILabel(Inter.getLocText("FR-Designer_No_Settings_Available")); + UILabel label = new UILabel(prompt); label.setHorizontalAlignment(SwingConstants.CENTER); defaultPane.setLayout(new BorderLayout()); defaultPane.add(label, BorderLayout.CENTER); @@ -166,7 +172,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } rightPane.add(item.getName(), item.getPropertyPanel()); } - rightPane.add(DEFAULT_PANE, getDefaultPane()); + rightPane.add(DEFAULT_PANE, defaultPane); + rightPane.add(DEFAULT_AUTHORITY_PANE, defaultAuthorityPane); replaceRightPane(rightPane); refreshRightPane(); @@ -363,16 +370,24 @@ public class EastRegionContainerPane extends UIEastResizableContainer { */ public void refreshRightPane() { boolean hasAvailableTab = false; + boolean hasEnabledTab = false; for (String name : propertyItemMap.keySet()) { PropertyItem propertyItem = propertyItemMap.get(name); - if (propertyItem.isVisible() && !propertyItem.isPoppedOut() && propertyItem.isEnabled()) { - propertyCard.show(rightPane, name); // 显示第一个可用tab - hasAvailableTab = true; - break; + if (propertyItem.isVisible() && propertyItem.isEnabled()) { + hasEnabledTab = true; + if (!propertyItem.isPoppedOut()) { + propertyCard.show(rightPane, name); // 显示第一个可用tab + hasAvailableTab = true; + break; + } } } if (!hasAvailableTab) { - propertyCard.show(rightPane, DEFAULT_PANE); + if (!hasEnabledTab && BaseUtils.isAuthorityEditing()) { + propertyCard.show(rightPane, DEFAULT_AUTHORITY_PANE); + } else { + propertyCard.show(rightPane, DEFAULT_PANE); + } } // if (this.getRightPane() instanceof DockingView) {