Browse Source

Merge remote-tracking branch 'origin/release/9.0' into release/9.0

master
mengao 7 years ago
parent
commit
d62cccece7
  1. 4
      designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java
  2. 62
      designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java
  3. 28
      designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java
  4. 1
      designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java
  5. 29
      designer/src/com/fr/design/actions/edit/HyperlinkAction.java
  6. 2
      designer/src/com/fr/design/cell/editor/AbstractCellEditor.java
  7. 1
      designer/src/com/fr/design/mainframe/CellElementPropertyPane.java
  8. 6
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  9. 19
      designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java
  10. 20
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  11. 54
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  12. 62
      designer/src/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java
  13. 3
      designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  14. 1
      designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  15. 4
      designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java
  16. 4
      designer/src/com/fr/design/present/PresentPane.java
  17. 8
      designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java
  18. 32
      designer/src/com/fr/design/report/mobile/MobileUseHtmlGroupPane.java
  19. 6
      designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java
  20. 26
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  21. 1
      designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java
  22. 2
      designer/src/com/fr/design/widget/ui/ButtonDefinePane.java
  23. 6
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  24. 12
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  25. 6
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  26. 8
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  27. 4
      designer/src/com/fr/grid/GridMouseAdapter.java
  28. 5
      designer/src/com/fr/grid/selection/CellSelection.java
  29. 7
      designer/src/com/fr/grid/selection/FloatSelection.java
  30. 5
      designer/src/com/fr/poly/creator/ECBlockPane.java
  31. 9
      designer_base/src/com/fr/design/constants/UIConstants.java
  32. 112
      designer_base/src/com/fr/design/dialog/mobile/MobileUseHtmlGroupBeanPane.java
  33. 2
      designer_base/src/com/fr/design/extra/PluginOperateUtils.java
  34. 8
      designer_base/src/com/fr/design/extra/PluginUtils.java
  35. 19
      designer_base/src/com/fr/design/extra/WebViewDlgHelper.java
  36. 39
      designer_base/src/com/fr/design/foldablepane/HeaderPane.java
  37. 60
      designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java
  38. 288
      designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java
  39. 15
      designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java
  40. 47
      designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java
  41. 14
      designer_base/src/com/fr/design/gui/itextfield/UITextField.java
  42. 2
      designer_base/src/com/fr/design/gui/style/AlignmentPane.java
  43. 1
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  44. 33
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  45. 4
      designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java
  46. 7
      designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java
  47. 372
      designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java
  48. 1
      designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java
  49. 14
      designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java
  50. 33
      designer_form/src/com/fr/design/form/mobile/MobileUseHtmlGroupPane.java
  51. 2
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  52. 4
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  53. 31
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  54. 7
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  55. 2
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java
  56. 10
      designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  57. 6
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  58. 6
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  59. 7
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  60. 1
      designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java
  61. 34
      designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  62. 6
      designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java
  63. 6
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  64. 6
      designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java
  65. 6
      designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java
  66. 2
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java
  67. 1
      designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java

4
designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java

@ -1,10 +1,10 @@
package com.fr.design.actions.cell; package com.fr.design.actions.cell;
import java.awt.event.ActionEvent;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.CellElementPropertyPane;
import java.awt.event.ActionEvent;
/** /**
* 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表 * 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表
* *

62
designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java

@ -1,24 +1,18 @@
package com.fr.design.actions.cell; package com.fr.design.actions.cell;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.dialog.BasicPane; import java.awt.event.ActionEvent;
import com.fr.form.ui.Widget;
import com.fr.general.FRLogger;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.TemplateCellElement;
/** /**
* Cell Widget Attribute. * Cell Widget Attribute.
*/ */
public class CellWidgetAttrAction extends AbstractCellElementAction { public class CellWidgetAttrAction extends UpdateAction {
public CellWidgetAttrAction(ElementCasePane t) { public CellWidgetAttrAction() {
super(t);
this.setMenuKeySet(KeySetUtils.CELL_WIDGET_ATTR); this.setMenuKeySet(KeySetUtils.CELL_WIDGET_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName()); this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
@ -26,47 +20,7 @@ public class CellWidgetAttrAction extends AbstractCellElementAction {
} }
@Override @Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) { public void actionPerformed(ActionEvent e) {
CellWriteAttrPane pane = new CellWriteAttrPane(this.getEditingComponent()); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
//got simple cell element from column and row.
pane.populate(cellElement);
return pane;
}
@Override
protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) {
CellWriteAttrPane pane = (CellWriteAttrPane) bp;
if (cellElement.getWidget() == null) {
pane.update(cellElement);
return;
}
try {
Widget oldWidget = (Widget) cellElement.getWidget().clone();
pane.update(cellElement);
//这边需要重新设置权限细粒度的hashset是因为Update是直接生成一个新的来update的,所以以前里面的hashset都没有了
Widget newWidget = cellElement.getWidget();
if (newWidget.getClass() == oldWidget.getClass()) {
newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone());
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
}
@Override
protected boolean isNeedShinkToFit() {
return true;
}
@Override
public void update() {
ElementCasePane ePane = this.getEditingComponent();
Selection sel = ePane.getSelection();
if (sel instanceof CellSelection) {
this.setEnabled(true);
} else {
this.setEnabled(false);
}
} }
} }

28
designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java

@ -0,0 +1,28 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.menu.KeySetUtils;
import java.awt.event.ActionEvent;
/**
* Condition Attributes.
*/
public class ConditionAttributesAction extends UpdateAction {
public ConditionAttributesAction() {
this.setMenuKeySet(KeySetUtils.CONDITION_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/highlight.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CONDITION_ATTR);
}
}

1
designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java

@ -186,6 +186,7 @@ public class GlobalStyleMenuDef extends MenuDef {
} }
stylePane.updateGlobalStyle(getEditingComponent()); stylePane.updateGlobalStyle(getEditingComponent());
CellElementPropertyPane.getInstance().GoToPane(Inter.getLocText("FR-Designer-Widget_Style"));
return true; return true;
} }

29
designer/src/com/fr/design/actions/edit/HyperlinkAction.java

@ -0,0 +1,29 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.menu.KeySetUtils;
import java.awt.event.ActionEvent;
/**
* HyperlinkAction.
*/
public class HyperlinkAction extends UpdateAction {
public HyperlinkAction() {
this.setMenuKeySet(KeySetUtils.HYPER_LINK);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_HYPERLINK);
}
}

2
designer/src/com/fr/design/cell/editor/AbstractCellEditor.java

@ -7,6 +7,7 @@ import java.awt.Point;
import javax.swing.event.EventListenerList; import javax.swing.event.EventListenerList;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.event.CellEditorEvent; import com.fr.grid.event.CellEditorEvent;
import com.fr.grid.event.CellEditorListener; import com.fr.grid.event.CellEditorListener;
@ -114,6 +115,7 @@ public abstract class AbstractCellEditor implements CellEditor {
} }
if(ePane != null) { if(ePane != null) {
ePane.fireSelectionChangeListener(); ePane.fireSelectionChangeListener();
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ELEMENT);
} }
} }

1
designer/src/com/fr/design/mainframe/CellElementPropertyPane.java

@ -176,6 +176,7 @@ public class CellElementPropertyPane extends DockingView {
*/ */
public void GoToPane(String... id) { public void GoToPane(String... id) {
cellElementEditPane.setSelectedIndex(id); cellElementEditPane.setSelectedIndex(id);
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR);
EastRegionContainerPane.getInstance().setWindow2PreferWidth(); EastRegionContainerPane.getInstance().setWindow2PreferWidth();
} }

6
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.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.actions.edit.HyperlinkAction;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
@ -169,12 +170,13 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic()); MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic());
menuDef.addShortCut(new CellExpandAttrAction()); menuDef.addShortCut(new CellExpandAttrAction());
menuDef.addShortCut(new CellWidgetAttrAction(this)); menuDef.addShortCut(new CellWidgetAttrAction());
menuDef.addShortCut(new GlobalStyleMenuDef(this)); menuDef.addShortCut(new GlobalStyleMenuDef(this));
menuDef.addShortCut(new ConditionAttributesAction());
// 单元格形态 // 单元格形态
menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this));
menuDef.addShortCut(new HyperlinkAction());
menuDef.addShortCut(SeparatorDef.DEFAULT); menuDef.addShortCut(SeparatorDef.DEFAULT);
menuDef.addShortCut(new MergeCellAction(this)); menuDef.addShortCut(new MergeCellAction(this));
menuDef.addShortCut(new UnmergeCellAction(this)); menuDef.addShortCut(new UnmergeCellAction(this));

19
designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java

@ -32,35 +32,22 @@ import java.util.List;
* @since 2012-5-8下午12:18:53 * @since 2012-5-8下午12:18:53
*/ */
public class CellElementEditPane extends BasicPane { public class CellElementEditPane extends BasicPane {
private static int TIME_GAP = 80; private static final int LEFT_BORDER = -5;
private static final int RIGHT_BORDER = 5;
private List<AbstractCellAttrPane> paneList; private List<AbstractCellAttrPane> paneList;
private TemplateCellElement cellelement; private TemplateCellElement cellelement;
private ElementCasePane ePane; private ElementCasePane ePane;
private UIHeadGroup tabsHeaderIconPane; private UIHeadGroup tabsHeaderIconPane;
private boolean isEditing; private boolean isEditing;
private int PaneListIndex;
private CardLayout card; private CardLayout card;
private JPanel center; private JPanel center;
private JPanel downTitle; private JPanel downTitle;
private JPanel title;
private UILabel titlename;
private TitleChangeListener titleChangeListener = null; private TitleChangeListener titleChangeListener = null;
private CellAttributeProvider cellAttributeProvider = null; private CellAttributeProvider cellAttributeProvider = null;
public static void main(String[] args){
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(new CellElementEditPane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400);
jf.setVisible(true);
}
public CellElementEditPane() { public CellElementEditPane() {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
initPaneList(); initPaneList();
@ -89,7 +76,7 @@ public class CellElementEditPane extends BasicPane {
downTitle = new JPanel(); downTitle = new JPanel();
downTitle.setLayout(new BorderLayout()); downTitle.setLayout(new BorderLayout());
downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH); downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH);
center.setBorder(BorderFactory.createEmptyBorder(0, -10, 0, -10)); center.setBorder(BorderFactory.createEmptyBorder(0, LEFT_BORDER, 0, RIGHT_BORDER));
downTitle.add(center, BorderLayout.CENTER); downTitle.add(center, BorderLayout.CENTER);
this.add(downTitle, BorderLayout.CENTER); this.add(downTitle, BorderLayout.CENTER);

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe.cell.settingpane;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.expand.ExpandLeftFatherPane; import com.fr.design.expand.ExpandLeftFatherPane;
import com.fr.design.expand.ExpandUpFatherPane; import com.fr.design.expand.ExpandUpFatherPane;
import com.fr.design.expand.SortExpandAttrPane; import com.fr.design.expand.SortExpandAttrPane;
@ -61,18 +62,6 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
return layoutPane(); return layoutPane();
} }
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(new CellExpandAttrPane().layoutPane(), BorderLayout.CENTER);
GUICoreUtils.centerWindow(jf);
jf.setSize(290, 400);
jf.setVisible(true);
}
private void initAllNames() { private void initAllNames() {
expandDirectionButton.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction")); expandDirectionButton.setGlobalName(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"));
leftFatherPane.setGlobalName(Inter.getLocText("FR-Designer_LeftParent")); leftFatherPane.setGlobalName(Inter.getLocText("FR-Designer_LeftParent"));
@ -85,8 +74,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, 24, basicPane()); basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 223, 24, basicPane());
seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 290, 24, seniorPane()); seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 223, 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;
@ -122,6 +111,8 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
UILabel expendSort = new UILabel(Inter.getLocText("FR-Designer_ExpendSort"), SwingConstants.LEFT); UILabel expendSort = new UILabel(Inter.getLocText("FR-Designer_ExpendSort"), SwingConstants.LEFT);
JPanel expendSortPane = new JPanel(new BorderLayout()); JPanel expendSortPane = new JPanel(new BorderLayout());
expendSortPane.add(expendSort, BorderLayout.NORTH); expendSortPane.add(expendSort, BorderLayout.NORTH);
horizontalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
verticalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{horizontalExpandableCheckBox, null}, new Component[]{horizontalExpandableCheckBox, null},
@ -163,6 +154,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
default: { default: {
horizontalExpandableCheckBox.setSelected(false); horizontalExpandableCheckBox.setSelected(false);
verticalExpandableCheckBox.setSelected(false); verticalExpandableCheckBox.setSelected(false);
break;
} }
} }

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

@ -1,6 +1,7 @@
package com.fr.design.mainframe.cell.settingpane; package com.fr.design.mainframe.cell.settingpane;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
@ -9,7 +10,7 @@ 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.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -46,9 +47,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private UIComboBox showContent; private UIComboBox showContent;
private UITextField tooltipTextField; private UIPropertyTextField tooltipTextField;
private UITextField fileNameTextField; private UIPropertyTextField fileNameTextField;
// 分页 // 分页
private UICheckBox pageBeforeRowCheckBox; private UICheckBox pageBeforeRowCheckBox;
@ -88,18 +89,18 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private JPanel basicPane() { private JPanel basicPane() {
autoHeightCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Auto_Adjust_Height")); autoHeightCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Auto_Adjust_Height"));
autoWidthCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Auto_Adjust_Wdith")); autoWidthCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Auto_Adjust_Wdith"));
autoHeightCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
autoWidthCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p};
double[] columnSize = {p}; double[] columnSize = {p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null}, new Component[]{null},
new Component[]{autoHeightCheckBox}, new Component[]{autoHeightCheckBox},
new Component[]{null},
new Component[]{autoWidthCheckBox}, new Component[]{autoWidthCheckBox},
new Component[]{null},
}; };
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_LARGE);
} }
@ -146,22 +147,38 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private JPanel seniorUpPane() { private JPanel seniorUpPane() {
JPanel fileNamePane = createNormal(); JPanel fileNamePane = createNormal();
previewCellContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
printAndExportContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
printAndExportBackground.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p};
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}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{previewCellContent, null}, new Component[]{previewCellContent, null},
new Component[]{printAndExportContent, null}, new Component[]{printAndExportContent, null},
new Component[]{printAndExportBackground, null}, new Component[]{printAndExportBackground, null},
};
JPanel upPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE);
double[] downRowSize = {p, p, p, p, p, p};
double[] downColumnSize = {p, f};
int[][] downRowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] downComponent = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Show_Content"), SwingConstants.LEFT), showContent}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Show_Content"), SwingConstants.LEFT), showContent},
new Component[]{null, fileNamePane}, new Component[]{null, fileNamePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_CellWrite_ToolTip"), SwingConstants.RIGHT), tooltipTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_CellWrite_ToolTip"), SwingConstants.RIGHT), tooltipTextField},
new Component[]{null, null}, new Component[]{null, null},
new Component[]{null, null},
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); JPanel downPane = TableLayoutHelper.createGapTableLayoutPane(downComponent, downRowSize, downColumnSize, downRowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
JPanel pane = new JPanel(new BorderLayout());
pane.add(upPane, BorderLayout.NORTH);
pane.add(downPane, BorderLayout.CENTER);
return pane;
} }
private JPanel pagePane() { private JPanel pagePane() {
@ -175,6 +192,13 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
canBreakOnPaginateCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_CellPage_Can_Break_On_Paginate")); canBreakOnPaginateCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_CellPage_Can_Break_On_Paginate"));
repeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_CellPage_Repeat_Content_When_Paging")); repeatCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_CellPage_Repeat_Content_When_Paging"));
pageBeforeRowCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
pageAfterRowCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
pageBeforeColumnCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
pageAfterColumnCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
canBreakOnPaginateCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
repeatCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p}; double[] columnSize = {p};
@ -190,7 +214,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
new Component[]{canBreakOnPaginateCheckBox}, new Component[]{canBreakOnPaginateCheckBox},
new Component[]{repeatCheckBox}, new Component[]{repeatCheckBox},
}; };
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_LARGE);
} }
@ -204,8 +228,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
final JPanel fileNamePane = new JPanel(fileNameLayout); final JPanel fileNamePane = new JPanel(fileNameLayout);
JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0)); JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0));
fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST); fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST);
fileNameTextField = new UITextField(); fileNameTextField = new UIPropertyTextField();
tooltipTextField = new UITextField(); tooltipTextField = new UIPropertyTextField();
tooltipTextField.getUI(); tooltipTextField.getUI();
fileNamePane.add(new JPanel(), "none"); fileNamePane.add(new JPanel(), "none");
fileNamePane.add(fileNameCCPane, "content"); fileNamePane.add(fileNameCCPane, "content");
@ -224,8 +248,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
} }
} }
}); });
tooltipTextField = new UITextField();
tooltipTextField.getUI();
return fileNamePane; return fileNamePane;
} }

62
designer/src/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.cell.settingpane; package com.fr.design.mainframe.cell.settingpane;
import com.fr.base.present.Present; import com.fr.base.present.Present;
import com.fr.design.constants.UIConstants;
import com.fr.design.present.PresentPane; import com.fr.design.present.PresentPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
@ -17,16 +18,18 @@ import java.awt.event.ItemListener;
* @since 2012-5-11下午5:24:35 * @since 2012-5-11下午5:24:35
*/ */
public class CellPresentPane extends AbstractCellAttrPane { public class CellPresentPane extends AbstractCellAttrPane {
private PresentPane presentPane; private PresentPane presentPane;
/** /**
* 初始化面板 * 初始化面板
* @return 面板 *
* @return 面板
*/ */
public JPanel createContentPane() { public JPanel createContentPane() {
presentPane = new PresentPane(); presentPane = new PresentPane();
JPanel content = new JPanel(new BorderLayout()); JPanel content = new JPanel(new BorderLayout());
content.add(presentPane, BorderLayout.CENTER); content.add(presentPane, BorderLayout.CENTER);
presentPane.setBorder(UIConstants.CELL_ATTR_PRESENTBORDER);
presentPane.addTabChangeListener(new ItemListener() { presentPane.addTabChangeListener(new ItemListener() {
@Override @Override
@ -35,23 +38,23 @@ public class CellPresentPane extends AbstractCellAttrPane {
} }
}); });
return content; return content;
} }
@Override @Override
public String getIconPath() { public String getIconPath() {
// return "com/fr/design/images/data/source/dataDictionary.png"; // return "com/fr/design/images/data/source/dataDictionary.png";
return Inter.getLocText("FR-Designer_Present"); return Inter.getLocText("FR-Designer_Present");
} }
@Override @Override
public void updateBean(TemplateCellElement cellElement) { public void updateBean(TemplateCellElement cellElement) {
cellElement.setPresent(presentPane.updateBean()); cellElement.setPresent(presentPane.updateBean());
} }
/** /**
* 保存 * 保存
*/ */
public void updateBeans() { public void updateBeans() {
Present present = presentPane.updateBean(); Present present = presentPane.updateBean();
TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
int cellRectangleCount = cs.getCellRectangleCount(); int cellRectangleCount = cs.getCellRectangleCount();
@ -71,21 +74,21 @@ public class CellPresentPane extends AbstractCellAttrPane {
} }
} }
} }
} }
@Override @Override
protected void populateBean() { protected void populateBean() {
//选中的所有单元格都有形态,属性表才会有内容,否则是初始值 //选中的所有单元格都有形态,属性表才会有内容,否则是初始值
//主要是解决37664 //主要是解决37664
Present present = getSelectCellPresent(); Present present = getSelectCellPresent();
presentPane.populateBean(present); presentPane.populateBean(present);
} }
private Present getSelectCellPresent(){ private Present getSelectCellPresent() {
TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
//按住ctrl选中多个cell块 //按住ctrl选中多个cell块
int cellRectangleCount = cs.getCellRectangleCount(); int cellRectangleCount = cs.getCellRectangleCount();
for (int rect = 0; rect < cellRectangleCount; rect++) { for (int rect = 0; rect < cellRectangleCount; rect++) {
Rectangle cellRectangle = cs.getCellRectangle(rect); Rectangle cellRectangle = cs.getCellRectangle(rect);
for (int j = 0; j < cellRectangle.height; j++) { for (int j = 0; j < cellRectangle.height; j++) {
@ -93,8 +96,8 @@ public class CellPresentPane extends AbstractCellAttrPane {
int column = i + cellRectangle.x; int column = i + cellRectangle.x;
int row = j + cellRectangle.y; int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if(cellElement == null || cellElement.getPresent() == null){ if (cellElement == null || cellElement.getPresent() == null) {
return null; return null;
} }
} }
} }
@ -104,15 +107,16 @@ public class CellPresentPane extends AbstractCellAttrPane {
/** /**
* 对话框标题 * 对话框标题
* @return 标题 *
* @return 标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Style_Present"); return Inter.getLocText("FR-Chart-Style_Present");
} }
public void setSelectedByIds(int level, String... id) { public void setSelectedByIds(int level, String... id) {
presentPane.setSelectedByName(id[level]); presentPane.setSelectedByName(id[level]);
} }
} }

3
designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.cell.settingpane; package com.fr.design.mainframe.cell.settingpane;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.cell.settingpane.style.StylePane; import com.fr.design.mainframe.cell.settingpane.style.StylePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -25,6 +26,7 @@ public class CellStylePane extends AbstractCellAttrPane {
JPanel content = new JPanel(new BorderLayout()); JPanel content = new JPanel(new BorderLayout());
stylePane = new StylePane(); stylePane = new StylePane();
content.add(stylePane, BorderLayout.CENTER); content.add(stylePane, BorderLayout.CENTER);
stylePane.setBorder(UIConstants.CELL_ATTR_PRESENTBORDER);
stylePane.addPredefinedChangeListener(new ChangeListener() { stylePane.addPredefinedChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
attributeChanged(); attributeChanged();
@ -37,7 +39,6 @@ public class CellStylePane extends AbstractCellAttrPane {
adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条 adjustValues();// 里面的Tab切换后要及时调整滚动条,因为一些界面可能不需要滚动条
} }
}); });
// content.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
return content; return content;
} }

1
designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -40,6 +40,7 @@ public class CustomStylePane extends MultiTabPane<Style> {
public CustomStylePane() { public CustomStylePane() {
super(); super();
tabPane.setOneLineTab(true); tabPane.setOneLineTab(true);
tabPane.setDrawLine(false);
tabPane.setLayout(new FiveButtonLayout(1)); tabPane.setLayout(new FiveButtonLayout(1));
} }

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

@ -23,6 +23,8 @@ import java.util.Iterator;
public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> implements DesignerBean { public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> implements DesignerBean {
private static final int LEFT_BORDER = 10;
private static final int RIGHT_BORDER = 10;
private DefaultListModel defaultListModel; private DefaultListModel defaultListModel;
private JList styleList; private JList styleList;
private ChangeListener changeListener; private ChangeListener changeListener;
@ -65,7 +67,7 @@ public class PredefinedStylePane extends FurtherBasicBeanPane<NameStyle> impleme
styleList.setCellRenderer(render); styleList.setCellRenderer(render);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(styleList, BorderLayout.CENTER); this.add(styleList, BorderLayout.CENTER);
this.setBorder(UIConstants.CELL_ATTR_NORMALBORDER); this.setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));
styleList.addMouseListener(new MouseAdapter() { styleList.addMouseListener(new MouseAdapter() {
@Override @Override

4
designer/src/com/fr/design/present/PresentPane.java

@ -70,25 +70,21 @@ public class PresentPane extends UIComboBoxPane<Present> {
displays.add(none.title4PopupWindow()); displays.add(none.title4PopupWindow());
dictPresentPane = new DictPresentPane(); dictPresentPane = new DictPresentPane();
dictPresentPane.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
paneList.add(dictPresentPane); paneList.add(dictPresentPane);
keys.add(DictPresent.class.getName()); keys.add(DictPresent.class.getName());
displays.add(dictPresentPane.title4PopupWindow()); displays.add(dictPresentPane.title4PopupWindow());
FurtherBasicBeanPane<BarcodePresent> bar = new BarCodePane(); FurtherBasicBeanPane<BarcodePresent> bar = new BarCodePane();
bar.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
paneList.add(bar); paneList.add(bar);
keys.add(BarcodePresent.class.getName()); keys.add(BarcodePresent.class.getName());
displays.add(bar.title4PopupWindow()); displays.add(bar.title4PopupWindow());
FurtherBasicBeanPane<FormulaPresent> formula = new FormulaPresentPane(); FurtherBasicBeanPane<FormulaPresent> formula = new FormulaPresentPane();
formula.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
paneList.add(formula); paneList.add(formula);
keys.add(FormulaPresent.class.getName()); keys.add(FormulaPresent.class.getName());
displays.add(formula.title4PopupWindow()); displays.add(formula.title4PopupWindow());
FurtherBasicBeanPane<CurrencyLinePresent> currency = new CurrencyLinePane(); FurtherBasicBeanPane<CurrencyLinePresent> currency = new CurrencyLinePane();
currency.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
paneList.add(currency); paneList.add(currency);
keys.add(CurrencyLinePresent.class.getName()); keys.add(CurrencyLinePresent.class.getName());
displays.add(currency.title4PopupWindow()); displays.add(currency.title4PopupWindow());

8
designer/src/com/fr/design/report/mobile/MobileRadioGroupPane.java

@ -29,21 +29,19 @@ public class MobileRadioGroupPane extends BasicBeanPane<MobileFitAttrState>{
private void initComponents(String title) { private void initComponents(String title) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p}; double[] rowSize = {p};
double[] columnSize = {p, p, p, p, p, p}; double[] columnSize = {p, p, p, p, p};
IndexRadioButton defaultRadio = new IndexRadioButton(MobileFitAttrState.DEFAULT.description(), MobileFitAttrState.DEFAULT);
defaultRadio.setSelected(true);
IndexRadioButton horizonRadio = new IndexRadioButton(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL); IndexRadioButton horizonRadio = new IndexRadioButton(MobileFitAttrState.HORIZONTAL.description(), MobileFitAttrState.HORIZONTAL);
horizonRadio.setSelected(true);
IndexRadioButton verticalRadio = new IndexRadioButton(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL); IndexRadioButton verticalRadio = new IndexRadioButton(MobileFitAttrState.VERTICAL.description(), MobileFitAttrState.VERTICAL);
IndexRadioButton bidirectionalRadio = new IndexRadioButton(MobileFitAttrState.BIDIRECTIONAL.description(), MobileFitAttrState.BIDIRECTIONAL); IndexRadioButton bidirectionalRadio = new IndexRadioButton(MobileFitAttrState.BIDIRECTIONAL.description(), MobileFitAttrState.BIDIRECTIONAL);
IndexRadioButton notFitRadio = new IndexRadioButton(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE); IndexRadioButton notFitRadio = new IndexRadioButton(MobileFitAttrState.NONE.description(), MobileFitAttrState.NONE);
addToButtonGroup(defaultRadio, horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio); addToButtonGroup(horizonRadio, verticalRadio, notFitRadio, bidirectionalRadio);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[] { new Component[] {
new UILabel(title), new UILabel(title),
defaultRadio,
horizonRadio, horizonRadio,
verticalRadio, verticalRadio,
bidirectionalRadio, bidirectionalRadio,

32
designer/src/com/fr/design/report/mobile/MobileUseHtmlGroupPane.java

@ -1,32 +0,0 @@
package com.fr.design.report.mobile;
import com.fr.design.dialog.mobile.MobileUseHtmlGroupBeanPane;
import com.fr.report.mobile.ElementCaseMobileAttr;
/**
* Created by kunsnat on 2016/8/3.
*/
public class MobileUseHtmlGroupPane extends MobileUseHtmlGroupBeanPane<ElementCaseMobileAttr> {
public MobileUseHtmlGroupPane(String annotation) {
super(annotation);
}
@Override
public void populateBean(ElementCaseMobileAttr mobileAttr) {
if(mobileAttr != null) {
selectIndexButton(mobileAttr.isUseHTML() ? 1 : 0);
}
}
@Override
public ElementCaseMobileAttr updateBean() {
return null;
}
@Override
public void updateBean(ElementCaseMobileAttr mobileAttr) {
if(mobileAttr != null) {
mobileAttr.setUseHTML(getSelectRadioIndex() == 1);
}
}
}

6
designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java

@ -15,8 +15,6 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
private AppFitBrowserPane appFitBrowserPane; private AppFitBrowserPane appFitBrowserPane;
private MobileUseHtmlGroupPane htmlGroupPane;
//工具栏容器 //工具栏容器
private MobileToolBarPane mobileToolBarPane; private MobileToolBarPane mobileToolBarPane;
@ -34,8 +32,6 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
jPanel.add(appFitBrowserPane); jPanel.add(appFitBrowserPane);
jPanel.add(htmlGroupPane = new MobileUseHtmlGroupPane(Inter.getLocText("FR-Designer_Mobile_Report_Analysis_Annotation")));
jPanel.add(mobileToolBarPane = new MobileToolBarPane()); jPanel.add(mobileToolBarPane = new MobileToolBarPane());
jPanel.add(appFitPreviewPane); jPanel.add(appFitPreviewPane);
@ -50,7 +46,6 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
} }
appFitBrowserPane.populateBean(ob); appFitBrowserPane.populateBean(ob);
mobileToolBarPane.populateBean(ob); mobileToolBarPane.populateBean(ob);
htmlGroupPane.populateBean(ob);
} }
@ -58,7 +53,6 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
public ElementCaseMobileAttr updateBean() { public ElementCaseMobileAttr updateBean() {
ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean(); ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean();
mobileToolBarPane.updateBean(caseMobileAttr); mobileToolBarPane.updateBean(caseMobileAttr);
htmlGroupPane.updateBean(caseMobileAttr);
return caseMobileAttr; return caseMobileAttr;
} }

26
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -2,6 +2,7 @@ package com.fr.design.widget;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -48,10 +49,30 @@ public class CellWidgetCardPane extends BasicPane {
this.removeAll(); this.removeAll();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
BasicScrollPane basicScrollPane = new BasicScrollPane() {
@Override
protected JPanel createContentPane() {
return jPanel;
}
@Override
public void populateBean(Object ob) {
}
@Override
protected String title4PopupWindow() {
return null;
}
};
this.add(basicScrollPane, BorderLayout.CENTER);
//k //k
tabbedPane = new CardLayout(); tabbedPane = new CardLayout();
center = new JPanel(tabbedPane); center = new JPanel(tabbedPane);
this.add(center, BorderLayout.CENTER); jPanel.add(center, BorderLayout.CENTER);
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -70,7 +91,7 @@ public class CellWidgetCardPane extends BasicPane {
} }
}; };
tabsHeaderIconPane.setNeedLeftRightOutLine(false); tabsHeaderIconPane.setNeedLeftRightOutLine(false);
this.add(tabsHeaderIconPane, BorderLayout.NORTH); jPanel.add(tabsHeaderIconPane, BorderLayout.NORTH);
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
@ -82,7 +103,6 @@ public class CellWidgetCardPane extends BasicPane {
attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
attriTabPane.add(attriCardPane, BorderLayout.CENTER); attriTabPane.add(attriCardPane, BorderLayout.CENTER);
attriCardLayout = (CardLayout) attriCardPane.getLayout(); attriCardLayout = (CardLayout) attriCardPane.getLayout();
this.setPreferredSize(new Dimension(600, 450));
} }
private void initPaneList() { private void initPaneList() {

1
designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java

@ -3,7 +3,6 @@ package com.fr.design.widget.ui;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
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.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;

2
designer/src/com/fr/design/widget/ui/ButtonDefinePane.java

@ -5,8 +5,6 @@ import com.fr.design.widget.ui.btn.ButtonDetailPaneFactory;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.design.widget.btn.ButtonDetailPane; import com.fr.design.widget.btn.ButtonDetailPane;
import javax.swing.*;
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.*;

6
designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -14,7 +14,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UIPropertyTextField text;
public CheckBoxDefinePane() { public CheckBoxDefinePane() {
this.iniComoponents(); this.iniComoponents();
@ -22,7 +22,7 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UITextField(8); text = new UIPropertyTextField();
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(text, BorderLayout.CENTER); panel.add(text, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0));

12
designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -5,7 +5,7 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
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.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -24,7 +24,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UITextField errorMsgTextField; protected UIPropertyTextField errorMsgTextField;
protected JPanel validatePane; protected JPanel validatePane;
public FieldEditorDefinePane() { public FieldEditorDefinePane() {
@ -33,7 +33,6 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
initErrorMsgPane();
JPanel contentPane = this.setFirstContentPane(); JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) { if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, contentPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, contentPane);
@ -45,9 +44,8 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
errorMsgTextField = new UITextField(10); errorMsgTextField = new UIPropertyTextField();
// // richer:主要为了方便查看比较长的错误信息
// richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
@ -98,7 +96,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() { protected void addValidatePane() {
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Error", "FR-Designer_Tooltips"})); final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Error", "FR-Designer_Tooltips"}));
errorMsgTextField = new UITextField(10); initErrorMsgPane();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));

6
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -9,7 +9,7 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
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.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -28,7 +28,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private static final int P_W = 610; private static final int P_W = 610;
private static final int P_H = 580; private static final int P_H = 580;
private UITextField srcTextField; private UIPropertyTextField srcTextField;
private ReportletParameterViewPane parameterViewPane; private ReportletParameterViewPane parameterViewPane;
private UICheckBox horizontalCheck; private UICheckBox horizontalCheck;
private UICheckBox verticalCheck; private UICheckBox verticalCheck;
@ -61,7 +61,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
java.awt.Component[][] coms = { java.awt.Component[][] coms = {
{horizontalCheck, null}, {horizontalCheck, null},
{verticalCheck, null}, {verticalCheck, null},
{new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()}, {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UIPropertyTextField()},
{new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}}; {new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE);

8
designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java

@ -1,7 +1,7 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WaterMark; import com.fr.form.ui.WaterMark;
@ -13,14 +13,12 @@ import java.awt.event.KeyListener;
public class WaterMarkDictPane extends JPanel { public class WaterMarkDictPane extends JPanel {
private UITextField waterMarkTextField; private UIPropertyTextField waterMarkTextField;
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
// this.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); waterMarkTextField = new UIPropertyTextField();
// this.add(new UILabel(Inter.getLocText("WaterMark") + ":"));
waterMarkTextField = new UITextField(13);
UILabel emptyLabel = new UILabel(); UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));

4
designer/src/com/fr/grid/GridMouseAdapter.java

@ -6,6 +6,7 @@ import com.fr.base.ScreenResolution;
import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JSliderPane; import com.fr.design.mainframe.JSliderPane;
import com.fr.design.present.CellWriteAttrPane; import com.fr.design.present.CellWriteAttrPane;
@ -204,7 +205,6 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
*/ */
private void showWidetWindow(TemplateCellElement cellElement, TemplateElementCase report) { private void showWidetWindow(TemplateCellElement cellElement, TemplateElementCase report) {
// int resolution = ScreenResolution.getScreenResolution();
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report); DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report); DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
double fixed_pos_x = this.oldEvtX - columnWidthList.getRangeValue(grid.getHorizontalValue(), cellElement.getColumn()).toPixD(resolution); double fixed_pos_x = this.oldEvtX - columnWidthList.getRangeValue(grid.getHorizontalValue(), cellElement.getColumn()).toPixD(resolution);
@ -212,7 +212,7 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
double cell_width = columnWidthList.getRangeValue(cellElement.getColumn(), cellElement.getColumn() + cellElement.getColumnSpan()).toPixD(resolution); double cell_width = columnWidthList.getRangeValue(cellElement.getColumn(), cellElement.getColumn() + cellElement.getColumnSpan()).toPixD(resolution);
double cell_height = rowHeightList.getRangeValue(cellElement.getRow(), cellElement.getRow() + cellElement.getRowSpan()).toPixD(resolution); double cell_height = rowHeightList.getRangeValue(cellElement.getRow(), cellElement.getRow() + cellElement.getRowSpan()).toPixD(resolution);
if (fitSizeToShow(cell_width, cell_height, fixed_pos_x, fixed_pos_y)) { if (fitSizeToShow(cell_width, cell_height, fixed_pos_x, fixed_pos_y)) {
CellWriteAttrPane.showWidgetWindow(grid.getElementCasePane()); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
} }
} }

5
designer/src/com/fr/grid/selection/CellSelection.java

@ -8,6 +8,7 @@ import com.fr.design.actions.cell.GlobalStyleMenuDef.GlobalStyleSelection;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.CopyAction; import com.fr.design.actions.edit.CopyAction;
import com.fr.design.actions.edit.CutAction; import com.fr.design.actions.edit.CutAction;
import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.actions.edit.PasteAction; import com.fr.design.actions.edit.PasteAction;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.CellElementsClip;
@ -456,11 +457,13 @@ public class CellSelection extends Selection {
} }
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook()){ //表单中报表块编辑屏蔽掉 控件设置 if (jTemplate.isJWorkBook()){ //表单中报表块编辑屏蔽掉 控件设置
popup.add(new CellWidgetAttrAction(ePane).createMenuItem()); popup.add(new CellWidgetAttrAction().createMenuItem());
} }
popup.add(new CellExpandAttrAction().createMenuItem()); popup.add(new CellExpandAttrAction().createMenuItem());
popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu()); popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu());
popup.add(new CellAttributeAction().createMenuItem()); popup.add(new CellAttributeAction().createMenuItem());
popup.add(new ConditionAttributesAction().createMenuItem());
popup.add(new HyperlinkAction().createMenuItem());
// cut, copy and paste // cut, copy and paste
popup.addSeparator(); popup.addSeparator();
popup.add(new CutAction(ePane).createMenuItem()); popup.add(new CutAction(ePane).createMenuItem());

7
designer/src/com/fr/grid/selection/FloatSelection.java

@ -9,11 +9,7 @@ import com.fr.base.FRContext;
import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.CleanAuthorityAction;
import com.fr.design.actions.cell.FloatStyleAction; import com.fr.design.actions.cell.FloatStyleAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.CopyAction; import com.fr.design.actions.edit.*;
import com.fr.design.actions.edit.CutAction;
import com.fr.design.actions.edit.DeleteAction;
import com.fr.design.actions.edit.EditFloatElementNameAction;
import com.fr.design.actions.edit.PasteAction;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.CellElementsClip;
import com.fr.design.cell.clipboard.ElementsTransferable; import com.fr.design.cell.clipboard.ElementsTransferable;
@ -125,6 +121,7 @@ public class FloatSelection extends Selection {
} }
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu()); popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
popup.add(new FloatStyleAction(ePane).createMenuItem()); popup.add(new FloatStyleAction(ePane).createMenuItem());
popup.add(new HyperlinkAction().createMenuItem());
// cut, copy and paste // cut, copy and paste
popup.addSeparator(); popup.addSeparator();

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

@ -4,6 +4,7 @@
package com.fr.poly.creator; package com.fr.poly.creator;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
@ -142,12 +143,14 @@ public class ECBlockPane extends PolyElementCasePane {
MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic()); MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic());
menuDef.addShortCut(new CellExpandAttrAction()); menuDef.addShortCut(new CellExpandAttrAction());
menuDef.addShortCut(new CellWidgetAttrAction(this)); menuDef.addShortCut(new CellWidgetAttrAction());
menuDef.addShortCut(new GlobalStyleMenuDef(this)); menuDef.addShortCut(new GlobalStyleMenuDef(this));
menuDef.addShortCut(new ConditionAttributesAction());
// 单元格形态 // 单元格形态
menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this));
menuDef.addShortCut(new HyperlinkAction());
menuDef.addShortCut(SeparatorDef.DEFAULT); menuDef.addShortCut(SeparatorDef.DEFAULT);
menuDef.addShortCut(new MergeCellAction(this)); menuDef.addShortCut(new MergeCellAction(this));
menuDef.addShortCut(new UnmergeCellAction(this)); menuDef.addShortCut(new UnmergeCellAction(this));

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

@ -19,9 +19,10 @@ public interface UIConstants {
public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif"); public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0 ,0, 0, 0); public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 0); public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 0);
public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 15); public static final Border CELL_ATTR_PRESENTBORDER = BorderFactory.createEmptyBorder(0, 5, 0, 0);
public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 15);
public static final int SIZE = 17; public static final int SIZE = 17;
@ -155,7 +156,7 @@ public interface UIConstants {
public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127); public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127);
public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45); public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45);
public static final Color BARNOMAL = new Color(232, 232, 233); public static final Color BARNOMAL = new Color(232, 232, 233);
public static final Color COMPONENT_BACKGROUND_COLOR = new Color(237,237,238); public static final Color COMPONENT_BACKGROUND_COLOR = new Color(237, 237, 238);
public static final int ARC = 0; public static final int ARC = 0;
public static final int BUTTON_GROUP_ARC = 0; public static final int BUTTON_GROUP_ARC = 0;
public static final int LARGEARC = 6; public static final int LARGEARC = 6;

112
designer_base/src/com/fr/design/dialog/mobile/MobileUseHtmlGroupBeanPane.java

@ -1,112 +0,0 @@
package com.fr.design.dialog.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/**
* 由于MobileUserHtmlGroupPane 现在在report和form中均会用到会出现重复代码故放入base中
* Created by fanglei on 2016/12/28.
*/
public abstract class MobileUseHtmlGroupBeanPane<T> extends BasicBeanPane<T> {
private List<UIRadioButton> radioButtons = new ArrayList<UIRadioButton>();
public MobileUseHtmlGroupBeanPane(String annotation) {
initComponents(annotation);
}
private void initComponents(String annotation) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(UITitledBorder.createBorderWithTitle(this.title4PopupWindow()));
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {p, p, p};
UIRadioButton useApp = new UIRadioButton(Inter.getLocText("FR-mobile_native_analysis"));
useApp.setSelected(true);
UIRadioButton useHTML5 = new UIRadioButton(Inter.getLocText("FR-mobile_html_analysis"));
addToButtonGroup(useApp, useHTML5);
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-mobile_analysis_style")), useApp, useHTML5},
new Component[]{new UILabel(annotation), null, null}
};
JPanel usePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
usePane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10));
this.add(usePane);
}
private void addToButtonGroup(UIRadioButton... radios) {
ButtonGroup buttonGroup = new ButtonGroup();
for (UIRadioButton radio : radios) {
radioButtons.add(radio);
buttonGroup.add(radio);
}
}
/**
* 设置按钮状态
*/
public void setEnabled(boolean enabled) {
for (UIRadioButton radioButton : radioButtons) {
radioButton.setEnabled(enabled);
}
}
/**
* 获取当前选中的按钮index
*
* @return 按钮index
*/
public int getSelectRadioIndex() {
for (int i = 0, len = radioButtons.size(); i < len; i++) {
if (radioButtons.get(i).isSelected()) {
return i;
}
}
return 0;
}
/**
* 选中指定index的按钮
*/
public void selectIndexButton(int index) {
if (index < 0 || index > radioButtons.size() - 1) {
return;
}
UIRadioButton button = radioButtons.get(index);
button.setSelected(true);
}
/**
* 给所有的按钮加上监听
*/
public void addActionListener(ActionListener actionListener) {
for (UIRadioButton radioButton : radioButtons) {
radioButton.addActionListener(actionListener);
}
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-mobile_report_analysis");
}
}

2
designer_base/src/com/fr/design/extra/PluginOperateUtils.java

@ -292,7 +292,7 @@ public class PluginOperateUtils {
pluginInfo.append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode())); pluginInfo.append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode()));
continue; continue;
} }
PluginMarker pluginMarker = pluginTask.getMarker(); PluginMarker pluginMarker = pluginTask.getToMarker();
PluginContext pluginContext = PluginManager.getContext(pluginMarker); PluginContext pluginContext = PluginManager.getContext(pluginMarker);
if (pluginContext != null) { if (pluginContext != null) {
pluginInfo.append(pluginContext.getName()).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode())); pluginInfo.append(pluginContext.getName()).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode()));

8
designer_base/src/com/fr/design/extra/PluginUtils.java

@ -78,8 +78,8 @@ public class PluginUtils {
return jsonArray.toString(); return jsonArray.toString();
} }
public static void downloadShopScripts(String id, String username, String password, Process<Double> p) throws Exception { public static void downloadShopScripts(String id, Process<Double> p) throws Exception {
HttpClient httpClient = new HttpClient(getDownloadPath(id, username, password)); HttpClient httpClient = new HttpClient(getDownloadPath(id));
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
int totalSize = httpClient.getContentLength(); int totalSize = httpClient.getContentLength();
InputStream reader = httpClient.getResponseStream(); InputStream reader = httpClient.getResponseStream();
@ -104,11 +104,9 @@ public class PluginUtils {
} }
} }
private static String getDownloadPath(String id, String username, String password) throws Exception { private static String getDownloadPath(String id) throws Exception {
HashMap<String, String> map = new HashMap<String, String>(); HashMap<String, String> map = new HashMap<String, String>();
map.put("id", id); map.put("id", id);
map.put("username", username);
map.put("password", password);
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.scripts")); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.scripts"));
httpClient.asGet(); httpClient.asGet();
String resText = httpClient.getResponseText(); String resText = httpClient.getResponseText();

19
designer_base/src/com/fr/design/extra/WebViewDlgHelper.java

@ -1,7 +1,6 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
@ -171,10 +170,8 @@ public class WebViewDlgHelper {
new SwingWorker<Boolean, Void>() { new SwingWorker<Boolean, Void>() {
@Override @Override
protected Boolean doInBackground() throws Exception { protected Boolean doInBackground() throws Exception {
String username = DesignerEnvManager.getEnvManager().getBBSName();
String password = DesignerEnvManager.getEnvManager().getBBSPassword();
try { try {
PluginUtils.downloadShopScripts(scriptsId, username, password, new Process<Double>() { PluginUtils.downloadShopScripts(scriptsId, new Process<Double>() {
@Override @Override
public void process(Double integer) { public void process(Double integer) {
} }
@ -198,19 +195,7 @@ public class WebViewDlgHelper {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome);
copyMainFile(StableUtils.pathJoin(installHome, "index.html"), StableUtils.pathJoin(installHome, relativePath)); copyMainFile(StableUtils.pathJoin(installHome, "index.html"), StableUtils.pathJoin(installHome, relativePath));
// TODO: 2017/4/17 删除之前存放在安装目录下的script // TODO: 2017/4/17 删除之前存放在安装目录下的script
int rv = JOptionPane.showOptionDialog( JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE);
null,
Inter.getLocText("FR-Designer-Plugin_Shop_Installed"),
Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")},
null
);
if (rv == JOptionPane.OK_OPTION) {
RestartHelper.restart();
}
} }
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);

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

@ -11,16 +11,17 @@ import java.awt.image.BufferedImage;
*/ */
public class HeaderPane extends JPanel { public class HeaderPane extends JPanel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final int TITLE_X = 9; private static final int TITLE_X = 5;
private static final int LEFT_X = 221; private static final int LEFT_X = 16;
private static final int LEFT_Y = 6; private static final int LEFT_Y = 6;
private int headWidth = 280; private static final int NORMAL_FONTSIZE = 12;
private int headHeight = 25; private int headWidth;
private int headHeight;
private Color bgColor; private Color bgColor;
private boolean isShow; private boolean isShow;
private String title; private String title;
private Image image; private Image image;
private int fontSize = 13; private int fontSize;
public void setShow(boolean isShow) { public void setShow(boolean isShow) {
this.isShow = isShow; this.isShow = isShow;
@ -56,21 +57,19 @@ public class HeaderPane extends JPanel {
BufferedImage panelImage = new BufferedImage(getWidth(), headHeight, BufferedImage.TYPE_INT_ARGB); BufferedImage panelImage = new BufferedImage(getWidth(), headHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = panelImage.createGraphics(); Graphics2D g2d = panelImage.createGraphics();
g2d.setColor(UIConstants.COMPONENT_BACKGROUND_COLOR); g2d.setColor(UIConstants.COMPONENT_BACKGROUND_COLOR);
headWidth = this.getWidth();
g2d.fillRect(0, 0, headWidth, headHeight); g2d.fillRect(0, 0, headWidth, headHeight);
// g2d.drawImage(UIConstants.DRAG_BAR, 0, 0, headWidth, headHeight, null);
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, TITLE_X, headHeight - fontSize / 2 - 1); g2d.drawString(this.title, TITLE_X, headHeight - fontSize / 2 - 1);
int leftWdith = headWidth - LEFT_X;
if (this.isShow) { if (this.isShow) {
image = UIConstants.DRAG_DOWN_SELECTED_SMALL; image = UIConstants.DRAG_DOWN_SELECTED_SMALL;
g2d.drawImage(image, LEFT_X, LEFT_Y, null); g2d.drawImage(image, leftWdith, LEFT_Y, null);
} else { } else {
image = UIConstants.DRAG_LEFT_NORMAL_SMALL; image = UIConstants.DRAG_LEFT_NORMAL_SMALL;
g2d.drawImage(image, LEFT_X, LEFT_Y , null); g2d.drawImage(image, leftWdith, LEFT_Y, null);
} }
return panelImage; return panelImage;
} }
@ -90,21 +89,21 @@ public class HeaderPane extends JPanel {
} }
public HeaderPane(Color bgColor, String title, int headWidth, int headHeight) { public HeaderPane(Color bgColor, String title, int headHeight) {
this(bgColor); this(bgColor);
this.title = title; this.title = title;
this.headHeight = headHeight; this.headHeight = headHeight;
this.headWidth = headWidth; this.fontSize = NORMAL_FONTSIZE;
} }
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, 24), BorderLayout.CENTER); // mainFrame.getContentPane().add(new HeaderPane(Color.black, "基本", 24), BorderLayout.CENTER);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.pack(); // mainFrame.pack();
mainFrame.setSize(250, 400); // mainFrame.setSize(300, 400);
mainFrame.setVisible(true); // mainFrame.setVisible(true);
} }
} }

60
designer_base/src/com/fr/design/foldablepane/UIExpandablePane.java

@ -1,18 +1,17 @@
package com.fr.design.foldablepane; package com.fr.design.foldablepane;
import com.fr.design.constants.UIConstants; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import javax.swing.*;
/** /**
* Created by MoMeak on 2017/7/5. * Created by MoMeak on 2017/7/5.
*/ */
public class UIExpandablePane extends JPanel { public class UIExpandablePane extends JPanel {
private static final int LEFT_BORDER = 5;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private HeaderPane headerPanel; private HeaderPane headerPanel;
private JPanel contentPanel; private JPanel contentPanel;
@ -22,8 +21,7 @@ public class UIExpandablePane extends JPanel {
private int headHeight; private int headHeight;
public UIExpandablePane(String title,int headWidth,int headHeight,JPanel contentPanel) public UIExpandablePane(String title, int headWidth, int headHeight, JPanel contentPanel) {
{
super(); super();
this.title = title; this.title = title;
this.headWidth = headWidth; this.headWidth = headWidth;
@ -32,29 +30,32 @@ public class UIExpandablePane extends JPanel {
initComponents(); initComponents();
} }
public UIExpandablePane(String title, int headHeight, JPanel contentPanel) {
super();
this.title = title;
this.headHeight = headHeight;
this.contentPanel = contentPanel;
initComponents();
}
private void initComponents() { private void initComponents() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
headerPanel = new HeaderPane(color, title,headWidth,headHeight); headerPanel = new HeaderPane(color, title, headHeight);
headerPanel.addMouseListener(new PanelAction()); headerPanel.addMouseListener(new PanelAction());
contentPanel.setBorder(UIConstants.CELL_ATTR_NORMALBORDER); contentPanel.setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, 0));
this.add(headerPanel, BorderLayout.NORTH); this.add(headerPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER); this.add(contentPanel, BorderLayout.CENTER);
setOpaque(false); setOpaque(false);
} }
class PanelAction extends MouseAdapter class PanelAction extends MouseAdapter {
{ public void mousePressed(MouseEvent e) {
public void mousePressed(MouseEvent e) HeaderPane hp = (HeaderPane) e.getSource();
{ if (contentPanel.isShowing()) {
HeaderPane hp = (HeaderPane)e.getSource();
if(contentPanel.isShowing())
{
contentPanel.setVisible(false); contentPanel.setVisible(false);
hp.setShow(false); hp.setShow(false);
} } else {
else
{
contentPanel.setVisible(true); contentPanel.setVisible(true);
hp.setShow(true); hp.setShow(true);
} }
@ -64,34 +65,19 @@ public class UIExpandablePane extends JPanel {
} }
public static void main(String[] args) public static void main(String[] args) {
{
// JFrame jf = new JFrame("test"); // JFrame jf = new JFrame("test");
// jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// JPanel content = (JPanel) jf.getContentPane(); // JPanel content = (JPanel) jf.getContentPane();
// content.setLayout(new BorderLayout()); // content.setLayout(new BorderLayout());
//
// JPanel myPanel = new JPanel(); // JPanel myPanel = new JPanel();
// myPanel.setLayout(new BorderLayout()); // myPanel.setLayout(new BorderLayout());
// JPanel Panel = new JPanel(); // JPanel Panel = new JPanel();
// Panel.setBackground(Color.blue); // Panel.setBackground(Color.blue);
// myPanel.add(new UIExpandablePane("基本",280,25,Panel),BorderLayout.CENTER); // myPanel.add(new UIExpandablePane("基本", 223, 24, Panel), BorderLayout.CENTER);
//// myPanel.setLayout(new GridBagLayout());
//// myPanel.add(new JExpandablePanel());
//// GridBagConstraints gbc = new GridBagConstraints();
//// JPanel[] panels = new JPanel[4]; //
//// gbc.insets = new Insets(1,3,0,3);
//// gbc.weightx = 1.0;
//// gbc.fill = GridBagConstraints.HORIZONTAL;
//// gbc.gridwidth = GridBagConstraints.REMAINDER;
//// for(int j = 0; j < panels.length; j++)
//// {
//// panels[j] = new JExpandablePanel();
//// myPanel.add(panels[j], gbc);
//// }
// content.add(myPanel, BorderLayout.CENTER); // content.add(myPanel, BorderLayout.CENTER);
// GUICoreUtils.centerWindow(jf); // GUICoreUtils.centerWindow(jf);
// jf.setSize(280, 400); // jf.setSize(439, 400);
// jf.setVisible(true); // jf.setVisible(true);
} }

288
designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java

@ -2,7 +2,6 @@ package com.fr.design.gui.frpane;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import javax.swing.*; import javax.swing.*;
@ -12,155 +11,152 @@ import java.awt.event.ItemListener;
import java.util.List; import java.util.List;
/** /**
*
* @author zhou * @author zhou
* @since 2012-5-31下午12:25:21 * @since 2012-5-31下午12:25:21
*/ */
public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> { public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
protected abstract List<FurtherBasicBeanPane<? extends T>> initPaneList(); protected abstract List<FurtherBasicBeanPane<? extends T>> initPaneList();
protected UIComboBox jcb; protected UIComboBox jcb;
protected JPanel cardPane; protected JPanel cardPane;
protected List<FurtherBasicBeanPane<? extends T>> cards; protected List<FurtherBasicBeanPane<? extends T>> cards;
protected String[] cardNames; protected String[] cardNames;
public UIComboBoxPane() { public UIComboBoxPane() {
cards = initPaneList(); cards = initPaneList();
initComponents(); initComponents();
} }
protected void initComponents() { protected void initComponents() {
cardNames = new String[cards.size()]; cardNames = new String[cards.size()];
jcb = createComboBox(); jcb = createComboBox();
cardPane = new JPanel(new CardLayout()) { cardPane = new JPanel(new CardLayout()) {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return cards.get(jcb.getSelectedIndex()).getPreferredSize(); return cards.get(jcb.getSelectedIndex()).getPreferredSize();
} }
}; };
for (int i = 0; i < this.cards.size(); i++) { for (int i = 0; i < this.cards.size(); i++) {
String name = this.cards.get(i).title4PopupWindow();// Name从各自的pane里面获取 String name = this.cards.get(i).title4PopupWindow();// Name从各自的pane里面获取
cardNames[i] = name; cardNames[i] = name;
cardPane.add(this.cards.get(i), cardNames[i]); cardPane.add(this.cards.get(i), cardNames[i]);
addComboBoxItem(cards, i); addComboBoxItem(cards, i);
} }
addItemChangeEvent(); addItemChangeEvent();
initLayout(); initLayout();
jcb.setSelectedIndex(0); jcb.setSelectedIndex(0);
} }
public FurtherBasicBeanPane<? extends T> getSelectedPane(){ public FurtherBasicBeanPane<? extends T> getSelectedPane() {
return cards.get(jcb.getSelectedIndex()); return cards.get(jcb.getSelectedIndex());
} }
protected void addItemChangeEvent() { protected void addItemChangeEvent() {
jcb.addItemListener(new ItemListener() { jcb.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
comboBoxItemStateChanged(); comboBoxItemStateChanged();
CardLayout cl = (CardLayout)cardPane.getLayout(); CardLayout cl = (CardLayout) cardPane.getLayout();
cl.show(cardPane, cardNames[jcb.getSelectedIndex()]); cl.show(cardPane, cardNames[jcb.getSelectedIndex()]);
} }
}); });
} }
protected UIComboBox createComboBox() { protected UIComboBox createComboBox() {
return new UIComboBox(); return new UIComboBox();
} }
protected void addComboBoxItem(List<FurtherBasicBeanPane<? extends T>> cards, int index) { protected void addComboBoxItem(List<FurtherBasicBeanPane<? extends T>> cards, int index) {
jcb.addItem(cards.get(index).title4PopupWindow()); jcb.addItem(cards.get(index).title4PopupWindow());
} }
/** /**
* 设置只支持其中的某个选项, * 设置只支持其中的某个选项,
*/ */
public void justSupportOneSelect(boolean surpport) { public void justSupportOneSelect(boolean surpport) {
if(!surpport) { if (!surpport) {
jcb.setSelectedIndex(0); jcb.setSelectedIndex(0);
} }
jcb.setEnabled(surpport); jcb.setEnabled(surpport);
} }
/** /**
* august 如果需要的布局有变化覆盖之 * august 如果需要的布局有变化覆盖之
*/ */
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(0,6)); this.setLayout(new BorderLayout(0, 6));
JPanel northPane = new JPanel(new BorderLayout()); JPanel northPane = new JPanel(new BorderLayout());
northPane.add(jcb, BorderLayout.CENTER); northPane.add(jcb, BorderLayout.CENTER);
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
northPane.setBorder(UIConstants.CELL_ATTR_NORMALBORDER); this.add(cardPane, BorderLayout.CENTER);
this.add(cardPane, BorderLayout.CENTER);
}
}
protected void comboBoxItemStateChanged() {
protected void comboBoxItemStateChanged() {
}
}
public void reset() {
public void reset() { jcb.setSelectedIndex(0);
jcb.setSelectedIndex(0); for (FurtherBasicBeanPane<?> pane : cards) {
for (FurtherBasicBeanPane<?> pane : cards) { pane.reset();
pane.reset(); }
} }
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override
@Override public void populateBean(T ob) {
public void populateBean(T ob) { for (int i = 0; i < this.cards.size(); i++) {
for (int i = 0; i < this.cards.size(); i++) { FurtherBasicBeanPane pane = cards.get(i);
FurtherBasicBeanPane pane = cards.get(i); if (pane.accept(ob)) {
if (pane.accept(ob)) { pane.populateBean(ob);
pane.populateBean(ob); jcb.setSelectedIndex(i);
jcb.setSelectedIndex(i); return;
return; }
} }
} }
}
@Override
public T updateBean() {
@Override return cards.get(jcb.getSelectedIndex()).updateBean();
public T updateBean() { }
return cards.get(jcb.getSelectedIndex()).updateBean();
} @Override
public void checkValid() throws Exception {
@Override cards.get(jcb.getSelectedIndex()).checkValid();
public void checkValid() throws Exception {
cards.get(jcb.getSelectedIndex()).checkValid(); }
} public int getSelectedIndex() {
return jcb.getSelectedIndex();
public int getSelectedIndex() { }
return jcb.getSelectedIndex();
} public void setSelectedIndex(int index) {
jcb.setSelectedIndex(index);
public void setSelectedIndex(int index) { }
jcb.setSelectedIndex(index);
} public void addTabChangeListener(ItemListener l) {
jcb.addItemListener(l);
public void addTabChangeListener(ItemListener l){ }
jcb.addItemListener(l);
} public UIComboBox getUIComboBox() {
return this.jcb;
public UIComboBox getUIComboBox(){ }
return this.jcb;
} public List<FurtherBasicBeanPane<? extends T>> getCards() {
return this.cards;
public List<FurtherBasicBeanPane<? extends T>> getCards(){ }
return this.cards;
} public void clear() {
reset();
public void clear() { }
reset();
}
} }

15
designer_base/src/com/fr/design/gui/ibutton/UITabGroup.java

@ -10,6 +10,7 @@ import com.fr.design.constants.UIConstants;
public class UITabGroup extends UIButtonGroup<Integer> { public class UITabGroup extends UIButtonGroup<Integer> {
private boolean isOneLineTab = false; private boolean isOneLineTab = false;
private boolean isDrawLine = true;
private static final int BUTTON_NUMBER = 5; private static final int BUTTON_NUMBER = 5;
private static final int SEVEN_NUMBER = 7; private static final int SEVEN_NUMBER = 7;
private static final int ORIGINAL_WIDTH = 10; private static final int ORIGINAL_WIDTH = 10;
@ -50,7 +51,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
g2d.setColor(UIConstants.LINE_COLOR); g2d.setColor(UIConstants.LINE_COLOR);
if (!isTwoLine()) { if (!isTwoLine()) {
int width = isDrawLine() ? ORIGINAL_WIDTH : 0; int width = isDrawLine ? ORIGINAL_WIDTH : 0;
for (int i = 0; i < labelButtonList.size() - 1; i++) { for (int i = 0; i < labelButtonList.size() - 1; i++) {
width += labelButtonList.get(i).getWidth() + 1; width += labelButtonList.get(i).getWidth() + 1;
int height = labelButtonList.get(i).getHeight(); int height = labelButtonList.get(i).getHeight();
@ -58,7 +59,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
} }
width += labelButtonList.get(labelButtonList.size() - 1).getWidth() + 1; width += labelButtonList.get(labelButtonList.size() - 1).getWidth() + 1;
if (isDrawLine()) { if (isDrawLine) {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(ORIGINAL_WIDTH, 0, width - ORIGINAL_WIDTH, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); g2d.drawRoundRect(ORIGINAL_WIDTH, 0, width - ORIGINAL_WIDTH, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
@ -82,7 +83,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} }
if (isDrawLine()) { if (isDrawLine) {
g2d.drawLine(0, getHeight() / 2, getWidth(), getHeight() / 2); g2d.drawLine(0, getHeight() / 2, getWidth(), getHeight() / 2);
} }
} }
@ -127,12 +128,16 @@ public class UITabGroup extends UIButtonGroup<Integer> {
} }
protected boolean isDrawLine() { protected boolean isDrawLine() {
return true; return isDrawLine;
}
public void setDrawLine(boolean isDrawLine) {
this.isDrawLine = isDrawLine;
} }
@Override @Override
protected Border getGroupBorder() { protected Border getGroupBorder() {
if (!isDrawLine()) { if (!isDrawLine) {
return BorderFactory.createEmptyBorder(1, 1, 1, 1); return BorderFactory.createEmptyBorder(1, 1, 1, 1);
} }
return BorderFactory.createEmptyBorder(1, GAP, 1, GAP); return BorderFactory.createEmptyBorder(1, GAP, 1, GAP);

47
designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java

@ -0,0 +1,47 @@
package com.fr.design.gui.itextfield;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.text.Document;
/**
* Created by ibm on 2017/8/16.
*/
public class UIPropertyTextField extends UITextField{
public UIPropertyTextField() {
super();
}
public UIPropertyTextField(int columns) {
super(columns);
}
public UIPropertyTextField(String text, int columns) {
super(text, columns);
}
public UIPropertyTextField(String text) {
super(text);
}
public UIPropertyTextField(Document doc, String text, int columns) {
super(doc, text, columns);
}
protected void initListener() {
if (shouldResponseChangeListener()) {
addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
}
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
}
}
}

14
designer_base/src/com/fr/design/gui/itextfield/UITextField.java

@ -13,8 +13,6 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import javax.swing.text.Document; import javax.swing.text.Document;
import java.awt.*; import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
/** /**
* @author Jerry * @author Jerry
@ -61,13 +59,19 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs
protected void initListener() { protected void initListener() {
if (shouldResponseChangeListener()) { if (shouldResponseChangeListener()) {
addFocusListener(new FocusListener() { getDocument().addDocumentListener(new DocumentListener() {
@Override @Override
public void focusGained(FocusEvent e) { public void insertUpdate(DocumentEvent e) {
attributeChange();
}
@Override
public void removeUpdate(DocumentEvent e) {
attributeChange();
} }
@Override @Override
public void focusLost(FocusEvent e) { public void changedUpdate(DocumentEvent e) {
attributeChange(); attributeChange();
} }
}); });

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

@ -39,7 +39,7 @@ import java.util.Arrays;
*/ */
public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameObserver { public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameObserver {
private static final int ANGEL = 90; private static final int ANGEL = 90;
private static final Dimension SPINNER_DIMENSION = new Dimension(60, 20); private static final Dimension SPINNER_DIMENSION = new Dimension(70, 20);
private static final String[] TEXT = {Inter.getLocText("FR-Designer_StyleAlignment_Wrap_Text"), Inter.getLocText("FR-Designer_StyleAlignment_Single_Line"), private static final String[] TEXT = {Inter.getLocText("FR-Designer_StyleAlignment_Wrap_Text"), Inter.getLocText("FR-Designer_StyleAlignment_Single_Line"),
Inter.getLocText("FR-Designer_StyleAlignment_Single_Line(Adjust_Font)"), Inter.getLocText("FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)")}; Inter.getLocText("FR-Designer_StyleAlignment_Single_Line(Adjust_Font)"), Inter.getLocText("FR-Designer_StyleAlignment_Multi_Line(Adjust_Font)")};

1
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -68,7 +68,6 @@ public class FormatPane extends AbstractBasicStylePane {
*/ */
public FormatPane() { public FormatPane() {
this.initComponents(TYPES); this.initComponents(TYPES);
this.setBorder(UIConstants.CELL_ATTR_NORMALBORDER);
} }
protected void initComponents(Integer[] types) { protected void initComponents(Integer[] types) {

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

@ -39,17 +39,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final int POPUP_MIN_HEIGHT = 145; private static final int POPUP_MIN_HEIGHT = 145;
private static final int POPUP_MAX_HEIGHT = 480; private static final int POPUP_MAX_HEIGHT = 480;
private static final int POPUP_DEFAULT_HEIGHT = 360; private static final int POPUP_DEFAULT_HEIGHT = 360;
private static final String KEY_CELL_ELEMENT = "cellElement"; public static final String KEY_CELL_ELEMENT = "cellElement";
private static final String KEY_CELL_ATTR = "cellAttr"; public static final String KEY_CELL_ATTR = "cellAttr";
private static final String KEY_FLOAT_ELEMENT = "floatElement"; public static final String KEY_FLOAT_ELEMENT = "floatElement";
private static final String KEY_WIDGET_SETTINGS = "widgetSettings"; public static final String KEY_WIDGET_SETTINGS = "widgetSettings";
private static final String KEY_CONDITION_ATTR = "conditionAttr"; public static final String KEY_CONDITION_ATTR = "conditionAttr";
private static final String KEY_HYPERLINK = "hyperlink"; public static final String KEY_HYPERLINK = "hyperlink";
private static final String KEY_WIDGET_LIB = "widgetLib"; public static final String KEY_WIDGET_LIB = "widgetLib";
private static final String KEY_AUTHORITY_EDITION = "authorityEdition"; public static final String KEY_AUTHORITY_EDITION = "authorityEdition";
private static final String KEY_CONFIGURED_ROLES = "editedRoles"; public static final String KEY_CONFIGURED_ROLES = "editedRoles";
private static final String DEFAULT_PANE = "defaultPane"; public static final String DEFAULT_PANE = "defaultPane";
private static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane"; public static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane";
private JPanel defaultPane; // "无可用配置项"面板 private JPanel defaultPane; // "无可用配置项"面板
private JPanel defaultAuthorityPane; // "该元素不支持权限编辑" private JPanel defaultAuthorityPane; // "该元素不支持权限编辑"
@ -359,6 +359,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
propertyItemMap.get(KEY_WIDGET_SETTINGS).removeHeaderPane(); propertyItemMap.get(KEY_WIDGET_SETTINGS).removeHeaderPane();
} }
public void switchTabTo(String tabName) {
PropertyItem propertyItem = propertyItemMap.get(tabName);
if (propertyItem == null) {
return;
}
if (propertyItem.isVisible() && propertyItem.isEnabled() && !propertyItem.isPoppedOut()) {
propertyCard.show(rightPane, tabName);
propertyItem.setTabButtonSelected();
}
}
/** /**
* 刷新右面板 * 刷新右面板
*/ */

4
designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java

@ -22,7 +22,7 @@ import java.awt.*;
public class GradientBackgroundQuickPane extends BackgroundQuickPane { public class GradientBackgroundQuickPane extends BackgroundQuickPane {
private static final long serialVersionUID = -6854603990673031897L; private static final long serialVersionUID = -6854603990673031897L;
private static final int DEFAULT_GRADIENT_WIDTH = 185; private static final int DEFAULT_GRADIENT_WIDTH = 150 ;
private int gradientBarWidth = DEFAULT_GRADIENT_WIDTH; private int gradientBarWidth = DEFAULT_GRADIENT_WIDTH;
@ -52,7 +52,7 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{gradientBar, null}, new Component[]{gradientBar, null},
new Component[]{new UILabel(Inter.getLocText("Gradient-Direction") + ":"), directionPane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Gradient_Direction")), directionPane}
}; };
JPanel Gradient = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel Gradient = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());

7
designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java

@ -61,17 +61,14 @@ public class ImageBackgroundQuickPane extends BackgroundQuickPane {
contentPane.add(southPane, BorderLayout.NORTH); contentPane.add(southPane, BorderLayout.NORTH);
this.add(contentPane, BorderLayout.CENTER); this.add(contentPane, BorderLayout.CENTER);
JPanel selectFilePane = new JPanel(new GridLayout(0, 2));
UIButton selectPictureButton = new UIButton(Inter.getLocText("Image-Select_Picture")); UIButton selectPictureButton = new UIButton(Inter.getLocText("Image-Select_Picture"));
selectFilePane.add(new JPanel());
selectFilePane.add(selectPictureButton);
selectPictureButton.addActionListener(selectPictureActionListener); selectPictureButton.addActionListener(selectPictureActionListener);
if(hasImageLayout){ if(hasImageLayout){
southPane.add(imageLayoutPane, BorderLayout.CENTER); southPane.add(imageLayoutPane, BorderLayout.SOUTH);
} }
southPane.add(selectFilePane, BorderLayout.SOUTH); southPane.add(selectPictureButton, BorderLayout.CENTER);
imageLayoutPane.addChangeListener(new ChangeListener() { imageLayoutPane.addChangeListener(new ChangeListener() {

372
designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java

@ -2,14 +2,17 @@ package com.fr.design.mainframe.backgroundpane;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.background.PatternBackground; import com.fr.base.background.PatternBackground;
import com.fr.design.constants.UIConstants;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.design.style.color.ColorSelectBox;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -25,182 +28,191 @@ import java.awt.geom.Rectangle2D;
*/ */
public class PatternBackgroundQuickPane extends BackgroundQuickPane { public class PatternBackgroundQuickPane extends BackgroundQuickPane {
private int patternIndex = 0; // pattern setIndex. private int patternIndex = 0; // pattern setIndex.
private final static int DEFAULT_DIM_HEIGHT = 190; private final static int DEFAULT_DIM_HEIGHT = 210;
private ColorSelectBox foregroundColorPane; private ColorSelectBox foregroundColorPane;
private ColorSelectBox backgroundColorPane; private ColorSelectBox backgroundColorPane;
private PatternButton[] patternButtonArray; private PatternButton[] patternButtonArray;
public PatternBackgroundQuickPane() { public PatternBackgroundQuickPane() {
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout(0, 4));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(contentPane, BorderLayout.NORTH); this.add(contentPane, BorderLayout.NORTH);
contentPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5)); contentPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5));
JPanel typePane2 = new JPanel(); JPanel typePane2 = new JPanel();
contentPane.add(typePane2); contentPane.add(typePane2);
typePane2.setLayout(new GridLayout(0, 8, 1, 1)); typePane2.setLayout(new GridLayout(0, 8, 1, 1));
typePane2.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); typePane2.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
ButtonGroup patternButtonGroup = new ButtonGroup(); ButtonGroup patternButtonGroup = new ButtonGroup();
patternButtonArray = new PatternButton[PatternBackground.PATTERN_COUNT]; patternButtonArray = new PatternButton[PatternBackground.PATTERN_COUNT];
for (int i = 0; i < PatternBackground.PATTERN_COUNT; i++) { for (int i = 0; i < PatternBackground.PATTERN_COUNT; i++) {
patternButtonArray[i] = new PatternButton(i); patternButtonArray[i] = new PatternButton(i);
patternButtonGroup.add(patternButtonArray[i]); patternButtonGroup.add(patternButtonArray[i]);
typePane2.add(patternButtonArray[i]); typePane2.add(patternButtonArray[i]);
} }
JPanel colorPane = new JPanel(new GridLayout(0, 2)); foregroundColorPane = new ColorSelectBox(60);
foregroundColorPane = new ColorSelectBox(70); backgroundColorPane = new ColorSelectBox(60);
backgroundColorPane = new ColorSelectBox(70);
colorPane.add(this.createLabelColorPane(Inter.getLocText("FR-Designer_Foreground") + ":", foregroundColorPane)); double f = TableLayout.FILL;
colorPane.add(this.createLabelColorPane(Inter.getLocText("FR-Designer_Background") + ":", backgroundColorPane)); double p = TableLayout.PREFERRED;
this.add(colorPane, BorderLayout.CENTER); Component[][] components = new Component[][]{
foregroundColorPane.addSelectChangeListener(colorChangeListener); new Component[]{null, null},
backgroundColorPane.addSelectChangeListener(colorChangeListener); new Component[]{new UILabel(Inter.getLocText("FR-Designer_Foreground"), UILabel.LEFT), foregroundColorPane},
} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background"), UILabel.LEFT), backgroundColorPane},
};
@Override double[] rowSize = {p, p, p};
public Dimension getPreferredSize() { double[] columnSize = {p, f};
Dimension dim = super.getPreferredSize(); int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
dim.height = DEFAULT_DIM_HEIGHT; JPanel colorPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE);
return dim; this.add(colorPane, BorderLayout.CENTER);
} foregroundColorPane.addSelectChangeListener(colorChangeListener);
backgroundColorPane.addSelectChangeListener(colorChangeListener);
private JPanel createLabelColorPane(String text, JComponent colorPane) { }
JPanel labelColorPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
labelColorPane.add(new UILabel(text)); @Override
labelColorPane.add(colorPane); public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
return labelColorPane; dim.height = DEFAULT_DIM_HEIGHT;
} return dim;
}
public void populateBean(Background background) {
PatternBackground patternBackground = (PatternBackground) background; private JPanel createLabelColorPane(String text, JComponent colorPane) {
int patternIndex = patternBackground.getPatternIndex(); JPanel labelColorPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
labelColorPane.add(new UILabel(text));
if (patternIndex >= 0 && patternIndex < this.patternButtonArray.length) { labelColorPane.add(colorPane);
this.patternButtonArray[patternIndex].setSelected(true);
this.patternIndex = patternIndex; return labelColorPane;
} else { }
this.patternIndex = 0;
} public void populateBean(Background background) {
PatternBackground patternBackground = (PatternBackground) background;
foregroundColorPane.setSelectObject(patternBackground.getForeground()); int patternIndex = patternBackground.getPatternIndex();
backgroundColorPane.setSelectObject(patternBackground.getBackground());
} if (patternIndex >= 0 && patternIndex < this.patternButtonArray.length) {
this.patternButtonArray[patternIndex].setSelected(true);
public Background updateBean() { this.patternIndex = patternIndex;
return new PatternBackground(patternIndex, foregroundColorPane.getSelectObject(), backgroundColorPane.getSelectObject()); } else {
} this.patternIndex = 0;
}
/** foregroundColorPane.setSelectObject(patternBackground.getForeground());
* 给组件登记一个观察者监听事件 backgroundColorPane.setSelectObject(patternBackground.getBackground());
* }
* @param listener 观察者监听事件
*/ public Background updateBean() {
public void registerChangeListener(final UIObserverListener listener) { return new PatternBackground(patternIndex, foregroundColorPane.getSelectObject(), backgroundColorPane.getSelectObject());
foregroundColorPane.addSelectChangeListener(new ChangeListener() { }
public void stateChanged(ChangeEvent e) {
listener.doChange();
} /**
}); * 给组件登记一个观察者监听事件
backgroundColorPane.addSelectChangeListener(new ChangeListener() { *
public void stateChanged(ChangeEvent e) { * @param listener 观察者监听事件
listener.doChange(); */
} public void registerChangeListener(final UIObserverListener listener) {
}); foregroundColorPane.addSelectChangeListener(new ChangeListener() {
for (int i = 0, count = patternButtonArray.length; i < count; i ++) { public void stateChanged(ChangeEvent e) {
patternButtonArray[i].addChangeListener(new ChangeListener() { listener.doChange();
public void stateChanged(ChangeEvent e) { }
listener.doChange(); });
} backgroundColorPane.addSelectChangeListener(new ChangeListener() {
}); public void stateChanged(ChangeEvent e) {
} listener.doChange();
} }
});
for (int i = 0, count = patternButtonArray.length; i < count; i++) {
// Foreground or Background changed. patternButtonArray[i].addChangeListener(new ChangeListener() {
ChangeListener colorChangeListener = new ChangeListener() { public void stateChanged(ChangeEvent e) {
listener.doChange();
public void stateChanged(ChangeEvent e) { }
for (int i = 0; i < patternButtonArray.length; i++) { });
patternButtonArray[i].setPatternForeground(foregroundColorPane.getSelectObject()); }
patternButtonArray[i].setPatternBackground(backgroundColorPane.getSelectObject()); }
}
PatternBackgroundQuickPane.this.repaint();// repaint // Foreground or Background changed.
} ChangeListener colorChangeListener = new ChangeListener() {
};
public void stateChanged(ChangeEvent e) {
/** for (int i = 0; i < patternButtonArray.length; i++) {
* Pattern type button. patternButtonArray[i].setPatternForeground(foregroundColorPane.getSelectObject());
*/ patternButtonArray[i].setPatternBackground(backgroundColorPane.getSelectObject());
class PatternButton extends JToggleButton implements ActionListener { }
public PatternButton(int pIndex) { PatternBackgroundQuickPane.this.repaint();// repaint
this.pIndex = pIndex; }
this.addActionListener(this); };
this.setCursor(new Cursor(Cursor.HAND_CURSOR)); /**
this.setBorder(null); * Pattern type button.
this.patternBackground = new PatternBackground(this.pIndex, Color.lightGray, Color.black); */
} class PatternButton extends JToggleButton implements ActionListener {
public void paintComponent(Graphics g) { public PatternButton(int pIndex) {
Graphics2D g2d = (Graphics2D) g; this.pIndex = pIndex;
this.addActionListener(this);
Dimension d = getSize();
this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1)); this.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.setBorder(null);
if (this.pIndex == patternIndex) {// it's selected. this.patternBackground = new PatternBackground(this.pIndex, Color.lightGray, Color.black);
g2d.setPaint(UIConstants.LINE_COLOR); }
GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1));
} public void paintComponent(Graphics g) {
} Graphics2D g2d = (Graphics2D) g;
public Dimension getPreferredSize() { Dimension d = getSize();
return new Dimension(super.getPreferredSize().width, 20); this.patternBackground.paint(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1));
}
if (this.pIndex == patternIndex) {// it's selected.
public void setPatternForeground(Color foreground) { g2d.setPaint(UIConstants.LINE_COLOR);
this.patternBackground.setForeground(foreground); GraphHelper.draw(g2d, new Rectangle2D.Double(0, 0, d.width - 1, d.height - 1));
} }
}
public void setPatternBackground(Color background) {
this.patternBackground.setBackground(background); public Dimension getPreferredSize() {
} return new Dimension(super.getPreferredSize().width, 20);
}
/**
* set Pattern setIndex. public void setPatternForeground(Color foreground) {
*/ this.patternBackground.setForeground(foreground);
public void actionPerformed(ActionEvent evt) { }
PatternBackgroundQuickPane.this.patternIndex = pIndex;
public void setPatternBackground(Color background) {
fireChagneListener(); this.patternBackground.setBackground(background);
PatternBackgroundQuickPane.this.repaint();// repaint }
}
/**
public void addChangeListener(ChangeListener changeListener) { * set Pattern setIndex.
this.changeListener = changeListener; */
} public void actionPerformed(ActionEvent evt) {
PatternBackgroundQuickPane.this.patternIndex = pIndex;
private void fireChagneListener() {
if (this.changeListener != null) { fireChagneListener();
ChangeEvent evt = new ChangeEvent(this); PatternBackgroundQuickPane.this.repaint();// repaint
this.changeListener.stateChanged(evt); }
}
} public void addChangeListener(ChangeListener changeListener) {
this.changeListener = changeListener;
private int pIndex = 0; }
private PatternBackground patternBackground;
} private void fireChagneListener() {
if (this.changeListener != null) {
@Override ChangeEvent evt = new ChangeEvent(this);
public boolean accept(Background background) { this.changeListener.stateChanged(evt);
return background instanceof PatternBackground; }
} }
@Override private int pIndex = 0;
public String title4PopupWindow() { private PatternBackground patternBackground;
return Inter.getLocText("FR-Designer_Background-Pattern"); }
}
@Override
public boolean accept(Background background) {
return background instanceof PatternBackground;
}
@Override
public String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Background-Pattern");
}
} }

1
designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java

@ -33,7 +33,6 @@ public class TextureBackgroundQuickPane extends BackgroundQuickPane {
this.add(borderPane, BorderLayout.NORTH); this.add(borderPane, BorderLayout.NORTH);
contentPane.setLayout(new GridLayout(0, 8, 1, 1)); contentPane.setLayout(new GridLayout(0, 8, 1, 1));
contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
borderPane.setPreferredSize(new Dimension(0, 145));
ButtonGroup patternButtonGroup = new ButtonGroup(); ButtonGroup patternButtonGroup = new ButtonGroup();
textureButtonArray = new TextureButton[EMBED_TEXTURE_PAINT_ARRAY.length]; textureButtonArray = new TextureButton[EMBED_TEXTURE_PAINT_ARRAY.length];
for (int i = 0; i < EMBED_TEXTURE_PAINT_ARRAY.length; i++) { for (int i = 0; i < EMBED_TEXTURE_PAINT_ARRAY.length; i++) {

14
designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java

@ -16,9 +16,6 @@ public class FormMobileAttrPane extends BasicBeanPane<FormMobileAttr>{
//工具栏容器 //工具栏容器
private MobileToolBarPane mobileToolBarPane; private MobileToolBarPane mobileToolBarPane;
//h5解析容器
private MobileUseHtmlGroupPane mobileUseHtmlGroupPane;
static final int PADDINGHEIGHT = 10; static final int PADDINGHEIGHT = 10;
public FormMobileAttrPane() { public FormMobileAttrPane() {
@ -29,21 +26,14 @@ public class FormMobileAttrPane extends BasicBeanPane<FormMobileAttr>{
//拉长两个Panel的高度去填满整个对话框。 //拉长两个Panel的高度去填满整个对话框。
private void initComponents() { private void initComponents() {
JPanel jPanel1 = new JPanel(); JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
jPanel1.setLayout(FRGUIPaneFactory.createBorderLayout()); jPanel1.setLayout(FRGUIPaneFactory.createBorderLayout());
jPanel1.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); jPanel1.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
jPanel2.setLayout(FRGUIPaneFactory.createBorderLayout());
jPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
this.mobileToolBarPane = new MobileToolBarPane(); this.mobileToolBarPane = new MobileToolBarPane();
this.mobileUseHtmlGroupPane = new MobileUseHtmlGroupPane(Inter.getLocText("FR-Designer_Mobile_Form_Analysis_Annotation"));
//设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中 //设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中
jPanel1.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + PADDINGHEIGHT)); jPanel1.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + PADDINGHEIGHT));
jPanel2.setPreferredSize(new Dimension(0, (int)this.mobileUseHtmlGroupPane.getPreferredSize().getHeight() + PADDINGHEIGHT)); jPanel1.add("North", this.mobileToolBarPane);
jPanel1.add("North", this.mobileUseHtmlGroupPane);
jPanel2.add("North", this.mobileToolBarPane);
this.add("North", jPanel1); this.add("North", jPanel1);
this.add("Center", jPanel2);
} }
@Override @Override
@ -52,14 +42,12 @@ public class FormMobileAttrPane extends BasicBeanPane<FormMobileAttr>{
ob = new FormMobileAttr(); ob = new FormMobileAttr();
} }
this.mobileToolBarPane.populateBean(ob); this.mobileToolBarPane.populateBean(ob);
this.mobileUseHtmlGroupPane.populateBean(ob);
} }
@Override @Override
public FormMobileAttr updateBean() { public FormMobileAttr updateBean() {
FormMobileAttr formMobileAttr = new FormMobileAttr(); FormMobileAttr formMobileAttr = new FormMobileAttr();
this.mobileToolBarPane.updateBean(formMobileAttr); this.mobileToolBarPane.updateBean(formMobileAttr);
this.mobileUseHtmlGroupPane.updateBean(formMobileAttr);
return formMobileAttr; return formMobileAttr;
} }

33
designer_form/src/com/fr/design/form/mobile/MobileUseHtmlGroupPane.java

@ -1,33 +0,0 @@
package com.fr.design.form.mobile;
import com.fr.design.dialog.mobile.MobileUseHtmlGroupBeanPane;
import com.fr.form.main.mobile.FormMobileAttr;
/**
* 直接copyreport中的MobileUseHtmlGroupPane
* Created by fanglei on 2016/12/28.
*/
public class MobileUseHtmlGroupPane extends MobileUseHtmlGroupBeanPane<FormMobileAttr> {
public MobileUseHtmlGroupPane(String annotation) {
super(annotation);
}
@Override
public void populateBean(FormMobileAttr mobileAttr) {
if(mobileAttr != null) {
selectIndexButton(mobileAttr.isUseHTML() ? 1 : 0);
}
}
@Override
public FormMobileAttr updateBean() {
return null;
}
@Override
public void updateBean(FormMobileAttr mobileAttr) {
if(mobileAttr != null) {
mobileAttr.setUseHTML(getSelectRadioIndex() == 1);
}
}
}

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

@ -114,7 +114,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
FormWidgetDetailPane.getInstance(this)); FormWidgetDetailPane.getInstance(this));
if (!BaseUtils.isAuthorityEditing()) { if (!BaseUtils.isAuthorityEditing()) {
ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(this); ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(this);
parameterPropertyPane.setAddParaPaneVisible(true); parameterPropertyPane.refreshState();
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane( EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(

4
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -326,9 +326,11 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetPrope
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(DesignerEvent evt) {
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED if (evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED || evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) { || evt.getCreatorEventID() == DesignerEvent.CREATOR_RESIZED) {
formWidgetCardPane.populate(); formWidgetCardPane.populate();
}else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED){
formWidgetCardPane = new FormWidgetCardPane(designer);
formWidgetCardPane.populate();
} }
} }

31
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.widget.ui;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
@ -17,6 +18,7 @@ import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -46,7 +48,6 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (widgetBoundPane != null) { if (widgetBoundPane != null) {
attriCardPane.add(widgetBoundPane, BorderLayout.CENTER); attriCardPane.add(widgetBoundPane, BorderLayout.CENTER);
} }
} }
public XLayoutContainer getParent(XCreator source) { public XLayoutContainer getParent(XCreator source) {
@ -102,22 +103,40 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
} }
private void initComponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
BasicScrollPane basicScrollPane = new BasicScrollPane() {
@Override
protected JPanel createContentPane() {
return jPanel;
}
@Override
public void populateBean(Object ob) {
}
@Override
protected String title4PopupWindow() {
return null;
}
};
this.add(basicScrollPane, BorderLayout.CENTER);
if (xCreator.supportSetVisibleOrEnable()) { if (xCreator.supportSetVisibleOrEnable()) {
widgetPropertyPane = new FormBasicWidgetPropertyPane(); widgetPropertyPane = new FormBasicWidgetPropertyPane();
} else { } else {
widgetPropertyPane = new FormBasicPropertyPane(); widgetPropertyPane = new FormBasicPropertyPane();
} }
UIExpandablePane uiExpandablePane = new UIExpandablePane("基本", 280, 20, widgetPropertyPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 20, widgetPropertyPane);
this.add(uiExpandablePane, BorderLayout.NORTH); jPanel.add(uiExpandablePane, BorderLayout.NORTH);
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(attriCardPane, BorderLayout.CENTER); jPanel.add(attriCardPane, BorderLayout.CENTER);
this.listener2 = new AttributeChangeListener() { this.listener2 = new AttributeChangeListener() {
@Override @Override

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

@ -45,7 +45,7 @@ public class ParameterPropertyPane extends JPanel{
revalidate(); revalidate();
} }
public ParameterPropertyPane() { private ParameterPropertyPane() {
toolbarPane = new ParameterToolBarPane(); toolbarPane = new ParameterToolBarPane();
BasicScrollPane basicScrollPane = new BasicScrollPane() { BasicScrollPane basicScrollPane = new BasicScrollPane() {
@Override @Override
@ -77,6 +77,11 @@ public class ParameterPropertyPane extends JPanel{
this.add(addParaPane, BorderLayout.CENTER); this.add(addParaPane, BorderLayout.CENTER);
} }
// 显示或隐藏添加参数面板
public void refreshState() {
setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem());
}
public void setAddParaPaneVisible(boolean isVisible) { public void setAddParaPaneVisible(boolean isVisible) {
if (isVisible == addParaPane.isVisible()) { if (isVisible == addParaPane.isVisible()) {
return; return;

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

@ -82,6 +82,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(label); this.add(label);
if (parameterArray.length == 0) { if (parameterArray.length == 0) {
ParameterPropertyPane.getInstance().refreshState();
this.setVisible(false); this.setVisible(false);
this.repaint(); this.repaint();
return; return;
@ -102,6 +103,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(addAll); this.add(addAll);
this.doLayout(); this.doLayout();
ParameterPropertyPane.getInstance().refreshState();
this.repaint(); this.repaint();
} }

10
designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -17,8 +17,8 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> { public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> {
private UITextField hotkeysTextField; private UIPropertyTextField hotkeysTextField;
private UITextField buttonNameTextField; private UIPropertyTextField buttonNameTextField;
private AccessibleIconEditor iconPane; private AccessibleIconEditor iconPane;
@ -35,8 +35,8 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
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}};
iconPane = new AccessibleIconEditor(); iconPane = new AccessibleIconEditor();
hotkeysTextField = new UITextField(); hotkeysTextField = new UIPropertyTextField();
buttonNameTextField = new UITextField(); buttonNameTextField = new UIPropertyTextField();
Component[] backgroundCompPane = createBackgroundComp(); Component[] backgroundCompPane = createBackgroundComp();
Component[] frFont = createFontPane(); Component[] frFont = createFontPane();
UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background")); UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background"));

6
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java

@ -4,7 +4,7 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -16,7 +16,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UIPropertyTextField text;
private UISpinner fontSizePane; private UISpinner fontSizePane;
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
@ -27,7 +27,7 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private void iniComoponents() { private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UITextField(); text = new UIPropertyTextField();
fontSizePane = new UISpinner(0, 20, 1, 0); fontSizePane = new UISpinner(0, 20, 1, 0);
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL; double f = TableLayout.FILL;

6
designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java

@ -4,7 +4,7 @@ import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
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.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.form.ui.ComboBox; import com.fr.form.ui.ComboBox;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -13,7 +13,7 @@ import java.awt.*;
public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> { public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
private UITextField waterMarkField; private UIPropertyTextField waterMarkField;
public ComboBoxDefinePane(XCreator xCreator) { public ComboBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -26,7 +26,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
} }
public Component[] createWaterMarkPane() { public Component[] createWaterMarkPane() {
waterMarkField = new UITextField(); waterMarkField = new UIPropertyTextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField};
} }

7
designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java

@ -3,10 +3,9 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIHeadGroup;
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.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
@ -18,7 +17,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
private UIButtonGroup returnType; private UIButtonGroup returnType;
private UITextField waterMarkDictPane; private UIPropertyTextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
public ComboCheckBoxDefinePane(XCreator xCreator) { public ComboCheckBoxDefinePane(XCreator xCreator) {
@ -32,7 +31,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
} }
public Component[] createWaterMarkPane() { public Component[] createWaterMarkPane() {
waterMarkDictPane = new UITextField(); waterMarkDictPane = new UIPropertyTextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
} }

1
designer_form/src/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java

@ -3,7 +3,6 @@ package com.fr.design.widget.ui.designer;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.form.ui.CustomWriteAbleRepeatEditor;
import com.fr.general.Inter; import com.fr.general.Inter;

34
designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -1,12 +1,11 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.base.GraphHelper;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
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.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -14,16 +13,16 @@ import com.fr.form.ui.FieldEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30;
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UITextField errorMsgTextField; protected UIPropertyTextField errorMsgTextField;
protected JPanel validatePane; protected JPanel validatePane;
protected UISpinner fontSizePane; protected UISpinner fontSizePane;
@ -40,9 +39,8 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
// allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT));
fontSizePane = new UISpinner(0, 20, 1, 0); fontSizePane = new UISpinner(0, 20, 1, 0);
errorMsgTextField = new UITextField(); errorMsgTextField = new UIPropertyTextField();
JPanel contentPane = this.setFirstContentPane(); JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) { if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
@ -71,6 +69,27 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
return e; return e;
} }
protected void initErrorMsgPane() {
// 错误信息
errorMsgTextField = new UIPropertyTextField();
// // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
errorMsgTextField.setToolTipText(errorMsgTextField.getText());
}
public void insertUpdate(DocumentEvent e) {
errorMsgTextField.setToolTipText(errorMsgTextField.getText());
}
public void removeUpdate(DocumentEvent e) {
errorMsgTextField.setToolTipText(errorMsgTextField.getText());
}
});
}
protected abstract T updateSubFieldEditorBean(); protected abstract T updateSubFieldEditorBean();
@ -83,6 +102,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
} }
protected void addValidatePane() { protected void addValidatePane() {
initErrorMsgPane();
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")); final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip"));

6
designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java

@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
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.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -18,7 +18,7 @@ import java.awt.*;
import java.util.List; import java.util.List;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private UITextField srcTextField; private UIPropertyTextField srcTextField;
private ReportletParameterViewPane parameterViewPane; private ReportletParameterViewPane parameterViewPane;
private UICheckBox horizontalCheck; private UICheckBox horizontalCheck;
private UICheckBox verticalCheck; private UICheckBox verticalCheck;
@ -44,7 +44,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
Component[][] coms = { Component[][] coms = {
{ horizontalCheck, null }, { horizontalCheck, null },
{ verticalCheck, null }, { verticalCheck, null },
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UIPropertyTextField() },
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } };
int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}}; int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5);

6
designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -18,7 +18,7 @@ import java.awt.event.KeyEvent;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> { public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegPane regPane; protected RegPane regPane;
private UITextField waterMarkDictPane; private UIPropertyTextField waterMarkDictPane;
FormWidgetValuePane formWidgetValuePane; FormWidgetValuePane formWidgetValuePane;
public TextFieldEditorDefinePane(XCreator xCreator) { public TextFieldEditorDefinePane(XCreator xCreator) {
@ -47,7 +47,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
}; };
regPane.addPhoneRegListener(pl); regPane.addPhoneRegListener(pl);
waterMarkDictPane = new UITextField(13); waterMarkDictPane = new UIPropertyTextField();
waterMarkDictPane.addKeyListener(new KeyAdapter() { waterMarkDictPane.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
regPane.removePhoneRegListener(pl); regPane.removePhoneRegListener(pl);

6
designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java

@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -11,14 +11,14 @@ import java.awt.*;
public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane { public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
protected UITextField waterMarkDictPane; protected UIPropertyTextField waterMarkDictPane;
public TreeComboBoxEditorDefinePane(XCreator xCreator) { public TreeComboBoxEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
} }
public Component[] createWaterMarkPane(){ public Component[] createWaterMarkPane(){
waterMarkDictPane = new UITextField(); waterMarkDictPane = new UIPropertyTextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
} }

6
designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java

@ -1,6 +1,6 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.WaterMark; import com.fr.form.ui.WaterMark;
@ -8,12 +8,12 @@ import javax.swing.*;
public class WaterMarkDictPane extends JPanel{ public class WaterMarkDictPane extends JPanel{
private UITextField waterMarkTextField; private UIPropertyTextField waterMarkTextField;
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
waterMarkTextField = new UITextField(); waterMarkTextField = new UIPropertyTextField();
this.add(waterMarkTextField); this.add(waterMarkTextField);
} }

2
designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -39,7 +39,7 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), new UITextField()}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane},
new Component[]{buttonGroupDictPane, null} new Component[]{buttonGroupDictPane, null}
}; };

1
designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java

@ -3,7 +3,6 @@ package com.fr.design.widget.ui.designer.component;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;

Loading…
Cancel
Save