Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

feature/big-screen
Bryant 5 years ago
parent
commit
0825dc9abe
  1. 38
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 29
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  3. 28
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java
  4. 8
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java
  5. 25
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  6. 13
      designer-base/src/main/java/com/fr/design/gui/ispinner/UIBasicSpinner.java
  7. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  8. 5
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  9. 7
      designer-base/src/main/java/com/fr/design/present/DictPresentPane.java
  10. 8
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  11. 8
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  12. 58
      designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java
  13. 35
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetPopWindow.java
  14. 11
      designer-realize/src/main/java/com/fr/design/condition/WHPane.java
  15. 16
      designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java
  16. 1
      designer-realize/src/main/java/com/fr/design/present/PresentPane.java
  17. 9
      designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java
  18. 9
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java

38
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,7 +1,5 @@
package com.fr.design.actions.file; 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.Configuration;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignerEnvManager; 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.VcsOperator;
import com.fr.workspace.server.vcs.git.config.GcConfig; import com.fr.workspace.server.vcs.git.config.GcConfig;
import javax.swing.*; import javax.swing.BorderFactory;
import javax.swing.event.*; import javax.swing.BoxLayout;
import java.awt.*; import javax.swing.JDialog;
import java.awt.event.*; 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.io.File;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.Locale; import java.util.Locale;
@ -663,7 +687,7 @@ public class PreferencePane extends BasicPane {
defaultStringToFormulaBox.setSelected(false); defaultStringToFormulaBox.setSelected(false);
} }
VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager();
if (FineClusterConfig.getInstance().isCluster()) { if (WorkContext.getCurrent().isCluster()) {
vcsEnableCheckBox.setEnabled(false); vcsEnableCheckBox.setEnabled(false);
gcEnableCheckBox.setEnabled(false); gcEnableCheckBox.setEnabled(false);
} }

29
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.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.DialogActionAdapter; 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.gui.iprogressbar.AutoProgressBar;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -73,7 +73,7 @@ public abstract class DesignTableDataManager {
*/ */
private static java.util.Map<String, TableDataWrapper> globalDsCache = new java.util.HashMap<String, TableDataWrapper>(); private static java.util.Map<String, TableDataWrapper> globalDsCache = new java.util.HashMap<String, TableDataWrapper>();
private static java.util.Map<String, String> dsNameChangedMap = new HashMap<String, String>(); private static java.util.Map<String, String> dsNameChangedMap = new HashMap<String, String>();
// private static List<ChangeListener> dsListeners = new ArrayList<ChangeListener>(); private static List<ChangeListener> globalDsListeners = new ArrayList<>();
private static Map<String, List<ChangeListener>> dsListenersMap = new HashMap<String, List<ChangeListener>>(); private static Map<String, List<ChangeListener>> dsListenersMap = new HashMap<String, List<ChangeListener>>();
@ -95,15 +95,19 @@ public abstract class DesignTableDataManager {
* 响应数据集改变. * 响应数据集改变.
*/ */
private static void fireDsChanged() { private static void fireDsChanged() {
fireDsChanged(globalDsListeners);
for (Entry<String, List<ChangeListener>> listenerEntry : dsListenersMap.entrySet()) { for (Entry<String, List<ChangeListener>> listenerEntry : dsListenersMap.entrySet()) {
List<ChangeListener> dsListeners = listenerEntry.getValue(); List<ChangeListener> dsListeners = listenerEntry.getValue();
for (int i = 0; i < dsListeners.size(); i++) { fireDsChanged(dsListeners);
//增强for循环用的iterator实现的, 如果中间哪个listener修改或删除了(如ChartEditPane.dsChangeListener), }
// 由于dsListeners是arraylist, 此时会ConcurrentModifyException }
// for (ChangeListener l : dsListeners) {
ChangeEvent e = null; private static void fireDsChanged(List<ChangeListener> dsListeners) {
dsListeners.get(i).stateChanged(e); 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监听器 * @param l ChangeListener监听器
*/ */
public static void addDsChangeListener(ChangeListener l) { public static void addDsChangeListener(ChangeListener l) {
JTemplate<?, ?> template = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
String key = StringUtils.EMPTY; String key = StringUtils.EMPTY;
if (template != null) { if (template != null) {
key = template.getPath(); key = template.getPath();
@ -178,7 +186,6 @@ public abstract class DesignTableDataManager {
} }
dsListeners.add(l); dsListeners.add(l);
} }
/** /**
* 获取数据源source中dsName的所有字段 * 获取数据源source中dsName的所有字段
* *

28
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 static final long serialVersionUID = 1L;
private boolean refresModel = false; private boolean refresModel = false;
private String treeName; //树数据集本身的名字 private String treeName; //树数据集本身的名字
private ChangeListener changeListener;
public TableDataComboBox(TableDataSource source){ public TableDataComboBox(TableDataSource source){
this(source,StringUtils.EMPTY); this(source,StringUtils.EMPTY);
@ -136,15 +137,22 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
} }
} }
/** /**
*注册listener,相应数据集改变 *注册listener,相应数据集改变
*/ */
public void registerDSChangeListener() { @Override
DesignTableDataManager.addDsChangeListener(new ChangeListener() { public void registerDSChangeListener() {
public void stateChanged(ChangeEvent e) { changeListener = new ChangeListener() {
TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource()); @Override
} public void stateChanged(ChangeEvent e) {
}); TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource());
} }
};
DesignTableDataManager.addDsChangeListener(changeListener);
}
public void registerGlobalDSChangeListener() {
DesignTableDataManager.addGlobalDsChangeListener(changeListener);
}
} }

8
designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java vendored

@ -1,5 +1,6 @@
package com.fr.design.env; package com.fr.design.env;
import com.fr.cluster.engine.remote.ClusterOperator;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -66,7 +67,12 @@ public class RemoteWorkspace implements Workspace {
} }
return isRoot; return isRoot;
} }
@Override
public boolean isCluster() {
return WorkContext.getCurrent().get(ClusterOperator.class).isCluster();
}
@Override @Override
public WorkspaceConnection getConnection() { public WorkspaceConnection getConnection() {

25
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.mainframe.DesignerContext;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; 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.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Cursor; import java.awt.Cursor;
@ -34,6 +25,14 @@ import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.Window; 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.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
@ -72,7 +71,6 @@ abstract class UIControlPane extends JControlPane {
this.creators = this.createNameableCreators(); this.creators = this.createNameableCreators();
initCardPane(); initCardPane();
if (isNewStyle()) { if (isNewStyle()) {
getPopupEditDialog(cardPane); getPopupEditDialog(cardPane);
this.add(getLeftPane(), BorderLayout.CENTER); this.add(getLeftPane(), BorderLayout.CENTER);
@ -148,9 +146,7 @@ abstract class UIControlPane extends JControlPane {
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut(); ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
JPanel leftTopPane = getLeftTopPane(topToolBar); JPanel leftTopPane = getLeftTopPane(topToolBar);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0));
leftPane.add(leftTopPane, BorderLayout.NORTH); leftPane.add(leftTopPane, BorderLayout.NORTH);
@ -171,7 +167,6 @@ abstract class UIControlPane extends JControlPane {
JPanel leftTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel leftTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
leftTopPane.add(toolBarPane, BorderLayout.EAST); leftTopPane.add(toolBarPane, BorderLayout.EAST);
leftTopPane.add(addItemLabel, BorderLayout.CENTER); leftTopPane.add(addItemLabel, BorderLayout.CENTER);
return leftTopPane; return leftTopPane;
} }
@ -202,7 +197,6 @@ abstract class UIControlPane extends JControlPane {
topToolBar.validate(); topToolBar.validate();
this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板 this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板
cardPane.add(controlUpdatePane, "EDIT"); cardPane.add(controlUpdatePane, "EDIT");
this.repaint(); this.repaint();
} }
@ -248,7 +242,6 @@ abstract class UIControlPane extends JControlPane {
return; return;
} }
} }
// 要隐藏 先检查有没有非法输入 // 要隐藏 先检查有没有非法输入
// 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框 // 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框
try { try {
@ -268,6 +261,8 @@ abstract class UIControlPane extends JControlPane {
addWindowFocusListener(new WindowAdapter() { addWindowFocusListener(new WindowAdapter() {
@Override @Override
public void windowLostFocus(WindowEvent e) { public void windowLostFocus(WindowEvent e) {
//在Linux上拉回焦点,不然导致一些面板关不掉
requestFocus();
hideDialog(); hideDialog();
} }
}); });

13
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.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.text.ParseException;
/** /**
* Created by IntelliJ IDEA. * 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) {
}
}
});
} }

4
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.BaseUtils;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.base.vcs.DesignerMode; 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.DesignModelAdapter;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
@ -369,7 +367,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
private void fireVcsActionChange() { private void fireVcsActionChange() {
if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
|| VcsHelper.getInstance().isUnSelectedTemplate() || VcsHelper.getInstance().isUnSelectedTemplate()
|| FineClusterConfig.getInstance().isCluster()) { || WorkContext.getCurrent().isCluster()) {
setEnabled(false); setEnabled(false);
return; return;
} }

5
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -1,7 +1,5 @@
package com.fr.design.mainframe.vcs.common; 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.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.file.HistoryTemplateListCache; 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.Icon;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import java.awt.Color; import java.awt.Color;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
@ -174,7 +171,7 @@ public class VcsHelper implements JTemplateActionListener {
public void templateSaved(JTemplate<?, ?> jt) { public void templateSaved(JTemplate<?, ?> jt) {
if (needInit() if (needInit()
&& DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() && DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable()
&& !FineClusterConfig.getInstance().isCluster()) { && !WorkContext.getCurrent().isCluster()) {
fireVcs(jt); fireVcs(jt);
} }
} }

7
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.base.present.DictPresent;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
@ -13,7 +14,7 @@ import com.fr.design.present.dict.DictionaryPane;
* @author zhou * @author zhou
* @since 2012-5-31上午10:54:20 * @since 2012-5-31上午10:54:20
*/ */
public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> { public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> implements Prepare4DataSourceChange {
private DictionaryPane dictionaryPane; private DictionaryPane dictionaryPane;
public DictPresentPane() { public DictPresentPane() {
@ -50,4 +51,8 @@ public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> {
dictionaryPane.reset(); dictionaryPane.reset();
} }
@Override
public void registerDSChangeListener() {
dictionaryPane.registerDSChangeListener();
}
} }

8
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.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI; 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.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -20,7 +21,7 @@ import java.util.List;
* @author zhou * @author zhou
* @since 2012-5-31下午12:20:41 * @since 2012-5-31下午12:20:41
*/ */
public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI { public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI, Prepare4DataSourceChange {
private TableDataDictPane tableDataDictPane; private TableDataDictPane tableDataDictPane;
@Override @Override
@ -77,4 +78,9 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
paneList.add(new FormulaDictPane()); paneList.add(new FormulaDictPane());
return paneList; return paneList;
} }
@Override
public void registerDSChangeListener() {
tableDataDictPane.registerDSChangeListener();
}
} }

8
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.TableDataTreePane;
import com.fr.design.data.datapane.preview.PreviewLabel; import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable; 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.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.editor.DoubleDeckValueEditorPane; import com.fr.design.editor.DoubleDeckValueEditorPane;
@ -48,7 +49,7 @@ import java.util.List;
* @editor zhou * @editor zhou
* @since 2012-3-29下午1:49:24 * @since 2012-3-29下午1:49:24
*/ */
public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary> implements Previewable, UIObserver { public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary> implements Previewable, UIObserver, Prepare4DataSourceChange {
private static final int BEGIN = 1; private static final int BEGIN = 1;
private static final int END = 10; private static final int END = 10;
private static final int VGAP = 24; private static final int VGAP = 24;
@ -368,4 +369,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return true; return true;
} }
@Override
public void registerDSChangeListener() {
tableDataNameComboBox.registerGlobalDSChangeListener();
}
} }

58
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 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 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 HSPINNER_VALUE = 360f;
private static final float SSPINNER_VALUE = 100f; 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_EIGHT = 255;
private static final int BINARY_FOR_FOUR = 16; private static final int BINARY_FOR_FOUR = 16;
@ -321,7 +321,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
internalChange = true; internalChange = true;
sSpinner.setValue(new Integer((int) (s * S_MAX))); sSpinner.setValue(new Integer((int) (s * S_MAX)));
internalChange = false; internalChange = false;
bSpinner.setValue(new Integer((int) (b * L_MAX))); bSpinner.setValue(new Integer((int) (b * B_MAX)));
revalidate(); revalidate();
} }
@ -338,7 +338,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
internalChange = true; internalChange = true;
hSpinner.setValue(new Integer((int) (h * H_MAX))); hSpinner.setValue(new Integer((int) (h * H_MAX)));
internalChange = false; internalChange = false;
bSpinner.setValue(new Integer((int) (b * L_MAX))); bSpinner.setValue(new Integer((int) (b * B_MAX)));
revalidate(); revalidate();
} }
@ -431,7 +431,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
} }
/** /**
* hsl 监听 * hsb 监听
*/ */
class ImageScrollListener implements ChangeListener { class ImageScrollListener implements ChangeListener {
/** /**
@ -506,7 +506,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
null); null);
internalChange = true; internalChange = true;
adjustHSLValue(hsbVals); adjustHSBValue(hsbVals);
internalChange = false; internalChange = false;
@ -521,11 +521,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
updateHexFields(); updateHexFields();
} }
private void adjustHSLValue(float[] hsbVals) { private void adjustHSBValue(float[] hsbVals) {
if (!spinnerTrigger) { if (!spinnerTrigger) {
hSpinner.setValue(new Integer((int) (hsbVals[0] * HSPINNER_VALUE))); hSpinner.setValue(new Integer((int) (hsbVals[0] * HSPINNER_VALUE)));
sSpinner.setValue(new Integer((int) (hsbVals[1] * SSPINNER_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) { switch (locked) {
case HLOCKED: case HLOCKED:
@ -536,7 +536,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
gradientPoint.x = (int) ((1 gradientPoint.x = (int) ((1
- ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_WIDTH); - ((Number) sSpinner.getValue()).intValue() / SSPINNER_VALUE) * IMG_WIDTH);
gradientPoint.y = (int) ((1 gradientPoint.y = (int) ((1
- ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); - ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE) * IMG_HEIGHT);
} }
break; break;
case SLOCKED: case SLOCKED:
@ -546,7 +546,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
if (!handlingMouse) { if (!handlingMouse) {
gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH); gradientPoint.x = (int) (((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE * IMG_WIDTH);
gradientPoint.y = (int) ((1 gradientPoint.y = (int) ((1
- ((Number) bSpinner.getValue()).intValue() / LSPINNER_VALUE) * IMG_HEIGHT); - ((Number) bSpinner.getValue()).intValue() / BSPINNER_VALUE) * IMG_HEIGHT);
} }
break; break;
case BLOCKED: case BLOCKED:
@ -565,7 +565,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
private void updateImageAndTrack() { private void updateImageAndTrack() {
float h = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; float h = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE;
float s = ((Number) sSpinner.getValue()).intValue() / SSPINNER_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; spinnerTrigger = true;
getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b))); getColorSelectionModel().setSelectedColor(new Color(Color.HSBtoRGB(h, s, b)));
@ -691,11 +691,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
container.add(label); container.add(label);
container.add(mainPanel); container.add(mainPanel);
// hsl和rgb面板 // hsb和rgb面板
JPanel hslAndRgbPanel = new JPanel(); JPanel hsbAndRgbPanel = new JPanel();
hslAndRgbPanel.setLayout(new BorderLayout(0, 16)); hsbAndRgbPanel.setLayout(new BorderLayout(0, 16));
hslAndRgbPanel.add(initialHSLPanel(), BorderLayout.CENTER); hsbAndRgbPanel.add(initialHSBPanel(), BorderLayout.CENTER);
hslAndRgbPanel.add(initialRGBPanel(), BorderLayout.SOUTH); hsbAndRgbPanel.add(initialRGBPanel(), BorderLayout.SOUTH);
// 十六进制面板 // 十六进制面板
JPanel hexPanel = new JPanel(); JPanel hexPanel = new JPanel();
@ -703,7 +703,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
hexPanel.add(new UILabel("#")); hexPanel.add(new UILabel("#"));
hexPanel.add(field); hexPanel.add(field);
mainPanel.add(hslAndRgbPanel, BorderLayout.CENTER); mainPanel.add(hsbAndRgbPanel, BorderLayout.CENTER);
mainPanel.add(hexPanel, BorderLayout.SOUTH); mainPanel.add(hexPanel, BorderLayout.SOUTH);
JPanel rightPane = new JPanel(new BorderLayout()); JPanel rightPane = new JPanel(new BorderLayout());
@ -719,11 +719,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
return container; return container;
} }
//初始化HSL部分 //初始化HSB部分
private JPanel initialHSLPanel() { private JPanel initialHSBPanel() {
hRadio = new UIRadioButton("H"); hRadio = new UIRadioButton("H");
sRadio = new UIRadioButton("S"); sRadio = new UIRadioButton("S");
bRadio = new UIRadioButton("L"); bRadio = new UIRadioButton("B");
ButtonGroup group = new ButtonGroup(); ButtonGroup group = new ButtonGroup();
group.add(hRadio); group.add(hRadio);
group.add(sRadio); group.add(sRadio);
@ -748,27 +748,27 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
sSpinner.addChangeListener(scroll); sSpinner.addChangeListener(scroll);
bSpinner.addChangeListener(scroll); bSpinner.addChangeListener(scroll);
JPanel hslPanel = new JPanel(); JPanel hsbPanel = new JPanel();
hslPanel.setLayout(new GridLayout(3, 0, 0, 5)); hsbPanel.setLayout(new GridLayout(3, 0, 0, 5));
JPanel hPanel = new JPanel(); JPanel hPanel = new JPanel();
hPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); hPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
hPanel.add(hRadio); hPanel.add(hRadio);
hPanel.add(hSpinner); hPanel.add(hSpinner);
hslPanel.add(hPanel); hsbPanel.add(hPanel);
JPanel sPanel = new JPanel(); JPanel sPanel = new JPanel();
sPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); sPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
sPanel.add(sRadio); sPanel.add(sRadio);
sPanel.add(sSpinner); sPanel.add(sSpinner);
hslPanel.add(sPanel); hsbPanel.add(sPanel);
JPanel lPanel = new JPanel(); JPanel lPanel = new JPanel();
lPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0)); lPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 10, 0));
lPanel.add(bRadio); lPanel.add(bRadio);
lPanel.add(bSpinner); lPanel.add(bSpinner);
hslPanel.add(lPanel); hsbPanel.add(lPanel);
return hslPanel; return hsbPanel;
} }
private JPanel initialRGBPanel() { private JPanel initialRGBPanel() {
@ -856,7 +856,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
*/ */
private void updateBLockImage() { private void updateBLockImage() {
int[] pix = new int[IMG_WIDTH * IMG_HEIGHT]; 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; int index = 0;
for (int j = 0; j < IMG_HEIGHT; j++) { 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]; int[] trackPix = new int[TRACK_WIDTH * IMG_HEIGHT];
float hValue = ((Number) hSpinner.getValue()).intValue() / HSPINNER_VALUE; 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; int trackIndex = 0;
for (int j = 0; j < IMG_HEIGHT; j++) { for (int j = 0; j < IMG_HEIGHT; j++) {

35
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.Toolkit;
import java.awt.event.AWTEventListener; import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JWindow; import javax.swing.JWindow;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.location.Location;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.stable.OperatingSystem; import com.fr.stable.os.OperatingSystem;
//august: //august:
public class FormWidgetPopWindow extends JWindow { public class FormWidgetPopWindow extends JWindow {
@ -52,24 +49,28 @@ public class FormWidgetPopWindow extends JWindow {
if (event instanceof MouseEvent) { if (event instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) event; MouseEvent mv = (MouseEvent) event;
if (mv.getClickCount() > 0) { if (mv.getClickCount() > 0) {
Point point = new Point((int) (mv.getLocationOnScreen().getX()), (int) mv.getLocationOnScreen().getY()); hideWindow(mv);
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);
}
}
} }
} }
} }
}; };
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 { private class EditorChoosePane extends JPanel {
public EditorChoosePane() { public EditorChoosePane() {
super(); super();

11
designer-realize/src/main/java/com/fr/design/condition/WHPane.java

@ -33,17 +33,6 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
GUICoreUtils.setColumnForSpinner(spinner, 5); GUICoreUtils.setColumnForSpinner(spinner, 5);
this.spinner.setValue(new Integer(0)); this.spinner.setValue(new Integer(0));
this.locString = locString; this.locString = locString;
final JFormattedTextField textField = ((JSpinner.NumberEditor) this.spinner.getEditor()).getTextField();
textField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
try {
textField.commitEdit();
} catch (ParseException ignore) {
}
}
});
} }
@Override @Override

16
designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java

@ -3,7 +3,7 @@ package com.fr.design.mainframe;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.general.FRFont; import com.fr.general.FRFont;
@ -24,7 +24,7 @@ import java.awt.Color;
*/ */
public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionProvider { public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionProvider {
private static HyperlinkGroupPaneActionProvider instance; private static HyperlinkGroupPaneActionProvider instance;
private static Selection selection ;
private HyperlinkGroupPaneActionImpl() { private HyperlinkGroupPaneActionImpl() {
} }
@ -40,7 +40,9 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
ElementCasePane reportPane = (ElementCasePane)elementCasePane; ElementCasePane reportPane = (ElementCasePane)elementCasePane;
final TemplateElementCase report = reportPane.getEditingElementCase(); final TemplateElementCase report = reportPane.getEditingElementCase();
NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report); NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report);
selection = reportPane.getSelection();
hyperlinkGroupPane.populate(nameHyperlinks); hyperlinkGroupPane.populate(nameHyperlinks);
} }
private NameJavaScriptGroup getNameJSGroup(ElementCasePane reportPane, final TemplateElementCase report) { private NameJavaScriptGroup getNameJSGroup(ElementCasePane reportPane, final TemplateElementCase report) {
@ -67,13 +69,12 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
} }
ElementCasePane reportPane = (ElementCasePane)jt.getCurrentElementCasePane(); ElementCasePane reportPane = (ElementCasePane)jt.getCurrentElementCasePane();
final TemplateElementCase report = reportPane.getEditingElementCase(); final TemplateElementCase report = reportPane.getEditingElementCase();
final Selection sel = reportPane.getSelection();
final NameJavaScriptGroup updateNameHyperlinks = hyperlinkGroupPane.updateJSGroup(); final NameJavaScriptGroup updateNameHyperlinks = hyperlinkGroupPane.updateJSGroup();
if (sel instanceof FloatSelection) { if (selection instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName()); FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)selection).getSelectedFloatName());
selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks); selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks);
} else { } else {
ReportActionUtils.actionIterateWithCellSelection((CellSelection)sel, report, new ReportActionUtils.IterAction() { ReportActionUtils.actionIterateWithCellSelection((CellSelection)selection, report, new ReportActionUtils.IterAction() {
public void dealWith(CellElement editCellElement) { public void dealWith(CellElement editCellElement) {
Style elementStyle = editCellElement.getStyle(); Style elementStyle = editCellElement.getStyle();
FRFont frFont = elementStyle.getFRFont(); FRFont frFont = elementStyle.getFRFont();
@ -94,7 +95,6 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
} }
}); });
} }
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
} }
} }

1
designer-realize/src/main/java/com/fr/design/present/PresentPane.java

@ -75,6 +75,7 @@ public class PresentPane extends UIComboBoxPane<Present> {
displays.add(none.title4PopupWindow()); displays.add(none.title4PopupWindow());
dictPresentPane = new DictPresentPane(); dictPresentPane = new DictPresentPane();
dictPresentPane.registerDSChangeListener();
paneList.add(dictPresentPane); paneList.add(dictPresentPane);
keys.add(DictPresent.class.getName()); keys.add(DictPresent.class.getName());
displays.add(dictPresentPane.title4PopupWindow()); displays.add(dictPresentPane.title4PopupWindow());

9
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); JPanel repeatPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
repeatPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); repeatPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); 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); outfreezePanel.add(freezePanel);
// 重复打印部分 // 重复打印部分
// 重复打印标题的起始行 // 重复打印标题的起始行

9
designer-realize/src/main/java/com/fr/design/webattr/ToolBarDragPane.java

@ -227,6 +227,15 @@ public class ToolBarDragPane extends WidgetToolBarPane {
GUICoreUtils.setEnabled(this, b); GUICoreUtils.setEnabled(this, b);
isEnabled = b; isEnabled = b;
removeAllListener(northToolBar.getToolBarButtons()); removeAllListener(northToolBar.getToolBarButtons());
removeAllListener(southToolBar.getToolBarButtons());
removeToolBarListener(northToolBar);
removeToolBarListener(southToolBar);
}
private void removeToolBarListener(ToolBarPane toolBarPane) {
if (!isEnabled) {
toolBarPane.removeDefaultMouseListener();
}
} }
private void removeAllListener(List<ToolBarButton> toolBarButtons) { private void removeAllListener(List<ToolBarButton> toolBarButtons) {

Loading…
Cancel
Save