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. 19
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  3. 12
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataComboBox.java
  4. 6
      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. 19
      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. 7
      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;
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);
}

19
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<String, TableDataWrapper> globalDsCache = new java.util.HashMap<String, TableDataWrapper>();
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>>();
@ -95,17 +95,21 @@ public abstract class DesignTableDataManager {
* 响应数据集改变.
*/
private static void fireDsChanged() {
fireDsChanged(globalDsListeners);
for (Entry<String, List<ChangeListener>> listenerEntry : dsListenersMap.entrySet()) {
List<ChangeListener> dsListeners = listenerEntry.getValue();
fireDsChanged(dsListeners);
}
}
private static void fireDsChanged(List<ChangeListener> dsListeners) {
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);
}
}
}
public static void closeTemplate(JTemplate<?, ?> template) {
if (template != null) {
@ -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的所有字段
*

12
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);
@ -139,12 +140,19 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
/**
*注册listener,相应数据集改变
*/
@Override
public void registerDSChangeListener() {
DesignTableDataManager.addDsChangeListener(new ChangeListener() {
changeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
TableDataComboBox.this.refresh(DesignTableDataManager.getEditingTableDataSource());
}
});
};
DesignTableDataManager.addDsChangeListener(changeListener);
}
public void registerGlobalDSChangeListener() {
DesignTableDataManager.addGlobalDsChangeListener(changeListener);
}
}

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

@ -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;
@ -67,6 +68,11 @@ public class RemoteWorkspace implements Workspace {
return isRoot;
}
@Override
public boolean isCluster() {
return WorkContext.getCurrent().get(ClusterOperator.class).isCluster();
}
@Override
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.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();
}
});

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.DocumentListener;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.text.ParseException;
/**
* Created by IntelliJ IDEA.
@ -56,8 +59,18 @@ 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) {
}
}
});
}
private void attributeChanged() {

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.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;
}

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;
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);
}
}

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.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<DictPresent> {
public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> implements Prepare4DataSourceChange {
private DictionaryPane dictionaryPane;
public DictPresentPane() {
@ -50,4 +51,8 @@ public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> {
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.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<Dictionary> implements DataCreatorUI {
public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI, Prepare4DataSourceChange {
private TableDataDictPane tableDataDictPane;
@Override
@ -77,4 +78,9 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
paneList.add(new FormulaDictPane());
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.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<TableDataDictionary> implements Previewable, UIObserver {
public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary> 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<TableDataDictionary>
public boolean shouldResponseChangeListener() {
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 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++) {

19
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,12 +49,19 @@ public class FormWidgetPopWindow extends JWindow {
if (event instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) event;
if (mv.getClickCount() > 0) {
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)) {
if (!FormWidgetPopWindow.this.contains(point)) {
FormWidgetPopWindow.this.setVisible(false);
}
} else if (OperatingSystem.isMacOS()) {
}else if(OperatingSystem.isMacos() || OperatingSystem.isLinux()){
Dimension d = FormWidgetPopWindow.this.getSize();
Point p = FormWidgetPopWindow.this.getLocation();
Rectangle rect = new Rectangle(p, d);
@ -66,9 +70,6 @@ public class FormWidgetPopWindow extends JWindow {
}
}
}
}
}
};
private class EditorChoosePane extends JPanel {
public EditorChoosePane() {

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);
this.spinner.setValue(new Integer(0));
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

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.design.actions.utils.ReportActionUtils;
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.HyperlinkGroupPaneActionProvider;
import com.fr.general.FRFont;
@ -24,7 +24,7 @@ import java.awt.Color;
*/
public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionProvider {
private static HyperlinkGroupPaneActionProvider instance;
private static Selection selection ;
private HyperlinkGroupPaneActionImpl() {
}
@ -40,7 +40,9 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
ElementCasePane reportPane = (ElementCasePane)elementCasePane;
final TemplateElementCase report = reportPane.getEditingElementCase();
NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report);
selection = reportPane.getSelection();
hyperlinkGroupPane.populate(nameHyperlinks);
}
private NameJavaScriptGroup getNameJSGroup(ElementCasePane reportPane, final TemplateElementCase report) {
@ -67,13 +69,12 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
}
ElementCasePane reportPane = (ElementCasePane)jt.getCurrentElementCasePane();
final TemplateElementCase report = reportPane.getEditingElementCase();
final Selection sel = reportPane.getSelection();
final NameJavaScriptGroup updateNameHyperlinks = hyperlinkGroupPane.updateJSGroup();
if (sel instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName());
if (selection instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)selection).getSelectedFloatName());
selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks);
} else {
ReportActionUtils.actionIterateWithCellSelection((CellSelection)sel, report, new ReportActionUtils.IterAction() {
ReportActionUtils.actionIterateWithCellSelection((CellSelection)selection, report, new ReportActionUtils.IterAction() {
public void dealWith(CellElement editCellElement) {
Style elementStyle = editCellElement.getStyle();
FRFont frFont = elementStyle.getFRFont();
@ -94,7 +95,6 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
}
});
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
HistoryTemplateListCache.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());
dictPresentPane = new DictPresentPane();
dictPresentPane.registerDSChangeListener();
paneList.add(dictPresentPane);
keys.add(DictPresent.class.getName());
displays.add(dictPresentPane.title4PopupWindow());

7
designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java

@ -215,13 +215,6 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
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);
// 重复打印部分
// 重复打印标题的起始行

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);
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<ToolBarButton> toolBarButtons) {

Loading…
Cancel
Save