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. 4
      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. 4
      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. 339
      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. 4
      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. 18
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  55. 216
      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. 30
      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 {
try {
Thread.sleep(10);
doSearch(searchTextField.getText());
doSearch(searchTextField.getText().toLowerCase());
} catch (InterruptedException e1) {
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.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
@ -16,30 +15,18 @@ public class DocumentPreviewPane extends JPanel {
public DocumentPreviewPane(String title, String summary) {
this.setLayout(new BorderLayout());
this.setBackground(Color.WHITE);
this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT));
UITextArea titleArea = new UITextArea(title);
UITextArea contentArea = new UITextArea(summary);
titleArea.setOpaque(false);
contentArea.setOpaque(false);
titleArea.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
titleArea.setBorder(null);
titleArea.setEditable(false);
titleArea.setForeground(AlphaFineConstants.BLUE);
contentArea.setForeground(AlphaFineConstants.BLACK);
titleArea.setPreferredSize(new Dimension(360, 30));
titleArea.setFont(AlphaFineConstants.LARGE_FONT);
contentArea.setFont(AlphaFineConstants.MEDIUM_FONT);
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);
}
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;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane;
@ -73,7 +74,7 @@ public class CellWidgetCardPane extends BasicPane {
tabbedPane = new CardLayout();
center = new JPanel(tabbedPane);
jPanel.add(center, BorderLayout.CENTER);
jPanel.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L6, 0, 0));
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
initPaneList();
@ -91,7 +92,7 @@ public class CellWidgetCardPane extends BasicPane {
}
};
tabsHeaderIconPane.setNeedLeftRightOutLine(false);
jPanel.add(tabsHeaderIconPane, BorderLayout.NORTH);
this.add(tabsHeaderIconPane, BorderLayout.NORTH);
widgetPropertyPane = new BasicWidgetPropertySettingPane();

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

@ -92,7 +92,9 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
AttributeChangeListener listener = new AttributeChangeListener() {
@Override
public void attributeChange() {
CellWidgetPropertyPane.getInstance().update();
if(shouldFireSelectedEvent){
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) {
initDetailPane(btn, cls);
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
}
public void initDetailPane(Button btn, Class cls){
if (detailPane != null) {
remove(detailPane);
}
@ -40,13 +46,11 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
}
});
this.updateUI();
CellWidgetPropertyPane.getInstance().reInitAllListener();
CellWidgetPropertyPane.getInstance().update();
}
@Override
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

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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.form.ui.CheckBoxGroup;
import com.fr.general.Inter;
@ -36,7 +37,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override
protected JPanel setFirstContentPane() {
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));
buttonGroupDictPane = new ButtonGroupDictPane();
checkBoxDictPane = new CheckBoxDictPane();
@ -52,7 +53,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
double[] columnSize = {p, f};
int[][] rowCount = {{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));
advancePane.add(panel);
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.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.form.ui.ComboCheckBox;
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.Formula;
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.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.CellWidgetPropertyPane;
import com.fr.design.widget.component.DateValuePane;
import com.fr.form.ui.DateEditor;
import com.fr.general.DateUtils;
@ -19,6 +18,8 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.UtilEvalError;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -26,14 +27,14 @@ import java.text.SimpleDateFormat;
import java.util.Date;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIHeadGroup returnTypeComboBox;
private UIButtonGroup returnTypeComboBox;
private DateValuePane startDv;
private DateValuePane endDv;
private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup;
private UIButtonGroup fomatHeadGroup;
@ -47,12 +48,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override
protected JPanel setSecondContentPane() {
returnTypeComboBox = new UIHeadGroup(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}){
protected void tabChanged(int newSelectedIndex) {
//todo
}
};
returnTypeComboBox = new UIButtonGroup<>(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")});
JPanel formatHead = createFormatHead();
startDv = new DateValuePane();
@ -118,8 +114,11 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
customPane.add(dateFormatPane, Inter.getLocText("StyleFormat-Date"));
customPane.add(timeFormatPane, 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")}){
protected void tabChanged(int newSelectedIndex) {
fomatHeadGroup = new UIButtonGroup(new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")});
fomatHeadGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int newSelectedIndex = fomatHeadGroup.getSelectedIndex();
cardLayout.show(customPane, tabTitles[newSelectedIndex]);
if(newSelectedIndex == 0){
currentFormatComboBox = dateFormatComboBox;
@ -130,12 +129,14 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}
refreshPreviewLabel();
}
};
});
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane;
}
private void refreshPreviewLabel() {
String text = (String) currentFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) {
@ -175,6 +176,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText();
fomatHeadGroup.setSelectedIndex(getDateType(e));
fomatHeadGroup.populateBean();
currentFormatComboBox.setSelectedItem(formatText);
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;
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;
import com.fr.base.GraphHelper;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
@ -20,8 +20,6 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
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;
// richer:错误信息,是所有控件共有的属性,所以放到这里来
protected UITextField errorMsgTextField;
@ -95,39 +93,29 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() {
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();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null"));
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() {
@Override
public void itemStateChanged(ItemEvent e) {
boolean isSelected = allowBlankCheckBox.isSelected();
uiLabel.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.setVisible(!isSelected);
}
});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox, null},
new Component[]{uiLabel, errorMsgTextField},
new Component[]{allowBlankCheckBox},
new Component[]{borderPane},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 1);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,TableLayoutHelper.FILL_LASTCOLUMN, 5, 5);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0));
validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane();

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

@ -1,60 +1,20 @@
package com.fr.design.widget.ui;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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.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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.NumberEditorValidatePane;
import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter;
public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> {
/**
* FieldEditorDefinePane
*/
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 ChangeListener minValueChangeListener;
private WaterMarkDictPane waterMarkDictPane;
private NumberEditorValidatePane numberEditorValidatePane;
public NumberEditorDefinePane() {
}
@ -75,226 +35,23 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}
public JPanel setValidatePane() {
initListeners();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals"));
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.decimalLength = new 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;
numberEditorValidatePane = new NumberEditorValidatePane();
return numberEditorValidatePane;
}
@Override
protected void populateSubFieldEditorBean(NumberEditor e) {
allowDecimalsCheckBox.setSelected(e.isAllowDecimals());
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.numberEditorValidatePane.populate(e);
this.waterMarkDictPane.populate(e);
}
@Override
protected NumberEditor updateSubFieldEditorBean() {
NumberEditor ob = new NumberEditor();
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.numberEditorValidatePane.update(ob);
this.waterMarkDictPane.update(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();
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();
lpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
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);
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 columnSize[] = { p, f};
crEditor = new ColumnRowEditor();
UILabel messageLabel = new UILabel(Inter.getLocText("Append_Delete_Row_Message"));
Component[][] components = {
{ new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"}) + ":"), crEditor },
{new UILabel(Inter.getLocText("Append_Delete_Row_Message")),null}};
{ new UILabel(Inter.getLocText(new String[]{"Specify", "Cell"})), crEditor },
{ messageLabel, null}};
JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
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;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -27,34 +28,21 @@ public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> exte
}
protected void initComponents() {
setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = {p};
double columnSize[] = {p, f};
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);
UIExpandablePane advancedPane = new UIExpandablePane("高级", 280, 20, panel);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_L2, 8);
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);
// 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

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

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

@ -1,5 +1,7 @@
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.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
@ -31,6 +33,7 @@ public class RegFieldPane extends RegPane {
}
public void initComponents() {
this.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0));
regErrorMsgPane = new RegErrorMsgPane();
final RegChangeListener regChangeListener = new RegChangeListener() {
@ -68,9 +71,11 @@ public class RegFieldPane extends RegPane {
public RegErrorMsgPane() {
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();
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);
}

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

@ -1,6 +1,7 @@
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.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
@ -70,7 +71,7 @@ public class RegPane extends BasicPane {
private void initComponents(){
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.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")};
DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType);
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());
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel);
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);
editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN));
dataTypeComboBox.addItemListener(new ItemListener() {
@ -393,20 +396,24 @@ public class RegPane extends BasicPane {
public RegLengthPane(){
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));
minLenSpinner = 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 p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"), minLenSpinner },
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"), maxLenSpinner},
new Component[]{minLabel, minLenSpinner },
new Component[]{maxLabel, maxLenSpinner},
};
double[] rowSize = {p, p};
double[] columnSize = {p,f};
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);
@ -446,9 +453,9 @@ public class RegPane extends BasicPane {
public CustomRegRexPane(){
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();
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);
}

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

@ -100,7 +100,9 @@ public class UITextArea extends JTextArea implements UIObserver {
@Override
protected void paintBorder(Graphics g) {
getUI().paintBorder((Graphics2D) g, getWidth(), getHeight(), true, Constants.NULL);
if (getBorder() != null) {
getUI().paintBorder((Graphics2D) g, getWidth(), getHeight(), true, Constants.NULL);
}
}
@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) {
if (isRollOver && textField.isEnabled()) {
if (isRollOver && textField.isEnabled() && ((UITextArea)textField).isEditable()) {
g2d.setColor(UIConstants.TEXT_FILED_BORDER_SELECTED);
g2d.drawRect(0, 0, width - 1, height - 1);
} 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 com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
@ -42,13 +43,13 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
iconPane = new AccessibleIconEditor();
labelPane.add(iconPane);
Component[][] n_components = {
{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-Icon") + ":"), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField = new UITextField()},
{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-Icon")), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys")), hotkeysTextField = new UITextField()},
};
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));
advancePane.add(panel, BorderLayout.NORTH);
Component comp = createCenterPane();

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

@ -1,14 +1,16 @@
package com.fr.design.widget.component;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleImgBackgroundEditor;
import com.fr.form.ui.Widget;
import com.fr.general.Inter;
import com.vividsolutions.jts.index.bintree.Interval;
import javax.swing.*;
import java.awt.*;
@ -18,9 +20,9 @@ import java.awt.*;
*/
public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
protected UIButtonGroup backgroundHead;
protected AccessibleBackgroundEditor initalBackgroundEditor;
protected AccessibleBackgroundEditor overBackgroundEditor;
protected AccessibleBackgroundEditor clickBackgroundEditor;
protected AccessibleImgBackgroundEditor initalBackgroundEditor;
protected AccessibleImgBackgroundEditor overBackgroundEditor;
protected AccessibleImgBackgroundEditor clickBackgroundEditor;
private JPanel panel;
public BackgroundCompPane() {
@ -29,9 +31,11 @@ public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
initalBackgroundEditor = new AccessibleBackgroundEditor();
overBackgroundEditor = new AccessibleBackgroundEditor();
clickBackgroundEditor = new AccessibleBackgroundEditor();
UILabel headLabel = createUILable();
headLabel.setPreferredSize(new Dimension(50, 20));
initalBackgroundEditor = new AccessibleImgBackgroundEditor();
overBackgroundEditor = new AccessibleImgBackgroundEditor();
clickBackgroundEditor = new AccessibleImgBackgroundEditor();
String [] titles = new String[]{Inter.getLocText("FR-Designer_DEFAULT"), Inter.getLocText("FR-Designer_Custom")};
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-Click")), clickBackgroundEditor},
};
panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
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);
}
protected UILabel createUILable(){
return new UILabel(Inter.getLocText("FR-Designer_Background"));
}
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.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.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants;
@ -20,39 +24,40 @@ public class CheckBoxDictPane extends JPanel {
private UIButtonGroup returnTypeComboBox;
private DictionaryComboBox startComboBox;
private DictionaryComboBox endComboBox;
private JPanel delimiterPane;
private JPanel startPane;
private JPanel endPane;
private JPanel returnStringPane;
public CheckBoxDictPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
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 = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays);
delimiterComboBox.setEditable(true);
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 = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays);
startComboBox.setEditable(true);
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 = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays);
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")});
returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypePane}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
returnTypeComboBox.addActionListener(new ActionListener() {
@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);
}
private void checkVisible(int selectIndex){
delimiterPane.setVisible(selectIndex == 1);
startPane.setVisible(selectIndex == 1);
endPane.setVisible(selectIndex == 1);
public void checkVisible(int selectIndex){
returnStringPane.setVisible(selectIndex == 1);
}
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.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.Inter;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
/**
* Created by ibm on 2017/8/8.
*/
public class DateValuePane extends JPanel {
private UIHeadGroup widgetValueHead;
private UIButtonGroup widgetValueHead;
private Editor[] editor;
@ -31,9 +33,11 @@ public class DateValuePane extends JPanel {
customPane.add(editor[i], editor[i].getName());
tabTitles[i] = editor[i].getName();
}
widgetValueHead = new UIHeadGroup(tabTitles) {
widgetValueHead = new UIButtonGroup(tabTitles);
widgetValueHead.addChangeListener(new ChangeListener() {
@Override
public void tabChanged(int index) {
public void stateChanged(ChangeEvent e) {
int index = widgetValueHead.getSelectedIndex();
if (ComparatorUtils.equals(tabTitles[index], Inter.getLocText("None"))) {
customPane.setVisible(false);
} else {
@ -41,7 +45,7 @@ public class DateValuePane extends JPanel {
}
cardLayout.show(customPane, tabTitles[index]);
}
};
});
this.add(widgetValueHead, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER);
@ -56,6 +60,9 @@ public class DateValuePane extends JPanel {
}
public void populate(Object ob) {
if(ob == null){
setCardValue(0, ob);
}
for (int i = 0; i < editor.length; i++) {
if (editor[i].accept(ob)) {
setCardValue(i, ob);
@ -66,6 +73,7 @@ public class DateValuePane extends JPanel {
private void setCardValue(int i, Object object) {
widgetValueHead.setSelectedIndex(i);
widgetValueHead.populateBean();
editor[i].setValue(object);
// kunsnat: bug7861 所有的Editor值都要跟随改变, 因为populate的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.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.OperatingSystem;
import com.fr.stable.project.ProjectConstants;
import com.fr.start.server.JettyHost;
@ -179,10 +180,16 @@ public class StartServer {
private static class InformationPane extends BasicPane {
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) {
init(message);
}
private void init(String message) {
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;
if (!ComparatorUtils.equals(message, Inter.getLocText(new String[]{"Default", "Utils-Report_Runtime_Env"}))) {
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;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
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.js.EmailJavaScript;
import javax.swing.*;
import java.awt.*;
/**
*
* @author jim
@ -30,11 +29,11 @@ public class ChartEmailPane extends EmailPane{
JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
// 是否支持导出控制图表的超链邮件是否显示showTplContent
boolean supportExport = jTemplate.isJWorkBook();
JPanel contentPane;
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"));
centerPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},
contentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(), tipsPane1},
createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = 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(), tipsPane2}},rSizes, columnSize, 6);
} else {
double[] rSizes = { preferred, preferred, preferred, preferred, preferred, preferred, fill, preferred};
centerPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
double[] rSizes = { preferred, preferred, preferred, preferred, preferred, fill, preferred};
contentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},
{new UILabel(), tipsPane1},
createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()),
@ -55,6 +54,17 @@ public class ChartEmailPane extends EmailPane{
{mainTextLabel, scrollPane},
{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) {

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 USER = 3;
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 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 标题
*/
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();
chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension(200, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setPreferredSize(new Dimension(300, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setSupportEdit(false);
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.DocumentListener;
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.
@ -126,7 +130,7 @@ public class UIEditLabel extends JPanel implements UIObserver{
*/
public void mouseExited(MouseEvent e) {
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(){
UIEditLabel.this.setBackground(UIConstants.NORMAL_BACKGROUND);
UIEditLabel.this.setBackground(UIConstants.SELECT_TAB);
}
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.ChartConstants;
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.GisMapTableDefinition;
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.utils.gui.GUICoreUtils;
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.StringUtils;
import com.fr.stable.bridge.StableFactory;
@ -48,7 +66,12 @@ import com.fr.third.org.hsqldb.lib.Iterator;
import javax.swing.*;
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.Format;
import java.util.ArrayList;
@ -215,7 +238,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
@Override
public void mouseClicked(MouseEvent e) {
if (percentFormatPane == null) {
percentFormatPane = new FormatPane();
percentFormatPane = new FormatPaneWithOutFont();
}
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.chartattr.Plot;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.ibutton.UIButton;
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.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.dialog.BasicPane;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.component.format.FormatPaneWithOutFont;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.*;
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.Format;
import java.util.HashMap;
@ -226,7 +232,7 @@ public class ChartDatapointLabelPane extends BasicPane{
}
if(valueFormatPane == null) {
valueFormatPane = new FormatPane();
valueFormatPane = new FormatPaneWithOutFont();
}
Point comPoint = valueFormatButton.getLocationOnScreen();
Point arrowPoint = new Point(comPoint.x + valueFormatButton.getWidth(), comPoint.y + valueFormatButton.getHeight());
@ -255,7 +261,7 @@ public class ChartDatapointLabelPane extends BasicPane{
}
if(percentFormatPane == null) {
percentFormatPane = new FormatPane();
percentFormatPane = new FormatPaneWithOutFont();
}
Point comPoint = valuePercentFormatButton.getLocationOnScreen();
Point arrowPoint = new Point(comPoint.x + valuePercentFormatButton.getWidth(), comPoint.y + valuePercentFormatButton.getHeight());
@ -429,7 +435,7 @@ public class ChartDatapointLabelPane extends BasicPane{
protected void updatePercentFormatpane(){
if(isValuePercent!= null && isValuePercent.isSelected()){
if(this.percentFormatPane == null){
this.percentFormatPane = new FormatPane();
this.percentFormatPane = new FormatPaneWithOutFont();
}
if(this.percentFormat == null){
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;
}
//设置色彩面板内容
protected void setColorPaneContent (JPanel panel) {
panel.add(createStylePane(), BorderLayout.CENTER);
}
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
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.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.ibutton.UIButton;
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.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.js.EmailJavaScript;
@ -29,16 +23,12 @@ 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.attr.plot.VanChartPlot;
import com.fr.plugin.chart.designer.component.VanChartUIListControlPane;
import com.fr.plugin.chart.designer.other.HyperlinkMapFactory;
import com.fr.stable.ListMap;
import com.fr.stable.Nameable;
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.HashMap;
import java.util.Map;
@ -47,7 +37,7 @@ import java.util.Set;
/**
* Created by Fangjie on 2016/4/28.
*/
public class VanChartHyperLinkPane extends UIListControlPane {
public class VanChartHyperLinkPane extends VanChartUIListControlPane {
public VanChartHyperLinkPane() {
super();
@ -115,19 +105,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
return new NameJavaScriptGroup(res_array);
}
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot);
}
public void populate(Plot plot) {
//特殊处理,使用instanceof判断,处理连续弹窗问题
if (SwingUtilities.getWindowAncestor(this) instanceof JDialog) {
popupEditDialog = new HyperDialog(cardPane);
}
this.plot = plot;
HashMap paneMap = getHyperlinkMap(plot);
@ -207,7 +185,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"),
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"),
new WebHyperlink(), getUseMap(map, WebHyperlink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"),
@ -240,87 +218,4 @@ public class VanChartHyperLinkPane extends UIListControlPane {
}
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.style.ChartFillStylePane;
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.custom.VanChartCustomPlot;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.VanChartBeautyPane;
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 colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Color"),panel);
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 {
leftcontentPane.setBounds(0, 0, width, height);
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, original));
}
}
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();
}
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) {
@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.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.RefreshMoreLabel;
@ -86,11 +85,19 @@ public class AutoRefreshPane extends BasicBeanPane<RefreshMoreLabel> {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f, 20};
double[] rowSize = {p, p};
double[] column = {f, 20};
double[] rowSize = {p};
Component[][] components = initComponent(jPanel);
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
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(contentPane, BorderLayout.CENTER);
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() {
tooltipSet = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png"));
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;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.RefreshMoreLabel;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.*;
import java.awt.*;
/**
@ -17,9 +14,9 @@ public class AutoRefreshPaneWithoutTooltip extends AutoRefreshPane {
super(chart, isLargeModel);
}
protected Component[][] initComponent(JPanel autoTooltipPane){
protected Component[][] initAutoTooltipComponent () {
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},
};
}

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

@ -116,28 +116,28 @@ public class HyperlinkMapFactory {
public static HashMap getHyperlinkMap(Plot plot) {
String plotType = plotTypeMap.get(plot.getClass().getName() + plot.getDetailType());
if(plotType == null){
if (plotType == null) {
plotType = plotTypeMap.get(plot.getClass().getName());
if(plotType == null) {
if (plotType == null) {
plotType = NORMAL;
}
}
return getHyperlinkMapWithType(plotType);
}
public static HashMap getDrillUpLinkMap(){
public static HashMap getDrillUpLinkMap() {
return getHyperlinkMapWithType(DIRLLMAPCATALOG);
}
public static HashMap getLineMapHyperLinkMap(){
public static HashMap getLineMapHyperLinkMap() {
return getHyperlinkMapWithType(LINEMAP);
}
private static HashMap getHyperlinkMapWithType(String plotType){
private static HashMap getHyperlinkMapWithType(String plotType) {
HashMap<Class, Class> map = new HashMap<Class, Class>();
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(ParameterJavaScript.class, getClassWithPrefix(HyperlinkMapFactory.Para.class, plotType));
@ -150,9 +150,9 @@ public class HyperlinkMapFactory {
return map;
}
private static Class getClassWithPrefix(Class superClass, String plotType){
private static Class getClassWithPrefix(Class superClass, String plotType) {
String wholeClassString = superClass.getName() + plotType;
try{
try {
return Class.forName(wholeClassString);
} catch (Exception e) {
return superClass;
@ -386,78 +386,90 @@ public class HyperlinkMapFactory {
return ValueEditorPaneFactory.createValueEditorPane(addBasicEditors(list));
}
//网络报表
public static class Report{
public static class VAN_CHART extends ReportletHyperlinkPane.CHART{
public static class Report {
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
protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane();
}
}
public static class VAN_CHART_SCATTER extends ReportletHyperlinkPane.CHART{
public static class VAN_CHART_SCATTER extends Report.VAN_CHART {
@Override
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
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
return getGanntValueEditorPane();
}
}
public static class VAN_CHART_MULTIPIE extends ReportletHyperlinkPane.CHART{
public static class VAN_CHART_MULTIPIE extends Report.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane();
}
}
public static class VAN_CHART_LINE_MAP extends ReportletHyperlinkPane.CHART{
public static class VAN_CHART_LINE_MAP extends Report.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane();
}
}
public static class VAN_CHART_DRILLMAPCATALOG extends ReportletHyperlinkPane.CHART{
public static class VAN_CHART_DRILLMAPCATALOG extends Report.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane();
}
}
public static class VAN_CHART_FUNNEL extends ReportletHyperlinkPane.CHART{
public static class VAN_CHART_FUNNEL extends Report.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane();
}
}
public static class VAN_CHART_WORDCLOUD extends ReportletHyperlinkPane.CHART{
public static class VAN_CHART_WORDCLOUD extends Report.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane();
}
}
public static class VAN_CHART_STRUCTURE extends ReportletHyperlinkPane.CHART{
public static class VAN_CHART_STRUCTURE extends Report.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
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 VAN_CHART extends WebHyperlinkPane.CHART{
public static class Web {
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
protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane();
}
}
public static class VAN_CHART_SCATTER extends WebHyperlinkPane.CHART{
public static class VAN_CHART_SCATTER extends Web.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane();
}
}
public static class VAN_CHART_GANNT extends WebHyperlinkPane.CHART{
public static class VAN_CHART_GANNT extends Web.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane();
}
}
public static class VAN_CHART_LINE_MAP extends WebHyperlinkPane.CHART{
public static class VAN_CHART_LINE_MAP extends Web.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane();
}
}
public static class VAN_CHART_MULTIPIE extends WebHyperlinkPane.CHART{
public static class VAN_CHART_MULTIPIE extends Web.VAN_CHART {
protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane();
}
}
public static class VAN_CHART_FUNNEL extends WebHyperlinkPane.CHART{
public static class VAN_CHART_FUNNEL extends Web.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane();
}
}
public static class VAN_CHART_WORDCLOUD extends WebHyperlinkPane.CHART{
public static class VAN_CHART_WORDCLOUD extends Web.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane();
}
}
public static class VAN_CHART_STRUCTURE extends WebHyperlinkPane.CHART{
public static class VAN_CHART_STRUCTURE extends Web.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane();
@ -544,42 +575,52 @@ public class HyperlinkMapFactory {
}
//动态参数
public static class Para{
public static class VAN_CHART extends ParameterJavaScriptPane.CHART{
public static class Para {
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
protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane();
}
}
public static class VAN_CHART_SCATTER extends ParameterJavaScriptPane.CHART{
public static class VAN_CHART_SCATTER extends Para.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane();
}
}
public static class VAN_CHART_GANNT extends ParameterJavaScriptPane.CHART{
public static class VAN_CHART_GANNT extends Para.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane();
}
}
public static class VAN_CHART_LINE_MAP extends ParameterJavaScriptPane.CHART{
public static class VAN_CHART_LINE_MAP extends Para.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane();
}
}
public static class VAN_CHART_MULTIPIE extends ParameterJavaScriptPane.CHART{
public static class VAN_CHART_MULTIPIE extends Para.VAN_CHART {
protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane();
}
}
public static class VAN_CHART_FUNNEL extends ParameterJavaScriptPane.CHART{
public static class VAN_CHART_FUNNEL extends Para.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane();
}
}
public static class VAN_CHART_WORDCLOUD extends ParameterJavaScriptPane.CHART{
public static class VAN_CHART_WORDCLOUD extends Para.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane();
}
}
public static class VAN_CHART_STRUCTURE extends ParameterJavaScriptPane.CHART{
public static class VAN_CHART_STRUCTURE extends Para.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane();
@ -623,76 +664,86 @@ public class HyperlinkMapFactory {
}
//js超链
public static class Js{
public static class VAN_CHART extends JavaScriptImplPane.CHART{
public static class Js {
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
protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane();
}
}
public static class VAN_CHART_SCATTER extends JavaScriptImplPane.CHART{
public static class VAN_CHART_SCATTER extends Js.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane();
}
}
public static class VAN_CHART_GANNT extends JavaScriptImplPane.CHART{
public static class VAN_CHART_GANNT extends Js.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane();
}
}
public static class VAN_CHART_LINE_MAP extends JavaScriptImplPane.CHART{
public static class VAN_CHART_LINE_MAP extends Js.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane();
}
}
public static class VAN_CHART_DRILLMAPCATALOG extends JavaScriptImplPane.CHART{
public static class VAN_CHART_DRILLMAPCATALOG extends Js.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane();
}
}
public static class VAN_CHART_MULTIPIE extends JavaScriptImplPane.CHART{
public static class VAN_CHART_MULTIPIE extends Js.VAN_CHART {
protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane();
}
}
public static class VAN_CHART_FUNNEL extends JavaScriptImplPane.CHART{
public static class VAN_CHART_FUNNEL extends Js.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane();
}
}
public static class VAN_CHART_WORDCLOUD extends JavaScriptImplPane.CHART{
public static class VAN_CHART_WORDCLOUD extends Js.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane();
}
}
public static class VAN_CHART_STRUCTURE extends JavaScriptImplPane.CHART{
public static class VAN_CHART_STRUCTURE extends Js.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane();
@ -701,76 +752,84 @@ public class HyperlinkMapFactory {
}
//图表超链-悬浮窗图表
public static class Chart_Chart{
public static class VAN_CHART extends ChartHyperPoplinkPane{
public static class Chart_Chart {
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
protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane();
}
}
public static class VAN_CHART_SCATTER extends ChartHyperPoplinkPane{
public static class VAN_CHART_SCATTER extends Chart_Chart.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane();
}
}
public static class VAN_CHART_GANNT extends ChartHyperPoplinkPane{
public static class VAN_CHART_GANNT extends Chart_Chart.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane();
}
}
public static class VAN_CHART_LINE_MAP extends ChartHyperPoplinkPane{
public static class VAN_CHART_LINE_MAP extends Chart_Chart.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane();
}
}
public static class VAN_CHART_DRILLMAPCATALOG extends ChartHyperPoplinkPane{
public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Chart.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane();
}
}
public static class VAN_CHART_MULTIPIE extends ChartHyperPoplinkPane{
public static class VAN_CHART_MULTIPIE extends Chart_Chart.VAN_CHART {
protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane();
}
}
public static class VAN_CHART_FUNNEL extends ChartHyperPoplinkPane{
public static class VAN_CHART_FUNNEL extends Chart_Chart.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane();
}
}
public static class VAN_CHART_WORDCLOUD extends ChartHyperPoplinkPane{
public static class VAN_CHART_WORDCLOUD extends Chart_Chart.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane();
}
}
public static class VAN_CHART_STRUCTURE extends ChartHyperPoplinkPane{
public static class VAN_CHART_STRUCTURE extends Chart_Chart.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane();
@ -779,76 +838,84 @@ public class HyperlinkMapFactory {
}
//图表超链-联动单元格
public static class Chart_Cell{
public static class VAN_CHART extends ChartHyperRelateCellLinkPane{
public static class Chart_Cell {
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
protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane();
}
}
public static class VAN_CHART_SCATTER extends ChartHyperRelateCellLinkPane{
public static class VAN_CHART_SCATTER extends Chart_Cell.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane();
}
}
public static class VAN_CHART_GANNT extends ChartHyperRelateCellLinkPane{
public static class VAN_CHART_GANNT extends Chart_Cell.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane();
}
}
public static class VAN_CHART_LINE_MAP extends ChartHyperRelateCellLinkPane{
public static class VAN_CHART_LINE_MAP extends Chart_Cell.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane();
}
}
public static class VAN_CHART_DRILLMAPCATALOG extends ChartHyperRelateCellLinkPane{
public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Cell.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane();
}
}
public static class VAN_CHART_MULTIPIE extends ChartHyperRelateCellLinkPane{
public static class VAN_CHART_MULTIPIE extends Chart_Cell.VAN_CHART {
protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane();
}
}
public static class VAN_CHART_FUNNEL extends ChartHyperRelateCellLinkPane{
public static class VAN_CHART_FUNNEL extends Chart_Cell.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane();
}
}
public static class VAN_CHART_WORDCLOUD extends ChartHyperRelateCellLinkPane{
public static class VAN_CHART_WORDCLOUD extends Chart_Cell.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane();
}
}
public static class VAN_CHART_STRUCTURE extends ChartHyperRelateCellLinkPane{
public static class VAN_CHART_STRUCTURE extends Chart_Cell.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane();
@ -857,76 +924,84 @@ public class HyperlinkMapFactory {
}
//图表超链-悬浮元素
public static class Chart_Float{
public static class VAN_CHART extends ChartHyperRelateFloatLinkPane{
public static class Chart_Float {
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
protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane();
}
}
public static class VAN_CHART_SCATTER extends ChartHyperRelateFloatLinkPane{
public static class VAN_CHART_SCATTER extends Chart_Float.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane();
}
}
public static class VAN_CHART_GANNT extends ChartHyperRelateFloatLinkPane{
public static class VAN_CHART_GANNT extends Chart_Float.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane();
}
}
public static class VAN_CHART_LINE_MAP extends ChartHyperRelateFloatLinkPane{
public static class VAN_CHART_LINE_MAP extends Chart_Float.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getLineMapValueEditorPane();
}
}
public static class VAN_CHART_DRILLMAPCATALOG extends ChartHyperRelateFloatLinkPane{
public static class VAN_CHART_DRILLMAPCATALOG extends Chart_Float.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane();
}
}
public static class VAN_CHART_MULTIPIE extends ChartHyperRelateFloatLinkPane{
public static class VAN_CHART_MULTIPIE extends Chart_Float.VAN_CHART {
protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane();
}
}
public static class VAN_CHART_FUNNEL extends ChartHyperRelateFloatLinkPane{
public static class VAN_CHART_FUNNEL extends Chart_Float.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane();
}
}
public static class VAN_CHART_WORDCLOUD extends ChartHyperRelateFloatLinkPane{
public static class VAN_CHART_WORDCLOUD extends Chart_Float.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane();
}
}
public static class VAN_CHART_STRUCTURE extends ChartHyperRelateFloatLinkPane{
public static class VAN_CHART_STRUCTURE extends Chart_Float.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getStructureValueEditorPane();
@ -935,42 +1010,50 @@ public class HyperlinkMapFactory {
}
//当前表单对象
public static class Form{
public static class VAN_CHART extends FormHyperlinkPane.CHART{
public static class Form {
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
protected ValueEditorPane getValueEditorPane() {
return getMultiCategoryEditorPane();
}
}
public static class VAN_CHART_SCATTER extends FormHyperlinkPane.CHART{
public static class VAN_CHART_SCATTER extends Form.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getScatterValueEditorPane();
}
}
public static class VAN_CHART_GANNT extends FormHyperlinkPane.CHART{
public static class VAN_CHART_GANNT extends Form.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane() {
return getMapValueEditorPane();
}
}
public static class VAN_CHART_LINE_MAP extends FormHyperlinkPane.CHART{
public static class VAN_CHART_LINE_MAP extends Form.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
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
protected ValueEditorPane getValueEditorPane(){
protected ValueEditorPane getValueEditorPane() {
return getDrillMapCatalogValueEditorPane();
}
}
public static class VAN_CHART_MULTIPIE extends FormHyperlinkPane.CHART{
public static class VAN_CHART_MULTIPIE extends Form.VAN_CHART {
protected ValueEditorPane getValueEditorPane() {
return getMultiPieValueEditorPane();
}
}
public static class VAN_CHART_FUNNEL extends FormHyperlinkPane.CHART{
public static class VAN_CHART_FUNNEL extends Form.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getFunnelValueEditorPane();
}
}
public static class VAN_CHART_WORDCLOUD extends FormHyperlinkPane.CHART{
public static class VAN_CHART_WORDCLOUD extends Form.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
return getWordCloudValueEditorPane();
}
}
public static class VAN_CHART_STRUCTURE extends FormHyperlinkPane.CHART{
public static class VAN_CHART_STRUCTURE extends Form.VAN_CHART {
@Override
protected ValueEditorPane getValueEditorPane() {
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){
if (conditionPane == null) {
conditionPane = new VanChartListControlPane(plot);
conditionPane = new VanChartConditionListControlPane(plot);
}
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.gui.controlpane.NameObjectCreator;
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.NameObject;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.designer.component.VanChartUIListControlPane;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
@ -20,10 +18,11 @@ import java.lang.reflect.InvocationTargetException;
/**
* 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);
}
@ -57,14 +56,6 @@ public class VanChartListControlPane extends UIListControlPane {
return null;
}
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
updateConditionCollection(((VanChartPlot) plot).getConditionCollection());
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override
public String getAddItemText() {
@ -80,7 +71,8 @@ public class VanChartListControlPane extends UIListControlPane {
/**
* Update.
*/
public void updateConditionCollection(ConditionCollection cc) {
protected void update(Plot plot) {
ConditionCollection cc = plot.getConditionCollection();
Nameable[] nameables = this.update();
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.design.gui.controlpane.NameableCreator;
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.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.designer.component.VanChartUIListControlPane;
import com.fr.stable.Nameable;
import java.util.ArrayList;
@ -20,18 +18,9 @@ import java.util.List;
/**
* Created by mengao on 2017/8/22.
* 自定义警戒线列表面板
*/
public class AlertLineListControlPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
public class AlertLineListControlPane extends VanChartUIListControlPane {
@Override
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.design.gui.controlpane.NameableCreator;
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.Inter;
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.VanChartAxis;
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.designer.component.VanChartUIListControlPane;
import com.fr.stable.Nameable;
import java.util.ArrayList;
@ -21,17 +19,9 @@ import java.util.List;
/**
* Created by mengao on 2017/8/22.
* 自定义间隔背景列表面板
*/
public class BackgroundListControlPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot, false);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
public class BackgroundListControlPane extends VanChartUIListControlPane {
@Override
public NameableCreator[] createNameableCreators() {
@ -92,6 +82,12 @@ public class BackgroundListControlPane extends UIListControlPane {
doLayout();
}
@Override
protected void update(Plot plot) {
update(plot, false);
}
public void update(Plot plot, boolean isDefaultIntervalBackground) {
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) {
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);
verticalColorBackground = new ColorSelectBox(100);
Component[][] components = getIntervalPaneComponents();
@ -90,7 +90,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
cardLayout = new 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"));
isDefaultIntervalBackground.addActionListener(new ActionListener() {
@Override
@ -117,7 +117,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private void checkCardPane() {
if (isDefaultIntervalBackground.getSelectedIndex() == 0) {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground"));
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_Default_Interval"));
} else {
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));
//
JPanel top = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.removeAll();
this.add(top);
top.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Plugin-ChartF_CustomIntervalBackground") + ":", null));
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.component.VanChartAreaSeriesFillColorPane;
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.VanChartMarkerPane;
import com.fr.plugin.chart.designer.component.VanChartTrendLinePane;
@ -96,31 +95,30 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
* 返回 填充界面.
*/
protected ChartFillStylePane getFillStylePane() {
return new VanChartFillStylePane();
//如果是自定義組合圖,則不創建填充界面
return parentPane instanceof VanChartCustomStylePane ? null : new ChartFillStylePane();
}
//风格
protected VanChartBeautyPane createStylePane() {
stylePane = new VanChartBeautyPane();
return stylePane;
return parentPane instanceof VanChartCustomStylePane ? null : new VanChartBeautyPane();
}
//获取色面板
//获取色面板
protected JPanel getColorPane () {
//如果是自定義組合圖,則不創建色彩界面
if (parentPane instanceof VanChartCustomStylePane) {
return null;
}
JPanel panel = new JPanel(new BorderLayout());
stylePane = createStylePane();
setColorPaneContent(panel);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Color"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0));
return colorPane;
return panel.getComponentCount() == 0 ? null : colorPane;
}
//设置色彩面板内容
protected void setColorPaneContent (JPanel panel) {
panel.add(createStylePane(), BorderLayout.CENTER);
if (stylePane != null) {
panel.add(stylePane, BorderLayout.CENTER);
}
}
//趋势线

4
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) {
panel.add(createStylePane(), BorderLayout.CENTER);
if (stylePane != null) {
panel.add(createStylePane(), BorderLayout.CENTER);
}
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());
}
}
}

18
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() {
return "";
return StringUtils.EMPTY;
}
public String getIconPath() {
@ -472,11 +472,9 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
selectionModel.selectACreatorAtMouseEvent(e);
}
if (editingMouseListener.stopEditing()) {
if (this != designer.getRootComponent()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this);
editingMouseListener.startEditing(this, adapter.getDesignerEditor(), adapter);
}
if (editingMouseListener.stopEditing() && this != designer.getRootComponent()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this);
editingMouseListener.startEditing(this, adapter.getDesignerEditor(), adapter);
}
}
@ -642,4 +640,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
this.data = data;
}
/**
* data属性改变触发其他操作
*
*/
public void firePropertyChange(){
}
}

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

@ -32,8 +32,8 @@ import com.fr.stable.core.PropertyChangeAdapter;
*/
public class XDateEditor extends XDirectWriteEditor {
private UITextField textField;
private LimpidButton btn;
private UITextField textField;
private LimpidButton btn;
public XDateEditor(DateEditor widget, Dimension initSize) {
super(widget, initSize);
@ -41,84 +41,85 @@ public class XDateEditor extends XDirectWriteEditor {
/**
* 控件的属性列表
*
* @return 此控件所用的属性列表
* @throws IntrospectionException 异常
*/
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor [] tempt=(CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced").setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
initFieldText();
}
})},super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(tempt,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass(
DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("startDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Start-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced").setEditorClass(DateRangeEditor.class),
new CRPropertyDescriptor("endDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_End-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced").setEditorClass(DateRangeEditor.class),
new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"),
new CRPropertyDescriptor("returnDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Return-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced")
});
}
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] tempt = (CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced").setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
initFieldText();
}
})}, super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(tempt,
new CRPropertyDescriptor[]{
new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass(
DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("startDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Start-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced").setEditorClass(DateRangeEditor.class),
new CRPropertyDescriptor("endDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_End-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced").setEditorClass(DateRangeEditor.class),
new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"),
new CRPropertyDescriptor("returnDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Return-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced")
});
}
protected Class formatClass() {
return DateFormatEditor.class;
return DateFormatEditor.class;
}
private void initFieldText() {
DateEditor dateEditor = (DateEditor) data;
if (dateEditor.getWidgetValue() != null) {
WidgetValue widgetValue = dateEditor.getWidgetValue();
//控件值.toString
String valueStr = widgetValue.toString();
//控件值
Object value = widgetValue.getValue();
//格式
String format = dateEditor.getFormatText();
if (value instanceof Date) {
valueStr = DateUtils.getDate2Str(format, (Date) value);
}
//日期控件默认值
if (StringUtils.isEmpty(valueStr)) {
valueStr = DateUtils.getDate2Str(format, new Date());
dateEditor.setWidgetValue(new WidgetValue(new Date()));
}
textField.setText(valueStr);
}
}
private void initFieldText() {
DateEditor dateEditor = (DateEditor) data;
if (dateEditor.getWidgetValue() != null) {
WidgetValue widgetValue = dateEditor.getWidgetValue();
//控件值.toString
String valueStr = widgetValue.toString();
//控件值
Object value = widgetValue.getValue();
//格式
String format = dateEditor.getFormatText();
if(value instanceof Date){
valueStr = DateUtils.getDate2Str(format, (Date) value);
}
//日期控件默认值
if(StringUtils.isEmpty(valueStr)){
valueStr = DateUtils.getDate2Str(format, new Date());
dateEditor.setWidgetValue(new WidgetValue(new Date()));
}
textField.setText(valueStr);
}
}
@Override
protected void initXCreatorProperties() {
super.initXCreatorProperties();
initFieldText();
}
@Override
protected void initXCreatorProperties() {
super.initXCreatorProperties();
initFieldText();
}
@Override
protected JComponent initEditor() {
if (editor == null) {
editor = FRGUIPaneFactory.createBorderLayout_S_Pane();
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));
editor.add(btn, BorderLayout.EAST);
textField.setOpaque(false);
@ -132,47 +133,46 @@ public class XDateEditor extends XDirectWriteEditor {
return "date_16.png";
}
protected void makeVisible(boolean visible) {
btn.makeVisible(visible);
}
/**
* 获取当前XCreator的一个封装父容器
*
* @param widgetName 当前组件名
*
* @return 封装的父容器
*
*
* @date 2014-11-25-下午4:47:23
*
*/
protected XLayoutContainer getCreatorWrapper(String widgetName){
return new XWScaleLayout();
}
/**
* 将当前对象添加到父容器中
*
* @param parentPanel 父容器组件
*
*
* @date 2014-11-25-下午4:57:55
*
*/
protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight){
this.setSize(width, minHeight);
parentPanel.add(this);
}
/**
* 此控件在自适应布局要保持原样高度
*
* @return 是则返回true
*/
@Override
public boolean shouldScaleCreator() {
return true;
}
protected void makeVisible(boolean visible) {
btn.makeVisible(visible);
}
/**
* 获取当前XCreator的一个封装父容器
*
* @param widgetName 当前组件名
* @return 封装的父容器
* @date 2014-11-25-下午4:47:23
*/
protected XLayoutContainer getCreatorWrapper(String widgetName) {
return new XWScaleLayout();
}
/**
* 将当前对象添加到父容器中
*
* @param parentPanel 父容器组件
* @date 2014-11-25-下午4:57:55
*/
protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight) {
this.setSize(width, minHeight);
parentPanel.add(this);
}
/**
* 此控件在自适应布局要保持原样高度
*
* @return 是则返回true
*/
@Override
public boolean shouldScaleCreator() {
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"))
.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);
if (processor == null) {
return propertyTableEditor;
return extraTableEditor;
}
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
FitProvider wbTpl = (FitProvider) designer.getTarget();
@ -122,11 +127,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
if (editor.getReportFitAttr() == null) {
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才行
Set<FormElementCaseEditorProvider> set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING);
for (FormElementCaseEditorProvider provider : set) {
@ -137,9 +143,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
FormProvider formProvider = designer.getTarget();
ElementCaseEditorProvider elementCaseEditorProvider = this.toData();
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

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

@ -161,4 +161,13 @@ public class XWScaleLayout extends DedicateLayoutContainer {
public boolean supportSetVisibleOrEnable(){
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() {
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;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.*;
import com.fr.design.dialog.BasicScrollPane;
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.widget.CRBoundsWidget;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -135,6 +137,8 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
jPanel.add(attriCardPane, BorderLayout.CENTER);
this.listener = new AttributeChangeListener() {
@ -148,19 +152,12 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
private void initDefinePane() {
currentEditorDefinePane = null;
XCreator creator = xCreator;
if (xCreator.acceptType(XWScaleLayout.class)) {
if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) {
creator = (XCreator) xCreator.getComponent(0);
}
}
if(xCreator.acceptType(XWTitleLayout.class)){
creator = (XCreator) xCreator.getComponent(0);
}
boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class);
XCreator creator = dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator;
FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, creator.toData(), new Operator() {
@Override
public void did(DataCreatorUI ui, String cardName) {
//todo
}
});
DataModify<Widget> definePane = rn.getDefinePane();
@ -188,7 +185,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (cellWidget.acceptType(WScaleLayout.class)) {
Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget();
innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget();
} else if(cellWidget.acceptType(WTitleLayout.class)){
} else if (cellWidget.acceptType(WTitleLayout.class)) {
CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget();
innerWidget = crBoundsWidget.getWidget();
}
@ -205,6 +202,8 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
if (widgetBoundPane != null) {
widgetBoundPane.update();
}
xCreator.resetCreatorName(widget.getWidgetName());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
fireValueChanged();
}
@ -218,12 +217,13 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
}
public void fireValueChanged() {
designer.repaint();
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
xCreator.firePropertyChange();
designer.fireTargetModified();
designer.refreshDesignerUI();
}
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.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWParameterLayout;
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);
this.add(advanceExpandablePane, BorderLayout.NORTH);
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);
}
@ -65,7 +66,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
Component[][] components = new Component[][]{
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();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
jPanel.add(panel);
@ -97,8 +98,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
new Component[]{useParamsTemplate, null},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
jPanel.add(panel);
return jPanel;
}
@ -115,7 +116,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
displayReport.setSelected(ob.isDelayDisplayContent());
useParamsTemplate.setSelected(ob.isUseParamsTemplate());
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.needAddTemplateId(useParamsTemplate.isSelected());
wParameterLayout.setBackground((Background) background.getValue());
wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex());
wParameterLayout.setPosition((int)hAlignmentPane.getSelectedItem());
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"));
backgroundLabel.setVerticalAlignment(SwingConstants.TOP);
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},
backgroundCompPane,
frFont,
{new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField}
{new UILabel(Inter.getLocText("FR-Designer_Icon")), iconPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys")), hotkeysTextField}
};
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
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.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.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
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.form.ui.CheckBoxGroup;
import com.fr.general.Inter;
@ -18,7 +16,7 @@ import java.awt.*;
public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane;
private UIButtonGroup returnType;
private CheckBoxDictPane checkBoxDictPane;
private UICheckBox checkbox;
public CheckBoxGroupDefinePane(XCreator xCreator) {
@ -42,15 +40,12 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){
checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIButtonGroup(tabTitles);
checkBoxDictPane = new CheckBoxDictPane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
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[] columnSize = {p, f};
@ -62,7 +57,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override
protected void populateSubButtonGroupBean(CheckBoxGroup ob) {
returnType.setSelectedIndex(ob.isReturnString() ? 1 : 0);
this.checkBoxDictPane.populate(ob);
this.dictPane.populateBean(ob.getDictionary());
checkbox.setSelected(ob.isChooseAll());
}
@ -72,7 +67,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override
protected CheckBoxGroup updateSubButtonGroupBean() {
CheckBoxGroup ob = (CheckBoxGroup) creator.toData();
ob.setReturnString(returnType.getSelectedIndex() == 1);
checkBoxDictPane.update(ob);
ob.setDictionary(this.dictPane.updateBean());
ob.setChooseAll(checkbox.isSelected());
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.designer.creator.XCreator;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.CheckBoxDictPane;
import com.fr.form.ui.ComboCheckBox;
import com.fr.general.Inter;
@ -16,7 +16,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox;
private UIButtonGroup returnType;
private CheckBoxDictPane checkBoxDictPane;
private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox;
@ -38,15 +38,13 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public JPanel createOtherPane(){
supportTagCheckBox = new UICheckBox(Inter.getLocText("Form-SupportTag"), true);
final String[] tabTitles = new String[]{Inter.getLocText("Widget-Array"), Inter.getLocText("String")};
returnType = new UIButtonGroup(tabTitles) ;
checkBoxDictPane = new CheckBoxDictPane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
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[] columnSize = {p, f};
@ -57,7 +55,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
}
protected void populateSubDictionaryEditorBean(ComboCheckBox ob){
returnType.setSelectedIndex(ob.isReturnString() ? 1 : 0);
this.checkBoxDictPane.populate(ob);
waterMarkDictPane.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob);
this.supportTagCheckBox.setSelected(ob.isSupportTag());
@ -66,7 +64,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
protected ComboCheckBox updateSubDictionaryEditorBean(){
ComboCheckBox combo = (ComboCheckBox) creator.toData();
combo.setReturnString(returnType.getSelectedIndex() == 1);
checkBoxDictPane.update(combo);
formWidgetValuePane.update(combo);
combo.setWaterMark(waterMarkDictPane.getText());
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.design.designer.creator.XCreator;
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.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -22,6 +20,8 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.UtilEvalError;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -34,10 +34,9 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private DateValuePane endDv;
private WaterMarkDictPane waterMarkDictPane;
private FormWidgetValuePane formWidgetValuePane;
private UISpinner fontSizePane;
private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel;
private UIHeadGroup fomatHeadGroup;
private UIButtonGroup fomatHeadGroup;
public DateEditorDefinePane(XCreator xCreator) {
super(xCreator);
@ -53,7 +52,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected JPanel setFirstContentPane() {
waterMarkDictPane = new WaterMarkDictPane();
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
fontSizePane = new UISpinner(0, 20, 1, 0);
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
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(timeFormatPane, 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")}){
protected void tabChanged(int newSelectedIndex) {
fomatHeadGroup = new UIButtonGroup(new String[]{Inter.getLocText("StyleFormat-Date"), Inter.getLocText("StyleFormat-Time")});
fomatHeadGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int newSelectedIndex = fomatHeadGroup.getSelectedIndex();
cardLayout.show(customPane, tabTitles[newSelectedIndex]);
if(newSelectedIndex == 0){
currentFormatComboBox = dateFormatComboBox;
@ -137,7 +138,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}
refreshPreviewLabel();
}
};
});
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane;
@ -172,6 +173,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText();
fomatHeadGroup.setSelectedIndex(getDateType(e));
fomatHeadGroup.populateBean();
currentFormatComboBox.setSelectedItem(formatText);
waterMarkDictPane.populate(e);
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;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.*;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -105,37 +107,25 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() {
initErrorMsgPane();
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
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() {
@Override
public void itemStateChanged(ItemEvent e) {
boolean isSelected = allowBlankCheckBox.isSelected();
uiLabel.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.setVisible(!isSelected);
}
});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox, null},
new Component[]{uiLabel, errorMsgTextField},
new Component[]{allowBlankCheckBox},
new Component[]{borderPane},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 5, 5);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L6);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane();
if (contentPane != null) {

30
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.gui.ilable.UILabel;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.component.ButtonBackgroundPane;
import com.fr.form.ui.FreeButton;
import com.fr.general.FRFont;
@ -17,6 +18,7 @@ import java.awt.*;
public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
private ButtonBackgroundPane backgroundCompPane;
private FRFontPane frFontPane;
private UILabel fontLabel;
public FreeButtonDefinePane(XCreator xcreator) {
super(xcreator);
@ -24,29 +26,41 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
public Component[] createBackgroundComp() {
backgroundCompPane = new ButtonBackgroundPane();
return new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background") + ":"), backgroundCompPane};
return new Component[]{backgroundCompPane,null};
}
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);
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) {
backgroundCompPane.populate(e);
FRFont frFont = e.getFont();
if (frFont != null) {
frFontPane.populateBean(e.getFont());
frFontPane.setVisible(e.isCustomStyle());
fontLabel.setVisible(e.isCustomStyle());
if(e.isCustomStyle()){
FRFont frFont = e.getFont();
if (frFont != null) {
frFontPane.populateBean(e.getFont());
}
}
}
public FreeButton updateSubButtonPane() {
FreeButton freeButton = (FreeButton) creator.toData();
backgroundCompPane.update(freeButton);
FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont();
freeButton.setFont(frFontPane.update(frFont));
frFontPane.setVisible(freeButton.isCustomStyle());
fontLabel.setVisible(freeButton.isCustomStyle());
if(freeButton.isCustomStyle()){
FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont();
freeButton.setFont(frFontPane.update(frFont));
}
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);
isStyleAlignmentWrapText.setSelected(ob.isAutoLine());
isPageSetupVertically.setSelected(ob.isVerticalCenter());
hAlignmentPane.setSelectedIndex(ob.getTextalign());
hAlignmentPane.setSelectedItem(ob.getTextalign());
frFontPane.populateBean(ob.getFont());
}
@ -95,7 +95,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
formWidgetValuePane.update(layout);
layout.setAutoLine(isStyleAlignmentWrapText.isSelected());
layout.setVerticalCenter(isPageSetupVertically.isSelected());
layout.setTextalign(hAlignmentPane.getSelectedIndex());
layout.setTextalign((int) hAlignmentPane.getSelectedItem());
layout.setFont(frFontPane.update(layout.getFont()));
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;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.NumberEditorValidatePane;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
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;
public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> {
public NumberEditorDefinePane(XCreator xCreator){
super(xCreator);
}
private FormWidgetValuePane formWidgetValuePane;
/**
*
*/
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 ChangeListener minValueChangeListener;
private FormWidgetValuePane formWidgetValuePane;
private NumberEditorValidatePane numberEditorValidatePane;
@ -84,237 +56,27 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
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() {
initListeners();
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
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;
numberEditorValidatePane = new NumberEditorValidatePane();
return numberEditorValidatePane;
}
@Override
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);
this.waterMarkDictPane.populate(e);
numberEditorValidatePane.populate(e);
}
@Override
protected NumberEditor updateSubFieldEditorBean() {
NumberEditor ob = (NumberEditor)creator.toData();
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);
numberEditorValidatePane.update(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){
JComponent editor = jspinner.getEditor();
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;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
@ -43,7 +44,7 @@ public class PaddingBoundPane extends BasicPane {
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)},
};
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));
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;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.widget.component.BackgroundCompPane;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.Background;
import com.fr.general.Inter;
/**
* Created by ibm on 2017/8/8.
@ -44,6 +46,10 @@ public class TabFitLayoutBackgroundPane extends BackgroundCompPane<WTabFitLayout
switchCard();
}
protected UILabel createUILable(){
return new UILabel(Inter.getLocText("FR-Designer_Style"));
}
protected String title4PopupWindow() {
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;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.designer.creator.*;
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.mainframe.widget.accessibles.AccessibleElementCaseToolBarEditor;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
@ -20,39 +19,41 @@ import java.awt.*;
public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseEditor> {
private PaddingBoundPane paddingBoundPane;
private AccessibleElementCaseToolBarEditor elementCaseToolBarEditor;
private PropertyGroupPane extraPropertyGroupPane;
public ElementEditorDefinePane(XCreator xCreator){
public ElementEditorDefinePane(XCreator xCreator) {
super(xCreator);
}
protected JPanel createCenterPane(){
protected JPanel createCenterPane() {
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBoundPane = new PaddingBoundPane();
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[][]{
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));
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(){
ElementCaseEditor elementCaseEditor = (ElementCaseEditor)creator.toData();
protected ElementCaseEditor updateSubBean() {
ElementCaseEditor elementCaseEditor = (ElementCaseEditor) creator.toData();
paddingBoundPane.update(elementCaseEditor);
elementCaseEditor.setToolBars((FormToolBarManager[])elementCaseToolBarEditor.getValue());
elementCaseEditor.setToolBars((FormToolBarManager[]) elementCaseToolBarEditor.getValue());
return elementCaseEditor;
}
protected void populateSubBean(ElementCaseEditor ob){
protected void populateSubBean(ElementCaseEditor ob) {
paddingBoundPane.populate(ob);
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;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.*;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.properties.items.FRLayoutTypeItems;
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.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner;
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.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType;
@ -26,33 +32,38 @@ import java.util.Comparator;
* Created by ibm on 2017/8/2.
*/
public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
private XWAbsoluteBodyLayout xwAbsoluteBodyLayout;
private WAbsoluteBodyLayout wAbsoluteBodyLayout;
private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
private UIComboBox layoutCombox;
private WBodyLayoutType layoutType = WBodyLayoutType.ABSOLUTE;
private static final int EACH_ROW_COUNT = 4;
public FRAbsoluteBodyLayoutDefinePane(XCreator 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() {
initLayoutComboBox();
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[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Attr_Layout_Type")), layoutCombox},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Scaling_Mode")), comboBox},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return panel;
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
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);
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);
jPanel.add(northPane, BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));
return jPanel;
}
@ -72,8 +83,8 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
}
public void populateSubPane(WAbsoluteLayout ob) {
// WAbsoluteBodyLayout layout = (WAbsoluteBodyLayout) ob;
layoutCombox.setSelectedIndex(1);
borderStyleEditor.setValue(ob.getBorderStyle());
}
public WAbsoluteBodyLayout updateSubPane() {
@ -90,6 +101,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
switch2FitBodyLayout();
}
}
layout.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue());
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.
*/
public class FRAbsoluteLayoutDefinePane extends AbstractDataModify<WAbsoluteLayout> {
private XWAbsoluteLayout xwAbsoluteLayout;
private WAbsoluteLayout wAbsoluteLayout;
protected UIComboBox comboBox;
private WBodyLayoutType layoutType = WBodyLayoutType.ABSOLUTE;
private WidgetBoundPane boundPane;
public FRAbsoluteLayoutDefinePane(XCreator xCreator) {
super(xCreator);
this.xwAbsoluteLayout = (XWAbsoluteLayout) xCreator;
wAbsoluteLayout = xwAbsoluteLayout.toData();
initComponent();
}
public void initComponent() {
boundPane = new WidgetBoundPane(creator);
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();
JPanel thirdPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
thirdPane.add(createThirdPane(), BorderLayout.CENTER);
thirdPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer-Widget_Area_Scaling"), 280, 20,thirdPane );
this.add(layoutExpandablePane, BorderLayout.CENTER);
// JPanel thirdPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// thirdPane.add(, BorderLayout.CENTER);
// thirdPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
UIExpandablePane layoutExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer-Widget_Area_Scaling"), 280, 20,createThirdPane() );
centerPane.add(layoutExpandablePane, BorderLayout.CENTER);
this.add(centerPane, BorderLayout.CENTER);
}
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;
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.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWFitLayout;
@ -43,7 +44,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
private UIComboBox adaptComboBox;
private UISpinner componentIntervel;
private PaddingBoundPane paddingBound;
private AccessibleWLayoutBorderStyleEditor background;
private AccessibleWLayoutBorderStyleEditor stylePane;
public FRFitLayoutDefinePane(XCreator xCreator) {
super(xCreator);
@ -64,9 +65,9 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
public JPanel createAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
background = new AccessibleWLayoutBorderStyleEditor();
stylePane = new AccessibleWLayoutBorderStyleEditor();
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));
jPanel.add(paddingBound, BorderLayout.CENTER);
jPanel.add(jp2, BorderLayout.NORTH);
@ -80,18 +81,20 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
componentIntervel = new UISpinner(0, 100, 1, 0);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] rowSize = {p, p};
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[][]{
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_Interval")), componentIntervel}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
jPanel.add(panel, BorderLayout.CENTER);
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, 7);
centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));
jPanel.add(northPane, BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER);
return jPanel;
}
@ -116,7 +119,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());
adaptComboBox.setSelectedIndex(ob.getCompState());
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() {
WFitLayout layout = (WFitLayout) creator.toData();
paddingBound.update(layout);
LayoutBorderStyle borderStyle = (LayoutBorderStyle) background.getValue();
LayoutBorderStyle borderStyle = (LayoutBorderStyle) stylePane.getValue();
if(borderStyle != null){
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() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
carouselInterval = new UISpinner(0, 20, 1, 0);
accessibleCardTagWLayoutBorderStyleEditor = new AccessibleCardTagWLayoutBorderStyleEditor();
accessibleCardTagWLayoutBorderStyleEditor.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
JPanel accessibleCardlayout = FRGUIPaneFactory.createBorderLayout_S_Pane();
accessibleCardlayout.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
accessibleCardlayout.add(accessibleCardTagWLayoutBorderStyleEditor, BorderLayout.CENTER);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel stylePane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")), accessibleCardTagWLayoutBorderStyleEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
stylePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
accessibleCardlayout.add(stylePane, BorderLayout.CENTER);
UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, accessibleCardlayout);
final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
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.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
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;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.AbstractDataModify;
@ -22,6 +24,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
private PaddingBoundPane paddingBoundPane;
private TabFitLayoutBackgroundPane borderStyle;
private UISpinner componentInterval;
private UITextField titleField;
public WTabFitLayoutDefinePane(XCreator xCreator) {
super(xCreator);
@ -32,7 +35,8 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
paddingBoundPane = new PaddingBoundPane();
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(paddingBoundPane, BorderLayout.CENTER);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -43,8 +47,17 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
public void initLayoutComponent(){
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);
this.add(jPanel, BorderLayout.CENTER);
titleField = new UITextField();
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
@ -57,6 +70,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
borderStyle.populate(ob);
paddingBoundPane.populate(ob);
componentInterval.setValue(ob.getCompInterval());
titleField.setText(ob.getCurrentCard().getText());
}
@ -66,6 +80,7 @@ public class WTabFitLayoutDefinePane extends AbstractDataModify<WTabFitLayout> {
borderStyle.update(layout);
paddingBoundPane.update(layout);
layout.setCompInterval((int)componentInterval.getValue());
layout.getCurrentCard().setText(titleField.getText());
return layout;
}
}

Loading…
Cancel
Save