diff --git a/designer/src/com/fr/design/report/ReportColumnsPane.java b/designer/src/com/fr/design/report/ReportColumnsPane.java index c0414afee..be80e744b 100644 --- a/designer/src/com/fr/design/report/ReportColumnsPane.java +++ b/designer/src/com/fr/design/report/ReportColumnsPane.java @@ -19,6 +19,7 @@ import javax.swing.SpinnerNumberModel; import javax.swing.SwingConstants; import com.fr.base.BaseUtils; +import com.fr.base.GraphHelper; import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UITitledBorder; import com.fr.design.dialog.BasicPane; @@ -109,9 +110,12 @@ public class ReportColumnsPane extends BasicPane{ onOffButtonGroup.addActionListener(onOffListener); UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_ReportColumns-Columns")); - uiLabel.setFont(FRFont.getInstance(FONT_NAME, Font.PLAIN, FONT_SIZE)); + FRFont uiLableFont = FRFont.getInstance(FONT_NAME, Font.PLAIN, FONT_SIZE); + uiLabel.setFont(uiLableFont); uiLabel.setHorizontalAlignment(SwingConstants.CENTER); - uiLabel.setPreferredSize(new Dimension(100,20)); + int uiLabelWidth = GraphHelper.getLocTextWidth("FR-Designer_ReportColumns-Columns", uiLableFont); + + uiLabel.setPreferredSize(new Dimension(uiLabelWidth, 20)); north.add(uiLabel,BorderLayout.WEST); JPanel buttonGroupPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 23,11)); buttonGroupPane.add(onOffButtonGroup); @@ -200,7 +204,7 @@ public class ReportColumnsPane extends BasicPane{ JPanel sampleLablePane = new JPanel(new GridLayout(1,2)); sampleLablePane.setPreferredSize(new Dimension(524, 130)); JPanel rPane = new JPanel(); - UILabel rLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/reportcolumns/row.png")); + UILabel rLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/reportcolumns/" + Inter.getLocText("FR-Designer_Row_Icon_File_Name"))); rLabel.setBorder(BorderFactory.createEmptyBorder(5,45,0,49)); rPane.add(rLabel); rowButton = new UIRadioButton(Inter.getLocText("ReportColumns-Columns_horizontally")); @@ -260,7 +264,7 @@ public class ReportColumnsPane extends BasicPane{ GUICoreUtils.setColumnForSpinner(maxNumberSpinner, 6); maxRadioButton.addActionListener(maxBtnListener); maxUILabel = new UILabel(COLUMN_ROW_TEXTS[rowOrColumn] ); - JPanel maxRowRadioPane = GUICoreUtils.createFlowPane(new JComponent[]{maxRadioButton, maxNumberSpinner, maxUILabel, new UILabel(Inter.getLocText("FR-Designer_ReportColumns-Columns"))}, FlowLayout.CENTER); + JPanel maxRowRadioPane = GUICoreUtils.createFlowPane(new JComponent[]{maxRadioButton, maxNumberSpinner, maxUILabel, new UILabel(Inter.getLocText("FR-Designer_ReportColumns_Columns_Optional"))}, FlowLayout.CENTER); RowMaxOrSetPane.add(maxRowRadioPane); //marks:分成多少行 toXRadioButton = new UIRadioButton(Inter.getLocText("ReportColumns-Columns_to")); @@ -308,7 +312,7 @@ public class ReportColumnsPane extends BasicPane{ rowPane.setBorder(explainBorder); rowPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5,13)); rowPane.setPreferredSize(new Dimension(500,80)); - rowPane.add(new UILabel(Inter.getLocText(new String[]{"ReportColumns-Columns","Data"}) + ":")); + rowPane.add(new UILabel(Inter.getLocText(new String[]{"FR-Designer_ReportColumns_Columns_Optional","Data"}) + ":")); repeatColDataTextField = new UITextField(); repeatColDataTextField.setPreferredSize(new Dimension(107,24)); rowPane.add(repeatColDataTextField); diff --git a/designer/src/com/fr/design/webattr/PageToolBarPane.java b/designer/src/com/fr/design/webattr/PageToolBarPane.java index b9e8c2bf7..5f3df534c 100644 --- a/designer/src/com/fr/design/webattr/PageToolBarPane.java +++ b/designer/src/com/fr/design/webattr/PageToolBarPane.java @@ -27,8 +27,8 @@ import java.util.List; public class PageToolBarPane extends AbstractEditToolBarPane { - private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Center", "Display"})); - private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Left", "Display"})); + private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display")); + private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display")); private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar")); private UICheckBox isShowAsImageBox; diff --git a/designer/src/com/fr/design/webattr/PageWebSettingPane.java b/designer/src/com/fr/design/webattr/PageWebSettingPane.java index 504687e89..ee415da68 100644 --- a/designer/src/com/fr/design/webattr/PageWebSettingPane.java +++ b/designer/src/com/fr/design/webattr/PageWebSettingPane.java @@ -36,8 +36,8 @@ public class PageWebSettingPane extends WebSettingPane { @Override protected JPanel createOtherSetPane() { - centerRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Center", "Display"})); - leftRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Left", "Display"})); + centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display")); + leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display")); ButtonGroup buttonGroup = new ButtonGroup(); leftRadioButton.setSelected(true); buttonGroup.add(centerRadioButton); @@ -45,15 +45,15 @@ public class PageWebSettingPane extends WebSettingPane { JPanel buttonpane = new JPanel(FRGUIPaneFactory.createBoxFlowLayout()); buttonpane.add(centerRadioButton); buttonpane.add(leftRadioButton); - isShowAsImageBox = new UICheckBox(Inter.getLocText("Is_Paint_Page")); - isAutoScaleBox = new UICheckBox(Inter.getLocText("IS_Auto_Scale")); - isTDHeavyBox = new UICheckBox(Inter.getLocText("IS_TD_HEAVY_EXPORT"), false); + isShowAsImageBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Paint_Page")); + isAutoScaleBox = new UICheckBox(Inter.getLocText("FR-Designer_IS_Auto_Scale")); + isTDHeavyBox = new UICheckBox(Inter.getLocText("FR-Designer_IS_TD_HEAVY_EXPORT"), false); double p = TableLayout.PREFERRED; double[] columnSize = { p,p,p}; double[] rowSize = { p, p,p,p }; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Report_Show_Location") + ":", UILabel.RIGHT), buttonpane,null}, - new Component[]{new UILabel(Inter.getLocText("PageSetup-Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.RIGHT), buttonpane,null}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_PageSetup_Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox}, new Component[]{null, isTDHeavyBox, null} }; diff --git a/designer/src/com/fr/design/webattr/ToolBarDragPane.java b/designer/src/com/fr/design/webattr/ToolBarDragPane.java index f606c641f..bd6dd0fc0 100644 --- a/designer/src/com/fr/design/webattr/ToolBarDragPane.java +++ b/designer/src/com/fr/design/webattr/ToolBarDragPane.java @@ -126,25 +126,9 @@ public class ToolBarDragPane extends WidgetToolBarPane { } } }); - layoutTable = new JTable(toolbarButtonTableModel); - layoutTable.setDefaultRenderer(Object.class, tableRenderer); - layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - layoutTable.setColumnSelectionAllowed(false); - layoutTable.setRowSelectionAllowed(false); - layoutTable.setBackground(Color.white); - layoutTable.addMouseListener(new MouseAdapter() { - public void mouseClicked(MouseEvent e) { - if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) { - WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); - Widget widget = no.createWidget(); - ToolBarButton tb = new ToolBarButton(no.optionIcon(), widget); - tb.setNameOption(no); - northToolBar.add(tb); - northToolBar.validate(); - northToolBar.repaint(); - } - } - }); + + initLayoutTable(); + JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane(); center.setBackground(Color.white); center.add(topButton, BorderLayout.NORTH); @@ -178,6 +162,33 @@ public class ToolBarDragPane extends WidgetToolBarPane { isUseToolBarCheckBox.setSelected(true); } + private void initLayoutTable() { + layoutTable = new JTable(toolbarButtonTableModel); + layoutTable.setDefaultRenderer(Object.class, tableRenderer); + layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + layoutTable.setColumnSelectionAllowed(false); + layoutTable.setRowSelectionAllowed(false); + layoutTable.setBackground(Color.white); + int columnWidth = Integer.parseInt(Inter.getLocText("FR-Designer_LayoutTable_Column_Width")); + for (int i = 0; i < layoutTable.getColumnModel().getColumnCount(); i++) { + layoutTable.getColumnModel().getColumn(i).setPreferredWidth(columnWidth); + } + layoutTable.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() > 1 && !(SwingUtilities.isRightMouseButton(e)) && isEnabled) { + WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); + Widget widget = no.createWidget(); + ToolBarButton tb = new ToolBarButton(no.optionIcon(), widget); + tb.setNameOption(no); + northToolBar.add(tb); + northToolBar.validate(); + northToolBar.repaint(); + } + } + }); + } + + private boolean isSelectedtable() { for (int i = 0; i < layoutTable.getColumnCount(); i++) { if (layoutTable.isColumnSelected(i)) { diff --git a/designer/src/com/fr/design/webattr/WriteToolBarPane.java b/designer/src/com/fr/design/webattr/WriteToolBarPane.java index 0abc1049c..70cf35af9 100644 --- a/designer/src/com/fr/design/webattr/WriteToolBarPane.java +++ b/designer/src/com/fr/design/webattr/WriteToolBarPane.java @@ -39,8 +39,8 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top")); private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom")); private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":"); - private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Center", "Display"})); - private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Left", "Display"})); + private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display")); + private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display")); private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT); private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar")); private UIButton editToolBarButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); @@ -76,7 +76,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane { colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); northPane.add(GUICoreUtils.createFlowPane(new Component[]{colorBox, colorButton}, FlowLayout.LEFT)); - unloadCheck = new UICheckBox(Inter.getLocText(new String[]{"Event-unloadcheck", "Tooltips"})); + unloadCheck = new UICheckBox(Inter.getLocText("FR-Designer_Unload_Check")); unloadCheck.setSelected(true); showWidgets = new UICheckBox(Inter.getLocText("FR-Designer_Event_ShowWidgets")); diff --git a/designer/src/com/fr/design/webattr/WriteWebSettingPane.java b/designer/src/com/fr/design/webattr/WriteWebSettingPane.java index e42aca728..92b26b0d5 100644 --- a/designer/src/com/fr/design/webattr/WriteWebSettingPane.java +++ b/designer/src/com/fr/design/webattr/WriteWebSettingPane.java @@ -42,8 +42,7 @@ public class WriteWebSettingPane extends WebSettingPane { @Override protected JPanel createOtherSetPane() { - colorBox = new UICheckBox(Inter.getLocText(new String[]{"Face_Write", "Current", "Edit", "Row", - "Background", "Set"}) + ":"); + colorBox = new UICheckBox(Inter.getLocText("FR-Designer_Set_BG_Of_Current_Row") + ":"); colorBox.setSelected(true); colorButton = new UIColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png")); colorBox.addActionListener(new ActionListener() { @@ -66,15 +65,15 @@ public class WriteWebSettingPane extends WebSettingPane { //Sean: 报表显示位置since 706 rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT); - centerRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Center", "Display"})); - leftRadioButton = new UIRadioButton(Inter.getLocText(new String[]{"Left", "Display"})); + centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display")); + leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display")); ButtonGroup rptShowButtonGroup = new ButtonGroup(); leftRadioButton.setSelected(true); rptShowButtonGroup.add(centerRadioButton); rptShowButtonGroup.add(leftRadioButton); JPanel showLocPane = GUICoreUtils.createFlowPane(new Component[]{rptShowLocationLabel, centerRadioButton, leftRadioButton}, FlowLayout.LEFT); - unloadCheck = new UICheckBox(Inter.getLocText(new String[]{"Event-unloadcheck", "Tooltips"})); + unloadCheck = new UICheckBox(Inter.getLocText("FR-Designer_Unload_Check")); unloadCheck.setSelected(true); showWidgets = new UICheckBox(Inter.getLocText(new String[]{"Event-showWidgets"})); diff --git a/designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java b/designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java index 6a165f874..64e854601 100644 --- a/designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java +++ b/designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java @@ -1 +1 @@ -package com.fr.design.widget.ui; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane extends WritableRepeatEditorPane { private UICheckBox customDataCheckBox; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize(new Dimension(100, 30)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } \ No newline at end of file +package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane extends WritableRepeatEditorPane { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index e5498adeb..34c355f51 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -6,6 +6,7 @@ import java.awt.event.ItemListener; import javax.swing.*; +import com.fr.base.GraphHelper; import com.fr.design.gui.ilable.UILabel; import javax.swing.event.DocumentEvent; @@ -19,6 +20,8 @@ import com.fr.form.ui.FieldEditor; import com.fr.general.Inter; public abstract class FieldEditorDefinePane extends AbstractDataModify { + private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Blank") + 30; + private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; private UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 private UITextField errorMsgTextField; @@ -32,6 +35,24 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); + + initRegErrorMsgTextField(); + + //JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); + allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Blank")); + allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); + allowBlankCheckBox.addItemListener(new ItemListener() { + + @Override + public void itemStateChanged(ItemEvent e) { + errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); + } + }); + + initErrorMsgPane(); + } + + protected void initRegErrorMsgTextField() { regErrorMsgTextField = new UITextField(16); regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { @@ -46,18 +67,9 @@ public abstract class FieldEditorDefinePane extends Abstr regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText()); } }); + } - //JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); - allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank")); - allowBlankCheckBox.setPreferredSize(new Dimension(75, 30)); - allowBlankCheckBox.addItemListener(new ItemListener() { - - @Override - public void itemStateChanged(ItemEvent e) { - errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); - } - }); - + protected void initErrorMsgPane() { // 错误信息 JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":")); @@ -128,7 +140,7 @@ public abstract class FieldEditorDefinePane extends Abstr JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5); validatePane.add(firstPane); JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24); - secondPane.setPreferredSize(new Dimension(310, 23)); + secondPane.setPreferredSize(new Dimension(400, 23)); validatePane.add(secondPane); } diff --git a/designer_base/src/com/fr/design/actions/help/AboutPane.java b/designer_base/src/com/fr/design/actions/help/AboutPane.java index 680aa9b95..4249b2634 100644 --- a/designer_base/src/com/fr/design/actions/help/AboutPane.java +++ b/designer_base/src/com/fr/design/actions/help/AboutPane.java @@ -3,6 +3,7 @@ */ package com.fr.design.actions.help; +import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.BoldFontTextLabel; @@ -26,6 +27,7 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.net.URI; +import java.util.Locale; public class AboutPane extends JPanel { private static final String FINEREPORT = "FineReport"; @@ -66,12 +68,17 @@ public class AboutPane extends JPanel { Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK") })); - if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){ - boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("Service_Phone") + ProductConstants.COMPARE_TELEPHONE); + // 英文去掉服务电话和 QQ + if (FRContext.getLocale() == Locale.ENGLISH || FRContext.getLocale() == Locale.US || FRContext.getLocale() == Locale.UK){ + // do nothing + } else { + if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){ + boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE); + contentPane.add(boxCenterAlignmentPane); + } + boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq")); contentPane.add(boxCenterAlignmentPane); } - boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq")); - contentPane.add(boxCenterAlignmentPane); BoxCenterAligmentPane actionLabel = getURLActionLabel(ProductConstants.WEBSITE_URL); BoxCenterAligmentPane emailLabel = getEmailActionLabel(ProductConstants.SUPPORT_EMAIL); @@ -103,12 +110,12 @@ public class AboutPane extends JPanel { } private String getCopyRight(){ - return append(Inter.getLocText("About-CopyRight"), COPYRIGHT_LABEL, + return append(Inter.getLocText("FR-Designer_About_CopyRight"), COPYRIGHT_LABEL, ProductConstants.HISTORY, StringUtils.BLANK, ProductConstants.COMPANY_NAME); } private String getBuildTitle() { - return append(ProductConstants.APP_NAME, Inter.getLocText("About-Version"), + return append(ProductConstants.APP_NAME, Inter.getLocText("FR-Designer_About_Version"), StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX); } diff --git a/designer_base/src/com/fr/design/editor/editor/DateEditor.java b/designer_base/src/com/fr/design/editor/editor/DateEditor.java index cef908aa6..17fc58077 100644 --- a/designer_base/src/com/fr/design/editor/editor/DateEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/DateEditor.java @@ -15,6 +15,7 @@ import java.awt.event.ItemListener; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; /** * CellEditor used to edit Date object. @@ -59,7 +60,10 @@ public class DateEditor extends Editor { this.setLayout(FRGUIPaneFactory.createBorderLayout()); uiDatePicker = new UIDatePicker(); if (format) { - uiDatePicker.setStyle(uiDatePicker.STYLE_CN_DATE); + int dateStyle = (FRContext.getLocale() == Locale.ENGLISH + || FRContext.getLocale() == Locale.US + || FRContext.getLocale() == Locale.UK) ? uiDatePicker.STYLE_EN_DATE : uiDatePicker.STYLE_CN_DATE; + uiDatePicker.setStyle(dateStyle); uiDatePicker.setEditable(false); } uiDatePicker.addItemListener(new ItemListener() { diff --git a/designer_base/src/com/fr/design/gui/date/UIDatePicker.java b/designer_base/src/com/fr/design/gui/date/UIDatePicker.java index c2ee8ab31..3a102de90 100644 --- a/designer_base/src/com/fr/design/gui/date/UIDatePicker.java +++ b/designer_base/src/com/fr/design/gui/date/UIDatePicker.java @@ -31,6 +31,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { public static final int STYLE_CN_DATE1 = 1; public static final int STYLE_CN_DATETIME = 2; public static final int STYLE_CN_DATETIME1 = 3; + public static final int STYLE_EN_DATE = 4; public boolean isWillHide = false; /** * 日期格式类型 @@ -113,6 +114,8 @@ public class UIDatePicker extends UIComboBox implements Serializable { return new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); case STYLE_CN_DATETIME1: return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + case STYLE_EN_DATE: + return new SimpleDateFormat("MM/dd/yyyy"); default: throw new UnsupportedOperationException( "invalid formatStyle parameter!"); diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java b/designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java index 0973fd363..dcc44f630 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java @@ -30,6 +30,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G private static final int SIZE_2 = 2; private static final int SIZE_4 = 4; private static final int SIZE_6 = 6; + private static final int POPUP_MENU_SHIFT = -70; private Color color = Color.BLACK; private ColorControlWindow popupWin; private EventListenerList colorChangeListenerList = new EventListenerList(); @@ -126,7 +127,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G popupWin = this.getColorControlWindow(); - GUICoreUtils.showPopupMenu(popupWin, this, 0, this.getSize().height); + GUICoreUtils.showPopupMenu(popupWin, this, POPUP_MENU_SHIFT, this.getSize().height); } /** diff --git a/designer_base/src/com/fr/design/images/reportcolumns/col_en.png b/designer_base/src/com/fr/design/images/reportcolumns/col_en.png new file mode 100644 index 000000000..14f73966d Binary files /dev/null and b/designer_base/src/com/fr/design/images/reportcolumns/col_en.png differ diff --git a/designer_base/src/com/fr/design/images/reportcolumns/row_en.png b/designer_base/src/com/fr/design/images/reportcolumns/row_en.png new file mode 100644 index 000000000..7c66662a2 Binary files /dev/null and b/designer_base/src/com/fr/design/images/reportcolumns/row_en.png differ diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 5caabf622..3f809fb4a 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -510,6 +510,13 @@ FR-Designer_Create_Tree= FR-Designer_Set_Callback_Function= FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Title= +FR-Designer_LayoutTable_Column_Width=160 +FR-Designer_Set_BG_Of_Current_Row=Set BG of the row being edited +FR-Designer_Unload_Check=Prompt users when leave without submitting +FR-Designer_ReportColumns_Columns_Optional= +FR-Designer_Row_Icon_File_Name=row.png +FR-Designer_Center_Display=Center +FR-Designer_Left_Display=Left FR-Designer_Background_Null= FR-Designer_Background_Color= FR-Designer_Background_Texture= @@ -523,4 +530,12 @@ FR-Designer_setCarousel= FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= \ No newline at end of file +FR-Designer_Mouse_Click_Tips= +FR-Designer_About_Version=Version +FR-Designer_About_CopyRight=Copy Right +FR-Designer_Service_Phone=Service Phone +FR-Designer_Allow_Blank=Allow Blank +FR-Designer_PageSetup_Page=Page +FR-Designer_Custom_Job_Description=Description +FR-Designer_Property=Property +FR-Designer_ClassName=Class Name \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 91668466a..30db869a2 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -181,7 +181,7 @@ FR-Designer_Support_QQ=Support online FR-Designer_Swatch=Swatch FR-Designer_Tab_title=Tab title FR-Designer_TableData=Data set -FR-Designer_Thank_guest=Special Thanks +FR-Designer_Thank_guest=Special thanks to FR-Designer_Thanks-To=Thanks FR-Designer_Title=Title FR-Designer_Total=Total @@ -510,6 +510,13 @@ FR-Designer_Create_Tree=Build Tree FR-Designer_Set_Callback_Function=Set Callback Function FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Title= +FR-Designer_LayoutTable_Column_Width=250 +FR-Designer_Set_BG_Of_Current_Row=Set BG of the row being edited +FR-Designer_Unload_Check=Prompt users when leave without submitting +FR-Designer_ReportColumns_Columns_Optional=\u3000 +FR-Designer_Row_Icon_File_Name=row_en.png +FR-Designer_Center_Display=Center +FR-Designer_Left_Display=Left FR-Designer_Background_Null=No Background FR-Designer_Background_Color=Color FR-Designer_Background_Texture=Texture @@ -523,4 +530,12 @@ FR-Designer_setCarousel= FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips=Initial background of the button FR-Designer_Mouse_Move_Tips=Move the mouse to the button on the background, in the absence of not changing the background -FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in the absence of not changing the background \ No newline at end of file +FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in the absence of not changing the background +FR-Designer_About_Version=Version +FR-Designer_About_CopyRight=Copy Right +FR-Designer_Service_Phone=Service Phone +FR-Designer_Allow_Blank=Allow Null +FR-Designer_PageSetup_Page=Page +FR-Designer_Custom_Job_Description=Description +FR-Designer_Property=Property +FR-Designer_ClassName=Class Name diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 2e0ca9c92..ba6114955 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -489,6 +489,13 @@ FR-Designer_Create_Tree= FR-Designer_Set_Callback_Function= FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Title= +FR-Designer_LayoutTable_Column_Width=160 +FR-Designer_Set_BG_Of_Current_Row=\u5831\u544A\u30AB\u30EC\u30F3\u30C8\u7DE8\u96C6\u884C\u80CC\u666F\u8A2D\u5B9A +FR-Designer_Unload_Check=\u63D0\u51FA\u305B\u305A\u306B\u30D2\u30F3\u30C8 +FR-Designer_ReportColumns_Columns_Optional=\u6BB5\u7D44\u307F +FR-Designer_Row_Icon_File_Name=row.png +FR-Designer_Center_Display=\u4E2D\u592E\u63C3\u3048\u8868\u793A +FR-Designer_Left_Display=\u5DE6\u8868\u793A FR-Designer_Background_Null= FR-Designer_Background_Color= FR-Designer_Background_Texture= @@ -502,4 +509,12 @@ FR-Designer_setCarousel= FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= \ No newline at end of file +FR-Designer_Mouse_Click_Tips= +FR-Designer_About_Version=\u30D0\u30FC\u30B8\u30E7\u30F3 +FR-Designer_About_CopyRight=\u8457\u4F5C\u6A29\u6240\u6709 +FR-Designer_Service_Phone=\u30B5\u30FC\u30D3\u30B9\u96FB\u8A71\uFF1A +FR-Designer_Allow_Blank=\u7A7A\u6B04\u3042\u308A +FR-Designer_PageSetup_Page=\u30DA\u30FC\u30B8 +FR-Designer_Custom_Job_Description=\u8A18\u8FF0 +FR-Designer_Property=\u5C5E\u6027 +FR-Designer_ClassName=\u985E\u540D diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index b86f0d900..9d540cd01 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -459,14 +459,14 @@ FR-Designer-DS-Database_Query=\uB370\uC774\uD130\uBCA0\uC774\uC2A4\uCC3E\uC544\u FR-Designer_Is_Share_DBTableData=\uB370\uC774\uD130\uC138\uD2B8\uACF5\uC720 FR-Designer-LayerPageReport_PageQuery=\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30 FR-Designer-LayerPageReport_Define_PageQuerySQL=\uC815\uC758\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30sql -FR-Designer_Event=\ +FR-Designer_Event= FR-Designer_Properties=\uFFFD FR-Designer_Export_failed=\uB0B4\uBCF4\uB0B4\uAE30\uC2E4\uD328 FR-Designer_Exported_successfully=\uB0B4\uBCF4\uB0B4\uAE30\uC131\uACF5 FR-Designer_Exporting=\uB0B4\uBCF4\uB0B4\uAE30\uC911 -FR-Designer_Export-PDF=PDF\uC11C\uC2DDFR-Designer_Properties=\uFFFD -FR-Designer_Button_OK=\uD655\uC778FR-Designer_Button_Cancel=\uCDE8\uC18C -\uFFFD +FR-Designer_Export-PDF=PDF\uC11C\uC2DD +FR-Designer_Button_OK=\uD655\uC778 +FR-Designer_Button_Cancel=\uCDE8\uC18C FR-Designer_JavaScript= FR-Designer_JavaScript_Form_Submit= FR-Designer_JavaScript_Commit_to_Database= @@ -484,6 +484,13 @@ FR-Designer_Create_Tree= FR-Designer_Set_Callback_Function= FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Title= +FR-Designer_LayoutTable_Column_Width=160 +FR-Designer_Set_BG_Of_Current_Row=\uAE30\uC785\uD604\uC7AC\uD3B8\uC9D1\uD589\uBC30\uACBD\uC124\uC815 +FR-Designer_Unload_Check=\uBBF8\uC81C\uCD9C\uB098\uAC14\uC74C\uC54C\uB9BC +FR-Designer_ReportColumns_Columns_Optional=\uC140\uB098\uB204\uAE30 +FR-Designer_Row_Icon_File_Name=row.png +FR-Designer_Center_Display=\uAC00\uC6B4\uB370\uC815\uB82C\uBCF4\uC774\uAE30 +FR-Designer_Left_Display=\uC67C\uCABD\uBCF4\uC774\uAE30 FR-Designer_Background_Null= FR-Designer_Background_Color= FR-Designer_Background_Texture= @@ -497,4 +504,12 @@ FR-Designer_setCarousel= FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= \ No newline at end of file +FR-Designer_Mouse_Click_Tips= +FR-Designer_About_Version=\uBC84\uC804 +FR-Designer_About_CopyRight=\uD310\uAD8C\uC18C\uC720 +FR-Designer_Service_Phone=\uC11C\uBE44\uC2A4\uC804\uD654\uFF1A +FR-Designer_Allow_Blank=\uBE48\uCE78\uD5C8\uC6A9 +FR-Designer_PageSetup_Page=\uC6F9\uD398\uC774\uC9C0 +FR-Designer_Custom_Job_Description=\uC124\uBA85 +FR-Designer_Property=\uC18D\uC131 +FR-Designer_ClassName=\uD074\uB798\uC2A4\uB124\uC784 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 659fe3737..54f0ac177 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -514,6 +514,13 @@ FR-Designer_Create_Tree=\u6784\u5EFA\u6811 FR-Designer_Set_Callback_Function=\u8BBE\u7F6E\u56DE\u8C03\u51FD\u6570 FR-Designer_ConfirmDialog_Content=\u662F\u5426\u786E\u5B9A\u5220\u9664tab\u63A7\u4EF6 FR-Designer_ConfirmDialog_Title=FineReport 8.0 +FR-Designer_LayoutTable_Column_Width=160 +FR-Designer_Set_BG_Of_Current_Row=\u586B\u62A5\u5F53\u524D\u7F16\u8F91\u884C\u80CC\u666F\u8BBE\u7F6E +FR-Designer_Unload_Check=\u672A\u63D0\u4EA4\u79BB\u5F00\u63D0\u793A +FR-Designer_ReportColumns_Columns_Optional=\u5206\u680F +FR-Designer_Row_Icon_File_Name=row.png +FR-Designer_Center_Display=\u5C45\u4E2D\u5C55\u793A +FR-Designer_Left_Display=\u5DE6\u5C55\u793A FR-Designer_Background_Null=\u6CA1\u6709\u80CC\u666F FR-Designer_Background_Color=\u989C\u8272 FR-Designer_Background_Texture=\u7EB9\u7406 @@ -528,3 +535,12 @@ FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694 FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F +FR-Designer_About_Version=\u7248\u672C +FR-Designer_About_CopyRight=\u7248\u6743\u6240\u6709 +FR-Designer_Service_Phone=\u670D\u52A1\u7535\u8BDD\uFF1A +FR-Designer_Allow_Blank=\u5141\u8BB8\u4E3A\u7A7A +FR-Designer_PageSetup_Page=\u9875\u9762 +FR-Designer_Custom_Job_Description=\u63CF\u8FF0 +FR-Designer_Property=\u5C5E\u6027 +FR-Designer_ClassName=\u7C7B\u540D + diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 5cff5b570..271150729 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -502,6 +502,13 @@ FR-Designer_Create_Tree= FR-Designer_Set_Callback_Function= FR-Designer_ConfirmDialog_Content= FR-Designer_ConfirmDialog_Title= +FR-Designer_LayoutTable_Column_Width=160 +FR-Designer_Set_BG_Of_Current_Row=\u586B\u5831\u7576\u524D\u7DE8\u8F2F\u5217\u80CC\u666F\u8A2D\u5B9A +FR-Designer_Unload_Check=\u672A\u63D0\u4EA4\u96E2\u958B\u63D0\u793A +FR-Designer_ReportColumns_Columns_Optional=\u5831\u8868\u6B04\u4F4D +FR-Designer_Row_Icon_File_Name=row.png +FR-Designer_Center_Display=\u7F6E\u4E2D\u986F\u793A +FR-Designer_Left_Display=\u5DE6\u986F\u793A FR-Designer_Background_Null= FR-Designer_Background_Color= FR-Designer_Background_Texture= @@ -515,4 +522,12 @@ FR-Designer_setCarousel= FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= \ No newline at end of file +FR-Designer_Mouse_Click_Tips= +FR-Designer_About_Version=\u7248\u672C +FR-Designer_About_CopyRight=\u7248\u6B0A\u6240\u6709 +FR-Designer_Service_Phone=\u670D\u52D9\u96FB\u8A71\uFF1A +FR-Designer_Allow_Blank=\u5141\u8A31\u70BA\u7A7A\u767D +FR-Designer_PageSetup_Page=\u9801\u9762 +FR-Designer_Custom_Job_Description=\u63CF\u8FF0 +FR-Designer_Property=\u5C6C\u6027 +FR-Designer_ClassName=\u985E\u540D diff --git a/designer_base/src/com/fr/design/style/color/ColorSelectPane.java b/designer_base/src/com/fr/design/style/color/ColorSelectPane.java index 743a71ce4..91d2b06df 100644 --- a/designer_base/src/com/fr/design/style/color/ColorSelectPane.java +++ b/designer_base/src/com/fr/design/style/color/ColorSelectPane.java @@ -71,11 +71,8 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable centerPane.add(getRow1Pane()); - JPanel menuColorPane1 = new JPanel(); + JPanel menuColorPane1 = getMenuColorPane(); centerPane.add(menuColorPane1); - - menuColorPane1.setLayout(new GridLayout(5, 8, 1, 1)); - menuColorPane1.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); Color[] colorArray = this.getColorArray(); for (int i = 0; i < colorArray.length; i++) { Color color = colorArray[i] == null ? UsedColorPane.DEFAULT_COLOR : colorArray[i]; @@ -94,24 +91,28 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable }); customButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); JPanel centerPane1 = FRGUIPaneFactory.createBorderLayout_S_Pane(); - centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 0, 8)); + centerPane1.setBorder(BorderFactory.createEmptyBorder(2, 8, 8, 8)); centerPane1.add(customButton, BorderLayout.NORTH); centerPane.add(centerPane1); } + protected JPanel getMenuColorPane() { + JPanel menuColorPane = new JPanel(); + menuColorPane.setLayout(new GridLayout(5, 8, 1, 1)); + menuColorPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); + + return menuColorPane; + } + // 第一行,1个取色按钮 + 7个最近使用的颜色 - private JPanel getRow1Pane() { + protected JPanel getRow1Pane() { JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout()); row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0)); row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7 - // 取色按钮 - UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON16, true); - row1Pane.add(pickColorButton, BorderLayout.WEST); - // 最近使用 - UsedColorPane usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this); - usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8)); + UsedColorPane usedColorPane = new UsedColorPane(1, 8, 1, ColorSelectConfigManager.getInstance().getColors(), this, true, true); + usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8)); row1Pane.add(usedColorPane.getPane()); return row1Pane; } diff --git a/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java b/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java index 85363b0e6..2f22a9f8f 100644 --- a/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer_base/src/com/fr/design/style/color/CustomChooserPanel.java @@ -1,15 +1,7 @@ package com.fr.design.style.color; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Graphics; -import java.awt.GridLayout; -import java.awt.Image; -import java.awt.Point; +import java.awt.*; import java.awt.event.*; import java.awt.image.MemoryImageSource; import java.util.regex.Matcher; @@ -29,6 +21,7 @@ import javax.swing.event.DocumentListener; import javax.swing.text.BadLocationException; import javax.swing.text.Document; +import com.fr.design.gui.ibutton.SpecialUIButton; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; @@ -709,12 +702,20 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec hexPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 0)); hexPanel.add(new UILabel("#")); hexPanel.add(field); - UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true); - hexPanel.add(pickColorButton); mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER); mainPanel.add(hexPanel, BorderLayout.SOUTH); + JPanel rightPane = new JPanel(new BorderLayout()); + SpecialUIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true); + JPanel blankArea = new JPanel(); + blankArea.setPreferredSize(new Dimension(100, 175)); + rightPane.add(blankArea, BorderLayout.CENTER); + JPanel buttonPane = new JPanel(new BorderLayout()); + buttonPane.add(pickColorButton, BorderLayout.WEST); + rightPane.add(buttonPane, BorderLayout.SOUTH); + container.add(rightPane); + return container; } diff --git a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java index ba28b4201..b9903a81f 100644 --- a/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer_base/src/com/fr/design/style/color/NewColorSelectPane.java @@ -79,19 +79,14 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); this.add(centerPane, BorderLayout.CENTER); - // 第一行,1个取色按钮 + 7个最近使用的颜色 + // 第一行 JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout()); row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0)); row1Pane.setPreferredSize(new Dimension(135, 16)); // 宽度为 16 * 8 + 7 centerPane.add(row1Pane); - - // 取色按钮 - UIButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON16); - row1Pane.add(pickColorButton, BorderLayout.WEST); - // 最近使用 - usedColorPane = new UsedColorPane(1, 7, ColorSelectConfigManager.getInstance().getColors(),this); - usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 8)); + usedColorPane = new UsedColorPane(1, 8, 1, ColorSelectConfigManager.getInstance().getColors(), this, true, false); + usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8)); row1Pane.add(usedColorPane.getPane()); JPanel menuColorPane1 = new JPanel(); diff --git a/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java b/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java index 32188ff4e..19d0c86ee 100644 --- a/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java +++ b/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java @@ -1,8 +1,10 @@ package com.fr.design.style.color; import com.fr.base.BaseUtils; -import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.SpecialUIButton; +import javax.swing.*; +import javax.swing.plaf.ButtonUI; import java.awt.*; import java.awt.event.*; @@ -10,21 +12,29 @@ import java.awt.event.*; * Created by plough on 2016/12/22. */ public class PickColorButtonFactory { + private static int iconSize; + private static final int SIZE_16 = 16; + private static final int SIZE_18 = 18; + private static IconType iconType; + private static Image iconImage; - public static UIButton getPickColorButton(ColorSelectable colorSelectable, IconType iconType) { + public static SpecialUIButton getPickColorButton(ColorSelectable colorSelectable, IconType iconType) { return getPickColorButton(colorSelectable, iconType, false); } - public static UIButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final Boolean setColorRealTime) { - UIButton pickColorButton = new UIButton(); + public static SpecialUIButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) { + SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI()); + PickColorButtonFactory.iconType = iconType; if (iconType == IconType.ICON16) { - pickColorButton.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorPicker/colorPicker16.png")); - pickColorButton.setPreferredSize(new Dimension(16, 16)); + iconImage = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPicker16.png"); + iconSize = SIZE_16; } else { - pickColorButton.setIcon(BaseUtils.readIcon("/com/fr/design/images/gui/colorPicker/colorPicker18.png")); - pickColorButton.setPreferredSize(new Dimension(18, 18)); + iconImage = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPicker18.png"); + iconSize = SIZE_18; + pickColorButton.setBorderPainted(false); } + pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize)); pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); pickColorButton.addMouseListener(new MouseAdapter() { @@ -41,4 +51,28 @@ public class PickColorButtonFactory { public enum IconType { ICON16, ICON18 } + + private static class WhiteButtonUI extends ButtonUI { + @Override + public void paint(Graphics g, JComponent c) { + super.paint(g, c); + Dimension size = c.getSize(); + g.setColor(Color.white); + g.fillRoundRect(0, 0, size.width - 1, size.height - 1, 1, 1); + g.setColor(new Color(153, 153, 153)); // #999999 + g.drawRoundRect(0, 0, size.width - 1, size.height - 1, 1, 1); + if (iconType == IconType.ICON16) { + g.drawImage( + iconImage, + (size.width - iconImage.getWidth(null)) / 2, + (size.height - iconImage.getHeight(null)) / 2, + iconImage.getWidth(null), + iconImage.getHeight(null), + null + ); + } else { + g.drawImage(iconImage, 0, 0, iconSize, iconSize, null); + } + } + } } diff --git a/designer_base/src/com/fr/design/style/color/UsedColorPane.java b/designer_base/src/com/fr/design/style/color/UsedColorPane.java index 37f14fa00..c8dfdcaec 100644 --- a/designer_base/src/com/fr/design/style/color/UsedColorPane.java +++ b/designer_base/src/com/fr/design/style/color/UsedColorPane.java @@ -7,6 +7,7 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.SpecialUIButton; public class UsedColorPane extends BasicPane{ @@ -16,6 +17,12 @@ public class UsedColorPane extends BasicPane{ private int columns; // 最近使用面板行数 private int rows; + // 留白的单元格数量 + private int reserveCells; + // 是否需要取色器按钮 + private boolean needPickColorButton; + // 是否在取色时实时设定颜色 + private boolean setColorRealTime; // 最近使用颜色 private Object[] colors; // 最近使用面板 @@ -40,15 +47,25 @@ public class UsedColorPane extends BasicPane{ * * @param rows 行 * @param columns 列 + * @param reserveCells 留白的单元格个数 * @param colors 最近使用的颜色 + * @param needPickColorButton 是否需要加上取色器按钮 + * @param setColorRealTime 取色器是否实时设定颜色 */ - public UsedColorPane(int rows,int columns,Object[] colors,ColorSelectable selectable){ + public UsedColorPane(int rows,int columns,int reserveCells, Object[] colors, ColorSelectable selectable, boolean needPickColorButton, boolean setColorRealTime){ this.columns = columns; this.rows = rows; + this.reserveCells = reserveCells; this.colors = colors; this.selectable = selectable; + this.needPickColorButton = needPickColorButton; + this.setColorRealTime = setColorRealTime; initialComponents(); } + + public UsedColorPane(int rows,int columns, Object[] colors,ColorSelectable selectable){ + this(rows, columns, 0, colors, selectable, false, false); + } private void initialComponents(){ int total = columns * rows; @@ -57,9 +74,25 @@ public class UsedColorPane extends BasicPane{ panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8)); Color[] colors = ColorSelectConfigManager.getInstance().getColors(); int size = colors.length; - for (int i = 0; i < total; i++) { + + int i = 0; + if (needPickColorButton) { + // 取色按钮 + SpecialUIButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime); + panel.add(pickColorButton); + i++; + this.reserveCells += 1; + } + while (i < this.reserveCells) { + ColorCell cc = new ColorCell(DEFAULT_COLOR, selectable); + cc.setVisible(false); + panel.add(cc); + i++; + } + while (i < total) { Color color = i < size ? colors[size-1-i]: DEFAULT_COLOR; panel.add(new ColorCell(color == null ? DEFAULT_COLOR : color, selectable)); + i++; } this.pane = panel; } @@ -72,7 +105,7 @@ public class UsedColorPane extends BasicPane{ int total = columns * rows; Color[] colors = ColorSelectConfigManager.getInstance().getColors(); int size = colors.length; - for(int i=0; i