Browse Source

Merge pull request #1030 in BA/design from ~MOMEAK/design9.0:9.0 to 9.0

* commit 'eccf8d8e1d0f0562296e4efaaccce6d39e6c0f68':
  REPORT-2897 9.0设计器修改 国际化
  REPORT-2897 9.0设计器修改 缩放条部分视觉优化
  REPORT-2897 9.0设计器修改 修改换行符
  REPORT-2897 9.0设计器修改 代码质量
  REPORT-2897 9.0设计器修改 去除不必要强转
  REPORT-2897 9.0设计器修改 换行符修改
  REPORT-2897 9.0设计器修改
  REPORT-2897 9.0设计器修改 缩放条tooltip部分视觉优化 pr修改
  REPORT-2897 9.0设计器修改 缩放条部分视觉优化
  REPORT-2897 9.0设计器修改 缩放条部分视觉png
  REPORT-2897 9.0设计器修改 权限编辑、缩放条部分视觉优化
  REPORT-2897 9.0设计器修改 权限编辑、缩放条部分视觉优化
master
superman 7 years ago
parent
commit
333ff9346c
  1. 142
      designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java
  2. 69
      designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  3. 2
      designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java
  4. 8
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  5. 141
      designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java
  6. 5
      designer/src/com/fr/design/mainframe/JWorkBook.java
  7. 56
      designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java
  8. 5
      designer/src/com/fr/design/mainframe/SheetNameTabPane.java
  9. 4
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  10. 2
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  11. 8
      designer/src/com/fr/poly/PolyDesigner.java
  12. 3
      designer/src/com/fr/poly/creator/ChartBlockEditor.java
  13. 6
      designer/src/com/fr/poly/creator/ECBlockPane.java
  14. 32
      designer_base/src/com/fr/design/foldablepane/HeaderPane.java
  15. 1
      designer_base/src/com/fr/design/gui/ibutton/UIButton.java
  16. 4
      designer_base/src/com/fr/design/gui/style/AlignmentPane.java
  17. 4
      designer_base/src/com/fr/design/gui/style/BorderPane.java
  18. BIN
      designer_base/src/com/fr/design/images/data/source/hoverDown.png
  19. BIN
      designer_base/src/com/fr/design/images/data/source/hoverDown20.png
  20. BIN
      designer_base/src/com/fr/design/images/data/source/hoverDown@2x.png
  21. BIN
      designer_base/src/com/fr/design/images/data/source/hoverUp20.png
  22. BIN
      designer_base/src/com/fr/design/images/data/source/normalDown.png
  23. BIN
      designer_base/src/com/fr/design/images/data/source/normalDown20.png
  24. BIN
      designer_base/src/com/fr/design/images/data/source/normalDown@2x.png
  25. BIN
      designer_base/src/com/fr/design/images/data/source/normalUp20.png
  26. BIN
      designer_base/src/com/fr/design/images/data/source/scaleDown.png
  27. BIN
      designer_base/src/com/fr/design/images/data/source/scaleUp.png
  28. 16
      designer_base/src/com/fr/design/locale/designer.properties
  29. 12
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  30. 9
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  31. 10
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  32. 9
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  33. 8
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  34. 86
      designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java
  35. 50
      designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java
  36. 7
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  37. 188
      designer_base/src/com/fr/design/mainframe/JFormSliderPane.java
  38. 226
      designer_base/src/com/fr/design/mainframe/JSliderPane.java
  39. 63
      designer_base/src/com/fr/design/mainframe/NoSupportAuthorityEdit.java
  40. 186
      designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java
  41. 74
      designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java
  42. 14
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  43. 8
      designer_form/src/com/fr/design/mainframe/JForm.java

142
designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java

File diff suppressed because one or more lines are too long

69
designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java

@ -31,6 +31,7 @@ import java.util.List;
public class AuthorityEditToolBarPane extends AuthorityPropertyPane { public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
private static final int TITLE_HEIGHT = 19; private static final int TITLE_HEIGHT = 19;
private static final int RIGHT_GAP = 10;
private AuthorityEditPane authorityEditPane = null; private AuthorityEditPane authorityEditPane = null;
private AuthorityToolBarPane authorityToolBarPane; private AuthorityToolBarPane authorityToolBarPane;
private String[] selectedPathArray; private String[] selectedPathArray;
@ -51,7 +52,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(authorityTitle, BorderLayout.CENTER); northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); 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); authorityEditPane = new AuthorityEditPane(buttonlists);
this.add(authorityEditPane, BorderLayout.CENTER); this.add(authorityEditPane, BorderLayout.CENTER);
} }
@ -81,13 +82,15 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
private class AuthorityEditPane extends JPanel { private class AuthorityEditPane extends JPanel {
private static final int TOP_GAP = 11; 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 static final int LEFT_CHECKPANE = 3;
private JPanel typePane;
private JPanel namePane;
private UILabel type = null; private UILabel type = null;
private UILabel name = null; private UILabel name = null;
private JPanel checkPane = null; private JPanel checkPane = null;
private List<ToolBarButton> buttonlists; private List<ToolBarButton> 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() { private ItemListener itemListener = new ItemListener() {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
@ -143,43 +146,36 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public AuthorityEditPane(List<ToolBarButton> buttonlists) { public AuthorityEditPane(List<ToolBarButton> buttonlists) {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
type = new UILabel(); 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(); 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 = new JPanel();
checkPane.setLayout(new BorderLayout()); checkPane.setLayout(new BorderLayout());
this.add(layoutText(), BorderLayout.WEST); this.add(centerPane(), BorderLayout.NORTH);
this.add(layoutPane(), BorderLayout.CENTER); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP));
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0));
this.buttonlists = buttonlists; this.buttonlists = buttonlists;
buttonVisible.addItemListener(itemListener); buttonVisible.addItemListener(itemListener);
} }
private JPanel layoutText() { private JPanel centerPane() {
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() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; 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[][]{ Component[][] components = new Component[][]{
new Component[]{type}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane},
new Component[]{name}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane},
new Component[]{checkPane}, new Component[]{checkPane, null},
}; };
double[] rowSize = {p, p, p};
double[] columnSize = {f}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
/** /**
@ -237,15 +233,14 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Form_Button"), SwingConstants.LEFT), new Component[]{buttonVisible},
buttonVisible},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p};
double[] columnSize = {p, p, f}; double[] columnSize = {p};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; int[][] rowCount = {{1}};
JPanel check = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); JPanel check = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL);
checkPane.add(check, BorderLayout.CENTER); checkPane.add(check, BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
} }
} }
} }

2
designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java

@ -41,7 +41,7 @@ public class AuthoritySheetEditedPane extends AuthorityPropertyPane {
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(authorityTitle, BorderLayout.CENTER); northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); 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); authorityEditPane = new SheetAuthorityEditPane(editingWorkBook, selectedIndex);
this.add(authorityEditPane, BorderLayout.CENTER); this.add(authorityEditPane, BorderLayout.CENTER);

8
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -76,7 +76,9 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
} }
} }
authorityEditToolBarPane.populate(); authorityEditToolBarPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(authorityEditToolBarPane); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityEditToolBarPane);
} }
}; };
@ -114,8 +116,8 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
populateToolBarPane(); populateToolBarPane();
authorityEditToolBarPane = new AuthorityEditToolBarPane(toolBarPane.getToolBarButtons()); authorityEditToolBarPane = new AuthorityEditToolBarPane(toolBarPane.getToolBarButtons());
authorityEditToolBarPane.setAuthorityToolBarPane(AuthorityToolBarPane.this); authorityEditToolBarPane.setAuthorityToolBarPane(AuthorityToolBarPane.this);
EastRegionContainerPane.getInstance().replaceUpPane(authorityEditToolBarPane); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityEditToolBarPane);
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
} }
} }
}; };

141
designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java

@ -5,6 +5,7 @@ import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
@ -30,6 +31,8 @@ import com.fr.stable.ColumnRow;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -50,20 +53,26 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
private static final int NEW_VALUE = 4; private static final int NEW_VALUE = 4;
//新值下面的编辑器的宽度 //新值下面的编辑器的宽度
private static final int NEW_PANE_WIDTH = 120; private static final int NEW_PANE_WIDTH = 120;
private static final Dimension VALUEPANE_NEW_DIMENSION = new Dimension(154,20);
private static final Dimension VALUEPANE_OLD_DIMENSION = new Dimension(0,0);
private UICheckBox floatElementVisibleCheckBoxes = new UICheckBox(Inter.getLocText("FR-Designer_Visible"));
private UICheckBox cellElementVisibleCheckBoxes = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); private UICheckBox floatElementVisibleCheckBoxes = new UICheckBox(Inter.getLocText("FR-Designer_Float_Visible"));
private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); private UICheckBox cellElementVisibleCheckBoxes = new UICheckBox(Inter.getLocText("FR-Designer_Cell_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 UICheckBox gridColumnRowVisible = new UICheckBox(Inter.getLocText("FR-Designer_Hide")); private UICheckBox gridColumnRowVisible = new UICheckBox(Inter.getLocText("FR-Designer_Hide"));
private UICheckBox newValue = new UICheckBox(Inter.getLocText("FR-Designer_New_Value")); private UICheckBox newValue = new UICheckBox(Inter.getLocText("FR-Designer_New_Value"));
private UIButtonGroup oldNewValueButton = new UIButtonGroup(new String[]{Inter.getLocText("FR-Designer_CellWrite_InsertRow_COPY"),Inter.getLocText("FR-Designer_New_Value")});
private JPanel newValuePane;
private ValueEditorPane valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(NEW_PANE_WIDTH); private ValueEditorPane valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(NEW_PANE_WIDTH);
private UICheckBox[] hyperlinkCheckBoxes = null; private UICheckBox[] hyperlinkCheckBoxes = null;
private ElementCasePane elementCasePane = null; private ElementCasePane elementCasePane = null;
private int selectionType = CellSelection.NORMAL; private int selectionType = CellSelection.NORMAL;
private CellSelection cellSelection; private CellSelection cellSelection;
private FloatSelection floatSelection; private FloatSelection floatSelection;
private CardLayout newValueCard;
private boolean isAllHasWidget; private boolean isAllHasWidget;
private boolean isAllHasHyperlink; private boolean isAllHasHyperlink;
private String[] selectedPathArray; private String[] selectedPathArray;
@ -148,6 +157,22 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
} }
} }
}; };
private ChangeListener buttonChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (oldNewValueButton.getSelectedIndex() == 1){
newValuePane.setPreferredSize(VALUEPANE_NEW_DIMENSION);
newValueCard.show(newValuePane,"new");
newValue.setSelected(true);
valueEditor.setEnabled(true);
}else {
newValue.setSelected(false);
// valueEditor.setEnabled(false);
newValuePane.setPreferredSize(VALUEPANE_OLD_DIMENSION);
newValueCard.show(newValuePane,"old");
}
}
};
public ElementCasePaneAuthorityEditPane(ElementCasePane elementCasePane) { public ElementCasePaneAuthorityEditPane(ElementCasePane elementCasePane) {
super(elementCasePane); super(elementCasePane);
@ -354,6 +379,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
} }
widgetAvailable.setEnabled(cellElementVisibleCheckBoxes.isSelected()); widgetAvailable.setEnabled(cellElementVisibleCheckBoxes.isSelected());
widgetVisible.setEnabled(cellElementVisibleCheckBoxes.isSelected()); widgetVisible.setEnabled(cellElementVisibleCheckBoxes.isSelected());
oldNewValueButton.setSelectedIndex(0);
} }
private void initListener() { private void initListener() {
@ -364,6 +390,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
gridColumnRowVisible.addItemListener(columnRowAuthorityListener); gridColumnRowVisible.addItemListener(columnRowAuthorityListener);
newValue.addItemListener(newValuelistener); newValue.addItemListener(newValuelistener);
valueEditor.registerChangeListener(observerListener); valueEditor.registerChangeListener(observerListener);
oldNewValueButton.addChangeListener(buttonChangeListener);
} }
private void removeListener() { private void removeListener() {
@ -374,6 +401,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
gridColumnRowVisible.removeItemListener(columnRowAuthorityListener); gridColumnRowVisible.removeItemListener(columnRowAuthorityListener);
newValue.removeItemListener(newValuelistener); newValue.removeItemListener(newValuelistener);
valueEditor.registerChangeListener(null); valueEditor.registerChangeListener(null);
oldNewValueButton.removeChangeListener(buttonChangeListener);
} }
private void addHyperlinkListener() { private void addHyperlinkListener() {
@ -506,7 +534,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
} else if (selectionType == FLOAT_SELECTION) { } else if (selectionType == FLOAT_SELECTION) {
populateFloatSelectionCheckPane(checkPane); populateFloatSelectionCheckPane(checkPane);
} }
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
return checkPane; return checkPane;
} }
@ -538,17 +566,17 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
} }
//单元格带控件 //单元格带控件
if (cellElement.getCellWidgetAttr() != null) { if (cellElement.getCellWidgetAttr() != null) {
checkPane.add(populateWidgetCheckPane(), BorderLayout.WEST); checkPane.add(populateWidgetCheckPane(), BorderLayout.CENTER);
} else { } else {
checkPane.add(populatCellCheckPane(), BorderLayout.WEST); checkPane.add(populatCellCheckPane(), BorderLayout.CENTER);
} }
} else { } else {
//批量选中单元格 //批量选中单元格
mutilRect(cellSelection); mutilRect(cellSelection);
if (!isAllHasWidget && !isAllHasHyperlink) { if (!isAllHasWidget && !isAllHasHyperlink) {
checkPane.add(populateMutilCellCheckPane(), BorderLayout.WEST); checkPane.add(populateMutilCellCheckPane(), BorderLayout.CENTER);
} else if (isAllHasWidget) { } else if (isAllHasWidget) {
checkPane.add(populateMutilWidgetCheckPane(), BorderLayout.WEST); checkPane.add(populateMutilWidgetCheckPane(), BorderLayout.CENTER);
} }
} }
} }
@ -609,28 +637,46 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("M_Insert-Float"), SwingConstants.LEFT), floatElementVisibleCheckBoxes} new Component[]{floatElementVisibleCheckBoxes}
}; };
double[] rowSize = {p}; double[] rowSize = {p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}}; int[][] rowCount = {{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_SMALL);
} }
// private JPanel populateWidgetCheckPane() {
// double f = TableLayout.FILL;
// double p = TableLayout.PREFERRED;
// Component[][] components = new Component[][]{
// new Component[]{new UILabel(Inter.getLocText("FR-Designer_Cell"), SwingConstants.LEFT), cellElementVisibleCheckBoxes},
// new Component[]{null, newValue},
// new Component[]{null, valueEditor},
// new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget"), SwingConstants.LEFT), widgetVisible},
// new Component[]{null, widgetAvailable}
// };
// double[] rowSize = {p, p, p, p, p};
// double[] columnSize = {p, f};
// int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
// return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
// }
private JPanel populateWidgetCheckPane() { private JPanel populateWidgetCheckPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel cv = new UILabel(Inter.getLocText("FR-Designer_Cell_Value") + " ");
cv.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Cell"), SwingConstants.LEFT), cellElementVisibleCheckBoxes}, new Component[]{cellElementVisibleCheckBoxes, null},
new Component[]{null, newValue}, new Component[]{cv,valueGroup()},
new Component[]{null, valueEditor}, new Component[]{null, newValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget"), SwingConstants.LEFT), widgetVisible}, new Component[]{widgetVisible,null},
new Component[]{null, widgetAvailable} new Component[]{widgetAvailable,null}
}; };
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 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_SMALL);
} }
private JPanel populateMutilWidgetCheckPane() { private JPanel populateMutilWidgetCheckPane() {
@ -659,18 +705,34 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
// private JPanel populatCellCheckPane() {
// double f = TableLayout.FILL;
// double p = TableLayout.PREFERRED;
// Component[][] components = new Component[][]{
// new Component[]{cellElementVisibleCheckBoxes},
// new Component[]{newValue},
// new Component[]{valueEditor}
// };
// 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);
// }
private JPanel populatCellCheckPane() { private JPanel populatCellCheckPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
UILabel cv = new UILabel(Inter.getLocText("FR-Designer_Cell_Value") + " ");
cv.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{cellElementVisibleCheckBoxes}, new Component[]{cellElementVisibleCheckBoxes,null},
new Component[]{newValue}, new Component[]{cv,valueGroup()},
new Component[]{valueEditor} new Component[]{null,newValuePane}
}; };
double[] rowSize = {p, p, p}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL);
double[] columnSize = {f};
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
public TemplateCellElement getFirstCell() { public TemplateCellElement getFirstCell() {
@ -719,12 +781,30 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
if (!firstCell.isDoneAuthority(selected)) { if (!firstCell.isDoneAuthority(selected)) {
newValue.setSelected(firstCell.isDoneNewValueAuthority(selected)); newValue.setSelected(firstCell.isDoneNewValueAuthority(selected));
if (newValue.isSelected()) { if (newValue.isSelected()) {
oldNewValueButton.setSelectedIndex(1);
if (newValuePane != null){
newValuePane.setPreferredSize(VALUEPANE_NEW_DIMENSION);
newValueCard.show(newValuePane,"new");
newValuePane.setVisible(true);
}
valueEditor.setEnabled(true); valueEditor.setEnabled(true);
valueEditor.populate(firstCell.getCellPrivilegeControl().getNewValueMap().get(selected)); valueEditor.populate(firstCell.getCellPrivilegeControl().getNewValueMap().get(selected));
} else { } else {
if (newValuePane != null){
oldNewValueButton.setSelectedIndex(0);
newValuePane.setPreferredSize(VALUEPANE_OLD_DIMENSION);
newValueCard.show(newValuePane,"old");
newValuePane.setVisible(false);
}
valueEditor.setEnabled(false); valueEditor.setEnabled(false);
} }
} else { } else {
oldNewValueButton.setSelectedIndex(0);
if (newValuePane != null){
newValuePane.setPreferredSize(new Dimension(0,0));
newValueCard.show(newValuePane,"old");
newValuePane.setVisible(false);
}
newValue.setSelected(false); newValue.setSelected(false);
valueEditor.setEnabled(false); valueEditor.setEnabled(false);
} }
@ -756,6 +836,7 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
widgetAvailable.setEnabled(true); widgetAvailable.setEnabled(true);
newValue.setSelected(false); newValue.setSelected(false);
valueEditor.setEnabled(false); valueEditor.setEnabled(false);
oldNewValueButton.setSelectedIndex(0);
} }
private void checkColumnRowCheckBoxes(String selected) { private void checkColumnRowCheckBoxes(String selected) {
@ -826,4 +907,14 @@ public class ElementCasePaneAuthorityEditPane extends AuthorityEditPane {
int[][] rowCount = {{1, 1}, {1, 1}}; int[][] rowCount = {{1, 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_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
private JPanel valueGroup(){
newValueCard = new CardLayout();
newValuePane = new JPanel(newValueCard);
newValuePane.add(valueEditor, "new");
newValuePane.add(new JPanel(), "old");
newValuePane.setPreferredSize(VALUEPANE_OLD_DIMENSION);
oldNewValueButton.setPreferredSize(VALUEPANE_NEW_DIMENSION);
return oldNewValueButton;
}
} }

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

@ -879,8 +879,9 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
} }
} }
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().replaceUpPane(allowAuthorityUpPane()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(allowAuthorityUpPane());
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
} }
centerPane.needToShowCoverAndHidPane(); centerPane.needToShowCoverAndHidPane();

56
designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java

@ -28,12 +28,14 @@ import java.awt.event.ItemListener;
*/ */
public class SheetAuthorityEditPane extends AuthorityEditPane { public class SheetAuthorityEditPane extends AuthorityEditPane {
private static final int TOP_GAP = 11; 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 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 WorkBook workBook = null;
private int selectedIndex = -1; private int selectedIndex = -1;
private JPanel typePane;
private JPanel namePane;
private ItemListener itemListener = new ItemListener() { private ItemListener itemListener = new ItemListener() {
@Override @Override
@ -66,47 +68,43 @@ public class SheetAuthorityEditPane extends AuthorityEditPane {
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
setLayout(new BorderLayout()); setLayout(new BorderLayout());
type = new UILabel(); 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(); 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 = new JPanel();
checkPane.setLayout(new BorderLayout()); checkPane.setLayout(new BorderLayout());
this.add(layoutText(), BorderLayout.WEST); // this.add(layoutText(), BorderLayout.WEST);
this.add(layoutPane(), BorderLayout.CENTER); // this.add(layoutPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); this.add(centerPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP));
this.workBook = editingWorkBook; this.workBook = editingWorkBook;
sheetVisible.addItemListener(itemListener); sheetVisible.addItemListener(itemListener);
this.selectedIndex = selectedIndex; this.selectedIndex = selectedIndex;
} }
private JPanel centerPane() {
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 f = TableLayout.FILL;
double p = TableLayout.PREFERRED; 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[][]{ Component[][] components = new Component[][]{
new Component[]{type}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), typePane},
new Component[]{name}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane},
new Component[]{checkPane}, new Component[]{checkPane, null},
}; };
double[] rowSize = {p, p, p};
double[] columnSize = {f}; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
int[][] rowCount = {{1}, {1}, {1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
} }
/** /**
* 更新权限编辑面板的具体内容类型名称权限面板 * 更新权限编辑面板的具体内容类型名称权限面板
*/ */
@ -121,7 +119,7 @@ public class SheetAuthorityEditPane extends AuthorityEditPane {
return; return;
} }
checkPane.add(populateCheckPane(), BorderLayout.CENTER); checkPane.add(populateCheckPane(), BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
checkVisibleCheckBoxes(); checkVisibleCheckBoxes();
} }

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

@ -215,8 +215,9 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
private void doWithAuthority() { private void doWithAuthority() {
AuthoritySheetEditedPane sheetEditedPane = new AuthoritySheetEditedPane(reportComposite.getEditingWorkBook(), selectedIndex); AuthoritySheetEditedPane sheetEditedPane = new AuthoritySheetEditedPane(reportComposite.getEditingWorkBook(), selectedIndex);
sheetEditedPane.populate(); sheetEditedPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(sheetEditedPane); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(sheetEditedPane);
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
} }

4
designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java

@ -84,8 +84,8 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
layoutPane = new JPanel(new BorderLayout()); layoutPane = new JPanel(new BorderLayout());
basicPane = new JPanel(); basicPane = new JPanel();
seniorPane = new JPanel(); seniorPane = new JPanel();
basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,20,basicPane()); basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,24,basicPane());
seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,20,seniorPane()); seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,24,seniorPane());
layoutPane.add(basicPane,BorderLayout.NORTH); layoutPane.add(basicPane,BorderLayout.NORTH);
layoutPane.add(seniorPane,BorderLayout.CENTER); layoutPane.add(seniorPane,BorderLayout.CENTER);
return layoutPane; return layoutPane;

2
designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -36,7 +36,7 @@ import java.awt.event.ItemListener;
public class CellOtherSetPane extends AbstractCellAttrPane { public class CellOtherSetPane extends AbstractCellAttrPane {
private static final int HEAD_WDITH = 290; private static final int HEAD_WDITH = 290;
private static final int HEAD_HEIGTH = 20; private static final int HEAD_HEIGTH = 24;
// normal // normal
private UIButtonGroup autoshrik; private UIButtonGroup autoshrik;

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

@ -139,7 +139,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
} }
private void initComponents() { private void initComponents() {
jSliderContainer = ((JWorkBook) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()).reportComposite.getjSliderContainer(); jSliderContainer = JSliderPane.getInstance();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
ployareaPane = new JPanel(new PolyDesignerLayout()); ployareaPane = new JPanel(new PolyDesignerLayout());
polyArea = new PolyArea(this, resolution); polyArea = new PolyArea(this, resolution);
@ -395,7 +395,8 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
* 不支持权限编辑 * 不支持权限编辑
*/ */
public void noAuthorityEdit() { public void noAuthorityEdit() {
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(false); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(false);
} }
@ -738,7 +739,8 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
startEditing(blockName); startEditing(blockName);
if (selection == null) { if (selection == null) {
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
} else { } else {
EastRegionContainerPane.getInstance().replaceDownPane(new JPanel()); EastRegionContainerPane.getInstance().replaceDownPane(new JPanel());
QuickEditorRegion.getInstance().populate(QuickEditor.DEFAULT_EDITOR); QuickEditorRegion.getInstance().populate(QuickEditor.DEFAULT_EDITOR);

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

@ -274,7 +274,8 @@ public class ChartBlockEditor extends BlockEditor<MiddleChartComponent, PolyChar
//清参数面板 //清参数面板
jTemplate.removeParameterPaneSelection(); jTemplate.removeParameterPaneSelection();
} }
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
} }
QuickEditorRegion.getInstance().populate(creator.getQuickEditor(designer)); QuickEditorRegion.getInstance().populate(creator.getQuickEditor(designer));
} }

6
designer/src/com/fr/poly/creator/ECBlockPane.java

@ -53,13 +53,15 @@ public class ECBlockPane extends PolyElementCasePane {
public void selectionChanged(SelectionEvent e) { public void selectionChanged(SelectionEvent e) {
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
if (designer.getSelection().getEditingElementCasePane() == null) { if (designer.getSelection().getEditingElementCasePane() == null) {
EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(false); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(false);
return; return;
} }
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(designer); AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(designer);
authorityPropertyPane.populate(); authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
return; return;
} }

32
designer_base/src/com/fr/design/foldablepane/HeaderPane.java

@ -2,9 +2,9 @@ package com.fr.design.foldablepane;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import javax.swing.JPanel;
/** /**
* Created by MoMeak on 2017/7/5. * Created by MoMeak on 2017/7/5.
@ -18,24 +18,24 @@ public class HeaderPane extends JPanel {
private String title; private String title;
private Image image; private Image image;
private int fontSize = 13; private int fontSize = 13;
public void setShow(boolean isShow) { public void setShow(boolean isShow) {
this.isShow = isShow; this.isShow = isShow;
} }
public void setTitle(String title) public void setTitle(String title) {
{
this.title = title; this.title = title;
} }
public void setHeadWidth(int headwidth){ public void setHeadWidth(int headwidth) {
this.headWidth = headwidth; this.headWidth = headwidth;
} }
public void setheadHeight(int headHeight){ public void setheadHeight(int headHeight) {
this.headHeight = headHeight; this.headHeight = headHeight;
} }
public void setFontSize(int fontSize){ public void setFontSize(int fontSize) {
this.fontSize = fontSize; this.fontSize = fontSize;
} }
@ -58,16 +58,13 @@ public class HeaderPane extends JPanel {
g2d.setFont(new Font("SimSun", 0, fontSize)); g2d.setFont(new Font("SimSun", 0, fontSize));
g2d.setPaint(bgColor); g2d.setPaint(bgColor);
// g2d.drawString(this.title, fontSize/2, headHeight-fontSize/3); // g2d.drawString(this.title, fontSize/2, headHeight-fontSize/3);
g2d.drawString(this.title, 0, headHeight-fontSize/3); g2d.drawString(this.title, 0, headHeight - fontSize / 2 - 1);
if(this.isShow) if (this.isShow) {
{
image = UIConstants.DRAG_DOWN_PRESS; image = UIConstants.DRAG_DOWN_PRESS;
g2d.drawImage(image, title.length() * fontSize, headHeight/2-1, null); g2d.drawImage(image, title.length() * fontSize, headHeight / 2 - 1, null);
} } else {
else
{
image = UIConstants.DRAG_RIGHT_PRESS; image = UIConstants.DRAG_RIGHT_PRESS;
g2d.drawImage(image, title.length() * fontSize, headHeight/3, null); g2d.drawImage(image, title.length() * fontSize, headHeight / 3, null);
} }
@ -90,18 +87,17 @@ public class HeaderPane extends JPanel {
} }
public HeaderPane(Color bgColor, String title , int headWidth, int headHeight) { public HeaderPane(Color bgColor, String title, int headWidth, int headHeight) {
this(bgColor); this(bgColor);
this.title = title; this.title = title;
this.headHeight = headHeight; this.headHeight = headHeight;
this.headWidth = headWidth; this.headWidth = headWidth;
} }
public static void main(String[] args) public static void main(String[] args) {
{
// JFrame mainFrame = new JFrame("UI Demo - Gloomyfish"); // JFrame mainFrame = new JFrame("UI Demo - Gloomyfish");
// mainFrame.getContentPane().setLayout(new BorderLayout()); // mainFrame.getContentPane().setLayout(new BorderLayout());
// mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本",280,25), BorderLayout.CENTER); // mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本", 280, 24), BorderLayout.CENTER);
// mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// mainFrame.pack(); // mainFrame.pack();
// mainFrame.setSize(280, 400); // mainFrame.setSize(280, 400);

1
designer_base/src/com/fr/design/gui/ibutton/UIButton.java

@ -135,6 +135,7 @@ public class UIButton extends JButton implements UIObserver {
private void init() { private void init() {
setOpaque(false);
setBackground(null); setBackground(null);
setRolloverEnabled(true); setRolloverEnabled(true);
initListener(); initListener();

4
designer_base/src/com/fr/design/gui/style/AlignmentPane.java

@ -164,8 +164,8 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
JPanel jp1 = new JPanel(new BorderLayout()); JPanel jp1 = new JPanel(new BorderLayout());
basicPane = new JPanel(); basicPane = new JPanel();
seniorPane = new JPanel(); seniorPane = new JPanel();
basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 290, 20, basicPane()); basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 290, 24, basicPane());
seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 20, seniorPane()); seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 24, seniorPane());
jp1.add(basicPane, BorderLayout.NORTH); jp1.add(basicPane, BorderLayout.NORTH);
jp1.add(seniorPane, BorderLayout.CENTER); jp1.add(seniorPane, BorderLayout.CENTER);

4
designer_base/src/com/fr/design/gui/style/BorderPane.java

@ -94,11 +94,11 @@ public class BorderPane extends AbstractBasicStylePane {
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
borderPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Border"), 280, 20, panel); borderPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Border"), 280, 24, panel);
this.add(borderPanel, BorderLayout.NORTH); this.add(borderPanel, BorderLayout.NORTH);
backgroundPane = new BackgroundPane(); backgroundPane = new BackgroundPane();
backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"), 280, 20, backgroundPane); backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"), 280, 24, backgroundPane);
this.add(backgroundPanel, BorderLayout.CENTER); this.add(backgroundPanel, BorderLayout.CENTER);
outerToggleButton.addChangeListener(outerToggleButtonChangeListener); outerToggleButton.addChangeListener(outerToggleButtonChangeListener);

BIN
designer_base/src/com/fr/design/images/data/source/hoverDown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

BIN
designer_base/src/com/fr/design/images/data/source/hoverDown20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

BIN
designer_base/src/com/fr/design/images/data/source/hoverDown@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
designer_base/src/com/fr/design/images/data/source/hoverUp20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

BIN
designer_base/src/com/fr/design/images/data/source/normalDown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
designer_base/src/com/fr/design/images/data/source/normalDown20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

BIN
designer_base/src/com/fr/design/images/data/source/normalDown@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

BIN
designer_base/src/com/fr/design/images/data/source/normalUp20.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

BIN
designer_base/src/com/fr/design/images/data/source/scaleDown.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

BIN
designer_base/src/com/fr/design/images/data/source/scaleUp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

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

@ -2092,17 +2092,15 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML
FR-Designer_Datasource_Other_Attributes=Other_Attributes 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_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing
FR-Designer_CellElement_Property_Table=CellElement_Property_Table 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_T_Insert_Float=Insert_Float
FR-Designer_Add_FloatElement=Add_FloatElement FR-Designer_Add_FloatElement=Add_FloatElement
FR-Designer_Insert_Image=Insert_Image 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_Formula=Insert_Formula
FR-Designer_Scale_Down=Scale_Down
FR-Designer_Insert_Chart= FR-Designer_Scale_Up=Scale_Up
FR-Designer_Insert_Text= FR-Designer_Scale_Slider=Scale_Slider
FR-Designer_Double= FR-Designer_Scale_Grade=Scale_Grade
FR-Designer_Insert_Chart=Insert_Chart
FR-Designer_Insert_Text=Insert_Text
FR-Designer_Double=Double
FR-Designer_Add_Event=Add Event FR-Designer_Add_Event=Add Event

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

@ -2093,17 +2093,15 @@ FR-Designer_CellWrite_Show_As_HTML=CellWrite_Show_As_HTML
FR-Designer_Datasource_Other_Attributes=Other_Attributes 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_Not_use_a_cell_attribute_table_editing=Not_use_a_cell_attribute_table_editing
FR-Designer_CellElement_Property_Table=CellElement_Property_Table 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_T_Insert_Float=Insert_Float
FR-Designer_Add_FloatElement=Add_FloatElement FR-Designer_Add_FloatElement=Add_FloatElement
FR-Designer_Insert_Image=Insert_Image FR-Designer_Insert_Image=Insert_Image
FR-Designer_Insert_Chart=Insert-Chart FR-Designer_Insert_Chart=Insert-Chart
FR-Designer_Insert_Text=Insert-Text FR-Designer_Insert_Text=Insert-Text
FR-Designer_Insert_Formula=Insert_Formula FR-Designer_Insert_Formula=Insert_Formula
FR-Designer_Double=Double
FR-Designer_Insert-Chart= FR-Designer_Scale_Down=Scale_Down
FR-Designer_Insert-Text= FR-Designer_Scale_Up=Scale_Up
FR-Designer_Double= FR-Designer_Scale_Slider=Scale_Slider
FR-Designer_Scale_Grade=Scale_Grade
FR-Designer_Add_Event=Add Event FR-Designer_Add_Event=Add Event

9
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 Every=\u6BCE
CellWrite-Preview_Cell_Content=\u30BB\u30EB\u5185\u5BB9 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
FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9
FR-Designer_Permissions=\u6A29\u9650 FR-Designer_Permissions=\u6A29\u9650
FR-Designer_Form_Button=\u30DC\u30BF\u30F3 FR-Designer_Form_Button=\u30DC\u30BF\u30F3
FR-Designer_WF_Name=\u540D FR-Designer_WF_Name=\u540D
@ -2074,13 +2075,15 @@ FR-Designer_CellWrite_Show_As_HTML=
FR-Designer_Datasource_Other_Attributes= FR-Designer_Datasource_Other_Attributes=
FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_Not_use_a_cell_attribute_table_editing=
FR-Designer_CellElement_Property_Table= FR-Designer_CellElement_Property_Table=
FR-Designer_Add_Condition=
FR-Designer_T_Insert_Float= FR-Designer_T_Insert_Float=
FR-Designer_Add_FloatElement= FR-Designer_Add_FloatElement=
FR-Designer_Insert_Image= FR-Designer_Insert_Image=
FR-Designer_Insert_Chart= FR-Designer_Insert_Chart=
FR-Designer_Insert_Text= FR-Designer_Insert_Text=
FR-Designer_Scale_Down=
FR-Designer_Scale_Up=
FR-Designer_Scale_Slider=
FR-Designer_Scale_Grade=
FR-Designer_AlphaFine_Enable= FR-Designer_AlphaFine_Enable=
FR-Designer_AlphaFine_EnableAlphaFine= FR-Designer_AlphaFine_EnableAlphaFine=
FR-Designer_AlphaFine_EnableInternet= FR-Designer_AlphaFine_EnableInternet=
@ -2104,7 +2107,5 @@ FR-Designer_Write_Enhance_Preview=
FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template= FR-Designer_Use_Params_Template=
FR-Designer_Label_Name= FR-Designer_Label_Name=
FR-Designer_Insert-Chart=
FR-Designer_Insert-Text=
FR-Designer_Insert_Formula= FR-Designer_Insert_Formula=
FR-Designer_Add_Event= FR-Designer_Add_Event=

10
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-Plugin_Plugin=\uD50C\uB7EC\uADF8\uC778
FR-Designer_Background=\uBC30\uACBD FR-Designer_Background=\uBC30\uACBD
Template=\uD15C\uD50C\uB9BF Template=\uD15C\uD50C\uB9BF
FR-Designer_Double=\uC18C\uC218
FR-Designer_Original_Marked_Filed=\uCD08\uAE30\uD0DC\uADF8\uD544\uB4DC 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_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 FR-Designer_Tree_Data_Field=\uD2B8\uB9AC\uB370\uC774\uD130\uD544\uB4DC
@ -2073,14 +2073,16 @@ FR-Designer_CellWrite_Show_As_HTML=
FR-Designer_Datasource_Other_Attributes= FR-Designer_Datasource_Other_Attributes=
FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_Not_use_a_cell_attribute_table_editing=
FR-Designer_CellElement_Property_Table= FR-Designer_CellElement_Property_Table=
FR-Designer_Add_Condition=
FR-Designer_T_Insert_Float= FR-Designer_T_Insert_Float=
FR-Designer_Add_FloatElement= FR-Designer_Add_FloatElement=
FR-Designer_Insert_Image= FR-Designer_Insert_Image=
FR-Designer_Insert_Chart= FR-Designer_Insert_Chart=
FR-Designer_Insert_Text= FR-Designer_Insert_Text=
FR-Designer_Insert_Formula= FR-Designer_Insert_Formula=
FR-Designer_Scale_Down=
FR-Designer_Scale_Up=
FR-Designer_Scale_Slider=
FR-Designer_Scale_Grade=
FR-Designer_AlphaFine_Enable= FR-Designer_AlphaFine_Enable=
FR-Designer_AlphaFine_EnableAlphaFine= FR-Designer_AlphaFine_EnableAlphaFine=
FR-Designer_AlphaFine_EnableInternet= FR-Designer_AlphaFine_EnableInternet=
@ -2105,6 +2107,4 @@ FR-Designer_Scale_customButton=
FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template= FR-Designer_Use_Params_Template=
FR-Designer_Label_Name= FR-Designer_Label_Name=
FR-Designer_Insert-Chart=
FR-Designer_Insert-Text=
FR-Designer_Add_Event= FR-Designer_Add_Event=

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

@ -2102,3 +2102,12 @@ FR-Designer_Insert_Chart=\u63D2\u5165\u56FE\u8868
FR-Designer_Insert_Text=\u63D2\u5165\u666E\u901A\u6587\u672C FR-Designer_Insert_Text=\u63D2\u5165\u666E\u901A\u6587\u672C
FR-Designer_Insert_Formula=\u63D2\u5165\u516C\u5F0F FR-Designer_Insert_Formula=\u63D2\u5165\u516C\u5F0F
FR-Designer_Add_Event=\u6DFB\u52A0\u4E8B\u4EF6 FR-Designer_Add_Event=\u6DFB\u52A0\u4E8B\u4EF6
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
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

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

@ -2092,19 +2092,19 @@ FR-Designer_CellWrite_Show_As_HTML=
FR-Designer_Datasource_Other_Attributes= FR-Designer_Datasource_Other_Attributes=
FR-Designer_Not_use_a_cell_attribute_table_editing= FR-Designer_Not_use_a_cell_attribute_table_editing=
FR-Designer_CellElement_Property_Table= FR-Designer_CellElement_Property_Table=
FR-Designer_Add_Condition=
FR-Designer_T_Insert_Float= FR-Designer_T_Insert_Float=
FR-Designer_Add_FloatElement= FR-Designer_Add_FloatElement=
FR-Designer_Insert_Image= FR-Designer_Insert_Image=
FR-Designer_Insert_Chart= FR-Designer_Insert_Chart=
FR-Designer_Insert_Text= FR-Designer_Insert_Text=
FR-Designer_Insert_Formula= FR-Designer_Insert_Formula=
FR-Designer_Scale_Down=
FR-Designer_Scale_Up=
FR-Designer_Scale_Slider=
FR-Designer_Scale_Grade=
FR-Designer_AlphaFine_EnableInternet= FR-Designer_AlphaFine_EnableInternet=
FR-Designer_Scale_EnlargeOrReduce= FR-Designer_Scale_EnlargeOrReduce=
FR-Designer-StyleAlignment_Style_PartSpacing= FR-Designer-StyleAlignment_Style_PartSpacing=
FR-Designer_Use_Params_Template= FR-Designer_Use_Params_Template=
FR-Designer_Label_Name= FR-Designer_Label_Name=
FR-Designer_Insert-Chart=
FR-Designer_Insert-Text=
FR-Designer_Add_Event= FR-Designer_Add_Event=

86
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 = 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(); } 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();
}

50
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.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void populate() { authorityEditPane.populateDetials(); } } 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();
}
}

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

@ -54,7 +54,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
POLY, // 聚合报表 POLY, // 聚合报表
POLY_REPORT, // 聚合报表-报表块 POLY_REPORT, // 聚合报表-报表块
POLY_CHART, // 聚合报表-图表块 POLY_CHART, // 聚合报表-图表块
AUTHORITY_EDITION // 权限编辑 AUTHORITY_EDITION, // 权限编辑
AUTHORITY_EDITION_DISABLED // 权限编辑
} }
private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板) private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板)
@ -115,11 +116,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
new PropertyMode[]{PropertyMode.FORM}); new PropertyMode[]{PropertyMode.FORM});
// 权限编辑 // 权限编辑
PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, Inter.getLocText("FR-Designer_Permissions_Edition"), 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}); new PropertyMode[]{PropertyMode.AUTHORITY_EDITION});
// 已配置角色 // 已配置角色
PropertyItem configuredRoles = new PropertyItem(KEY_CONFIGURED_ROLES, Inter.getLocText("FR-Designer_Configured_Roles"), 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}); new PropertyMode[]{PropertyMode.AUTHORITY_EDITION});
propertyItemMap.put(KEY_CELL_ELEMENT, cellElement); propertyItemMap.put(KEY_CELL_ELEMENT, cellElement);

188
designer_base/src/com/fr/design/mainframe/JFormSliderPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -13,14 +14,10 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.MatteBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
@ -32,7 +29,7 @@ public class JFormSliderPane extends JPanel {
private static final int SIX = 6; private static final int SIX = 6;
private static final int TEN = 10; private static final int TEN = 10;
private static final int ONE_EIGHT = 18; 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_WIDTH = 45;
private static final int SPINNER_HEIGHT = 20; private static final int SPINNER_HEIGHT = 20;
private static final int HALF_HUNDRED = 50; private static final int HALF_HUNDRED = 50;
@ -40,10 +37,15 @@ public class JFormSliderPane extends JPanel {
private static final int TWO_HUNDRED = 200; private static final int TWO_HUNDRED = 200;
private static final int THREE_HUNDRED = 300; private static final int THREE_HUNDRED = 300;
private static final int FOUR_HUNDRED = 400; private static final int FOUR_HUNDRED = 400;
private static final int DIALOG_WIDTH = 150; private static final int DIALOG_WIDTH = 157;
private static final int DIALOG_HEIGHT = 220; private static final int DIALOG_HEIGHT = 172;
private static final int SHOWVALBUTTON_WIDTH = 70; private static final int SLIDER_WIDTH = 220;
private static final int SHOWVALBUTTON_HEIGHTH = 25; 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 int TOOLTIP_Y = 25;
private static final Color BACK_COLOR = new Color(245, 245, 247);
public int showValue = 100; public int showValue = 100;
public double resolutionTimes = 1.0; public double resolutionTimes = 1.0;
private static JFormSliderPane THIS; private static JFormSliderPane THIS;
@ -54,7 +56,7 @@ public class JFormSliderPane extends JPanel {
private int sliderValue; private int sliderValue;
private UIButton downButton; private UIButton downButton;
private UIButton upButton; private UIButton upButton;
private UIButton showValButton; private JButton showValButton;
private UIRadioButton twoHundredButton; private UIRadioButton twoHundredButton;
private UIRadioButton oneHundredButton; private UIRadioButton oneHundredButton;
private UIRadioButton SevenFiveButton; private UIRadioButton SevenFiveButton;
@ -71,61 +73,102 @@ public class JFormSliderPane extends JPanel {
public JFormSliderPane() { public JFormSliderPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
slider = new UISlider(0, HUNDRED, HALF_HUNDRED); initSlider();
slider.setUI(new JSliderPaneUI(slider)); initShowValSpinner();
slider.addChangeListener(listener); initDownUpButton();
initShowValButton();
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.setActionCommand("less");
upButton.setActionCommand("more");
downButton.addActionListener(buttonActionListener);
upButton.addActionListener(buttonActionListener);
showValButton = new UIButton(showValSpinner.getValue() + "%");
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
showValButton.addActionListener(showValButtonActionListener);
initUIRadioButton(); initUIRadioButton();
initPane(); initPane();
JPanel panel = new JPanel(new FlowLayout(1, 1, 0)); JPanel panel = new JPanel(new FlowLayout(1, 5, 0));
panel.add(downButton); panel.add(downButton);
panel.add(slider); panel.add(slider);
panel.add(upButton); panel.add(upButton);
panel.add(showValButton); panel.add(showValButton);
panel.setBackground(BACK_COLOR);
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT);
} }
public static final JFormSliderPane getInstance() { public static final JFormSliderPane getInstance() {
// if (THIS == null) { // if (THIS == null) {
// THIS = new JFormSliderPane(); // THIS = new JSliderPane();
// } // }
THIS = new JFormSliderPane(); THIS = new JFormSliderPane();
return THIS; 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"));
}
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));
}
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")){
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"));
downButton.setActionCommand("less");
upButton.setActionCommand("more");
downButton.addActionListener(buttonActionListener);
upButton.addActionListener(buttonActionListener);
}
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));
showValButton.setBackground(BACK_COLOR);
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
showValButton.addActionListener(showValButtonActionListener);
showValButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Grade"));
}
private void initUIRadioButton() { private void initUIRadioButton() {
twoHundredButton = new UIRadioButton("200%"); twoHundredButton = new UIRadioButton("200%");
oneHundredButton = new UIRadioButton("100%"); oneHundredButton = new UIRadioButton("100%");
SevenFiveButton = new UIRadioButton("75%"); SevenFiveButton = new UIRadioButton("75%");
fiveTenButton = new UIRadioButton("50%"); fiveTenButton = new UIRadioButton("50%");
twoFiveButton = new UIRadioButton("25%"); 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 = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton"));
customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE));
twoHundredButton.addItemListener(radioButtonItemListener); twoHundredButton.addItemListener(radioButtonItemListener);
oneHundredButton.addItemListener(radioButtonItemListener); oneHundredButton.addItemListener(radioButtonItemListener);
SevenFiveButton.addItemListener(radioButtonItemListener); SevenFiveButton.addItemListener(radioButtonItemListener);
@ -140,7 +183,7 @@ public class JFormSliderPane extends JPanel {
bg.add(SevenFiveButton); bg.add(SevenFiveButton);
bg.add(fiveTenButton); bg.add(fiveTenButton);
bg.add(twoFiveButton); bg.add(twoFiveButton);
// bg.add(selfAdaptButton); bg.add(selfAdaptButton);
bg.add(customButton); bg.add(customButton);
customButton.setSelected(true); customButton.setSelected(true);
} }
@ -149,25 +192,44 @@ public class JFormSliderPane extends JPanel {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; 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[][]{ Component[][] components = new Component[][]{
new Component[]{upLabel, null},
new Component[]{septPane, null},
new Component[]{twoHundredButton, null}, new Component[]{twoHundredButton, null},
new Component[]{oneHundredButton, null}, new Component[]{oneHundredButton, null},
new Component[]{SevenFiveButton, null}, new Component[]{SevenFiveButton, null},
new Component[]{fiveTenButton, null}, new Component[]{fiveTenButton, null},
new Component[]{twoFiveButton, null}, new Component[]{twoFiveButton, null},
// new Component[]{selfAdaptButton,null},
new Component[]{customButton, createSpinnerPanel()} 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() { private JPanel createSpinnerPanel() {
JPanel spinnerPanel = new JPanel(new FlowLayout()); JPanel spinnerPanel = new JPanel(new FlowLayout());
spinnerPanel.add(showValSpinner); spinnerPanel.add(showValSpinner);
UILabel percent = new UILabel("%"); 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.add(percent);
spinnerPanel.setBackground(BACK_COLOR);
return spinnerPanel; return spinnerPanel;
} }
@ -314,14 +376,14 @@ public class JFormSliderPane extends JPanel {
dialog = new FormPopupPane(upButton, dialogContentPanel); dialog = new FormPopupPane(upButton, dialogContentPanel);
if (upButtonX == 0) { if (upButtonX == 0) {
upButtonX = btnCoords.x; 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 { } else {
if (upButtonX == 0) { if (upButtonX == 0) {
upButtonX = btnCoords.x; 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 { } 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 +403,13 @@ public class JFormSliderPane extends JPanel {
class FormPopupPane extends JPopupMenu { class FormPopupPane extends JPopupMenu {
private JComponent contentPane; private static final int DIALOG_WIDTH = 157;
private static final int UPLABEL_HEIGHT = 25; private static final int DIALOG_HEIGHT = 172;
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;
FormPopupPane(UIButton b, JPanel dialogContentPanel) { FormPopupPane(UIButton b, JPanel dialogContentPanel) {
contentPane = new JPanel(new BorderLayout()); this.add(dialogContentPanel, BorderLayout.CENTER);
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.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT));
this.setOpaque(false); this.setBackground(new Color(245, 245, 247));
} }

226
designer_base/src/com/fr/design/mainframe/JSliderPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -13,15 +14,11 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.MatteBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.plaf.basic.BasicSliderUI; import javax.swing.plaf.basic.BasicSliderUI;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
@ -33,7 +30,7 @@ public class JSliderPane extends JPanel {
private static final int SIX = 6; private static final int SIX = 6;
private static final int TEN = 10; private static final int TEN = 10;
private static final int ONE_EIGHT = 18; 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_WIDTH = 45;
private static final int SPINNER_HEIGHT = 20; private static final int SPINNER_HEIGHT = 20;
private static final int HALF_HUNDRED = 50; private static final int HALF_HUNDRED = 50;
@ -41,10 +38,16 @@ public class JSliderPane extends JPanel {
private static final int TWO_HUNDRED = 200; private static final int TWO_HUNDRED = 200;
private static final int THREE_HUNDRED = 300; private static final int THREE_HUNDRED = 300;
private static final int FOUR_HUNDRED = 400; private static final int FOUR_HUNDRED = 400;
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 DIALOG_HEIGHT = 192;
private static final int SHOWVALBUTTON_WIDTH = 70; private static final int SLIDER_WIDTH = 220;
private static final int SHOWVALBUTTON_HEIGHTH = 25; 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 int TOOLTIP_Y = 25;
private static final Color BACK_COLOR = new Color(245, 245, 247);
public int showValue = 100; public int showValue = 100;
public double resolutionTimes = 1.0; public double resolutionTimes = 1.0;
private static JSliderPane THIS; private static JSliderPane THIS;
@ -55,7 +58,7 @@ public class JSliderPane extends JPanel {
private int sliderValue; private int sliderValue;
private UIButton downButton; private UIButton downButton;
private UIButton upButton; private UIButton upButton;
private UIButton showValButton; private JButton showValButton;
private UIRadioButton twoHundredButton; private UIRadioButton twoHundredButton;
private UIRadioButton oneHundredButton; private UIRadioButton oneHundredButton;
private UIRadioButton SevenFiveButton; private UIRadioButton SevenFiveButton;
@ -72,44 +75,23 @@ public class JSliderPane extends JPanel {
public JSliderPane() { public JSliderPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
slider = new UISlider(0, HUNDRED, HALF_HUNDRED); initSlider();
slider.setUI(new JSliderPaneUI(slider)); initShowValSpinner();
slider.addChangeListener(listener); initDownUpButton();
initShowValButton();
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.setActionCommand("less");
upButton.setActionCommand("more");
downButton.addActionListener(buttonActionListener);
upButton.addActionListener(buttonActionListener);
showValButton = new UIButton(showValSpinner.getValue() + "%");
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
showValButton.addActionListener(showValButtonActionListener);
initUIRadioButton(); initUIRadioButton();
initPane(); initPane();
JPanel panel = new JPanel(new FlowLayout(1, 1, 0)); JPanel panel = new JPanel(new FlowLayout(1, 5, 0));
panel.add(downButton); panel.add(downButton);
panel.add(slider); panel.add(slider);
panel.add(upButton); panel.add(upButton);
panel.add(showValButton); panel.add(showValButton);
panel.setBackground(BACK_COLOR);
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
this.setBounds(0, 0, THREE_HUNDRED, ONE_EIGHT);
} }
public static final JSliderPane getInstance() { public static final JSliderPane getInstance() {
// if (THIS == null) { // if (THIS == null) {
// THIS = new JSliderPane(); // THIS = new JSliderPane();
@ -118,6 +100,70 @@ public class JSliderPane extends JPanel {
return THIS; 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"));
}
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));
}
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")){
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"));
downButton.setActionCommand("less");
upButton.setActionCommand("more");
downButton.addActionListener(buttonActionListener);
upButton.addActionListener(buttonActionListener);
}
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));
showValButton.setBackground(BACK_COLOR);
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
showValButton.addActionListener(showValButtonActionListener);
showValButton.setToolTipText(Inter.getLocText("FR-Designer_Scale_Grade"));
}
private void initUIRadioButton() { private void initUIRadioButton() {
twoHundredButton = new UIRadioButton("200%"); twoHundredButton = new UIRadioButton("200%");
oneHundredButton = new UIRadioButton("100%"); oneHundredButton = new UIRadioButton("100%");
@ -125,7 +171,9 @@ public class JSliderPane extends JPanel {
fiveTenButton = new UIRadioButton("50%"); fiveTenButton = new UIRadioButton("50%");
twoFiveButton = new UIRadioButton("25%"); 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 = new UIRadioButton(Inter.getLocText("FR-Designer_Scale_customButton"));
customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE));
twoHundredButton.addItemListener(radioButtonItemListener); twoHundredButton.addItemListener(radioButtonItemListener);
oneHundredButton.addItemListener(radioButtonItemListener); oneHundredButton.addItemListener(radioButtonItemListener);
SevenFiveButton.addItemListener(radioButtonItemListener); SevenFiveButton.addItemListener(radioButtonItemListener);
@ -149,8 +197,25 @@ public class JSliderPane extends JPanel {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; 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, 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[][]{ Component[][] components = new Component[][]{
new Component[]{upLabel, null},
new Component[]{septPane, null},
new Component[]{twoHundredButton, null}, new Component[]{twoHundredButton, null},
new Component[]{oneHundredButton, null}, new Component[]{oneHundredButton, null},
new Component[]{SevenFiveButton, null}, new Component[]{SevenFiveButton, null},
@ -159,15 +224,18 @@ public class JSliderPane extends JPanel {
new Component[]{selfAdaptButton, null}, new Component[]{selfAdaptButton, null},
new Component[]{customButton, createSpinnerPanel()} 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() { private JPanel createSpinnerPanel() {
JPanel spinnerPanel = new JPanel(new FlowLayout()); JPanel spinnerPanel = new JPanel(new FlowLayout());
spinnerPanel.add(showValSpinner); spinnerPanel.add(showValSpinner);
UILabel percent = new UILabel("%"); 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.add(percent);
spinnerPanel.setBackground(BACK_COLOR);
return spinnerPanel; return spinnerPanel;
} }
@ -314,14 +382,14 @@ public class JSliderPane extends JPanel {
dialog = new PopupPane(upButton, dialogContentPanel); dialog = new PopupPane(upButton, dialogContentPanel);
if (upButtonX == 0) { if (upButtonX == 0) {
upButtonX = btnCoords.x; 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 { } else {
if (upButtonX == 0) { if (upButtonX == 0) {
upButtonX = btnCoords.x; 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 { } 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 +409,7 @@ public class JSliderPane extends JPanel {
class JSliderPaneUI extends BasicSliderUI { 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_WIDTH = 11;
private static final int VERTICAL_HEIGHT = 16; private static final int VERTICAL_HEIGHT = 16;
private static final int FOUR = 4; private static final int FOUR = 4;
@ -356,33 +425,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) { public void paintThumb(Graphics g) {
Rectangle knobBounds = thumbRect; Rectangle knobBounds = thumbRect;
int w = knobBounds.width; int w = knobBounds.width;
int h = knobBounds.height; int h = knobBounds.height;
Graphics2D g2d = (Graphics2D) g;
g.translate(knobBounds.x, knobBounds.y);
if (slider.isEnabled()) { g2d.translate(knobBounds.x, knobBounds.y);
g.setColor(slider.getBackground()); // g2d.setColor(slider.getBackground());
} else { // g2d.fillRect(0, FOUR, FOUR, 9);
g.setColor(slider.getBackground().darker()); g2d.setColor(new Color(51, 51, 52));
} g2d.drawRoundRect(0, SIX, FOUR, 9, 2, 2);
g.setColor(Color.darkGray); g2d.fillRoundRect(0, SIX, FOUR, 9, 2, 2);
g.fillRect(0, 1, w - SIX, h + 1);
} }
/** */ /** */
@ -396,8 +450,10 @@ class JSliderPaneUI extends BasicSliderUI {
Graphics2D g2 = (Graphics2D) g; Graphics2D g2 = (Graphics2D) g;
cy = (trackBounds.height / 2); cy = (trackBounds.height / 2);
cw = trackBounds.width; cw = trackBounds.width;
g.setColor(Color.lightGray); g2.setPaint(BACK_COLOR);
g.drawLine(0, cy, cw + FIVE, cy); 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); g.drawLine(FIVE + cw / 2, cy - FOUR, FIVE + cw / 2, cy + FOUR);
} else { } else {
super.paintTrack(g); super.paintTrack(g);
@ -407,29 +463,13 @@ class JSliderPaneUI extends BasicSliderUI {
} }
class PopupPane extends JPopupMenu { class PopupPane extends JPopupMenu {
private JComponent contentPane; private static final int DIALOG_WIDTH = 157;
private static final int UPLABEL_HEIGHT = 25; private static final int DIALOG_HEIGHT = 192;
private static final int DIALOG_WIDTH = 150;
private static final int DIALOG_HEIGHT = 240; PopupPane(JButton b, JPanel dialogContentPanel) {
private static final int UPLABEL_WIDTH = 300; this.add(dialogContentPanel, BorderLayout.CENTER);
private JComponent centerPane;
private UILabel upLabel;
PopupPane(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.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT));
this.setOpaque(false); this.setBackground(new Color(245, 245, 247));
} }

63
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; } } 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;
}
}

186
designer_base/src/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java

File diff suppressed because one or more lines are too long

74
designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java

@ -34,8 +34,8 @@ import com.fr.general.Inter;
public class FormWidgetAuthorityEditPane extends AuthorityEditPane { public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
private FormDesigner designer; private FormDesigner designer;
private Widget[] widgets = null; private Widget[] widgets = null;
private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Visible"));
private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Enabled")); private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Enabled"));
private ItemListener visibleItemListener = new ItemListener() { private ItemListener visibleItemListener = new ItemListener() {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); 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() { 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() { public void populateName() {
String nameText = ""; String nameText = "";
if (widgets == null || widgets.length <= 0) { if (widgets == null || widgets.length <= 0) {
@ -117,29 +113,27 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
} }
/** /**
* 更新checkbox所在的面板 * 更新checkbox所在的面板
* *
* @return 面板 * @return 面板
* * @date 2014-12-21-下午6:19:03
* */
* @date 2014-12-21-下午6:19:03
*
*/
public JPanel populateCheckPane() { public JPanel populateCheckPane() {
checkPane.add(populateWidgetCheckPane(), BorderLayout.WEST); checkPane.add(populateWidgetCheckPane(), BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
return checkPane; return checkPane;
} }
private JPanel populateWidgetCheckPane() { private JPanel populateWidgetCheckPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ 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[] rowSize = {p, p};
double[] columnSize = {p, p, f}; double[] columnSize = {p};
int[][] rowCount = {{1, 1, 1}}; int[][] rowCount = {{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_SMALL);
} }
@ -157,7 +151,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
populateName(); populateName();
checkPane.removeAll(); checkPane.removeAll();
populateCheckPane(); populateCheckPane();
checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
checkCheckBoxes(); checkCheckBoxes();
} }
@ -170,24 +164,24 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane {
widgetAvailable.addItemListener(usableItemListener); widgetAvailable.addItemListener(usableItemListener);
} }
private void populateWidgetButton(String selected){ private void populateWidgetButton(String selected) {
if (widgets == null || widgets.length == 0) { if (widgets == null || widgets.length == 0) {
return; return;
} }
//选中多个, 界面上只取第一个 //选中多个, 界面上只取第一个
Widget widget = widgets[0]; Widget widget = widgets[0];
if(widget.isVisible()){ if (widget.isVisible()) {
widgetVisible.setSelected(!widget.isDoneVisibleAuthority(selected)); widgetVisible.setSelected(!widget.isDoneVisibleAuthority(selected));
}else{ } else {
widgetVisible.setSelected(widget.isVisibleAuthority(selected)); widgetVisible.setSelected(widget.isVisibleAuthority(selected));
} }
if(widget.isEnabled()){ if (widget.isEnabled()) {
widgetAvailable.setSelected(!widget.isDoneUsableAuthority(selected)); widgetAvailable.setSelected(!widget.isDoneUsableAuthority(selected));
}else{ } else {
widgetAvailable.setSelected(widget.isUsableAuthority(selected)); widgetAvailable.setSelected(widget.isUsableAuthority(selected));
} }
} }

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

@ -475,7 +475,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
paraHeight = 0; paraHeight = 0;
paraComponent = null; paraComponent = null;
formLayoutContainer.setSize(rootComponent.getWidth(), rootComponent.getHeight()); formLayoutContainer.setSize(rootComponent.getWidth(), rootComponent.getHeight());
EastRegionContainerPane.getInstance().replaceDownPane(this.getEastDownPane()); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(this.getEastDownPane());
//atat //atat
//EastRegionContainerPane.getInstance().addTitlePane(ParameterPropertyPane.getInstance(FormDesigner.this)); //EastRegionContainerPane.getInstance().addTitlePane(ParameterPropertyPane.getInstance(FormDesigner.this));
//删除后重绘下 //删除后重绘下
@ -1042,11 +1042,13 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
if (isSupportAuthority()) { if (isSupportAuthority()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(this); AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(this);
authorityPropertyPane.populate(); authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
} else { } 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<Form> implements TreeSelection
pane.setLayout(new BorderLayout()); pane.setLayout(new BorderLayout());
pane.add(FormWidgetDetailPane.getInstance(FormDesigner.this), BorderLayout.CENTER); pane.add(FormWidgetDetailPane.getInstance(FormDesigner.this), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceDownPane(pane); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(pane);
} }
}.start(); }.start();
} else { } else {
pane.setLayout(new BorderLayout()); pane.setLayout(new BorderLayout());
pane.add(FormWidgetDetailPane.getInstance(this), BorderLayout.CENTER); pane.add(FormWidgetDetailPane.getInstance(this), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceDownPane(pane); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(pane);
} }
return pane; return pane;

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

@ -654,11 +654,13 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
WidgetToolBarPane.getInstance(formDesign); WidgetToolBarPane.getInstance(formDesign);
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
if (formDesign.isSupportAuthority()) { if (formDesign.isSupportAuthority()) {
EastRegionContainerPane.getInstance().replaceUpPane(new AuthorityPropertyPane(this)); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new AuthorityPropertyPane(this));
} else { } 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; return;
} }

Loading…
Cancel
Save