Browse Source

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

feature/big-screen
pengda 4 years ago
parent
commit
b2a771607b
  1. 7
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 52
      designer-base/src/main/java/com/fr/design/actions/UpdateAction.java
  3. 37
      designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
  4. 43
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  5. 23
      designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
  6. 47
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  7. 58
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java
  8. 25
      designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java
  9. 73
      designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java
  10. 25
      designer-base/src/main/java/com/fr/design/editlock/EditLockChangeEvent.java
  11. 16
      designer-base/src/main/java/com/fr/design/editlock/EditLockChangeListener.java
  12. 81
      designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java
  13. 23
      designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java
  14. 31
      designer-base/src/main/java/com/fr/design/fun/DesignerLifecycleMonitor.java
  15. 31
      designer-base/src/main/java/com/fr/design/fun/DesignerPortProvider.java
  16. 24
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPaneWithPercent.java
  17. 55
      designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java
  18. 47
      designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java
  19. 28
      designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItemUI.java
  20. 26
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  21. 15
      designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPercent.java
  22. 20
      designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPx.java
  23. 26
      designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java
  24. 22
      designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java
  25. 114
      designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberFieldWithUnit.java
  26. 47
      designer-base/src/main/java/com/fr/design/monitor/DesignerLifecycleMonitorContext.java
  27. 14
      designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java
  28. 32
      designer-base/src/main/java/com/fr/design/port/DesignerPortContext.java
  29. 12
      designer-base/src/main/java/com/fr/design/utils/DesignerPort.java
  30. 4
      designer-base/src/main/java/com/fr/exit/DesignerExiter.java
  31. 2
      designer-base/src/main/java/com/fr/start/BaseDesigner.java
  32. 15
      designer-base/src/main/resources/com/fr/design/images/m_web/connection_locked_normal.svg
  33. 14
      designer-base/src/main/resources/com/fr/design/images/m_web/locked_normal.svg
  34. BIN
      designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon.png
  35. 3
      designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java
  36. 3
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java
  37. 15
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java
  38. 1
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java
  39. 3
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java
  40. 5
      designer-chart/src/main/java/com/fr/van/chart/bubble/component/VanChartBubblePane.java
  41. 3
      designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java
  42. 8
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java
  43. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartAreaSeriesFillColorPane.java
  44. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java
  45. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java
  46. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java
  47. 23
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java
  48. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java
  49. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithAlphaPane.java
  50. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java
  51. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java
  52. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java
  53. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java
  54. 8
      designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java
  55. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  56. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  57. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  58. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java
  59. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java
  60. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  61. 10
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  62. 3
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePane.java
  63. 6
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java
  64. 20
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java
  65. 3
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  66. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java
  67. 6
      designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartCurvePane.java
  68. 7
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java
  69. 11
      designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java
  70. 10
      designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java
  71. 46
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java
  72. 35
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java
  73. 51
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java
  74. 2
      designer-realize/src/main/java/com/fr/start/MainDesigner.java
  75. 14
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

7
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -15,10 +15,12 @@ import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.DesignerPortProvider;
import com.fr.design.i18n.Toolkit;
import com.fr.design.locale.impl.ProductImproveMark;
import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.notification.SnapChatConfig;
import com.fr.design.port.DesignerPortContext;
import com.fr.design.update.push.DesignerPushUpdateConfigManager;
import com.fr.design.style.color.ColorSelectConfigManager;
import com.fr.design.utils.DesignUtils;
@ -42,6 +44,7 @@ import com.fr.stable.ListMap;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.core.UUID;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.XMLPrintWriter;
@ -842,6 +845,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
* 返回Jetty服务器的端口号
*/
public int getEmbedServerPort() {
int embeddedServerPort = DesignerPortContext.getEmbeddedServerPort();
if (embeddedServerPort >= DesignerPort.MIN_PORT && embeddedServerPort <= DesignerPort.MAX_PORT) {
return embeddedServerPort;
}
return this.jettyServerPort;
}

52
designer-base/src/main/java/com/fr/design/actions/UpdateAction.java

@ -339,33 +339,37 @@ public abstract class UpdateAction extends ShortCut implements Action {
if (!(object instanceof AbstractButton)) {
UIButton button = null;
button = new UIButton();
// 添加一个名字作为自动化测试用
button.setName(getName());
button.set4ToolbarButton();
//设置属性.
Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY);
if (mnemonicInteger != null) {
button.setMnemonic((char) mnemonicInteger.intValue());
}
button.setIcon((Icon) this.getValue(Action.SMALL_ICON));
setPressedIcon4Button(button);
setDisabledIcon4Button(button);
button.addActionListener(this);
object = initButton(button, UIButton.class.getName());
}
button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW);
return (JComponent) object;
}
this.putValue(UIButton.class.getName(), button);
button.setText(StringUtils.EMPTY);
button.setEnabled(this.isEnabled());
protected JComponent initButton(UIButton button, String name) {
// 添加一个名字作为自动化测试用
button.setName(getName());
button.set4ToolbarButton();
//peter:产生tooltip
button.setToolTipText(getToolTipText());
object = button;
//设置属性.
Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY);
if (mnemonicInteger != null) {
button.setMnemonic((char) mnemonicInteger.intValue());
}
return (JComponent) object;
button.setIcon((Icon) this.getValue(Action.SMALL_ICON));
setPressedIcon4Button(button);
setDisabledIcon4Button(button);
button.addActionListener(this);
button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW);
this.putValue(name, button);
button.setText(StringUtils.EMPTY);
button.setEnabled(this.isEnabled());
//peter:产生tooltip
button.setToolTipText(getToolTipText());
return button;
}
/**
@ -641,14 +645,14 @@ public abstract class UpdateAction extends ShortCut implements Action {
shortPinyin.append(PinyinHelper.getShortPinyin(title)).append(separator);
}
private void setPressedIcon4Button(AbstractButton button) {
protected void setPressedIcon4Button(AbstractButton button) {
Icon pressedIcon = (Icon) this.getValue(UpdateAction.PRESSED_ICON);
if (pressedIcon != null && pressedIcon instanceof SVGIcon) {
button.setPressedIcon(pressedIcon);
}
}
private void setDisabledIcon4Button(AbstractButton button) {
protected void setDisabledIcon4Button(AbstractButton button) {
Icon disabledIcon = (Icon) this.getValue(UpdateAction.DISABLED_ICON);
if (disabledIcon != null && disabledIcon instanceof SVGIcon) {
button.setDisabledIcon(disabledIcon);

37
designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java

@ -1,19 +1,23 @@
package com.fr.design.actions.server;
import com.fr.base.svg.IconUtils;
import com.fr.data.impl.Connection;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionShowPane;
import com.fr.design.data.datapane.connect.DatabaseConnectionPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.editlock.ConnectionLockChangeChecker;
import com.fr.design.editlock.EditLockUtils;
import com.fr.design.gui.NameInspector;
import com.fr.design.gui.imenu.UILockMenuItem;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.menu.MenuKeySet;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.design.os.impl.DatabaseDialogAction;
import com.fr.file.ConnectionConfig;
import com.fr.report.LockItem;
import javax.swing.*;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
import java.util.Map;
@ -53,8 +57,16 @@ public class ConnectionListAction extends UpdateAction {
* @param evt 事件
*/
public void actionPerformed(ActionEvent evt) {
OSBasedAction osBasedAction = OSSupportCenter.getAction(DatabaseDialogAction.class);
osBasedAction.execute();
// 尝试为数据连接加锁
boolean actionLock = EditLockUtils.lock(LockItem.CONNECTION);
if (!actionLock) {
// 锁定失败,代表已经被其他用户锁定,跳出弹窗提示
EditLockUtils.showLockMessage();
} else {
// 锁定成功,执行后续操作
OSBasedAction osBasedAction = OSSupportCenter.getAction(DatabaseDialogAction.class);
osBasedAction.execute();
}
}
/**
@ -96,4 +108,21 @@ public class ConnectionListAction extends UpdateAction {
public void update() {
this.setEnabled(true);
}
@Override
public UIMenuItem createMenuItem() {
Object object = this.getValue(UILockMenuItem.class.getName());
if (object == null && !(object instanceof UILockMenuItem)) {
UILockMenuItem menuItem = new UILockMenuItem(this, EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, null, LockItem.CONNECTION);
// 设置名字用作单元测
menuItem.setName(getName());
setPressedIcon4Button(menuItem);
setDisabledIcon4Button(menuItem);
object = menuItem;
this.putValue(UILockMenuItem.class.getName(), object);
ConnectionLockChangeChecker.getInstance().addEditLockChangeListener((UILockMenuItem)object);
}
return (UILockMenuItem) object;
}
}

43
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -4,7 +4,6 @@
package com.fr.design.actions.server;
import com.fr.base.TableData;
import com.fr.base.svg.IconUtils;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager;
@ -13,7 +12,11 @@ import com.fr.design.data.tabledata.ResponseDataSourceChange;
import com.fr.design.data.tabledata.tabledatapane.TableDataManagerPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.editlock.EditLockUtils;
import com.fr.design.editlock.ServerTableDataLockChangeChecker;
import com.fr.design.gui.NameInspector;
import com.fr.design.gui.imenu.UILockMenuItem;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
@ -22,9 +25,10 @@ import com.fr.file.TableDataConfig;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import com.fr.report.LockItem;
import javax.swing.KeyStroke;
import java.awt.*;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.Map;
@ -66,6 +70,14 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
* @param evt 事件
*/
public void actionPerformed(ActionEvent evt) {
// 尝试为服务器数据集加锁
boolean actionLock = EditLockUtils.lock(LockItem.SERVER_TABLE_DATA);
if (!actionLock) {
// 锁定失败,代表已经被其他用户锁定,跳出弹窗提示
EditLockUtils.showLockMessage();
return;
}
// 锁定成功,执行后续操作
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final TableDataConfig tableDataConfig = TableDataConfig.getInstance();
final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() {
@ -90,7 +102,6 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
globalTableDataDialog.setDoOKSucceed(false);
return;
}
DesignTableDataManager.clearGlobalDs();
// 保存时 移除服务器数据集列名缓存
for (String name : tableDataConfig.getTableDatas().keySet()) {
@ -114,9 +125,18 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
// 刷新共有数据集
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
fireDSChanged(globalTableDataPane.getDsChangedNameMap());
// 关闭服务器数据集页面,为其解锁
EditLockUtils.unlock(LockItem.SERVER_TABLE_DATA);
}
}));
}
@Override
public void doCancel() {
super.doCancel();
// 关闭服务器数据集页面,为其解锁
EditLockUtils.unlock(LockItem.SERVER_TABLE_DATA);
}
});
globalTableDataDialog.setVisible(true);
}
@ -166,4 +186,21 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
public void fireDSChanged(Map<String, String> map) {
DesignTableDataManager.fireDSChanged(map);
}
@Override
public UIMenuItem createMenuItem() {
Object object = this.getValue(UILockMenuItem.class.getName());
if (object == null && !(object instanceof UILockMenuItem)) {
UILockMenuItem menuItem = new UILockMenuItem(this, EditLockUtils.SERVER_TABLEDATA_LOCKED_TOOLTIPS, null, LockItem.SERVER_TABLE_DATA);
// 设置名字用作单元测
menuItem.setName(getName());
setPressedIcon4Button(menuItem);
setDisabledIcon4Button(menuItem);
object = menuItem;
this.putValue(UILockMenuItem.class.getName(), object);
ServerTableDataLockChangeChecker.getInstance().addEditLockChangeListener((UILockMenuItem)object);
}
return (UILockMenuItem) object;
}
}

23
designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java

@ -18,7 +18,10 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editlock.ConnectionLockChangeChecker;
import com.fr.design.editlock.EditLockUtils;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.gui.ibutton.UILockButton;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.icon.IconPathConstants;
@ -31,8 +34,11 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import javax.swing.AbstractButton;
import javax.swing.Action;
import javax.swing.DefaultCellEditor;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JTree;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
@ -439,6 +445,23 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
this.setMnemonic('D');
this.setSmallIcon("/com/fr/design/images/m_web/connection");
}
@Override
public JComponent createToolBarComponent() {
Object object = this.getValue(UILockButton.class.getName());
if (!(object instanceof AbstractButton)) {
UILockButton button = new UILockButton(
EditLockUtils.CONNECTION_LOCKED_ICON,
(Icon) this.getValue(Action.SMALL_ICON),
EditLockUtils.CONNECTION_LOCKED_TOOLTIPS,
getToolTipText()
);
initButton(button, UILockButton.class.getName());
object = button;
ConnectionLockChangeChecker.getInstance().addEditLockChangeListener((UILockButton)object);
}
return (JComponent) object;
}
}
/**

47
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.connect;
import com.fr.base.svg.IconUtils;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection;
@ -7,6 +8,10 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.server.ConnectionListAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.editlock.ConnectionLockChangeChecker;
import com.fr.design.editlock.EditLockUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UILockButton;
import com.fr.design.mainframe.DesignerContext;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
@ -16,8 +21,12 @@ import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.connection.DBConnectAuth;
import com.fr.report.LockItem;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
@ -56,6 +65,24 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
refreshItems();
}
@Override
protected UIButton initEditButton(UIButton editButton, Dimension buttonSize) {
editButton = new UILockButton(
EditLockUtils.CONNECTION_LOCKED_ICON,
IconUtils.readIcon("/com/fr/design/images/m_web/connection"),
EditLockUtils.CONNECTION_LOCKED_TOOLTIPS,
StringUtils.EMPTY
);
editButton.setPreferredSize(buttonSize);
editButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
editItems();
}
});
ConnectionLockChangeChecker.getInstance().addEditLockChangeListener((UILockButton) editButton);
return editButton;
}
/*
* 刷新ComboBox.items
*/
@ -97,6 +124,14 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
* 弹出对话框编辑Items
*/
protected void editItems() {
// 尝试为数据连接加锁
boolean actionLock = EditLockUtils.lock(LockItem.CONNECTION);
if (!actionLock) {
// 锁定失败,代表已经被其他用户锁定,跳出弹窗提示
EditLockUtils.showLockMessage();
return;
}
// 锁定成功,执行后续操作
final ConnectionListPane connectionListPane = new ConnectionListPane();
final ConnectionConfig connectionConfig = ConnectionConfig.getInstance();
ConnectionConfig cloned = connectionConfig.mirror();
@ -109,7 +144,6 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
connectionListDialog.setDoOKSucceed(false);
return;
}
Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override
public void run() {
@ -125,10 +159,19 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
@Override
public void afterCommit() {
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
// 关闭定义数据连接页面,为其解锁
EditLockUtils.unlock(LockItem.CONNECTION);
}
}));
}
@Override
public void doCancel() {
// 关闭定义数据连接页面,为其解锁
super.doCancel();
EditLockUtils.unlock(LockItem.CONNECTION);
}
});
connectionListDialog.setVisible(true);
refreshItems();
@ -158,4 +201,4 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
}
}
}
}
}

58
designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java

@ -12,7 +12,7 @@ import java.awt.event.ActionListener;
public abstract class ItemEditableComboBoxPanel extends JPanel {
/**
*
*
*/
private static final long serialVersionUID = 1L;
@ -21,37 +21,29 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
return "";
}
};
protected UIComboBox itemComboBox;
protected UIButton editButton;
protected UIButton refreshButton;
public ItemEditableComboBoxPanel() {
super();
initComponents();
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
Dimension buttonSize = new Dimension(26, 20);
itemComboBox = new UIComboBox();
itemComboBox.setEnabled(true);
this.add(itemComboBox, BorderLayout.CENTER);
editButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/control-center2.png"));
refreshButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
JPanel jPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 4 ,4);
editButton = initEditButton(editButton, buttonSize);
jPanel.add(editButton);
jPanel.add(refreshButton);
this.add(jPanel, BorderLayout.EAST);
Dimension buttonSize = new Dimension(26, 20);
editButton.setPreferredSize(buttonSize);
editButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
editItems();
}
});
refreshButton.setPreferredSize(buttonSize);
refreshButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -59,32 +51,44 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
}
});
}
protected UIButton initEditButton(UIButton editButton, Dimension buttonSize) {
editButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/control-center2.png"));
editButton.setPreferredSize(buttonSize);
editButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
editItems();
}
});
return editButton;
}
/**
* 给itemComboBox添加ActionListener
*/
public void addComboBoxActionListener(ActionListener l) {
itemComboBox.addActionListener(l);
}
/*
* 刷新itemComboBox的内容
*/
protected void refreshItems() {
// 记录原来选中的Item,重新加载后需要再次选中
Object lastSelectedItem = itemComboBox.getSelectedItem();
DefaultComboBoxModel model = ((DefaultComboBoxModel) itemComboBox.getModel());
model.removeAllElements();
// 先加EMPTY,再加items
model.addElement(EMPTY);
java.util.Iterator<String> itemIt = items();
while(itemIt.hasNext()) {
model.addElement(itemIt.next());
}
// 再次选中之前选中的Item
int idx = model.getIndexOf(lastSelectedItem);
if(idx < 0) {
@ -92,16 +96,16 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
}
itemComboBox.setSelectedIndex(idx);
}
/*
* 得到其中的itemComboBox所选中的Item
*/
public String getSelectedItem() {
Object selected = itemComboBox.getSelectedItem();
return selected instanceof String ? (String)selected : null;
}
/*
* 选中name项
*/
@ -109,14 +113,14 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
DefaultComboBoxModel model = ((DefaultComboBoxModel) itemComboBox.getModel());
model.setSelectedItem(name);
}
/*
* 刷新ComboBox.items
*/
protected abstract java.util.Iterator<String> items();
/*
* 弹出对话框编辑Items
*/
protected abstract void editItems();
}
}

25
designer-base/src/main/java/com/fr/design/editlock/ConnectionLockChangeChecker.java

@ -0,0 +1,25 @@
package com.fr.design.editlock;
import com.fr.report.LockItem;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/20
* 定义数据连接的checker
*/
public class ConnectionLockChangeChecker extends EditLockChangeChecker{
private static class Holder {
private static final ConnectionLockChangeChecker INSTANCE = new ConnectionLockChangeChecker();
}
public static ConnectionLockChangeChecker getInstance() {
return ConnectionLockChangeChecker.Holder.INSTANCE;
}
public ConnectionLockChangeChecker() {
this.lockItem = LockItem.CONNECTION;
}
}

73
designer-base/src/main/java/com/fr/design/editlock/EditLockChangeChecker.java

@ -0,0 +1,73 @@
package com.fr.design.editlock;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.log.FineLoggerFactory;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.editlock.EditLockOperator;
import com.fr.report.LockItem;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/19
* 判断当前设计器在远程设计服务器中的锁状态是否发生了改变
*/
public abstract class EditLockChangeChecker {
private static final int INTERVAL = 30000;
private ScheduledExecutorService scheduler;
protected LockItem lockItem;
private boolean isLocked = false;
private List<EditLockChangeListener> listeners = new ArrayList<>();
/**
* 轮询任务如果是远程设计状态每隔30s查询一次相应lockItem的锁状态是否改变
*/
public void start() {
this.scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("EditLockChangeChecker"));
this.scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
// 判断是否为远程设计环境
if (!WorkContext.getCurrent().isLocal()) {
try {
EditLockOperator operator = WorkContext.getCurrent().get(EditLockOperator.class);
boolean locked = operator.isLocked(lockItem);
if (isLocked != locked) {
isLocked = locked;
fireChange();
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
}, 0, INTERVAL, TimeUnit.MILLISECONDS);
}
public void stop() {
this.scheduler.shutdown();
}
public void addEditLockChangeListener(EditLockChangeListener listener) {
this.listeners.add(listener);
}
private void fireChange() {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
for (EditLockChangeListener listener : EditLockChangeChecker.this.listeners) {
listener.updateLockedState(new EditLockChangeEvent(isLocked));
}
}
});
}
}

25
designer-base/src/main/java/com/fr/design/editlock/EditLockChangeEvent.java

@ -0,0 +1,25 @@
package com.fr.design.editlock;
import java.util.EventObject;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/20
*/
public class EditLockChangeEvent extends EventObject {
private boolean isLocked;
/**
* @param source 锁状态发生了改变且当前锁状态就是source
*/
public EditLockChangeEvent(boolean source) {
super(source);
this.isLocked = source;
}
public boolean isLocked() {
return isLocked;
}
}

16
designer-base/src/main/java/com/fr/design/editlock/EditLockChangeListener.java

@ -0,0 +1,16 @@
package com.fr.design.editlock;
import java.util.EventListener;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/20
*/
public interface EditLockChangeListener extends EventListener {
/**
* 锁定状态改变后执行的动作
* @param event 事件
*/
void updateLockedState(EditLockChangeEvent event);
}

81
designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java

@ -0,0 +1,81 @@
package com.fr.design.editlock;
import com.fr.base.svg.IconUtils;
import com.fr.base.svg.SVGLoader;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.IOUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.editlock.EditLockOperator;
import com.fr.report.LockItem;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import java.awt.Image;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/20
* 关于编辑锁定的一些常量和静态方法
*/
public class EditLockUtils {
/**
* 数据连接锁定标志
*/
public static final Icon CONNECTION_LOCKED_ICON = IconUtils.readIcon("/com/fr/design/images/m_web/connection_locked");
/**
* 小锁图片
*/
public static final @Nullable Image LOCKED_IMAGE = SVGLoader.load("/com/fr/design/images/m_web/locked_normal.svg");
/**
* 提示弹窗中的提示标志
*/
public static final Icon TOOLTIPS_ICON = IOUtils.readIcon("/com/fr/design/images/m_web/warningIcon.png");
/**
* 数据连接锁定中
*/
public static final String CONNECTION_LOCKED_TOOLTIPS = Toolkit.i18nText("Fine_Designer_Remote_Design_Data_Connection_Locked");
/**
* 服务器数据集锁定中
*/
public static final String SERVER_TABLEDATA_LOCKED_TOOLTIPS = Toolkit.i18nText("Fine_Designer_Remote_Design_Server_TableData_Locked");
/**
* 提示弹窗中的提示信息
*/
public static final String LOCKED_MESSAGE = Toolkit.i18nText("Fine_Designer_Remote_Design_Locked_Message");
/**
* 提示弹窗中的标题
*/
public static final String TOOLTIPS = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Title_Hint");
/**
* 已经被锁跳出弹窗提示
*/
public static void showLockMessage() {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), EditLockUtils.LOCKED_MESSAGE, EditLockUtils.TOOLTIPS, JOptionPane.INFORMATION_MESSAGE, EditLockUtils.TOOLTIPS_ICON);
}
public static boolean lock(LockItem lockItem) {
return WorkContext.getCurrent().get(EditLockOperator.class).lock(lockItem);
}
public static boolean unlock(LockItem lockItem) {
return WorkContext.getCurrent().get(EditLockOperator.class).unlock(lockItem);
}
public static boolean isLocked(LockItem lockItem) {
EditLockOperator operator = WorkContext.getCurrent().get(EditLockOperator.class);
// 启动过程中UILockButton初始化的时候会调用这个方法,但是此时workObjectPool中还没有对象,会报npe
return operator != null && operator.isLocked(lockItem);
}
}

23
designer-base/src/main/java/com/fr/design/editlock/ServerTableDataLockChangeChecker.java

@ -0,0 +1,23 @@
package com.fr.design.editlock;
import com.fr.report.LockItem;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/20
* 服务器数据集的checker
*/
public class ServerTableDataLockChangeChecker extends EditLockChangeChecker{
private static class Holder {
private static final ServerTableDataLockChangeChecker INSTANCE = new ServerTableDataLockChangeChecker();
}
public static ServerTableDataLockChangeChecker getInstance() {
return ServerTableDataLockChangeChecker.Holder.INSTANCE;
}
public ServerTableDataLockChangeChecker() {
this.lockItem = LockItem.SERVER_TABLE_DATA;
}
}

31
designer-base/src/main/java/com/fr/design/fun/DesignerLifecycleMonitor.java

@ -0,0 +1,31 @@
package com.fr.design.fun;
/**
* 设计器生命周期接口
*
* @author hades
* @version 10.0
* Created by hades on 2021/1/26
*/
public interface DesignerLifecycleMonitor {
String MARK_STRING = "DesignerLifecycleMonitor";
int CURRENT_LEVEL = 1;
/**
* 设计器启动之前
*/
void beforeStart();
/**
* 设计器启动完成 界面出现之后
*/
void afterStart();
/**
* 设计器关闭退出之前
*/
void beforeStop();
}

31
designer-base/src/main/java/com/fr/design/fun/DesignerPortProvider.java

@ -0,0 +1,31 @@
package com.fr.design.fun;
/**
* 设计器所有端口获取
*
* @author hades
* @version 10.0
* Created by hades on 2021/1/18
*/
public interface DesignerPortProvider {
String MARK_STRING = "DesignerPortProvider";
int CURRENT_LEVEL = 1;
/**
* 设计器自身端口
*
* @return
*/
int messagePort();
/**
* 内置服务器端口
*
* @return
*/
int embeddedServerPort();
}

24
designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPaneWithPercent.java

@ -0,0 +1,24 @@
package com.fr.design.gui.frpane;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPercent;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-01-21
*/
public class UINumberDragPaneWithPercent extends UINumberDragPane {
public UINumberDragPaneWithPercent(double minValue, double maxValue) {
super(minValue, maxValue);
}
public UINumberDragPaneWithPercent(double minValue, double maxValue, double dierta) {
super(minValue, maxValue, dierta);
}
protected UISpinner createUISpinner(double minValue, double maxValue, double dierta) {
return new UISpinnerWithPercent(minValue, maxValue, dierta, minValue);
}
}

55
designer-base/src/main/java/com/fr/design/gui/ibutton/UILockButton.java

@ -0,0 +1,55 @@
package com.fr.design.gui.ibutton;
import com.fr.design.editlock.EditLockChangeEvent;
import com.fr.design.editlock.EditLockChangeListener;
import com.fr.design.editlock.EditLockUtils;
import com.fr.report.LockItem;
import javax.swing.Icon;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/20
*/
public class UILockButton extends UIButton implements EditLockChangeListener {
/**
* 锁定状态图标
*/
private Icon lockedIcon;
/**
* 正常状态图标
*/
private Icon normalIcon;
/**
* 锁定状态的提示信息
*/
private String lockedTooltips;
/**
* 正常状态的提示信息
*/
private String normalTooltips;
public UILockButton(Icon lockedIcon, Icon normalIcon, String lockedTooltips, String normalTooltips) {
super();
this.lockedIcon = lockedIcon;
this.normalIcon = normalIcon;
this.lockedTooltips = lockedTooltips;
this.normalTooltips = normalTooltips;
init();
}
private void init() {
boolean locked = EditLockUtils.isLocked(LockItem.CONNECTION);
this.setIcon(locked ? lockedIcon : normalIcon);
this.setToolTipText(locked ? lockedTooltips : normalTooltips);
}
@Override
public void updateLockedState(EditLockChangeEvent event) {
this.setIcon(event.isLocked() ? lockedIcon : normalIcon);
this.setToolTipText(event.isLocked() ? lockedTooltips : normalTooltips);
this.repaint();
}
}

47
designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItem.java

@ -0,0 +1,47 @@
package com.fr.design.gui.imenu;
import com.fr.design.editlock.EditLockChangeEvent;
import com.fr.design.editlock.EditLockChangeListener;
import com.fr.report.LockItem;
import javax.swing.Action;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/20
*/
public class UILockMenuItem extends UIMenuItem implements EditLockChangeListener {
/**
* 锁定状态的提示信息
*/
private String lockedTooltips;
/**
* 正常状态的提示信息
*/
private String normalTooltips;
/**
* 当前锁定项
*/
private LockItem lockItem;
public UILockMenuItem(Action action, String lockedTooltips, String normalTooltips, LockItem lockItem) {
super(action);
this.lockedTooltips = lockedTooltips;
this.normalTooltips = normalTooltips;
this.lockItem = lockItem;
setUI(new UILockMenuItemUI());
}
public LockItem getLockItem() {
return lockItem;
}
@Override
public void updateLockedState(EditLockChangeEvent event) {
this.setToolTipText(event.isLocked() ? lockedTooltips : normalTooltips);
this.repaint();
}
}

28
designer-base/src/main/java/com/fr/design/gui/imenu/UILockMenuItemUI.java

@ -0,0 +1,28 @@
package com.fr.design.gui.imenu;
import com.fr.design.editlock.EditLockUtils;
import javax.swing.JMenuItem;
import java.awt.Graphics;
import java.awt.Rectangle;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2021/1/20
*/
public class UILockMenuItemUI extends UIMenuItemUI{
@Override
protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {
super.paintText(g, menuItem, textRect, text);
// 除了绘制text之外,还需要画一下锁定图标
UILockMenuItem lockMenuItem = (UILockMenuItem) menuItem;
if (EditLockUtils.isLocked(lockMenuItem.getLockItem())) {
int width = menuItem.getWidth();
int height = menuItem.getHeight();
g.drawImage(EditLockUtils.LOCKED_IMAGE, (int) Math.round(width * 0.9), (int) Math.round(height * 0.1), 16, 16, null);
}
}
}

26
designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java

@ -13,15 +13,28 @@ import com.fr.stable.CommonUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import com.fr.stable.collections.utils.MathUtils;
import javax.swing.*;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.plaf.ButtonUI;
import java.awt.*;
import java.awt.event.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver {
@ -46,6 +59,9 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
*/
private int numberFieldColumns;
public UISpinner() {
}
public UISpinner(double minValue, double maxValue, double dierta) {
init(minValue, maxValue, dierta);
@ -56,7 +72,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
textField.setValue(defaultValue);
}
private void init(double minValue, double maxValue, double dierta) {
protected void init(double minValue, double maxValue, double dierta) {
this.minValue = minValue;
this.maxValue = maxValue;
this.dierta = dierta;

15
designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPercent.java

@ -0,0 +1,15 @@
package com.fr.design.gui.ispinner.chart;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-01-21
*/
public class UISpinnerWithPercent extends UISpinnerWithUnit {
private static final String UNIT = "%";
public UISpinnerWithPercent(double minValue, double maxValue, double dierta, double defaultValue) {
super(minValue, maxValue, dierta, defaultValue, UNIT);
}
}

20
designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithPx.java

@ -0,0 +1,20 @@
package com.fr.design.gui.ispinner.chart;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-01-21
*/
public class UISpinnerWithPx extends UISpinnerWithUnit {
private static final String UNIT = "px";
public UISpinnerWithPx(double defaultValue) {
this(0, Double.MAX_VALUE, 1, defaultValue);
}
public UISpinnerWithPx(double minValue, double maxValue, double dierta, double defaultValue) {
super(minValue, maxValue, dierta, defaultValue, UNIT);
this.getTextField().canFillNegativeNumber(false);
}
}

26
designer-base/src/main/java/com/fr/design/gui/ispinner/chart/UISpinnerWithUnit.java

@ -0,0 +1,26 @@
package com.fr.design.gui.ispinner.chart;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.gui.itextfield.UINumberFieldWithUnit;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-01-20
*/
public class UISpinnerWithUnit extends UISpinner {
private String unit;
public UISpinnerWithUnit(double minValue, double maxValue, double dierta, double defaultValue, String unit) {
this.unit = unit;
init(minValue, maxValue, dierta);
getTextField().setValue(defaultValue);
}
@Override
protected UINumberField initNumberField() {
return new UINumberFieldWithUnit(3, unit);
}
}

22
designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java

@ -1,16 +1,15 @@
package com.fr.design.gui.itextfield;
import com.fr.base.Utils;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.ComparatorUtils;
import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
import java.awt.*;
import java.awt.Dimension;
import java.awt.Toolkit;
/**
* Number Field.
@ -193,7 +192,6 @@ public class UINumberField extends UITextField {
if (!fillNegativeNumber && strNew.contains("-")) {
return true;
}
boolean noChange = false;
boolean isMinus = strNew.startsWith("-");
strNew = strNew.replaceFirst("-", StringUtils.EMPTY); // 控制能输入负数
String strIntPart;
@ -207,25 +205,27 @@ public class UINumberField extends UITextField {
}
if (isOverMaxOrMinValue(strIntPart, strDecPart, strNew)) {
Toolkit.getDefaultToolkit().beep();
noChange = true;
return true;
}
return checkNumber(strNew, isMinus);
}
protected boolean checkNumber(String strValue, boolean isMinus) {
try {
if (!ComparatorUtils.equals(strNew, StringUtils.EMPTY) && !ComparatorUtils.equals(strNew, "-")) {// 控制能输入负数
double d = Double.parseDouble(strNew) * (isMinus ? -1 : 1);
if (!ComparatorUtils.equals(strValue, StringUtils.EMPTY) && !ComparatorUtils.equals(strValue, "-")) {// 控制能输入负数
double d = Double.parseDouble(strValue) * (isMinus ? -1 : 1);
if (d < minValue || d > maxValue) {
throw new Exception();
}
}
} catch (Exception e) {
Toolkit.getDefaultToolkit().beep();
noChange = true;
return true;
}
return noChange;
return false;
}
private boolean isOverMaxOrMinValue(String strIntPart, String strDecPart, String strNew) {
protected boolean isOverMaxOrMinValue(String strIntPart, String strDecPart, String strNew) {
boolean checkLength = strIntPart.length() > maxIntegerLength
|| strDecPart.length() > maxDecimalLength;
return checkLength || (strNew.length() > 1 && ComparatorUtils.equals(strNew.substring(0, 1), "0") && !ComparatorUtils.equals(strNew.substring(1, 2), "."));

114
designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberFieldWithUnit.java

@ -0,0 +1,114 @@
package com.fr.design.gui.itextfield;
import com.fr.base.Utils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.awt.Toolkit;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2021-01-20
* 这个控件不会限制输入的数字大小但是同样不允许输入数字之外的字符
*/
public class UINumberFieldWithUnit extends UINumberField {
private String unit;
private List<String> unitList = new ArrayList<>();
public UINumberFieldWithUnit(int columns, String unit) {
super(columns);
this.unit = unit;
initUnitList();
}
//对单位的字符进行组合
private void initUnitList() {
char[] chars = unit.toCharArray();
Set<String> set = new LinkedHashSet<>();
initUnitList(chars, 0, StringUtils.EMPTY, set);
unitList.addAll(set);
Collections.sort(unitList, Comparator.comparing(String::length));
}
private void initUnitList(char[] chars, int index, String str, Set<String> set) {
if (index == chars.length) {
return;
}
for (int i = index; i < chars.length; i++) {
String newStr = str + chars[i];
set.add(newStr);
initUnitList(chars, i + 1, newStr, set);
}
}
public void setFieldDocument() {
setDocument(new NumberDocumentNoLimit());
}
public void setValue(double value) {
this.setText(Utils.doubleToString(value) + unit);
}
public double getValue() throws NumberFormatException {
try {
String text = this.getText();
if (StringUtils.isEmpty(text)) {
return 0;
}
return Double.parseDouble(text.replace(getEndString(text), StringUtils.EMPTY));
} catch (NumberFormatException numberFormatException) {
return UINumberField.ERROR_VALUE;
}
}
private String getEndString(String text) {
int size = unitList.size();
for (int i = size - 1; i >= 0; i--) {
String unit = unitList.get(i);
if (text.endsWith(unit)) {
return unit;
}
}
return StringUtils.EMPTY;
}
class NumberDocumentNoLimit extends NumberDocument {
public boolean checkString(int offset, String s, String str) {
return (ComparatorUtils.equals(s, "F")
|| ComparatorUtils.equals(s, "f")
|| ComparatorUtils.equals(s, "D")
|| ComparatorUtils.equals(s, "d")
|| (ComparatorUtils.equals(s, ".") && getMaxDecimalLength() == 0));
}
protected boolean isOverMaxOrMinValue(String strIntPart, String strDecPart, String strNew) {
return super.isOverMaxOrMinValue(strIntPart, strDecPart, strNew.replaceFirst(getEndString(strNew), StringUtils.EMPTY));
}
protected boolean checkNumber(String strValue, boolean isMinus) {
try {
if (ComparatorUtils.equals(strValue, StringUtils.EMPTY) || ComparatorUtils.equals(strValue, "-")) {
return false;
}
Double.parseDouble(strValue.replaceFirst(getEndString(strValue), StringUtils.EMPTY));
} catch (Exception e) {
Toolkit.getDefaultToolkit().beep();
return true;
}
return false;
}
}
}

47
designer-base/src/main/java/com/fr/design/monitor/DesignerLifecycleMonitorContext.java

@ -0,0 +1,47 @@
package com.fr.design.monitor;
import com.fr.design.fun.DesignerLifecycleMonitor;
import com.fr.stable.bridge.StableFactory;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/1/27
*/
public class DesignerLifecycleMonitorContext {
private static DesignerLifecycleMonitor monitor;
static {
DesignerLifecycleMonitor designerLifecycleMonitor = StableFactory.getMarkedInstanceObjectFromClass(DesignerLifecycleMonitor.MARK_STRING, DesignerLifecycleMonitor.class);
if (designerLifecycleMonitor != null) {
monitor = designerLifecycleMonitor;
} else {
monitor = new EmptyDesignerLifecycleMonitor();
}
}
public static DesignerLifecycleMonitor getMonitor() {
return monitor;
}
static class EmptyDesignerLifecycleMonitor implements DesignerLifecycleMonitor {
@Override
public void beforeStart() {
}
@Override
public void afterStart() {
}
@Override
public void beforeStop() {
}
}
}

14
designer-base/src/main/java/com/fr/design/os/impl/DatabaseDialogAction.java

@ -1,18 +1,17 @@
package com.fr.design.os.impl;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.data.datapane.connect.ConnectionManagerPane;
import com.fr.design.dcm.UniversalDatabaseOpener;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.editlock.EditLockUtils;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.file.ConnectionConfig;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
import com.fr.report.LockItem;
import static com.fr.design.actions.server.ConnectionListAction.doWithDatasourceManager;
/**
@ -68,9 +67,18 @@ public class DatabaseDialogAction implements OSBasedAction {
@Override
public void afterCommit() {
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
// 定义数据连接弹窗关闭后,解锁
EditLockUtils.unlock(LockItem.CONNECTION);
}
}));
}
@Override
public void doCancel() {
super.doCancel();
// 定义数据连接弹窗关闭后,解锁
EditLockUtils.unlock(LockItem.CONNECTION);
}
});
databaseListDialog.setVisible(true);
}

32
designer-base/src/main/java/com/fr/design/port/DesignerPortContext.java

@ -0,0 +1,32 @@
package com.fr.design.port;
import com.fr.design.fun.DesignerPortProvider;
import com.fr.stable.bridge.StableFactory;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/1/27
*/
public class DesignerPortContext {
private static int messagePort = -1;
private static int embeddedServerPort = -1;
static {
DesignerPortProvider designerPortProvider = StableFactory.getMarkedInstanceObjectFromClass(DesignerPortProvider.MARK_STRING, DesignerPortProvider.class);
if (designerPortProvider != null) {
messagePort = designerPortProvider.messagePort();
embeddedServerPort = designerPortProvider.embeddedServerPort();
}
}
public static int getMessagePort() {
return messagePort;
}
public static int getEmbeddedServerPort() {
return embeddedServerPort;
}
}

12
designer-base/src/main/java/com/fr/design/utils/DesignerPort.java

@ -4,19 +4,21 @@ import com.fr.common.report.ReportState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.TipDialog;
import com.fr.design.fun.DesignerPortProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.port.DesignerPortContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.process.ProcessEventPipe;
import com.fr.process.engine.core.CarryMessageEvent;
import com.fr.process.engine.core.FineProcessContext;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLWriter;
@ -35,8 +37,8 @@ import java.awt.event.ActionListener;
public class DesignerPort implements XMLReadable, XMLWriter {
public static final String XML_TAG = "DesignerPort";
private static final int MIN_PORT = 1024;
private static final int MAX_PORT = 65535;
public static final int MIN_PORT = 1024;
public static final int MAX_PORT = 65535;
public static final DesignerPort INSTANCE = new DesignerPort();
@ -58,6 +60,10 @@ public class DesignerPort implements XMLReadable, XMLWriter {
private int debugMessagePort = 51463;
public int getMessagePort() {
int extraMessagePort = DesignerPortContext.getMessagePort();
if (extraMessagePort >= MIN_PORT && extraMessagePort <= MAX_PORT) {
return extraMessagePort;
}
return messagePort;
}

4
designer-base/src/main/java/com/fr/exit/DesignerExiter.java

@ -1,10 +1,9 @@
package com.fr.exit;
import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.monitor.DesignerLifecycleMonitorContext;
import com.fr.process.engine.core.FineProcessContext;
import com.fr.process.engine.core.FineProcessEngineEvent;
import com.fr.stable.StableUtils;
/**
* @author hades
@ -20,6 +19,7 @@ public class DesignerExiter {
}
public void execute() {
DesignerLifecycleMonitorContext.getMonitor().beforeStop();
beforeExit();
if (FineProcessContext.getParentPipe() != null) {
FineProcessContext.getParentPipe().syncFire(FineProcessEngineEvent.DESTROY);

2
designer-base/src/main/java/com/fr/start/BaseDesigner.java

@ -14,6 +14,7 @@ import com.fr.design.fun.DesignerStartOpenFileProcessor;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
import com.fr.design.monitor.DesignerLifecycleMonitorContext;
import com.fr.design.ui.util.UIUtil;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
@ -75,6 +76,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, new Listener<Null>() {
@Override
public void on(Event event, Null param) {
DesignerLifecycleMonitorContext.getMonitor().afterStart();
EventDispatcher.stopListen(this);
// 启动完成 停止监听
ProcessEventPipe eventPipe = FineProcessContext.getParentPipe();

15
designer-base/src/main/resources/com/fr/design/images/m_web/connection_locked_normal.svg

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 3</title>
<g id="远程设计数据连接/服务器数据集增加锁定" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g transform="translate(-162.000000, -121.000000)" id="template">
<g transform="translate(24.000000, 115.000000)">
<g id="编组-3" transform="translate(138.000000, 6.000000)">
<rect id="矩形" fill-opacity="0" fill="#FFFFFF" x="0" y="0" width="16" height="16"></rect>
<path d="M13.9931545,2 C14.5492199,2 15,2.44371665 15,2.99980749 L15,6.00019251 C15,6.18235446 14.9510312,6.35313811 14.8654084,6.50022573 C14.9510251,6.64542671 15,6.81651267 15,6.99980749 L15,8 L13.999,8 L14,6.99980749 L2.00684547,7 C2.00567632,7 2.00469979,7.12351139 2.00388585,7.32041361 L2.003125,7.53992312 C2.00300685,7.57996653 2.00289294,7.6215845 2.00278313,7.66454498 L2.00201498,8.01864019 L2.00184669,8.11271215 L2.00184669,8.11271215 L2.00113666,8.59786697 C2.00105585,8.66296526 2.00098034,8.72781696 2.00090983,8.7919289 L2.00000644,9.98367135 C2.00000205,9.99452107 2,10.0001925 2,10.0001925 L8,10 L8,10.999 L2.00684547,11 C2.00567632,11 2.00469979,11.1235114 2.00388585,11.3204136 L2.003125,11.5399231 C2.00300685,11.5799665 2.00289294,11.6215845 2.00278313,11.664545 L2.00201498,12.0186402 L2.00184669,12.1127121 L2.00184669,12.1127121 L2.00113666,12.597867 C2.00105585,12.6629653 2.00098034,12.727817 2.00090983,12.7919289 L2.00000644,13.9836714 C2.00000205,13.9945211 2,14.0001925 2,14.0001925 L8,14 L8,15 L2.00684547,15 C1.45078007,15 1,14.5562834 1,14.0001925 L1,10.9998075 C1,10.8176455 1.04896881,10.6468619 1.13459156,10.4997743 C1.04897491,10.3545733 1,10.1834873 1,10.0001925 L1,6.99980749 C1,6.81764554 1.04896881,6.64686189 1.13459156,6.49977427 C1.04897491,6.35457329 1,6.18348733 1,6.00019251 L1,2.99980749 C1,2.44762906 1.44994876,2 2.00684547,2 L13.9931545,2 Z M14,2.99980749 L2.00684547,3 C2.00567632,3 2.00469979,3.12351139 2.00388585,3.32041361 L2.003125,3.53992312 C2.00300685,3.57996653 2.00289294,3.6215845 2.00278313,3.66454498 L2.00201498,4.01864019 L2.00184669,4.11271215 L2.00184669,4.11271215 L2.00113666,4.59786697 C2.00105585,4.66296526 2.00098034,4.72781696 2.00090983,4.7919289 L2.00000644,5.98367135 C2.00000205,5.99452107 2,6.00019251 2,6.00019251 L13.9814047,6.00000045 C13.9891898,6.00000015 13.9931545,6 13.9931545,6 C13.9943237,6 13.9953002,5.87648861 13.9961142,5.67958639 L13.996875,5.46007688 C13.9969932,5.42003347 13.9971071,5.3784155 13.9972169,5.33545502 L13.997985,4.98135981 L13.9981533,4.88728785 L13.9981533,4.88728785 L13.9988633,4.40213303 C13.9989441,4.33703474 13.9990197,4.27218304 13.9990902,4.2080711 L14,2.99980749 Z M4,4 L4,5 L3,5 L3,4 L4,4 Z M6,4 L6,5 L5,5 L5,4 L6,4 Z" id="形状结合" fill="#333334" fill-rule="nonzero"></path>
<path d="M14,8 L14,10 L15,10 L15,15 L9,15 L9,10 L10,10 L10,8 L14,8 Z M13,12 L11,12 L11,13 L13,13 L13,12 Z M13,9 L11,9 L11,10 L13,10 L13,9 Z" id="形状结合" fill="#E21E20" fill-rule="nonzero"></path>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

14
designer-base/src/main/resources/com/fr/design/images/m_web/locked_normal.svg

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 2</title>
<g id="远程设计数据连接/服务器数据集增加锁定" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g transform="translate(-476.000000, -106.000000)" id="列表/导航栏下拉列表">
<g transform="translate(243.000000, 70.000000)">
<g id="编组-2" transform="translate(233.000000, 36.000000)">
<rect id="矩形" fill="#FFFFFF" opacity="0" x="0" y="0" width="16" height="16"></rect>
<path d="M11,3 L11,6 L12,6 L12,13 L4,13 L4,6 L5,6 L5,3 L11,3 Z M10,9 L6,9 L6,10 L10,10 L10,9 Z M10,4 L6,4 L6,6 L10,6 L10,4 Z" id="形状结合" fill="#E21E20" fill-rule="nonzero"></path>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 959 B

BIN
designer-base/src/main/resources/com/fr/design/images/m_web/warningIcon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

3
designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java

@ -14,6 +14,7 @@ import com.fr.locale.LocaleMarker;
import com.fr.locale.LocaleScope;
import com.fr.module.Activator;
import com.fr.module.extension.Prepare;
import com.fr.plugin.chart.DownloadSourcesHelper;
import com.fr.plugin.chart.vanchart.export.ImagePainter;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
@ -44,7 +45,7 @@ public class ChartDesignerActivator extends Activator implements Prepare {
DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption());
ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
DownloadSourcesHelper.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
ImagePainter.registerDefaultCallbackEvent(HistoryTemplateListCache.getInstance());
ChartTypeInterfaceManager.addPluginChangedListener();

3
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java

@ -5,6 +5,7 @@ import com.fr.chart.base.DataSeriesCondition;
import com.fr.design.condition.ConditionAttrSingleConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ilable.UILabel;
@ -32,7 +33,7 @@ public class LabelAlphaPane extends ConditionAttrSingleConditionPane<DataSeriesC
nameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alpha"));
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alpha") + ":");
alphaPane = new UINumberDragPane(0, ALPHASIZE);
alphaPane = new UINumberDragPaneWithPercent(0, ALPHASIZE);
JPanel panel = new JPanel(new BorderLayout());

15
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java

@ -58,7 +58,7 @@ public class DatabaseTableDataPane extends BasicPane{
* 返回选中的数据源.
*/
public TableDataWrapper getTableDataWrapper() {
return tableNameCombox.getSelectedItem();
return tableNameCombox.getSelectedItem();
}
public void populateBean(TableData nameTableData) {
@ -68,12 +68,12 @@ public class DatabaseTableDataPane extends BasicPane{
tableNameCombox.setSelectedTableDataByName(((NameTableData)nameTableData).getName());
}
}
@Override
protected String title4PopupWindow() {
return null;
}
/**
* 数据集列表选中后的事件
*/
@ -82,7 +82,12 @@ public class DatabaseTableDataPane extends BasicPane{
}
private void initTableCombox() {
tableNameCombox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource());
tableNameCombox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()){
//图表的数据集选择下拉框,不需要注册监听,chartEditPane已经注册了。
public void registerDSChangeListener() {
}
};
tableNameCombox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
@ -94,7 +99,7 @@ public class DatabaseTableDataPane extends BasicPane{
}
});
}
private void initReviewButton() {
reviewButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/search.png"));
reviewButton.setBorder(new LineBorder(UIConstants.LINE_COLOR));

1
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java

@ -56,6 +56,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
this.setLayout(new BorderLayout());
nameBox = new UIComboBoxWithNone();
nameBox.setSelectedIndex(nameBox.getItemCount() -1);
valueBox = new UIComboBox();
targetBox = new UIComboBox();
custom = new TinyFormulaPane();

3
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxBorderPane.java

@ -4,6 +4,7 @@ import com.fr.base.background.ColorBackground;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.plugin.chart.base.AttrBorderWithWidth;
@ -31,7 +32,7 @@ public class VanChartBoxBorderPane extends BasicBeanPane<AttrBorderWithWidth> {
};
}
};
lineWidth = new UISpinner(0.5, Double.MAX_VALUE, 0.5, 0.5);
lineWidth = new UISpinnerWithPx(0.5, Double.MAX_VALUE, 0.5, 0.5);
Component[][] components = new Component[][]{
new Component[]{null, null},

5
designer-chart/src/main/java/com/fr/van/chart/bubble/component/VanChartBubblePane.java

@ -4,6 +4,7 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -24,8 +25,8 @@ public class VanChartBubblePane extends BasicBeanPane<VanChartAttrBubble> {
private UIButtonGroup<Integer> displayNegative;
public VanChartBubblePane(){
minDiameter = new UISpinner(0,Double.MAX_VALUE,1,0);
maxDiameter = new UISpinner(0,Double.MAX_VALUE,1,0);
minDiameter = new UISpinnerWithPx(0);
maxDiameter = new UISpinnerWithPx(0);
shadow = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
displayNegative = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),

3
designer-chart/src/main/java/com/fr/van/chart/column/ColumnBorderAttriPane.java

@ -3,6 +3,7 @@ package com.fr.van.chart.column;
import com.fr.design.chart.comp.BorderAttriPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import java.awt.Dimension;
@ -19,7 +20,7 @@ public class ColumnBorderAttriPane extends BorderAttriPane {
public ColumnBorderAttriPane(String radiusString) {
this.add(new UILabel(radiusString + ":"));
radius = new UISpinner(0,1000,1,0);
radius = new UISpinnerWithPx(0,1000,1,0);
this.add(radius);
radius.setPreferredSize(new Dimension(60, 18));
}

8
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java

@ -3,6 +3,8 @@ package com.fr.van.chart.column;
import com.fr.base.background.ImageBackground;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
@ -76,10 +78,10 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
private JPanel createSeriesStylePane(double[] row, double[] col) {
isFixedWidth = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")});
columnWidth = new UISpinner(0,1000,1,0);
columnWidth = new UISpinnerWithPx(0,1000,1,0);
columnWidth.setBorder(BorderFactory.createEmptyBorder(0, (int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0));
seriesGap = new UINumberDragPane(-100, 100);
categoryGap = new UINumberDragPane(0, 100);
seriesGap = new UINumberDragPaneWithPercent(-100, 100);
categoryGap = new UINumberDragPaneWithPercent(0, 100);
isFillWithImage = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")});
imagePane = new ImageBackgroundQuickPane(false);
imagePane.setBorder(BorderFactory.createEmptyBorder(0,(int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0));

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartAreaSeriesFillColorPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.designer.component;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
@ -36,7 +37,7 @@ public class VanChartAreaSeriesFillColorPane extends BasicPane {
};
}
};
transparent = new UINumberDragPane(0, 100);
transparent = new UINumberDragPaneWithPercent(0, 100);
JPanel transparentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha"), transparent);

5
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java

@ -4,6 +4,7 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.utils.gui.UIComponentUtils;
@ -15,11 +16,11 @@ import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.util.Arrays;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;
/**
* line相关设置
@ -74,7 +75,7 @@ public class VanChartLineTypePane extends BasicPane {
lineTypeComboBox = createLineType();
lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE);
lineWidthSpinner = new UISpinnerWithPx(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE);
lineTypeComboBox.addActionListener(new ActionListener() {
@Override

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java

@ -7,6 +7,7 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
@ -61,7 +62,7 @@ public class VanChartTrendLinePane extends BasicPane{
trendLineName = new UITextField();
trendLineColor = new ColorSelectBox(PREFERRED_WIDTH);
trendLineStyle = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED});
lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE);
lineWidthSpinner = new UISpinnerWithPx(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE);
trendLineType = new UIComboBox(TYPES);
prePeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
afterPeriod = new UISpinner(0, Integer.MAX_VALUE, 1, 0);

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java

@ -4,6 +4,7 @@ import com.fr.base.background.ImageBackground;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
@ -112,7 +113,7 @@ public class VanChartBackgroundPane extends BasicPane {
}
});
transparentLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha"));
transparent = new UINumberDragPane(0, 100);
transparent = new UINumberDragPaneWithPercent(0, 100);
}
protected Component[][] getPaneComponents() {

23
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java

@ -1,10 +1,15 @@
package com.fr.van.chart.designer.component.background;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.Component;
@ -28,10 +33,13 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = { p,p,p};
double[] columnSize = {f, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH};
double[] rowSize = {p, p, p};
return TableLayoutHelper.createTableLayoutPane(getPaneComponents(),rowSize,columnSize);
JPanel tableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize,
TableLayout4VanChartHelper.COMPONENT_INTERVAL, LayoutConstants.VGAP_MEDIUM);
tableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 4, 0));
return tableLayoutPane;
}
@Override
@ -44,7 +52,7 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Default_Name");
return Toolkit.i18nText("Fine-Design_Chart_Default_Name");
}
});
paneList.add(new ColorBackgroundQuickPane());
@ -54,11 +62,14 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro
@Override
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{typeComboBox, null},
new Component[]{centerPane, null},
new Component[]{new UILabel(labelName()), typeComboBox},
new Component[]{null, centerPane},
new Component[]{getTransparentLabel(), transparent},
};
}
protected String labelName() {
return Toolkit.i18nText("Fine-Design_Chart_Background");
}
}

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java

@ -3,6 +3,7 @@ package com.fr.van.chart.designer.component.background;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import java.awt.Component;
@ -24,7 +25,7 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg
}
protected Component[][] getPaneComponents() {
radius = new UISpinner(0, 1000, 1, 0);
radius = new UISpinnerWithPx(0, 1000, 1, 0);
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox},

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithAlphaPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.designer.component.border;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
@ -29,7 +30,7 @@ public class VanChartBorderWithAlphaPane extends VanChartBorderPane{
@Override
protected void initComponents() {
super.initComponents();
transparent = new UINumberDragPane(0,100);
transparent = new UINumberDragPaneWithPercent(0,100);
}
protected void initContent() {

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java

@ -4,6 +4,7 @@ import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
@ -34,7 +35,7 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane {
@Override
protected void initComponents() {
super.initComponents();
radius = new UISpinner(0,1000,1,0);
radius = new UISpinnerWithPx(0,1000,1,0);
}
@Override

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java

@ -7,6 +7,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
@ -58,7 +59,7 @@ public class VanChartBorderWithShapePane extends BasicPane {
});
lineColorBox = new ColorSelectBox(100);
borderShape = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers());
borderRadius = new UISpinner(0, 1000, 1, 0);
borderRadius = new UISpinnerWithPx(0, 1000, 1, 0);
}
private void createBorderPane() {

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java

@ -4,6 +4,7 @@ import com.fr.chart.chartglyph.Marker;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
@ -89,7 +90,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
};
}
};
radius = new UISpinner(0, 100, 0.5, 0);
radius = new UISpinnerWithPx(0, 100, 0.5, 0);
double p = TableLayout.PREFERRED;

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartFieldListPane.java

@ -162,7 +162,7 @@ public class VanChartFieldListPane extends JPanel {
tableField.setPreferredSize(new Dimension(FIELD_ADD_W, tableFieldNameList.size() * FIELD_ADD_H));
return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap("数据集字段", tableField);
return TableLayout4VanChartHelper.createExpandablePaneWithTitleTopGap(Toolkit.i18nText("Fine-Design_Report_Table_Field"), tableField);
}
protected List<VanChartFieldButton> getDefaultFieldButtonList() {

8
designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.designer.component.richText;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.ui.ModernUIPane;
import com.fr.plugin.chart.base.AttrTooltipContent;
@ -38,7 +39,8 @@ public class VanChartRichTextPane extends BasicBeanPane<AttrTooltipContent> {
}
private JPanel createFieldContentPane() {
JPanel fieldPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
JPanel fieldPane = new JPanel();
fieldPane.setLayout(FRGUIPaneFactory.create2ColumnGridLayout());
// 新增字段目录
JPanel fieldListContent = new JPanel();
@ -48,12 +50,12 @@ public class VanChartRichTextPane extends BasicBeanPane<AttrTooltipContent> {
JScrollPane fieldListScrollPane = new JScrollPane(fieldListContent);
fieldListScrollPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H));
fieldListScrollPane.setHorizontalScrollBar(null);
fieldListScrollPane.setBorder(BorderFactory.createTitledBorder("添加字段"));
fieldListScrollPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Add_Field")));
// 字段格式和汇总
JScrollPane fieldAttrScrollPane = new JScrollPane(fieldAttrPane);
fieldAttrScrollPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H));
fieldAttrScrollPane.setBorder(BorderFactory.createTitledBorder("字段设置"));
fieldAttrScrollPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Field_Setting")));
fieldPane.add(fieldListScrollPane);
fieldPane.add(fieldAttrScrollPane);

11
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -4,11 +4,12 @@ import com.fr.base.BaseUtils;
import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -65,7 +66,7 @@ public class VanChartPlotLegendPane extends BasicPane {
//区域显示策略 恢复用注释。下面4行删除。
private UIButtonGroup<Integer> customSize;
private UISpinner maxProportion;
private UINumberDragPane maxProportion;
private JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
@ -294,7 +295,7 @@ public class VanChartPlotLegendPane extends BasicPane {
private JPanel createDisplayStrategy() {
//区域显示策略 恢复用注释。开始删除。
maxProportion = new UISpinner(0, 100, 1, 30);
maxProportion = new UINumberDragPaneWithPercent(0, 100, 1);
customSize = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), customSize);
@ -402,7 +403,7 @@ public class VanChartPlotLegendPane extends BasicPane {
legend.setLayout(layoutButton.getSelectedItem());
//区域显示策略 恢复用注释。下面2行删除。
legend.setCustomSize(customSize.getSelectedIndex() == 1);
legend.setMaxHeight(maxProportion.getValue());
legend.setMaxHeight(maxProportion.updateBean());
//区域显示策略 恢复用注释。取消注释。
//legend.setLimitAttribute(limitPane.updateBean());
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());
@ -427,7 +428,7 @@ public class VanChartPlotLegendPane extends BasicPane {
layoutButton.setSelectedItem(legend.getLayout());
//区域显示策略 恢复用注释。下面2行删除。
customSize.setSelectedIndex(legend.isCustomSize() ? 1 : 0);
maxProportion.setValue(legend.getMaxHeight());
maxProportion.populateBean(legend.getMaxHeight());
//区域显示策略 恢复用注释。取消注释。
//limitPane.populateBean(legend.getLimitAttribute());
if (highlightButton != null) {

11
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -7,11 +7,12 @@ import com.fr.chart.base.TextAttr;
import com.fr.chartx.config.info.constant.ConfigType;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
@ -64,7 +65,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
//区域显示策略 恢复用注释。下面3行删除。
private UIButtonGroup<Integer> limitSize;
private UISpinner maxProportion;
private UINumberDragPane maxProportion;
private JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
@ -183,7 +184,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private JPanel createDisplayStrategy() {
//区域显示策略 恢复用注释。开始删除。
maxProportion = new UISpinner(0, 100, 1, 30);
maxProportion = new UINumberDragPaneWithPercent(0, 100, 1);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize);
@ -320,7 +321,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
customFloatPositionPane.setFloatPosition_y(title.getFloatPercentY());
//区域显示策略 恢复用注释。下面2行删除。
limitSize.setSelectedIndex(title.isLimitSize() ? 0 : 1);
maxProportion.setValue(title.getMaxHeight());
maxProportion.populateBean(title.getMaxHeight());
//区域显示策略 恢复用注释。取消注释。
//limitPane.populateBean(title.getLimitAttribute());
@ -357,7 +358,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
title.setFloating(customFloatPositionButton.isSelected());
//区域显示策略 恢复用注释。下面2行删除。
title.setLimitSize(limitSize.getSelectedIndex() == 0);
title.setMaxHeight(maxProportion.getValue());
title.setMaxHeight(maxProportion.updateBean());
//区域显示策略 恢复用注释。取消注释。
//title.setLimitAttribute(limitPane.updateBean());
title.setFloatPercentX(customFloatPositionPane.getFloatPosition_x());

10
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -8,11 +8,11 @@ import com.fr.chart.chartattr.Title;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.i18n.Toolkit;
@ -97,7 +97,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
//区域显示策略 恢复用注释。下面3行删除。
protected UIButtonGroup<Integer> axisLimitSize;
protected UISpinner maxProportion;
protected UINumberDragPane maxProportion;
protected JPanel maxProportionPane;
//区域显示策略 恢复用注释。取消注释。
//private LimitPane limitPane;
@ -465,7 +465,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected JPanel createDisplayStrategy() {
//区域显示策略 恢复用注释。删除到return,即除了注释的代码都删除。
maxProportion = new UISpinner(0, 100, 1, 30);
maxProportion = new UINumberDragPaneWithPercent(0, 100, 1);
axisLimitSize = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Limit"), Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), axisLimitSize);
@ -767,7 +767,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
axisLimitSize.setSelectedIndex(axis.isLimitSize() ? 0 : 1);
}
if (maxProportion != null) {
maxProportion.setValue(axis.getMaxHeight());
maxProportion.populateBean(axis.getMaxHeight());
}
//区域显示策略 恢复用注释。取消注释。
@ -909,7 +909,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
axis.setLimitSize(axisLimitSize.getSelectedIndex() == 0);
}
if (maxProportion != null) {
axis.setMaxHeight(maxProportion.getValue());
axis.setMaxHeight(maxProportion.updateBean());
}
//区域显示策略 恢复用注释。取消注释。
// if (limitPane != null) {

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java

@ -10,6 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory;
@ -90,7 +91,7 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
alertValue.setPreferredSize(new Dimension(VALUE_WD, HT));
alertLineStyle = new LineTypeComboBox(new LineType[]{LineType.SOLID, LineType.DASHED});
lineWidthSpinner = new UISpinner(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE);
lineWidthSpinner = new UISpinnerWithPx(LINE_WIDTH_MIN_VALUE, Integer.MAX_VALUE, LINE_WIDTH_DIERTA_VALUE, LINE_WIDTH_DEFAULT_VALUE);
alertLineColor = new ColorSelectBox(PREFERRED_WIDTH);
alertTextPosition = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Top"), Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom")});
alertText = new TinyFormulaPane();

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java

@ -5,6 +5,7 @@ import com.fr.base.Utils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
@ -52,7 +53,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
bottomValue.setPreferredSize(new Dimension(124,20));
topValue.setPreferredSize(new Dimension(124,20));
color = new ColorSelectBox(100);
transparent = new UINumberDragPane(0,100);
transparent = new UINumberDragPaneWithPercent(0,100);
double p = TableLayout.PREFERRED;
double[] columnSize = {p,p};
double[] rowSize = {p,p,p};

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -11,6 +11,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
@ -278,7 +279,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//不透明度
protected JPanel createAlphaPane() {
transparent = new UINumberDragPane(0, 100);
transparent = new UINumberDragPaneWithPercent(0, 100);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), transparent);
}

10
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -84,7 +84,11 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
};*/
backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow();
selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow();
selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow() {
protected String labelName() {
return Toolkit.i18nText("Fine-Design_Chart_Select_Color");
}
};
catalogSuperLink = new VanChartCatalogHyperLinkPane();
double p = TableLayout.PREFERRED;
@ -94,8 +98,8 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
Component[][] components = new Component[][]{
new Component[]{null},
new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)},
new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane)},
new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Select_Color"), selectBackgroundPane)},
new Component[]{backgroundPane},
new Component[]{selectBackgroundPane},
new Component[]{catalogSuperLink}
};
drillPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);

3
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.gantt.designer.style.axis;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -55,7 +56,7 @@ public class GanttAxisStylePane extends BasicBeanPane<GanttAxisStyleAttr> {
protected void initComponents() {
textAttrPane = new ChartTextAttrPane();
colorSelectBox4button = new ColorSelectBoxWithOutTransparent(100);
transparent = new UINumberDragPane(0, 100);
transparent = new UINumberDragPaneWithPercent(0, 100);
}
protected Component[][] getUsedComponents() {

6
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java

@ -3,9 +3,11 @@ package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -257,12 +259,12 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane {
}
private Component[] getThermometerWidth() {
thermometerWidth = new UISpinner(0, Double.MAX_VALUE, 0.1, 10);
thermometerWidth = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.1, 10);
return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Thermometer_Width")),thermometerWidth};
}
private Component[] getChutePercent() {
chutePercent = new UINumberDragPane(0, 100, 1);
chutePercent = new UINumberDragPaneWithPercent(0, 100, 1);
return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Chute_Percent")),chutePercent};
}

20
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/style/VanChartHeatMapSeriesPane.java

@ -3,9 +3,11 @@ package com.fr.van.chart.heatmap.designer.style;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -31,7 +33,7 @@ import java.awt.Component;
public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane {
private UISpinner radius;
private UISpinner blur;
private UINumberDragPane blur;
private UINumberDragPane minOpacity;
private UINumberDragPane maxOpacity;
@ -119,8 +121,8 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane {
}
private JPanel createHeatPointStylePane() {
radius = new UISpinner(0, Double.MAX_VALUE, 1, 30);
blur = new UISpinner(0, 100, 1, 30);
radius = new UISpinnerWithPx(0, Double.MAX_VALUE, 1, 30);
blur = new UINumberDragPaneWithPercent(0, 100, 1);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -130,8 +132,8 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane {
Component[][] components = new Component[][]{
new Component[]{null, null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Heat_Map_Radius")), radius, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Heat_Map_Blur")), blur, new UILabel("%")}
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Heat_Map_Radius")), radius, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Heat_Map_Blur")), blur, null}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
@ -141,8 +143,8 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane {
}
private JPanel createOpacityPane() {
maxOpacity = new UINumberDragPane(0, 100);
minOpacity = new UINumberDragPane(0, 100);
maxOpacity = new UINumberDragPaneWithPercent(0, 100);
minOpacity = new UINumberDragPaneWithPercent(0, 100);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -169,7 +171,7 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane {
if (plot instanceof VanChartHeatMapPlot) {
VanChartHeatMapPlot heatMapPlot = (VanChartHeatMapPlot) plot;
radius.setValue(heatMapPlot.getRadius());
blur.setValue(heatMapPlot.getBlur());
blur.populateBean(heatMapPlot.getBlur());
maxOpacity.populateBean(heatMapPlot.getMaxOpacity());
minOpacity.populateBean(heatMapPlot.getMinOpacity());
getVanChartValueColorPane().populateBean((VanChartRangeLegend) plot.getLegend());
@ -187,7 +189,7 @@ public class VanChartHeatMapSeriesPane extends VanChartMapSeriesPane {
if (plot instanceof VanChartHeatMapPlot) {
VanChartHeatMapPlot heatMapPlot = (VanChartHeatMapPlot) plot;
heatMapPlot.setRadius(radius.getValue());
heatMapPlot.setBlur(blur.getValue());
heatMapPlot.setBlur(blur.updateBean());
heatMapPlot.setMaxOpacity(maxOpacity.updateBean());
heatMapPlot.setMinOpacity(minOpacity.updateBean());
getVanChartValueColorPane().updateBean((VanChartRangeLegend) plot.getLegend());

3
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -5,6 +5,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
@ -321,7 +322,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
//不透明度
protected JPanel createAlphaPane() {
setTransparent(new UINumberDragPane(0, 100));
setTransparent(new UINumberDragPaneWithPercent(0, 100));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};

3
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapAnchorMarkerPane.java

@ -3,6 +3,7 @@ package com.fr.van.chart.map.designer.style.series;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -20,7 +21,7 @@ public class VanChartMapAnchorMarkerPane extends BasicBeanPane<VanChartAttrMarke
private UISpinner anchorSize;
public VanChartMapAnchorMarkerPane() {
anchorSize = new UISpinner(0, Double.MAX_VALUE, 0.5, 28);
anchorSize = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 28);
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Height")), anchorSize}

6
designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartCurvePane.java

@ -2,8 +2,10 @@ package com.fr.van.chart.map.line;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -29,9 +31,9 @@ public class VanChartCurvePane extends BasicBeanPane<AttrCurve>{
}
private void initComponents(){
lineWidth = new UISpinner(0, MAX_WIDTH, STEP, 0.5);
lineWidth = new UISpinnerWithPx(0, MAX_WIDTH, STEP, 0.5);
bending = new UINumberDragPane(0, 100);
lineAlphaPane = new UINumberDragPane(0, 100);
lineAlphaPane = new UINumberDragPaneWithPercent(0, 100);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;

7
designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieSeriesPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.multilayer.style;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
@ -46,7 +47,7 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gradual_Deep")});
startAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0);
endAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0);
innerRadius = new UISpinner(0, 100, 1, 0);
innerRadius = new UINumberDragPaneWithPercent(0, 100, 1);
supportRotation = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
supportDrill = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),
@ -72,7 +73,7 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane {
gradualLevel.setSelectedIndex(multiPiePlot.isLight() ? 0 : 1);
startAngle.setValue(multiPiePlot.getStartAngle());
endAngle.setValue(multiPiePlot.getEndAngle());
innerRadius.setValue(multiPiePlot.getInnerRadiusPercent());
innerRadius.populateBean(multiPiePlot.getInnerRadiusPercent());
supportDrill.setSelectedIndex(multiPiePlot.isSupportDrill() ? 0 : 1);
supportRotation.setSelectedIndex(multiPiePlot.isSupportRotation() ? 0 : 1);
}
@ -85,7 +86,7 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane {
multiPiePlot.setLight(gradualLevel.getSelectedIndex() == 0);
multiPiePlot.setStartAngle(startAngle.getValue());
multiPiePlot.setEndAngle(endAngle.getValue());
multiPiePlot.setInnerRadiusPercent(innerRadius.getValue());
multiPiePlot.setInnerRadiusPercent(innerRadius.updateBean());
multiPiePlot.setSupportDrill(supportDrill.getSelectedIndex() == 0);
multiPiePlot.setSupportRotation(supportRotation.getSelectedIndex() == 0);
}

11
designer-chart/src/main/java/com/fr/van/chart/pie/RadiusCardLayoutPane.java

@ -4,9 +4,10 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.radius.VanChartRadiusPlot;
import com.fr.plugin.chart.base.VanChartRadius;
import com.fr.plugin.chart.type.RadiusType;
@ -14,11 +15,11 @@ import com.fr.van.chart.layout.VanChartCardLayoutPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.HashMap;
import java.util.Map;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.HashMap;
import java.util.Map;
/**
* Created by hufan on 2016/10/25.
@ -40,8 +41,8 @@ public class RadiusCardLayoutPane extends BasicBeanPane<Plot> {
Map<String, Component> paneList = new HashMap<String, Component>();
radiusType = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Auto"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fixed")});
radius = new UISpinner(MIN_RADIUS, MAX_RADIUS, 1, 100);
radiusType = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Fixed")});
radius = new UISpinnerWithPx(100);
radiusContent = new JPanel(new BorderLayout());
radiusContent.add(radius, BorderLayout.CENTER);

10
designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java

@ -2,6 +2,8 @@ package com.fr.van.chart.pie;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
@ -27,7 +29,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
protected UISpinner startAngle;
protected UISpinner endAngle;
protected UISpinner innerRadius;
protected UINumberDragPane innerRadius;
private UIButtonGroup<Boolean> supportRotation;
public VanChartPieSeriesPane(ChartStylePane parent, Plot plot) {
@ -52,7 +54,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
protected JPanel createSeriesStylePane(double[] row, double[] col) {
startAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0);
endAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0);
innerRadius = new UISpinner(0, 100, 1, 0);
innerRadius = new UINumberDragPaneWithPercent(0, 100, 1);
supportRotation = new UIButtonGroup<Boolean>(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
@ -86,7 +88,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
PiePlot4VanChart piePlot4VanChart = (PiePlot4VanChart) plot;
startAngle.setValue(piePlot4VanChart.getStartAngle());
endAngle.setValue(piePlot4VanChart.getEndAngle());
innerRadius.setValue(piePlot4VanChart.getInnerRadiusPercent());
innerRadius.populateBean(piePlot4VanChart.getInnerRadiusPercent());
supportRotation.setSelectedIndex(piePlot4VanChart.isSupportRotation() == true ?0:1);
}
}
@ -107,7 +109,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
PiePlot4VanChart piePlot4VanChart = (PiePlot4VanChart)plot;
piePlot4VanChart.setStartAngle(startAngle.getValue());
piePlot4VanChart.setEndAngle(endAngle.getValue());
piePlot4VanChart.setInnerRadiusPercent(innerRadius.getValue());
piePlot4VanChart.setInnerRadiusPercent(innerRadius.updateBean());
piePlot4VanChart.setSupportRotation(supportRotation.getSelectedItem());
}
}

46
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/StructureNodeStylePane.java

@ -3,13 +3,15 @@ package com.fr.van.chart.structure.desinger.style;
import com.fr.base.background.ImageBackground;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
import com.fr.plugin.chart.base.AttrNode;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartMarkerBackgroundPane;
@ -42,38 +44,46 @@ public class StructureNodeStylePane extends BasicBeanPane<AttrNode> {
double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p};
nodeRadiusType = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")});
nodeRadius = new UISpinner(0,Double.MAX_VALUE,0.5,0);
nodeBorderWidth = new UISpinner(0,Double.MAX_VALUE,0.5,0);
nodeBorderColor = new VanChartMarkerBackgroundPane();
nodeOpacity = new UINumberDragPane(0,100);
nodeRadiusType = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"),
Toolkit.i18nText("Fine-Design_Chart_Custom")});
nodeRadius = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 0);
nodeBorderWidth = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 0);
nodeBorderColor = new VanChartMarkerBackgroundPane() {
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Node_Radius")), typeComboBox},
new Component[]{null, centerPane},
};
}
};
nodeOpacity = new UINumberDragPaneWithPercent(0, 100);
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Node_Radius"), nodeRadiusType), BorderLayout.NORTH);
jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Node_Radius"), nodeRadiusType), BorderLayout.NORTH);
nodeRadiusPane = TableLayout4VanChartHelper.createGapTableLayoutPane("", nodeRadius);
jPanel.add(nodeRadiusPane, BorderLayout.CENTER);
Component[][] components1 = new Component[][]{
new Component[]{null, null},
new Component[]{jPanel, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border_Width")), nodeBorderWidth},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style_Border_Color")), nodeBorderColor},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), nodeOpacity}
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Border_Width")), nodeBorderWidth},
new Component[]{nodeBorderColor, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), nodeOpacity}
};
JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(components1, rowSize, columnSize);
useImage = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_YES"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_NO")});
useImage = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"),
Toolkit.i18nText("Fine-Design_Chart_NO")});
imagePane = new ImageBackgroundQuickPane(false);
imagePane.setBorder(BorderFactory.createEmptyBorder(0,(int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0));
imagePane.setBorder(BorderFactory.createEmptyBorder(0, (int) TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL, 0, 0));
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")),useImage},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")), useImage},
};
JPanel useImagePane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, columnSize);
JPanel panel2 = new JPanel(new BorderLayout(0,6));
JPanel panel2 = new JPanel(new BorderLayout(0, 6));
panel2.add(useImagePane, BorderLayout.NORTH);
panel2.add(imagePane, BorderLayout.CENTER);
@ -91,7 +101,7 @@ public class StructureNodeStylePane extends BasicBeanPane<AttrNode> {
}
});
this.setLayout(new BorderLayout(0,6));
this.setLayout(new BorderLayout(0, 6));
this.add(panel1, BorderLayout.NORTH);
this.add(panel2, BorderLayout.CENTER);
}
@ -112,7 +122,7 @@ public class StructureNodeStylePane extends BasicBeanPane<AttrNode> {
nodeBorderColor.populate(ob.getBorderColor());
nodeOpacity.populateBean(ob.getOpacity());
useImage.setSelectedIndex(ob.isUseImage() ? 0 : 1);
if(ob.getImageBackground() != null) {
if (ob.getImageBackground() != null) {
imagePane.populateBean(ob.getImageBackground());
}
checkRadius();

35
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureSeriesPane.java

@ -3,9 +3,12 @@ package com.fr.van.chart.structure.desinger.style;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
@ -43,7 +46,7 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p,p,p};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{createLinkPane()},
new Component[]{createNodePane()}
@ -57,10 +60,10 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane
private JPanel createLinkPane() {
linkColor = new ColorSelectBox(100);
linkWidthType = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")});
linkWidth = new UISpinner(0,Double.MAX_VALUE,0.5,0);
linkOpacity = new UINumberDragPane(0,100);
linkWidthType = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"),
Toolkit.i18nText("Fine-Design_Chart_Custom")});
linkWidth = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.5, 0);
linkOpacity = new UINumberDragPaneWithPercent(0, 100);
linkWidthType.addChangeListener(new ChangeListener() {
@Override
@ -73,10 +76,10 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p,p,p,p};
double[] rowSize = {p, p, p, p};
JPanel jPanel = new JPanel(new BorderLayout());
jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_Width")+" ", linkWidthType), BorderLayout.NORTH);
jPanel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Tree_Width") + " ", linkWidthType), BorderLayout.NORTH);
linkWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(" ", linkWidth);
jPanel.add(linkWidthPane, BorderLayout.CENTER);
@ -104,8 +107,8 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane
@Override
public void populateBean(Plot plot) {
super.populateBean(plot);
if(plot instanceof VanChartStructurePlot){
VanChartStructurePlot structurePlot = (VanChartStructurePlot)plot;
if (plot instanceof VanChartStructurePlot) {
VanChartStructurePlot structurePlot = (VanChartStructurePlot) plot;
linkColor.setSelectObject(structurePlot.getLinkColor());
linkWidthType.setSelectedIndex(structurePlot.isAutoLinkWidth() ? 0 : 1);
linkWidth.setValue(structurePlot.getLinkWidth());
@ -117,8 +120,8 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane
@Override
public void updateBean(Plot plot) {
super.updateBean(plot);
if(plot instanceof VanChartStructurePlot){
VanChartStructurePlot structurePlot = (VanChartStructurePlot)plot;
if (plot instanceof VanChartStructurePlot) {
VanChartStructurePlot structurePlot = (VanChartStructurePlot) plot;
structurePlot.setLinkColor(linkColor.getSelectObject());
structurePlot.setAutoLinkWidth(linkWidthType.getSelectedIndex() == 0);
structurePlot.setLinkWidth(linkWidth.getValue());
@ -126,16 +129,16 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane
}
}
protected void populateCondition(ConditionAttr defaultAttr){
if(nodeStylePane != null){
protected void populateCondition(ConditionAttr defaultAttr) {
if (nodeStylePane != null) {
AttrNode attrNode = defaultAttr.getExisted(AttrNode.class);
nodeStylePane.populateBean(attrNode);
}
}
protected void updateCondition(ConditionAttr defaultAttr){
if(nodeStylePane != null){
AttrNode attrNode =defaultAttr.getExisted(AttrNode.class);
protected void updateCondition(ConditionAttr defaultAttr) {
if (nodeStylePane != null) {
AttrNode attrNode = defaultAttr.getExisted(AttrNode.class);
if (attrNode != null) {
defaultAttr.remove(attrNode);
defaultAttr.addDataSeriesCondition(nodeStylePane.updateBean());

51
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java

@ -4,10 +4,12 @@ import com.fr.base.Utils;
import com.fr.base.background.ImageBackground;
import com.fr.base.background.ImageFileBackground;
import com.fr.chart.chartattr.Plot;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
@ -61,7 +63,7 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p,p,p};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{createWordCloudStylePane()},
};
@ -71,42 +73,43 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane {
return contentPane;
}
private JPanel createWordCloudStylePane(){
private JPanel createWordCloudStylePane() {
double labelSize = LABEL_SIZE;
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] centerC = {labelSize,f,p,f};
double[] centerC = {labelSize, f, p, f};
double[] centerR = {p};
minRotation = new UISpinner(-MAX_ROTATION,MAX_ROTATION,1,0);
minRotation = new UISpinner(-MAX_ROTATION, MAX_ROTATION, 1, 0);
maxRotation = new
UISpinner(-MAX_ROTATION,MAX_ROTATION,1,0);
UISpinner(-MAX_ROTATION, MAX_ROTATION, 1, 0);
Component[][] centerComps = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Rotation_Angle")), minRotation,
new UILabel("-"), maxRotation},
};
JPanel centerPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(centerComps,centerR,centerC);
JPanel centerPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(centerComps, centerR, centerC);
double[] northC = {f, e};
double[] northR = {p,p};
double[] northR = {p, p};
fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report());
defineFontSize = new UIButtonGroup(new String[]{AUTO_FONT_SIZE, CUSTOM_FONT_SIZE});
Component[][] northComps = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font")), fontNameComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")), defineFontSize }
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")), defineFontSize}
};
JPanel northPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(northComps,northR,northC);
JPanel northPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(northComps, northR, northC);
minFontSize = new UISpinner(0,Double.MAX_VALUE,1,10);
maxFontSize = new UISpinner(0,Double.MAX_VALUE,1,100);
minFontSize = new UISpinnerWithPx(10);
maxFontSize = new UISpinnerWithPx(100);
Component[][] fontComps = new Component[][]{
new Component[]{null, minFontSize,
new UILabel("-"), maxFontSize},
};
fontPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(fontComps,centerR,centerC);
fontPanel = TableLayoutHelper.createGapTableLayoutPane(fontComps, centerR, centerC,
6, LayoutConstants.VGAP_LARGE);
double[] columnSize = {f};
double[] rowSize = {p, p, p, p};
@ -132,27 +135,27 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane {
private JPanel createCloudShapePane() {
cloudShape = new UIComboBox(CloudShapeType.getTypes());
imageBackgroundQuickPane = new ImageBackgroundQuickPane(false){
imageBackgroundQuickPane = new ImageBackgroundQuickPane(false) {
@Override
public Dimension getPreferredSize() {
if(cloudShape.getSelectedItem() == CloudShapeType.DEFAULT){
return new Dimension(0,0);
if (cloudShape.getSelectedItem() == CloudShapeType.DEFAULT) {
return new Dimension(0, 0);
} else {
return super.getPreferredSize();
}
}
};
JPanel panel = new JPanel(new BorderLayout(0,4));
JPanel panel = new JPanel(new BorderLayout(0, 4));
panel.add(cloudShape, BorderLayout.NORTH);
panel.add(imageBackgroundQuickPane, BorderLayout.CENTER);
cloudShape.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
CloudShapeType type = (CloudShapeType)cloudShape.getSelectedItem();
CloudShapeType type = (CloudShapeType) cloudShape.getSelectedItem();
String path = type.getImageUrl();
if(path != null) {
if (path != null) {
ImageFileBackground imageBackground = new ImageFileBackground(IOUtils.readImage(path));
imageBackgroundQuickPane.populateBean(imageBackground);
} else {
@ -181,8 +184,8 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane {
@Override
public void populateBean(Plot plot) {
super.populateBean(plot);
if(plot instanceof VanChartWordCloudPlot){
VanChartWordCloudPlot wordCloudPlot = (VanChartWordCloudPlot)plot;
if (plot instanceof VanChartWordCloudPlot) {
VanChartWordCloudPlot wordCloudPlot = (VanChartWordCloudPlot) plot;
fontNameComboBox.setSelectedItem(wordCloudPlot.getFont().getFamily());
minRotation.setValue(wordCloudPlot.getMinRotation());
maxRotation.setValue(wordCloudPlot.getMaxRotation());
@ -193,7 +196,7 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane {
cloudShape.setSelectedItem(wordCloudPlot.getShapeType());
ImageBackground imageBackground = wordCloudPlot.getShapeImage();
if(imageBackground != null) {
if (imageBackground != null) {
imageBackgroundQuickPane.populateBean(imageBackground);
}
}
@ -209,8 +212,8 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane {
@Override
public void updateBean(Plot plot) {
super.updateBean(plot);
if(plot instanceof VanChartWordCloudPlot){
VanChartWordCloudPlot wordCloudPlot = (VanChartWordCloudPlot)plot;
if (plot instanceof VanChartWordCloudPlot) {
VanChartWordCloudPlot wordCloudPlot = (VanChartWordCloudPlot) plot;
wordCloudPlot.setFont(FRFont.getInstance(fontNameComboBox.getSelectedItem().toString(), Font.PLAIN, 9));
wordCloudPlot.setMinRotation(minRotation.getValue());
wordCloudPlot.setMaxRotation(maxRotation.getValue());
@ -220,7 +223,7 @@ public class VanChartWordCloudSeriesPane extends VanChartColorValueSeriesPane {
wordCloudPlot.setMaxFontSize(maxFontSize.getValue());
wordCloudPlot.setShapeType((CloudShapeType) cloudShape.getSelectedItem());
if(wordCloudPlot.getShapeType() != CloudShapeType.DEFAULT) {
if (wordCloudPlot.getShapeType() != CloudShapeType.DEFAULT) {
wordCloudPlot.setShapeImage((ImageBackground) imageBackgroundQuickPane.updateBean());
} else {
wordCloudPlot.setShapeImage(null);

2
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -36,6 +36,7 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.module.ChartEmptyDataStyleAction;
import com.fr.design.module.ChartPreStyleAction;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.monitor.DesignerLifecycleMonitorContext;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.Event;
@ -102,6 +103,7 @@ public class MainDesigner extends BaseDesigner {
StopWatch watch = new StopWatch();
watch.start();
DesignerLifecycleMonitorContext.getMonitor().beforeStart();
//启动运行时
FineRuntime.start();
DesignerSubListener.getInstance().start();

14
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java

@ -3,6 +3,8 @@ package com.fr.start.module;
import com.fr.design.DesignerEnvManager;
import com.fr.design.EnvChangeEntrance;
import com.fr.design.constants.DesignerLaunchStatus;
import com.fr.design.editlock.ConnectionLockChangeChecker;
import com.fr.design.editlock.ServerTableDataLockChangeChecker;
import com.fr.design.env.DesignerWorkspaceGenerator;
import com.fr.design.env.DesignerWorkspaceInfo;
import com.fr.design.env.LocalDesignerWorkspaceInfo;
@ -88,6 +90,12 @@ public class DesignerWorkspaceProvider extends Activator {
}
}
pluginErrorRemind();
editLockCheckerStart();
}
private void editLockCheckerStart() {
ConnectionLockChangeChecker.getInstance().start();
ServerTableDataLockChangeChecker.getInstance().start();
}
private void pluginErrorRemind() {
@ -102,6 +110,12 @@ public class DesignerWorkspaceProvider extends Activator {
@Override
public void stop() {
// void
editLockCheckerStop();
}
private void editLockCheckerStop() {
ConnectionLockChangeChecker.getInstance().stop();
ServerTableDataLockChangeChecker.getInstance().stop();
}
@Override

Loading…
Cancel
Save