diff --git a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java index a607538d6..dbf166048 100644 --- a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/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 diff --git a/designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java b/designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java index c5329da68..97f68cbf7 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java +++ b/designer/src/com/fr/design/mainframe/alphafine/cell/render/TitleCellRender.java @@ -33,14 +33,6 @@ public class TitleCellRender implements ListCellRenderer { 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; } diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index ed0bc5731..ae811dbda 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/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 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(); } } diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java index cfd37479e..8c962a001 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java +++ b/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() { diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif b/designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif new file mode 100644 index 000000000..715ab7aec Binary files /dev/null and b/designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif differ diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java index 711fd634d..32efda9ce 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/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(){ diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 53aa5e3dc..6be46f1c5 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/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()); } diff --git a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java index 26ae4d61f..30356efe8 100644 --- a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java +++ b/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; } diff --git a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java index bde3332b4..44d0df7f4 100644 --- a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java +++ b/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 { - private UIPropertyTextField text; + private UITextField text; public CheckBoxDefinePane() { this.iniComoponents(); @@ -22,7 +22,7 @@ public class CheckBoxDefinePane extends AbstractDataModify { 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)); diff --git a/designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java index 3d7e33510..2cdc0bc84 100644 --- a/designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java @@ -24,7 +24,7 @@ public abstract class DirectWriteEditorDefinePane 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); diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index ceb3d6476..054380b4d 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/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 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 extends Abstr protected void initErrorMsgPane() { // 错误信息 - errorMsgTextField = new UIPropertyTextField(); + errorMsgTextField = new UITextField(); // // richer:主要为了方便查看比较长的错误信息 errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { diff --git a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java index 218743c49..7416f314f 100644 --- a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java +++ b/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 { 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 { 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); diff --git a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java index 45d711e24..2862ab2ff 100644 --- a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java +++ b/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 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 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 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 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 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) { diff --git a/designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java index 3570cc66a..2a63a5b86 100644 --- a/designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java +++ b/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 { - 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; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java index d5bdb2255..96d83b7b6 100644 --- a/designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java +++ b/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 { - protected TreeSettingPane treeSettingPane; protected TreeRootPane treeRootPane; + private AccessibleTreeModelEditor accessibleTreeModelEditor; private UICheckBox removeRepeatCheckBox; @@ -27,7 +30,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane { @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 { @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 { } 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 { 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 { @Override public DataCreatorUI dataUI() { - return treeSettingPane; + return null; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java index 1f3812997..1bfcb0633 100644 --- a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java +++ b/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); } diff --git a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java b/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java index 0796d1dff..b1248df70 100644 --- a/designer_base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigManager.java +++ b/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) { diff --git a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java index 50eb2a46f..87d569324 100644 --- a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/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 diff --git a/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java b/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java deleted file mode 100644 index 8a949d4a1..000000000 --- a/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java +++ /dev/null @@ -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(); - } - }); - } - } -} diff --git a/designer_base/src/com/fr/design/gui/style/NumberDragBar.java b/designer_base/src/com/fr/design/gui/style/NumberDragBar.java index 013f76e92..0fa223a79 100644 --- a/designer_base/src/com/fr/design/gui/style/NumberDragBar.java +++ b/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); } diff --git a/designer_base/src/com/fr/design/images/buttonicon/run24.png b/designer_base/src/com/fr/design/images/buttonicon/run24.png index 8628e02a6..8ebe92439 100644 Binary files a/designer_base/src/com/fr/design/images/buttonicon/run24.png and b/designer_base/src/com/fr/design/images/buttonicon/run24.png differ diff --git a/designer_base/src/com/fr/design/images/buttonicon/runs.png b/designer_base/src/com/fr/design/images/buttonicon/runs.png index 4f1f6847b..bf91c74a0 100644 Binary files a/designer_base/src/com/fr/design/images/buttonicon/runs.png and b/designer_base/src/com/fr/design/images/buttonicon/runs.png differ diff --git a/designer_base/src/com/fr/design/images/m_edit/paste.png b/designer_base/src/com/fr/design/images/m_edit/paste.png index 656f9cc04..8ea606f06 100644 Binary files a/designer_base/src/com/fr/design/images/m_edit/paste.png and b/designer_base/src/com/fr/design/images/m_edit/paste.png differ diff --git a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java index 3a9e5e6dd..c796baa6c 100644 --- a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java @@ -16,6 +16,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; @@ -75,6 +77,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 +122,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); } @@ -325,7 +336,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 +346,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; diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 7f3ad51f4..006a38ce4 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -17,6 +17,8 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.plaf.basic.BasicSliderUI; +import javax.swing.text.DefaultFormatterFactory; +import javax.swing.text.NumberFormatter; import java.awt.*; import java.awt.event.*; import java.math.BigDecimal; @@ -77,6 +79,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 +125,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); } @@ -331,7 +342,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 +352,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; diff --git a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 17d9d6e36..fa99f0e28 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/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()]); } diff --git a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java b/designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java similarity index 96% rename from designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java rename to designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java index ef02c9f34..5ce099c91 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleTreeModelEditor.java +++ b/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); + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java b/designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java similarity index 97% rename from designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java rename to designer_base/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java index 17f9d0c89..1127c2503 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/wrappers/TreeModelWrapper.java +++ b/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 { + } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 6e8c89871..df150a3f1 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/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()); } }); } diff --git a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java b/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java index 2caa2a0b9..9c48aaa36 100644 --- a/designer_chart/src/com/fr/design/chart/gui/ChartComponent.java +++ b/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(); - } - } \ No newline at end of file diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java index 1f1f5a9f9..e2986a303 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java @@ -113,20 +113,20 @@ public class ChangeConfigPane extends BasicBeanPane { } }; styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight())); - return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character")+":", styleAttrPane); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character"), styleAttrPane); } private JPanel createButtonBackgroundColorPane(){ colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); - return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background") + ":", colorSelectBox4button); + return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background"), colorSelectBox4button); } private JPanel createButtonConfigPane() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p,p,p}; + double[] rowSize = {p,p}; Component[][] components = new Component[][]{ new Component[]{createTitleStylePane(),null}, new Component[]{createButtonBackgroundColorPane(),null}, diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java index f4a2381e7..0f09b016b 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java @@ -59,6 +59,18 @@ public class ChartDataFilterPane extends ThirdTabPane { } } + protected void initLayout() { + this.setLayout(new BorderLayout()); + if (!paneList.isEmpty()) { + JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0)); + if (nameArray.length > 1) { + pane.add(tabPane); + this.add(pane, BorderLayout.NORTH); + } + } + this.add(centerPane, BorderLayout.CENTER); + } + protected List initPaneList(Plot plot, AbstractAttrNoScrollPane parent) { plot4Pane = plot; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java index 35aa92b37..2612ae742 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java @@ -44,8 +44,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane { this.add(cardPane, BorderLayout.CENTER); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); this.add(panel, BorderLayout.SOUTH); } diff --git a/designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java b/designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java similarity index 95% rename from designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java rename to designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java index a8baa2593..1f8d05737 100644 --- a/designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java +++ b/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; diff --git a/designer_base/src/com/fr/design/gui/chart/background.png b/designer_chart/src/com/fr/plugin/chart/background.png similarity index 100% rename from designer_base/src/com/fr/design/gui/chart/background.png rename to designer_chart/src/com/fr/plugin/chart/background.png diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java index f9cda412e..756f31ca9 100644 --- a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java @@ -8,7 +8,6 @@ import com.fr.chart.chartdata.BubbleTableDefinition; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; @@ -50,7 +49,7 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = { p, p,p,p}; + double[] rowSize = {p, p}; double[] columnSize_north = {p, f}; double[] rowSize_north = {p, p, p, p}; @@ -62,20 +61,17 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}, }; - JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north); - north.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); + JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north); + north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15)); JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); - Component[][] components = new Component[][]{ - new Component[]{north}, - new Component[]{filterPane} - }; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); - this.add(panel, BorderLayout.CENTER); - + this.add(getJSeparator(), BorderLayout.NORTH); + this.add(north, BorderLayout.CENTER); + this.add(filterPane, BorderLayout.SOUTH); + seriesName.addItemListener(tooltipListener); xCombox.addItemListener(tooltipListener); yCombox.addItemListener(tooltipListener); diff --git a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java index f533aa6a7..59e92c7b8 100644 --- a/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java @@ -9,6 +9,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.chart.javascript.ChartEmailPane; import com.fr.design.designer.TargetComponent; import com.fr.design.fun.HyperlinkProvider; +import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; @@ -25,7 +26,6 @@ import com.fr.js.ParameterJavaScript; import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.designer.other.ChartHyperlinkNameObjectCreartor; import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; import com.fr.stable.ListMap; import com.fr.stable.Nameable; @@ -89,7 +89,6 @@ public class VanChartHyperLinkPane extends UIListControlPane { } public void populate(TargetComponent elementCasePane) { -// hyperlinkGroupPaneActionProvider.populate(this, elementCasePane); } /** @@ -113,7 +112,7 @@ public class VanChartHyperLinkPane extends UIListControlPane { if (isPopulating) { return; } - update((VanChartPlot)plot); + update((VanChartPlot) plot); } public void populate(Plot plot) { @@ -125,15 +124,14 @@ public class VanChartHyperLinkPane extends UIListControlPane { for (HyperlinkProvider provider : providers) { NameableCreator nc = provider.createHyperlinkCreator(); //todo@shine9.0 - // paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); + // paneMap.put(nc.getHyperlink(), nc.getUpdatePane()); } - //todo@mengao 去掉UIMenuNameableCreator java.util.List list = refreshList(paneMap); - ChartHyperlinkNameObjectCreartor[] creators= new ChartHyperlinkNameObjectCreartor[list.size()]; - for(int i = 0; list != null && i < list.size(); i++) { + NameObjectCreator[] creators = new NameObjectCreator[list.size()]; + for (int i = 0; list != null && i < list.size(); i++) { UIMenuNameableCreator uiMenuNameableCreator = list.get(i); - creators[i] = new ChartHyperlinkNameObjectCreartor(uiMenuNameableCreator.getObj(),uiMenuNameableCreator.getName(), uiMenuNameableCreator.getClass(), uiMenuNameableCreator.getPaneClazz()); + creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz()); } @@ -142,12 +140,12 @@ public class VanChartHyperLinkPane extends UIListControlPane { java.util.List nameObjects = new ArrayList(); NameJavaScriptGroup nameGroup = populateHotHyperLink(plot); - for(int i = 0; nameGroup != null && i < nameGroup.size(); i++) { + for (int i = 0; nameGroup != null && i < nameGroup.size(); i++) { NameJavaScript javaScript = nameGroup.getNameHyperlink(i); - if(javaScript != null && javaScript.getJavaScript() != null) { + if (javaScript != null && javaScript.getJavaScript() != null) { JavaScript script = javaScript.getJavaScript(); - UIMenuNameableCreator uiMenuNameableCreator= new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); - nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator)); + UIMenuNameableCreator uiMenuNameableCreator = new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass())); + nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj())); } } @@ -160,7 +158,7 @@ public class VanChartHyperLinkPane extends UIListControlPane { return plot.getHotHyperLink(); } - protected HashMap getHyperlinkMap(Plot plot){ + protected HashMap getHyperlinkMap(Plot plot) { return HyperlinkMapFactory.getHyperlinkMap(plot); } @@ -181,10 +179,10 @@ public class VanChartHyperLinkPane extends UIListControlPane { NameJavaScriptGroup nameGroup = new NameJavaScriptGroup(); nameGroup.clear(); - for(int i = 0; i < nameables.length; i++) { - UIMenuNameableCreator menu = (UIMenuNameableCreator)((NameObject)nameables[i]).getObject(); - NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj()); - nameJava.setName(nameables[i].getName()); + for (int i = 0; i < nameables.length; i++) { + JavaScript javaScript = (JavaScript) ((NameObject) nameables[i]).getObject(); + String name = nameables[i].getName(); + NameJavaScript nameJava = new NameJavaScript(name, javaScript); nameGroup.addNameHyperlink(nameJava); } @@ -219,23 +217,16 @@ public class VanChartHyperLinkPane extends UIListControlPane { } protected Class getUseMap(HashMap map, Object key) { - if(map.get(key) != null){ - return (Class)map.get(key); + if (map.get(key) != null) { + return (Class) map.get(key); } //引擎在这边放了个provider,当前表单对象 - for(Object tempKey : map.keySet()){ - if(((Class)tempKey).isAssignableFrom((Class)key)){ - return (Class)map.get(tempKey); + for (Object tempKey : map.keySet()) { + if (((Class) tempKey).isAssignableFrom((Class) key)) { + return (Class) map.get(tempKey); } } return null; } - protected Object getob2Populate (Object ob2Populate) { - if (ob2Populate == null) { - return ob2Populate; - } - return ((UIMenuNameableCreator)ob2Populate).getObj(); - - } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java deleted file mode 100644 index caa06d596..000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.plugin.chart.designer.other; - -import com.fr.base.chart.BasePlot; -import com.fr.chart.chartattr.Plot; -import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.design.gui.ilist.ListModelElement; -import com.fr.general.Inter; -import com.fr.general.NameObject; -import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; -import com.fr.stable.Nameable; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -/** - * Created by mengao on 2017/8/18. - */ -public class ChartConditionNameObjectCreator extends NameObjectCreator { - private BasePlot plot; - private ConditionUIMenuNameableCreator conditionUIMenuNameableCreator; - - public ChartConditionNameObjectCreator(BasePlot plot, String menuName, Class clazz, Class updatePane) { - super(menuName, clazz, updatePane); - this.plot = plot; - } - - /** - * create Nameable - * - * @param helper - * @return - */ - public Nameable createNameable(UnrepeatedNameHelper helper) { - Constructor constructor = null; - try { - constructor = clazzOfInitCase.getConstructor(Plot.class, String.class, Object.class, Class.class); - ConditionUIMenuNameableCreator conditionUIMenuNameableCreator = constructor.newInstance(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), getUpdatePane()); - return new NameObject(helper.createUnrepeatedName(this.menuName()), conditionUIMenuNameableCreator); - - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @param ob - * @return - */ - public Object acceptObject2Populate(Object ob) { - if (ob instanceof NameObject) { - ob = ((NameObject) ob).getObject(); - } - if (clazzOfObject != null && clazzOfObject.isInstance(ob)) { - doSthChanged4Icon(ob); - conditionUIMenuNameableCreator = (ConditionUIMenuNameableCreator) ((ConditionUIMenuNameableCreator) ob).clone(); - return ob; - } - - return null; - } - - /** - * save update bean - * - * @param wrapper - * @param bean - */ - public void saveUpdatedBean(ListModelElement wrapper, Object bean) { - conditionUIMenuNameableCreator.setObj(bean); - ((NameObject) wrapper.wrapper).setObject(conditionUIMenuNameableCreator); - } - - -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java b/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java deleted file mode 100644 index bc8ea431e..000000000 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.plugin.chart.designer.other; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.design.gui.ilist.ListModelElement; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.general.NameObject; -import com.fr.stable.Nameable; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -/** - * Created by mengao on 2017/8/21. - */ -public class ChartHyperlinkNameObjectCreartor extends NameObjectCreator { - private Object object; - private UIMenuNameableCreator uIMenuNameableCreator; - - - public ChartHyperlinkNameObjectCreartor(Object object, String menuName, Class clazz, Class updatePane) { - super(menuName, clazz, updatePane); - this.object = object; - - } - - /** - * create Nameable - * - * @param helper - * @return - */ - public Nameable createNameable(UnrepeatedNameHelper helper) { - Constructor constructor = null; - try { - constructor = clazzOfInitCase.getConstructor(String.class, Object.class, Class.class); - UIMenuNameableCreator uIMenuNameableCreator = constructor.newInstance(menuName, object, getUpdatePane()); - return new NameObject(helper.createUnrepeatedName(this.menuName()), uIMenuNameableCreator); - - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - return null; - } - - /** - * @param ob - * @return - */ - public Object acceptObject2Populate(Object ob) { - if (ob instanceof NameObject) { - ob = ((NameObject) ob).getObject(); - } - if (clazzOfObject != null && clazzOfObject.isInstance(ob)) { - doSthChanged4Icon(ob); - uIMenuNameableCreator = ((UIMenuNameableCreator) ob).clone(); - if (uIMenuNameableCreator.getObj() != null && object.getClass().isInstance(uIMenuNameableCreator.getObj())) { - return ob; - } - } - - return null; - } - - /** - * save update bean - * - * @param wrapper - * @param bean - */ - public void saveUpdatedBean(ListModelElement wrapper, Object bean) { - uIMenuNameableCreator.setObj(bean); - ((NameObject) wrapper.wrapper).setObject(uIMenuNameableCreator); - } - - -} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java index 5f80ae17e..9baf21508 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java @@ -6,14 +6,10 @@ import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.general.Inter; import com.fr.general.NameObject; -import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; import com.fr.stable.Nameable; import java.awt.*; -import java.util.ArrayList; -import java.util.List; /** * Created by Mitisky on 16/5/20. @@ -41,17 +37,11 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte this.setLayout(new BorderLayout()); this.add(conditionPane, BorderLayout.CENTER); - //todo@mango - List list = new ArrayList(); - - list.add(new ConditionUIMenuNameableCreator(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), showPane)); - NameObject[] nameables = new NameObject[collection.getConditionAttrSize()]; for(int i = 0; i < collection.getConditionAttrSize(); i++) { - ConditionUIMenuNameableCreator c =new ConditionUIMenuNameableCreator(plot, collection.getConditionAttr(i).getName(), collection.getConditionAttr(i), showPane); - nameables[i]=(new NameObject(c.getName(),c)); + nameables[i]=(new NameObject(collection.getConditionAttr(i).getName(),collection.getConditionAttr(i))); } conditionPane.populate(nameables); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java index 6ab1078e5..0d357d966 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java @@ -6,14 +6,13 @@ import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.UIListControlPane; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.mainframe.DesignerContext; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.plugin.chart.attr.plot.VanChartPlot; -import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator; import com.fr.stable.Nameable; import java.lang.reflect.Constructor; @@ -36,7 +35,7 @@ public class VanChartListControlPane extends UIListControlPane { @Override public NameableCreator[] createNameableCreators() { - return new ChartConditionNameObjectCreator[]{new ChartConditionNameObjectCreator(this.plot, Inter.getLocText("Condition_Attributes"), ConditionUIMenuNameableCreator.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())}; + return new NameObjectCreator[]{new NameObjectCreator(Inter.getLocText("Condition_Attributes"), ConditionAttr.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())}; } @@ -77,10 +76,6 @@ public class VanChartListControlPane extends UIListControlPane { return Inter.getLocText("Condition_Attributes"); } - protected Object getob2Populate(Object ob2Populate) { - return ((ConditionUIMenuNameableCreator) ob2Populate).getObj(); - - } /** * Update. @@ -91,8 +86,7 @@ public class VanChartListControlPane extends UIListControlPane { cc.clearConditionAttr(); for (int i = 0; i < nameables.length; i++) { - UIMenuNameableCreator uiMenuNameableCreator = (UIMenuNameableCreator) ((NameObject) nameables[i]).getObject(); - ConditionAttr ca = (ConditionAttr) uiMenuNameableCreator.getObj(); + ConditionAttr ca = (ConditionAttr) ((NameObject) nameables[i]).getObject(); ca.setName(nameables[i].getName()); cc.addConditionAttr(ca); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java new file mode 100644 index 000000000..f79ac7f0a --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java @@ -0,0 +1,116 @@ +package com.fr.plugin.chart.designer.style.background; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.UIListControlPane; +import com.fr.design.mainframe.DesignerContext; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.plugin.chart.attr.DefaultAxisHelper; +import com.fr.plugin.chart.attr.axis.VanChartAlertValue; +import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.stable.Nameable; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by mengao on 2017/8/22. + */ +public class AlertLineListControlPane extends UIListControlPane { + + + @Override + public void saveSettings() { + if (isPopulating) { + return; + } + update((VanChartPlot) plot); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + + @Override + public NameableCreator[] createNameableCreators() { + return new ChartNameObjectCreator[]{new ChartNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")}, + Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)}; + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("Plugin-ChartF_AlertLine"); + } + + protected String getAddItemText() { + return Inter.getLocText("Plugin-ChartF_AlertLine"); + } + + public void populate(Plot plot) { + this.plot = plot; + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList); + + ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)}; + + refreshNameableCreator(creators); + + java.util.List nameObjects = new ArrayList(); + + for (VanChartAxis axis : xAxisList) { + List values = axis.getAlertValues(); + for (VanChartAlertValue alertValue : values) { + alertValue.setAxisNamesArray(axisNames); + alertValue.setAxisName(axis.getAxisName()); + nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue)); + } + } + + for (VanChartAxis axis : yAxisList) { + List values = axis.getAlertValues(); + for (VanChartAlertValue alertValue : values) { + alertValue.setAxisNamesArray(axisNames); + alertValue.setAxisName(axis.getAxisName()); + nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue)); + } + } + + populate(nameObjects.toArray(new NameObject[nameObjects.size()])); + doLayout(); + } + + public void update(Plot plot) { + + Nameable[] nameables = this.update(); + + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + + for (VanChartAxis axis : xAxisList) { + List axisAlerts = new ArrayList(); + for (int i = 0; i < nameables.length; i++) { + VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject(); + if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) { + value.setAlertPaneSelectName(nameables[i].getName()); + axisAlerts.add(value); + } + } + axis.setAlertValues(axisAlerts); + } + for (VanChartAxis axis : yAxisList) { + List axisAlerts = new ArrayList(); + for (int i = 0; i < nameables.length; i++) { + VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject(); + if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) { + value.setAlertPaneSelectName(nameables[i].getName()); + axisAlerts.add(value); + } + } + axis.setAlertValues(axisAlerts); + } + } +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java new file mode 100644 index 000000000..5d502e08b --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java @@ -0,0 +1,121 @@ +package com.fr.plugin.chart.designer.style.background; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.UIListControlPane; +import com.fr.design.mainframe.DesignerContext; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; +import com.fr.general.NameObject; +import com.fr.plugin.chart.attr.DefaultAxisHelper; +import com.fr.plugin.chart.attr.axis.VanChartAlertValue; +import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; +import com.fr.stable.Nameable; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by mengao on 2017/8/22. + */ +public class BackgroundListControlPane extends UIListControlPane { + + @Override + public void saveSettings() { + if (isPopulating) { + return; + } + update((VanChartPlot) plot, false); + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + + @Override + public NameableCreator[] createNameableCreators() { + return new BackgroundNameObjectCreator[]{new BackgroundNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")}, + Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartAlertValue.class, VanChartAlertValuePane.class)}; + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"); + } + + @Override + public String getAddItemText() { + return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"); + } + + public void populate(Plot plot) { + this.plot = plot; + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList); + + BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, VanChartCustomIntervalBackgroundPane.class)}; + + refreshNameableCreator(creators); + + java.util.List nameObjects = new ArrayList(); + + + for (VanChartAxis axis : xAxisList) { + List customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray(); + for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) { + background.setAxisNamesArray(axisNames); + background.setAxisName(axis.getAxisName()); + nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background)); + } + + } + for (VanChartAxis axis : yAxisList) { + List customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray(); + for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) { + background.setAxisNamesArray(axisNames); + background.setAxisName(axis.getAxisName()); + nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background)); + } + } + populate(nameObjects.toArray(new NameObject[nameObjects.size()])); + doLayout(); + } + + public void update(Plot plot, boolean isDefaultIntervalBackground) { + + Nameable[] nameables = this.update(); + + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + + for (VanChartAxis axis : xAxisList) { + List axisCustomBackground = new ArrayList(); + if (!isDefaultIntervalBackground) { + for (int i = 0; i < nameables.length; i++) { + VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject(); + if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) { + value.setCustomIntervalBackgroundSelectName(nameables[i].getName()); + axisCustomBackground.add(value); + } + } + } + axis.setCustomIntervalBackgroundArray(axisCustomBackground); + } + for (VanChartAxis axis : yAxisList) { + List axisCustomBackground = new ArrayList(); + if (!isDefaultIntervalBackground) { + for (int i = 0; i < nameables.length; i++) { + VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject(); + if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) { + value.setCustomIntervalBackgroundSelectName(nameables[i].getName()); + axisCustomBackground.add(value); + } + } + } + axis.setCustomIntervalBackgroundArray(axisCustomBackground); + } + } +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java new file mode 100644 index 000000000..bf5c6cf66 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java @@ -0,0 +1,48 @@ +package com.fr.plugin.chart.designer.style.background; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.general.FRLogger; +import com.fr.general.NameObject; +import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; +import com.fr.stable.Nameable; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * Created by mengao on 2017/8/23. + */ +public class BackgroundNameObjectCreator extends ChartNameObjectCreator { + public BackgroundNameObjectCreator(Object object, String menuName, Class clazz, Class updatePane) { + super(object, menuName, clazz, updatePane); + } + + /** + * create Nameable + * + * @param helper + * @return + */ + public Nameable createNameable(UnrepeatedNameHelper helper) { + Constructor constructor = null; + try { + constructor = clazzOfInitCase.getConstructor(); + VanChartCustomIntervalBackground vanChartCustomIntervalBackground = constructor.newInstance(); + vanChartCustomIntervalBackground.setAxisNamesArray((String[]) object); + vanChartCustomIntervalBackground.setAxisName(((String[]) object)[0]); + return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartCustomIntervalBackground); + + } catch (NoSuchMethodException e) { + FRLogger.getLogger().error(e.getMessage(), e); + } catch (IllegalAccessException e) { + FRLogger.getLogger().error(e.getMessage(), e); + } catch (InstantiationException e) { + FRLogger.getLogger().error(e.getMessage(), e); + } catch (InvocationTargetException e) { + FRLogger.getLogger().error(e.getMessage(), e); + } + return null; + } + +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java new file mode 100644 index 000000000..227efeea8 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java @@ -0,0 +1,53 @@ +package com.fr.plugin.chart.designer.style.background; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.UnrepeatedNameHelper; +import com.fr.general.FRLogger; +import com.fr.general.NameObject; +import com.fr.plugin.chart.attr.axis.VanChartAlertValue; +import com.fr.stable.Nameable; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * Created by mengao on 2017/8/21. + */ +public class ChartNameObjectCreator extends NameObjectCreator { + protected Object object; + + + public ChartNameObjectCreator(Object object, String menuName, Class clazz, Class updatePane) { + super(menuName, clazz, updatePane); + this.object = object; + + } + + /** + * create Nameable + * + * @param helper + * @return + */ + public Nameable createNameable(UnrepeatedNameHelper helper) { + Constructor constructor = null; + try { + constructor = clazzOfInitCase.getConstructor(); + VanChartAlertValue vanChartAlertValue = constructor.newInstance(); + vanChartAlertValue.setAxisNamesArray((String[]) object); + vanChartAlertValue.setAxisName(((String[]) object)[0]); + return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue); + + } catch (NoSuchMethodException e) { + FRLogger.getLogger().error(e.getMessage(), e); + } catch (IllegalAccessException e) { + FRLogger.getLogger().error(e.getMessage(), e); + } catch (InstantiationException e) { + FRLogger.getLogger().error(e.getMessage(), e); + } catch (InvocationTargetException e) { + FRLogger.getLogger().error(e.getMessage(), e); + } + return null; + } +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java index 7e1144e75..ec934be6f 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java @@ -46,6 +46,8 @@ public class VanChartAlertValuePane extends BasicBeanPane { private UIComboBox fontName; private ColorSelectBox fontColor; + private VanChartAlertValue chartAlertValue; + public VanChartAlertValuePane(){ initComponents(); } @@ -134,6 +136,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { } public void populateBean(VanChartAlertValue chartAlertValue){ + this.chartAlertValue =chartAlertValue; alertAxis = new UIButtonGroup(chartAlertValue.getAxisNamesArray(), chartAlertValue.getAxisNamesArray()); alertAxis.setSelectedItem(chartAlertValue.getAxisName()); alertAxis.addChangeListener(new ChangeListener() { @@ -165,8 +168,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { fontColor.setSelectObject(chartAlertValue.getAlertFont().getForeground()); } - @Override - public void updateBean(VanChartAlertValue chartAlertValue) { + public VanChartAlertValue updateBean(){ chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString()); chartAlertValue.setAlertValueFormula(new Formula(alertValue.updateBean())); @@ -191,9 +193,6 @@ public class VanChartAlertValuePane extends BasicBeanPane { } else { chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.LEFT : Constants.RIGHT); } - } - - public VanChartAlertValue updateBean(){ - return null; + return chartAlertValue; } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java index f2ca9ce33..d29726d01 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java @@ -2,97 +2,90 @@ package com.fr.plugin.chart.designer.style.background; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.frpane.UICorrelationComboBoxPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.plugin.chart.VanChartAttrHelper; -import com.fr.plugin.chart.attr.DefaultAxisHelper; -import com.fr.plugin.chart.attr.axis.VanChartAlertValue; -import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; -import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.VanChartUIMenuNameableCreator; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; /** * 样式-背景-绘图区背景-坐标轴图表特有(间隔背景、网格线、警戒线) */ -public class VanChartAxisAreaPane extends BasicBeanPane{ +public class VanChartAxisAreaPane extends BasicBeanPane { private static final long serialVersionUID = -1880497996650835504L; protected ColorSelectBox horizontalGridLine; protected ColorSelectBox verticalGridLine; - protected UICorrelationComboBoxPane alertLine; + protected AlertLineListControlPane alertLine; private UIButtonGroup isDefaultIntervalBackground; private JPanel centerPane; private CardLayout cardLayout; protected ColorSelectBox horizontalColorBackground; private ColorSelectBox verticalColorBackground; - protected UICorrelationComboBoxPane customIntervalBackground; + protected BackgroundListControlPane customIntervalBackground; - public VanChartAxisAreaPane(){ + public VanChartAxisAreaPane() { initComponents(); } - protected void initComponents(){ + protected void initComponents() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = { f }; - double[] rowSize = {p,p,p}; + double[] columnSize = {f}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ - new Component[]{createGridLinePane(new double[]{p,p,p}, new double[]{p,f})}, + new Component[]{createGridLinePane(new double[]{p, p, p}, new double[]{p, f})}, new Component[]{createAlertLinePane()}, - new Component[]{createIntervalPane(new double[]{p,p,p,p}, new double[]{p,f})}, + new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{p, f})}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); + this.add(panel, BorderLayout.CENTER); } - private JPanel createGridLinePane(double[] row, double[] col){ + private JPanel createGridLinePane(double[] row, double[] col) { horizontalGridLine = new ColorSelectBox(100); verticalGridLine = new ColorSelectBox(100); Component[][] components = getGridLinePaneComponents(); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"), panel); } protected Component[][] getGridLinePaneComponents() { return new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalGridLine}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalGridLine}, + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalGridLine}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalGridLine}, }; } - protected JPanel createAlertLinePane(){ - alertLine = new UICorrelationComboBoxPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); + protected JPanel createAlertLinePane() { + alertLine = new AlertLineListControlPane(); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"), alertLine); + alertLine.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); + return panel; } - protected JPanel createIntervalPane(double[] row, double[] col){ + protected JPanel createIntervalPane(double[] row, double[] col) { isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_IntervalBackground"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")}); horizontalColorBackground = new ColorSelectBox(100); verticalColorBackground = new ColorSelectBox(100); Component[][] components = getIntervalPaneComponents(); JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col); - customIntervalBackground = new UICorrelationComboBoxPane(); + customIntervalBackground = new BackgroundListControlPane(); cardLayout = new CardLayout(); centerPane = new JPanel(cardLayout); @@ -107,43 +100,43 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); intervalPane.add(centerPane, BorderLayout.CENTER); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"), intervalPane); + intervalPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); + return panel; } protected Component[][] getIntervalPaneComponents() { return new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalColorBackground}, - new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalColorBackground}, + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalColorBackground}, + new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalColorBackground}, }; } - private void checkCardPane(){ - if(isDefaultIntervalBackground.getSelectedIndex() == 0){ + private void checkCardPane() { + if (isDefaultIntervalBackground.getSelectedIndex() == 0) { cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground")); } else { cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")); } } - protected String title4PopupWindow(){ + protected String title4PopupWindow() { return ""; } - public void populateBean(Plot plot){ - VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; - List xAxisList = rectanglePlot.getXAxisList(); - List yAxisList = rectanglePlot.getYAxisList(); - String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList); + public void populateBean(Plot plot) { + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + populateGridLine(rectanglePlot); - populateAlert(xAxisList, yAxisList, axisNames); + alertLine.populate(plot); isDefaultIntervalBackground.setSelectedIndex(rectanglePlot.isDefaultIntervalBackground() ? 0 : 1); horizontalColorBackground.setSelectObject(rectanglePlot.getDefaultYAxis().getDefaultIntervalBackgroundColor()); verticalColorBackground.setSelectObject(rectanglePlot.getDefaultXAxis().getDefaultIntervalBackgroundColor()); - populateCustomIntervalBackground(xAxisList, yAxisList, axisNames); + customIntervalBackground.populate(plot); checkCardPane(); } @@ -152,107 +145,23 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor()); } - protected Class getAlertPaneClass() { - return VanChartAlertValuePane.class; - } - - protected void setAlertDemoAxisName(VanChartAlertValue demo, String[] axisNames) { - demo.setAxisName(axisNames[0]); - } - - private void populateAlert(List xAxisList, List yAxisList, String[] axisNames){ - List menuList = new ArrayList(); - VanChartAlertValue demo = new VanChartAlertValue(); - demo.setAxisNamesArray(axisNames); - setAlertDemoAxisName(demo, axisNames); - menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_AlertLine"), demo, getAlertPaneClass())); - - alertLine.refreshMenuAndAddMenuAction(menuList); - - List list = new ArrayList(); - - for(VanChartAxis axis: xAxisList){ - List values = axis.getAlertValues(); - for(VanChartAlertValue alertValue : values) { - alertValue.setAxisNamesArray(axisNames); - alertValue.setAxisName(axis.getAxisName()); - list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass())); - } - } - - for(VanChartAxis axis: yAxisList){ - List values = axis.getAlertValues(); - for(VanChartAlertValue alertValue : values) { - alertValue.setAxisNamesArray(axisNames); - alertValue.setAxisName(axis.getAxisName()); - list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass())); - } - } - - alertLine.populateBean(list); - alertLine.doLayout(); - } - - protected Class getIntervalPaneClass() { - return VanChartCustomIntervalBackgroundPane.class; - } - - protected void setCustomIntervalBackgroundDemoAxisName(VanChartCustomIntervalBackground demo, String[] axisNames) { - demo.setAxisName(axisNames[0]); - } - - private void populateCustomIntervalBackground(List xAxisList, List yAxisList, String[] axisNames){ - List menuList = new ArrayList(); - VanChartCustomIntervalBackground demo = new VanChartCustomIntervalBackground(); - demo.setAxisNamesArray(axisNames); - setCustomIntervalBackgroundDemoAxisName(demo, axisNames); - menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), demo, getIntervalPaneClass())); - - customIntervalBackground.refreshMenuAndAddMenuAction(menuList); - - List list = new ArrayList(); - - for(VanChartAxis axis: xAxisList){ - List customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray(); - for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){ - background.setAxisNamesArray(axisNames); - background.setAxisName(axis.getAxisName()); - list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass())); - } - - } - - for(VanChartAxis axis: yAxisList){ - List customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray(); - for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){ - background.setAxisNamesArray(axisNames); - background.setAxisName(axis.getAxisName()); - list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass())); - } - } - - customIntervalBackground.populateBean(list); - customIntervalBackground.doLayout(); - } - public void updateBean(Plot plot){ - VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot; - List xAxisList = rectanglePlot.getXAxisList(); - List yAxisList = rectanglePlot.getYAxisList(); + public void updateBean(Plot plot) { + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; updateGirdLine(rectanglePlot); - updateAlert(xAxisList, yAxisList); + alertLine.update(plot); rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0); - if(rectanglePlot.isDefaultIntervalBackground()){ + if (rectanglePlot.isDefaultIntervalBackground()) { rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(horizontalColorBackground.getSelectObject()); rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(verticalColorBackground.getSelectObject()); } else { rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null); rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null); } - updateCustomIntervalBackground(xAxisList, yAxisList); + customIntervalBackground.update(plot, isDefaultIntervalBackground.getSelectedIndex() == 0); } protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) { @@ -260,36 +169,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject()); } - private void updateAlert(List xAxisList, List yAxisList){ - - List alertList = alertLine.updateBean(); - - for(VanChartAxis axis : xAxisList){ - List axisAlerts = new ArrayList(); - for(UIMenuNameableCreator creator : alertList) { - VanChartAlertValue value = (VanChartAlertValue)creator.getObj(); - if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){ - value.setAlertPaneSelectName(creator.getName()); - axisAlerts.add(value); - } - } - axis.setAlertValues(axisAlerts); - } - for(VanChartAxis axis : yAxisList){ - List axisAlerts = new ArrayList(); - for(UIMenuNameableCreator creator : alertList) { - VanChartAlertValue value = (VanChartAlertValue)creator.getObj(); - if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName()) || yAxisEquals(value.getAxisName(), axis.getAxisName())){ - value.setAlertPaneSelectName(creator.getName()); - axisAlerts.add(value); - } - } - axis.setAlertValues(axisAlerts); - } - } - /** * Y軸和雷達圖的極軸也是相等的 + * * @param axisName * @param valueAxisName * @return @@ -299,40 +181,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName); } - private void updateCustomIntervalBackground(List xAxisList, List yAxisList){ - - List customList = customIntervalBackground.updateBean(); - - for(VanChartAxis axis : xAxisList){ - List axisCustomBackground = new ArrayList(); - if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组 - for(UIMenuNameableCreator creator : customList) { - VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj(); - if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){ - value.setCustomIntervalBackgroundSelectName(creator.getName()); - axisCustomBackground.add(value); - } - } - } - axis.setCustomIntervalBackgroundArray(axisCustomBackground); - } - for(VanChartAxis axis : yAxisList){ - List axisCustomBackground = new ArrayList(); - if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组 - for(UIMenuNameableCreator creator : customList) { - VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj(); - if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){ - value.setCustomIntervalBackgroundSelectName(creator.getName()); - axisCustomBackground.add(value); - } - } - } - axis.setCustomIntervalBackgroundArray(axisCustomBackground); - } - } - - - public Plot updateBean(){ + public Plot updateBean() { return null; } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java index a2db0a3c2..bf6bb4695 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java @@ -32,8 +32,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane { 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 +72,9 @@ public class RootDesignDefinePane extends AbstractDataModify { 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 +85,14 @@ public class RootDesignDefinePane extends AbstractDataModify { , 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 +108,10 @@ public class RootDesignDefinePane extends AbstractDataModify { @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 +120,10 @@ public class RootDesignDefinePane extends AbstractDataModify { @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()); wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); return wParameterLayout; diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java index 588828255..ede1d7d29 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java +++ b/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 extends AbstractDataModify { - 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 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 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 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; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java index 18f0e0ced..35f765835 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java +++ b/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 { - 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 { 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)); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java index 08f73236a..829736a65 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java +++ b/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 { private UICheckBox removeRepeatCheckBox; - private UIPropertyTextField waterMarkField; + private UITextField waterMarkField; public ComboBoxDefinePane(XCreator xCreator) { super(xCreator); @@ -26,7 +26,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane { } public Component[] createWaterMarkPane() { - waterMarkField = new UIPropertyTextField(); + waterMarkField = new UITextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java index 7a3ed0f22..8bff98936 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java +++ b/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 { 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 } public Component[] createWaterMarkPane() { - waterMarkDictPane = new UIPropertyTextField(); + waterMarkDictPane = new UITextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java index ec735a9ad..90fb8de97 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java +++ b/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(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 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); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index ffc45d266..cc7ecc664 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/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 extends AbstractDataModify { 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 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 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 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() { diff --git a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java index cbda1a2e3..fb7399ef8 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java +++ b/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 { - private UIPropertyTextField srcTextField; + private UITextField srcTextField; private ReportletParameterViewPane parameterViewPane; private UICheckBox horizontalCheck; private UICheckBox verticalCheck; @@ -44,7 +44,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { 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); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java index cc50a0127..9ca625a15 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java +++ b/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 public NumberEditorDefinePane(XCreator xCreator){ super(xCreator); } + private FormWidgetValuePane formWidgetValuePane; /** * @@ -37,23 +38,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane 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 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 } 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 }; - 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 }; - 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 } }; - changeListener1 = new ChangeListener() { + maxValueChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -176,7 +178,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } }; - changeListener2 = new ChangeListener() { + minValueChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -191,42 +193,42 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane 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 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 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 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 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 } } + 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; + } + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java index 46f62dac1..5378c00ed 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java +++ b/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 { protected RegPane regPane; - private UIPropertyTextField waterMarkDictPane; + private UITextField waterMarkDictPane; FormWidgetValuePane formWidgetValuePane; public TextFieldEditorDefinePane(XCreator xCreator) { @@ -47,7 +47,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane } }; 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 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)); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java index 68cac1037..fd26c6934 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java +++ b/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; } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java index 6edfe78c7..100fb2800 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java +++ b/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 { - protected TreeSettingPane treeSettingPane; +public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane { 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 { 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 { 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 { 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; } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java b/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java index 75d6d7d17..c0ec063af 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java +++ b/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); } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java index e0df39eb1..2cfd8ce3c 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java @@ -38,14 +38,15 @@ public abstract class ButtonGroupDefinePane 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);