diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index e416083f7..29214984c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -96,4 +96,11 @@ public class ProgressDialog extends UIDialog { public void updateLoadingText(String text) { this.text.setText(text); } + + public void updateLoadingText(String text, FRFont font) { + if (font != null) { + this.text.setFont(font); + } + this.text.setText(text); + } } diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index 43710cd0f..8355d4f97 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -395,7 +395,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane support() { + Set set = new HashSet(); + set.add(Locale.KOREA); + return set; + } + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index b935eb11e..1d67c47df 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -8,6 +8,7 @@ import com.fr.design.ui.util.UIUtil; import com.fr.general.ComparatorUtils; import com.fr.general.log.Log4jConfig; import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.third.apache.log4j.spi.ThrowableInformation; @@ -53,12 +54,14 @@ public class DesignerLogHandler { private static final int SERVER_GAP_Y = -20; - private static final String ERROR_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":"; + private static final String ERROR_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + ":"; - private static final String WARN_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + ":"; + private static final String WARN_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":"; private static final String NORMAL_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Normal") + ":"; + private static final String ACTION_MAP_KEY = "clear"; + public static DesignerLogHandler getInstance() { return HOLDER.singleton; @@ -223,14 +226,14 @@ public class DesignerLogHandler { InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction); - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear"); + inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), ACTION_MAP_KEY); ActionMap actionMap = resultPane.getActionMap(); - actionMap.put("clear", new AbstractAction() { + actionMap.put(ACTION_MAP_KEY, new AbstractAction() { @Override public void actionPerformed(ActionEvent evt) { - resultPane.setText(""); + resultPane.setText(StringUtils.EMPTY); caption.clearMessage(); } }); @@ -293,10 +296,10 @@ public class DesignerLogHandler { SimpleAttributeSet attrSet = new SimpleAttributeSet(); if (style == DesignerLogger.ERROR_INT) { - StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); + StyleConstants.setForeground(attrSet, Color.RED); StyleConstants.setBold(attrSet, true); } else if (style == DesignerLogger.WARN_INT) { - StyleConstants.setForeground(attrSet, Color.red); + StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); StyleConstants.setBold(attrSet, true); } else if (style == DesignerLogger.INFO_INT) { StyleConstants.setForeground(attrSet, Color.black); @@ -330,9 +333,9 @@ public class DesignerLogHandler { LogMessageBar.getInstance().setMessage(message); if (level == DesignerLogger.INFO_INT && showInfo.isSelected()) { caption.infoAdd(); - } else if (level == DesignerLogger.ERROR_INT && showError.isSelected()) { + } else if (level == DesignerLogger.WARN_INT && showError.isSelected()) { caption.errorAdd(); - } else if (level == DesignerLogger.WARN_INT && showServer.isSelected()) { + } else if (level == DesignerLogger.ERROR_INT && showServer.isSelected()) { caption.serverAdd(); } } @@ -343,7 +346,7 @@ public class DesignerLogHandler { this.copy.setEnabled(true); this.clear.setEnabled(true); - if (ComparatorUtils.equals(this.jTextArea.getText(), "")) { + if (ComparatorUtils.equals(this.jTextArea.getText(), StringUtils.EMPTY)) { this.selectAll.setEnabled(false); this.clear.setEnabled(false); } @@ -367,7 +370,7 @@ public class DesignerLogHandler { } else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.copy.getText())) { LogHandlerArea.this.jTextArea.copy(); } else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.clear.getText())) { - LogHandlerArea.this.jTextArea.setText(""); + LogHandlerArea.this.jTextArea.setText(StringUtils.EMPTY); caption.clearMessage(); } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 078372183..7e95c48d2 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -2,12 +2,18 @@ package com.fr.start.server; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.gui.iprogressbar.ProgressDialog; +import com.fr.design.i18n.Toolkit; +import com.fr.design.locale.impl.SupportLocaleImpl; import com.fr.design.mainframe.DesignerContext; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.general.FRFont; +import com.fr.general.locale.LocaleAction; +import com.fr.general.locale.LocaleCenter; +import javax.swing.plaf.ColorUIResource; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -27,6 +33,11 @@ public class FineEmbedServerMonitor { private static final int STEP_HEARTBEAT = 40; private static volatile FineEmbedServerMonitor monitor; private static ProgressDialog progressBar = DesignerContext.getDesignerFrame().getProgressDialog(); + //由于默认值的字体不支持韩文,所以要对韩文单独生成字体 + private FRFont font = null; + private static final int FONT_RGB = 333334; + private static final int FONT_SIZE = 14; + private static final String FONT_NAME = "Dialog"; private FineEmbedServerMonitor() { } @@ -86,8 +97,15 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - DesignerContext.getDesignerFrame().getProgressDialog() - .updateLoadingText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server")); + //如果为韩文则改变字体 + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + font = FRFont.getInstance().applySize(FONT_SIZE).applyForeground(new ColorUIResource(FONT_RGB)).applyName(FONT_NAME); + } + }, SupportLocaleImpl.SUPPORT_KOREA); + String text = Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index c6f4ac204..3f5f70aae 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -24,6 +24,8 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.event.ChangeEvent; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; @@ -31,8 +33,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.List; /** * 属性表 数据集界面: 系列名 使用字段名. @@ -129,7 +129,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane { +public class SeriesTypeUseComboxPane extends BasicBeanPane { private SeriesNameUseFieldValuePane nameFieldValuePane; private SeriesNameUseFieldNamePane nameFieldNamePane; @@ -39,50 +40,100 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { private ChartDataPane parent; private Plot initplot; - private boolean isNeedSummary = true; + private boolean isNeedSummary; + + protected UIButtonGroup content; + protected JPanel cardPane; public SeriesTypeUseComboxPane(ChartDataPane parent, Plot initplot) { this.initplot = initplot; this.parent = parent; - cards = initPaneList(); this.isNeedSummary = true; initComponents(); } + protected void initComponents() { + nameFieldValuePane = createValuePane(); + nameFieldNamePane = createNamePane(); + + cardPane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (content.getSelectedIndex() == 0) { + return nameFieldValuePane.getPreferredSize(); + } else { + return nameFieldNamePane.getPreferredSize(); + } + } + }; + cardPane.add(nameFieldValuePane, nameFieldValuePane.title4PopupWindow()); + cardPane.add(nameFieldNamePane, nameFieldNamePane.title4PopupWindow()); + + content = new UIButtonGroup<>(new String[]{nameFieldValuePane.title4PopupWindow(), nameFieldNamePane.title4PopupWindow()}); + + addItemChangeEvent(); + + initLayout(); + content.setSelectedIndex(0); + } + + private void addItemChangeEvent() { + content.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkCardPane(); + + } + }); + } + + protected void checkCardPane() { + comboBoxItemStateChanged(); + CardLayout cl = (CardLayout) cardPane.getLayout(); + if (content.getSelectedIndex() == 0) { + cl.show(cardPane, nameFieldValuePane.title4PopupWindow()); + } else { + cl.show(cardPane, nameFieldNamePane.title4PopupWindow()); + } + } + protected void initLayout() { this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); JPanel northPane = new JPanel(new BorderLayout(4, 0)); - UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); + UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); - northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); + JPanel borderLayoutPane = GUICoreUtils.createBorderLayoutPane(new Component[]{content, null, null, label1, null}); + northPane.add(borderLayoutPane); northPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 0, 15)); cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); - dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); - JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); - panel.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); - dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); + dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); + JPanel panel = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 250, 24, dataScreeningPane); + panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 15)); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.add(panel, BorderLayout.SOUTH); } - protected UIComboBox createComboBox() { - UIComboBox uiComboBox = new UIComboBox(); - UIComponentUtils.setPreferedWidth(uiComboBox, 100); - return uiComboBox; + public Dimension getPreferredSize() { + Dimension preferredSize = super.getPreferredSize(); + return new Dimension(260, (int) preferredSize.getHeight()); } + /** * 检查box 是否使用, hasUse, 表示上层已经使用, 否则, 则此界面都可使用 + * * @param hasUse 是否使用 */ public void checkUseBox(boolean hasUse) { - jcb.setEnabled(hasUse); + content.setEnabled(hasUse); nameFieldValuePane.checkUse(hasUse); dataScreeningPane.checkBoxUse(); } /** * 切换 变更数据集时, 刷新Box选中项目 + * * @param list 列表 */ public void refreshBoxListWithSelectTableData(List list) { @@ -93,28 +144,20 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { /** * 清空所有的box设置 */ - public void clearAllBoxList(){ + public void clearAllBoxList() { nameFieldValuePane.clearAllBoxList(); nameFieldNamePane.clearAllBoxList(); } /** * 界面标题 + * * @return 界面标题 */ protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"); } - @Override - protected List> initPaneList() { - nameFieldValuePane = createValuePane(); - nameFieldNamePane = createNamePane(); - List> paneList = new ArrayList>(); - paneList.add(nameFieldValuePane); - paneList.add(nameFieldNamePane); - return paneList; - } protected SeriesNameUseFieldValuePane createValuePane() { return new SeriesNameUseFieldValuePane(); @@ -135,15 +178,17 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { nameFieldNamePane.populateBean(ob, isNeedSummary); } dataScreeningPane.populateBean(ob, isNeedSummary); + checkCardPane(); } /** * 重新布局整个面板 + * * @param isNeedSummary 是否需要汇总 */ public void relayoutPane(boolean isNeedSummary) { this.isNeedSummary = isNeedSummary; - if (jcb.getSelectedIndex() == 0) { + if (this.getSelectedIndex() == 0) { nameFieldValuePane.relayoutPane(this.isNeedSummary); } else { nameFieldNamePane.relayoutPane(this.isNeedSummary); @@ -152,9 +197,8 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { } - @Override protected void comboBoxItemStateChanged() { - if (jcb.getSelectedIndex() == 0) { + if (this.getSelectedIndex() == 0) { nameFieldValuePane.relayoutPane(this.isNeedSummary); } else { nameFieldNamePane.relayoutPane(this.isNeedSummary); @@ -178,4 +222,21 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { dataScreeningPane.updateBean(ob); } + /** + * 保存数据 + * + * @return 待保存的对象 + */ + public ChartCollection updateBean() { + return null; + } + + + public int getSelectedIndex() { + return content.getSelectedIndex(); + } + + public void setSelectedIndex(int index) { + content.setSelectedIndex(index); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java index a0580ba46..a58a88916 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import javax.swing.JPanel; import javax.swing.border.Border; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -20,7 +21,6 @@ import java.awt.Graphics2D; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.List; public abstract class ThirdTabPane extends BasicBeanPane{ @@ -74,16 +74,6 @@ public abstract class ThirdTabPane extends BasicBeanPane{ } } - @Override - public void paint(Graphics g) { - super.paint(g); - if (!paneList.isEmpty()) { - Graphics2D g2d = (Graphics2D)g; - g2d.setColor(UIConstants.LINE_COLOR); - g2d.drawLine(getWidth() - 2, tabPane.getPreferredSize().height, getWidth() - 2, getHeight() - 1); - } - } - protected void initLayout() { this.setLayout(new BorderLayout()); if (!paneList.isEmpty()) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index ff52dac14..b68833f83 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -760,6 +760,7 @@ public class JWorkBook extends JTemplate { if (centerPane.isUpEditMode()) { if (hasParameterPane()) { parameterPane.populate(u.getApplyTarget()); + setAutoHeightForCenterPane(); DesignModuleFactory.getFormHierarchyPane().refreshRoot(); } } else { @@ -782,6 +783,7 @@ public class JWorkBook extends JTemplate { private void applyAll(WorkBookUndoState u) { if (hasParameterPane()) { parameterPane.populate(u.getApplyTarget()); + setAutoHeightForCenterPane(); DesignModuleFactory.getFormHierarchyPane().refreshRoot(); } //报表主体