Browse Source

Merging in latest from upstream (BA/design:refs/heads/9.0)

* commit 'ad27fd390e210c511b13e6b97785615ebceb3260':
  REPORT-3163 合作开发9.0设计器=>组件库tab页
  REPORT-3163 合作开发9.0设计器=>参数面板=》调整工具条背景色
  REPORT-3163 合作开发9.0设计器=>整理代码
  REPORT-3163 合作开发9.0设计器=>参数面板=》完善功能,调整界面
  REPORT-3163 合作开发9.0设计器=>参数面板=》实现基本交互
  REPORT-3163 合作开发9.0设计器=>界面微调
  REPORT-3163 合作开发9.0设计器=>聚合报表=》修改逻辑,正确显示tab项
  REPORT-3163 合作开发9.0设计器=>列表面板=》替换选中状态下的编辑按钮图标
master
kerry 7 years ago
parent
commit
7cca6865bd
  1. 15
      designer/src/com/fr/design/mainframe/JWorkBook.java
  2. 4
      designer/src/com/fr/design/mainframe/SheetNameTabPane.java
  3. 7
      designer/src/com/fr/poly/PolyDesigner.java
  4. 8
      designer/src/com/fr/poly/creator/ChartBlockEditor.java
  5. 5
      designer_base/src/com/fr/design/constants/UIConstants.java
  6. 8
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  7. BIN
      designer_base/src/com/fr/design/images/control/edit_white.png
  8. 1
      designer_base/src/com/fr/design/locale/designer.properties
  9. 7
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  10. 1
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  11. 1
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  12. 7
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  13. 1
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  14. 2
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  15. 6
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  16. 239
      designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java
  17. 265
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java
  18. 9
      designer_form/src/com/fr/design/mainframe/JForm.java
  19. 15
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
  20. 47
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  21. 4
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

15
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -64,6 +64,7 @@ import com.fr.privilege.finegrain.WorkSheetPrivilegeControl;
import com.fr.report.ReportHelper;
import com.fr.report.elementcase.ElementCase;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.poly.PolyWorkSheet;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;
@ -109,9 +110,17 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
@Override
public void refreshEastPropertiesPane() {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellElementPane(getEastUpPane());
EastRegionContainerPane.getInstance().replaceCellAttrPane(getEastDownPane());
if (isEditingPolySheet()) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY);
} else {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellElementPane(getEastUpPane());
EastRegionContainerPane.getInstance().replaceCellAttrPane(getEastDownPane());
}
}
private boolean isEditingPolySheet() {
return template.getReport(getEditingReportIndex()) instanceof PolyWorkSheet;
}
@Override

4
designer/src/com/fr/design/mainframe/SheetNameTabPane.java

@ -23,6 +23,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
@ -553,6 +554,9 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
for (int i = scrollIndex; i <= lastOneIndex; i++) {
int textWidth = widthArray[i];
if (evtX >= textX && evtX < textX + textWidth) {
if (getSelectedIndex() != i) {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
}
setSelectedIndex(i);
isBlank = false;
reportComposite.setComposite();

7
designer/src/com/fr/poly/PolyDesigner.java

@ -72,8 +72,8 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
/**
* 选中的类型--1.什么都没选中2.选中一个聚合块内部的内容3.选中聚合块本省
*/
public static enum SelectionType {
NONE, INNER, BLOCK
public enum SelectionType {
NONE, INNER, BLOCK, CHART_INNER
}
public JComponent polyArea;
@ -892,6 +892,9 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
} else if (isChooseBlock()) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY_CHART);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(PolyBlockProperPane.getInstance(PolyDesigner.this));
} else if (type == SelectionType.CHART_INNER) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY_CHART);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(getEastUpPane());
} else if (type != SelectionType.NONE) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY_REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());

8
designer/src/com/fr/poly/creator/ChartBlockEditor.java

@ -122,6 +122,12 @@ public class ChartBlockEditor extends BlockEditor<MiddleChartComponent, PolyChar
protected MiddleChartComponent createEffective() {
if (editComponent == null) {
initEffective(creator.getValue().getChartCollection());
editComponent.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
designer.setChooseType(SelectionType.CHART_INNER);
}
});
}
return editComponent;
}
@ -266,7 +272,7 @@ public class ChartBlockEditor extends BlockEditor<MiddleChartComponent, PolyChar
* 刷新选中状态.日EC
*/
public void resetSelectionAndChooseState() {
designer.setChooseType(SelectionType.BLOCK);
designer.setChooseType(SelectionType.CHART_INNER);
// refreshChartComponent();// 选中之后 刷新下图表编辑层
if (BaseUtils.isAuthorityEditing()) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();

5
designer_base/src/com/fr/design/constants/UIConstants.java

@ -22,6 +22,8 @@ public interface UIConstants {
public static final int SIZE = 17;
public static final int GAP_NORMAL = 10; // 10px
/**
* Cell default cursor.
*/
@ -93,6 +95,7 @@ public interface UIConstants {
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);
public static final Color SPLIT_LINE = new Color(201, 198, 184);
public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png");
@ -139,7 +142,7 @@ public interface UIConstants {
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 Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit_white.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(232, 232, 233);

8
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -113,7 +113,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
// mainSplitPane.setOneTouchExpandable(true);
this.add(getLeftPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 12, 10));
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 15, 15));
// mainSplitPane.setDividerLocation(getLeftPreferredSize());
this.checkButtonEnabled();
}
@ -161,10 +161,10 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
topToolBar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { p, f };
double[] rowSize = { p};
double[] columnSize = { p, f, 155};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(getAddItemText()), topToolBar},
new Component[]{new UILabel(getAddItemText()), null, topToolBar},
};
JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));

BIN
designer_base/src/com/fr/design/images/control/edit_white.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

1
designer_base/src/com/fr/design/locale/designer.properties

@ -2105,3 +2105,4 @@ 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
FR-Designer_Remove_Item=Remove Item

7
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -462,9 +462,9 @@ FR-Designer_Attr_Bidirectional_Adaptive=Bidirectional adaptive
FR-Designer-Selected_Widget=Selected widget
FR-Designer_LocalWidget=Local component library
FR-Designer_AllCategories=All categories
FR-Designer_Download_Template=Download components
FR-Designer_Install_Template=Install components
FR-Designer_Delete_Template=Delete components
FR-Designer_Download_Template=Download
FR-Designer_Install_Template=Install
FR-Designer_Delete_Template=Delete
FR-Designer_Mobile-Refresh=Refresh
FR-Designer_Mobile-ToolBar=Toolbar
FR-Designer_WLayout-Absolute-ToolTips=Freestyle layout, add control in any position of the layout
@ -2106,3 +2106,4 @@ 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
FR-Designer_Remove_Item=Remove Item

1
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -2109,3 +2109,4 @@ FR-Designer_Use_Params_Template=
FR-Designer_Label_Name=
FR-Designer_Insert_Formula=
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
FR-Designer_Remove_Item=

1
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2109,3 +2109,4 @@ 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.
FR-Designer_Remove_Item=

7
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -467,9 +467,9 @@ FR-Designer_AllCategories=\u6240\u6709\u5206\u7C7B
FR-Designer_SimpleDetail_Report=\u7B80\u5355\u660E\u7EC6\u8868
FR-Designer_SimpleCross_Report=\u7B80\u5355\u4EA4\u53C9\u8868
FR-Designer_DoubleLayer_Report=\u53CC\u5C42\u8868\u5934
FR-Designer_Download_Template=\u4E0B\u8F7D\u7EC4\u4EF6
FR-Designer_Install_Template=\u5B89\u88C5\u7EC4\u4EF6
FR-Designer_Delete_Template=\u5220\u9664\u7EC4\u4EF6
FR-Designer_Download_Template=\u4E0B\u8F7D
FR-Designer_Install_Template=\u5B89\u88C5
FR-Designer_Delete_Template=\u5220\u9664
FR-Designer_Mobile-ToolBar=\u5DE5\u5177\u680F
FR-Designer_Mobile-Refresh=\u5237\u65B0
FR-Designer_WLayout-Absolute-ToolTips=\u81EA\u7531\u5F0F\u5E03\u5C40\uFF0C\u53EF\u4EE5\u5728\u5E03\u5C40\u5185\u4EFB\u610F\u4F4D\u7F6E\u6DFB\u52A0\u63A7\u4EF6
@ -2112,3 +2112,4 @@ 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
FR-Designer_Remove_Item=\u5220\u9664\u9009\u4E2D

1
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2109,3 +2109,4 @@ 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
FR-Designer_Remove_Item=

2
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -28,7 +28,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private JPanel leftPane;
private JPanel rightPane;
private FixedPopupPane currentPopupPane;
private static final int CONTAINER_WIDTH = 288;
private static final int CONTAINER_WIDTH = 286;
private static final int TAB_WIDTH = 38;
private static final int TAB_BUTTON_WIDTH = 32;
private static final int TAB_BUTTON_HEIGHT = 28;

6
designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java

@ -113,8 +113,10 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
EastRegionContainerPane.getInstance().replaceWidgetLibPane(
FormWidgetDetailPane.getInstance(this));
if (!BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this));
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(this);
parameterPropertyPane.setAddParaPaneVisible(true);
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(
WidgetPropertyPane.getInstance(this));
} else {

239
designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java

@ -1,12 +1,24 @@
package com.fr.design.mainframe;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.*;
import com.fr.design.actions.UndoableAction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.designer.beans.actions.ChangeNameAction;
import com.fr.design.designer.beans.actions.FormUndoableAction;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.mainframe.widget.UITreeComboBox;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.parameter.HierarchyTreePane;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWParameterLayout;
@ -14,11 +26,6 @@ import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import com.fr.base.BaseUtils;
import com.fr.general.Inter;
@ -34,11 +41,10 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
public static final int PARA = 0;
public static final int BODY = 1;
private ShortCut4JControlPane[] shorts;
private ComponentTree componentTree;
private UITreeComboBox treeComboBox;
// richer:搜寻树节点的的文本框
// private UITextField searchTextField;
// private SearchResultPane searchResult;
private ChangeNameAction changeVarNameAction;
public static FormHierarchyTreePane getInstance() {
return HOLDER.singleton;
@ -77,9 +83,6 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
*/
public void clearDockingView() {
this.componentTree = null;
// this.searchTextField = null;
// this.searchResult = null;
// add(new JScrollPane(), BorderLayout.CENTER);
}
@Override
@ -108,51 +111,60 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
if(childCount == NODE_LENGTH){
adjustPosition(treeModel, formDesigner);
}
add(getWidgetPane(), BorderLayout.CENTER);
}
private JPanel getWidgetPane() {
shorts = createShortcuts();
JPanel widgetPane = new JPanel();
widgetPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout());
add(widgetPane, BorderLayout.NORTH);
widgetPane.add(new UILabel(Inter.getLocText("FR-Designer-Selected_Widget") + " ",
JPanel headPane = new JPanel(new BorderLayout());
headPane.add(new UILabel(Inter.getLocText("FR-Designer-Selected_Widget") + " ",
SwingConstants.HORIZONTAL), BorderLayout.WEST);
headPane.add(getToolBarPane(), BorderLayout.EAST);
widgetPane.add(headPane, BorderLayout.CENTER);
treeComboBox = new UITreeComboBox(componentTree);
widgetPane.add(treeComboBox, BorderLayout.CENTER);
add(widgetPane, BorderLayout.CENTER);
// UIScrollPane scrollPane = new UIScrollPane(componentTree);
// scrollPane.setBorder(null);
// add(scrollPane, BorderLayout.CENTER);
// JPanel searchPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// add(searchPane, BorderLayout.NORTH);
// searchPane.add(new UILabel(Inter.getLocText("FR-Designer_Search") + ":",
// SwingConstants.HORIZONTAL), BorderLayout.WEST);
// searchTextField = new UITextField();
// searchPane.add(searchTextField, BorderLayout.CENTER);
// searchTextField.getDocument().addDocumentListener(new DocumentListener() {
// @Override
// public void insertUpdate(DocumentEvent e) {
// search();
// }
//
// @Override
// public void removeUpdate(DocumentEvent e) {
// search();
// }
//
// @Override
// public void changedUpdate(DocumentEvent e) {
// search();
// }
//
// private void search() {
// String text = searchTextField.getText();
// if (StringUtils.isEmpty(text)) {
// removeSearchResult();
// } else {
// populate(componentTree.search(text));
// }
// }
// });
widgetPane.add(treeComboBox, BorderLayout.SOUTH);
return widgetPane;
}
private JPanel getToolBarPane() {
ToolBarDef toolbarDef = new ToolBarDef();
for (ShortCut4JControlPane sj : shorts) {
toolbarDef.addShortCut(sj.getShortCut());
}
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolBar.setUI(new UIToolBarUI(){
@Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(new Color(245, 245, 247));
g2.fillRect(0, 0, c.getWidth(), c.getHeight());
}
});
toolbarDef.updateToolBar(toolBar);
JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER);
return toolBarPane;
}
protected ShortCut4JControlPane[] createShortcuts() {
ArrayList<ShortCut4JControlPane> shortCutList = new ArrayList<>();
FormDesigner designer = getEditingFormDesigner();
if (changeVarNameAction == null) {
changeVarNameAction = new ChangeNameAction(designer);
}
shortCutList.add(new WidgetEnableShortCut(changeVarNameAction));
for (Action action : designer.getActions()) {
shortCutList.add(new WidgetEnableShortCut((UndoableAction)action));
}
return shortCutList.toArray(new ShortCut4JControlPane[shortCutList.size()]);
}
/**
@ -188,113 +200,6 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
componentTree.refreshTreeRoot();
}
/**
* 删除搜索结果
*/
// public void removeSearchResult() {
// componentTree.setSelectionPath(null);
// if (searchResult != null) {
// this.remove(searchResult);
// }
// }
//
// public void populate(TreePath[] treepath) {
// if (this.searchResult == null) {
// searchResult = new SearchResultPane();
// }
// if (((BorderLayout) getLayout()).getLayoutComponent(BorderLayout.SOUTH) == null) {
// add(searchResult, BorderLayout.SOUTH);
// }
// searchResult.populate(treepath);
// }
// private class SearchResultPane extends JPanel {
// private UILabel resultLabel = new UILabel();
// private BackAction backAction = new BackAction();
// private ForWardAction forwardAction = new ForWardAction();
// private TreePath[] tree;
// private int number = 0;
//
// SearchResultPane() {
// this.setLayout(FRGUIPaneFactory.createBorderLayout());
// JPanel actionJPanel = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
// addButtonToJPanel(actionJPanel, backAction.createToolBarComponent());
// addButtonToJPanel(actionJPanel, forwardAction.createToolBarComponent());
//
// this.add(actionJPanel, BorderLayout.EAST);
// this.add(resultLabel, BorderLayout.WEST);
// }
//
// private void addButtonToJPanel(JPanel actionLabel,
// JComponent toolBarComponent) {
// actionLabel.add(toolBarComponent);
// if (toolBarComponent instanceof UIButton) {
// toolBarComponent.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
// }
// }
//
// public void populate(TreePath[] search) {
// tree = search;
// resultLabel.setText(Inter.getLocText("FR-Designer_Total") + ":" + tree.length);
// number = 0;
// check();
// }
//
// public void next() {
// if (number < tree.length - 1) {
// componentTree.setAndScrollSelectionPath(tree[++number]);
// }
// check();
// }
//
// public void last() {
// if (number > 0) {
// componentTree.setAndScrollSelectionPath(tree[--number]);
// }
// check();
// }
//
// public void check() {
// if (tree.length < 1) {
// backAction.setEnabled(false);
// forwardAction.setEnabled(false);
// } else {
// backAction.setEnabled(number > 0);
// forwardAction.setEnabled(number < tree.length - 1);
// }
//
// }
//}
// private class BackAction extends UpdateAction {
//
// public BackAction() {
// this.setName(Inter.getLocText("Form-Hierarchy_Tree_Last"));
// this.setSmallIcon(BaseUtils
// .readIcon("com/fr/design/images/m_help/back.png"));
// this.setEnabled(false);
// }
//
// public void actionPerformed(ActionEvent e) {
// searchResult.last();
// }
// }
//
// private class ForWardAction extends UpdateAction {
//
// public ForWardAction() {
// this.setName(Inter.getLocText("Form-Hierarchy_Tree_Next"));
// this.setSmallIcon(BaseUtils
// .readIcon("com/fr/design/images/m_help/forward.png"));
// this.setEnabled(false);
// }
//
// public void actionPerformed(ActionEvent e) {
// searchResult.next();
// }
// }
@Override
/**
* 位置
@ -304,4 +209,18 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
public Location preferredLocation() {
return Location.WEST_BELOW;
}
private class WidgetEnableShortCut extends ShortCut4JControlPane {
public WidgetEnableShortCut(ShortCut shortCut) {
this.shortCut = shortCut;
}
/**
* 检查是否可用
*/
@Override
public void checkEnable() {
this.shortCut.setEnabled(false);
}
}
}

265
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -4,11 +4,13 @@ import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.share.ShareLoader;
@ -40,7 +42,7 @@ import java.net.URISyntaxException;
*/
public class FormWidgetDetailPane extends FormDockView{
private UITabbedPane tabbedPane;
private JPanel tabbedPane;
private UIScrollPane downPane;
private JPanel reuWidgetPanel;
private UIComboBox comboBox;
@ -50,11 +52,16 @@ public class FormWidgetDetailPane extends FormDockView{
private JPanel editPanel;
private JPanel resetPanel;
private JPanel menutPanel;
private JPanel menutPanelNorthPane;
private static final int OFFSET_X = 140;
private static final int OFFSET_Y = 26;
private SwingWorker sw;
//组件面板是否可以编辑
private boolean isEdit;
private CardLayout card;
private static final String REPORT_TAB = Inter.getLocText("FR-Engine_Report");
private static final String CHART_TAB = Inter.getLocText("FR-Designer-Form-ToolBar_Chart");
public static FormWidgetDetailPane getInstance() {
if (HOLDER.singleton == null) {
@ -115,12 +122,21 @@ public class FormWidgetDetailPane extends FormDockView{
}
initReuWidgetPanel();
initMenuPanel();
tabbedPane = new UITabbedPane();
tabbedPane.setOpaque(true);
tabbedPane.setBorder(null);
tabbedPane.setTabPlacement(SwingConstants.BOTTOM);
tabbedPane.addTab(Inter.getLocText("FR-Engine_Report"), reuWidgetPanel);
tabbedPane.addTab(Inter.getLocText("FR-Designer-Form-ToolBar_Chart"), new JPanel());
card = new CardLayout();
tabbedPane = new JPanel();
tabbedPane.setLayout(card);
tabbedPane.add(REPORT_TAB, reuWidgetPanel);
tabbedPane.add(CHART_TAB, new JPanel());
UIHeadGroup tabsHeaderIconPane = new UIHeadGroup(new String[] {REPORT_TAB, CHART_TAB}) {
@Override
public void tabChanged(int index) {
card.show(tabbedPane, labelButtonList.get(index).getText());
}
};
tabsHeaderIconPane.setNeedLeftRightOutLine(false);
add(tabsHeaderIconPane, BorderLayout.NORTH);
add(tabbedPane, BorderLayout.CENTER);
}
@ -140,17 +156,20 @@ public class FormWidgetDetailPane extends FormDockView{
private void initMenuPanel() {
menutPanel = new JPanel();
menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 8, 3, 3));
menutPanel.setPreferredSize(new Dimension(240, 48));
menutPanel.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"),
menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15));
// menutPanel.setPreferredSize(new Dimension(240, 48));
menutPanelNorthPane = new JPanel(new BorderLayout());
menutPanelNorthPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"),
SwingConstants.HORIZONTAL), BorderLayout.WEST);
menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST);
menutPanelNorthPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
menutPanel.add(initEditButtonPane(), BorderLayout.EAST);
menutPanel.add(new JPanel(), BorderLayout.CENTER);
menutPanel.add(menutPanelNorthPane, BorderLayout.NORTH);
comboBox = new UIComboBox(getFormCategories());
comboBox.setPreferredSize(new Dimension(240, 30));
comboBox.setPreferredSize(new Dimension(240, comboBox.getPreferredSize().height));
initComboBoxSelectedListener();
menutPanel.add(comboBox, BorderLayout.SOUTH);
menutPanel.add(comboBox, BorderLayout.CENTER);
reuWidgetPanel.add(menutPanel, BorderLayout.NORTH);
}
@ -159,10 +178,13 @@ public class FormWidgetDetailPane extends FormDockView{
* 创建菜单栏按钮面板
*/
private JPanel initEditButtonPane() {
editPanel = new JPanel();
editPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
editPanel.add(createRefreshButton(), BorderLayout.WEST);
editPanel.add(createDownloadButton(), BorderLayout.EAST);
editPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
editPanel.add(createRefreshButton());
editPanel.add(createDownloadButton());
editPanel.add(createInstallButton());
editPanel.add(createDeleteButton());
return editPanel;
}
@ -185,8 +207,38 @@ public class FormWidgetDetailPane extends FormDockView{
reuWidgetPanel.remove(deleteButton);
}
});
deleteButton = new UIButton(Inter.getLocText("FR-Designer_Remove_Item"));
deleteButton.set4ToolbarButton();
deleteButton.setOpaque(true);
deleteButton.setBackground(Color.red);
deleteButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (ShareLoader.getLoader().removeModulesFromList()) {
refreshShareMoudule();
reuWidgetPanel.remove(deleteButton);
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Successful"));
refreshDownPanel(false);
replaceButtonPanel(false);
refreshComboxData();
} else {
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Failed"));
}
}
});
JPanel deletePane = new JPanel(new BorderLayout());
deletePane.add(deleteButton, BorderLayout.CENTER);
deletePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
resetPanel.add(resetButton, BorderLayout.CENTER);
resetPanel.add(deletePane, BorderLayout.WEST);
refreshDownPanel(true);
return resetPanel;
}
@ -210,35 +262,46 @@ public class FormWidgetDetailPane extends FormDockView{
});
}
/**
* 创建工具条按钮
*/
private UIButton createToolButton(Icon icon, String toolTip, ActionListener actionListener) {
UIButton toolButton = new UIButton();
toolButton.setIcon(icon);
toolButton.setToolTipText(toolTip);
toolButton.set4ToolbarButton();
toolButton.addActionListener(actionListener);
return toolButton;
}
/**
* 创建刷新按钮
*/
private UIButton createRefreshButton() {
UIButton refreshButton = new UIButton();
refreshButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/refresh.png"));
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_Refresh"));
refreshButton.set4ToolbarButton();
refreshButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (sw != null) {
sw.cancel(true);
}
sw = new SwingWorker() {
return createToolButton(
BaseUtils.readIcon("/com/fr/design/form/images/refresh.png"),
Inter.getLocText("FR-Designer_Refresh"),
new ActionListener() {
@Override
protected Object doInBackground() throws Exception {
ShareLoader.getLoader().refreshModule();
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
refreshComboxData();
refreshDownPanel(false);
return null;
public void actionPerformed(ActionEvent e) {
if (sw != null) {
sw.cancel(true);
}
sw = new SwingWorker() {
@Override
protected Object doInBackground() throws Exception {
ShareLoader.getLoader().refreshModule();
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
refreshComboxData();
refreshDownPanel(false);
return null;
}
};
sw.execute();
}
};
sw.execute();
}
});
return refreshButton;
}
);
}
private void refreshComboxData() {
@ -251,30 +314,10 @@ public class FormWidgetDetailPane extends FormDockView{
*/
private UIButton createDownloadButton() {
UIButton downloadButton = new UIButton();
downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/showmenu.png"));
downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/download icon.png"));
downloadButton.set4ToolbarButton();
downloadButton.setToolTipText(Inter.getLocText("FR-Designer_Download_Template"));
downloadButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
initPopMenu();
}
});
return downloadButton;
}
/**
* 初始化下拉面板
*/
private void initPopMenu() {
UIPopupMenu menu = new UIPopupMenu();
UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download icon.png"));
UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Install_Template"), BaseUtils.readIcon("/com/fr/design/form/images/install icon.png"));
UIMenuItem deleteItem = new UIMenuItem(Inter.getLocText("FR-Designer_Delete_Template"), BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png"));
menu.add(downloadItem);
menu.add(installItem);
menu.add(deleteItem);
downloadItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String url = SiteCenter.getInstance().acquireUrlByKind("reuse.url");
@ -295,68 +338,58 @@ public class FormWidgetDetailPane extends FormDockView{
}
}
});
installItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu"));
int returnValue = fileChooser.showDialog(new UILabel(), Inter.getLocText("FR-Designer_Select"));
if (returnValue == JFileChooser.APPROVE_OPTION) {
final File chosenFile = fileChooser.getSelectedFile();
installFromDiskZipFile(chosenFile);
}
}
});
deleteItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
replaceButtonPanel(true);
deleteFromDiskZipFile();
}
});
GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, OFFSET_Y);
return downloadButton;
}
private void deleteFromDiskZipFile() {
deleteButton = new UIButton(Inter.getLocText("FR-Designer-CommitTab_Remove"));
deleteButton.setBackground(Color.red);
deleteButton.repaint();
deleteButton.setPreferredSize(new Dimension(240, 40));
reuWidgetPanel.add(deleteButton, BorderLayout.SOUTH);
deleteButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (ShareLoader.getLoader().removeModulesFromList()) {
refreshShareMoudule();
reuWidgetPanel.remove(deleteButton);
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Successful"));
refreshDownPanel(false);
replaceButtonPanel(false);
refreshComboxData();
} else {
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Failed"));
/**
* 创建安装模板的按钮
*/
private UIButton createInstallButton() {
return createToolButton(
BaseUtils.readIcon("/com/fr/design/form/images/install icon.png"),
Inter.getLocText("FR-Designer_Install_Template"),
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu"));
int returnValue = fileChooser.showDialog(new UILabel(), Inter.getLocText("FR-Designer_Select"));
if (returnValue == JFileChooser.APPROVE_OPTION) {
final File chosenFile = fileChooser.getSelectedFile();
installFromDiskZipFile(chosenFile);
}
}
}
);
}
}
});
refreshDownPanel(true);
/**
* 创建删除模板的按钮
*/
private UIButton createDeleteButton() {
return createToolButton(
BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png"),
Inter.getLocText("FR-Designer_Delete_Template"),
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
replaceButtonPanel(true);
}
}
);
}
private void replaceButtonPanel(boolean isEdit) {
this.isEdit = isEdit;
if (isEdit) {
menutPanel.remove(editPanel);
menutPanel.add(initResetButtonPane(), BorderLayout.EAST);
menutPanelNorthPane.remove(editPanel);
menutPanelNorthPane.add(initResetButtonPane(), BorderLayout.EAST);
} else {
menutPanel.remove(resetPanel);
menutPanel.add(initEditButtonPane(), BorderLayout.EAST);
menutPanelNorthPane.remove(resetPanel);
menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST);
ShareLoader.getLoader().resetRemovedModuleList();
}
}
private void installFromDiskZipFile(File chosenFile) {
@ -393,8 +426,6 @@ public class FormWidgetDetailPane extends FormDockView{
return ArrayUtils.addAll(new String[] {Inter.getLocText("FR-Designer_AllCategories")}, ShareLoader.getLoader().getModuleCategory());
}
public void refreshDownPanel(boolean isEdit) {
reuWidgetPanel.remove(downPane);
downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit));
@ -409,12 +440,6 @@ public class FormWidgetDetailPane extends FormDockView{
revalidate();
}
public void setSelectedIndex(int index){
tabbedPane.setSelectedIndex(index);
}
/**
* 清除数据
*/

9
designer_form/src/com/fr/design/mainframe/JForm.java

@ -300,8 +300,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
private void setPropertyPaneChange(XComponent comp) {
if (comp == null) {
ParameterPropertyPane.getInstance().setAddParaPaneVisible(false);
return;
}
ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout);
editingComponent = comp.createToolPane(this, formDesign);
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
if (BaseUtils.isAuthorityEditing()) {
@ -677,8 +679,11 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(formDesign).getPreferredSize().height);
ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign);
parameterPropertyPane.setAddParaPaneVisible(false);
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);
if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) {
new Thread() {
public void run() {

15
designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -80,6 +80,19 @@ public class UITreeComboBox extends JComboBox{
setUI(cui);
}
private void refreshShortCuts() {
TreePath path = this.getTree().getSelectionPath();
if (path == null) {
return;
}
Component component = (Component) path.getLastPathComponent();
if (!(component instanceof XCreator)) {
return;
}
com.fr.design.designer.beans.ComponentAdapter adapter = AdapterBus.getComponentAdapter(this.getTree().getDesigner(), (XCreator) component);
adapter.getContextPopupMenu(null);
}
// UI Inner classes -- one for each supported Look and Feel
class MetalJTreeComboBoxUI extends MetalComboBoxUI{
protected ComboPopup createPopup() {
@ -152,7 +165,7 @@ public class UITreeComboBox extends JComboBox{
tree.refreshUI();
repaint();
}
refreshShortCuts();
}
@Override

47
designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

@ -1,5 +1,6 @@
package com.fr.design.parameter;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.FormDesigner;
@ -14,11 +15,14 @@ import java.awt.event.MouseEvent;
public class ParameterPropertyPane extends JPanel{
private ParameterToolBarPane toolbarPane;
private BasicScrollPane basicScrollPane;
private ParaDefinitePane paraPane;
private JPanel formHierarchyTreePaneWrapper; // 封装一层,加边框
private JPanel addParaPane;
public static ParameterPropertyPane THIS;
private static ParameterPropertyPane THIS;
private boolean isEditing = false;
private static final int HIDE_HEIGHT = 40;
public static final ParameterPropertyPane getInstance() {
if(THIS == null) {
@ -43,7 +47,7 @@ public class ParameterPropertyPane extends JPanel{
public ParameterPropertyPane() {
toolbarPane = new ParameterToolBarPane();
basicScrollPane = new BasicScrollPane() {
BasicScrollPane basicScrollPane = new BasicScrollPane() {
@Override
protected JPanel createContentPane() {
return toolbarPane;
@ -59,15 +63,42 @@ public class ParameterPropertyPane extends JPanel{
return null;
}
};
initParameterListener();
JPanel scrollPaneWrapperInner = new JPanel(new BorderLayout());
scrollPaneWrapperInner.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 5));
scrollPaneWrapperInner.add(basicScrollPane, BorderLayout.CENTER);
addParaPane = new JPanel(new BorderLayout());
addParaPane.add(scrollPaneWrapperInner, BorderLayout.CENTER);
addParaPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.SPLIT_LINE));
initParameterListener();
this.setLayout(new BorderLayout(0, 6));
this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
this.add(basicScrollPane, BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.add(addParaPane, BorderLayout.CENTER);
}
public void setAddParaPaneVisible(boolean isVisible) {
if (isVisible == addParaPane.isVisible()) {
return;
}
if (isVisible && toolbarPane.hasSelectedLabelItem()) {
addParaPane.setVisible(true);
this.setPreferredSize(null);
} else {
addParaPane.setVisible(false);
this.setPreferredSize(new Dimension(getWidth(), formHierarchyTreePaneWrapper.getPreferredSize().height + UIConstants.GAP_NORMAL));
}
repaintContainer();
}
private void setEditor(FormDesigner editor) {
this.remove(FormHierarchyTreePane.getInstance());
this.add(FormHierarchyTreePane.getInstance(editor), BorderLayout.NORTH);
if (formHierarchyTreePaneWrapper == null) {
formHierarchyTreePaneWrapper = new JPanel(new BorderLayout());
formHierarchyTreePaneWrapper.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
this.add(formHierarchyTreePaneWrapper, BorderLayout.SOUTH);
}
formHierarchyTreePaneWrapper.remove(FormHierarchyTreePane.getInstance());
formHierarchyTreePaneWrapper.add(FormHierarchyTreePane.getInstance(editor), BorderLayout.CENTER);
}
private void initParameterListener() {

4
designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

@ -57,6 +57,10 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
}
public boolean hasSelectedLabelItem() {
return !parameterSelectedLabellist.isEmpty();
}
@Override
protected String title4PopupWindow() {
return null;

Loading…
Cancel
Save