diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index e982d04cd5..55ccfce636 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -1,7 +1,5 @@ package com.fr.design.actions.file; -import com.fr.cluster.ClusterBridge; -import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.config.Configuration; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; @@ -47,10 +45,36 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.server.vcs.VcsOperator; import com.fr.workspace.server.vcs.git.config.GcConfig; -import javax.swing.*; -import javax.swing.event.*; -import java.awt.*; -import java.awt.event.*; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.Timer; +import javax.swing.UIManager; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import java.io.File; import java.text.DecimalFormat; import java.util.Locale; @@ -663,7 +687,7 @@ public class PreferencePane extends BasicPane { defaultStringToFormulaBox.setSelected(false); } VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); - if (FineClusterConfig.getInstance().isCluster()) { + if (WorkContext.getCurrent().isCluster()) { vcsEnableCheckBox.setEnabled(false); gcEnableCheckBox.setEnabled(false); } diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index 0018d5333b..44ec26127b 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -20,7 +20,7 @@ import com.fr.design.data.tabledata.wrapper.TableDataFactory; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -73,7 +73,7 @@ public abstract class DesignTableDataManager { */ private static java.util.Map globalDsCache = new java.util.HashMap(); private static java.util.Map dsNameChangedMap = new HashMap(); -// private static List dsListeners = new ArrayList(); + private static List globalDsListeners = new ArrayList<>(); private static Map> dsListenersMap = new HashMap>(); @@ -95,15 +95,19 @@ public abstract class DesignTableDataManager { * 响应数据集改变. */ private static void fireDsChanged() { + fireDsChanged(globalDsListeners); for (Entry> listenerEntry : dsListenersMap.entrySet()) { List dsListeners = listenerEntry.getValue(); - for (int i = 0; i < dsListeners.size(); i++) { - //增强for循环用的iterator实现的, 如果中间哪个listener修改或删除了(如ChartEditPane.dsChangeListener), - // 由于dsListeners是arraylist, 此时会ConcurrentModifyException -// for (ChangeListener l : dsListeners) { - ChangeEvent e = null; - dsListeners.get(i).stateChanged(e); - } + fireDsChanged(dsListeners); + } + } + + private static void fireDsChanged(List dsListeners) { + for (int i = 0; i < dsListeners.size(); i++) { + //增强for循环用的iterator实现的, 如果中间哪个listener修改或删除了(如ChartEditPane.dsChangeListener), + // 由于dsListeners是arraylist, 此时会ConcurrentModifyException + ChangeEvent e = null; + dsListeners.get(i).stateChanged(e); } } @@ -160,13 +164,17 @@ public abstract class DesignTableDataManager { } } + public static void addGlobalDsChangeListener(ChangeListener l) { + globalDsListeners.add(l); + } + /** * 添加模板数据集改变 监听事件. * * @param l ChangeListener监听器 */ public static void addDsChangeListener(ChangeListener l) { - JTemplate template = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); String key = StringUtils.EMPTY; if (template != null) { key = template.getPath(); @@ -178,7 +186,6 @@ public abstract class DesignTableDataManager { } dsListeners.add(l); } - /** * 获取数据源source中dsName的所有字段 * diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java index dddb269bc8..ebbdbf0f35 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java @@ -34,6 +34,7 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC private static final long serialVersionUID = 1L; private boolean refresModel = false; private String treeName; //树数据集本身的名字 + private ChangeListener changeListener; public TableDataComboBox(TableDataSource source){ this(source,StringUtils.EMPTY); @@ -136,15 +137,22 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC } } - /** - *注册listener,相应数据集改变 - */ - public void registerDSChangeListener() { - DesignTableDataManager.addDsChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource()); - } - }); - } + /** + *注册listener,相应数据集改变 + */ + @Override + public void registerDSChangeListener() { + changeListener = new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource()); + } + }; + DesignTableDataManager.addDsChangeListener(changeListener); + } + + public void registerGlobalDSChangeListener() { + DesignTableDataManager.addGlobalDsChangeListener(changeListener); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index 36d8e7f7a5..6a582f1faa 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -1,5 +1,6 @@ package com.fr.design.env; +import com.fr.cluster.engine.remote.ClusterOperator; import com.fr.design.i18n.Toolkit; import com.fr.stable.AssistUtils; import com.fr.workspace.WorkContext; @@ -66,7 +67,12 @@ public class RemoteWorkspace implements Workspace { } return isRoot; } - + + @Override + public boolean isCluster() { + return WorkContext.getCurrent().get(ClusterOperator.class).isCluster(); + } + @Override public WorkspaceConnection getConnection() { diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index d47805de96..6319b239bb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -9,18 +9,9 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.ShortCut; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; - -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JSplitPane; -import javax.swing.border.EmptyBorder; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; @@ -34,6 +25,14 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.Window; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSplitPane; +import javax.swing.border.EmptyBorder; + import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; @@ -72,7 +71,6 @@ abstract class UIControlPane extends JControlPane { this.creators = this.createNameableCreators(); initCardPane(); - if (isNewStyle()) { getPopupEditDialog(cardPane); this.add(getLeftPane(), BorderLayout.CENTER); @@ -148,9 +146,7 @@ abstract class UIControlPane extends JControlPane { topToolBar.setLayout(new BorderLayout()); ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut(); addItem.intoJToolBar(topToolBar); - JPanel leftTopPane = getLeftTopPane(topToolBar); - leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); leftPane.add(leftTopPane, BorderLayout.NORTH); @@ -171,7 +167,6 @@ abstract class UIControlPane extends JControlPane { JPanel leftTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); leftTopPane.add(toolBarPane, BorderLayout.EAST); leftTopPane.add(addItemLabel, BorderLayout.CENTER); - return leftTopPane; } @@ -202,7 +197,6 @@ abstract class UIControlPane extends JControlPane { topToolBar.validate(); this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板 cardPane.add(controlUpdatePane, "EDIT"); - this.repaint(); } @@ -248,7 +242,6 @@ abstract class UIControlPane extends JControlPane { return; } } - // 要隐藏 先检查有没有非法输入 // 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框 try { @@ -268,6 +261,8 @@ abstract class UIControlPane extends JControlPane { addWindowFocusListener(new WindowAdapter() { @Override public void windowLostFocus(WindowEvent e) { + //在Linux上拉回焦点,不然导致一些面板关不掉 + requestFocus(); hideDialog(); } }); diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java index 4b71a2c752..9c9f48fae2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java @@ -7,6 +7,9 @@ import javax.swing.*; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.*; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.text.ParseException; /** * Created by IntelliJ IDEA. @@ -56,7 +59,17 @@ public class UIBasicSpinner extends JSpinner implements UIObserver { } }); } + final JFormattedTextField textField = ((JSpinner.DefaultEditor) this.getEditor()).getTextField(); + textField.addFocusListener(new FocusAdapter() { + @Override + public void focusLost(FocusEvent e) { + try { + textField.commitEdit(); + } catch (ParseException ignore) { + } + } + }); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 2071215985..f24375da1f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -3,8 +3,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; -import com.fr.cluster.ClusterBridge; -import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -369,7 +367,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private void fireVcsActionChange() { if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() || VcsHelper.getInstance().isUnSelectedTemplate() - || FineClusterConfig.getInstance().isCluster()) { + || WorkContext.getCurrent().isCluster()) { setEnabled(false); return; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 547ddf6ae6..8229c9f8d8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -1,7 +1,5 @@ package com.fr.design.mainframe.vcs.common; -import com.fr.cluster.ClusterBridge; -import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; @@ -27,7 +25,6 @@ import com.fr.workspace.server.vcs.git.config.GcConfig; import javax.swing.Icon; import javax.swing.border.EmptyBorder; import java.awt.Color; - import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -174,7 +171,7 @@ public class VcsHelper implements JTemplateActionListener { public void templateSaved(JTemplate jt) { if (needInit() && DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() - && !FineClusterConfig.getInstance().isCluster()) { + && !WorkContext.getCurrent().isCluster()) { fireVcs(jt); } } diff --git a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java index 17733fb1bb..cba37ea19e 100644 --- a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java @@ -5,6 +5,7 @@ import java.awt.event.ItemListener; import com.fr.base.present.DictPresent; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.present.dict.DictionaryPane; @@ -13,7 +14,7 @@ import com.fr.design.present.dict.DictionaryPane; * @author zhou * @since 2012-5-31上午10:54:20 */ -public class DictPresentPane extends FurtherBasicBeanPane { +public class DictPresentPane extends FurtherBasicBeanPane implements Prepare4DataSourceChange { private DictionaryPane dictionaryPane; public DictPresentPane() { @@ -50,4 +51,8 @@ public class DictPresentPane extends FurtherBasicBeanPane { dictionaryPane.reset(); } + @Override + public void registerDSChangeListener() { + dictionaryPane.registerDSChangeListener(); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index 3f62c01703..e50ed86b93 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -5,6 +5,7 @@ import com.fr.data.impl.DynamicSQLDict; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.constants.LayoutConstants; import com.fr.design.data.DataCreatorUI; +import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; @@ -20,7 +21,7 @@ import java.util.List; * @author zhou * @since 2012-5-31下午12:20:41 */ -public class DictionaryPane extends UIComboBoxPane implements DataCreatorUI { +public class DictionaryPane extends UIComboBoxPane implements DataCreatorUI, Prepare4DataSourceChange { private TableDataDictPane tableDataDictPane; @Override @@ -77,4 +78,9 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr paneList.add(new FormulaDictPane()); return paneList; } + + @Override + public void registerDSChangeListener() { + tableDataDictPane.registerDSChangeListener(); + } } diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index ab9d8d90c8..3c08c1c9da 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -16,6 +16,7 @@ import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.preview.PreviewLabel; import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; +import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.editor.DoubleDeckValueEditorPane; @@ -48,7 +49,7 @@ import java.util.List; * @editor zhou * @since 2012-3-29下午1:49:24 */ -public class TableDataDictPane extends FurtherBasicBeanPane implements Previewable, UIObserver { +public class TableDataDictPane extends FurtherBasicBeanPane implements Previewable, UIObserver, Prepare4DataSourceChange { private static final int BEGIN = 1; private static final int END = 10; private static final int VGAP = 24; @@ -368,4 +369,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane public boolean shouldResponseChangeListener() { return true; } + + @Override + public void registerDSChangeListener() { + tableDataNameComboBox.registerGlobalDSChangeListener(); + } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java b/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java index 79ecdc9461..49a3a91254 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java @@ -142,13 +142,13 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec */ private static final UILabel B = new UILabel("B"); - private static final int H_MAX = 365; + private static final int H_MAX = 360; private static final int S_MAX = 100; - private static final int L_MAX = 100; + private static final int B_MAX = 100; private static final float HSPINNER_VALUE = 360f; private static final float SSPINNER_VALUE = 100f; - private static final float LSPINNER_VALUE = 100f; + private static final float BSPINNER_VALUE = 100f; private static final int BINARY_FOR_EIGHT = 255; private static final int BINARY_FOR_FOUR = 16; @@ -321,7 +321,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec internalChange = true; sSpinner.setValue(new Integer((int) (s * S_MAX))); internalChange = false; - bSpinner.setValue(new Integer((int) (b * L_MAX))); + bSpinner.setValue(new Integer((int) (b * B_MAX))); revalidate(); } @@ -338,7 +338,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec internalChange = true; hSpinner.setValue(new Integer((int) (h * H_MAX))); internalChange = false; - bSpinner.setValue(new Integer((int) (b * L_MAX))); + bSpinner.setValue(new Integer((int) (b * B_MAX))); revalidate(); } @@ -431,7 +431,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec } /** - * hsl 监听 + * hsb 监听 */ class ImageScrollListener implements ChangeListener { /** @@ -506,7 +506,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec null); internalChange = true; - adjustHSLValue(hsbVals); + adjustHSBValue(hsbVals); internalChange = false; @@ -521,11 +521,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec updateHexFields(); } - private void adjustHSLValue(float[] hsbVals) { + private void adjustHSBValue(float[] hsbVals) { if (!spinnerTrigger) { hSpinner.setValue(new Integer((int) (hsbVals[0] * HSPINNER_VALUE))); sSpinner.setValue(new Integer((int) (hsbVals[1] * SSPINNER_VALUE))); - bSpinner.setValue(new Integer((int) (hsbVals[2] * LSPINNER_VALUE))); + bSpinner.setValue(new Integer((int) (hsbVals[2] * BSPINNER_VALUE))); } switch (locked) { case HLOCKED: @@ -536,7 +536,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec gradientPoint.x = (int) ((1 - ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_WIDTH); gradientPoint.y = (int) ((1 - - ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); + - ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE) * IMG_HEIGHT); } break; case SLOCKED: @@ -546,7 +546,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec if (!handlingMouse) { gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); gradientPoint.y = (int) ((1 - - ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); + - ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE) * IMG_HEIGHT); } break; case BLOCKED: @@ -565,7 +565,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec private void updateImageAndTrack() { float h = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; float s = ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE; - float b = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; + float b = ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE; spinnerTrigger = true; getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b))); @@ -691,11 +691,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec container.add(label); container.add(mainPanel); - // hsl和rgb面板 - JPanel hslAndRgbPanel = new JPanel(); - hslAndRgbPanel.setLayout(new BorderLayout(0, 16)); - hslAndRgbPanel.add(initialHSLPanel(), BorderLayout.CENTER); - hslAndRgbPanel.add(initialRGBPanel(), BorderLayout.SOUTH); + // hsb和rgb面板 + JPanel hsbAndRgbPanel = new JPanel(); + hsbAndRgbPanel.setLayout(new BorderLayout(0, 16)); + hsbAndRgbPanel.add(initialHSBPanel(), BorderLayout.CENTER); + hsbAndRgbPanel.add(initialRGBPanel(), BorderLayout.SOUTH); // 十六进制面板 JPanel hexPanel = new JPanel(); @@ -703,7 +703,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec hexPanel.add(new UILabel("#")); hexPanel.add(field); - mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER); + mainPanel.add(hsbAndRgbPanel, BorderLayout.CENTER); mainPanel.add(hexPanel, BorderLayout.SOUTH); JPanel rightPane = new JPanel(new BorderLayout()); @@ -719,11 +719,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec return container; } - //初始化HSL部分 - private JPanel initialHSLPanel() { + //初始化HSB部分 + private JPanel initialHSBPanel() { hRadio = new UIRadioButton("H"); sRadio = new UIRadioButton("S"); - bRadio = new UIRadioButton("L"); + bRadio = new UIRadioButton("B"); ButtonGroup group = new ButtonGroup(); group.add(hRadio); group.add(sRadio); @@ -748,27 +748,27 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec sSpinner.addChangeListener(scroll); bSpinner.addChangeListener(scroll); - JPanel hslPanel = new JPanel(); - hslPanel.setLayout(new GridLayout(3, 0, 0, 5)); + JPanel hsbPanel = new JPanel(); + hsbPanel.setLayout(new GridLayout(3, 0, 0, 5)); JPanel hPanel = new JPanel(); hPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); hPanel.add(hRadio); hPanel.add(hSpinner); - hslPanel.add(hPanel); + hsbPanel.add(hPanel); JPanel sPanel = new JPanel(); sPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); sPanel.add(sRadio); sPanel.add(sSpinner); - hslPanel.add(sPanel); + hsbPanel.add(sPanel); JPanel lPanel = new JPanel(); lPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); lPanel.add(bRadio); lPanel.add(bSpinner); - hslPanel.add(lPanel); - return hslPanel; + hsbPanel.add(lPanel); + return hsbPanel; } private JPanel initialRGBPanel() { @@ -856,7 +856,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec */ private void updateBLockImage() { int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; - float bValue = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; + float bValue = ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE; int index = 0; for (int j = 0; j < IMG_HEIGHT; j++) { @@ -1028,7 +1028,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT]; float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; - float bValue = ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE; + float bValue = ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE; int trackIndex = 0; for (int j = 0; j < IMG_HEIGHT; j++) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java index fc3967a992..7f1304d3a1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java @@ -12,14 +12,11 @@ import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.AWTEventListener; import java.awt.event.MouseEvent; - import javax.swing.JPanel; import javax.swing.JWindow; - import com.fr.design.constants.UIConstants; -import com.fr.design.designer.beans.location.Location; import com.fr.design.gui.core.WidgetOption; -import com.fr.stable.OperatingSystem; +import com.fr.stable.os.OperatingSystem; //august: public class FormWidgetPopWindow extends JWindow { @@ -52,24 +49,28 @@ public class FormWidgetPopWindow extends JWindow { if (event instanceof MouseEvent) { MouseEvent mv = (MouseEvent) event; if (mv.getClickCount() > 0) { - Point point = new Point((int) (mv.getLocationOnScreen().getX()), (int) mv.getLocationOnScreen().getY()); - if (OperatingSystem.isWindows()) { - if(!FormWidgetPopWindow.this.contains(point)) { - FormWidgetPopWindow.this.setVisible(false); - } - } else if (OperatingSystem.isMacOS()) { - Dimension d = FormWidgetPopWindow.this.getSize(); - Point p = FormWidgetPopWindow.this.getLocation(); - Rectangle rect = new Rectangle(p, d); - if (!rect.contains(point)) { - FormWidgetPopWindow.this.setVisible(false); - } - } + hideWindow(mv); } } } }; + private void hideWindow(MouseEvent mv){ + Point point = new Point((int) (mv.getLocationOnScreen().getX()), (int) mv.getLocationOnScreen().getY()); + if (OperatingSystem.isWindows()) { + if (!FormWidgetPopWindow.this.contains(point)) { + FormWidgetPopWindow.this.setVisible(false); + } + }else if(OperatingSystem.isMacos() || OperatingSystem.isLinux()){ + Dimension d = FormWidgetPopWindow.this.getSize(); + Point p = FormWidgetPopWindow.this.getLocation(); + Rectangle rect = new Rectangle(p, d); + if (!rect.contains(point)) { + FormWidgetPopWindow.this.setVisible(false); + } + } + } + private class EditorChoosePane extends JPanel { public EditorChoosePane() { super(); diff --git a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java index e92bf212ee..dce2d466ad 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/WHPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/WHPane.java @@ -33,17 +33,6 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane { displays.add(none.title4PopupWindow()); dictPresentPane = new DictPresentPane(); + dictPresentPane.registerDSChangeListener(); paneList.add(dictPresentPane); keys.add(DictPresent.class.getName()); displays.add(dictPresentPane.title4PopupWindow()); diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 1dd75e1633..17cf8566a9 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -214,14 +214,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { JPanel repeatPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); repeatPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - //自适应插件 - if (shouldShowTip()) { - JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attention")); - BoxCenterAligmentPane actionLabel = getURLActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Form_Fit_Tip")); - infoPane.add(actionLabel, BorderLayout.SOUTH); - this.add(infoPane, BorderLayout.SOUTH); - } + outfreezePanel.add(freezePanel); // 重复打印部分 // 重复打印标题的起始行 diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java b/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java index fc3d813523..a8cd06a9b3 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java @@ -227,6 +227,15 @@ public class ToolBarDragPane extends WidgetToolBarPane { GUICoreUtils.setEnabled(this, b); isEnabled = b; removeAllListener(northToolBar.getToolBarButtons()); + removeAllListener(southToolBar.getToolBarButtons()); + removeToolBarListener(northToolBar); + removeToolBarListener(southToolBar); + } + + private void removeToolBarListener(ToolBarPane toolBarPane) { + if (!isEnabled) { + toolBarPane.removeDefaultMouseListener(); + } } private void removeAllListener(List toolBarButtons) {