Browse Source

Merge branch 'release/9.0' of ssh://cloud.finedevelop.com:7999/~hzzz/design into release/9.0

master
hzzz 7 years ago
parent
commit
2acee16328
  1. 21
      designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java
  2. 14
      designer_base/src/com/fr/design/constants/UIConstants.java
  3. 8
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  4. 11
      designer_base/src/com/fr/design/gui/style/FRFontPane.java
  5. 47
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  6. 19
      designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java
  7. 141
      designer_base/src/com/fr/design/write/submit/CustomJobPane.java
  8. 17
      designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java
  9. 2
      designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java
  10. 44
      designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java

21
designer/src/com/fr/design/report/mobile/AppFitPreviewPane.java

@ -1,5 +1,6 @@
package com.fr.design.report.mobile;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -31,16 +32,16 @@ public class AppFitPreviewPane extends BasicPane{
}
private void initCacheImage() {
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png")));
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png")));
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V2.png")));
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V3.png")));
cachedVerticalPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/V4.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H0.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H1.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H2.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png")));
cachedHorizonPreviewImage.add(new ImageIcon(IOUtils.readImage("/com/fr/design/images/dialog/appfit/H4.png")));
cachedVerticalPreviewImage.add(new ImageIcon(UIConstants.APPFIT_V0));
cachedVerticalPreviewImage.add(new ImageIcon(UIConstants.APPFIT_V1));
cachedVerticalPreviewImage.add(new ImageIcon(UIConstants.APPFIT_V2));
cachedVerticalPreviewImage.add(new ImageIcon(UIConstants.APPFIT_V3));
cachedVerticalPreviewImage.add(new ImageIcon(UIConstants.APPFIT_V4));
cachedHorizonPreviewImage.add(new ImageIcon(UIConstants.APPFIT_H0));
cachedHorizonPreviewImage.add(new ImageIcon(UIConstants.APPFIT_H1));
cachedHorizonPreviewImage.add(new ImageIcon(UIConstants.APPFIT_H2));
cachedHorizonPreviewImage.add(new ImageIcon(UIConstants.APPFIT_H3));
cachedHorizonPreviewImage.add(new ImageIcon(UIConstants.APPFIT_H4));
}
private void initComponents() {

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

@ -18,8 +18,19 @@ import java.awt.image.BufferedImage;
public interface UIConstants {
public static final Icon CPT_ICON = BaseUtils.readIcon("/com/fr/base/images/oem/cpt.png");
public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif");
public static final Image APPFIT_V0 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V0.png");
public static final Image APPFIT_V1 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V1.png");
public static final Image APPFIT_V2 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V2.png");
public static final Image APPFIT_V3 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V3.png");
public static final Image APPFIT_V4 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/V4.png");
public static final Image APPFIT_H0 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H0.png");
public static final Image APPFIT_H1 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H1.png");
public static final Image APPFIT_H2 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H2.png");
public static final Image APPFIT_H3 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png");
public static final Image APPFIT_H4 = BaseUtils.readImage("/com/fr/design/images/dialog/appfit/H4.png");
public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 0);
public static final Border CELL_ATTR_PRESENTBORDER = BorderFactory.createEmptyBorder(0, 5, 0, 0);
@ -98,6 +109,7 @@ public interface UIConstants {
public static final Color ATTRIBUTE_NORMAL = Color.WHITE;
public static final Color ATTRIBUTE_HOVER = new Color(0xF5F5F7);
public static final Color UI_TOOLBAR_COLOR = new Color(0xF5F5F7);
public static final Color DIALOG_TITLEBAR_BACKGROUND = new Color(0xFCFCFD);
public static final Color CHECKBOX_HOVER_SELECTED = new Color(0x3394f0);
public static final Color TEXT_FILED_BORDER_SELECTED = new Color(0x3384f0);
public static final Color SHEET_NORMAL = new Color(0xc8c8ca);

8
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -443,14 +443,16 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
public PopupToolPane(String title, JDialog parentDialog) {
super();
this.parentDialog = parentDialog;
originColor = UIConstants.UI_TOOLBAR_COLOR;
originColor = UIConstants.DIALOG_TITLEBAR_BACKGROUND;
contentPane = new JPanel();
contentPane.setBackground(originColor);
contentPane.setLayout(new BorderLayout());
titleLabel = new UILabel(title);
Font font = new Font("SimSun", Font.PLAIN, 12);
titleLabel.setFont(font);
contentPane.add(titleLabel, BorderLayout.WEST);
contentPane.setBorder(new EmptyBorder(5, 10, 5, 0));
contentPane.setBorder(new EmptyBorder(5, 14, 6, 0));
setLayout(new BorderLayout());
add(contentPane, BorderLayout.CENTER);
@ -466,7 +468,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 25);
return new Dimension(super.getPreferredSize().width, 28);
}
}
}

11
designer_base/src/com/fr/design/gui/style/FRFontPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
@ -41,6 +42,8 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
public static Integer[] FONT_SIZES = {new Integer(6), new Integer(8), new Integer(9), new Integer(10), new Integer(11), new Integer(12), new Integer(14), new Integer(16),
new Integer(18), new Integer(20), new Integer(22), new Integer(24), new Integer(26), new Integer(28), new Integer(36), new Integer(48), new Integer(72)};
private static final Dimension BUTTON_SIZE = new Dimension(20, 18);
private static final Dimension UNDER_LINE_SIZE = new Dimension(87, 20);
private static final Dimension HIDE_SIZE = new Dimension(0, 0);
private final String[] fontSizeStyles = {Inter.getLocText("FR-Designer_FRFont_plain"), Inter.getLocText("FR-Designer_FRFont_bold"), Inter.getLocText("FR-Designer_FRFont_italic"), Inter.getLocText("FR-Designer_FRFont_bolditalic")};
private JPanel buttonPane;
private JPanel isSuperOrSubPane;
@ -104,9 +107,11 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
if (line == Constants.LINE_NONE) {
underline.setSelected(false);
cly.show(linePane, "none");
linePane.setPreferredSize(HIDE_SIZE);
} else {
underline.setSelected(true);
cly.show(linePane, "combobox");
linePane.setPreferredSize(UNDER_LINE_SIZE);
this.underlineCombo.setSelectedLineStyle(line);
}
// effects
@ -297,8 +302,14 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
public void stateChanged(ChangeEvent e) {
CardLayout cly = (CardLayout) linePane.getLayout();
cly.show(linePane, underline.isSelected() ? "combobox" : "none");
if(underline.isSelected()){
linePane.setPreferredSize(UNDER_LINE_SIZE);
}else{
linePane.setPreferredSize(HIDE_SIZE);
}
}
});
return linePane;
}

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

@ -1,4 +1,3 @@
# generated time: \u661F\u671F\u56DB \u5341\u4E00\u6708 24 12:02:51 CST 2016
FR-Designer-BBSLogin_Account=User name
FR-Designer-BBSLogin_Connection-Failure=Connection failure, check your network status
FR-Designer-BBSLogin_Connection-Failure-Tip=Tip
@ -591,13 +590,13 @@ FR-Designer_Style=Style
FR-Designer_Color=Color
FR-Designer_Border=Border
FR-Designer_Background-Pattern=Pattern
FR-Designer_SimpleDetail_Report=
FR-Designer_SimpleCross_Report=
FR-Designer_SimpleDetail_Report=Simple list
FR-Designer_SimpleCross_Report=Simple cross table
FR-Designer_Edit_Button_ToolBar=Edit Button ToolBar
FR-Designer_Remove_Button_ToolBar=Remove Button ToolBar
FR-Designer_Get-CubeGetting=
FR-Designer_DoubleLayer_Report=
FR-Designer_Get-Cube=
FR-Designer_Get-CubeGetting=Getting cube
FR-Designer_DoubleLayer_Report=Double deck header
FR-Designer_Get-Cube=Getting the cube
CellWrite-InsertRow_NULL=Null
DashBoard-ChartFloat=Chart
contact_info=Contact information (optional)
@ -1246,7 +1245,7 @@ FR-Designer-Cell_Group=Cell Group
Week=Week
PageSetup-Orientation=Orientation
M-Open_Recent=Open Recent
NNormal=
NNormal=normal
Integer=Integer
Select_The_Source_To_Save=Select Source to Save
Transition=Branch
@ -1458,7 +1457,7 @@ Env-Configure_Workspace=Configure working directory
feedback_info=We welcome your comments and suggestions, please fill out the information as detailed as possible, we will contact you soon
Ratio=Ratio
DBCP_TEST_ON_BORROW=Test before Getting Connections
FR-Designer_layerIndex=
FR-Designer_layerIndex=Dependent layers
WEB-Write_Setting=Filling Settings
M-New_WorkBook=New General Report
FR-Designer-Plugin_Has_Been_Actived=Plugin is now active, restart the designer and sever to enable it and the sever need to be manually restarted
@ -1760,7 +1759,7 @@ FR-Base_sure_remove_item=Are you sure to delete the selected item
Component_Scale=Component Scale
Hyperlink-Use_CJK_to_encode_parameter=Use CJK to process parameter
LOG-Has_Been_Openned=Report Has Been Openned
FR-Designer-Dependence=
FR-Designer-Dependence=Dependent environment
ECP_error_pwd=Password Error
REPORTLET=Parameter of access path to template
RWA-Column_Offset=Column Offset
@ -1799,7 +1798,7 @@ ParentCell_Setting=Parent Cell Setting
Only_selected_cell_can_paste_only=Paste when cell is selected
M_Report-Report_Columns=Multi-columns/lines
Unit_Hundred=Hundred
FR-Designer_DataTable-Build=
FR-Designer_DataTable-Build=Speed layered construction
Widget-Form_Widget_Config=Form control
Server-version-tip-moreInfo=Conform the version numbers of FineReport Designer and the deployment server are consistent, in order to avoid the problems caused by inconsistent versions. If you open the template produced by higher designer vision, error may occurs or the original template properties missed. If the Designer Version you used to create the template is higher than the final deployment server version, the server may not be able to properly load the template.
Actions=Task
@ -1819,7 +1818,7 @@ BackgroundTexture-Cork=Cork
M_Format-Data_Map=Data Dictionary
FR-mobile_native_analysis=native analysis
HighLight=High Light
FR-Designer_Dropdown-More-Preview=
FR-Designer_Dropdown-More-Preview=Pull down to get more previews
local=local
FR-Designer_Gradation=Gradation
PageSetup-Finis_Start_Column=Duplicate Last Column
@ -1942,7 +1941,7 @@ Widget-User_Defined=Predefine
Url_location=Absolute path
Disk_File=Disk File
Inside=Inside
FR-Designer_filedChosen=
FR-Designer_filedChosen=Dependent fields
ServerM-Predefined_Styles=Predefined Styles
is_need_word_adjust=Word Auto Adjust
Background-Null=No Background
@ -2122,7 +2121,7 @@ FS-Designer_DS_Filter_Odd_Tip=Odd_Tip
FS-Designer_DS_Filter_Even_Tip=Even_Tip
FS-Designer_DS_Filter_Specify_Tip=Specify_Tip
FR-Designer-AlphaFine_NO_Result=no search result
FR-Designer-Download_Online_Sources=
FR-Designer-Download_Online_Sources=The chart needs to download the latest resource file. Is it installed?
FR-Designer_Select_Color=Select Color
FR-Designer-Basic_Dynamic_Parameter_Injection=Injection
FR-Designer_Label=Label
@ -2131,17 +2130,17 @@ FR-Designer_Insert_Cell_Element=Insert Cell Element
FR-Designer_Add_Condition=Add Condition
FR-Designer_Use_Params_Template=use parameter template
FR-Designer_Label_Name=label name
FR-Designer_Widget_Visible=
FR-Designer_Widget_Display_Report_Tool=
FR-Designer_Cell_Value=
FR-Designer_Cell_Visible=
FR-Designer_Widget_Formula=
FR-Designer_Show=
FR-Designer_Widget_Position=
FR-Designer_Float_Visible=
FR-Designer_Widget_String=
FR-Designer_Widget_Field=
FR-Designer_Widget_Enabled=
FR-Designer_Widget_Visible=Visible control
FR-Designer_Widget_Display_Report_Tool=Display report block toolbar
FR-Designer_Cell_Value=cell value
FR-Designer_Cell_Visible=Cell visible
FR-Designer_Widget_Formula=formula
FR-Designer_Show=display
FR-Designer_Widget_Position=Control location
FR-Designer_Float_Visible=Suspended elements are visible
FR-Designer_Widget_String=Character string
FR-Designer_Widget_Field=field
FR-Designer_Widget_Enabled=Control available
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Sheet_Label_Page_Display_Position=

19
designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -28,7 +28,7 @@ public class WidgetBoundsPaneFactory {
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, boundsPane);
@ -49,19 +49,24 @@ public class WidgetBoundsPaneFactory {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
Component[][] northComponents = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), createRightPane(x, y)},
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER))},
};
Component[][] centerComponents = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), createRightPane(width, height)},
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER))},
};
double[] rowSize = {p, p, p, p};
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
int[][] rowCount = {{1, 1}, {1, 1}};
final JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(northComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6);
final JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
northPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
boundsPane.add(northPanel, BorderLayout.NORTH);
boundsPane.add(centerPanel, BorderLayout.CENTER);
return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, boundsPane);
}
}

141
designer_base/src/com/fr/design/write/submit/CustomJobPane.java

@ -1 +1,140 @@
package com.fr.design.write.submit; import com.fr.base.GraphHelper; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.beans.BasicBeanPane; import com.fr.design.formula.JavaEditorPane; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.general.Inter; import com.fr.stable.StringUtils; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /** * Author : Shockway * Date: 13-7-29 * Time: 下午6:48 */ public abstract class CustomJobPane extends BasicBeanPane { protected UITextField classNameTextField; protected ObjectProperiesPane objectProperiesPane; public static final int DEFAULT_LENGTH = 30; public CustomJobPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(getLengthOfTextField()); reportletNamePane.add(classNameTextField); UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select")); browserButton.setPreferredSize(new Dimension( GraphHelper.getLocTextWidth("FR-Designer_Select") + 20, classNameTextField.getPreferredSize().height)); UIButton editButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); editButton.setPreferredSize(new Dimension( GraphHelper.getLocTextWidth("FR-Designer_Edit") + 20, classNameTextField.getPreferredSize().height)); reportletNamePane.add(browserButton); reportletNamePane.add(editButton); browserButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { final ClassNameSelectPane bPane = new ClassNameSelectPane(); bPane.setClassPath(classNameTextField.getText()); bPane.showWindow( SwingUtilities.getWindowAncestor(getWindowAncestor()), new DialogActionAdapter() { public void doOk() { classNameTextField.setText(bPane.getClassPath()); checkAddButtonEnable(); } }).setVisible(true); } }); editButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final JavaEditorPane javaEditorPane = new JavaEditorPane(classNameTextField.getText(), JavaEditorPane.DEFAULT_SUBMIT_JOB); final BasicDialog dlg = javaEditorPane.showMediumWindow(SwingUtilities.getWindowAncestor(CustomJobPane.this), new DialogActionAdapter() { public void doOk() { classNameTextField.setText(javaEditorPane.getClassText()); checkAddButtonEnable(); } }); javaEditorPane.addSaveActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dlg.doOK(); } }); dlg.setVisible(true); } }); reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_ClassName"), null)); this.add(reportletNamePane, BorderLayout.NORTH); objectProperiesPane = new ObjectProperiesPane(); objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Property"), null)); this.add(objectProperiesPane, BorderLayout.CENTER); UITextArea area = new UITextArea(2, 1); area.setText(Inter.getLocText(new String[]{"Come_True", "Interface"}) + ":com.fr.data.SubmitJob"); JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dsPane.add(area); dsPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Custom_Job_Description"), null)); this.add(dsPane, BorderLayout.SOUTH); checkAddButtonEnable(); } public int getLengthOfTextField() { return DEFAULT_LENGTH; } protected String title4PopupWindow() { return "CustomJob"; } protected Component getWindowAncestor() { return this; } @Override public void populateBean(Object ob) { if (ob instanceof AbstractClassJob) { AbstractClassJob cj = (AbstractClassJob) ob; this.classNameTextField.setText(cj.getClassName()); this.objectProperiesPane.populateBean(cj.getPropertyMap()); checkAddButtonEnable(); } } /** * 添加按钮可用 */ public void checkAddButtonEnable() { objectProperiesPane.enableAddButton(StringUtils.isNotEmpty(classNameTextField.getText())); } /** * 重置 */ public void reset() { this.classNameTextField.setText(null); this.checkAddButtonEnable(); } }
package com.fr.design.write.submit;
import com.fr.base.GraphHelper;
import com.fr.data.AbstractClassJob;
import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.formula.JavaEditorPane;
import com.fr.design.gui.frpane.ObjectProperiesPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Author : Shockway
* Date: 13-7-29
* Time: 下午6:48
*/
public abstract class CustomJobPane extends BasicBeanPane {
protected UITextField classNameTextField;
protected ObjectProperiesPane objectProperiesPane;
public static final int DEFAULT_LENGTH = 30;
public CustomJobPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
classNameTextField = new UITextField(getLengthOfTextField());
reportletNamePane.add(classNameTextField);
UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select"));
browserButton.setPreferredSize(new Dimension(
GraphHelper.getLocTextWidth("FR-Designer_Select") + 20,
classNameTextField.getPreferredSize().height));
UIButton editButton = new UIButton(Inter.getLocText("FR-Designer_Edit"));
editButton.setPreferredSize(new Dimension(
GraphHelper.getLocTextWidth("FR-Designer_Edit") + 20,
classNameTextField.getPreferredSize().height));
reportletNamePane.add(browserButton);
reportletNamePane.add(editButton);
browserButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
final ClassNameSelectPane bPane = new ClassNameSelectPane();
bPane.setClassPath(classNameTextField.getText());
bPane.showWindow(
SwingUtilities.getWindowAncestor(getWindowAncestor()),
new DialogActionAdapter() {
public void doOk() {
classNameTextField.setText(bPane.getClassPath());
checkAddButtonEnable();
}
}).setVisible(true);
}
});
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final JavaEditorPane javaEditorPane = new JavaEditorPane(classNameTextField.getText(), JavaEditorPane.DEFAULT_SUBMIT_JOB);
final BasicDialog dlg = javaEditorPane.showMediumWindow(SwingUtilities.getWindowAncestor(CustomJobPane.this),
new DialogActionAdapter() {
public void doOk() {
classNameTextField.setText(javaEditorPane.getClassText());
checkAddButtonEnable();
}
});
javaEditorPane.addSaveActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dlg.doOK();
}
});
dlg.setVisible(true);
}
});
reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_ClassName"), null));
this.add(reportletNamePane, BorderLayout.NORTH);
objectProperiesPane = new ObjectProperiesPane();
objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Property"), null));
this.add(objectProperiesPane, BorderLayout.CENTER);
UITextArea area = new UITextArea(2, 1);
area.setText(Inter.getLocText(new String[]{"Come_True", "Interface"}) + ":com.fr.data.AbstractSubmitTask");
JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
dsPane.add(area);
dsPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Custom_Job_Description"), null));
this.add(dsPane, BorderLayout.SOUTH);
checkAddButtonEnable();
}
public int getLengthOfTextField() {
return DEFAULT_LENGTH;
}
protected String title4PopupWindow() {
return "CustomJob";
}
protected Component getWindowAncestor() {
return this;
}
@Override
public void populateBean(Object ob) {
if (ob instanceof AbstractClassJob) {
AbstractClassJob cj = (AbstractClassJob) ob;
this.classNameTextField.setText(cj.getClassName());
this.objectProperiesPane.populateBean(cj.getPropertyMap());
checkAddButtonEnable();
}
}
/**
* 添加按钮可用
*/
public void checkAddButtonEnable() {
objectProperiesPane.enableAddButton(StringUtils.isNotEmpty(classNameTextField.getText()));
}
/**
* 重置
*/
public void reset() {
this.classNameTextField.setText(null);
this.checkAddButtonEnable();
}
}

17
designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java

@ -250,26 +250,23 @@ public class MobileWidgetTable extends JTable {
return new String[0][0];
}
//选择的控件
XCreator selectedCreator = designer.getSelectionModel().getSelection().getSelectedCreator();
Widget selectedModel = selectedCreator != null ? selectedCreator.toData() : null;
WFitLayout body = (WFitLayout) designer.getRootComponent().toData();
if (selectedModel == null) {
if (body == null || !body.acceptType(WSortLayout.class)) {
return new String[0][0];
}
// 选择的控件有两种类型,一种是WLayout,代表容器,一种是Widget,代表控件
if (selectedModel.acceptType(WSortLayout.class)) {
List<String> mobileWidgetList = ((WSortLayout) selectedModel).getOrderedMobileWidgetList();
List<String> mobileWidgetList = body.getOrderedMobileWidgetList();
String[][] widgetName = new String[mobileWidgetList.size() + 1][1];
widgetName[0][0] = Inter.getLocText("FR-Designer_WidgetOrder");
for (int i = 0; i < mobileWidgetList.size(); i++) {
widgetName[i + 1][0] = mobileWidgetList.get(i);
}
return widgetName;
} else {
return new String[0][0];
if (!body.isSorted()) {
body.setSorted(true);
}
return widgetName;
}
public boolean isCollapsed() {

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

@ -75,7 +75,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
boundsPane.add(panel);
return boundsPane;
}

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

@ -14,6 +14,7 @@ import com.fr.general.Inter;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
@ -40,32 +41,37 @@ public class PaddingBoundPane extends BasicPane{
bottom.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
left.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
right.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Layout-Padding")), createRightPane(top, bottom)},
new Component[]{null, createRightPane(new UILabel(Inter.getLocText("FR-Designer_Top"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Bottom"), SwingConstants.CENTER))},
new Component[]{null, createRightPane(left, right)},
new Component[]{null, createRightPane(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, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
UILabel label = new UILabel(Inter.getLocText("FR-Designer_Layout-Padding"));
label.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
label.setVerticalAlignment(SwingConstants.TOP);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{label, createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1 );
this.add(panel);
}
public JPanel createRightPane(Component com1, Component com2){
public JPanel createRightPane(){
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] rowSize = {p, p};
double[] columnSize = {f, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{com1, com2}
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components1 = new Component[][]{
new Component[]{top, bottom},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Top"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Bottom"), SwingConstants.CENTER)}
};
Component[][] components2 = new Component[][]{
new Component[]{left, right},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Left"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Right"), SwingConstants.CENTER)}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L1);
JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(components1, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L6);
northPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0));
JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(components2, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L6);
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
panel.add(northPanel, BorderLayout.NORTH);
panel.add(centerPanel, BorderLayout.CENTER);
return panel;
}

Loading…
Cancel
Save