Browse Source

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

master
MoMeak 7 years ago
parent
commit
28f20cbcd6
  1. 2
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  2. 29
      designer/src/com/fr/design/mainframe/alphafine/preview/DocumentPreviewPane.java
  3. 5
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  4. 2
      designer/src/com/fr/design/widget/WidgetPane.java
  5. 10
      designer/src/com/fr/design/widget/ui/ButtonDefinePane.java
  6. 4
      designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  7. 1
      designer/src/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java
  8. 28
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  9. 2
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  10. 36
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  11. 257
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  12. 4
      designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java
  13. 5
      designer/src/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java
  14. 28
      designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java
  15. 22
      designer_base/src/com/fr/design/designer/IntervalConstants.java
  16. 3
      designer_base/src/com/fr/design/gui/columnrow/ColumnRowPane.java
  17. 9
      designer_base/src/com/fr/design/gui/frpane/RegFieldPane.java
  18. 25
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  19. 2
      designer_base/src/com/fr/design/gui/itextarea/UITextArea.java
  20. 2
      designer_base/src/com/fr/design/gui/itextarea/UITextAreaUI.java
  21. 0
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java
  22. 11
      designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  23. 29
      designer_base/src/com/fr/design/widget/component/BackgroundCompPane.java
  24. 55
      designer_base/src/com/fr/design/widget/component/CheckBoxDictPane.java
  25. 18
      designer_base/src/com/fr/design/widget/component/DateValuePane.java
  26. 303
      designer_base/src/com/fr/design/widget/component/NumberEditorValidatePane.java
  27. 9
      designer_base/src/com/fr/start/StartServer.java
  28. 28
      designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java
  29. 2
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java
  30. 2
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java
  31. 2
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  32. 10
      designer_chart/src/com/fr/design/mainframe/chart/gui/UIEditLabel.java
  33. 31
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  34. 16
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java
  35. 5
      designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java
  36. 111
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  37. 5
      designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomSeriesPane.java
  38. 1
      designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java
  39. 133
      designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java
  40. 2
      designer_chart/src/com/fr/plugin/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java
  41. 22
      designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPane.java
  42. 7
      designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPaneWithoutTooltip.java
  43. 337
      designer_chart/src/com/fr/plugin/chart/designer/other/HyperlinkMapFactory.java
  44. 2
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java
  45. 20
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionListControlPane.java
  46. 17
      designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java
  47. 22
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java
  48. 6
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  49. 1
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java
  50. 20
      designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  51. 2
      designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java
  52. 92
      designer_form/src/com/fr/design/designer/creator/CRPropertyDescriptorPane.java
  53. 71
      designer_form/src/com/fr/design/designer/creator/PropertyGroupPane.java
  54. 14
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  55. 32
      designer_form/src/com/fr/design/designer/creator/XDateEditor.java
  56. 18
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  57. 9
      designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java
  58. 18
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  59. 28
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  60. 13
      designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java
  61. 6
      designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  62. 93
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDictPane.java
  63. 17
      designer_form/src/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  64. 14
      designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  65. 18
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  66. 32
      designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  67. 20
      designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java
  68. 4
      designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java
  69. 252
      designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  70. 3
      designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java
  71. 6
      designer_form/src/com/fr/design/widget/ui/designer/component/TabFitLayoutBackgroundPane.java
  72. 35
      designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java
  73. 46
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  74. 23
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java
  75. 27
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  76. 9
      designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java
  77. 21
      designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java

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

@ -684,7 +684,7 @@ public class AlphaFineDialog extends UIDialog {
} else { } else {
try { try {
Thread.sleep(10); Thread.sleep(10);
doSearch(searchTextField.getText()); doSearch(searchTextField.getText().toLowerCase());
} catch (InterruptedException e1) { } catch (InterruptedException e1) {
FRLogger.getLogger().error(e1.getMessage()); FRLogger.getLogger().error(e1.getMessage());
} }

29
designer/src/com/fr/design/mainframe/alphafine/preview/DocumentPreviewPane.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe.alphafine.preview;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -16,30 +15,18 @@ public class DocumentPreviewPane extends JPanel {
public DocumentPreviewPane(String title, String summary) { public DocumentPreviewPane(String title, String summary) {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBackground(Color.WHITE); this.setBackground(Color.WHITE);
this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT));
UITextArea titleArea = new UITextArea(title); UITextArea titleArea = new UITextArea(title);
UITextArea contentArea = new UITextArea(summary); titleArea.setBorder(null);
titleArea.setOpaque(false); titleArea.setEditable(false);
contentArea.setOpaque(false);
titleArea.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
titleArea.setForeground(AlphaFineConstants.BLUE); titleArea.setForeground(AlphaFineConstants.BLUE);
contentArea.setForeground(AlphaFineConstants.BLACK);
titleArea.setPreferredSize(new Dimension(360, 30));
titleArea.setFont(AlphaFineConstants.LARGE_FONT); titleArea.setFont(AlphaFineConstants.LARGE_FONT);
contentArea.setFont(AlphaFineConstants.MEDIUM_FONT);
add(titleArea, BorderLayout.NORTH); add(titleArea, BorderLayout.NORTH);
UITextArea contentArea = new UITextArea(summary);
contentArea.setEditable(false);
contentArea.setBorder(null);
contentArea.setForeground(AlphaFineConstants.BLACK);
contentArea.setFont(AlphaFineConstants.MEDIUM_FONT);
add(contentArea, BorderLayout.CENTER); add(contentArea, BorderLayout.CENTER);
} }
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(null);
content.add(new DocumentPreviewPane("test", "ababababaabbababab"));
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);
jf.setVisible(true);
}
} }

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

@ -1,6 +1,7 @@
package com.fr.design.widget; package com.fr.design.widget;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
@ -73,7 +74,7 @@ public class CellWidgetCardPane extends BasicPane {
tabbedPane = new CardLayout(); tabbedPane = new CardLayout();
center = new JPanel(tabbedPane); center = new JPanel(tabbedPane);
jPanel.add(center, BorderLayout.CENTER); jPanel.add(center, BorderLayout.CENTER);
jPanel.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L6, 0, 0));
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
initPaneList(); initPaneList();
@ -91,7 +92,7 @@ public class CellWidgetCardPane extends BasicPane {
} }
}; };
tabsHeaderIconPane.setNeedLeftRightOutLine(false); tabsHeaderIconPane.setNeedLeftRightOutLine(false);
jPanel.add(tabsHeaderIconPane, BorderLayout.NORTH); this.add(tabsHeaderIconPane, BorderLayout.NORTH);
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();

2
designer/src/com/fr/design/widget/WidgetPane.java

@ -92,8 +92,10 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
AttributeChangeListener listener = new AttributeChangeListener() { AttributeChangeListener listener = new AttributeChangeListener() {
@Override @Override
public void attributeChange() { public void attributeChange() {
if(shouldFireSelectedEvent){
CellWidgetPropertyPane.getInstance().update(); CellWidgetPropertyPane.getInstance().update();
} }
}
}; };
/** /**

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

@ -28,6 +28,12 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
} }
private void resetDetailPane(Button btn, Class cls) { private void resetDetailPane(Button btn, Class cls) {
initDetailPane(btn, cls);
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
}
public void initDetailPane(Button btn, Class cls){
if (detailPane != null) { if (detailPane != null) {
remove(detailPane); remove(detailPane);
} }
@ -40,13 +46,11 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
} }
}); });
this.updateUI(); this.updateUI();
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
} }
@Override @Override
public void populateBean(Button btn) { public void populateBean(Button btn) {
resetDetailPane(btn, btn instanceof FreeButton && !((FreeButton) btn).isCustomStyle() ? Button.class : null); initDetailPane(btn, btn instanceof FreeButton && !((FreeButton) btn).isCustomStyle() ? Button.class : null);
} }
@Override @Override

4
designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -9,6 +9,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -36,7 +37,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
checkbox = new UICheckBox(Inter.getLocText("FR-Designer_Advanced")); checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
checkBoxDictPane = new CheckBoxDictPane(); checkBoxDictPane = new CheckBoxDictPane();
@ -52,7 +53,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1,1},{1,1}}; int[][] rowCount = {{1, 1},{1, 1},{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
// panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
advancePane.add(panel); advancePane.add(panel);
return advancePane; return advancePane;

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

@ -8,6 +8,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;

28
designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -3,13 +3,12 @@ package com.fr.design.widget.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.widget.component.DateValuePane; import com.fr.design.widget.component.DateValuePane;
import com.fr.form.ui.DateEditor; import com.fr.form.ui.DateEditor;
import com.fr.general.DateUtils; import com.fr.general.DateUtils;
@ -19,6 +18,8 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.UtilEvalError; import com.fr.stable.UtilEvalError;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -26,14 +27,14 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> { public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIHeadGroup returnTypeComboBox; private UIButtonGroup returnTypeComboBox;
private DateValuePane startDv; private DateValuePane startDv;
private DateValuePane endDv; private DateValuePane endDv;
private UIComboBox currentFormatComboBox; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel; private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup; private UIButtonGroup fomatHeadGroup;
@ -47,12 +48,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected JPanel setSecondContentPane() { protected JPanel setSecondContentPane() {
returnTypeComboBox = new UIHeadGroup(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}){ returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")});
protected void tabChanged(int newSelectedIndex) {
//todo
}
};
JPanel formatHead = createFormatHead(); JPanel formatHead = createFormatHead();
startDv = new DateValuePane(); startDv = new DateValuePane();
@ -118,8 +114,11 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
customPane.add(dateFormatPane, Inter.getLocText("StyleFormat-Date")); customPane.add(dateFormatPane, Inter.getLocText("StyleFormat-Date"));
customPane.add(timeFormatPane, Inter.getLocText("StyleFormat-Time")); customPane.add(timeFormatPane, Inter.getLocText("StyleFormat-Time"));
final String[] tabTitles = new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")}; final String[] tabTitles = new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")};
fomatHeadGroup = new UIHeadGroup(new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")}){ fomatHeadGroup = new UIButtonGroup(new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")});
protected void tabChanged(int newSelectedIndex) { fomatHeadGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int newSelectedIndex = fomatHeadGroup.getSelectedIndex();
cardLayout.show(customPane, tabTitles[newSelectedIndex]); cardLayout.show(customPane, tabTitles[newSelectedIndex]);
if(newSelectedIndex == 0){ if(newSelectedIndex == 0){
currentFormatComboBox = dateFormatComboBox; currentFormatComboBox = dateFormatComboBox;
@ -130,12 +129,14 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
refreshPreviewLabel(); refreshPreviewLabel();
} }
}; });
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH); fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER); fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane; return fomatHeadPane;
} }
private void refreshPreviewLabel() { private void refreshPreviewLabel() {
String text = (String) currentFormatComboBox.getSelectedItem(); String text = (String) currentFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) { if (text != null && text.length() > 0) {
@ -175,6 +176,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected void populateSubDirectWriteEditorBean(DateEditor e) { protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText(); String formatText = e.getFormatText();
fomatHeadGroup.setSelectedIndex(getDateType(e)); fomatHeadGroup.setSelectedIndex(getDateType(e));
fomatHeadGroup.populateBean();
currentFormatComboBox.setSelectedItem(formatText); currentFormatComboBox.setSelectedItem(formatText);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1); returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1);

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

@ -15,7 +15,7 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
protected WaterMarkDictPane waterMarkDictPane; protected WaterMarkDictPane waterMarkDictPane;
public DirectWriteEditorDefinePane() { public DirectWriteEditorDefinePane() {
this.initComponents(); super();
} }

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

@ -1,7 +1,7 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.base.GraphHelper;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -20,8 +20,6 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Null") + 30;
private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30;
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UITextField errorMsgTextField; protected UITextField errorMsgTextField;
@ -95,39 +93,29 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() { protected void addValidatePane() {
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final UILabel uiLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Error", "FR-Designer_Tooltips"})); final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip"));
initErrorMsgPane(); initErrorMsgPane();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
borderPane.add(errorTipPane, BorderLayout.CENTER);
allowBlankCheckBox.addItemListener(new ItemListener() { allowBlankCheckBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
boolean isSelected = allowBlankCheckBox.isSelected(); boolean isSelected = allowBlankCheckBox.isSelected();
uiLabel.setVisible(!isSelected); errorTipPane.setVisible(!isSelected);
errorMsgTextField.setVisible(!isSelected);
if (isSelected) {
uiLabel.setPreferredSize(new Dimension(0, 0));
errorMsgTextField.setPreferredSize(new Dimension(0, 0));
} else {
uiLabel.setPreferredSize(new Dimension(66, 20));
errorMsgTextField.setPreferredSize(new Dimension(150, 20));
}
} }
}); });
errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox, null}, new Component[]{allowBlankCheckBox},
new Component[]{uiLabel, errorMsgTextField}, new Component[]{borderPane},
}; };
double[] rowSize = {p, p}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,TableLayoutHelper.FILL_LASTCOLUMN, 5, 5);
double[] columnSize = {p, f}; panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0));
int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
validatePane.add(panel, BorderLayout.NORTH); validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane(); JPanel contentPane = this.setValidatePane();

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

@ -1,60 +1,20 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JFormattedTextField;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
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.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.widget.component.NumberEditorValidatePane;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter;
public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> { public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> {
/** /**
* FieldEditorDefinePane * FieldEditorDefinePane
*/ */
private static final long serialVersionUID = 8011242951911686805L; private static final long serialVersionUID = 8011242951911686805L;
private UICheckBox allowDecimalsCheckBox;
private UICheckBox allowNegativeCheckBox;
private UICheckBox setMaxValueCheckBox;
private UICheckBox setMinValueCheckBox;
private UIBasicSpinner maxValueSpinner;
private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel;
private UISpinner decimalLength;
private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane;
private ActionListener allowDecimalsListener;
private ActionListener allowNegativeListener ;
public ActionListener setMaxListener;
private ActionListener setMinListener;
private ChangeListener maxValueChangeListener; private WaterMarkDictPane waterMarkDictPane;
private NumberEditorValidatePane numberEditorValidatePane;
private ChangeListener minValueChangeListener;
public NumberEditorDefinePane() { public NumberEditorDefinePane() {
} }
@ -75,226 +35,23 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
public JPanel setValidatePane() { public JPanel setValidatePane() {
initListeners(); numberEditorValidatePane = new NumberEditorValidatePane();
return numberEditorValidatePane;
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals"));
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
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(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));
setNotAllowsInvalid(this.maxValueSpinner);
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));
setNotAllowsInvalid(this.minValueSpinner);
this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener);
UILabel numberLabel = new UILabel(Inter.getLocText("FR-Designer_Decimal_Places"));
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[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null},
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(10, 0, 0, 0));
return pane;
} }
@Override @Override
protected void populateSubFieldEditorBean(NumberEditor e) { protected void populateSubFieldEditorBean(NumberEditor e) {
allowDecimalsCheckBox.setSelected(e.isAllowDecimals()); this.numberEditorValidatePane.populate(e);
if (e.isAllowDecimals()) {
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.setEnabled(false);
} else {
setMaxValueCheckBox.setSelected(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.setEnabled(false);
} else {
minValueSpinner.setEnabled(true);
setMinValueCheckBox.setSelected(true);
minValueSpinner.setValue(new Double(e.getMinValue()));
}
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@Override @Override
protected NumberEditor updateSubFieldEditorBean() { protected NumberEditor updateSubFieldEditorBean() {
NumberEditor ob = new NumberEditor(); NumberEditor ob = new NumberEditor();
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); this.numberEditorValidatePane.update(ob);
if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength((int)this.decimalLength.getValue());
}
ob.setAllowNegative(allowNegativeCheckBox.isSelected());
if (setMaxValueCheckBox.isSelected()) {
ob.setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue()));
} else {
ob.setMaxValue(Double.MAX_VALUE);
}
if (setMinValueCheckBox.isSelected()) {
ob.setMinValue(Double.parseDouble("" + minValueSpinner.getValue()));
} else {
ob.setMinValue(-Double.MAX_VALUE);
}
this.waterMarkDictPane.update(ob); this.waterMarkDictPane.update(ob);
return ob; return ob;
} }
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) {
JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) {
JFormattedTextField ftf = ((UIBasicSpinner.DefaultEditor) editor).getTextField();
ftf.setColumns(10);
JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter();
DefaultFormatter df = (DefaultFormatter) formatter;
df.setAllowsInvalid(false);
}
}
} }

4
designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java

@ -38,11 +38,11 @@ public class DefineAppendColumnRowPane extends BasicPane {
crEditor = new ColumnRowEditor(); crEditor = new ColumnRowEditor();
jNumberEditor = new UISpinner(0, 100 , 1, 0); jNumberEditor = new UISpinner(0, 100 , 1, 0);
rowCountLable = new UILabel(Inter.getLocText("Edit-Row_Count") + ":"); rowCountLable = new UILabel(Inter.getLocText("Edit-Row_Count"));
JPanel lpane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel lpane = FRGUIPaneFactory.createBorderLayout_S_Pane();
lpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); lpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
lpane.add(new UILabel(Inter.getLocText("Append_Delete_Row_Message"))); lpane.add(new UILabel(Inter.getLocText("Append_Delete_Row_Message")));
Component[][] components = { { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor }, { rowCountLable, jNumberEditor } ,{lpane,null}}; Component[][] components = { { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"})), crEditor }, { rowCountLable, jNumberEditor } ,{lpane,null}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));

5
designer/src/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java

@ -34,9 +34,10 @@ public class DefineDeleteColumnRowPane extends BasicPane {
double rowSize[] = { p, p}; double rowSize[] = { p, p};
double columnSize[] = { p, f}; double columnSize[] = { p, f};
crEditor = new ColumnRowEditor(); crEditor = new ColumnRowEditor();
UILabel messageLabel = new UILabel(Inter.getLocText("Append_Delete_Row_Message"));
Component[][] components = { Component[][] components = {
{ new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor }, { new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"})), crEditor },
{new UILabel(Inter.getLocText("Append_Delete_Row_Message")),null}}; { messageLabel, null}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());

28
designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui.btn; package com.fr.design.widget.ui.btn;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -27,34 +28,21 @@ public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> exte
} }
protected void initComponents() { protected void initComponents() {
setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = {p}; double rowSize[] = {p};
double columnSize[] = {p, f}; double columnSize[] = {p, f};
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Type")), createButtonTypeComboBox()},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 8); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_L2, 8);
UIExpandablePane advancedPane = new UIExpandablePane("高级", 280, 20, panel); JPanel borderPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
borderPanel.add(panel, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
UIExpandablePane advancedPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, borderPanel);
this.add(advancedPane); this.add(advancedPane);
// setLayout(FRGUIPaneFactory.createBorderLayout());
// double p = TableLayout.PREFERRED;
// double rowSize[] = {p};
// double columnSize[] = {p, 184};
// Component[][] n_components = {
// {new UILabel(Inter.getLocText(new String[]{"Form-Button", "Type"}) + ":"), createButtonTypeComboBox()}
// };
// JPanel northPane = TableLayoutHelper.createTableLayoutPane(n_components, rowSize, columnSize);
// JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
//// advancedPane.add(northPane);
// add(northPane);
} }
@Override @Override

22
designer_base/src/com/fr/design/designer/IntervalConstants.java

@ -0,0 +1,22 @@
package com.fr.design.designer;
/**
* Created by kerry on 2017/9/8.
*/
public class IntervalConstants {
public static final int INTERVAL_L1 = 10;
public static final int INTERVAL_L2 = 15;
public static final int INTERVAL_L3 = 155;
public static final int INTERVAL_L4 = 10;
public static final int INTERVAL_L5 = 12;
public static final int INTERVAL_L6 = 5;
public static final int INTERVAL_L7 = 8;
}

3
designer_base/src/com/fr/design/gui/columnrow/ColumnRowPane.java

@ -17,6 +17,7 @@ import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
import javax.swing.text.DocumentFilter; import javax.swing.text.DocumentFilter;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -96,7 +97,7 @@ public class ColumnRowPane extends JPanel implements UIObserver {
* 初始化元素 * 初始化元素
*/ */
public void initComponents() { public void initComponents() {
this.setLayout(new GridLayout(0, 2, 0, 0)); this.setLayout(new GridLayout(0, 2, IntervalConstants.INTERVAL_L6, 0));
initColSpinner(); initColSpinner();
this.add(columnSpinner, BorderLayout.WEST); this.add(columnSpinner, BorderLayout.WEST);
initRowSpinner(); initRowSpinner();

9
designer_base/src/com/fr/design/gui/frpane/RegFieldPane.java

@ -1,5 +1,7 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -31,6 +33,7 @@ public class RegFieldPane extends RegPane {
} }
public void initComponents() { public void initComponents() {
this.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0));
regErrorMsgPane = new RegErrorMsgPane(); regErrorMsgPane = new RegErrorMsgPane();
final RegChangeListener regChangeListener = new RegChangeListener() { final RegChangeListener regChangeListener = new RegChangeListener() {
@ -68,9 +71,11 @@ public class RegFieldPane extends RegPane {
public RegErrorMsgPane() { public RegErrorMsgPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
initRegErrorMsgField(); initRegErrorMsgField();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); UILabel tipLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip"));
tipLabel.setPreferredSize(new Dimension(60, 20));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tipLabel, regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM);
this.add(panel); this.add(panel);
} }

25
designer_base/src/com/fr/design/gui/frpane/RegPane.java

@ -1,6 +1,7 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
@ -70,7 +71,7 @@ public class RegPane extends BasicPane {
private void initComponents(){ private void initComponents(){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
regComboBox = new UIComboBox(regType); regComboBox = new UIComboBox(regType);
regComboBox.setRenderer(listCellRender); regComboBox.setRenderer(listCellRender);
@ -331,11 +332,13 @@ public class RegPane extends BasicPane {
private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")}; private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")};
DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType); DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType);
public RegPhonePane() { public RegPhonePane() {
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel); dataTypeComboBox = new UIComboBox(DefaultComboBoxModel);
JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent()); JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent());
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Data_Type")), dataTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); UILabel dataTypeLable = new UILabel(Inter.getLocText("FR-Designer_Data_Type"));
dataTypeLable.setPreferredSize(new Dimension(60, 20));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{dataTypeLable, dataTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, 0);
this.add(panel); this.add(panel);
editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN)); editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN));
dataTypeComboBox.addItemListener(new ItemListener() { dataTypeComboBox.addItemListener(new ItemListener() {
@ -393,20 +396,24 @@ public class RegPane extends BasicPane {
public RegLengthPane(){ public RegLengthPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
this.setPreferredSize(new Dimension(210, 56)); this.setPreferredSize(new Dimension(210, 56));
minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
UILabel minLabel = new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length"));
UILabel maxLabel = new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length"));
minLabel.setPreferredSize(new Dimension(60, 20));
maxLabel.setPreferredSize(new Dimension(60, 20));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"), minLenSpinner }, new Component[]{minLabel, minLenSpinner },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"), maxLenSpinner}, new Component[]{maxLabel, maxLenSpinner},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p,f}; double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1}}; int[][] rowCount = {{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, LayoutConstants.VGAP_MEDIUM);
this.add(panel); this.add(panel);
@ -446,9 +453,9 @@ public class RegPane extends BasicPane {
public CustomRegRexPane(){ public CustomRegRexPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
regTextField = new UITextField(); regTextField = new UITextField();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions")), regTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions")), regTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM);
this.add(panel); this.add(panel);
} }

2
designer_base/src/com/fr/design/gui/itextarea/UITextArea.java

@ -100,8 +100,10 @@ public class UITextArea extends JTextArea implements UIObserver {
@Override @Override
protected void paintBorder(Graphics g) { protected void paintBorder(Graphics g) {
if (getBorder() != null) {
getUI().paintBorder((Graphics2D) g, getWidth(), getHeight(), true, Constants.NULL); getUI().paintBorder((Graphics2D) g, getWidth(), getHeight(), true, Constants.NULL);
} }
}
@Override @Override
/** /**

2
designer_base/src/com/fr/design/gui/itextarea/UITextAreaUI.java

@ -32,7 +32,7 @@ public class UITextAreaUI extends BasicTextAreaUI {
} }
public void paintBorder(Graphics2D g2d, int width, int height, boolean isRound, int rectDirection) { public void paintBorder(Graphics2D g2d, int width, int height, boolean isRound, int rectDirection) {
if (isRollOver && textField.isEnabled()) { if (isRollOver && textField.isEnabled() && ((UITextArea)textField).isEditable()) {
g2d.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED); g2d.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED);
g2d.drawRect(0, 0, width - 1, height - 1); g2d.drawRect(0, 0, width - 1, height - 1);
} else { } else {

0
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java → designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java

11
designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java

@ -4,6 +4,7 @@ import java.awt.*;
import javax.swing.*; import javax.swing.*;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -42,13 +43,13 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
iconPane = new AccessibleIconEditor(); iconPane = new AccessibleIconEditor();
labelPane.add(iconPane); labelPane.add(iconPane);
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Type")), createButtonTypeComboBox()},
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField = new UITextField()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Name")), buttonNameTextField = new UITextField()},
{new UILabel(Inter.getLocText("FR-Designer_Button-Icon") + ":"), iconPane}, {new UILabel(Inter.getLocText("FR-Designer_Button-Icon")), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField = new UITextField()}, {new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys")), hotkeysTextField = new UITextField()},
}; };
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ",")); hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 16, 8); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH); advancePane.add(panel, BorderLayout.NORTH);
Component comp = createCenterPane(); Component comp = createCenterPane();

29
designer_base/src/com/fr/design/widget/component/BackgroundCompPane.java

@ -1,14 +1,16 @@
package com.fr.design.widget.component; package com.fr.design.widget.component;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleImgBackgroundEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.vividsolutions.jts.index.bintree.Interval;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -18,9 +20,9 @@ import java.awt.*;
*/ */
public abstract class BackgroundCompPane<T extends Widget> extends BasicPane { public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
protected UIButtonGroup backgroundHead; protected UIButtonGroup backgroundHead;
protected AccessibleBackgroundEditor initalBackgroundEditor; protected AccessibleImgBackgroundEditor initalBackgroundEditor;
protected AccessibleBackgroundEditor overBackgroundEditor; protected AccessibleImgBackgroundEditor overBackgroundEditor;
protected AccessibleBackgroundEditor clickBackgroundEditor; protected AccessibleImgBackgroundEditor clickBackgroundEditor;
private JPanel panel; private JPanel panel;
public BackgroundCompPane() { public BackgroundCompPane() {
@ -29,9 +31,11 @@ public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
public void initComponent() { public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
initalBackgroundEditor = new AccessibleBackgroundEditor(); UILabel headLabel = createUILable();
overBackgroundEditor = new AccessibleBackgroundEditor(); headLabel.setPreferredSize(new Dimension(50, 20));
clickBackgroundEditor = new AccessibleBackgroundEditor(); initalBackgroundEditor = new AccessibleImgBackgroundEditor();
overBackgroundEditor = new AccessibleImgBackgroundEditor();
clickBackgroundEditor = new AccessibleImgBackgroundEditor();
String [] titles = new String[]{Inter.getLocText("FR-Designer_DEFAULT"), Inter.getLocText("FR-Designer_Custom")}; String [] titles = new String[]{Inter.getLocText("FR-Designer_DEFAULT"), Inter.getLocText("FR-Designer_Custom")};
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -44,14 +48,19 @@ public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Over")), overBackgroundEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Over")), overBackgroundEditor},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Click")), clickBackgroundEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Click")), clickBackgroundEditor},
}; };
panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7); panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
backgroundHead = new UIButtonGroup(titles); backgroundHead = new UIButtonGroup(titles);
this.add(backgroundHead, BorderLayout.NORTH); JPanel headPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{headLabel, backgroundHead}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, 7);
this.add(headPane, BorderLayout.NORTH);
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
protected UILabel createUILable(){
return new UILabel(Inter.getLocText("FR-Designer_Background"));
}
public void update(T e){ public void update(T e){
} }

55
designer/src/com/fr/design/widget/ui/CheckBoxDictPane.java → designer_base/src/com/fr/design/widget/component/CheckBoxDictPane.java

@ -1,10 +1,14 @@
package com.fr.design.widget.ui; package com.fr.design.widget.component;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
@ -20,39 +24,40 @@ public class CheckBoxDictPane extends JPanel {
private UIButtonGroup returnTypeComboBox; private UIButtonGroup returnTypeComboBox;
private DictionaryComboBox startComboBox; private DictionaryComboBox startComboBox;
private DictionaryComboBox endComboBox; private DictionaryComboBox endComboBox;
private JPanel returnStringPane;
private JPanel delimiterPane;
private JPanel startPane;
private JPanel endPane;
public CheckBoxDictPane() { public CheckBoxDictPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays);
delimiterPane =FRGUIPaneFactory.createBorderLayout_S_Pane();
UILabel label = new UILabel(Inter.getLocText("Form-Delimiter") + ":");
delimiterPane.add(label, BorderLayout.WEST);
delimiterPane.add(delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays), BorderLayout.CENTER);
delimiterComboBox.setEditable(true); delimiterComboBox.setEditable(true);
startComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays);
startPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
startPane.add(new UILabel(Inter.getLocText("ComboCheckBox-Start_Symbol") + ":"), BorderLayout.WEST);
startPane.add(startComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER);
startComboBox.setEditable(true); startComboBox.setEditable(true);
endComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays);
endPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
endPane.add(new UILabel(Inter.getLocText("ComboCheckBox-End_Symbol") + ":"), BorderLayout.WEST);
endPane.add(endComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER);
endComboBox.setEditable(true); endComboBox.setEditable(true);
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Form-Delimiter") + ":"), delimiterComboBox},
new Component[]{new UILabel(Inter.getLocText("ComboCheckBox-Start_Symbol") + ":"),startComboBox},
new Component[]{new UILabel(Inter.getLocText("ComboCheckBox-End_Symbol") + ":"),endComboBox}
};
returnStringPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
returnTypeComboBox = new UIButtonGroup(new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")}); returnTypeComboBox = new UIButtonGroup(new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")});
returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER); returnTypeComboBox.addActionListener(new ActionListener() {
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypePane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); @Override
public void actionPerformed(ActionEvent e) {
checkVisible(returnTypeComboBox.getSelectedIndex());
}
});
JPanel headPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(headPane, BorderLayout.NORTH);
jPanel.add(returnStringPane, BorderLayout.CENTER);
returnStringPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));
this.add(jPanel); this.add(jPanel);
} }
private void checkVisible(int selectIndex){ public void checkVisible(int selectIndex){
delimiterPane.setVisible(selectIndex == 1); returnStringPane.setVisible(selectIndex == 1);
startPane.setVisible(selectIndex == 1);
endPane.setVisible(selectIndex == 1);
} }
public void populate(ComboCheckBox comboCheckBox) { public void populate(ComboCheckBox comboCheckBox) {

18
designer_base/src/com/fr/design/widget/component/DateValuePane.java

@ -2,18 +2,20 @@ package com.fr.design.widget.component;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.editor.*; import com.fr.design.editor.editor.*;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
/** /**
* Created by ibm on 2017/8/8. * Created by ibm on 2017/8/8.
*/ */
public class DateValuePane extends JPanel { public class DateValuePane extends JPanel {
private UIHeadGroup widgetValueHead; private UIButtonGroup widgetValueHead;
private Editor[] editor; private Editor[] editor;
@ -31,9 +33,11 @@ public class DateValuePane extends JPanel {
customPane.add(editor[i], editor[i].getName()); customPane.add(editor[i], editor[i].getName());
tabTitles[i] = editor[i].getName(); tabTitles[i] = editor[i].getName();
} }
widgetValueHead = new UIHeadGroup(tabTitles) { widgetValueHead = new UIButtonGroup(tabTitles);
widgetValueHead.addChangeListener(new ChangeListener() {
@Override @Override
public void tabChanged(int index) { public void stateChanged(ChangeEvent e) {
int index = widgetValueHead.getSelectedIndex();
if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("None"))) { if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("None"))) {
customPane.setVisible(false); customPane.setVisible(false);
} else { } else {
@ -41,7 +45,7 @@ public class DateValuePane extends JPanel {
} }
cardLayout.show(customPane, tabTitles[index]); cardLayout.show(customPane, tabTitles[index]);
} }
}; });
this.add(widgetValueHead, BorderLayout.NORTH); this.add(widgetValueHead, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER); this.add(customPane, BorderLayout.CENTER);
@ -56,6 +60,9 @@ public class DateValuePane extends JPanel {
} }
public void populate(Object ob) { public void populate(Object ob) {
if(ob == null){
setCardValue(0, ob);
}
for (int i = 0; i < editor.length; i++) { for (int i = 0; i < editor.length; i++) {
if (editor[i].accept(ob)) { if (editor[i].accept(ob)) {
setCardValue(i, ob); setCardValue(i, ob);
@ -66,6 +73,7 @@ public class DateValuePane extends JPanel {
private void setCardValue(int i, Object object) { private void setCardValue(int i, Object object) {
widgetValueHead.setSelectedIndex(i); widgetValueHead.setSelectedIndex(i);
widgetValueHead.populateBean();
editor[i].setValue(object); editor[i].setValue(object);
// kunsnat: bug7861 所有的Editor值都要跟随改变, 因为populate的editor 从"" // kunsnat: bug7861 所有的Editor值都要跟随改变, 因为populate的editor 从""
// 一定是最后的Editor哦. // 一定是最后的Editor哦.

303
designer_base/src/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -0,0 +1,303 @@
package com.fr.design.widget.component;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
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.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.DefaultFormatter;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by kerry on 2017/9/10.
*/
public class NumberEditorValidatePane extends JPanel {
private UICheckBox allowDecimalsCheckBox;
private UICheckBox allowNegativeCheckBox;
private UICheckBox setMaxValueCheckBox;
private UICheckBox setMinValueCheckBox;
private UIBasicSpinner maxValueSpinner;
private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel;
private UISpinner decimalLength;
private JPanel limitNumberPane;
private UITextField maxValueErrorTextField;
private UITextField minValueErrorTextField;
private JPanel maxValueFieldPane;
private JPanel minValueFieldPane;
private ActionListener allowDecimalsListener;
private ActionListener allowNegativeListener;
public ActionListener setMaxListener;
private ActionListener setMinListener;
private ChangeListener maxValueChangeListener;
private ChangeListener minValueChangeListener;
public NumberEditorValidatePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
initComponent();
}
private void initComponent() {
initListeners();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
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));
setNotAllowsInvalid(this.maxValueSpinner);
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));
setNotAllowsInvalid(this.minValueSpinner);
minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
initMaxMinValueFieldPane();
JPanel maxValueBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
maxValueBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
maxValueBorderPane.add(maxValueFieldPane, BorderLayout.CENTER);
JPanel minValueBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
minValueBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, IntervalConstants.INTERVAL_L1, 0));
minValueBorderPane.add(minValueFieldPane, BorderLayout.CENTER);
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);
limitNumberPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowDecimalsCheckBox, null},
new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{maxValueBorderPane, null},
new Component[]{setMinValueCheckBox, minValueSpinner},
new Component[]{minValueBorderPane, null},
};
double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
this.add(panel);
}
private void initMaxMinValueFieldPane() {
maxValueErrorTextField = new UITextField();
minValueErrorTextField = new UITextField();
maxValueFieldPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), maxValueErrorTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
setMaxValueCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
maxValueFieldPane.setVisible(setMaxValueCheckBox.isSelected());
}
});
minValueFieldPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), minValueErrorTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
setMinValueCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
minValueFieldPane.setVisible(setMinValueCheckBox.isSelected());
}
});
}
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) {
JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) {
JFormattedTextField ftf = ((UIBasicSpinner.DefaultEditor) editor).getTextField();
ftf.setColumns(10);
JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter();
DefaultFormatter df = (DefaultFormatter) formatter;
df.setAllowsInvalid(false);
}
}
public void populate(NumberEditor e) {
allowDecimalsCheckBox.setSelected(e.isAllowDecimals());
if (e.isAllowDecimals()) {
this.decimalLength.setValue(e.getMaxDecimalLength());
} else {
this.limitNumberPane.setVisible(false);
}
allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) {
setMaxValueCheckBox.setSelected(false);
maxValueFieldPane.setVisible(false);
maxValueSpinner.setValue(new Double(Double.MAX_VALUE));
maxValueSpinner.setEnabled(false);
} else {
setMaxValueCheckBox.setSelected(true);
maxValueSpinner.setEnabled(true);
maxValueFieldPane.setVisible(true);
maxValueSpinner.setValue(new Double(e.getMaxValue()));
}
if (e.getMinValue() == -Double.MAX_VALUE) {
setMinValueCheckBox.setSelected(false);
minValueFieldPane.setVisible(false);
minValueSpinner.setValue(new Double(-Double.MAX_VALUE));
minValueSpinner.setEnabled(false);
} else {
setMinValueCheckBox.setSelected(true);
minValueFieldPane.setVisible(true);
minValueSpinner.setEnabled(true);
minValueSpinner.setValue(new Double(e.getMinValue()));
}
}
public void update(NumberEditor ob) {
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength((int) this.decimalLength.getValue());
}
ob.setAllowNegative(allowNegativeCheckBox.isSelected());
if (setMaxValueCheckBox.isSelected()) {
ob.setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue()));
} else {
ob.setMaxValue(Double.MAX_VALUE);
}
if (setMinValueCheckBox.isSelected()) {
ob.setMinValue(Double.parseDouble("" + minValueSpinner.getValue()));
} else {
ob.setMinValue(-Double.MAX_VALUE);
}
}
}

9
designer_base/src/com/fr/start/StartServer.java

@ -18,6 +18,7 @@ import com.fr.stable.EnvChangedListener;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.OperatingSystem;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.start.server.JettyHost; import com.fr.start.server.JettyHost;
@ -179,10 +180,16 @@ public class StartServer {
private static class InformationPane extends BasicPane { private static class InformationPane extends BasicPane {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final int FREE_STYLE_TOP = 15;
private static final int FREE_STYLE_OTHER = 5;
public InformationPane(String message) { public InformationPane(String message) {
init(message);
}
private void init(String message) {
this.setLayout(new BorderLayout(10, 10)); this.setLayout(new BorderLayout(10, 10));
this.setBorder(BorderFactory.createEmptyBorder(15, 5, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(FREE_STYLE_TOP, FREE_STYLE_OTHER, FREE_STYLE_OTHER, FREE_STYLE_OTHER));
String text; String text;
if (!ComparatorUtils.equals(message, Inter.getLocText(new String[]{"Default", "Utils-Report_Runtime_Env"}))) { if (!ComparatorUtils.equals(message, Inter.getLocText(new String[]{"Default", "Utils-Report_Runtime_Env"}))) {
text = new StringBuffer(Inter.getLocText("FR-Designer_Open")) text = new StringBuffer(Inter.getLocText("FR-Designer_Open"))

28
designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java

@ -1,9 +1,5 @@
package com.fr.design.chart.javascript; package com.fr.design.chart.javascript;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -14,6 +10,9 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.EmailJavaScript; import com.fr.js.EmailJavaScript;
import javax.swing.*;
import java.awt.*;
/** /**
* *
* @author jim * @author jim
@ -30,11 +29,11 @@ public class ChartEmailPane extends EmailPane{
JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate(); JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
// 是否支持导出控制图表的超链邮件是否显示showTplContent // 是否支持导出控制图表的超链邮件是否显示showTplContent
boolean supportExport = jTemplate.isJWorkBook(); boolean supportExport = jTemplate.isJWorkBook();
JPanel contentPane;
if (supportExport) { if (supportExport) {
double[] rSizes = { preferred, preferred, preferred, preferred, preferred, preferred, fill, preferred, preferred}; double[] rSizes = { preferred, preferred, preferred, preferred, preferred, fill, preferred, preferred};
showTplContent = new UICheckBox(Inter.getLocText("Email-Can_Preview_Report_Content")); showTplContent = new UICheckBox(Inter.getLocText("Email-Can_Preview_Report_Content"));
centerPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ contentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},
{new UILabel(), tipsPane1}, {new UILabel(), tipsPane1},
createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()), createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()),
createLinePane(Inter.getLocText("HJS-CC_to"), ccEditor = new UITextField()), createLinePane(Inter.getLocText("HJS-CC_to"), ccEditor = new UITextField()),
@ -44,8 +43,8 @@ public class ChartEmailPane extends EmailPane{
{new UILabel(), showTplContent}, {new UILabel(), showTplContent},
{new UILabel(), tipsPane2}},rSizes, columnSize, 6); {new UILabel(), tipsPane2}},rSizes, columnSize, 6);
} else { } else {
double[] rSizes = { preferred, preferred, preferred, preferred, preferred, preferred, fill, preferred}; double[] rSizes = { preferred, preferred, preferred, preferred, preferred, fill, preferred};
centerPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{ contentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField}, {new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},
{new UILabel(), tipsPane1}, {new UILabel(), tipsPane1},
createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()), createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()),
@ -55,6 +54,17 @@ public class ChartEmailPane extends EmailPane{
{mainTextLabel, scrollPane}, {mainTextLabel, scrollPane},
{new UILabel(), tipsPane2}},rSizes, columnSize, 8); {new UILabel(), tipsPane2}},rSizes, columnSize, 8);
} }
centerPane = new JPanel(new BorderLayout());
if (needRenamePane()) {
JPanel namePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{{new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},},
new double[] {preferred}, columnSize, 6);
centerPane.add(namePane, BorderLayout.NORTH);
}
centerPane.add(contentPane, BorderLayout.CENTER);
}
protected boolean needRenamePane() {
return true;
} }
protected void checkEmailConfig(boolean valid) { protected void checkEmailConfig(boolean valid) {

2
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java

@ -56,7 +56,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
private static final int STATE = 2; private static final int STATE = 2;
private static final int USER = 3; private static final int USER = 3;
private static final int OFFSET_X = 800; private static final int OFFSET_X = 800;
private static final int OFFSET_Y = 280; private static final int OFFSET_Y = 250;
private UIGroupExtensionPane groupExtensionPane; private UIGroupExtensionPane groupExtensionPane;
private UIButton addButton; private UIButton addButton;

2
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java

@ -147,7 +147,7 @@ public class ChartHyperPopAttrPane extends AbstractChartAttrPane {
* @return 标题 * @return 标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("FR-Hyperlink_ChartHyperlink"); return Inter.getLocText("Plugin-ChartF_Hyperlink");
} }
} }

2
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -45,7 +45,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
ChartCollection cc = createChartCollection(); ChartCollection cc = createChartCollection();
chartComponent = new ChartComponent(); chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension(200, 170));// 在单元格弹出时 需要调整保证属性表的大小. chartComponent.setPreferredSize(new Dimension(300, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setSupportEdit(false); chartComponent.setSupportEdit(false);
chartComponent.populate(cc); chartComponent.populate(cc);

10
designer_chart/src/com/fr/design/mainframe/chart/gui/UIEditLabel.java

@ -16,7 +16,11 @@ import javax.swing.*;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.AWTEventListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
@ -126,7 +130,7 @@ public class UIEditLabel extends JPanel implements UIObserver{
*/ */
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
showLabel.setToolTipText(getTooltip()); showLabel.setToolTipText(getTooltip());
UIEditLabel.this.setBackground(UIConstants.NORMAL_BACKGROUND); UIEditLabel.this.setBackground(UIConstants.SELECT_TAB);
} }
}); });
@ -149,7 +153,7 @@ public class UIEditLabel extends JPanel implements UIObserver{
* 设置成正常的背景 * 设置成正常的背景
*/ */
public void resetNomalrBackground(){ public void resetNomalrBackground(){
UIEditLabel.this.setBackground(UIConstants.NORMAL_BACKGROUND); UIEditLabel.this.setBackground(UIConstants.SELECT_TAB);
} }
private String getTooltip(){ private String getTooltip(){

31
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

@ -6,7 +6,16 @@ import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.AttrContents; import com.fr.chart.base.AttrContents;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.TimeSwitchAttr; import com.fr.chart.base.TimeSwitchAttr;
import com.fr.chart.chartattr.*; import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.GanttPlot;
import com.fr.chart.chartattr.GisMapPlot;
import com.fr.chart.chartattr.MapPlot;
import com.fr.chart.chartattr.MeterPlot;
import com.fr.chart.chartattr.PiePlot;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartattr.StockPlot;
import com.fr.chart.chartattr.XYScatterPlot;
import com.fr.chart.chartdata.GisMapReportDefinition; import com.fr.chart.chartdata.GisMapReportDefinition;
import com.fr.chart.chartdata.GisMapTableDefinition; import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
@ -39,7 +48,16 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartOtherPane; import com.fr.design.mainframe.chart.gui.ChartOtherPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.*; import com.fr.js.EmailJavaScript;
import com.fr.js.FormHyperlinkProvider;
import com.fr.js.JavaScript;
import com.fr.js.JavaScriptImpl;
import com.fr.js.NameJavaScript;
import com.fr.js.NameJavaScriptGroup;
import com.fr.js.ParameterJavaScript;
import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink;
import com.fr.plugin.chart.designer.component.format.FormatPaneWithOutFont;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
@ -48,7 +66,12 @@ import com.fr.third.org.hsqldb.lib.Iterator;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.Format; import java.text.Format;
import java.util.ArrayList; import java.util.ArrayList;
@ -215,7 +238,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (percentFormatPane == null) { if (percentFormatPane == null) {
percentFormatPane = new FormatPane(); percentFormatPane = new FormatPaneWithOutFont();
} }
DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat(), "#.##%"); DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat(), "#.##%");

16
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java

@ -9,6 +9,7 @@ import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.base.DataSeriesCondition;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane; import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -18,15 +19,20 @@ import com.fr.design.gui.style.FormatPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.dialog.BasicPane;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.component.format.FormatPaneWithOutFont;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.Format; import java.text.Format;
import java.util.HashMap; import java.util.HashMap;
@ -226,7 +232,7 @@ public class ChartDatapointLabelPane extends BasicPane{
} }
if(valueFormatPane == null) { if(valueFormatPane == null) {
valueFormatPane = new FormatPane(); valueFormatPane = new FormatPaneWithOutFont();
} }
Point comPoint = valueFormatButton.getLocationOnScreen(); Point comPoint = valueFormatButton.getLocationOnScreen();
Point arrowPoint = new Point(comPoint.x + valueFormatButton.getWidth(), comPoint.y + valueFormatButton.getHeight()); Point arrowPoint = new Point(comPoint.x + valueFormatButton.getWidth(), comPoint.y + valueFormatButton.getHeight());
@ -255,7 +261,7 @@ public class ChartDatapointLabelPane extends BasicPane{
} }
if(percentFormatPane == null) { if(percentFormatPane == null) {
percentFormatPane = new FormatPane(); percentFormatPane = new FormatPaneWithOutFont();
} }
Point comPoint = valuePercentFormatButton.getLocationOnScreen(); Point comPoint = valuePercentFormatButton.getLocationOnScreen();
Point arrowPoint = new Point(comPoint.x + valuePercentFormatButton.getWidth(), comPoint.y + valuePercentFormatButton.getHeight()); Point arrowPoint = new Point(comPoint.x + valuePercentFormatButton.getWidth(), comPoint.y + valuePercentFormatButton.getHeight());
@ -429,7 +435,7 @@ public class ChartDatapointLabelPane extends BasicPane{
protected void updatePercentFormatpane(){ protected void updatePercentFormatpane(){
if(isValuePercent!= null && isValuePercent.isSelected()){ if(isValuePercent!= null && isValuePercent.isSelected()){
if(this.percentFormatPane == null){ if(this.percentFormatPane == null){
this.percentFormatPane = new FormatPane(); this.percentFormatPane = new FormatPaneWithOutFont();
} }
if(this.percentFormat == null){ if(this.percentFormat == null){
DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat("#.##%"), "#.##%"); DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat("#.##%"), "#.##%");

5
designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java

@ -40,11 +40,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane{
return contentPane; return contentPane;
} }
//设置色彩面板内容
protected void setColorPaneContent (JPanel panel) {
panel.add(createStylePane(), BorderLayout.CENTER);
}
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() { protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomStackAndAxisConditionPane.class; return VanChartCustomStackAndAxisConditionPane.class;
} }

111
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java

@ -6,18 +6,12 @@ import com.fr.chart.web.ChartHyperRelateCellLink;
import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.fun.HyperlinkProvider; import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.js.EmailJavaScript; import com.fr.js.EmailJavaScript;
@ -29,16 +23,12 @@ import com.fr.js.NameJavaScriptGroup;
import com.fr.js.ParameterJavaScript; import com.fr.js.ParameterJavaScript;
import com.fr.js.ReportletHyperlink; import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink; import com.fr.js.WebHyperlink;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.designer.component.VanChartUIListControlPane;
import com.fr.plugin.chart.designer.other.HyperlinkMapFactory; import com.fr.plugin.chart.designer.other.HyperlinkMapFactory;
import com.fr.stable.ListMap; import com.fr.stable.ListMap;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -47,7 +37,7 @@ import java.util.Set;
/** /**
* Created by Fangjie on 2016/4/28. * Created by Fangjie on 2016/4/28.
*/ */
public class VanChartHyperLinkPane extends UIListControlPane { public class VanChartHyperLinkPane extends VanChartUIListControlPane {
public VanChartHyperLinkPane() { public VanChartHyperLinkPane() {
super(); super();
@ -115,19 +105,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
return new NameJavaScriptGroup(res_array); return new NameJavaScriptGroup(res_array);
} }
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot);
}
public void populate(Plot plot) { public void populate(Plot plot) {
//特殊处理,使用instanceof判断,处理连续弹窗问题
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
popupEditDialog = new HyperDialog(cardPane);
}
this.plot = plot; this.plot = plot;
HashMap paneMap = getHyperlinkMap(plot); HashMap paneMap = getHyperlinkMap(plot);
@ -207,7 +185,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"),
new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class))); new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), HyperlinkMapFactory.VanChartEmailPane.class));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"),
new WebHyperlink(), getUseMap(map, WebHyperlink.class))); new WebHyperlink(), getUseMap(map, WebHyperlink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"),
@ -240,87 +218,4 @@ public class VanChartHyperLinkPane extends UIListControlPane {
} }
return null; return null;
} }
protected void popupEditDialog(Point mousePos) {
//特殊处理,处理连续弹窗情况
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
GUICoreUtils.centerWindow(popupEditDialog);
popupEditDialog.setVisible(true);
return;
}
super.popupEditDialog(mousePos);
}
// 点击"编辑"按钮,弹出面板
protected class HyperDialog extends JDialog {
private JComponent editPane;
private static final int WIDTH = 570;
private static final int HEIGHT = 490;
private UIButton okButton, cancelButton;
HyperDialog(JComponent pane) {
super(DesignerContext.getDesignerFrame(), true);
pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10));
this.editPane = pane;
JPanel editPaneWrapper = new JPanel(new BorderLayout());
editPaneWrapper.add(editPane, BorderLayout.CENTER);
this.getContentPane().add(editPaneWrapper, BorderLayout.CENTER);
this.getContentPane().add(createControlButtonPane(), BorderLayout.SOUTH);
setSize(WIDTH, HEIGHT);
this.setVisible(false);
}
private JPanel createControlButtonPane() {
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
controlPane.add(buttonsPane, BorderLayout.EAST);
//确定
addOkButton(buttonsPane);
//取消
addCancelButton(buttonsPane);
controlPane.setBorder(BorderFactory.createEmptyBorder(10,0,10,0));
return controlPane;
}
private void addCancelButton(JPanel buttonsPane) {
cancelButton = new UIButton(Inter.getLocText("Cancel"));
buttonsPane.add(cancelButton);
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
doCancel();
}
});
}
private void addOkButton(JPanel buttonsPane) {
okButton = new UIButton(Inter.getLocText("OK"));
buttonsPane.add(okButton);
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
doOK();
}
});
}
public void doOK() {
saveSettings();
setVisible(false);
}
public void doCancel() {
setVisible(false);
}
}
} }

5
designer_chart/src/com/fr/plugin/chart/custom/style/VanChartCustomSeriesPane.java

@ -6,10 +6,8 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane;
import com.fr.general.Inter;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.VanChartBeautyPane; import com.fr.plugin.chart.designer.component.VanChartBeautyPane;
import com.fr.plugin.chart.designer.component.VanChartFillStylePane; import com.fr.plugin.chart.designer.component.VanChartFillStylePane;
@ -81,9 +79,8 @@ public class VanChartCustomSeriesPane extends ChartSeriesPane {
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Color"),panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
return colorPane; return panel;
} }
/** /**

1
designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartScrollPane.java

@ -27,6 +27,7 @@ public abstract class AbstractVanChartScrollPane<T> extends BasicScrollPane<T> {
} else { } else {
leftcontentPane.setBounds(0, 0, width, height); leftcontentPane.setBounds(0, 0, width, height);
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, original));
} }
} }
public void reloaPane(JPanel pane){ public void reloaPane(JPanel pane){

133
designer_chart/src/com/fr/plugin/chart/designer/component/VanChartUIListControlPane.java

@ -0,0 +1,133 @@
package com.fr.plugin.chart.designer.component;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.stable.Nameable;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by mengao on 2017/9/8.
* 新图表UIListControlPane基础面板
*/
public abstract class VanChartUIListControlPane extends UIListControlPane {
public VanChartUIListControlPane() {
super();
}
public VanChartUIListControlPane(BasePlot plot) {
super(plot);
}
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((Plot) plot);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
protected abstract void update(Plot plot);
//-------------------连续弹窗问题 start-------------------//
public void populate (Nameable[] nameableArray) {
//特殊处理,使用instanceof判断,弹出不同的面板
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
popupEditDialog = new HyperDialog(cardPane);
}
super.populate(nameableArray);
}
protected void popupEditDialog(Point mousePos) {
//特殊处理,处理连续弹窗情况,弹出面板定为方式不同
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
GUICoreUtils.centerWindow(popupEditDialog);
popupEditDialog.setVisible(true);
return;
}
super.popupEditDialog(mousePos);
}
// 点击"编辑"按钮,弹出面板(这个面板是弹窗里面的弹窗)
protected class HyperDialog extends JDialog {
private JComponent editPane;
private static final int WIDTH = 570;
private static final int HEIGHT = 490;
private UIButton okButton, cancelButton;
HyperDialog(JComponent pane) {
super(DesignerContext.getDesignerFrame(), true);
pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10));
this.editPane = pane;
JPanel editPaneWrapper = new JPanel(new BorderLayout());
editPaneWrapper.add(editPane, BorderLayout.CENTER);
this.getContentPane().add(editPaneWrapper, BorderLayout.CENTER);
this.getContentPane().add(createControlButtonPane(), BorderLayout.SOUTH);
setSize(WIDTH, HEIGHT);
this.setVisible(false);
}
private JPanel createControlButtonPane() {
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
controlPane.add(buttonsPane, BorderLayout.EAST);
//确定
addOkButton(buttonsPane);
//取消
addCancelButton(buttonsPane);
controlPane.setBorder(BorderFactory.createEmptyBorder(10,0,10,0));
return controlPane;
}
private void addCancelButton(JPanel buttonsPane) {
cancelButton = new UIButton(Inter.getLocText("Cancel"));
buttonsPane.add(cancelButton);
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
doCancel();
}
});
}
private void addOkButton(JPanel buttonsPane) {
okButton = new UIButton(Inter.getLocText("OK"));
buttonsPane.add(okButton);
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
doOK();
}
});
}
public void doOK() {
saveSettings();
setVisible(false);
}
public void doCancel() {
setVisible(false);
}
}
}

2
designer_chart/src/com/fr/plugin/chart/designer/component/format/VanChartFormatPaneWithCheckBox.java

@ -92,7 +92,7 @@ public abstract class VanChartFormatPaneWithCheckBox extends JPanel{
formatPane = createFormatPane(); formatPane = createFormatPane();
} }
Point comPoint = formatButton.getLocationOnScreen(); Point comPoint = formatButton.getLocationOnScreen();
Point arrowPoint = new Point(comPoint.x + formatButton.getWidth(), comPoint.y + formatButton.getHeight()); Point arrowPoint = new Point(comPoint.x, comPoint.y + formatButton.getHeight());
UIBubbleFloatPane<Style> pane = new UIBubbleFloatPane(Constants.LEFT, arrowPoint, formatPane, 258, 209) { UIBubbleFloatPane<Style> pane = new UIBubbleFloatPane(Constants.LEFT, arrowPoint, formatPane, 258, 209) {
@Override @Override

22
designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPane.java

@ -10,7 +10,6 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.base.RefreshMoreLabel;
@ -86,11 +85,19 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f, 20}; double[] columnSize = {p, f, 20};
double[] rowSize = {p, p}; double[] column = {f, 20};
double[] rowSize = {p};
Component[][] components = initComponent(jPanel); Component[][] components = initComponent(jPanel);
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
contentPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); contentPane = new JPanel(new BorderLayout());
contentPane.add(panel1, BorderLayout.CENTER);
Component[][] AutoTooltipComponent = initAutoTooltipComponent();
JPanel panel2 = TableLayout4VanChartHelper.createGapTableLayoutPane(AutoTooltipComponent, rowSize, column);
panel2.setBorder(BorderFactory.createEmptyBorder(10, 0,0,0));
contentPane.add(panel2, BorderLayout.SOUTH);
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 72,0,0));
content.add(moreLabelPane, BorderLayout.NORTH); content.add(moreLabelPane, BorderLayout.NORTH);
content.add(contentPane, BorderLayout.CENTER); content.add(contentPane, BorderLayout.CENTER);
return content; return content;
@ -105,6 +112,13 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
} }
protected Component[][] initAutoTooltipComponent () {
return new Component[][]{
new Component[]{autoTooltip, tooltipSet},
};
}
private void initTooltipSet() { private void initTooltipSet() {
tooltipSet = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png")); tooltipSet = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png"));
tooltipSet.setPreferredSize(new Dimension(20, 20)); tooltipSet.setPreferredSize(new Dimension(20, 20));

7
designer_chart/src/com/fr/plugin/chart/designer/other/AutoRefreshPaneWithoutTooltip.java

@ -1,11 +1,8 @@
package com.fr.plugin.chart.designer.other; package com.fr.plugin.chart.designer.other;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.base.RefreshMoreLabel;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.*;
import java.awt.*; import java.awt.*;
/** /**
@ -17,9 +14,9 @@ public class AutoRefreshPaneWithoutTooltip extends AutoRefreshPane {
super(chart, isLargeModel); super(chart, isLargeModel);
} }
protected Component[][] initComponent(JPanel autoTooltipPane){ protected Component[][] initAutoTooltipComponent () {
return new Component[][]{ return new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), getAutoRefreshTime(),new UILabel(Inter.getLocText("Chart-Time_Seconds"))} new Component[]{null, null},
}; };
} }

337
designer_chart/src/com/fr/plugin/chart/designer/other/HyperlinkMapFactory.java

@ -116,28 +116,28 @@ public class HyperlinkMapFactory {
public static HashMap getHyperlinkMap(Plot plot) { public static HashMap getHyperlinkMap(Plot plot) {
String plotType = plotTypeMap.get(plot.getClass().getName() + plot.getDetailType()); String plotType = plotTypeMap.get(plot.getClass().getName() + plot.getDetailType());
if(plotType == null){ if (plotType == null) {
plotType = plotTypeMap.get(plot.getClass().getName()); plotType = plotTypeMap.get(plot.getClass().getName());
if(plotType == null) { if (plotType == null) {
plotType = NORMAL; plotType = NORMAL;
} }
} }
return getHyperlinkMapWithType(plotType); return getHyperlinkMapWithType(plotType);
} }
public static HashMap getDrillUpLinkMap(){ public static HashMap getDrillUpLinkMap() {
return getHyperlinkMapWithType(DIRLLMAPCATALOG); return getHyperlinkMapWithType(DIRLLMAPCATALOG);
} }
public static HashMap getLineMapHyperLinkMap(){ public static HashMap getLineMapHyperLinkMap() {
return getHyperlinkMapWithType(LINEMAP); return getHyperlinkMapWithType(LINEMAP);
} }
private static HashMap getHyperlinkMapWithType(String plotType){ private static HashMap getHyperlinkMapWithType(String plotType) {
HashMap<Class, Class> map = new HashMap<Class, Class>(); HashMap<Class, Class> map = new HashMap<Class, Class>();
map.put(ReportletHyperlink.class, getClassWithPrefix(HyperlinkMapFactory.Report.class, plotType)); map.put(ReportletHyperlink.class, getClassWithPrefix(HyperlinkMapFactory.Report.class, plotType));
map.put(EmailJavaScript.class, ChartEmailPane.class); map.put(EmailJavaScript.class, VanChartEmailPane.class);
map.put(WebHyperlink.class, getClassWithPrefix(HyperlinkMapFactory.Web.class, plotType)); map.put(WebHyperlink.class, getClassWithPrefix(HyperlinkMapFactory.Web.class, plotType));
map.put(ParameterJavaScript.class, getClassWithPrefix(HyperlinkMapFactory.Para.class, plotType)); map.put(ParameterJavaScript.class, getClassWithPrefix(HyperlinkMapFactory.Para.class, plotType));
@ -150,9 +150,9 @@ public class HyperlinkMapFactory {
return map; return map;
} }
private static Class getClassWithPrefix(Class superClass, String plotType){ private static Class getClassWithPrefix(Class superClass, String plotType) {
String wholeClassString = superClass.getName() + plotType; String wholeClassString = superClass.getName() + plotType;
try{ try {
return Class.forName(wholeClassString); return Class.forName(wholeClassString);
} catch (Exception e) { } catch (Exception e) {
return superClass; return superClass;
@ -386,78 +386,90 @@ public class HyperlinkMapFactory {
return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list)); return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list));
} }
//网络报表 //网络报表
public static class Report{ public static class Report {
public static class VAN_CHART extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART extends ReportletHyperlinkPane.CHART {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MULTICATEGORY extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_MULTICATEGORY extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane(); return getMultiCategoryEditorPane();
} }
} }
public static class VAN_CHART_SCATTER extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_SCATTER extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane(); return getScatterValueEditorPane();
} }
} }
public static class VAN_CHART_GANNT extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_GANNT extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane(); return getGanntValueEditorPane();
} }
} }
public static class VAN_CHART_MULTIPIE extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_MULTIPIE extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane(); return getMultiPieValueEditorPane();
} }
} }
public static class VAN_CHART_GAUGE extends ReportletHyperlinkPane.CHART_METER{ public static class VAN_CHART_GAUGE extends ReportletHyperlinkPane.CHART_METER {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MAP extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_MAP extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane(); return getMapValueEditorPane();
} }
} }
public static class VAN_CHART_LINE_MAP extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_LINE_MAP extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane(); return getLineMapValueEditorPane();
} }
} }
public static class VAN_CHART_DRILLMAPCATALOG extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_DRILLMAPCATALOG extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane(); return getDrillMapCatalogValueEditorPane();
} }
} }
public static class VAN_CHART_FUNNEL extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_FUNNEL extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane(); return getFunnelValueEditorPane();
} }
} }
public static class VAN_CHART_WORDCLOUD extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_WORDCLOUD extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane(); return getWordCloudValueEditorPane();
} }
} }
public static class VAN_CHART_STRUCTURE extends ReportletHyperlinkPane.CHART{ public static class VAN_CHART_STRUCTURE extends Report.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane(); return getStructureValueEditorPane();
@ -465,42 +477,61 @@ public class HyperlinkMapFactory {
} }
} }
//邮箱
public static class VanChartEmailPane extends ChartEmailPane {
@Override
protected boolean needRenamePane() {
return false;
}
}
//网页链接 //网页链接
public static class Web{ public static class Web {
public static class VAN_CHART extends WebHyperlinkPane.CHART{ public static class VAN_CHART extends WebHyperlinkPane.CHART {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MULTICATEGORY extends WebHyperlinkPane.CHART{ public static class VAN_CHART_MULTICATEGORY extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane(); return getMultiCategoryEditorPane();
} }
} }
public static class VAN_CHART_SCATTER extends WebHyperlinkPane.CHART{ public static class VAN_CHART_SCATTER extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane(); return getScatterValueEditorPane();
} }
} }
public static class VAN_CHART_GANNT extends WebHyperlinkPane.CHART{
public static class VAN_CHART_GANNT extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane(); return getGanntValueEditorPane();
} }
} }
public static class VAN_CHART_GAUGE extends WebHyperlinkPane.CHART_METER{ public static class VAN_CHART_GAUGE extends WebHyperlinkPane.CHART_METER {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MAP extends WebHyperlinkPane.CHART{ public static class VAN_CHART_MAP extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane(); return getMapValueEditorPane();
} }
} }
public static class VAN_CHART_LINE_MAP extends WebHyperlinkPane.CHART{ public static class VAN_CHART_LINE_MAP extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane(); return getLineMapValueEditorPane();
@ -508,34 +539,34 @@ public class HyperlinkMapFactory {
} }
public static class VAN_CHART_DRILLMAPCATALOG extends WebHyperlinkPane.CHART{ public static class VAN_CHART_DRILLMAPCATALOG extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane(); return getDrillMapCatalogValueEditorPane();
} }
} }
public static class VAN_CHART_MULTIPIE extends WebHyperlinkPane.CHART{ public static class VAN_CHART_MULTIPIE extends Web.VAN_CHART {
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane(); return getMultiPieValueEditorPane();
} }
} }
public static class VAN_CHART_FUNNEL extends WebHyperlinkPane.CHART{ public static class VAN_CHART_FUNNEL extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane(); return getFunnelValueEditorPane();
} }
} }
public static class VAN_CHART_WORDCLOUD extends WebHyperlinkPane.CHART{ public static class VAN_CHART_WORDCLOUD extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane(); return getWordCloudValueEditorPane();
} }
} }
public static class VAN_CHART_STRUCTURE extends WebHyperlinkPane.CHART{ public static class VAN_CHART_STRUCTURE extends Web.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane(); return getStructureValueEditorPane();
@ -544,42 +575,52 @@ public class HyperlinkMapFactory {
} }
//动态参数 //动态参数
public static class Para{ public static class Para {
public static class VAN_CHART extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART extends ParameterJavaScriptPane.CHART {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MULTICATEGORY extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_MULTICATEGORY extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane(); return getMultiCategoryEditorPane();
} }
} }
public static class VAN_CHART_SCATTER extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_SCATTER extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane(); return getScatterValueEditorPane();
} }
} }
public static class VAN_CHART_GANNT extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_GANNT extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane(); return getGanntValueEditorPane();
} }
} }
public static class VAN_CHART_GAUGE extends ParameterJavaScriptPane.CHART_METER{ public static class VAN_CHART_GAUGE extends ParameterJavaScriptPane.CHART_METER {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MAP extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_MAP extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane(); return getMapValueEditorPane();
} }
} }
public static class VAN_CHART_LINE_MAP extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_LINE_MAP extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane(); return getLineMapValueEditorPane();
@ -587,34 +628,34 @@ public class HyperlinkMapFactory {
} }
public static class VAN_CHART_DRILLMAPCATALOG extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_DRILLMAPCATALOG extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane(); return getDrillMapCatalogValueEditorPane();
} }
} }
public static class VAN_CHART_MULTIPIE extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_MULTIPIE extends Para.VAN_CHART {
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane(); return getMultiPieValueEditorPane();
} }
} }
public static class VAN_CHART_FUNNEL extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_FUNNEL extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane(); return getFunnelValueEditorPane();
} }
} }
public static class VAN_CHART_WORDCLOUD extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_WORDCLOUD extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane(); return getWordCloudValueEditorPane();
} }
} }
public static class VAN_CHART_STRUCTURE extends ParameterJavaScriptPane.CHART{ public static class VAN_CHART_STRUCTURE extends Para.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane(); return getStructureValueEditorPane();
@ -623,76 +664,86 @@ public class HyperlinkMapFactory {
} }
//js超链 //js超链
public static class Js{ public static class Js {
public static class VAN_CHART extends JavaScriptImplPane.CHART{ public static class VAN_CHART extends JavaScriptImplPane.CHART {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MULTICATEGORY extends JavaScriptImplPane.CHART{ public static class VAN_CHART_MULTICATEGORY extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane(); return getMultiCategoryEditorPane();
} }
} }
public static class VAN_CHART_SCATTER extends JavaScriptImplPane.CHART{ public static class VAN_CHART_SCATTER extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane(); return getScatterValueEditorPane();
} }
} }
public static class VAN_CHART_GANNT extends JavaScriptImplPane.CHART{ public static class VAN_CHART_GANNT extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane(); return getGanntValueEditorPane();
} }
} }
public static class VAN_CHART_GAUGE extends JavaScriptImplPane.CHART_METER{ public static class VAN_CHART_GAUGE extends Js.VAN_CHART {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MAP extends JavaScriptImplPane.CHART{ public static class VAN_CHART_MAP extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane(); return getMapValueEditorPane();
} }
} }
public static class VAN_CHART_LINE_MAP extends JavaScriptImplPane.CHART{ public static class VAN_CHART_LINE_MAP extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane(); return getLineMapValueEditorPane();
} }
} }
public static class VAN_CHART_DRILLMAPCATALOG extends JavaScriptImplPane.CHART{ public static class VAN_CHART_DRILLMAPCATALOG extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane(); return getDrillMapCatalogValueEditorPane();
} }
} }
public static class VAN_CHART_MULTIPIE extends JavaScriptImplPane.CHART{ public static class VAN_CHART_MULTIPIE extends Js.VAN_CHART {
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane(); return getMultiPieValueEditorPane();
} }
} }
public static class VAN_CHART_FUNNEL extends JavaScriptImplPane.CHART{ public static class VAN_CHART_FUNNEL extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane(); return getFunnelValueEditorPane();
} }
} }
public static class VAN_CHART_WORDCLOUD extends JavaScriptImplPane.CHART{ public static class VAN_CHART_WORDCLOUD extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane(); return getWordCloudValueEditorPane();
} }
} }
public static class VAN_CHART_STRUCTURE extends JavaScriptImplPane.CHART{ public static class VAN_CHART_STRUCTURE extends Js.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane(); return getStructureValueEditorPane();
@ -701,76 +752,84 @@ public class HyperlinkMapFactory {
} }
//图表超链-悬浮窗图表 //图表超链-悬浮窗图表
public static class Chart_Chart{ public static class Chart_Chart {
public static class VAN_CHART extends ChartHyperPoplinkPane{ public static class VAN_CHART extends ChartHyperPoplinkPane {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MULTICATEGORY extends ChartHyperPoplinkPane{ public static class VAN_CHART_MULTICATEGORY extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane(); return getMultiCategoryEditorPane();
} }
} }
public static class VAN_CHART_SCATTER extends ChartHyperPoplinkPane{ public static class VAN_CHART_SCATTER extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane(); return getScatterValueEditorPane();
} }
} }
public static class VAN_CHART_GANNT extends ChartHyperPoplinkPane{ public static class VAN_CHART_GANNT extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane(); return getGanntValueEditorPane();
} }
} }
public static class VAN_CHART_GAUGE extends ChartHyperPoplinkPane.CHART_METER{ public static class VAN_CHART_GAUGE extends ChartHyperPoplinkPane.CHART_METER {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MAP extends ChartHyperPoplinkPane{ public static class VAN_CHART_MAP extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane(); return getMapValueEditorPane();
} }
} }
public static class VAN_CHART_LINE_MAP extends ChartHyperPoplinkPane{ public static class VAN_CHART_LINE_MAP extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane(); return getLineMapValueEditorPane();
} }
} }
public static class VAN_CHART_DRILLMAPCATALOG extends ChartHyperPoplinkPane{ public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane(); return getDrillMapCatalogValueEditorPane();
} }
} }
public static class VAN_CHART_MULTIPIE extends ChartHyperPoplinkPane{ public static class VAN_CHART_MULTIPIE extends Chart_Chart.VAN_CHART {
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane(); return getMultiPieValueEditorPane();
} }
} }
public static class VAN_CHART_FUNNEL extends ChartHyperPoplinkPane{ public static class VAN_CHART_FUNNEL extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane(); return getFunnelValueEditorPane();
} }
} }
public static class VAN_CHART_WORDCLOUD extends ChartHyperPoplinkPane{ public static class VAN_CHART_WORDCLOUD extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane(); return getWordCloudValueEditorPane();
} }
} }
public static class VAN_CHART_STRUCTURE extends ChartHyperPoplinkPane{ public static class VAN_CHART_STRUCTURE extends Chart_Chart.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane(); return getStructureValueEditorPane();
@ -779,76 +838,84 @@ public class HyperlinkMapFactory {
} }
//图表超链-联动单元格 //图表超链-联动单元格
public static class Chart_Cell{ public static class Chart_Cell {
public static class VAN_CHART extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART extends ChartHyperRelateCellLinkPane {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MULTICATEGORY extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_MULTICATEGORY extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane(); return getMultiCategoryEditorPane();
} }
} }
public static class VAN_CHART_SCATTER extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_SCATTER extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane(); return getScatterValueEditorPane();
} }
} }
public static class VAN_CHART_GANNT extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_GANNT extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane(); return getGanntValueEditorPane();
} }
} }
public static class VAN_CHART_GAUGE extends ChartHyperRelateCellLinkPane.CHART_METER{ public static class VAN_CHART_GAUGE extends ChartHyperRelateCellLinkPane.CHART_METER {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MAP extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_MAP extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane(); return getMapValueEditorPane();
} }
} }
public static class VAN_CHART_LINE_MAP extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_LINE_MAP extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane(); return getLineMapValueEditorPane();
} }
} }
public static class VAN_CHART_DRILLMAPCATALOG extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane(); return getDrillMapCatalogValueEditorPane();
} }
} }
public static class VAN_CHART_MULTIPIE extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_MULTIPIE extends Chart_Cell.VAN_CHART {
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane(); return getMultiPieValueEditorPane();
} }
} }
public static class VAN_CHART_FUNNEL extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_FUNNEL extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane(); return getFunnelValueEditorPane();
} }
} }
public static class VAN_CHART_WORDCLOUD extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_WORDCLOUD extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane(); return getWordCloudValueEditorPane();
} }
} }
public static class VAN_CHART_STRUCTURE extends ChartHyperRelateCellLinkPane{ public static class VAN_CHART_STRUCTURE extends Chart_Cell.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane(); return getStructureValueEditorPane();
@ -857,76 +924,84 @@ public class HyperlinkMapFactory {
} }
//图表超链-悬浮元素 //图表超链-悬浮元素
public static class Chart_Float{ public static class Chart_Float {
public static class VAN_CHART extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART extends ChartHyperRelateFloatLinkPane {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MULTICATEGORY extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_MULTICATEGORY extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane(); return getMultiCategoryEditorPane();
} }
} }
public static class VAN_CHART_SCATTER extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_SCATTER extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane(); return getScatterValueEditorPane();
} }
} }
public static class VAN_CHART_GANNT extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_GANNT extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane(); return getGanntValueEditorPane();
} }
} }
public static class VAN_CHART_GAUGE extends ChartHyperRelateFloatLinkPane.CHART_METER{ public static class VAN_CHART_GAUGE extends ChartHyperRelateFloatLinkPane.CHART_METER {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MAP extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_MAP extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane(); return getMapValueEditorPane();
} }
} }
public static class VAN_CHART_LINE_MAP extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_LINE_MAP extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane(); return getLineMapValueEditorPane();
} }
} }
public static class VAN_CHART_DRILLMAPCATALOG extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane(); return getDrillMapCatalogValueEditorPane();
} }
} }
public static class VAN_CHART_MULTIPIE extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_MULTIPIE extends Chart_Float.VAN_CHART {
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane(); return getMultiPieValueEditorPane();
} }
} }
public static class VAN_CHART_FUNNEL extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_FUNNEL extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane(); return getFunnelValueEditorPane();
} }
} }
public static class VAN_CHART_WORDCLOUD extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_WORDCLOUD extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane(); return getWordCloudValueEditorPane();
} }
} }
public static class VAN_CHART_STRUCTURE extends ChartHyperRelateFloatLinkPane{ public static class VAN_CHART_STRUCTURE extends Chart_Float.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane(); return getStructureValueEditorPane();
@ -935,42 +1010,50 @@ public class HyperlinkMapFactory {
} }
//当前表单对象 //当前表单对象
public static class Form{ public static class Form {
public static class VAN_CHART extends FormHyperlinkPane.CHART{ public static class VAN_CHART extends FormHyperlinkPane.CHART {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MULTICATEGORY extends FormHyperlinkPane.CHART{ public static class VAN_CHART_MULTICATEGORY extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane(); return getMultiCategoryEditorPane();
} }
} }
public static class VAN_CHART_SCATTER extends FormHyperlinkPane.CHART{ public static class VAN_CHART_SCATTER extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane(); return getScatterValueEditorPane();
} }
} }
public static class VAN_CHART_GANNT extends FormHyperlinkPane.CHART{ public static class VAN_CHART_GANNT extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane(); return getGanntValueEditorPane();
} }
} }
public static class VAN_CHART_GAUGE extends FormHyperlinkPane.CHART_METER{ public static class VAN_CHART_GAUGE extends FormHyperlinkPane.CHART_METER {
@Override
protected boolean needRenamePane() {
return false;
}
} }
public static class VAN_CHART_MAP extends FormHyperlinkPane.CHART{ public static class VAN_CHART_MAP extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane(); return getMapValueEditorPane();
} }
} }
public static class VAN_CHART_LINE_MAP extends FormHyperlinkPane.CHART{ public static class VAN_CHART_LINE_MAP extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane(); return getLineMapValueEditorPane();
@ -978,34 +1061,34 @@ public class HyperlinkMapFactory {
} }
public static class VAN_CHART_DRILLMAPCATALOG extends FormHyperlinkPane.CHART{ public static class VAN_CHART_DRILLMAPCATALOG extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane(){ protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane(); return getDrillMapCatalogValueEditorPane();
} }
} }
public static class VAN_CHART_MULTIPIE extends FormHyperlinkPane.CHART{ public static class VAN_CHART_MULTIPIE extends Form.VAN_CHART {
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane(); return getMultiPieValueEditorPane();
} }
} }
public static class VAN_CHART_FUNNEL extends FormHyperlinkPane.CHART{ public static class VAN_CHART_FUNNEL extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane(); return getFunnelValueEditorPane();
} }
} }
public static class VAN_CHART_WORDCLOUD extends FormHyperlinkPane.CHART{ public static class VAN_CHART_WORDCLOUD extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane(); return getWordCloudValueEditorPane();
} }
} }
public static class VAN_CHART_STRUCTURE extends FormHyperlinkPane.CHART{ public static class VAN_CHART_STRUCTURE extends Form.VAN_CHART {
@Override @Override
protected ValueEditorPane getValueEditorPane() { protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane(); return getStructureValueEditorPane();

2
designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java

@ -30,7 +30,7 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte
public void populateBean(Plot plot, ConditionCollection collection, Class<? extends ConditionAttributesPane> showPane){ public void populateBean(Plot plot, ConditionCollection collection, Class<? extends ConditionAttributesPane> showPane){
if (conditionPane == null) { if (conditionPane == null) {
conditionPane = new VanChartListControlPane(plot); conditionPane = new VanChartConditionListControlPane(plot);
} }
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());

20
designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java → designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionListControlPane.java

@ -8,11 +8,9 @@ import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.designer.component.VanChartUIListControlPane;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
@ -20,10 +18,11 @@ import java.lang.reflect.InvocationTargetException;
/** /**
* Created by mengao on 2017/8/18. * Created by mengao on 2017/8/18.
* 条件属性ListControlPane弹出条件属性设置面板
*/ */
public class VanChartListControlPane extends UIListControlPane { public class VanChartConditionListControlPane extends VanChartUIListControlPane {
public VanChartListControlPane(BasePlot plot) { public VanChartConditionListControlPane(BasePlot plot) {
super(plot); super(plot);
} }
@ -57,14 +56,6 @@ public class VanChartListControlPane extends UIListControlPane {
return null; return null;
} }
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
updateConditionCollection(((VanChartPlot) plot).getConditionCollection());
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override @Override
public String getAddItemText() { public String getAddItemText() {
@ -80,7 +71,8 @@ public class VanChartListControlPane extends UIListControlPane {
/** /**
* Update. * Update.
*/ */
public void updateConditionCollection(ConditionCollection cc) { protected void update(Plot plot) {
ConditionCollection cc = plot.getConditionCollection();
Nameable[] nameables = this.update(); Nameable[] nameables = this.update();
cc.clearConditionAttr(); cc.clearConditionAttr();

17
designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java

@ -3,16 +3,14 @@ package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.DefaultAxisHelper; import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis; 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.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.designer.component.VanChartUIListControlPane;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.util.ArrayList; import java.util.ArrayList;
@ -20,18 +18,9 @@ import java.util.List;
/** /**
* Created by mengao on 2017/8/22. * Created by mengao on 2017/8/22.
* 自定义警戒线列表面板
*/ */
public class AlertLineListControlPane extends UIListControlPane { public class AlertLineListControlPane extends VanChartUIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override @Override
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {

22
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java

@ -3,8 +3,6 @@ package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
@ -12,8 +10,8 @@ import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartCustomIntervalBackground; import com.fr.plugin.chart.attr.axis.VanChartCustomIntervalBackground;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.designer.component.VanChartUIListControlPane;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,17 +19,9 @@ import java.util.List;
/** /**
* Created by mengao on 2017/8/22. * Created by mengao on 2017/8/22.
* 自定义间隔背景列表面板
*/ */
public class BackgroundListControlPane extends UIListControlPane { public class BackgroundListControlPane extends VanChartUIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot, false);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override @Override
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
@ -92,6 +82,12 @@ public class BackgroundListControlPane extends UIListControlPane {
doLayout(); doLayout();
} }
@Override
protected void update(Plot plot) {
update(plot, false);
}
public void update(Plot plot, boolean isDefaultIntervalBackground) { public void update(Plot plot, boolean isDefaultIntervalBackground) {
Nameable[] nameables = this.update(); Nameable[] nameables = this.update();

6
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java

@ -81,7 +81,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
} }
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")}); isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Default_Interval"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")});
horizontalColorBackground = new ColorSelectBox(100); horizontalColorBackground = new ColorSelectBox(100);
verticalColorBackground = new ColorSelectBox(100); verticalColorBackground = new ColorSelectBox(100);
Component[][] components = getIntervalPaneComponents(); Component[][] components = getIntervalPaneComponents();
@ -90,7 +90,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
cardLayout = new CardLayout(); cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout); centerPane = new JPanel(cardLayout);
centerPane.add(defaultPane, Inter.getLocText("Plugin-ChartF_IntervalBackground")); centerPane.add(defaultPane, Inter.getLocText("Plugin-ChartF_Default_Interval"));
centerPane.add(customIntervalBackground, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")); centerPane.add(customIntervalBackground, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"));
isDefaultIntervalBackground.addActionListener(new ActionListener() { isDefaultIntervalBackground.addActionListener(new ActionListener() {
@Override @Override
@ -117,7 +117,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private void checkCardPane() { private void checkCardPane() {
if (isDefaultIntervalBackground.getSelectedIndex() == 0) { if (isDefaultIntervalBackground.getSelectedIndex() == 0) {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground")); cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_Default_Interval"));
} else { } else {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")); cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"));
} }

1
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java

@ -38,6 +38,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
// //
JPanel top = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel top = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.removeAll();
this.add(top); this.add(top);
top.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Plugin-ChartF_CustomIntervalBackground") + ":", null)); top.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Plugin-ChartF_CustomIntervalBackground") + ":", null));
top.add(createContentPane()); top.add(createContentPane());

20
designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -29,7 +29,6 @@ import com.fr.plugin.chart.custom.style.VanChartCustomStylePane;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.VanChartAreaSeriesFillColorPane; import com.fr.plugin.chart.designer.component.VanChartAreaSeriesFillColorPane;
import com.fr.plugin.chart.designer.component.VanChartBeautyPane; import com.fr.plugin.chart.designer.component.VanChartBeautyPane;
import com.fr.plugin.chart.designer.component.VanChartFillStylePane;
import com.fr.plugin.chart.designer.component.VanChartLineTypePane; import com.fr.plugin.chart.designer.component.VanChartLineTypePane;
import com.fr.plugin.chart.designer.component.VanChartMarkerPane; import com.fr.plugin.chart.designer.component.VanChartMarkerPane;
import com.fr.plugin.chart.designer.component.VanChartTrendLinePane; import com.fr.plugin.chart.designer.component.VanChartTrendLinePane;
@ -96,31 +95,30 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
* 返回 填充界面. * 返回 填充界面.
*/ */
protected ChartFillStylePane getFillStylePane() { protected ChartFillStylePane getFillStylePane() {
return new VanChartFillStylePane(); //如果是自定義組合圖,則不創建填充界面
return parentPane instanceof VanChartCustomStylePane ? null : new ChartFillStylePane();
} }
//风格 //风格
protected VanChartBeautyPane createStylePane() { protected VanChartBeautyPane createStylePane() {
stylePane = new VanChartBeautyPane(); return parentPane instanceof VanChartCustomStylePane ? null : new VanChartBeautyPane();
return stylePane;
} }
//获取色面板 //获取色面板
protected JPanel getColorPane () { protected JPanel getColorPane () {
//如果是自定義組合圖,則不創建色彩界面
if (parentPane instanceof VanChartCustomStylePane) {
return null;
}
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
stylePane = createStylePane();
setColorPaneContent(panel); setColorPaneContent(panel);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Color"), panel); JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Color"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0)); panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0));
return colorPane; return panel.getComponentCount() == 0 ? null : colorPane;
} }
//设置色彩面板内容 //设置色彩面板内容
protected void setColorPaneContent (JPanel panel) { protected void setColorPaneContent (JPanel panel) {
panel.add(createStylePane(), BorderLayout.CENTER); if (stylePane != null) {
panel.add(stylePane, BorderLayout.CENTER);
}
} }
//趋势线 //趋势线

2
designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java

@ -42,7 +42,9 @@ public class VanChartFunnelSeriesPane extends VanChartAbstractPlotSeriesPane {
//设置色彩面板内容 //设置色彩面板内容
protected void setColorPaneContent (JPanel panel) { protected void setColorPaneContent (JPanel panel) {
if (stylePane != null) {
panel.add(createStylePane(), BorderLayout.CENTER); panel.add(createStylePane(), BorderLayout.CENTER);
}
panel.add(createAlphaPane(), BorderLayout.SOUTH); panel.add(createAlphaPane(), BorderLayout.SOUTH);
} }

92
designer_form/src/com/fr/design/designer/creator/CRPropertyDescriptorPane.java

@ -0,0 +1,92 @@
package com.fr.design.designer.creator;
import com.fr.base.FRContext;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.xtable.TableUtils;
import com.fr.design.mainframe.widget.editors.ExtendedPropertyEditor;
import com.fr.design.mainframe.widget.editors.StringEditor;
import com.fr.form.ui.Widget;
import java.awt.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyEditor;
import java.lang.reflect.Method;
/**
* Created by kerry on 2017/9/6.
*/
public class CRPropertyDescriptorPane {
private CRPropertyDescriptor crPropertyDescriptor;
private XCreator xCreator;
private PropertyEditor propertyEditor;
public CRPropertyDescriptorPane(CRPropertyDescriptor crPropertyDescriptor, XCreator xCreator) {
this.crPropertyDescriptor = crPropertyDescriptor;
this.xCreator = xCreator;
}
public Component[] createTableLayoutComponent() {
return new Component[]{new UILabel(crPropertyDescriptor.getDisplayName()), initEditorComponent(crPropertyDescriptor, xCreator)};
}
private Component initEditorComponent(CRPropertyDescriptor crPropertyDescriptor, final XCreator xCreator) {
Component component = null;
try {
// 如果已有的编辑器就生成对应的component
Class<?> editorClass = crPropertyDescriptor.getPropertyEditorClass();
if (editorClass != null) {
propertyEditor = initExtendEditor(crPropertyDescriptor, xCreator);
component = propertyEditor.getCustomEditor();
} else {
Class propType = crPropertyDescriptor.getPropertyType();
Class<? extends PropertyEditor> defaultEditorClass = TableUtils.getPropertyEditorClass(propType);
if (defaultEditorClass == null) {
defaultEditorClass = StringEditor.class;
}
propertyEditor = defaultEditorClass.newInstance();
component = propertyEditor.getCustomEditor();
}
propertyEditor.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
update(xCreator.toData());
}
});
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
return component;
}
private PropertyEditor initExtendEditor(CRPropertyDescriptor crPropertyDescriptor, XCreator xCreator) throws Exception {
ExtendedPropertyEditor editor = (ExtendedPropertyEditor) crPropertyDescriptor.createPropertyEditor(xCreator.toData());
if (editor == null) {
Class propType = crPropertyDescriptor.getPropertyType();
editor = TableUtils.getPropertyEditorClass(propType).newInstance();
}
return editor;
}
public void populate(Widget widget) {
try {
Method m = crPropertyDescriptor.getReadMethod();
Object value = m.invoke(widget);
propertyEditor.setValue(value);
} catch (Exception e) {
}
}
public void update(Widget widget) {
try {
Method m = crPropertyDescriptor.getWriteMethod();
m.invoke(widget, propertyEditor.getValue());
} catch (Exception e) {
}
}
}

71
designer_form/src/com/fr/design/designer/creator/PropertyGroupPane.java

@ -0,0 +1,71 @@
package com.fr.design.designer.creator;
import com.fr.base.FRContext;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.FreeButton;
import com.fr.form.ui.Widget;
import javax.swing.*;
import java.awt.*;
/**
* Created by kerry on 2017/9/7.
*/
public class PropertyGroupPane extends BasicPane {
private CRPropertyDescriptor[] crPropertyDescriptors;
private CRPropertyDescriptorPane[] crPropertyDescriptorPanes;
private XCreator xCreator;
public PropertyGroupPane(CRPropertyDescriptor[] crPropertyDescriptors, XCreator xCreator) {
this.crPropertyDescriptors = crPropertyDescriptors;
this.xCreator = xCreator;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
initComponent();
}
public void initComponent() {
int count = crPropertyDescriptors.length;
crPropertyDescriptorPanes = new CRPropertyDescriptorPane[count];
Component[][] components = new Component[count][];
for (int i = 0; i < count; i++) {
crPropertyDescriptorPanes[i] = new CRPropertyDescriptorPane(crPropertyDescriptors[i], xCreator);
components[i] = crPropertyDescriptorPanes[i].createTableLayoutComponent();
}
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
this.add(panel, BorderLayout.CENTER);
}
public void populate(Widget widget){
for(int i = 0; i< crPropertyDescriptorPanes.length; i++){
crPropertyDescriptorPanes[i].populate(widget);
}
}
@Override
protected String title4PopupWindow() {
return "PropertyGroupPane";
}
public static void main(String[] args) {
try{
XCreator xCreator = new XButton(new FreeButton(),new Dimension(100, 100));
PropertyGroupPane propertyGroupPane = new PropertyGroupPane(xCreator.supportedDescriptor(), xCreator);
JFrame jf = new JFrame("jFrame");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
content.add(propertyGroupPane, BorderLayout.CENTER);
jf.setSize(439, 400);
jf.setVisible(true);
}catch (Exception e){
FRContext.getLogger().error(e.getMessage());
}
}
}

14
designer_form/src/com/fr/design/designer/creator/XCreator.java

@ -227,7 +227,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
} }
protected String getIconName() { protected String getIconName() {
return ""; return StringUtils.EMPTY;
} }
public String getIconPath() { public String getIconPath() {
@ -472,13 +472,11 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
selectionModel.selectACreatorAtMouseEvent(e); selectionModel.selectACreatorAtMouseEvent(e);
} }
if (editingMouseListener.stopEditing()) { if (editingMouseListener.stopEditing() && this != designer.getRootComponent()) {
if (this != designer.getRootComponent()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this);
editingMouseListener.startEditing(this, adapter.getDesignerEditor(), adapter); editingMouseListener.startEditing(this, adapter.getDesignerEditor(), adapter);
} }
} }
}
/** /**
* 删除相关组件 * 删除相关组件
@ -642,4 +640,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
this.data = data; this.data = data;
} }
/**
* data属性改变触发其他操作
*
*/
public void firePropertyChange(){
}
} }

32
designer_form/src/com/fr/design/designer/creator/XDateEditor.java

@ -41,13 +41,14 @@ public class XDateEditor extends XDirectWriteEditor {
/** /**
* 控件的属性列表 * 控件的属性列表
*
* @return 此控件所用的属性列表 * @return 此控件所用的属性列表
* @throws IntrospectionException 异常 * @throws IntrospectionException 异常
*/ */
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor [] tempt=(CRPropertyDescriptor[]) ArrayUtils.addAll( CRPropertyDescriptor[] tempt = (CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] { new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass( Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
@ -57,9 +58,9 @@ public class XDateEditor extends XDirectWriteEditor {
public void propertyChange() { public void propertyChange() {
initFieldText(); initFieldText();
} }
})},super.supportedDescriptor()); })}, super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(tempt, return (CRPropertyDescriptor[]) ArrayUtils.addAll(tempt,
new CRPropertyDescriptor[] { new CRPropertyDescriptor[]{
new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName( new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass( Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass(
DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
@ -93,12 +94,12 @@ public class XDateEditor extends XDirectWriteEditor {
//格式 //格式
String format = dateEditor.getFormatText(); String format = dateEditor.getFormatText();
if(value instanceof Date){ if (value instanceof Date) {
valueStr = DateUtils.getDate2Str(format, (Date) value); valueStr = DateUtils.getDate2Str(format, (Date) value);
} }
//日期控件默认值 //日期控件默认值
if(StringUtils.isEmpty(valueStr)){ if (StringUtils.isEmpty(valueStr)) {
valueStr = DateUtils.getDate2Str(format, new Date()); valueStr = DateUtils.getDate2Str(format, new Date());
dateEditor.setWidgetValue(new WidgetValue(new Date())); dateEditor.setWidgetValue(new WidgetValue(new Date()));
} }
@ -118,7 +119,7 @@ public class XDateEditor extends XDirectWriteEditor {
if (editor == null) { if (editor == null) {
editor = FRGUIPaneFactory.createBorderLayout_S_Pane(); editor = FRGUIPaneFactory.createBorderLayout_S_Pane();
editor.add(textField = new UITextField(5), BorderLayout.CENTER); editor.add(textField = new UITextField(5), BorderLayout.CENTER);
btn = new LimpidButton("", this.getIconPath(), toData().isVisible() ? FULL_OPACITY : HALF_OPACITY); btn = new LimpidButton(StringUtils.EMPTY, this.getIconPath(), toData().isVisible() ? FULL_OPACITY : HALF_OPACITY);
btn.setPreferredSize(new Dimension(21, 21)); btn.setPreferredSize(new Dimension(21, 21));
editor.add(btn, BorderLayout.EAST); editor.add(btn, BorderLayout.EAST);
textField.setOpaque(false); textField.setOpaque(false);
@ -140,14 +141,10 @@ public class XDateEditor extends XDirectWriteEditor {
* 获取当前XCreator的一个封装父容器 * 获取当前XCreator的一个封装父容器
* *
* @param widgetName 当前组件名 * @param widgetName 当前组件名
*
* @return 封装的父容器 * @return 封装的父容器
*
*
* @date 2014-11-25-下午4:47:23 * @date 2014-11-25-下午4:47:23
*
*/ */
protected XLayoutContainer getCreatorWrapper(String widgetName){ protected XLayoutContainer getCreatorWrapper(String widgetName) {
return new XWScaleLayout(); return new XWScaleLayout();
} }
@ -155,12 +152,9 @@ public class XDateEditor extends XDirectWriteEditor {
* 将当前对象添加到父容器中 * 将当前对象添加到父容器中
* *
* @param parentPanel 父容器组件 * @param parentPanel 父容器组件
*
*
* @date 2014-11-25-下午4:57:55 * @date 2014-11-25-下午4:57:55
*
*/ */
protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight){ protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight) {
this.setSize(width, minHeight); this.setSize(width, minHeight);
parentPanel.add(this); parentPanel.add(this);
} }
@ -175,4 +169,10 @@ public class XDateEditor extends XDirectWriteEditor {
return true; return true;
} }
/**
* data属性改变触发其他操作
*/
public void firePropertyChange() {
initFieldText();
}
} }

18
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -104,10 +104,15 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
.setI18NName(Inter.getLocText("Form-EC_toolbar")) .setI18NName(Inter.getLocText("Form-EC_toolbar"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
}; };
propertyTableEditor = resolveCompatible(propertyTableEditor); CRPropertyDescriptor[] extraTableEditor = getExtraTableEditor();
return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraTableEditor);
}
public CRPropertyDescriptor[] getExtraTableEditor(){
CRPropertyDescriptor[] extraTableEditor = resolveCompatible();
FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING); FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING);
if (processor == null) { if (processor == null) {
return propertyTableEditor; return extraTableEditor;
} }
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
FitProvider wbTpl = (FitProvider) designer.getTarget(); FitProvider wbTpl = (FitProvider) designer.getTarget();
@ -122,11 +127,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
if (editor.getReportFitAttr() == null) { if (editor.getReportFitAttr() == null) {
editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); editor.setReportFitInPc(processor.getFitStateInPC(fitAttr));
} }
return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); return (CRPropertyDescriptor[]) ArrayUtils.addAll(extraTableEditor, extraEditor);
} }
private CRPropertyDescriptor[] resolveCompatible (CRPropertyDescriptor[] propertyTableEditor) { private CRPropertyDescriptor[] resolveCompatible() {
CRPropertyDescriptor[] extraProperty = new CRPropertyDescriptor[0];
//这边有个插件兼容问题,之后还是要改回process才行 //这边有个插件兼容问题,之后还是要改回process才行
Set<FormElementCaseEditorProvider> set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); Set<FormElementCaseEditorProvider> set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING);
for (FormElementCaseEditorProvider provider : set) { for (FormElementCaseEditorProvider provider : set) {
@ -137,9 +143,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
FormProvider formProvider = designer.getTarget(); FormProvider formProvider = designer.getTarget();
ElementCaseEditorProvider elementCaseEditorProvider = this.toData(); ElementCaseEditorProvider elementCaseEditorProvider = this.toData();
PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider); PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider);
propertyTableEditor = (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraEditor); extraProperty = (CRPropertyDescriptor[]) ArrayUtils.addAll(extraProperty, extraEditor);
} }
return propertyTableEditor; return extraProperty;
} }
@Override @Override

9
designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java

@ -161,4 +161,13 @@ public class XWScaleLayout extends DedicateLayoutContainer {
public boolean supportSetVisibleOrEnable(){ public boolean supportSetVisibleOrEnable(){
return true; return true;
} }
/**
* data属性改变触发其他操作
*
*/
public void firePropertyChange(){
XCreator child = getXCreator(INDEX);
child.firePropertyChange();
}
} }

18
designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -536,4 +536,22 @@ public class XWTabFitLayout extends XWFitLayout {
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[0]; return new WidgetPropertyUIProvider[0];
} }
public void firePropertyChange(){
checkButonType();
initialBackground = ((WTabFitLayout) data).getInitialBackground();
overBackground = ((WTabFitLayout) data).getOverBackground();
clickBackground = ((WTabFitLayout)data).getClickBackground();
CardSwitchButton cardSwitchButton = (CardSwitchButton) xCardSwitchButton.toData();
if(initialBackground != null){
xCardSwitchButton.setSelectBackground(initialBackground);
cardSwitchButton.setInitialBackground(initialBackground);
}
if(overBackground != null){
cardSwitchButton.setOverBackground(overBackground);
}
if(clickBackground != null){
cardSwitchButton.setClickBackground(clickBackground);
}
}
} }

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

@ -1,6 +1,7 @@
package com.fr.design.mainframe.widget.ui; package com.fr.design.mainframe.widget.ui;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
@ -19,6 +20,7 @@ import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -135,6 +137,8 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
jPanel.add(attriCardPane, BorderLayout.CENTER); jPanel.add(attriCardPane, BorderLayout.CENTER);
this.listener = new AttributeChangeListener() { this.listener = new AttributeChangeListener() {
@ -148,19 +152,12 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
private void initDefinePane() { private void initDefinePane() {
currentEditorDefinePane = null; currentEditorDefinePane = null;
XCreator creator = xCreator; boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class);
if (xCreator.acceptType(XWScaleLayout.class)) { XCreator creator = dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator;
if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) {
creator = (XCreator) xCreator.getComponent(0);
}
}
if(xCreator.acceptType(XWTitleLayout.class)){
creator = (XCreator) xCreator.getComponent(0);
}
FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, creator.toData(), new Operator() { FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, creator.toData(), new Operator() {
@Override @Override
public void did(DataCreatorUI ui, String cardName) { public void did(DataCreatorUI ui, String cardName) {
//todo
} }
}); });
DataModify<Widget> definePane = rn.getDefinePane(); DataModify<Widget> definePane = rn.getDefinePane();
@ -188,7 +185,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (cellWidget.acceptType(WScaleLayout.class)) { if (cellWidget.acceptType(WScaleLayout.class)) {
Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget(); Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget();
innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget(); innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget();
} else if(cellWidget.acceptType(WTitleLayout.class)){ } else if (cellWidget.acceptType(WTitleLayout.class)) {
CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget(); CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget();
innerWidget = crBoundsWidget.getWidget(); innerWidget = crBoundsWidget.getWidget();
} }
@ -205,6 +202,8 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (widgetBoundPane != null) { if (widgetBoundPane != null) {
widgetBoundPane.update(); widgetBoundPane.update();
} }
xCreator.resetCreatorName(widget.getWidgetName());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
fireValueChanged(); fireValueChanged();
} }
@ -218,12 +217,13 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
} }
public void fireValueChanged() { public void fireValueChanged() {
designer.repaint(); xCreator.firePropertyChange();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); designer.fireTargetModified();
designer.refreshDesignerUI();
} }
public String getIconPath() { public String getIconPath() {
return ""; return StringUtils.EMPTY;
} }

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

@ -2,6 +2,7 @@ package com.fr.design.parameter;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
@ -51,7 +52,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane); UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, advancePane);
this.add(advanceExpandablePane, BorderLayout.NORTH); this.add(advanceExpandablePane, BorderLayout.NORTH);
JPanel layoutPane = createBoundsPane(); JPanel layoutPane = createBoundsPane();
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("Size"), 280, 20, layoutPane); UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Size"), 280, 20, layoutPane);
this.add(layoutExpandablePane, BorderLayout.CENTER); this.add(layoutExpandablePane, BorderLayout.CENTER);
} }
@ -65,7 +66,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Form-Desin_Width")), designerWidth}, new Component[]{new UILabel(Inter.getLocText("Form-Desin_Width")), designerWidth},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
jPanel.add(panel); jPanel.add(panel);
@ -97,8 +98,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
new Component[]{useParamsTemplate, null}, new Component[]{useParamsTemplate, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane} new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
jPanel.add(panel); jPanel.add(panel);
return jPanel; return jPanel;
} }
@ -115,7 +116,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
displayReport.setSelected(ob.isDelayDisplayContent()); displayReport.setSelected(ob.isDelayDisplayContent());
useParamsTemplate.setSelected(ob.isUseParamsTemplate()); useParamsTemplate.setSelected(ob.isUseParamsTemplate());
designerWidth.setValue(ob.getDesignWidth()); designerWidth.setValue(ob.getDesignWidth());
hAlignmentPane.setSelectedIndex(ob.getPosition()); hAlignmentPane.setSelectedItem(ob.getPosition());
} }
@ -129,7 +130,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
jTemplate.needAddTemplateId(useParamsTemplate.isSelected()); jTemplate.needAddTemplateId(useParamsTemplate.isSelected());
wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setBackground((Background) background.getValue());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); wParameterLayout.setPosition((int)hAlignmentPane.getSelectedItem());
return wParameterLayout; return wParameterLayout;
} }

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

@ -44,12 +44,12 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background")); UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background"));
backgroundLabel.setVerticalAlignment(SwingConstants.TOP); backgroundLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] n_components = { Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField}, {new UILabel(Inter.getLocText("FR-Designer_Button-Name")), buttonNameTextField},
{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, {new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
backgroundCompPane, backgroundCompPane,
frFont, frFont,
{new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane}, {new UILabel(Inter.getLocText("FR-Designer_Icon")), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField} {new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys")), hotkeysTextField}
}; };
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ",")); hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, 10, 10);

93
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDictPane.java

@ -1,93 +0,0 @@
package com.fr.design.widget.ui.designer;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.CheckBoxGroup;
import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class CheckBoxDictPane extends JPanel {
private DictionaryComboBox delimiterComboBox;
private UIComboBox returnTypeComboBox;
private DictionaryComboBox startComboBox;
private DictionaryComboBox endComboBox;
private JPanel delimiterPane;
private JPanel startPane;
private JPanel endPane;
public CheckBoxDictPane() {
JPanel returnTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIComboBox(new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")});
returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER);
this.add(returnTypePane);
delimiterPane =FRGUIPaneFactory.createBorderLayout_S_Pane();
UILabel label = new UILabel(Inter.getLocText("Form-Delimiter") + ":");
delimiterPane.add(label, BorderLayout.WEST);
delimiterPane.add(delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays), BorderLayout.CENTER);
delimiterComboBox.setEditable(true);
this.add(delimiterPane);
startPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
startPane.add(new UILabel(Inter.getLocText("ComboCheckBox-Start_Symbol") + ":"), BorderLayout.WEST);
startPane.add(startComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER);
startComboBox.setEditable(true);
this.add(startPane);
endPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
endPane.add(new UILabel(Inter.getLocText("ComboCheckBox-End_Symbol") + ":"), BorderLayout.WEST);
endPane.add(endComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays), BorderLayout.CENTER);
endComboBox.setEditable(true);
this.add(endPane);
returnTypeComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
checkVisible();
}
});
}
private void checkVisible(){
delimiterPane.setVisible(returnTypeComboBox.getSelectedIndex() == 1);
startPane.setVisible(returnTypeComboBox.getSelectedIndex() == 1);
endPane.setVisible(returnTypeComboBox.getSelectedIndex() == 1);
}
public void populate(ComboCheckBox comboCheckBox) {
this.delimiterComboBox.setSelectedItem(comboCheckBox.getDelimiter());
this.returnTypeComboBox.setSelectedIndex(comboCheckBox.isReturnString() ? 1 : 0);
this.startComboBox.setSelectedItem(comboCheckBox.getStartSymbol());
this.endComboBox.setSelectedItem(comboCheckBox.getEndSymbol());
checkVisible();
}
public void update(ComboCheckBox comboCheckBox) {
comboCheckBox.setDelimiter((String)this.delimiterComboBox.getSelectedItem());
comboCheckBox.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0);
comboCheckBox.setStartSymbol((String)this.startComboBox.getSelectedItem());
comboCheckBox.setEndSymbol((String)this.endComboBox.getSelectedItem());
}
public void populate(CheckBoxGroup checkBoxGroup) {
this.delimiterComboBox.setSelectedItem(checkBoxGroup.getDelimiter());
this.returnTypeComboBox.setSelectedIndex(checkBoxGroup.isReturnString() ? 1 : 0);
this.startComboBox.setSelectedItem(checkBoxGroup.getStartSymbol());
this.endComboBox.setSelectedItem(checkBoxGroup.getEndSymbol());
checkVisible();
}
public void update(CheckBoxGroup checkBoxGroup) {
checkBoxGroup.setDelimiter((String)this.delimiterComboBox.getSelectedItem());
checkBoxGroup.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0);
checkBoxGroup.setStartSymbol((String)this.startComboBox.getSelectedItem());
checkBoxGroup.setEndSymbol((String)this.endComboBox.getSelectedItem());
}
}

17
designer_form/src/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -2,13 +2,11 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane; import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -18,7 +16,7 @@ import java.awt.*;
public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> { public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane; private DictionaryPane dictPane;
private UIButtonGroup returnType; private CheckBoxDictPane checkBoxDictPane;
private UICheckBox checkbox; private UICheckBox checkbox;
public CheckBoxGroupDefinePane(XCreator xCreator) { public CheckBoxGroupDefinePane(XCreator xCreator) {
@ -42,15 +40,12 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){ public JPanel createOtherPane(){
checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"})); checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")}; checkBoxDictPane = new CheckBoxDictPane();
returnType = new UIButtonGroup(tabTitles);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{checkbox, null }, new Component[]{checkbox, null },
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnType}, new Component[]{checkBoxDictPane, null},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -62,7 +57,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected void populateSubButtonGroupBean(CheckBoxGroup ob) { protected void populateSubButtonGroupBean(CheckBoxGroup ob) {
returnType.setSelectedIndex(ob.isReturnString() ? 1 : 0); this.checkBoxDictPane.populate(ob);
this.dictPane.populateBean(ob.getDictionary()); this.dictPane.populateBean(ob.getDictionary());
checkbox.setSelected(ob.isChooseAll()); checkbox.setSelected(ob.isChooseAll());
} }
@ -72,7 +67,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected CheckBoxGroup updateSubButtonGroupBean() { protected CheckBoxGroup updateSubButtonGroupBean() {
CheckBoxGroup ob = (CheckBoxGroup) creator.toData(); CheckBoxGroup ob = (CheckBoxGroup) creator.toData();
ob.setReturnString(returnType.getSelectedIndex() == 1); checkBoxDictPane.update(ob);
ob.setDictionary(this.dictPane.updateBean()); ob.setDictionary(this.dictPane.updateBean());
ob.setChooseAll(checkbox.isSelected()); ob.setChooseAll(checkbox.isSelected());
return ob; return ob;

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

@ -2,12 +2,12 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -16,7 +16,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
private UIButtonGroup returnType; private CheckBoxDictPane checkBoxDictPane;
private UITextField waterMarkDictPane; private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
@ -38,15 +38,13 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public JPanel createOtherPane(){ public JPanel createOtherPane(){
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true); supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
checkBoxDictPane = new CheckBoxDictPane();
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIButtonGroup(tabTitles) ;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{supportTagCheckBox, null }, new Component[]{supportTagCheckBox, null },
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnType}, new Component[]{checkBoxDictPane, null},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -57,7 +55,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
} }
protected void populateSubDictionaryEditorBean(ComboCheckBox ob){ protected void populateSubDictionaryEditorBean(ComboCheckBox ob){
returnType.setSelectedIndex(ob.isReturnString() ? 1 : 0); this.checkBoxDictPane.populate(ob);
waterMarkDictPane.setText(ob.getWaterMark()); waterMarkDictPane.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob); formWidgetValuePane.populate(ob);
this.supportTagCheckBox.setSelected(ob.isSupportTag()); this.supportTagCheckBox.setSelected(ob.isSupportTag());
@ -66,7 +64,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
protected ComboCheckBox updateSubDictionaryEditorBean(){ protected ComboCheckBox updateSubDictionaryEditorBean(){
ComboCheckBox combo = (ComboCheckBox) creator.toData(); ComboCheckBox combo = (ComboCheckBox) creator.toData();
combo.setReturnString(returnType.getSelectedIndex() == 1); checkBoxDictPane.update(combo);
formWidgetValuePane.update(combo); formWidgetValuePane.update(combo);
combo.setWaterMark(waterMarkDictPane.getText()); combo.setWaterMark(waterMarkDictPane.getText());
combo.setSupportTag(this.supportTagCheckBox.isSelected()); combo.setSupportTag(this.supportTagCheckBox.isSelected());

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

@ -5,10 +5,8 @@ import com.fr.base.Formula;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
@ -22,6 +20,8 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.UtilEvalError; import com.fr.stable.UtilEvalError;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -34,10 +34,9 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private DateValuePane endDv; private DateValuePane endDv;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
private UISpinner fontSizePane;
private UIComboBox currentFormatComboBox; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel; private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup; private UIButtonGroup fomatHeadGroup;
public DateEditorDefinePane(XCreator xCreator) { public DateEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -53,7 +52,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
fontSizePane = new UISpinner(0, 20, 1, 0);
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST); returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}); returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")});
@ -125,8 +123,11 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
customPane.add(dateFormatPane, Inter.getLocText("StyleFormat-Date")); customPane.add(dateFormatPane, Inter.getLocText("StyleFormat-Date"));
customPane.add(timeFormatPane, Inter.getLocText("StyleFormat-Time")); customPane.add(timeFormatPane, Inter.getLocText("StyleFormat-Time"));
final String[] tabTitles = new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")}; final String[] tabTitles = new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")};
fomatHeadGroup = new UIHeadGroup(new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")}){ fomatHeadGroup = new UIButtonGroup(new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")});
protected void tabChanged(int newSelectedIndex) { fomatHeadGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int newSelectedIndex = fomatHeadGroup.getSelectedIndex();
cardLayout.show(customPane, tabTitles[newSelectedIndex]); cardLayout.show(customPane, tabTitles[newSelectedIndex]);
if(newSelectedIndex == 0){ if(newSelectedIndex == 0){
currentFormatComboBox = dateFormatComboBox; currentFormatComboBox = dateFormatComboBox;
@ -137,7 +138,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
refreshPreviewLabel(); refreshPreviewLabel();
} }
}; });
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH); fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER); fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane; return fomatHeadPane;
@ -172,6 +173,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected void populateSubDirectWriteEditorBean(DateEditor e) { protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText(); String formatText = e.getFormatText();
fomatHeadGroup.setSelectedIndex(getDateType(e)); fomatHeadGroup.setSelectedIndex(getDateType(e));
fomatHeadGroup.populateBean();
currentFormatComboBox.setSelectedItem(formatText); currentFormatComboBox.setSelectedItem(formatText);
waterMarkDictPane.populate(e); waterMarkDictPane.populate(e);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1); returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1);

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

@ -1,5 +1,7 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -105,37 +107,25 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() { protected void addValidatePane() {
initErrorMsgPane(); initErrorMsgPane();
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")); final UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip"));
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
borderPane.add(errorTipPane, BorderLayout.CENTER);
allowBlankCheckBox.addItemListener(new ItemListener() { allowBlankCheckBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
boolean isSelected = allowBlankCheckBox.isSelected(); boolean isSelected = allowBlankCheckBox.isSelected();
uiLabel.setVisible(!isSelected); errorTipPane.setVisible(!isSelected);
errorMsgTextField.setVisible(!isSelected);
if (isSelected) {
uiLabel.setPreferredSize(new Dimension(0, 0));
errorMsgTextField.setPreferredSize(new Dimension(0, 0));
} else {
uiLabel.setPreferredSize(new Dimension(66, 20));
errorMsgTextField.setPreferredSize(new Dimension(150, 20));
}
} }
}); });
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox, null}, new Component[]{allowBlankCheckBox},
new Component[]{uiLabel, errorMsgTextField}, new Component[]{borderPane},
}; };
double[] rowSize = {p, p}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L6);
double[] columnSize = {p, f}; panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 5, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
validatePane.add(panel, BorderLayout.NORTH); validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane(); JPanel contentPane = this.setValidatePane();
if (contentPane != null) { if (contentPane != null) {

20
designer_form/src/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java

@ -3,6 +3,7 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.FRFontPane; import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.component.ButtonBackgroundPane; import com.fr.design.widget.component.ButtonBackgroundPane;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.general.FRFont; import com.fr.general.FRFont;
@ -17,6 +18,7 @@ import java.awt.*;
public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> { public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
private ButtonBackgroundPane backgroundCompPane; private ButtonBackgroundPane backgroundCompPane;
private FRFontPane frFontPane; private FRFontPane frFontPane;
private UILabel fontLabel;
public FreeButtonDefinePane(XCreator xcreator) { public FreeButtonDefinePane(XCreator xcreator) {
super(xcreator); super(xcreator);
@ -24,29 +26,41 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
public Component[] createBackgroundComp() { public Component[] createBackgroundComp() {
backgroundCompPane = new ButtonBackgroundPane(); backgroundCompPane = new ButtonBackgroundPane();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane}; return new Component[]{backgroundCompPane,null};
} }
public Component[] createFontPane() { public Component[] createFontPane() {
UILabel fontLabel = new UILabel(Inter.getLocText("FR-Designer_Font")); JPanel fontLabelPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
fontLabel = new UILabel(Inter.getLocText("FR-Designer_Font"));
fontLabelPanel.add(fontLabel, BorderLayout.CENTER);
fontLabel.setVerticalAlignment(SwingConstants.TOP); fontLabel.setVerticalAlignment(SwingConstants.TOP);
frFontPane = new FRFontPane(); frFontPane = new FRFontPane();
return new Component[]{fontLabel, frFontPane}; JPanel fontPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
fontPanel.add(frFontPane, BorderLayout.CENTER);
return new Component[]{fontLabelPanel, fontPanel};
} }
public void populateSubButtonPane(FreeButton e) { public void populateSubButtonPane(FreeButton e) {
backgroundCompPane.populate(e); backgroundCompPane.populate(e);
frFontPane.setVisible(e.isCustomStyle());
fontLabel.setVisible(e.isCustomStyle());
if(e.isCustomStyle()){
FRFont frFont = e.getFont(); FRFont frFont = e.getFont();
if (frFont != null) { if (frFont != null) {
frFontPane.populateBean(e.getFont()); frFontPane.populateBean(e.getFont());
} }
} }
}
public FreeButton updateSubButtonPane() { public FreeButton updateSubButtonPane() {
FreeButton freeButton = (FreeButton) creator.toData(); FreeButton freeButton = (FreeButton) creator.toData();
backgroundCompPane.update(freeButton); backgroundCompPane.update(freeButton);
frFontPane.setVisible(freeButton.isCustomStyle());
fontLabel.setVisible(freeButton.isCustomStyle());
if(freeButton.isCustomStyle()){
FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont();
freeButton.setFont(frFontPane.update(frFont)); freeButton.setFont(frFontPane.update(frFont));
}
return freeButton; return freeButton;
} }
} }

4
designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -84,7 +84,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
formWidgetValuePane.populate(ob); formWidgetValuePane.populate(ob);
isStyleAlignmentWrapText.setSelected(ob.isAutoLine()); isStyleAlignmentWrapText.setSelected(ob.isAutoLine());
isPageSetupVertically.setSelected(ob.isVerticalCenter()); isPageSetupVertically.setSelected(ob.isVerticalCenter());
hAlignmentPane.setSelectedIndex(ob.getTextalign()); hAlignmentPane.setSelectedItem(ob.getTextalign());
frFontPane.populateBean(ob.getFont()); frFontPane.populateBean(ob.getFont());
} }
@ -95,7 +95,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
formWidgetValuePane.update(layout); formWidgetValuePane.update(layout);
layout.setAutoLine(isStyleAlignmentWrapText.isSelected()); layout.setAutoLine(isStyleAlignmentWrapText.isSelected());
layout.setVerticalCenter(isPageSetupVertically.isSelected()); layout.setVerticalCenter(isPageSetupVertically.isSelected());
layout.setTextalign(hAlignmentPane.getSelectedIndex()); layout.setTextalign((int) hAlignmentPane.getSelectedItem());
layout.setFont(frFontPane.update(layout.getFont())); layout.setFont(frFontPane.update(layout.getFont()));
return layout; return layout;
} }

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

@ -1,58 +1,30 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; 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.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.NumberEditorValidatePane;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.DefaultFormatter;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> { public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> {
public NumberEditorDefinePane(XCreator xCreator){ public NumberEditorDefinePane(XCreator xCreator){
super(xCreator); super(xCreator);
} }
private FormWidgetValuePane formWidgetValuePane;
/** /**
* *
*/ */
private static final long serialVersionUID = 8011242951911686805L; private static final long serialVersionUID = 8011242951911686805L;
private UICheckBox allowDecimalsCheckBox;
private UICheckBox allowNegativeCheckBox;
private UICheckBox setMaxValueCheckBox;
private UICheckBox setMinValueCheckBox;
private UIBasicSpinner maxValueSpinner;
private SpinnerNumberModel maxValueModel;
private UIBasicSpinner minValueSpinner;
private SpinnerNumberModel minValueModel;
private UISpinner decimalLength;
private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private FormWidgetValuePane formWidgetValuePane;
private ActionListener allowDecimalsListener; private NumberEditorValidatePane numberEditorValidatePane;
private ActionListener allowNegativeListener ;
public ActionListener setMaxListener;
private ActionListener setMinListener;
private ChangeListener maxValueChangeListener;
private ChangeListener minValueChangeListener;
@ -84,237 +56,27 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
return boundsPane; return boundsPane;
} }
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()));
}
}
}
};
}
public JPanel setValidatePane() { public JPanel setValidatePane() {
initListeners(); numberEditorValidatePane = new NumberEditorValidatePane();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); return numberEditorValidatePane;
this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
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));
setNotAllowsInvalid(this.maxValueSpinner);
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));
setNotAllowsInvalid(this.minValueSpinner);
minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
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[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null},
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 panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
return panel;
} }
@Override @Override
protected void populateSubFieldEditorBean(NumberEditor e) { protected void populateSubFieldEditorBean(NumberEditor e) {
allowDecimalsCheckBox.setSelected(e.isAllowDecimals());
if (e.isAllowDecimals()) {
this.decimalLength.setValue(e.getMaxDecimalLength());
} else {
this.limitNumberPane.setVisible(false);
}
allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) {
setMaxValueCheckBox.setSelected(false);
maxValueSpinner.setValue(new Double(Double.MAX_VALUE));
maxValueSpinner.setEnabled(false);
} else {
setMaxValueCheckBox.setSelected(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.setEnabled(false);
} else {
setMinValueCheckBox.setSelected(true);
minValueSpinner.setEnabled(true);
minValueSpinner.setValue(new Double(e.getMinValue()));
}
formWidgetValuePane.populate(e); formWidgetValuePane.populate(e);
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
numberEditorValidatePane.populate(e);
} }
@Override @Override
protected NumberEditor updateSubFieldEditorBean() { protected NumberEditor updateSubFieldEditorBean() {
NumberEditor ob = (NumberEditor)creator.toData(); NumberEditor ob = (NumberEditor)creator.toData();
formWidgetValuePane.update(ob); formWidgetValuePane.update(ob);
ob.setAllowDecimals(allowDecimalsCheckBox.isSelected());
if (allowDecimalsCheckBox.isSelected()) {
ob.setMaxDecimalLength((int)this.decimalLength.getValue());
}
ob.setAllowNegative(allowNegativeCheckBox.isSelected());
if (setMaxValueCheckBox.isSelected()) {
ob.setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue()));
} else {
ob.setMaxValue(Double.MAX_VALUE);
}
if (setMinValueCheckBox.isSelected()) {
ob.setMinValue(Double.parseDouble("" + minValueSpinner.getValue()));
} else {
ob.setMinValue(-Double.MAX_VALUE);
}
this.waterMarkDictPane.update(ob); this.waterMarkDictPane.update(ob);
numberEditorValidatePane.update(ob);
return ob; return ob;
} }
private void setNotAllowsInvalid(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();
DefaultFormatter df = (DefaultFormatter) formatter;
df.setAllowsInvalid(false);
}
}
public Object getValue(UIBasicSpinner jspinner){ public Object getValue(UIBasicSpinner jspinner){
JComponent editor = jspinner.getEditor(); JComponent editor = jspinner.getEditor();
if (editor instanceof UIBasicSpinner.DefaultEditor) { if (editor instanceof UIBasicSpinner.DefaultEditor) {

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

@ -1,5 +1,6 @@
package com.fr.design.widget.ui.designer.component; package com.fr.design.widget.ui.designer.component;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
@ -43,7 +44,7 @@ public class PaddingBoundPane extends BasicPane {
new Component[]{null, left, right}, new Component[]{null, left, right},
new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_Left"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Right"), SwingConstants.CENTER)}, new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_Left"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Right"), SwingConstants.CENTER)},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
this.add(panel); this.add(panel);

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

@ -1,8 +1,10 @@
package com.fr.design.widget.ui.designer.component; package com.fr.design.widget.ui.designer.component;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.widget.component.BackgroundCompPane; import com.fr.design.widget.component.BackgroundCompPane;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.Inter;
/** /**
* Created by ibm on 2017/8/8. * Created by ibm on 2017/8/8.
@ -44,6 +46,10 @@ public class TabFitLayoutBackgroundPane extends BackgroundCompPane<WTabFitLayout
switchCard(); switchCard();
} }
protected UILabel createUILable(){
return new UILabel(Inter.getLocText("FR-Designer_Style"));
}
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "tabFitBackground"; return "tabFitBackground";
} }

35
designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java

@ -1,9 +1,8 @@
package com.fr.design.widget.ui.designer.layout; package com.fr.design.widget.ui.designer.layout;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.*;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleElementCaseToolBarEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleElementCaseToolBarEditor;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
@ -20,39 +19,41 @@ import java.awt.*;
public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseEditor> { public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseEditor> {
private PaddingBoundPane paddingBoundPane; private PaddingBoundPane paddingBoundPane;
private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor; private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor;
private PropertyGroupPane extraPropertyGroupPane;
public ElementEditorDefinePane(XCreator xCreator){ public ElementEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
} }
protected JPanel createCenterPane(){ protected JPanel createCenterPane() {
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBoundPane = new PaddingBoundPane(); paddingBoundPane = new PaddingBoundPane();
elementCaseToolBarEditor = new AccessibleElementCaseToolBarEditor(); elementCaseToolBarEditor = new AccessibleElementCaseToolBarEditor();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{paddingBoundPane, null}, new Component[]{paddingBoundPane, null},
new Component[]{new UILabel("报表块工具栏"), elementCaseToolBarEditor} new Component[]{new UILabel(Inter.getLocText("Form-EC_toolbar")), elementCaseToolBarEditor},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
return panel; CRPropertyDescriptor[] extraTableEditor = ((XElementCase)creator).getExtraTableEditor();
extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, creator);
centerPane.add(panel, BorderLayout.NORTH);
centerPane.add(extraPropertyGroupPane, BorderLayout.CENTER);
return centerPane;
} }
protected ElementCaseEditor updateSubBean(){ protected ElementCaseEditor updateSubBean() {
ElementCaseEditor elementCaseEditor = (ElementCaseEditor)creator.toData(); ElementCaseEditor elementCaseEditor = (ElementCaseEditor) creator.toData();
paddingBoundPane.update(elementCaseEditor); paddingBoundPane.update(elementCaseEditor);
elementCaseEditor.setToolBars((FormToolBarManager[])elementCaseToolBarEditor.getValue()); elementCaseEditor.setToolBars((FormToolBarManager[]) elementCaseToolBarEditor.getValue());
return elementCaseEditor; return elementCaseEditor;
} }
protected void populateSubBean(ElementCaseEditor ob){ protected void populateSubBean(ElementCaseEditor ob) {
paddingBoundPane.populate(ob); paddingBoundPane.populate(ob);
elementCaseToolBarEditor.setValue(ob.getToolBars()); elementCaseToolBarEditor.setValue(ob.getToolBars());
extraPropertyGroupPane.populate(ob);
} }
} }

46
designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -1,16 +1,22 @@
package com.fr.design.widget.ui.designer.layout; package com.fr.design.widget.ui.designer.layout;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.*;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.properties.items.FRLayoutTypeItems; import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item; import com.fr.design.designer.properties.items.Item;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBodyLayoutType;
@ -26,33 +32,38 @@ import java.util.Comparator;
* Created by ibm on 2017/8/2. * Created by ibm on 2017/8/2.
*/ */
public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
private XWAbsoluteBodyLayout xwAbsoluteBodyLayout; private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
private WAbsoluteBodyLayout wAbsoluteBodyLayout;
private UIComboBox layoutCombox; private UIComboBox layoutCombox;
private WBodyLayoutType layoutType = WBodyLayoutType.ABSOLUTE; private WBodyLayoutType layoutType = WBodyLayoutType.ABSOLUTE;
private static final int EACH_ROW_COUNT = 4; private static final int EACH_ROW_COUNT = 4;
public FRAbsoluteBodyLayoutDefinePane(XCreator xCreator) { public FRAbsoluteBodyLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
this.xwAbsoluteBodyLayout = (XWAbsoluteBodyLayout) xCreator;
wAbsoluteBodyLayout = xwAbsoluteBodyLayout.toData();
} }
public void initComponent() {
super.initComponent();
borderStyleEditor = new AccessibleWLayoutBorderStyleEditor();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")), borderStyleEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
borderPane.add(jPanel, BorderLayout.CENTER);
UIExpandablePane advancedPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, borderPane );
this.add(advancedPane, BorderLayout.NORTH);
}
public JPanel createThirdPane() { public JPanel createThirdPane() {
initLayoutComboBox(); initLayoutComboBox();
double f = TableLayout.FILL; JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
double p = TableLayout.PREFERRED; JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Attr_Layout_Type")), layoutCombox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, 7);
double[] rowSize = {p, p}; JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Scaling_Mode")), comboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, 7);
double[] columnSize = {p, f}; jPanel.add(northPane, BorderLayout.NORTH);
int[][] rowCount = {{1, 1}, {1, 1}}; jPanel.add(centerPane, BorderLayout.CENTER);
Component[][] components = new Component[][]{ northPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Attr_Layout_Type")), layoutCombox}, centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Scaling_Mode")), comboBox}, return jPanel;
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return panel;
} }
@ -72,8 +83,8 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
} }
public void populateSubPane(WAbsoluteLayout ob) { public void populateSubPane(WAbsoluteLayout ob) {
// WAbsoluteBodyLayout layout = (WAbsoluteBodyLayout) ob;
layoutCombox.setSelectedIndex(1); layoutCombox.setSelectedIndex(1);
borderStyleEditor.setValue(ob.getBorderStyle());
} }
public WAbsoluteBodyLayout updateSubPane() { public WAbsoluteBodyLayout updateSubPane() {
@ -90,6 +101,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
switch2FitBodyLayout(); switch2FitBodyLayout();
} }
} }
layout.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue());
return layout; return layout;
} }

23
designer_form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteLayoutDefinePane.java

@ -24,32 +24,27 @@ import java.awt.*;
* Created by ibm on 2017/8/2. * Created by ibm on 2017/8/2.
*/ */
public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayout> { public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayout> {
private XWAbsoluteLayout xwAbsoluteLayout;
private WAbsoluteLayout wAbsoluteLayout;
protected UIComboBox comboBox; protected UIComboBox comboBox;
private WBodyLayoutType layoutType = WBodyLayoutType.ABSOLUTE;
private WidgetBoundPane boundPane; private WidgetBoundPane boundPane;
public FRAbsoluteLayoutDefinePane(XCreator xCreator) { public FRAbsoluteLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
this.xwAbsoluteLayout = (XWAbsoluteLayout) xCreator;
wAbsoluteLayout = xwAbsoluteLayout.toData();
initComponent(); initComponent();
} }
public void initComponent() { public void initComponent() {
boundPane = new WidgetBoundPane(creator);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(boundPane, BorderLayout.NORTH); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
boundPane = new WidgetBoundPane(creator);
centerPane.add(boundPane, BorderLayout.NORTH);
initUIComboBox(); initUIComboBox();
JPanel thirdPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); // JPanel thirdPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
thirdPane.add(createThirdPane(), BorderLayout.CENTER); // thirdPane.add(, BorderLayout.CENTER);
thirdPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); // thirdPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer-Widget_Area_Scaling"), 280, 20,thirdPane ); UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer-Widget_Area_Scaling"), 280, 20,createThirdPane() );
centerPane.add(layoutExpandablePane, BorderLayout.CENTER);
this.add(layoutExpandablePane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
public JPanel createThirdPane() { public JPanel createThirdPane() {

27
designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui.designer.layout; package com.fr.design.widget.ui.designer.layout;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
@ -43,7 +44,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
private UIComboBox adaptComboBox; private UIComboBox adaptComboBox;
private UISpinner componentIntervel; private UISpinner componentIntervel;
private PaddingBoundPane paddingBound; private PaddingBoundPane paddingBound;
private AccessibleWLayoutBorderStyleEditor background; private AccessibleWLayoutBorderStyleEditor stylePane;
public FRFitLayoutDefinePane(XCreator xCreator) { public FRFitLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -64,9 +65,9 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
background = new AccessibleWLayoutBorderStyleEditor(); stylePane = new AccessibleWLayoutBorderStyleEditor();
paddingBound = new PaddingBoundPane(); paddingBound = new PaddingBoundPane();
JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")), stylePane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
jp2.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0)); jp2.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0));
jPanel.add(paddingBound, BorderLayout.CENTER); jPanel.add(paddingBound, BorderLayout.CENTER);
jPanel.add(jp2, BorderLayout.NORTH); jPanel.add(jp2, BorderLayout.NORTH);
@ -80,18 +81,20 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
componentIntervel = new UISpinner(0, 100, 1, 0); componentIntervel = new UISpinner(0, 100, 1, 0);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Attr_Layout_Type")), layoutComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, 7);
northPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Attr_Layout_Type")), layoutComboBox},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Scale")), adaptComboBox}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Scale")), adaptComboBox},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentIntervel} new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentIntervel}
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10); JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));
jPanel.add(panel, BorderLayout.CENTER); jPanel.add(northPane, BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER);
return jPanel; return jPanel;
} }
@ -116,7 +119,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());
adaptComboBox.setSelectedIndex(ob.getCompState()); adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval()); componentIntervel.setValue(ob.getCompInterval());
background.setValue(ob.getBorderStyle()); stylePane.setValue(ob.getBorderStyle());
} }
@ -124,7 +127,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public WFitLayout updateBean() { public WFitLayout updateBean() {
WFitLayout layout = (WFitLayout) creator.toData(); WFitLayout layout = (WFitLayout) creator.toData();
paddingBound.update(layout); paddingBound.update(layout);
LayoutBorderStyle borderStyle = (LayoutBorderStyle) background.getValue(); LayoutBorderStyle borderStyle = (LayoutBorderStyle) stylePane.getValue();
if(borderStyle != null){ if(borderStyle != null){
layout.setBorderStyle(borderStyle); layout.setBorderStyle(borderStyle);
} }

9
designer_form/src/com/fr/design/widget/ui/designer/layout/WCardLayoutDefinePane.java

@ -33,18 +33,17 @@ public class WCardLayoutDefinePane extends AbstractDataModify<WCardLayout> {
} }
public void initComponent() { public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
carouselInterval = new UISpinner(0, 20, 1, 0); carouselInterval = new UISpinner(0, 20, 1, 0);
accessibleCardTagWLayoutBorderStyleEditor = new AccessibleCardTagWLayoutBorderStyleEditor(); accessibleCardTagWLayoutBorderStyleEditor = new AccessibleCardTagWLayoutBorderStyleEditor();
accessibleCardTagWLayoutBorderStyleEditor.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
JPanel accessibleCardlayout = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel accessibleCardlayout = FRGUIPaneFactory.createBorderLayout_S_Pane();
accessibleCardlayout.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JPanel stylePane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")), accessibleCardTagWLayoutBorderStyleEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
accessibleCardlayout.add(accessibleCardTagWLayoutBorderStyleEditor, BorderLayout.CENTER); stylePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); accessibleCardlayout.add(stylePane, BorderLayout.CENTER);
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, accessibleCardlayout); UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, accessibleCardlayout);
final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); jPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
setCarousel = new UICheckBox(Inter.getLocText("FR-Designer_setCarousel")); setCarousel = new UICheckBox(Inter.getLocText("FR-Designer_setCarousel"));
IntervalPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_carouselInterval")), carouselInterval}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); IntervalPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_carouselInterval")), carouselInterval}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
IntervalPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); IntervalPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
jPanel.add(setCarousel, BorderLayout.NORTH); jPanel.add(setCarousel, BorderLayout.NORTH);

21
designer_form/src/com/fr/design/widget/ui/designer/layout/WTabFitLayoutDefinePane.java

@ -1,9 +1,11 @@
package com.fr.design.widget.ui.designer.layout; package com.fr.design.widget.ui.designer.layout;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
@ -22,6 +24,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
private PaddingBoundPane paddingBoundPane; private PaddingBoundPane paddingBoundPane;
private TabFitLayoutBackgroundPane borderStyle; private TabFitLayoutBackgroundPane borderStyle;
private UISpinner componentInterval; private UISpinner componentInterval;
private UITextField titleField;
public WTabFitLayoutDefinePane(XCreator xCreator) { public WTabFitLayoutDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -32,7 +35,8 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBoundPane = new PaddingBoundPane(); paddingBoundPane = new PaddingBoundPane();
borderStyle = new TabFitLayoutBackgroundPane(); borderStyle = new TabFitLayoutBackgroundPane();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style")), borderStyle}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{borderStyle, null}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
jPanel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
advancePane.add(jPanel, BorderLayout.NORTH); advancePane.add(jPanel, BorderLayout.NORTH);
advancePane.add(paddingBoundPane, BorderLayout.CENTER); advancePane.add(paddingBoundPane, BorderLayout.CENTER);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -43,8 +47,17 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
public void initLayoutComponent(){ public void initLayoutComponent(){
componentInterval = new UISpinner(0, 100, 1, 0); componentInterval = new UISpinner(0, 100, 1, 0);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentInterval}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); titleField = new UITextField();
this.add(jPanel, BorderLayout.CENTER); Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Component_Interval")), componentInterval},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Title")), titleField}
};
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
jPanel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
borderPane.add(jPanel, BorderLayout.CENTER);
UIExpandablePane currentEditTab = new UIExpandablePane(Inter.getLocText("FR-Designer_Current_tab"), 280, 20, borderPane);
this.add(currentEditTab, BorderLayout.CENTER);
} }
@Override @Override
@ -57,6 +70,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
borderStyle.populate(ob); borderStyle.populate(ob);
paddingBoundPane.populate(ob); paddingBoundPane.populate(ob);
componentInterval.setValue(ob.getCompInterval()); componentInterval.setValue(ob.getCompInterval());
titleField.setText(ob.getCurrentCard().getText());
} }
@ -66,6 +80,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
borderStyle.update(layout); borderStyle.update(layout);
paddingBoundPane.update(layout); paddingBoundPane.update(layout);
layout.setCompInterval((int)componentInterval.getValue()); layout.setCompInterval((int)componentInterval.getValue());
layout.getCurrentCard().setText(titleField.getText());
return layout; return layout;
} }
} }

Loading…
Cancel
Save