Browse Source

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

master
mengao 7 years ago
parent
commit
7bd18ed09a
  1. 9
      designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java
  2. 7
      designer/src/com/fr/design/mainframe/CellElementPropertyPane.java
  3. 83
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  4. 11
      designer/src/com/fr/design/mainframe/ReportComponentComposite.java
  5. 8
      designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java
  6. 120
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  7. 1
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java
  8. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif
  9. 16
      designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java
  10. 6
      designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  11. 14
      designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  12. 3
      designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java
  13. 7
      designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java
  14. 6
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  15. 2
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  16. 6
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  17. 6
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  18. 273
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  19. 32
      designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java
  20. 25
      designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java
  21. 15
      designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java
  22. 46
      designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java
  23. 5
      designer/src/com/fr/poly/creator/ECBlockPane.java
  24. 39
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  25. 34
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  26. 63
      designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java
  27. 15
      designer_base/src/com/fr/design/actions/core/ActionFactory.java
  28. 10
      designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java
  29. 9
      designer_base/src/com/fr/design/file/HistoryTemplateListPane.java
  30. 373
      designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java
  31. 227
      designer_base/src/com/fr/design/gui/ibutton/UISliderButtonUI.java
  32. 47
      designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java
  33. 6
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  34. 2
      designer_base/src/com/fr/design/gui/style/NumberDragBar.java
  35. BIN
      designer_base/src/com/fr/design/images/buttonicon/run24.png
  36. BIN
      designer_base/src/com/fr/design/images/buttonicon/runs.png
  37. BIN
      designer_base/src/com/fr/design/images/m_edit/paste.png
  38. 4
      designer_base/src/com/fr/design/locale/designer.properties
  39. 4
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  40. 2
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  41. 4
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  42. 4
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  43. 2
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  44. 46
      designer_base/src/com/fr/design/mainframe/JFormSliderPane.java
  45. 47
      designer_base/src/com/fr/design/mainframe/JSliderPane.java
  46. 10
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  47. 8
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  48. 80
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java
  49. 78
      designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java
  50. 13
      designer_base/src/com/fr/design/present/dict/FormulaDictPane.java
  51. 2
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  52. 6
      designer_chart/src/com/fr/design/chart/gui/ChartComponent.java
  53. 6
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  54. 13
      designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java
  55. 0
      designer_chart/src/com/fr/plugin/chart/background.png
  56. 26
      designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java
  57. 55
      designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java
  58. 18
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  59. 19
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  60. 23
      designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  61. 13
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  62. 6
      designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  63. 6
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  64. 7
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  65. 5
      designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  66. 13
      designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  67. 6
      designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java
  68. 90
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  69. 11
      designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  70. 18
      designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java
  71. 30
      designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java
  72. 6
      designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java
  73. 9
      designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

9
designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java

@ -30,6 +30,8 @@ import java.awt.*;
*/
public class ChartFloatAction extends ElementCaseAction {
private boolean isRecordNeeded;
/**
* 构造函数 图表插入悬浮元素
*/
@ -64,9 +66,10 @@ public class ChartFloatAction extends ElementCaseAction {
* @return 是则返回true
*/
public boolean executeActionReturnUndoRecordNeeded() {
isRecordNeeded = false;
final ElementCasePane reportPane = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (reportPane == null) {
return false;
return isRecordNeeded;
}
reportPane.stopEditing();
@ -78,7 +81,7 @@ public class ChartFloatAction extends ElementCaseAction {
chartDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
isRecordNeeded = true;
FloatElement newFloatElement;
try {
newFloatElement = new FloatElement(chartDialog.getChartCollection().clone());
@ -101,6 +104,6 @@ public class ChartFloatAction extends ElementCaseAction {
});
chartDialog.setVisible(true);
return true;
return isRecordNeeded;
}
}

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

@ -79,7 +79,7 @@ public class CellElementPropertyPane extends DockingView {
@Override
public void fireTitleChange(String addName) {
title.setText(Inter.getLocText("CellElement-Property_Table") + '-' + addName);
title.setText(Inter.getLocText("FR-Designer_CellElement_Property_Table") + '-' + addName);
}
};
@ -134,8 +134,7 @@ public class CellElementPropertyPane extends DockingView {
}
public void reInit(ElementCasePane ePane) {
if (titlePane.getParent() == null) { // 如果处于隐藏状态,则让其显示
// this.add(titlePane, BorderLayout.NORTH);
if (cellElementEditPane.getParent() == null) { // 如果处于隐藏状态,则让其显示
this.add(cellElementEditPane, BorderLayout.CENTER);
}
cellElementEditPane.populate(ePane);
@ -151,7 +150,7 @@ public class CellElementPropertyPane extends DockingView {
@Override
public String getViewTitle() {
return Inter.getLocText("CellElement-Property_Table");
return Inter.getLocText("FR-Designer_CellElement_Property_Table");
}
@Override

83
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -45,48 +45,12 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
public ElementCasePaneDelegate(WorkSheet sheet) {
super(sheet);
this.addSelectionChangeListener(new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {
//在编辑权限,所以要更新权限编辑面板
if (BaseUtils.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
if (!isEditable()) {
return;
}
CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) {
Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection();
// 模板初始化完成后,才能初始化超级链接面板
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
if (editingSelection instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
JPanel floatPane = new JPanel(new BorderLayout());
floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH);
floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane);
} else {
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
}
EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
EastRegionContainerPane.getInstance().removeParameterPane();
}
doOnSelectionChanged(e);
}
});
this.addTargetModifiedListener(new TargetModifiedListener() {
@ -97,6 +61,48 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
});
}
private void doOnSelectionChanged(SelectionEvent e) {
//在编辑权限,所以要更新权限编辑面板
if (BaseUtils.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
return;
}
CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) {
Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection();
// 模板初始化完成后,才能初始化超级链接面板
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
if (editingSelection instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
JPanel floatPane = new JPanel(new BorderLayout());
floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH);
floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane);
} else {
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
}
EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
EastRegionContainerPane.getInstance().removeParameterPane();
}
}
@Override
protected boolean supportRepeatedHeaderFooter() {
return true;
@ -123,6 +129,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
*
* @return 不是必须在可见范围.
*/
@Override
public boolean mustInVisibleRange() {
return false;
}

11
designer/src/com/fr/design/mainframe/ReportComponentComposite.java

@ -204,19 +204,14 @@ public class ReportComponentComposite extends JComponent {
}
private JComponent createSouthControlPane() {
// hbarContainer = FRGUIPaneFactory.createBorderLayout_S_Pane();
// hbarContainer.add(createSouthControlPaneWithJSliderPane());
hbarContainer = FRGUIPaneFactory.createBorderLayout_S_Pane();
hbarContainer.add(centerCardPane.editingComponet.getHorizontalScrollBar());
// JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sheetNameTab, hbarContainer);
JPanel southPane = new JPanel(new BorderLayout());
jSliderContainer = JSliderPane.getInstance();
JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sheetNameTab, jSliderContainer);
splitpane.setBorder(null);
splitpane.setDividerSize(3);
splitpane.setResizeWeight(1);
southPane.add(hbarContainer, BorderLayout.NORTH);
southPane.add(splitpane, BorderLayout.CENTER);
southPane.add(sheetNameTab, BorderLayout.CENTER);
southPane.add(jSliderContainer, BorderLayout.EAST);
return southPane;
}

8
designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java

@ -33,14 +33,6 @@ public class TitleCellRender implements ListCellRenderer<Object> {
showMoreLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
panel.add(showMoreLabel, BorderLayout.EAST);
}
if (moreModel.isLoading()) {
ImageIcon imageIcon = new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/loading.gif"));
//设置cell的加载动画
imageIcon.setImageObserver(list);
UILabel loadingLabel = new UILabel(imageIcon);
loadingLabel.setBorder(BorderFactory.createEmptyBorder(LOAD_OFFSET,0,0,0));
panel.add(loadingLabel, 0);
}
panel.setPreferredSize(new Dimension(list.getFixedCellWidth(), AlphaFineConstants.CELL_TITLE_HEIGHT));
return panel;
}

120
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -17,7 +17,10 @@ import com.fr.design.mainframe.alphafine.cell.model.PluginModel;
import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender;
import com.fr.design.mainframe.alphafine.listener.DocumentAdapter;
import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.alphafine.preview.*;
import com.fr.design.mainframe.alphafine.preview.DocumentPreviewPane;
import com.fr.design.mainframe.alphafine.preview.FilePreviewPane;
import com.fr.design.mainframe.alphafine.preview.NoResultPane;
import com.fr.design.mainframe.alphafine.preview.PluginPreviewPane;
import com.fr.design.mainframe.alphafine.search.manager.*;
import com.fr.form.main.Form;
import com.fr.form.main.FormIO;
@ -72,9 +75,11 @@ public class AlphaFineDialog extends UIDialog {
private AlphaFineTextField searchTextField;
private UIButton closeButton;
private JPanel searchResultPane;
private Point pressedPoint;
private UIScrollPane leftSearchResultPane;
private JPanel defaultPane;
//分割线
private UILabel splitLabel;
private JPanel rightSearchResultPane;
private AlphaFineList searchResultList;
private SearchListModel searchListModel;
@ -302,7 +307,7 @@ public class AlphaFineDialog extends UIDialog {
rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT));
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
searchResultPane.add(rightSearchResultPane, BorderLayout.EAST);
UILabel splitLabel = new UILabel();
splitLabel = new UILabel();
splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1));
searchResultPane.add(splitLabel, BorderLayout.NORTH);
add(searchResultPane, BorderLayout.SOUTH);
@ -320,6 +325,8 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker = new SwingWorker() {
@Override
protected Object doInBackground() throws Exception {
resumeLeftPane();
splitLabel.setIcon(new ImageIcon(getClass().getResource("/com/fr/design/mainframe/alphafine/images/bigloading.gif")));
rebuildList(searchTextField.getText().toLowerCase());
return null;
}
@ -327,6 +334,7 @@ public class AlphaFineDialog extends UIDialog {
@Override
protected void done() {
if (!isCancelled()) {
splitLabel.setIcon(null);
fireStopLoading();
}
}
@ -334,12 +342,39 @@ public class AlphaFineDialog extends UIDialog {
this.searchWorker.execute();
}
/**
* 恢复左侧列表面板
*/
private void resumeLeftPane() {
if (searchResultPane != null && defaultPane != null) {
rightSearchResultPane.removeAll();
searchResultPane.remove(defaultPane);
defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
refreshContainer();
}
}
/**
* 移除左侧列表面板
*/
private void removeLeftPane() {
if (searchListModel.isEmpty() && defaultPane == null) {
defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png"));
searchResultPane.remove(leftSearchResultPane);
searchResultPane.add(defaultPane, BorderLayout.WEST);
refreshContainer();
}
}
/**
* 停止加载状态
*/
private void fireStopLoading() {
searchListModel.resetState();
replaceLeftPane();
if (searchResultPane != null) {
removeLeftPane();
}
}
/**
@ -351,22 +386,6 @@ public class AlphaFineDialog extends UIDialog {
revalidate();
}
/**
* 重置结果面板
*/
private void replaceLeftPane() {
if (searchListModel.getSize() == 0 && defaultPane == null) {
defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png"));
searchResultPane.remove(leftSearchResultPane);
searchResultPane.add(defaultPane, BorderLayout.WEST);
} else if (searchListModel.getSize() > 0 && defaultPane != null) {
searchResultPane.remove(defaultPane);
defaultPane = null;
searchResultPane.add(leftSearchResultPane, BorderLayout.WEST);
}
refreshContainer();
}
/**
* 重新构建搜索结果列表
* 先根据输入判断是不是隐藏的搜索功能
@ -409,8 +428,7 @@ public class AlphaFineDialog extends UIDialog {
searchListModel.removeAllElements();
searchListModel.resetSelectedState();
rightSearchResultPane.removeAll();
validate();
repaint();
refreshContainer();
}
/**
@ -605,7 +623,7 @@ public class AlphaFineDialog extends UIDialog {
this.showWorker.execute();
break;
default:
return;
rightSearchResultPane.removeAll();
}
@ -680,45 +698,6 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 窗口拖拽
*/
private void initMouseListener() {
addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
doMouseDragged(e);
}
});
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
doMousePressed(e);
}
});
}
private void doMousePressed(MouseEvent e) {
pressedPoint = e.getPoint();
}
private void doMouseDragged(MouseEvent e) {
Point point = e.getPoint();// 获取当前坐标
Point locationPoint = getLocation();// 获取窗体坐标
int x = locationPoint.x + point.x - pressedPoint.x;// 计算移动后的新坐标
int y = locationPoint.y + point.y - pressedPoint.y;
setLocation(x, y);// 改变窗体位置
}
/**
* 当鼠标在搜索界面边界外点击时触发
*/
@ -792,7 +771,7 @@ public class AlphaFineDialog extends UIDialog {
}
final HashMap<String, String> para = new HashMap<>();
String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
para.put("token", CodeUtils.md5Encode(date, "", "MD5"));
para.put("token", CodeUtils.md5Encode(date, StringUtils.EMPTY, "MD5"));
para.put("content", object.toString());
HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true);
httpClient.asGet();
@ -880,6 +859,14 @@ public class AlphaFineDialog extends UIDialog {
this.storeText = storeText;
}
public UILabel getSplitLabel() {
return splitLabel;
}
public void setSplitLabel(UILabel splitLabel) {
this.splitLabel = splitLabel;
}
/**
* +-------------------------------------+
@ -1047,8 +1034,13 @@ public class AlphaFineDialog extends UIDialog {
isValidSelected = selected;
}
@Override
public boolean isEmpty() {
return myDelegate.isEmpty();
}
public void resetState() {
for (int i = 0; i< getSize(); i++) {
for (int i = 0; i < getSize(); i++) {
getElementAt(i).resetState();
}
}

1
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java

@ -30,6 +30,7 @@ public class AlphaFinePane extends BasicPane {
refreshButton.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png"));
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine"));
refreshButton.set4ToolbarButton();
refreshButton.setRolloverEnabled(false);
this.add(refreshButton);
this.setBackground(ThemeUtils.WHITE_BORDER_COLOR);
refreshButton.addActionListener(new ActionListener() {

BIN
designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

16
designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java

@ -18,7 +18,9 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.DateUtils;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils;
@ -45,6 +47,7 @@ public class UserInfoPane extends BasicPane{
private UserInfoLabel userInfoLabel;
public UserInfoLabel getUserInfoLabel() {
return userInfoLabel;
}
@ -64,18 +67,15 @@ public class UserInfoPane extends BasicPane{
this.userInfoLabel = new UserInfoLabel(this);
this.markUnSignIn();
autoLogin();
addEnvChangedListener();
autoPushLoginDialog();
this.add(userInfoLabel, BorderLayout.CENTER);
}
// 后台自动登录
private void autoLogin(){
Thread bbsAutoLoginThread = new Thread(new Runnable() {
@Override
public void run() {
private void addEnvChangedListener(){
GeneralContext.addEnvChangedListener(new EnvChangedListener() {
public void envChanged() {
String username = ConfigManager.getProviderInstance().getBbsUsername();
if (StringUtils.isEmpty(username)){
markUnSignIn();
@ -84,8 +84,8 @@ public class UserInfoPane extends BasicPane{
}
}
});
bbsAutoLoginThread.start();
}
// 计算xml保存的上次弹框时间和当前时间的时间差
private int getDiffFromLastLogin(){

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

@ -85,8 +85,8 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
UILabel direction = new UILabel(Inter.getLocText("FR-Designer_ExpandD_Expand_Direction"), SwingConstants.LEFT);
// JPanel directionPane = new JPanel(new BorderLayout());
// directionPane.add(direction, BorderLayout.NORTH);
JPanel directionPane = new JPanel(new BorderLayout());
directionPane.add(direction, BorderLayout.NORTH);
UILabel left = new UILabel(Inter.getLocText("FR-Designer_LeftParent"), SwingConstants.LEFT);
JPanel leftPane = new JPanel(new BorderLayout());
leftPane.add(left, BorderLayout.NORTH);
@ -95,7 +95,7 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
upPane.add(up, BorderLayout.NORTH);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{direction, expandDirectionButton},
new Component[]{directionPane, expandDirectionButton},
new Component[]{leftPane, leftFatherPane},
new Component[]{upPane, rightFatherPane},
};

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

@ -10,7 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate;
@ -48,9 +48,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private UIComboBox showContent;
private UIPropertyTextField tooltipTextField;
private UITextField tooltipTextField;
private UIPropertyTextField fileNameTextField;
private UITextField fileNameTextField;
// 分页
private UICheckBox pageBeforeRowCheckBox;
@ -229,8 +229,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
final JPanel fileNamePane = new JPanel(fileNameLayout);
JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0));
fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST);
fileNameTextField = new UIPropertyTextField();
tooltipTextField = new UIPropertyTextField();
fileNameTextField = new UITextField();
tooltipTextField = new UITextField();
tooltipTextField.getUI();
fileNamePane.add(new JPanel(), "none");
fileNamePane.add(fileNameCCPane, "content");
@ -452,10 +452,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Page_After_Column"))) {
cellPageAttr.setPageAfterColumn(this.pageAfterColumnCheckBox.isSelected());
}
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Can_Break_On_Paginate"))) {
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellPage_Can_Break_On_Paginate"))) {
cellPageAttr.setCanBreakOnPaginate(canBreakOnPaginateCheckBox.isSelected());
}
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Repeat_Content_When_Paging"))) {
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellPage_Repeat_Content_When_Paging"))) {
cellPageAttr.setRepeat(this.repeatCheckBox.isSelected());
}

3
designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java

@ -78,7 +78,8 @@ public class ErrorInfoLogAppender extends AppenderSkeleton {
private String readLogID(String log) {
String errorCode = Inter.getLocText("FR-Engine_ErrorCode-Prefix");
String[] matchs = log.split(errorCode + ".*?:");
// 报错信息国际化不规范, 有些是中文分号, 有些是英文
String[] matchs = log.split(errorCode + ".*?[:,:]");
if (matchs.length <= 1) {
return StringUtils.EMPTY;
}

7
designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java

@ -169,12 +169,9 @@ public class FormReportComponentComposite extends JComponent implements TargetMo
hbarContainer.add(elementCaseDesigner.getHorizontalScrollBar());
jSliderContainer = JSliderPane.getInstance();
JSplitPane splitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, sheetNameTab, jSliderContainer);
southPane.add(hbarContainer, BorderLayout.NORTH);
southPane.add(splitpane, BorderLayout.CENTER);
splitpane.setBorder(null);
splitpane.setDividerSize(3);
splitpane.setResizeWeight(1);
southPane.add(sheetNameTab, BorderLayout.CENTER);
southPane.add(jSliderContainer, BorderLayout.EAST);
return southPane;
}

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

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

@ -24,7 +24,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
directWriteCheckBox.setPreferredSize(new Dimension(100, 30));
directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
waterMarkDictPane = new WaterMarkDictPane();
contentPane.add(waterMarkDictPane, BorderLayout.NORTH);

6
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.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -24,7 +24,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UIPropertyTextField errorMsgTextField;
protected UITextField errorMsgTextField;
protected JPanel validatePane;
public FieldEditorDefinePane() {
@ -44,7 +44,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initErrorMsgPane() {
// 错误信息
errorMsgTextField = new UIPropertyTextField();
errorMsgTextField = new UITextField();
// // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {

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

273
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -20,6 +20,7 @@ import javax.swing.text.DefaultFormatter;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -39,113 +40,23 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel;
private UIBasicSpinner decimalLength;
private UISpinner decimalLength;
private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane;
private ActionListener actionListener1 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
} else {
limitNumberPane.setVisible(false);
}
}
};
private ActionListener actionListener2 = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (allowNegativeCheckBox.isSelected()) {
minValueModel.setMinimum(-Double.MAX_VALUE);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(-Double.MAX_VALUE);
}
} else {
minValueModel.setMinimum(0.0);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
if (maxValue < 0.0) {
maxValueSpinner.setValue(0.0);
}
}
}
};
public ActionListener actionListener3 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setVisible(true);
Double value = new Double(0);
if (setMinValueCheckBox.isSelected()) {
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
value = minValue;
}
}
maxValueSpinner.setValue(value);
} else {
maxValueSpinner.setVisible(false);
minValueModel.setMaximum(Double.MAX_VALUE);
}
}
};
private ActionListener allowDecimalsListener;
private ActionListener allowNegativeListener ;
private ActionListener actionListener4 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setVisible(true);
Double value = new Double(0);
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
value = maxValue;
}
}
minValueSpinner.setValue(value);
} else {
minValueSpinner.setVisible(false);
maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
}
}
};
public ActionListener setMaxListener;
private ChangeListener changeListener1 = new ChangeListener() {
private ActionListener setMinListener;
@Override
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
private ChangeListener maxValueChangeListener;
private ChangeListener changeListener2 = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
private ChangeListener minValueChangeListener;
public NumberEditorDefinePane() {
// super();
this.initComponents();
}
@ -160,73 +71,53 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
content.add(waterMarkDictPane, BorderLayout.CENTER);
return content;
}
public JPanel setValidatePane() {
initListeners();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals"));
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.decimalLength = new UIBasicSpinner(new SpinnerNumberModel(16, 0, Integer.MAX_VALUE, 1));
this.decimalLength.setPreferredSize(new Dimension(155, 20));
this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2);
this.allowNegativeCheckBox.addActionListener(allowNegativeListener);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Max_Value"), false);
setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(155, 20));
setNotAllowsInvalid(this.maxValueSpinner);
this.maxValueSpinner.setVisible(false);
this.setMaxValueCheckBox.addActionListener(actionListener3);
this.maxValueSpinner.addChangeListener(changeListener1);
this.setMaxValueCheckBox.addActionListener(setMaxListener);
this.maxValueSpinner.addChangeListener(maxValueChangeListener);
this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Min_Value"), false);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(155, 20));
setNotAllowsInvalid(this.minValueSpinner);
this.minValueSpinner.setVisible(false);
this.setMinValueCheckBox.addActionListener(actionListener4);
this.minValueSpinner.addChangeListener(changeListener2);
this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener);
UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"}));
numberLabel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel decimalPane = new JPanel(new BorderLayout());
decimalPane.add(decimalLength, BorderLayout.CENTER);
decimalPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel maxValueSpinnerPane = new JPanel(new BorderLayout());
maxValueSpinnerPane.add(maxValueSpinner, BorderLayout.CENTER);
maxValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel minValueSpinnerPane = new JPanel(new BorderLayout());
minValueSpinnerPane.add(minValueSpinner, BorderLayout.CENTER);
minValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowDecimalsCheckBox, null},
new Component[]{numberLabel, decimalPane},
new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinnerPane},
new Component[]{setMinValueCheckBox, minValueSpinnerPane},
new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinner},
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
pane.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 0));
pane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return pane;
}
@ -237,28 +128,28 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.decimalLength.setValue(e.getMaxDecimalLength());
} else {
this.limitNumberPane.setVisible(false);
this.limitNumberPane.setPreferredSize(new Dimension(0,0));
}
allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) {
setMaxValueCheckBox.setSelected(false);
maxValueSpinner.setValue(new Double(Double.MAX_VALUE));
maxValueSpinner.setVisible(false);
maxValueSpinner.setEnabled(false);
} else {
setMaxValueCheckBox.setSelected(true);
maxValueSpinner.setVisible(true);
maxValueSpinner.setEnabled(true);
maxValueSpinner.setValue(new Double(e.getMaxValue()));
}
if (e.getMinValue() == -Double.MAX_VALUE) {
setMinValueCheckBox.setSelected(false);
minValueSpinner.setValue(new Double(-Double.MAX_VALUE));
minValueSpinner.setVisible(false);
minValueSpinner.setEnabled(false);
} else {
minValueSpinner.setEnabled(true);
setMinValueCheckBox.setSelected(true);
minValueSpinner.setVisible(true);
minValueSpinner.setValue(new Double(e.getMinValue()));
}
this.waterMarkDictPane.populate(e);
@ -270,7 +161,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
NumberEditor ob = new NumberEditor();
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength((Integer) this.decimalLength.getValue());
ob.setMaxDecimalLength((int)this.decimalLength.getValue());
}
ob.setAllowNegative(allowNegativeCheckBox.isSelected());
@ -292,18 +183,108 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
return ob;
}
private void checkVisible() {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setVisible(true);
} else {
minValueSpinner.setVisible(false);
}
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setVisible(true);
} else {
minValueSpinner.setVisible(false);
private void initListeners(){ allowDecimalsListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
limitNumberPane.setPreferredSize(new Dimension(215,20));
} else {
limitNumberPane.setVisible(false);
limitNumberPane.setPreferredSize(new Dimension(0,0));
}
}
};
allowNegativeListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (allowNegativeCheckBox.isSelected()) {
minValueModel.setMinimum(-Double.MAX_VALUE);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(-Double.MAX_VALUE);
}
} else {
minValueModel.setMinimum(0.0);
if (!setMinValueCheckBox.isSelected()) {
maxValueModel.setMinimum(0.0);
}
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (minValue < 0.0) {
minValueSpinner.setValue(0.0);
}
if (maxValue < 0.0) {
maxValueSpinner.setValue(0.0);
}
}
}
};
setMaxListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMinValueCheckBox.isSelected()) {
Double minValue = Double.parseDouble("" + minValueSpinner.getValue());
if (minValue > value) {
value = minValue;
}
}
maxValueSpinner.setValue(value);
} else {
maxValueSpinner.setEnabled(false);
minValueModel.setMaximum(Double.MAX_VALUE);
}
}
};
setMinListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
Double value = new Double(0);
if (setMaxValueCheckBox.isSelected()) {
Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue());
if (maxValue < value) {
value = maxValue;
}
}
minValueSpinner.setValue(value);
} else {
minValueSpinner.setEnabled(false);
maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0));
}
}
};
maxValueChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
minValueChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
}
private void setNotAllowsInvalid(UIBasicSpinner jspinner) {

32
designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java

@ -1,19 +1,23 @@
package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter;
public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
protected TreeSettingPane treeSettingPane;
protected AccessibleTreeModelEditor treeSettingPane;
protected TreeRootPane treeRootPane;
public TreeComboBoxEditorDefinePane() {
@ -27,9 +31,22 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane();
content.add(treeRootPane, BorderLayout.NORTH);
treeSettingPane = new TreeSettingPane(true);
return content;
}
@Override
protected JPanel setFirstContentPane() {
treeSettingPane = new AccessibleTreeModelEditor();
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel north = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), treeSettingPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
north.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
JPanel center = super.setFirstContentPane();
jPanel.add(north, BorderLayout.NORTH);
jPanel.add(center, BorderLayout.CENTER);
return jPanel;
}
@Override
protected String title4PopupWindow() {
@ -38,19 +55,20 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
@Override
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) {
treeSettingPane.populate(e);
treeSettingPane.setValue(e.getDictionary());
treeRootPane.populate(e.getTreeAttr());
}
@Override
protected TreeComboBoxEditor updateSubCustomWritableRepeatEditorBean() {
TreeComboBoxEditor editor = treeSettingPane.updateTreeComboBox();
TreeComboBoxEditor editor = new TreeComboBoxEditor();
editor.setDictionary((Dictionary)treeSettingPane.getValue());
editor.setTreeAttr(treeRootPane.update());
return editor;
}
@Override
public DataCreatorUI dataUI() {
return treeSettingPane;
return null;
}
}

25
designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -1,10 +1,13 @@
package com.fr.design.widget.ui;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter;
@ -16,8 +19,8 @@ import java.awt.*;
* richer:tree editor
*/
public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
protected TreeSettingPane treeSettingPane;
protected TreeRootPane treeRootPane;
private AccessibleTreeModelEditor accessibleTreeModelEditor;
private UICheckBox removeRepeatCheckBox;
@ -27,7 +30,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
@Override
protected void populateSubFieldEditorBean(TreeEditor e) {
this.treeSettingPane.populate(e);
this.accessibleTreeModelEditor.setValue(e.getDictionary());
treeRootPane.populate(e.getTreeAttr());
if (this.removeRepeatCheckBox != null) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
@ -36,7 +39,8 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
@Override
protected TreeEditor updateSubFieldEditorBean() {
TreeEditor editor = treeSettingPane.updateTreeEditor();
TreeEditor editor = new TreeEditor();
editor.setDictionary((Dictionary) accessibleTreeModelEditor.getValue());
editor.setTreeAttr(treeRootPane.update());
if (this.removeRepeatCheckBox != null) {
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected());
@ -50,13 +54,17 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
}
protected JPanel setSecondContentPane() {
accessibleTreeModelEditor = new AccessibleTreeModelEditor();
JPanel createTree = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Create_Tree")), accessibleTreeModelEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
createTree.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0();
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.add(contenter,BorderLayout.NORTH);
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false);
contenter.add(removeRepeatCheckBox);
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
contenter.add(createTree, BorderLayout.NORTH);
contenter.add(removeRepeatCheckBox, BorderLayout.CENTER);
JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER);
@ -69,7 +77,6 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane();
content.add(treeRootPane, BorderLayout.NORTH);
treeSettingPane = new TreeSettingPane(true);
return content;
}
@ -80,6 +87,6 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
@Override
public DataCreatorUI dataUI() {
return treeSettingPane;
return null;
}
}

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

@ -1,7 +1,7 @@
package com.fr.design.widget.ui;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WaterMark;
@ -13,25 +13,22 @@ import java.awt.event.KeyListener;
public class WaterMarkDictPane extends JPanel {
private UIPropertyTextField waterMarkTextField;
private UITextField waterMarkTextField;
public WaterMarkDictPane() {
this.setLayout(new BorderLayout());
waterMarkTextField = new UIPropertyTextField();
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));
waterMarkTextField = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), emptyLabel, waterMarkTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkTextField},
};
double[] rowSize = {p};
double[] columnSize = {p, p, f};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 18, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.CENTER);
}

46
designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -8,9 +8,7 @@ import java.awt.event.ActionEvent;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableCellRenderer;
@ -34,10 +32,7 @@ import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.*;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import com.fr.general.Inter;
@ -46,12 +41,15 @@ import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.stable.ColumnRow;
import com.fr.stable.ColumnRowGroup;
import com.fr.stable.StringUtils;
import com.fr.write.DMLConfigJob;
public class SmartInsertDBManipulationPane extends DBManipulationPane {
private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1);
private ElementCasePane ePane;
private static int CELL_GROUP_LIMIT = 6;
private static int TOP_PADDING = 30;
private static int LEFT_COLUMN_MAX_WIDTH = 40;
public SmartInsertDBManipulationPane(ElementCasePane ePane) {
super(ValueEditorPaneFactory.extendedCellGroupEditors());
@ -60,10 +58,14 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
public SmartInsertDBManipulationPane() {
super(ValueEditorPaneFactory.extendedCellGroupEditors());
JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
this.ePane = ((JWorkBook) jTemplate).getEditingElementCasePane();
init();
}
private void init() {
JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
this.ePane = ((JWorkBook) jTemplate).getEditingElementCasePane();
}
@Override
protected SubmitJobListPane createSubmitJobListPane() {
return new SmartInsertSubmitJobListPane();
@ -126,7 +128,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
}
};
bPane.setLayout(FRGUIPaneFactory.createBorderLayout());
bPane.setBorder(BorderFactory.createEmptyBorder(30, 0, 0, 0));
bPane.setBorder(BorderFactory.createEmptyBorder(TOP_PADDING, 0, 0, 0));
final UIBasicSpinner columnSpinner = new UIBasicSpinner();
final UIBasicSpinner rowSpinner = new UIBasicSpinner();
Component[][] coms = new Component[][] { { new UILabel(Inter.getLocText("RWA-Row_Offset")), rowSpinner },{ new UILabel(Inter.getLocText("RWA-Column_Offset")), columnSpinner } };
@ -196,11 +198,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
/*
* 当前的ReportPane不可编辑,不可切换Sheet,加GridSelectionChangeListener
*/
ePane.setSelection(NO_SELECTION);
ePane.setEditable(false);
ePane.setSelection(NO_SELECTION);
ePane.getGrid().setNotShowingTableSelectPane(false);
BasicDialog dlg = bPane.showWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this));
BasicDialog dlg = bPane.showWindow(DesignerContext.getDesignerFrame());
dlg.setModal(false);
dlg.setVisible(true);
@ -292,11 +294,6 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
}
}
private boolean possibleParentContainer(Container p) {
return p instanceof Dialog || p instanceof BasicPane ||
p instanceof JPanel || p instanceof JRootPane || p instanceof JLayeredPane;
}
private class SmartJTablePane4DB extends SmartJTablePane {
// 是否是单元格组
@ -332,7 +329,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
* set Width
*/
TableColumn column0 = table.getColumnModel().getColumn(0);
column0.setMaxWidth(40);
column0.setMaxWidth(LEFT_COLUMN_MAX_WIDTH);
/*
* 设置Column 1的Renderer
*/
@ -413,7 +410,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
// 要考虑多选的情况 要结合之前的看看 可能是增加 也可能需要减少
ColumnRowGroup add = new ColumnRowGroup();
int removeCount = 0;
if (oriCellSelection != null && sameStartPoint(cellselection, oriCellSelection)) {
if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) {
removeCount = dealDragSelection(add, cellselection);
} else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) {
dealSelectColRow(add, cellselection);
@ -444,7 +441,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
return newValue;
}
private boolean sameStartPoint(CellSelection cs1, CellSelection cs2) {
private boolean isSameStartPoint(CellSelection cs1, CellSelection cs2) {
return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow();
}
@ -482,6 +479,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
private SmartJTablePaneAction a = new AbstractSmartJTablePaneAction(this, SmartInsertDBManipulationPane.this) {
@Override
public void doOk() {
// 遗留代码
}
@Override
@ -510,7 +508,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (((ColumnValue)value).obj != null) {
this.setText(((ColumnValue)value).obj.toString());
} else {
this.setText("");
this.setText(StringUtils.EMPTY);
}
}
@ -538,12 +536,12 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
Object cv = ((ColumnValue) value).obj;
if (cv instanceof ColumnRowGroup && ((ColumnRowGroup)cv).getSize() >= CELL_GROUP_LIMIT) {
text.setText("[" + Inter.getLocText(new String[]{"Has_Selected", "Classifier-Ge", "Cell"},
new String[]{((ColumnRowGroup)cv).getSize()+"", ""}) + "]");
new String[]{((ColumnRowGroup)cv).getSize()+StringUtils.EMPTY, StringUtils.EMPTY}) + "]");
tip = cv.toString() + " " + tip;
} else if (cv != null) {
text.setText(cv.toString());
} else {
text.setText("");
text.setText(StringUtils.EMPTY);
}
}
@ -571,12 +569,12 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
Object cv = ((ColumnValue) value).obj;
if (cv instanceof ColumnRowGroup && ((ColumnRowGroup)cv).getSize() >= CELL_GROUP_LIMIT) {
this.setText("[" + Inter.getLocText(new String[]{"Has_Selected", "Classifier-Ge", "Cell"},
new String[]{((ColumnRowGroup)cv).getSize()+"", ""}) + "]");
new String[]{((ColumnRowGroup)cv).getSize()+StringUtils.EMPTY, StringUtils.EMPTY}) + "]");
tip = cv.toString() + " " + tip;
} else if (cv != null) {
this.setText(cv.toString());
} else {
this.setText("");
this.setText(StringUtils.EMPTY);
}
}

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

@ -52,6 +52,9 @@ public class ECBlockPane extends PolyElementCasePane {
@Override
public void selectionChanged(SelectionEvent e) {
if (!isEditable()) {
return;
}
if (BaseUtils.isAuthorityEditing()) {
if (designer.getSelection().getEditingElementCasePane() == null) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
@ -116,7 +119,7 @@ public class ECBlockPane extends PolyElementCasePane {
// 插入菜单
private MenuDef createInsertMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("M-Insert"), 'I');
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Insert"), 'I');
// 单元格菜单
menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this));

39
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -2,6 +2,7 @@ package com.fr.quickeditor;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iscrollbar.UIScrollBar;
@ -11,6 +12,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.menu.ShortCut;
import com.fr.design.selection.QuickEditor;
@ -20,8 +22,6 @@ import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.ColumnRow;
import javax.swing.*;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
@ -51,6 +51,8 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
/*占位label*/
protected static UILabel emptyLabel = new UILabel();
private int currentSelectedIndex;
static {
emptyLabel.setPreferredSize(new Dimension(60, 20));
}
@ -119,10 +121,10 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
cellLabel.setPreferredSize(new Dimension(60, 20));
UILabel insertContentLabel = new UILabel(Inter.getLocText("HF-Insert_Content"));
insertContentLabel.setPreferredSize(new Dimension(60, 20));
UIComboBox cellElementEditButton = initCellElementEditComboBox();
UIComboBox cellElementEditComboBox = initCellElementEditComboBox();
Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{insertContentLabel, cellElementEditButton},
new Component[]{insertContentLabel, cellElementEditComboBox},
};
JPanel topContent = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
topContent.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0));
@ -136,6 +138,10 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
* @return UIButton
*/
private UIComboBox initCellElementEditComboBox() {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate == null) {
return comboBox = new UIComboBox();
}
final String[] items = getDefaultComboBoxItems();
comboBox = new UIComboBox(items);
final Object comboBoxSelected = getComboBoxSelected();
@ -144,33 +150,14 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
} else {
comboBox.setSelectedIndex(1);
}
comboBox.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
if (cellInsertActions == null) {
cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc);
}
// 这边重新获取是因为要根据JTemplate做一个过滤
ArrayList<String> arrayList = new ArrayList<String>();
for (UpdateAction action : cellInsertActions) {
arrayList.add(action.getMenuKeySet().getMenuKeySetName());
}
comboBox.setModel(new DefaultComboBoxModel<>(arrayList.toArray(new String[arrayList.size()])));
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
}
});
currentSelectedIndex = comboBox.getSelectedIndex();
comboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
cellInsertActions = ActionFactory.createCellInsertAction(ElementCasePane.class, tc);
selectedIndex = comboBox.getSelectedIndex();
cellInsertActions[selectedIndex].actionPerformed(e);
comboBox.setSelectedIndex(currentSelectedIndex);
}
});
return comboBox;

34
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -6,7 +6,13 @@ package com.fr.design;
import com.fr.base.BaseUtils;
import com.fr.design.data.datapane.TableDataNameObjectCreator;
import com.fr.design.fun.*;
import com.fr.design.fun.CellWidgetOptionProvider;
import com.fr.design.fun.Feedback;
import com.fr.design.fun.FormWidgetOptionProvider;
import com.fr.design.fun.ParameterWidgetOptionProvider;
import com.fr.design.fun.ServerTableDataDefineProvider;
import com.fr.design.fun.TableDataDefineProvider;
import com.fr.design.fun.ToolbarItemProvider;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.core.WidgetOptionFactory;
import com.fr.design.menu.ShortCut;
@ -16,13 +22,19 @@ import com.fr.general.FRLogger;
import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils;
import com.fr.plugin.AbstractExtraClassManager;
import com.fr.plugin.solution.closeable.CompatibleInjectionContainer;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.injectable.PluginSingleInjection;
import com.fr.plugin.solution.closeable.CloseableContainedSet;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraDesignClassManagerProvider;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @author : richie
@ -33,7 +45,7 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement
private static ExtraDesignClassManager classManager = new ExtraDesignClassManager();
private CompatibleInjectionContainer<ShortCut> shortCuts = new CompatibleInjectionContainer<>();
private Set<ShortCut> shortCuts = new CloseableContainedSet<>(HashSet.class);
public synchronized static ExtraDesignClassManager getInstance() {
return classManager;
@ -204,8 +216,8 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement
@Override
protected boolean demountSpecific(PluginSingleInjection injection) {
if (ShortCut.TEMPLATE_TREE.equals(injection.getName()) && injection.getOriginalObject() instanceof ShortCut) {
if (ShortCut.TEMPLATE_TREE.equals(injection.getName()) && injection.getObject() instanceof ShortCut) {
shortCuts.remove(injection.getObject());
return true;
}
@ -214,16 +226,16 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement
@Override
protected boolean mountSpecific(PluginSingleInjection injection) {
if (ShortCut.TEMPLATE_TREE.equals(injection.getName()) && injection.getOriginalObject() instanceof ShortCut) {
shortCuts.put(injection.getObject(), (ShortCut) injection.getOriginalObject());
if (ShortCut.TEMPLATE_TREE.equals(injection.getName()) && injection.getObject() instanceof ShortCut) {
shortCuts.add((ShortCut) injection.getObject());
return true;
}
return false;
}
public Set<ShortCut> getExtraShortCuts() {
return shortCuts.getSet();
return Collections.unmodifiableSet(shortCuts);
}
}

63
designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java

@ -1 +1,62 @@
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.DesignModelAdapter; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; import com.fr.general.Inter; /** * Author : daisy * Date: 13-9-2 * Time: 下午3:36 */ public class ExitAuthorityEditAction extends TemplateComponentAction { public ExitAuthorityEditAction(TargetComponent t) { super(t); this.setName(Inter.getLocText(new String[]{"Exit", "DashBoard-Potence", "Edit"})); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit.png")); } public void prepare4Undo() { } public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } if (BaseUtils.isAuthorityEditing()) { BaseUtils.setAuthorityEditing(false); WestRegionContainerPane.getInstance().replaceDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); EastRegionContainerPane.getInstance().replaceDownPane(tc.getEastDownPane()); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); DesignerContext.getDesignerFrame().refreshDottedLine(); fireAuthorityStateToNomal(); } return true; } /** * 退出权限编辑时,将所有的做过权限编辑的状态,作为一个状态赋给报、报表主体 */ private void fireAuthorityStateToNomal() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { //如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表 if (opendedTemplate.get(i).isDoSomethingInAuthority()) { opendedTemplate.get(i).fireAuthorityStateToNomal(); } } } }
package com.fr.design.actions;
import com.fr.base.BaseUtils;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.DesignModelAdapter;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.*;
import com.fr.general.Inter;
/**
* Author : daisy
* Date: 13-9-2
* Time: 下午3:36
*/
public class ExitAuthorityEditAction extends TemplateComponentAction {
public ExitAuthorityEditAction(TargetComponent t) {
super(t);
this.setName(Inter.getLocText(new String[]{"Exit", "DashBoard-Potence", "Edit"}));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit.png"));
}
public void prepare4Undo() {
// 遗留代码
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
TargetComponent tc = getEditingComponent();
if (tc == null) {
return false;
}
if (BaseUtils.isAuthorityEditing()) {
BaseUtils.setAuthorityEditing(false);
WestRegionContainerPane.getInstance().replaceDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus());
DesignerContext.getDesignerFrame().needToAddAuhtorityPaint();
DesignerContext.getDesignerFrame().refreshDottedLine();
fireAuthorityStateToNomal();
}
return true;
}
/**
* 退出权限编辑时将所有的做过权限编辑的状态作为一个状态赋给报报表主体
*/
private void fireAuthorityStateToNomal() {
java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList();
for (int i = 0; i < opendedTemplate.size(); i++) {
//如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表
if (opendedTemplate.get(i).isDoSomethingInAuthority()) {
opendedTemplate.get(i).fireAuthorityStateToNomal();
}
}
}
}

15
designer_base/src/com/fr/design/actions/core/ActionFactory.java

@ -73,6 +73,7 @@ public class ActionFactory {
/**
* 注册图表的 地图资源
*
* @param action 地图资源action
*/
public static void registerChartMapEditorAction(UpdateAction action) {
@ -229,16 +230,18 @@ public class ActionFactory {
public static MenuKeySet[] createCellInsertActionName() {
List<MenuKeySet> actionNames = new ArrayList<>();
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
for (Class<?> clazz : actionClasses) {
if (clazz == null) {
continue;
}
try {
Constructor<? extends UpdateAction> c = (Constructor<? extends UpdateAction>) clazz.getConstructor();
actionNames.add(c.newInstance().getMenuKeySet());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
if (jTemplate.acceptToolbarItem(clazz)) {
try {
Constructor<? extends UpdateAction> c = (Constructor<? extends UpdateAction>) clazz.getConstructor();
actionNames.add(c.newInstance().getMenuKeySet());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
}
return actionNames.toArray(new MenuKeySet[actionNames.size()]);

10
designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java

@ -1,5 +1,7 @@
package com.fr.design.actions.help.alphafine;
import com.fr.base.FRCoreContext;
import com.fr.general.VT4FR;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter;
@ -88,7 +90,8 @@ public class AlphaFineConfigManager implements XMLable {
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone();
return manager;
}
@Override
@ -199,7 +202,10 @@ public class AlphaFineConfigManager implements XMLable {
}
public boolean isEnabled() {
return isEnabled;
if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) {
return isEnabled;
}
return false;
}
public void setEnabled(boolean isEnabled) {

9
designer_base/src/com/fr/design/file/HistoryTemplateListPane.java

@ -8,7 +8,6 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.gui.chart.DownLoadOnLineSourcesHelper;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.UIList;
@ -233,14 +232,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
getCurrentEditingTemplate().repaint();
}
@Override
public void downLoadSources() {
DownLoadOnLineSourcesHelper pane = new DownLoadOnLineSourcesHelper();
pane.addMapJSONSiteInfo();
pane.addPhantomSiteInfo();
pane.installOnline();
}
private class HistoryListCellRender extends DefaultListCellRenderer {
@Override

373
designer_base/src/com/fr/design/gui/ibutton/UISliderButton.java

@ -0,0 +1,373 @@
package com.fr.design.gui.ibutton;
import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle;
import com.fr.base.GraphHelper;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.plaf.ButtonUI;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.geom.RoundRectangle2D;
public class UISliderButton extends JButton implements UIObserver {
public static final int OTHER_BORDER = 1;
public static final int NORMAL_BORDER = 2;
private static final int HEIGH = 20;
private static final int TOOLTIP_Y = 30;
private boolean isExtraPainted = true;
private boolean isRoundBorder = true;
private int rectDirection = Constants.NULL;
private Stroke borderStroke = UIConstants.BS;
private Color borderColor = UIConstants.LINE_COLOR;
private boolean isPressedPainted = true;
private boolean isNormalPainted = true;
protected boolean isBorderPaintedOnlyWhenPressed = false;
private int borderType = NORMAL_BORDER;
private CellBorderStyle border = null;
protected UIObserverListener uiObserverListener;
public UISliderButton() {
this(StringUtils.EMPTY);
}
public UISliderButton(String string) {
this(string, null);
}
public UISliderButton(Icon icon) {
this(null, icon);
}
public UISliderButton(Action action) {
super(action);
init();
}
public UISliderButton(String text, Icon icon) {
super(text, icon);
init();
}
/**
* 是否进行过权限编辑
*
* @param role 角色
* @return
*/
public boolean isDoneAuthorityEdited(String role) {
return false;
}
public UISliderButton(Icon normal, Icon rollOver, Icon pressed) {
super(normal);
setBorderPainted(false);
setRolloverIcon(rollOver);
setPressedIcon(pressed);
setExtraPainted(false);
setBackground(null);
setOpaque(false);
initListener();
}
protected void initListener() {
if (shouldResponseChangeListener()) {
this.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (uiObserverListener == null) {
return;
}
uiObserverListener.doChange();
}
});
}
}
//确定是正常的边框类型,还是其他的Border类型
//若是其他的border类型,则要setOtherType,即设置线型颜色等。若是其他类型,但是没有设置,则默认的是虚线型边框
public void setBorderType(int borderType) {
this.borderType = borderType;
}
public void setBorderStyle(CellBorderStyle border) {
this.border = border;
}
public void set4ToolbarButton() {
setNormalPainted(false);
Dimension dim = getPreferredSize();
dim.height = HEIGH;
setBackground(null);
setOpaque(false);
setSize(dim);
setBorderPaintedOnlyWhenPressed(true);
}
public void set4LargeToolbarButton() {
setNormalPainted(false);
setBackground(null);
setOpaque(false);
setSize(new Dimension(40, 40));
setBorderPaintedOnlyWhenPressed(true);
}
public void set4ChartLargeToolButton() {
setNormalPainted(false);
setBackground(null);
setOpaque(false);
setSize(new Dimension(34, 44));
setBorderPaintedOnlyWhenPressed(true);
}
private void init() {
setOpaque(false);
setBackground(null);
setRolloverEnabled(true);
initListener();
}
@Override
public ButtonUI getUI() {
return new UISliderButtonUI();
}
/**
* 更新界面
*/
public void updateUI() {
setUI(getUI());
}
public CellBorderStyle getBorderStyle() {
return this.border;
}
@Override
public Insets getInsets() {
if (getIcon() != null) {
return new Insets(0, 3, 0, 3);
}
return new Insets(0, 0, 0, 0);
}
//@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 20);
}
public int getBorderType() {
return borderType;
}
public void setOtherBorder(Stroke s, Color c) {
borderStroke = s;
borderColor = c;
}
@Override
protected void paintBorder(Graphics g) {
if (!isBorderPainted()) {
return;
}
if (borderType == OTHER_BORDER) {
paintOtherBorder(g);
} else {
boolean isPress = (isBorderPaintedOnlyWhenPressed && getModel().isPressed());
if (isPress || !isBorderPaintedOnlyWhenPressed) {
if (ui instanceof UISliderButtonUI) {
((UISliderButtonUI) ui).paintBorder(g, this);
} else {
super.paintBorder(g);
}
}
}
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Dimension size = this.getSize();
Graphics2D g2d = (Graphics2D) g;
Stroke oldStroke = g2d.getStroke();
if (border != null) {
g2d.setColor(border.getTopColor());
GraphHelper.drawLine(g2d, 3, 4, size.getWidth() - 4, 4, border.getTopStyle());
g2d.setColor(border.getLeftColor());
GraphHelper.drawLine(g2d, 3, 4, 3, size.getHeight() - 4, border.getLeftStyle());
g2d.setColor(border.getBottomColor());
GraphHelper.drawLine(g2d, 3, size.getHeight() - 4, size.getWidth() - 4, size.getHeight() - 4, border.getBottomStyle());
g2d.setColor(border.getRightColor());
GraphHelper.drawLine(g2d, size.getWidth() - 4, 4, size.getWidth() - 4, size.getHeight() - 4, border.getRightStyle());
} else {
GraphHelper.drawLine(g2d, 2, 4, size.getWidth() - 4, 4, Constants.LINE_NONE);
GraphHelper.drawLine(g2d, 2, 4, 2, size.getHeight() - 4, Constants.LINE_NONE);
GraphHelper.drawLine(g2d, 2, size.getHeight() - 4, size.getWidth() - 4, size.getHeight() - 4, Constants.LINE_NONE);
GraphHelper.drawLine(g2d, size.getWidth() - 4, 4, size.getWidth() - 4, size.getHeight() - 4, Constants.LINE_NONE);
}
g2d.setStroke(oldStroke);
}
protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(borderStroke);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(borderColor);
g2d.draw(shape);
}
public void setExtraPainted(boolean extra) {
this.isExtraPainted = extra;
}
/**
* 是否额外画
*
* @return 是则返回TRUE
*/
public boolean isExtraPainted() {
return this.isExtraPainted;
}
/**
* @return
*/
public int getRectDirection() {
return rectDirection;
}
/**
* 是否圆边框
*
* @return 是则返回true
*/
public boolean isRoundBorder() {
return isRoundBorder;
}
/**
* @param isRoundBorder
*/
public void setRoundBorder(boolean isRoundBorder) {
setRoundBorder(isRoundBorder, Constants.NULL);
}
/**
* @param isRound
* @param rectDirection
*/
public void setRoundBorder(boolean isRound, int rectDirection) {
this.isRoundBorder = isRound;
this.rectDirection = rectDirection;
}
/**
* 是否按压画
*
* @return 是则返回TRUE
*/
public boolean isPressedPainted() {
return isPressedPainted;
}
/**
* @param isPressedPainted
*/
public void setPressedPainted(boolean isPressedPainted) {
this.isPressedPainted = isPressedPainted;
}
/**
* 是否正常画
*
* @return 是则返回TRUE
*/
public boolean isNormalPainted() {
return isNormalPainted;
}
/**
* @param isNormalPressed
*/
public void setNormalPainted(boolean isNormalPressed) {
this.isNormalPainted = isNormalPressed;
if (!isNormalPressed) {
setBackground(null);
setOpaque(false);
}
}
/**
* @param value
*/
public void setBorderPaintedOnlyWhenPressed(boolean value) {
this.isBorderPaintedOnlyWhenPressed = value;
}
@Override
public Point getToolTipLocation(MouseEvent event) {
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
/**
* 主函数
*
* @param args 入口参数
*/
public static void main(String... args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(null);
UISliderButton bb = new UISliderButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
bb.setEnabled(false);
bb.setBorderType(OTHER_BORDER);
// bb.setBounds(20, 20,content.getSize().width, bb.getPreferredSize().height);
bb.setPreferredSize(new Dimension(100, 30));
bb.setBounds(0, 0, bb.getPreferredSize().width, bb.getPreferredSize().height);
content.add(bb);
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);
jf.setVisible(true);
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
this.uiObserverListener = listener;
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
}

227
designer_base/src/com/fr/design/gui/ibutton/UISliderButtonUI.java

@ -0,0 +1,227 @@
package com.fr.design.gui.ibutton;
import java.awt.*;
import java.awt.geom.RoundRectangle2D;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.plaf.basic.BasicButtonUI;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.text.View;
import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.stable.Constants;
import sun.swing.SwingUtilities2;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUIPaintUtils;
import static com.fr.design.utils.gui.GUIPaintUtils.fillPaint;
public class UISliderButtonUI extends BasicButtonUI {
private Rectangle viewRec = new Rectangle();
private Rectangle textRec = new Rectangle();
private Rectangle iconRec = new Rectangle();
@Override
public void paint(Graphics g, JComponent c) {
UISliderButton b = (UISliderButton) c;
Graphics2D g2d = (Graphics2D) g;
int w = b.getWidth();
int h = b.getHeight();
String text = initRecAndGetText(b, SwingUtilities2.getFontMetrics(b, g), b.getWidth(), b.getHeight());
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
clearTextShiftOffset();
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
if (b.isExtraPainted()) {
if (isPressed(b) && b.isPressedPainted()) {
fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles));
} else if (isRollOver(b)) {
fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
} else if (b.isNormalPainted()) {
fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted());
}
}
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
paintContent(g, b, text);
}
protected boolean isRollOver(AbstractButton b) {
ButtonModel model = b.getModel();
return model.isRollover() && !b.isSelected();
}
protected boolean isPressed(AbstractButton b) {
ButtonModel model = b.getModel();
return (model.isArmed() && model.isPressed()) || b.isSelected();
}
private void paintContent(Graphics g, AbstractButton b, String text) {
if (b.getIcon() != null) {
paintIcon(g, b);
}
if (!StringUtils.isEmpty(text)) {
paintText(g, b, text);
}
}
private void paintText(Graphics g, AbstractButton b, String text) {
View v = (View) b.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
v.paint(g, textRec);
return;
}
FontMetrics fm = SwingUtilities2.getFontMetrics(b, g);
int mnemonicIndex = b.getDisplayedMnemonicIndex();
if (b.isEnabled()) {
g.setColor(UIConstants.FONT_COLOR);
} else {
g.setColor(UIConstants.LINE_COLOR);
}
SwingUtilities2.drawStringUnderlineCharAt(b, g, text, mnemonicIndex, textRec.x + getTextShiftOffset(), textRec.y + fm.getAscent() + getTextShiftOffset());
}
private String initRecAndGetText(AbstractButton b, FontMetrics fm, int width, int height) {
Insets i = b.getInsets();
viewRec.x = i.left;
viewRec.y = i.top;
viewRec.width = width - (i.right + viewRec.x);
viewRec.height = height - (i.bottom + viewRec.y);
textRec.x = textRec.y = textRec.width = textRec.height = 0;
iconRec.x = iconRec.y = iconRec.width = iconRec.height = 0;
// layout the text and icon
return SwingUtilities.layoutCompoundLabel(
b, fm, b.getText(), b.getIcon(),
b.getVerticalAlignment(), b.getHorizontalAlignment(),
b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
viewRec, iconRec, textRec,
b.getText() == null ? 0 : b.getIconTextGap());
}
protected void paintBorder(Graphics g, UISliderButton b) {
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
GUIPaintUtils.drawBorder((Graphics2D) g, 0, 0, b.getWidth(), b.getHeight(), b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles));
}
protected void paintIcon(Graphics g, JComponent c) {
AbstractButton b = (AbstractButton) c;
ButtonModel model = b.getModel();
Icon icon = b.getIcon();
Icon tmpIcon = null;
if (icon == null) {
return;
}
Icon selectedIcon = null;
/* the fallback icon should be based on the selected state */
if (model.isSelected()) {
selectedIcon = (Icon) b.getSelectedIcon();
if (selectedIcon != null) {
icon = selectedIcon;
}
}
if (!model.isEnabled()) {
if (model.isSelected()) {
tmpIcon = (Icon) b.getDisabledSelectedIcon();
if (tmpIcon == null) {
tmpIcon = selectedIcon;
}
}
if (tmpIcon == null) {
tmpIcon = (Icon) b.getDisabledIcon();
}
} else if (model.isPressed() && model.isArmed()) {
tmpIcon = (Icon) b.getPressedIcon();
if (tmpIcon != null) {
// revert back to 0 offset
clearTextShiftOffset();
}
} else if (b.isRolloverEnabled() && model.isRollover()) {
if (model.isSelected()) {
tmpIcon = (Icon) b.getRolloverSelectedIcon();
if (tmpIcon == null) {
tmpIcon = selectedIcon;
}
}
if (tmpIcon == null) {
tmpIcon = (Icon) b.getRolloverIcon();
}
}
if (tmpIcon != null) {
icon = tmpIcon;
}
paintModelIcon(model, icon, g, c);
}
private void paintModelIcon(ButtonModel model, Icon icon, Graphics g, JComponent c) {
if (model.isPressed() && model.isArmed()) {
icon.paintIcon(c, g, iconRec.x + getTextShiftOffset(),
iconRec.y + getTextShiftOffset());
} else {
icon.paintIcon(c, g, iconRec.x, iconRec.y);
}
}
private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp;
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB);
}else{
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER);
}
fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC);
}
private void fillRollOver(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp;
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.HOVER_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER);
}else {
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER);
}
fillPaint(g2d, x, y, width, height, isRound, rectDirection, gp, UIConstants.ARC);
}
private void fillPressed(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited) {
Color oldColor = g2d.getColor();
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
g2d.setColor(UIConstants.AUTHORITY_PRESS_BLUE);
} else {
g2d.setColor(UIConstants.POP_DIALOG_BORDER);
}
Shape oldClip = g2d.getClip();
if (isRound) {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.clip(new RoundRectangle2D.Double(x, y, width, height, UIConstants.ARC, UIConstants.ARC));
g2d.fillRoundRect(x, y, width, height, UIConstants.ARC, UIConstants.ARC);
g2d.setClip(oldClip);
if (rectDirection == Constants.RIGHT) {
g2d.fillRect(width - 2, y, x + 2, height);
} else if (rectDirection == Constants.LEFT) {
g2d.fillRect(x, y, x + 2, height);
}
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} else {
g2d.clip(new Rectangle(x, y, width, height));
g2d.fillRect(0, 0, width, height);
g2d.setClip(oldClip);
}
g2d.setColor(oldColor);
}
}

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

@ -1,47 +0,0 @@
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();
}
});
}
}
}

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

@ -109,7 +109,7 @@ public class FormatPane extends AbstractBasicStylePane {
JPanel typePane = new JPanel(new BorderLayout());
typePane.add(typeComboBox, BorderLayout.CENTER);
typePane.setBorder(LEFT_BORDER);
centerPane.setBorder(LEFT_BORDER);
// centerPane.setBorder(LEFT_BORDER);
frFontPane.setBorder(LEFT_BORDER);
Component[][] components = getComponent(fontPane, centerPane, typePane);
@ -125,7 +125,7 @@ public class FormatPane extends AbstractBasicStylePane {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Base_Format"), SwingConstants.LEFT), typePane},
new Component[]{null, centerPane},
new Component[]{centerPane, null},
new Component[]{fontPane, frFontPane},
};
}
@ -248,7 +248,7 @@ public class FormatPane extends AbstractBasicStylePane {
this.typeComboBox.setSelectedItem(formatStyle);
int i = isArrayContainPattern(FormatField.getInstance().getFormatArray(formatStyle), pattern);
if (i == -1) {
this.textField.setSelectedIndex(0);
this.textField.setSelectedItem(pattern);
} else {
this.textField.setSelectedIndex(i);
}

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

@ -74,7 +74,7 @@ public class NumberDragBar extends JComponent {
g2.setColor(isEnabled() ? UIConstants.FONT_COLOR : UIManager.getColor("Label.disabledForeground"));
g2.drawString(String.valueOf(minValue), 2, 10);
g2.drawString(String.valueOf(maxValue), width - 20, 10);
g2.drawString(String.valueOf(maxValue), width - 10 * String.valueOf(maxValue).length(), 10);
if(minValue < 0) {
g2.drawString("0", width / 2 - 2, 10);
}

BIN
designer_base/src/com/fr/design/images/buttonicon/run24.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

After

Width:  |  Height:  |  Size: 942 B

BIN
designer_base/src/com/fr/design/images/buttonicon/runs.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 482 B

BIN
designer_base/src/com/fr/design/images/m_edit/paste.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 214 B

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

@ -2129,4 +2129,6 @@ FR-Designer_Mobile-Height-Limit=Height Limit
FR-Designer-AlphaFine_NO_Result=no search result
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=Select Color
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection
FR-Designer_Label=
FR-Designer_Widgetname=Widget Name

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

@ -2125,4 +2125,6 @@ FS-Designer_DS_Filter_Specify_Tip=Specify_Tip
FR-Designer-AlphaFine_NO_Result=no search result
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=Select Color
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection
FR-Designer_Label=Label
FR-Designer_Widgetname=Widget Name

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

@ -2124,3 +2124,5 @@ FR-Designer_Mobile-Height-Limit=
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=\
FR-Designer_Label=\u30E9\u30D9\u30EBa
FR-Designer_Widgetname=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u540D

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

@ -2124,4 +2124,6 @@ FR-Designer_Mobile-Height-Percent=
FR-Designer_Mobile-Height-Limit=
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=
FR-Designer-Basic_Dynamic_Parameter_Injection=
FR-Designer_Label=\uB808\uC774\uBE14
FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984

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

@ -2136,4 +2136,6 @@ FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u4E3A1,2-3,5,8\
FR-Designer-AlphaFine_NO_Result=\u65E0\u641C\u7D22\u7ED3\u679C
FR-Designer-Download_Online_Sources=\u56FE\u8868\u9700\u8981\u4E0B\u8F7D\u6700\u65B0\u7684\u8D44\u6E90\u6587\u4EF6\uFF0C\u662F\u5426\u5B89\u88C5\uFF1F
FR-Designer_Select_Color=\u9009\u62E9\u989C\u8272
FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165
FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165
FR-Designer_Label=\u6807\u7B7E
FR-Designer_Widgetname=\u63A7\u4EF6\u540D

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

@ -2129,3 +2129,5 @@ FR-Designer-AlphaFine_NO_Result=\u7121\u641C\u7D22\u7D50\u679C
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165
FR-Designer_Label=\u6A19\u7C3D
FR-Designer_Widgetname=\u63A7\u5236\u9805\u540D

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

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ibutton.UISliderButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.islider.UISlider;
import com.fr.design.gui.ispinner.UIBasicSpinner;
@ -16,6 +17,8 @@ import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter;
import java.awt.*;
import java.awt.event.*;
import java.math.BigDecimal;
@ -44,7 +47,7 @@ public class JFormSliderPane extends JPanel {
private static final int SHOWVALBUTTON_WIDTH = 40;
private static final int SHOWVALBUTTON_HEIGHTH = 20;
private static final int SLIDER_GAP = 5;
private static final int TOOLTIP_Y = 25;
private static final int TOOLTIP_Y = 30;
private static final Color BACK_COLOR = new Color(245, 245, 247);
public int showValue = 100;
public double resolutionTimes = 1.0;
@ -56,7 +59,7 @@ public class JFormSliderPane extends JPanel {
private int sliderValue;
private UIButton downButton;
private UIButton upButton;
private JButton showValButton;
private UISliderButton showValButton;
private UIRadioButton twoHundredButton;
private UIRadioButton oneHundredButton;
private UIRadioButton SevenFiveButton;
@ -75,6 +78,15 @@ public class JFormSliderPane extends JPanel {
this.setLayout(new BorderLayout());
initSlider();
initShowValSpinner();
//MoMeak:控制只能输入10-400
JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0");
showValSpinner.setEditor(editor);
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.setEditable(true);
DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory();
NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
formatter.setAllowsInvalid(false);
initDownUpButton();
initShowValButton();
initUIRadioButton();
@ -111,7 +123,7 @@ public class JFormSliderPane extends JPanel {
}
private void initShowValSpinner() {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)){
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
@ -145,14 +157,7 @@ public class JFormSliderPane extends JPanel {
}
private void initShowValButton() {
showValButton = new JButton(showValSpinner.getValue() + "%"){
public Point getToolTipLocation(MouseEvent event){
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
showValButton.setOpaque(false);
showValButton.setMargin(new Insets(0, 0, 0, 0));
showValButton.setFont(new Font("SimSun", Font.PLAIN, 12));
showValButton = new UISliderButton(showValSpinner.getValue() + "%");
showValButton.setBackground(BACK_COLOR);
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
@ -174,8 +179,17 @@ public class JFormSliderPane extends JPanel {
SevenFiveButton.addItemListener(radioButtonItemListener);
fiveTenButton.addItemListener(radioButtonItemListener);
twoFiveButton.addItemListener(radioButtonItemListener);
//TODO
// selfAdaptButton.addItemListener();
customButton.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
JRadioButton temp = (JRadioButton) e.getSource();
if (temp.isSelected()) {
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.requestFocus();
textField.selectAll();
}
}
});
ButtonGroup bg = new ButtonGroup();// 初始化按钮组
bg.add(twoHundredButton);// 加入按钮组
@ -256,6 +270,8 @@ public class JFormSliderPane extends JPanel {
}
refreshSlider(val);
refreshBottun(val);
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.setCaretPosition(showValSpinner.getValue().toString().length());
}
};
@ -325,7 +341,7 @@ public class JFormSliderPane extends JPanel {
public void actionPerformed(ActionEvent e) {
showValue = (int) showValSpinner.getValue();
isButtonOrIsTxt = true;
if (e.getActionCommand().equals("less")) {
if ("less".equals(e.getActionCommand())) {
int newDownVal = showValue - TEN;
if (newDownVal >= TEN) {
showValue = newDownVal;
@ -335,7 +351,7 @@ public class JFormSliderPane extends JPanel {
showValSpinner.setValue(TEN);
}
}
if (e.getActionCommand().equals("more")) {
if ("more".equals(e.getActionCommand())) {
int newUpVal = showValue + TEN;
if (newUpVal <= FOUR_HUNDRED) {
showValue = newUpVal;

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

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ibutton.UISliderButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.islider.UISlider;
import com.fr.design.gui.ispinner.UIBasicSpinner;
@ -17,6 +18,9 @@ import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.basic.BasicSliderUI;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.NumberFormatter;
import java.awt.*;
import java.awt.event.*;
import java.math.BigDecimal;
@ -45,7 +49,7 @@ public class JSliderPane extends JPanel {
private static final int SHOWVALBUTTON_WIDTH = 40;
private static final int SHOWVALBUTTON_HEIGHTH = 20;
private static final int SLIDER_GAP = 5;
private static final int TOOLTIP_Y = 25;
private static final int TOOLTIP_Y = 30;
private static final Color BACK_COLOR = new Color(245, 245, 247);
public int showValue = 100;
@ -58,7 +62,7 @@ public class JSliderPane extends JPanel {
private int sliderValue;
private UIButton downButton;
private UIButton upButton;
private JButton showValButton;
private UISliderButton showValButton;
private UIRadioButton twoHundredButton;
private UIRadioButton oneHundredButton;
private UIRadioButton SevenFiveButton;
@ -77,6 +81,15 @@ public class JSliderPane extends JPanel {
this.setLayout(new BorderLayout());
initSlider();
initShowValSpinner();
//MoMeak:控制只能输入10-400
JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0");
showValSpinner.setEditor(editor);
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.setEditable(true);
DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory();
NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter();
formatter.setAllowsInvalid(false);
initDownUpButton();
initShowValButton();
initUIRadioButton();
@ -114,7 +127,7 @@ public class JSliderPane extends JPanel {
}
private void initShowValSpinner() {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)) {
showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)) {
public Point getToolTipLocation(MouseEvent event) {
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
@ -148,14 +161,7 @@ public class JSliderPane extends JPanel {
}
private void initShowValButton() {
showValButton = new JButton(showValSpinner.getValue() + "%") {
public Point getToolTipLocation(MouseEvent event) {
return new Point(event.getX(), event.getY() - TOOLTIP_Y);
}
};
showValButton.setOpaque(false);
showValButton.setMargin(new Insets(0, 0, 0, 0));
showValButton.setFont(new Font("SimSun", Font.PLAIN, 12));
showValButton = new UISliderButton(showValSpinner.getValue() + "%");
showValButton.setBackground(BACK_COLOR);
showValButton.setBorderPainted(false);
showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH));
@ -178,8 +184,17 @@ public class JSliderPane extends JPanel {
SevenFiveButton.addItemListener(radioButtonItemListener);
fiveTenButton.addItemListener(radioButtonItemListener);
twoFiveButton.addItemListener(radioButtonItemListener);
//TODO
// selfAdaptButton.addItemListener();
customButton.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
JRadioButton temp = (JRadioButton) e.getSource();
if (temp.isSelected()) {
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.requestFocus();
textField.selectAll();
}
}
});
ButtonGroup bg = new ButtonGroup();// 初始化按钮组
bg.add(twoHundredButton);// 加入按钮组
@ -261,6 +276,8 @@ public class JSliderPane extends JPanel {
}
refreshSlider(val);
refreshBottun(val);
JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField();
textField.setCaretPosition(showValSpinner.getValue().toString().length());
}
};
@ -331,7 +348,7 @@ public class JSliderPane extends JPanel {
public void actionPerformed(ActionEvent e) {
showValue = (int) showValSpinner.getValue();
isButtonOrIsTxt = true;
if (e.getActionCommand().equals("less")) {
if ("less".equals(e.getActionCommand())) {
int newDownVal = showValue - TEN;
if (newDownVal >= TEN) {
showValue = newDownVal;
@ -341,7 +358,7 @@ public class JSliderPane extends JPanel {
showValSpinner.setValue(TEN);
}
}
if (e.getActionCommand().equals("more")) {
if ("more".equals(e.getActionCommand())) {
int newUpVal = showValue + TEN;
if (newUpVal <= FOUR_HUNDRED) {
showValue = newUpVal;

10
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -1055,4 +1055,14 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
return uiButtons;
}
/**
* 由于老版本的模板没有模板ID当勾选使用参数模板时候就加一个模板ID
* @param isUseParamTemplate 是否使用参数模板
*/
public void needAddTemplateId(boolean isUseParamTemplate) {
if (isUseParamTemplate && StringUtils.isEmpty(template.getTemplateID())) {
template.initTemplateID();
}
}
}

8
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -5,6 +5,7 @@ package com.fr.design.mainframe.toolbar;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.FRCoreContext;
import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
@ -34,6 +35,7 @@ import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.general.VT4FR;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginRuntime;
import com.fr.plugin.manage.PluginFilter;
@ -379,8 +381,10 @@ public abstract class ToolBarMenuDock {
// shortCuts.add(new ForumAction());
}
shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new AlphaFineAction());
shortCuts.add(SeparatorDef.DEFAULT);
if (VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support()) {
shortCuts.add(new AlphaFineAction());
shortCuts.add(SeparatorDef.DEFAULT);
}
shortCuts.add(new AboutAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]);
}

80
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java

@ -1,41 +1,41 @@
package com.fr.design.mainframe.widget.accessibles;
import javax.swing.SwingUtilities;
import com.fr.design.mainframe.widget.wrappers.TreeModelWrapper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.frpane.TreeSettingPane;
/**
* 用于TreeEdito和TreeComboBox的数据格式设置
* @since 6.5.3
*/
public class AccessibleTreeModelEditor extends UneditableAccessibleEditor {
private TreeSettingPane treeSettingPane;
public AccessibleTreeModelEditor() {
super(new TreeModelWrapper());
}
@Override
protected void showEditorPane() {
if (treeSettingPane == null) {
treeSettingPane = new TreeSettingPane(false);
}
BasicDialog dlg = treeSettingPane.showWindow(SwingUtilities.getWindowAncestor(this));
treeSettingPane.populate(getValue());
dlg.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
Object nodeOrDict = treeSettingPane.updateTreeNodeAttrs();
setValue(nodeOrDict);
fireStateChanged();
}
});
dlg.setVisible(true);
}
package com.fr.design.mainframe.widget.accessibles;
import javax.swing.SwingUtilities;
import com.fr.design.mainframe.widget.wrappers.TreeModelWrapper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.frpane.TreeSettingPane;
/**
* 用于TreeEdito和TreeComboBox的数据格式设置
* @since 6.5.3
*/
public class AccessibleTreeModelEditor extends UneditableAccessibleEditor {
private TreeSettingPane treeSettingPane;
public AccessibleTreeModelEditor() {
super(new TreeModelWrapper());
}
@Override
protected void showEditorPane() {
if (treeSettingPane == null) {
treeSettingPane = new TreeSettingPane(false);
}
BasicDialog dlg = treeSettingPane.showWindow(SwingUtilities.getWindowAncestor(this));
treeSettingPane.populate(getValue());
dlg.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
Object nodeOrDict = treeSettingPane.updateTreeNodeAttrs();
setValue(nodeOrDict);
fireStateChanged();
}
});
dlg.setVisible(true);
}
}

78
designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java → designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java

@ -1,40 +1,40 @@
package com.fr.design.mainframe.widget.wrappers;
import com.fr.base.TemplateUtils;
import com.fr.data.impl.TreeNodeAttr;
import com.fr.data.impl.TreeNodeWrapper;
import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.StringUtils;
public class TreeModelWrapper implements Encoder, Decoder {
@Override
public String encode(Object v) {
if (v == null) {
return StringUtils.EMPTY;
}
if (v instanceof TreeNodeAttr[]) {
return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{((TreeNodeAttr[]) v).length + ""});
} else if (v instanceof TreeNodeWrapper) {
TreeNodeAttr[] treeNodeAttrs = ((TreeNodeWrapper) v).getTreeNodeAttrs();
return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{treeNodeAttrs.length + ""});
} else if (v instanceof NameObject) {
return Inter.getLocText("FR-Designer_DataTable-Build");
} else {
return Inter.getLocText("FR-Designer_Auto-Build");
}
}
@Override
public Object decode(String txt) {
return null;
}
@Override
public void validate(String txt) throws ValidationException {
}
package com.fr.design.mainframe.widget.wrappers;
import com.fr.base.TemplateUtils;
import com.fr.data.impl.TreeNodeAttr;
import com.fr.data.impl.TreeNodeWrapper;
import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.StringUtils;
public class TreeModelWrapper implements Encoder, Decoder {
@Override
public String encode(Object v) {
if (v == null) {
return StringUtils.EMPTY;
}
if (v instanceof TreeNodeAttr[]) {
return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{((TreeNodeAttr[]) v).length + ""});
} else if (v instanceof TreeNodeWrapper) {
TreeNodeAttr[] treeNodeAttrs = ((TreeNodeWrapper) v).getTreeNodeAttrs();
return TemplateUtils.render(Inter.getLocText("FR-Designer_Total_N_Grade"), new String[]{"N"}, new String[]{treeNodeAttrs.length + ""});
} else if (v instanceof NameObject) {
return Inter.getLocText("FR-Designer_DataTable-Build");
} else {
return Inter.getLocText("FR-Designer_Auto-Build");
}
}
@Override
public Object decode(String txt) {
return null;
}
@Override
public void validate(String txt) throws ValidationException {
}
}

13
designer_base/src/com/fr/design/present/dict/FormulaDictPane.java

@ -28,17 +28,6 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
initComponents();
}
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 FormulaDictPane(), BorderLayout.NORTH);
GUICoreUtils.centerWindow(jf);
jf.setSize(250, 400);
jf.setVisible(true);
}
private void initComponents() {
keyFormulaEditor = new FormulaEditor();
keyFormulaEditor.setColumns(EDITOR_COLUMN);
@ -59,7 +48,7 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
UILabel tag = new UILabel(Inter.getLocText("Formula_Dictionary_Display_Examples_Html"));
tag.setPreferredSize(new Dimension(225, 40));
tag.setPreferredSize(new Dimension(225, 80));
JPanel t = new JPanel(new BorderLayout());
t.add(tag, BorderLayout.CENTER);

2
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -42,6 +42,7 @@ import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.DownloadOnlineSourcesHelper;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.AreaIndependentVanChartInterface;
import com.fr.plugin.chart.area.VanChartAreaPlot;
@ -125,6 +126,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
//重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance());
DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
}
});
}

6
designer_chart/src/com/fr/design/chart/gui/ChartComponent.java

@ -331,10 +331,4 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
public void callback() {
this.repaint();
}
@Override
public void downLoadSources() {
HistoryTemplateListPane.getInstance().downLoadSources();
}
}

6
designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

@ -11,6 +11,7 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
@ -42,6 +43,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
//轮播切换方式配置接界面
private JPanel carouselConfigPane;
protected UISpinner timeInterval;
protected UICheckBox arrowCheckbox;
private ColorSelectBoxWithOutTransparent colorSelectBox4carousel;
public ChangeConfigPane(){
@ -95,9 +97,11 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
double[] rowSize = {p,p,p};
timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0);
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH);
arrowCheckbox = new UICheckBox(Inter.getLocText("FR-Base_TurnOn"));
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), timeInterval},
new Component[]{new UILabel(Inter.getLocText("Background")),colorSelectBox4carousel},
new Component[] {new UILabel(Inter.getLocText("Plugin-ChartF_Arrow_Style")), arrowCheckbox}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
@ -174,6 +178,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
//轮播切换界面
timeInterval.setValue(changeConfigAttr.getTimeInterval());
colorSelectBox4carousel.setSelectObject(changeConfigAttr.getCarouselColor());
arrowCheckbox.setSelected(changeConfigAttr.getShowArrow());
checkCardPane();
@ -197,6 +202,7 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
changeConfigAttr.setButtonColor(colorSelectBox4button.getSelectObject());
changeConfigAttr.setTimeInterval((int) timeInterval.getValue());
changeConfigAttr.setCarouselColor(colorSelectBox4carousel.getSelectObject());
changeConfigAttr.setShowArrow(arrowCheckbox.isSelected());
}
@Override

13
designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java → designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java

@ -1,4 +1,4 @@
package com.fr.design.gui.chart;
package com.fr.plugin.chart;
import com.fr.base.FRContext;
import com.fr.design.RestartHelper;
@ -26,7 +26,7 @@ import java.util.List;
/**
* Created by shine on 2017/8/21.
*/
public class DownLoadOnLineSourcesHelper {
public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent{
// 定义加载窗口大小
private static final int LOAD_WIDTH = 455;
private static final int INCIDENT_HEIGHT = 15;
@ -151,7 +151,7 @@ public class DownLoadOnLineSourcesHelper {
private void initDialog() {
// 创建标签,并在标签上放置一张图片
BufferedImage image = IOUtils.readImage("/com/fr/design/gui/chart/background.png");
BufferedImage image = IOUtils.readImage("/com/fr/plugin/chart/background.png");
ImageIcon imageIcon = new ImageIcon(image);
UILabel label = new UILabel(imageIcon);
label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT);
@ -209,6 +209,13 @@ public class DownLoadOnLineSourcesHelper {
}
}
@Override
public void downloadSources() {
this.addMapJSONSiteInfo();
this.addPhantomSiteInfo();
this.installOnline();
}
private class SiteInfo {
String siteKind;
String localDir;

0
designer_base/src/com/fr/design/gui/chart/background.png → designer_chart/src/com/fr/plugin/chart/background.png

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

26
designer_chart/src/com/fr/plugin/chart/map/designer/type/VanChartMapSourceChoosePane.java

@ -57,10 +57,28 @@ import java.util.ArrayList;
public class VanChartMapSourceChoosePane extends JPanel implements UIObserver {
private static final double[] COLUMN_SIZE = {48, TableLayout.FILL, TableLayout.PREFERRED};
public static final ZoomLevel[] ZOOM_LEVELS = new ZoomLevel[]{ZoomLevel.AUTO, ZoomLevel.ZERO, ZoomLevel.ONE,
ZoomLevel.TWO, ZoomLevel.THREE, ZoomLevel.FOUR, ZoomLevel.FIVE, ZoomLevel.SIX, ZoomLevel.SEVEN,
ZoomLevel.EIGHT, ZoomLevel.NINE, ZoomLevel.TEN, ZoomLevel.ELEVEN, ZoomLevel.TWELVE, ZoomLevel.THIRTEEN,
ZoomLevel.FOURTEEN, ZoomLevel.FIFTEEN, ZoomLevel.SIXTEEN, ZoomLevel.SEVENTEEN, ZoomLevel.EIGHTEEN};
public static final ZoomLevel[] ZOOM_LEVELS = new ZoomLevel[]{
ZoomLevel.AUTO,
ZoomLevel.ZERO, ZoomLevel.ZEROPOINTFIVE,
ZoomLevel.ONE, ZoomLevel.ONEPOINTFIVE,
ZoomLevel.TWO, ZoomLevel.TWOPOINTFIVE,
ZoomLevel.THREE, ZoomLevel.THREEPOINTFIVE,
ZoomLevel.FOUR, ZoomLevel.FOURPOINTFIVE,
ZoomLevel.FIVE, ZoomLevel.FIVEPOINTFIVE,
ZoomLevel.SIX, ZoomLevel.SIXPOINTFIVE,
ZoomLevel.SEVEN, ZoomLevel.SEVENPOINTFIVE,
ZoomLevel.EIGHT, ZoomLevel.EIGHTPOINTFIVE,
ZoomLevel.NINE, ZoomLevel.NINEPOINTFIVE,
ZoomLevel.TEN, ZoomLevel.TENPOINTFIVE,
ZoomLevel.ELEVEN, ZoomLevel.ELEVENTPOINTFIVE,
ZoomLevel.TWELVE, ZoomLevel.TWELVEPOINTFIVE,
ZoomLevel.THIRTEEN, ZoomLevel.THIRTEENPOINTFIVE,
ZoomLevel.FOURTEEN, ZoomLevel.FOURTEENPOINTFIVE,
ZoomLevel.FIFTEEN, ZoomLevel.FIFTEENPOINTFIVE,
ZoomLevel.SIXTEEN, ZoomLevel.SIXTEENPOINTFIVE,
ZoomLevel.SEVENTEEN, ZoomLevel.SEVENTEENPOINTFIVE,
ZoomLevel.EIGHTEEN
};
private static final String AUTO_CENTER_STRING = Inter.getLocText("Plugin-ChartF_Automatic");
private static final String CUSTOM_CENTER_STRING = Inter.getLocText("Plugin-ChartF_Custom");

55
designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java

@ -36,33 +36,37 @@ import java.util.EventObject;
*/
class MobileParaWidgetTable extends JTable {
private final int WIDGET_NAME_COLUMN = 1;
private FormDesigner designer;
private String[][] cellData;
private String[] headers = {Inter.getLocText("Form-Widget_Name")};
private String[] headers = {Inter.getLocText("FR-Designer_Label"), Inter.getLocText("FR-Designer_Widgetname")};
private static final int WIDGET_TABLE_ROW_HEIGHT = 22;
private static final int UITEXTFIELD_WIDTH = 40;
private static final int UITEXTFIELD_WIDTH = 0;
private static final int GAP = 11;
private UILabel moveComponent = new UILabel(); // 作为拖动时候随鼠标移动的那个半透明控件
private int selectedRow = -1;
private int selectedColumn = -1;
private int GAP = 11;
private boolean draging = false;
MobileParaWidgetTable(FormDesigner designer) {
private void init(FormDesigner designer) {
this.designer = designer;
this.cellData = getData();
this.setTableProperties();
this.setDefaultEditor(Object.class, new MobileCellEditor());
TableModel defaultModel = new BeanTableModel();
this.setModel(defaultModel);
this.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
this.setModel(new BeanTableModel());
this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
TableColumn tc = this.getColumn(this.getColumnName(0));
tc.setMinWidth(UITEXTFIELD_WIDTH);
tc.setMaxWidth(UITEXTFIELD_WIDTH);
tc.setPreferredWidth(UITEXTFIELD_WIDTH);
this.repaint();
this.setDefaultRenderer(Object.class, new MobileWidgetTableCellRenderer());
refreshData();
this.addMouseListener(mouseAdapter);
this.addMouseMotionListener(mouseAdapter);
}
MobileParaWidgetTable(FormDesigner designer) {
init(designer);
add(moveComponent);
}
@ -140,24 +144,27 @@ class MobileParaWidgetTable extends JTable {
*/
@Override
public void mouseDragged(MouseEvent e) {
int width = getColumnModel().getColumn(0).getWidth();
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
draging = true;
moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString());
moveComponent.setLocation(getColumnModel().getColumn(0).getWidth(), e.getY() - GAP);
moveComponent.setSize(new Dimension(width, WIDGET_TABLE_ROW_HEIGHT));
moveComponent.setVisible(true);
moveComponent.setForeground(Color.lightGray);
moveComponent.setBorder(BorderFactory.createLineBorder(Color.lightGray));
int width = getColumnModel().getColumn(1).getWidth();
//如果点击选中的是第二列,就可以拖动
if (selectedColumn == 1) {
setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
draging = true;
moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString());
moveComponent.setLocation(getColumnModel().getColumn(0).getWidth(), e.getY() - GAP);
moveComponent.setSize(new Dimension(width, WIDGET_TABLE_ROW_HEIGHT));
moveComponent.setVisible(true);
moveComponent.setForeground(Color.lightGray);
moveComponent.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
}
/**
* 设置鼠标单击时处理的事件
* 设置鼠标单击时处理的事件单击第二列的控件列表进入控件属性表
* @param e
*/
@Override
public void mouseClicked(MouseEvent e) {
if (getSelectedRow() != -1 && getSelectedColumn() == 0) {
if (getSelectedRow() != -1 && getSelectedColumn() == 1) {
String widgetName = cellData[getSelectedRow()][getSelectedColumn()];
if (StringUtils.isNotEmpty(widgetName)) {
int count = getEditingDesigner().getParaComponent().getComponentCount();
@ -222,7 +229,7 @@ class MobileParaWidgetTable extends JTable {
private String[][] getData() {
XLayoutContainer paraContainer = designer.getParaComponent();
if (paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)) {
return new String[0][1];
return new String[0][0];
}
WParameterLayout para = (WParameterLayout) (paraContainer.toData());
@ -342,7 +349,7 @@ class MobileParaWidgetTable extends JTable {
}
Object[] rowValue = cellData[row];
if (column > -1 && column < rowValue.length) {
return cellData[row][WIDGET_NAME_COLUMN];
return cellData[row][column];
}
return null;
}
@ -363,10 +370,10 @@ class MobileParaWidgetTable extends JTable {
return;
}
if (aValue == null) {
cellData[row][WIDGET_NAME_COLUMN] = null;
cellData[row][column] = null;
return;
}
cellData[row][WIDGET_NAME_COLUMN] = aValue.toString();
cellData[row][column] = aValue.toString();
}
/**
@ -377,7 +384,7 @@ class MobileParaWidgetTable extends JTable {
* @return 是否可编辑
*/
public boolean isCellEditable(int row, int column) {
return false;
return column != 1;
}
}

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

@ -184,16 +184,16 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (widgetBoundPane != null) {
widgetBoundPane.populate();
}
if (cellWidget instanceof WScaleLayout) {
Widget innerWidget = cellWidget;
if (cellWidget.acceptType(WScaleLayout.class)) {
Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget();
currentEditorDefinePane.populateBean(((CRBoundsWidget) crBoundsWidget).getWidget());
} else if(cellWidget instanceof WTitleLayout){
innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget();
} else if(cellWidget.acceptType(WTitleLayout.class)){
CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget();
currentEditorDefinePane.populateBean(crBoundsWidget.getWidget());
}else{
currentEditorDefinePane.populateBean(cellWidget);
innerWidget = crBoundsWidget.getWidget();
}
widgetPropertyPane.populate(cellWidget);
currentEditorDefinePane.populateBean(innerWidget);
widgetPropertyPane.populate(innerWidget);
reinitAllListeners();
this.addAttributeChangeListener(listener);
}
@ -207,12 +207,12 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
}
fireValueChanged();
if (xCreator instanceof XWScaleLayout) {
if (xCreator.acceptType(XWScaleLayout.class)) {
XCreator xCreator1 = xCreator.getEditingChildCreator();
xCreator1.resetData(widget);
xCreator.removeAll();
xCreator.add(xCreator1);
}else if(xCreator instanceof XWTitleLayout){
}else if(xCreator.acceptType(XWTitleLayout.class)){
XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0);
xCreator1.resetData(widget);
xCreator.removeAll();

19
designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java

@ -4,14 +4,17 @@ import com.fr.base.BaseUtils;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.container.WParameterLayout;
@ -29,8 +32,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
private XWParameterLayout root;
private UISpinner designerWidth;
private UICheckBox displayReport;
private UICheckBox useParamsTemplate;
private AccessibleBackgroundEditor background;
private UIButtonGroup hAlignmentPane;
private UITextField labelNameTextField;
public RootDesignDefinePane(XCreator xCreator) {
super(xCreator);
@ -69,7 +74,9 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelNameTextField = new UITextField();
displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery"));
useParamsTemplate = new UICheckBox(Inter.getLocText("FR-Designer_Use_Params_Template"));
background = new AccessibleBackgroundEditor();
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
@ -80,12 +87,14 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
, Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background},
new Component[]{displayReport, null},
new Component[]{useParamsTemplate, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
@ -101,8 +110,10 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override
public void populateBean(WParameterLayout ob) {
labelNameTextField.setText(ob.getLabelName());
background.setValue(ob.getBackground());
displayReport.setSelected(ob.isDelayDisplayContent());
useParamsTemplate.setSelected(ob.isUseParamsTemplate());
designerWidth.setValue(ob.getDesignWidth());
hAlignmentPane.setSelectedIndex(ob.getPosition());
}
@ -111,8 +122,12 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
@Override
public WParameterLayout updateBean() {
WParameterLayout wParameterLayout = (WParameterLayout) creator.toData();
wParameterLayout.setLabelName(labelNameTextField.getText());
wParameterLayout.setDesignWidth((int) designerWidth.getValue());
wParameterLayout.setDelayDisplayContent(displayReport.isSelected());
wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected());
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
jTemplate.needAddTemplateId(useParamsTemplate.isSelected());
wParameterLayout.setBackground((Background) background.getValue());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex());
return wParameterLayout;

23
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.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -17,9 +17,10 @@ import javax.swing.*;
import java.awt.*;
public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> {
private UIPropertyTextField hotkeysTextField;
private UIPropertyTextField buttonNameTextField;
private UITextField hotkeysTextField;
private UITextField buttonNameTextField;
private AccessibleIconEditor iconPane;
protected UITextField labelNameTextField;
public ButtonDefinePane(XCreator creator){
@ -31,18 +32,20 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
this.setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double rowSize[] = {p, p, p, p, p, p, p};
double rowSize[] = {p, p, p, p, p, p, p, p};
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}, {1, 1}};
iconPane = new AccessibleIconEditor();
hotkeysTextField = new UIPropertyTextField();
buttonNameTextField = new UIPropertyTextField();
hotkeysTextField = new UITextField();
buttonNameTextField = new UITextField();
labelNameTextField = new UITextField();
Component[] backgroundCompPane = createBackgroundComp();
Component[] frFont = createFontPane();
UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background"));
backgroundLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField},
{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
backgroundCompPane,
frFont,
{new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane},
@ -73,7 +76,8 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
@Override
public void populateBean(T btn) {
hotkeysTextField.setText(btn.getHotkeys());
buttonNameTextField.setText(btn.getLabelName());
buttonNameTextField.setText(btn.getText());
labelNameTextField.setText(btn.getLabelName());
iconPane.setValue(btn.getIconName());
populateSubButtonPane(btn);
}
@ -86,8 +90,9 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
public T updateBean() {
T btn = updateSubButtonPane();
btn.setHotkeys(hotkeysTextField.getText());
btn.setLabelName(buttonNameTextField.getText());
btn.setLabelName(labelNameTextField.getText());
btn.setIconName((String)iconPane.getValue());
btn.setText(buttonNameTextField.getText());
return btn;
}

13
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.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -16,9 +16,10 @@ import javax.swing.*;
import java.awt.*;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UIPropertyTextField text;
private UITextField text;
private UISpinner fontSizePane;
private FormWidgetValuePane formWidgetValuePane;
protected UITextField labelNameTextField;
public CheckBoxDefinePane(XCreator xCreator) {
super(xCreator);
@ -27,19 +28,21 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private void iniComoponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UIPropertyTextField();
text = new UITextField();
fontSizePane = new UISpinner(0, 20, 1, 0);
labelNameTextField = new UITextField();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text },
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane},
};
double[] rowSize = {p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 3},{1, 1}};
int[][] rowCount = {{1, 1},{1, 1}, {1, 3},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));

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

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

@ -5,7 +5,7 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.ComboCheckBox;
@ -17,7 +17,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox;
private UIButtonGroup returnType;
private UIPropertyTextField waterMarkDictPane;
private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox;
public ComboCheckBoxDefinePane(XCreator xCreator) {
@ -31,7 +31,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
}
public Component[] createWaterMarkPane() {
waterMarkDictPane = new UIPropertyTextField();
waterMarkDictPane = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
}

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

@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -38,6 +39,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup;
protected UITextField labelNameTextField;
public DateEditorDefinePane(XCreator xCreator) {
super(xCreator);
@ -58,12 +60,13 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")});
JPanel formatHead = createFormatHead();
labelNameTextField = new UITextField();
startDv = new DateValuePane();
endDv = new DateValuePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv},
@ -73,7 +76,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox}
};
double[] rowSize = {p, p, p, p, p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 3}, {1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10);

5
designer_form/src/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java

@ -34,15 +34,16 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane },
dicPane,
removeRepeatPane,
waterMarkComponent,
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
};
double[] rowSize = {p, p, p, p, p, p,p};
double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1,1},{1,1}};
int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1},{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH);

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

@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -22,9 +22,11 @@ import java.awt.event.ItemListener;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UIPropertyTextField errorMsgTextField;
protected UITextField errorMsgTextField;
protected JPanel validatePane;
protected UISpinner fontSizePane;
protected UITextField labelNameTextField;
public FieldEditorDefinePane(XCreator xCreator) {
super(xCreator);
@ -37,10 +39,11 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
labelNameTextField = new UITextField();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
fontSizePane = new UISpinner(0, 20, 1, 0);
errorMsgTextField = new UIPropertyTextField();
errorMsgTextField = new UITextField();
JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane);
@ -54,6 +57,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
this.allowBlankCheckBox.setSelected(ob.isAllowBlank());
this.errorMsgTextField.setText(ob.getErrorMessage());
this.fontSizePane.setValue(ob.getFontSize());
this.labelNameTextField.setText(ob.getLabelName());
populateSubFieldEditorBean(ob);
}
@ -66,12 +70,13 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
e.setAllowBlank(this.allowBlankCheckBox.isSelected());
e.setErrorMessage(this.errorMsgTextField.getText());
e.setFontSize((int)fontSizePane.getValue());
e.setLabelName(labelNameTextField.getText());
return e;
}
protected void initErrorMsgPane() {
// 错误信息
errorMsgTextField = new UIPropertyTextField();
errorMsgTextField = new UITextField();
// // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {

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

90
designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -4,13 +4,13 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter;
import com.fr.third.fr.pdf.layout.border.Border;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
@ -24,6 +24,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public NumberEditorDefinePane(XCreator xCreator){
super(xCreator);
}
private FormWidgetValuePane formWidgetValuePane;
/**
*
@ -37,23 +38,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel;
private com.fr.design.editor.editor.IntegerEditor decimalLength;
private UISpinner decimalLength;
private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane;
private ActionListener actionListener1;
private ActionListener actionListener2;
private ActionListener allowDecimalsListener;
private ActionListener allowNegativeListener ;
private ActionListener actionListener3;
public ActionListener setMaxListener;
private ActionListener setMinListener;
private ActionListener actionListener4 ;
private ChangeListener maxValueChangeListener;
private ChangeListener changeListener1;
private ChangeListener changeListener2 ;
private ChangeListener minValueChangeListener;
public NumberEditorDefinePane() {
super();
@ -73,13 +72,14 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}
};
double[] rowSize = {p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}};
int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1}};
JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
@ -88,17 +88,19 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}
private void initListeners(){
actionListener1 = new ActionListener() {
allowDecimalsListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
limitNumberPane.setPreferredSize(new Dimension(215,20));
} else {
limitNumberPane.setVisible(false);
limitNumberPane.setPreferredSize(new Dimension(0,0));
}
}
};
actionListener2 = new ActionListener() {
allowNegativeListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -125,7 +127,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
};
actionListener3 = new ActionListener() {
setMaxListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true);
@ -145,7 +147,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
};
actionListener4 = new ActionListener() {
setMinListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
@ -164,7 +166,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}
};
changeListener1 = new ChangeListener() {
maxValueChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
@ -176,7 +178,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}
};
changeListener2 = new ChangeListener() {
minValueChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
@ -191,42 +193,42 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
public JPanel setValidatePane() {
initListeners();
// super.addValidatePane();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
this.decimalLength.setColumns(4);
this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(actionListener2);
this.allowNegativeCheckBox.addActionListener(allowNegativeListener);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false);
setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner);
this.setMaxValueCheckBox.addActionListener(actionListener3);
this.maxValueSpinner.addChangeListener(changeListener1);
this.setMaxValueCheckBox.addActionListener(setMaxListener);
this.maxValueSpinner.addChangeListener(maxValueChangeListener);
this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("Need_Min_Value"), false);
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner);
minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMinValueCheckBox.addActionListener(actionListener4);
this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"}));
limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowDecimalsCheckBox, null },
new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength },
new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinner},
@ -235,7 +237,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return panel;
}
@ -273,7 +275,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setValue(new Double(e.getMinValue()));
}
formWidgetValuePane.populate(e);
// this.regErrorMsgTextField.setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e);
}
@ -284,7 +285,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
formWidgetValuePane.update(ob);
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength(this.decimalLength.getValue());
ob.setMaxDecimalLength((int)this.decimalLength.getValue());
}
ob.setAllowNegative(allowNegativeCheckBox.isSelected());
@ -306,20 +307,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
return ob;
}
private void checkVisible() {
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
} else {
minValueSpinner.setEnabled(false);
}
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
} else {
minValueSpinner.setEnabled(false);
}
}
private void setNotAllowsInvalid(UIBasicSpinner jspinner) {
JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) {
@ -331,4 +318,15 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}
}
public Object getValue(UIBasicSpinner jspinner){
JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) {
JFormattedTextField ftf = ((UIBasicSpinner.DefaultEditor) editor).getTextField();
ftf.setColumns(10);
JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter();
return ftf.getValue();
}
return null;
}
}

11
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.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -18,7 +18,7 @@ import java.awt.event.KeyEvent;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegPane regPane;
private UIPropertyTextField waterMarkDictPane;
private UITextField waterMarkDictPane;
FormWidgetValuePane formWidgetValuePane;
public TextFieldEditorDefinePane(XCreator xCreator) {
@ -47,7 +47,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
}
};
regPane.addPhoneRegListener(pl);
waterMarkDictPane = new UIPropertyTextField();
waterMarkDictPane = new UITextField();
waterMarkDictPane.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
regPane.removePhoneRegListener(pl);
@ -69,13 +69,14 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value"), SwingConstants.LEFT), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark"), SwingConstants.LEFT), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size"), SwingConstants.LEFT), fontSizePane}
};
double[] rowSize = {p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1}};
int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));

18
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.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UIPropertyTextField;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter;
@ -11,14 +11,14 @@ import java.awt.*;
public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
protected UIPropertyTextField waterMarkDictPane;
protected UITextField waterMarkDictPane;
public TreeComboBoxEditorDefinePane(XCreator xCreator) {
super(xCreator);
}
public Component[] createWaterMarkPane(){
waterMarkDictPane = new UIPropertyTextField();
waterMarkDictPane = new UITextField();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane};
}
@ -27,15 +27,13 @@ public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
return "treecombobox";
}
protected void populateSubDictionaryEditorBean(TreeEditor ob){
super.populateSubDictionaryEditorBean(ob);
formWidgetValuePane.populate(ob);
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor ob){
super.populateSubCustomWritableRepeatEditorBean(ob);
waterMarkDictPane.setText(ob.getWaterMark());
}
protected TreeEditor updateSubDictionaryEditorBean(){
TreeEditor editor = super.updateSubDictionaryEditorBean();
formWidgetValuePane.update(editor);
protected TreeEditor updateSubCustomWritableRepeatEditorBean(){
TreeEditor editor = super.updateSubCustomWritableRepeatEditorBean();
editor.setWaterMark(waterMarkDictPane.getText());
return editor;
}
@ -44,6 +42,6 @@ public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane {
@Override
public DataCreatorUI dataUI() {
return treeSettingPane;
return null;
}
}

30
designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java

@ -1,14 +1,16 @@
package com.fr.design.widget.ui.designer;
import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter;
@ -19,20 +21,21 @@ import java.awt.*;
/*
* richer:tree editor
*/
public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
protected TreeSettingPane treeSettingPane;
public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
protected TreeRootPane treeRootPane;
private UICheckBox mutiSelect;
private UICheckBox loadAsync;
private UICheckBox returnLeaf;
private UICheckBox returnPath;
private AccessibleTreeModelEditor accessibleTreeModelEditor;
public TreeEditorDefinePane(XCreator xCreator) {
super(xCreator);
treeRootPane = new TreeRootPane();
treeSettingPane = new TreeSettingPane(true);
}
public JPanel createOtherPane() {
mutiSelect = new UICheckBox(Inter.getLocText("Tree-Mutiple_Selection_Or_Not"));
loadAsync = new UICheckBox(Inter.getLocText("Widget-Load_By_Async"));
@ -58,9 +61,16 @@ public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
return "tree";
}
protected void populateSubDictionaryEditorBean(TreeEditor e){
protected Component[] createDictPane(){
accessibleTreeModelEditor = new AccessibleTreeModelEditor();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), accessibleTreeModelEditor};
}
@Override
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) {
accessibleTreeModelEditor.setValue(e.getDictionary());
formWidgetValuePane.populate(e);
treeSettingPane.populate(e);
treeRootPane.populate(e.getTreeAttr());
mutiSelect.setSelected(e.isMultipleSelection());
loadAsync.setSelected(e.isAjax());
@ -68,7 +78,9 @@ public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
returnPath.setSelected(e.isReturnFullPath());
}
protected TreeEditor updateSubDictionaryEditorBean(){
@Override
protected TreeEditor updateSubCustomWritableRepeatEditorBean() {
TreeEditor editor = (TreeEditor)creator.toData();
formWidgetValuePane.update(editor);
editor.setTreeAttr(treeRootPane.update());
@ -76,12 +88,12 @@ public class TreeEditorDefinePane extends DictEditorDefinePane<TreeEditor> {
editor.setAjax(loadAsync.isSelected());
editor.setSelectLeafOnly(returnLeaf.isSelected());
editor.setReturnFullPath(returnPath.isSelected());
editor.setDictionary((Dictionary) accessibleTreeModelEditor.getValue());
return editor;
}
@Override
public DataCreatorUI dataUI() {
return treeSettingPane;
return null;
}
}

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

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

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

@ -1,8 +1,8 @@
package com.fr.design.widget.ui.designer.btn;
import com.fr.data.Dictionary;
import com.fr.design.designer.creator.*;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -38,14 +38,15 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane},
new Component[]{buttonGroupDictPane, null}
};
double[] rowSize = {p, p, p, p, p, p};
double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1}};
int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH);
@ -66,6 +67,7 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
protected void populateSubFieldEditorBean(T e) {
this.buttonGroupDictPane.populate(e);
formWidgetValuePane.populate(e);
dictionaryEditor.setValue(e.getDictionary());
populateSubButtonGroupBean(e);
}
@ -78,6 +80,7 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
T e = updateSubButtonGroupBean();
this.buttonGroupDictPane.update(e);
formWidgetValuePane.update(e);
e.setDictionary((Dictionary) dictionaryEditor.getValue());
return e;
}

Loading…
Cancel
Save