fr_shine 7 years ago
parent
commit
eb7cb0c03c
  1. 12
      designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java
  2. 134
      designer/src/com/fr/design/dscolumn/DSColumnPane.java
  3. 3
      designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java
  4. 162
      designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
  5. 10
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  6. 44
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  7. 17
      designer/src/com/fr/design/mainframe/JWorkBook.java
  8. 4
      designer/src/com/fr/design/mainframe/ReportComponent.java
  9. 4
      designer/src/com/fr/design/mainframe/ReportComponentCardPane.java
  10. 5
      designer/src/com/fr/design/mainframe/ReportHyperlinkGroupPaneNoPop.java
  11. 3
      designer/src/com/fr/design/mainframe/SheetNameTabPane.java
  12. 9
      designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  13. 4
      designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java
  14. 5
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  15. 110
      designer/src/com/fr/design/report/PageSetupPane.java
  16. 23
      designer/src/com/fr/design/report/ReportBackgroundPane.java
  17. 10
      designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java
  18. 102
      designer/src/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java
  19. 2
      designer/src/com/fr/design/webattr/ReportWebWidgetConstants.java
  20. 4
      designer/src/com/fr/design/webattr/ToolBarButton.java
  21. 6
      designer/src/com/fr/grid/AbstractGridHeaderMouseHandler.java
  22. 4
      designer/src/com/fr/grid/GridColumnUI.java
  23. 14
      designer/src/com/fr/grid/GridMouseAdapter.java
  24. 4
      designer/src/com/fr/grid/GridRowUI.java
  25. 11
      designer/src/com/fr/grid/GridUI.java
  26. 3
      designer/src/com/fr/grid/selection/CellSelection.java
  27. 4
      designer/src/com/fr/grid/selection/FloatSelection.java
  28. 3
      designer/src/com/fr/poly/PolyComponetsBar.java
  29. 8
      designer/src/com/fr/poly/PolyDesigner.java
  30. 3
      designer/src/com/fr/poly/actions/DeleteBlockAction.java
  31. 7
      designer/src/com/fr/poly/creator/ChartBlockEditor.java
  32. 4
      designer/src/com/fr/poly/creator/ECBlockEditor.java
  33. 6
      designer/src/com/fr/poly/creator/ECBlockPane.java
  34. 8
      designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java
  35. 6
      designer/src/com/fr/poly/hanlder/ColumnOperationMouseHandler.java
  36. 4
      designer/src/com/fr/poly/hanlder/PolyDesignerDropTarget.java
  37. 6
      designer/src/com/fr/poly/hanlder/RowOperationMouseHandler.java
  38. 4
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  39. 7
      designer/src/com/fr/start/Designer.java
  40. 4
      designer_base/src/com/fr/design/DesignState.java
  41. 2
      designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java
  42. 5
      designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java
  43. 9
      designer_base/src/com/fr/design/actions/UpdateAction.java
  44. 11
      designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java
  45. 53
      designer_base/src/com/fr/design/actions/help/AboutPane.java
  46. 5
      designer_base/src/com/fr/design/data/datapane/ChoosePane.java
  47. 2
      designer_base/src/com/fr/design/designer/IntervalConstants.java
  48. 3
      designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java
  49. 13
      designer_base/src/com/fr/design/event/DesignerOpenedListener.java
  50. 2
      designer_base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java
  51. 10
      designer_base/src/com/fr/design/file/MutilTempalteTabPane.java
  52. 4
      designer_base/src/com/fr/design/file/NewTemplatePane.java
  53. 2
      designer_base/src/com/fr/design/fun/SubmitProvider.java
  54. 467
      designer_base/src/com/fr/design/gui/controlpane/UISimpleListControlPane.java
  55. 36
      designer_base/src/com/fr/design/gui/demo/ComboBoxDemo.java
  56. 15
      designer_base/src/com/fr/design/gui/demo/SwingComponentsDemo.java
  57. 11
      designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java
  58. 32
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java
  59. 14
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java
  60. 8
      designer_base/src/com/fr/design/gui/ibutton/UISliderButtonUI.java
  61. 13
      designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java
  62. 137
      designer_base/src/com/fr/design/gui/icombobox/LazyComboBox.java
  63. 44
      designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java
  64. 5
      designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  65. 10
      designer_base/src/com/fr/design/gui/icontainer/UIModeControlContainer.java
  66. 7
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  67. 8
      designer_base/src/com/fr/design/gui/imenu/UIHeadMenu.java
  68. 7
      designer_base/src/com/fr/design/gui/imenu/UIMenu.java
  69. 29
      designer_base/src/com/fr/design/gui/style/BorderPane.java
  70. 4
      designer_base/src/com/fr/design/gui/style/FRFontPane.java
  71. 37
      designer_base/src/com/fr/design/icon/IconPathConstants.java
  72. BIN
      designer_base/src/com/fr/design/images/buttonicon/add_press.png
  73. BIN
      designer_base/src/com/fr/design/images/buttonicon/addicon.png
  74. BIN
      designer_base/src/com/fr/design/images/control/newEdit.png
  75. 31
      designer_base/src/com/fr/design/locale/designer.properties
  76. 35
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  77. 28
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  78. 35
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  79. 35
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  80. 35
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  81. 109
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  82. 3
      designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  83. 3
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  84. 34
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  85. 6
      designer_base/src/com/fr/design/mainframe/UndoStateEdit.java
  86. 11
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  87. 4
      designer_base/src/com/fr/design/mainframe/toolbar/VcsScene.java
  88. 31
      designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java
  89. 7
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java
  90. 17
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTabBackgroundEditor.java
  91. 40
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTabPaneBackgroundEditor.java
  92. 2
      designer_base/src/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java
  93. 5
      designer_base/src/com/fr/design/mainframe/widget/accessibles/TemplateStylePreviewPane.java
  94. 7
      designer_base/src/com/fr/design/menu/ShortCut.java
  95. 3
      designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  96. 95
      designer_base/src/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java
  97. 64
      designer_base/src/com/fr/design/style/background/BackgroundFactory.java
  98. 88
      designer_base/src/com/fr/design/style/background/BackgroundTabPane.java
  99. 3
      designer_base/src/com/fr/design/utils/DesignUtils.java
  100. 10
      designer_base/src/com/fr/design/utils/gui/GUIPaintUtils.java
  101. Some files were not shown because too many files have changed in this diff Show More

12
designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -11,7 +11,10 @@ import com.fr.design.report.mobile.ReportMobileAttrPane;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.main.TemplateWorkBook;
import com.fr.plugin.ExtraClassManager;
import com.fr.report.mobile.ElementCaseMobileAttr;
import com.fr.stable.ReportFunctionProcessor;
import com.fr.stable.fun.FunctionProcessor;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -50,8 +53,15 @@ public class ReportMobileAttrAction extends JWorkBookAction{
BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
wbTpl.setReportMobileAttr(mobileAttrPane.updateBean());
ElementCaseMobileAttr elementCaseMobileAttr = mobileAttrPane.updateBean();
wbTpl.setReportMobileAttr(elementCaseMobileAttr);
jwb.fireTargetModified();
if (elementCaseMobileAttr.isMobileCanvasSize()) {
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(ReportFunctionProcessor.MOBILE_TEMPLATE_CPT);
}
}
}
});
dialog.setVisible(true);

134
designer/src/com/fr/design/dscolumn/DSColumnPane.java

@ -1,26 +1,30 @@
package com.fr.design.dscolumn;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.FRContext;
import com.fr.data.TableDataSource;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
/**
* @author null
* @version 2018年2月9日13点47分
* @since 8.0
*/
public class DSColumnPane extends BasicPane {
private TableDataSource tplEC;
@ -29,16 +33,55 @@ public class DSColumnPane extends BasicPane {
private DSColumnConditionsPane conditionPane = null;
private DSColumnAdvancedPane advancedPane = null;
private TemplateCellElement cellElement;
protected Component lastSelectedComponent;
private Component lastSelectedComponent;
public static final int SETTING_ALL = 2;
public static final int SETTING_DSRELATED = 1;
private ChangeListener appliedWizardTabChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent evt) {
try {
if (lastSelectedComponent == null) {
lastSelectedComponent = basicPane;
}
// selectTabComponent是正要切换到的那个Pane
Component selectTabComponent = tabbedPane.getSelectedComponent();
// denny: 如果切换Tab时上一个Pane是basicPane, 则刷新一下其他Pane,
// 因为选择的数据列可能改变, 导致后面过滤和使用公式用到的数据项改变
if (lastSelectedComponent == basicPane) {
basicPane.update(cellElement);
// denny_GUI: 刷新其他面板
refreshOtherTabs();
}
// 切换标签的时候就,确认是否有没有添加到列表中的条件
lastSelectedComponent = selectTabComponent;
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
};
/**
* cellElement 改变时刷新一下
* 比如上边切换Tab时basicPane Update了一下可能会改变Field cellElement的值
*/
private PropertyChangeListener myPropertyChangeListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
refreshOtherTabs();
}
};
public DSColumnPane() {
this.initComponents(SETTING_ALL);
this(SETTING_ALL);
}
public DSColumnPane(int setting) {
private DSColumnPane(int setting) {
this.initComponents(setting);
}
@ -71,8 +114,12 @@ public class DSColumnPane extends BasicPane {
return Inter.getLocText("ExpandD-Data_Column");
}
/*
* populate
/**
* 更新面板信息
*
* @param tds 数据源
* @param cellElement 单元格
* @throws Exception e
*/
public void populate(TableDataSource tds, TemplateCellElement cellElement) throws Exception {
this.tplEC = tds;
@ -85,15 +132,16 @@ public class DSColumnPane extends BasicPane {
// _denny: 这边需要克隆一下,因为在设置时,可能改变字段cellElement,但改变真实值是不被期望的
try {
this.cellElement = (TemplateCellElement) cellElement.clone();
} catch (CloneNotSupportedException ce) {
} catch (CloneNotSupportedException ignored) {
}
// 只更新基本设置的面板信息即可,因为从基本信息切换到其他设置的时候也还是会更新其他面板的
this.basicPane.populate(tds, this.cellElement);
this.conditionPane.populate(tds, this.cellElement);
this.advancedPane.populate(this.cellElement);
}
/*
* update
/**
* update 保存
*
* @return 单元格信息
*/
public CellElement update() {
this.basicPane.update(cellElement);
@ -101,49 +149,19 @@ public class DSColumnPane extends BasicPane {
this.advancedPane.update(cellElement);
return cellElement;
}
public ChangeListener appliedWizardTabChangeListener = new ChangeListener() {
public void stateChanged(ChangeEvent evt) {
try {
if (lastSelectedComponent == null) {
lastSelectedComponent = basicPane;
}
//selectTabComponent是正要切换到的那个Pane
Component selectTabComponent = tabbedPane.getSelectedComponent();
// _denny: 如果切换Tab时上一个Pane是basicPane, 则刷新一下其他Pane,
// 因为选择的数据列可能改变, 导致后面过滤和使用公式用到的数据项改变
if (lastSelectedComponent == basicPane) {
basicPane.update(cellElement);
// denny_GUI: 刷新其他面板
refrushOtherTabs();
}
// 切换标签的时候就,确认是否有没有添加到列表中的条件
lastSelectedComponent = selectTabComponent;
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
};
// cellElement 改变时,刷新一下
// 比如:上边切换Tab时,basicPane Update了一下,可能会改变Field cellElement的值
PropertyChangeListener myPropertyChangeListener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
refrushOtherTabs();
}
};
//_denny:当数据tab中的数据发生变化的时候刷新后面的tab
public void refrushOtherTabs() {
// ——deny:当JTabPane中加入一个Pane时,后面的Pane可能还没有初始化
/**
* denny:当数据tab中的数据发生变化的时候刷新后面的tab
*/
private void refreshOtherTabs() {
// deny:当JTabPane中加入一个Pane时,后面的Pane可能还没有初始化
if (conditionPane == null || advancedPane == null) {
return;
}
this.conditionPane.populate(tplEC, cellElement);
this.advancedPane.populate(cellElement);
}
public void putElementcase(ElementCasePane t) {
basicPane.putElementcase(t);
}

3
designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java

@ -17,6 +17,7 @@ public class SelectedConfirmedDataColumnPane extends SelectedDataColumnPane {
super(false);
}
@Override
protected void initTableNameComboBox() {
tableNameComboBox = new TableDataComboBox(new WorkBook());
tableNameComboBox.addItemListener(new ItemListener() {
@ -39,7 +40,7 @@ public class SelectedConfirmedDataColumnPane extends SelectedDataColumnPane {
TemplateTableDataWrapper wrapper = new TemplateTableDataWrapper(source.getTableData(name), name);
tableNameComboBox.setSelectedItem(wrapper);
tableNameComboBox.getModel().setSelectedItem(wrapper);
} catch (Exception e) {
} catch (Exception ignored) {
}
}
}

162
designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -37,8 +37,7 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.Objects;
import java.util.regex.Pattern;
/**
@ -50,29 +49,83 @@ import java.util.regex.Pattern;
* @since 8.0
*/
public class SelectedDataColumnPane extends BasicPane {
/**
* 参数编辑器面板
*/
private UITableEditorPane<ParameterProvider> editorPane;
/**
* 参数
*/
private Parameter[] ps;
/**
* 数据集下拉框
*/
TableDataComboBox tableNameComboBox;
/**
* 动态参数注入按钮
*/
private UIButton paramButton;
/**
* 数据列下拉框
*/
LazyComboBox columnNameComboBox;
/**
* 数据集下拉框和数据列下拉框监听器
*/
private ItemListener itemListener;
private UIButton paramButton;
/**
* 当前编辑的模板面板用于触发保存操作
*/
private ElementCasePane casePane;
private CellElement cellElement; // 保存当前选中的 CE
/**
* 保存当前选中的 CE
*/
private CellElement cellElement;
public SelectedDataColumnPane() {
this(true, false, null);
private static final Pattern COLUMN_NAME_PATTERN = Pattern.compile("[^\\d]");
/**
* 数据集下拉框变动后修改数据列下拉框加载状态的监听器
*/
private ItemListener isNeedReloadListener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
columnNameComboBox.setLoaded(false);
}
}
};
/**
* 创建横向布局附带显示动态参数注入按钮的数据集数据列选择面板
*/
SelectedDataColumnPane() {
this(true, false);
}
public SelectedDataColumnPane(boolean showParameterButton) {
this(showParameterButton, false, null);
/**
* 创建横向布局的数据集数据列选择面板
*
* @param showParameterButton 是否显示动态参数注入按钮
*/
SelectedDataColumnPane(boolean showParameterButton) {
this(showParameterButton, false);
}
public SelectedDataColumnPane(boolean showParameterButton, boolean verticalLayout, TemplateCellElement cellElement) {
/**
* 创建数据集数据列选择面板
*
* @param showParameterButton 是否显示动态参数注入按钮
* @param verticalLayout 是否是垂直布局
*/
public SelectedDataColumnPane(boolean showParameterButton, boolean verticalLayout) {
if (verticalLayout) {
initComponentVerticalLayout(cellElement);
initComponentVerticalLayout();
} else {
initComponent(showParameterButton);
}
@ -86,7 +139,7 @@ public class SelectedDataColumnPane extends BasicPane {
public void initComponent(boolean showParameterButton) {
initTableNameComboBox();
if (showParameterButton) {
initWithParameterButton();
initParameterButton();
}
columnNameComboBox = new LazyComboBox() {
@ -126,9 +179,9 @@ public class SelectedDataColumnPane extends BasicPane {
/**
* 初始化竖直布局的组件
*/
private void initComponentVerticalLayout(TemplateCellElement cellElement) {
private void initComponentVerticalLayout() {
initTableNameComboBox();
initWithParameterButton(cellElement);
initVerticalParameterButton();
columnNameComboBox = new LazyComboBox() {
@Override
public Object[] load() {
@ -156,6 +209,13 @@ public class SelectedDataColumnPane extends BasicPane {
}
/**
* 更新面板数据
*
* @param source 数据源
* @param cellElement 单元格
* @param casePane 当前编辑的模板面板
*/
public void populate(TableDataSource source, TemplateCellElement cellElement, ElementCasePane casePane) {
tableNameComboBox.refresh(source);
this.casePane = casePane;
@ -163,9 +223,8 @@ public class SelectedDataColumnPane extends BasicPane {
return;
}
this.cellElement = cellElement;
if (itemListener != null) {
removeListener(itemListener);
}
removeListener();
Object value = cellElement.getValue();
if (!(value instanceof DSColumn)) {
return;
@ -176,9 +235,14 @@ public class SelectedDataColumnPane extends BasicPane {
columnNameComboBox.setSelectedItem(TableDataColumn.getColumnName(dsColumn.getColumn()));
ps = dsColumn.getParameters();
addListener(itemListener);
addListener();
}
/**
* 保存数据到单元格对象中
*
* @param cellElement 单元格
*/
public void update(CellElement cellElement) {
if (cellElement == null) {
return;
@ -187,7 +251,7 @@ public class SelectedDataColumnPane extends BasicPane {
if (this.tableNameComboBox.getSelectedItem() == null && this.columnNameComboBox.getSelectedItem() == null) {
return;
}
DSColumn dsColumn = null;
DSColumn dsColumn;
if (value == null || !(value instanceof DSColumn)) {
dsColumn = new DSColumn();
cellElement.setValue(dsColumn);
@ -195,7 +259,7 @@ public class SelectedDataColumnPane extends BasicPane {
dsColumn = (DSColumn) cellElement.getValue();
SimpleDSColumn simpleDSColumn = updateColumnPane();
dsColumn.setDSName(simpleDSColumn.getDsName());
dsColumn.setDSName(Objects.requireNonNull(simpleDSColumn).getDsName());
dsColumn.setColumn(simpleDSColumn.getColumn());
dsColumn.setParameters((ps != null && ps.length > 0) ? ps : null);
@ -205,6 +269,7 @@ public class SelectedDataColumnPane extends BasicPane {
* 释放模板对象
*/
public void release() {
this.cellElement = null;
this.casePane = null;
this.tableNameComboBox.setModel(new DefaultComboBoxModel());
}
@ -214,7 +279,7 @@ public class SelectedDataColumnPane extends BasicPane {
*
* @return 更新后的值
*/
public SimpleDSColumn updateColumnPane() {
private SimpleDSColumn updateColumnPane() {
SimpleDSColumn dsColumn = new SimpleDSColumn();
TableDataWrapper tableDataWrappe = this.tableNameComboBox.getSelectedItem();
if (tableDataWrappe == null) {
@ -224,9 +289,8 @@ public class SelectedDataColumnPane extends BasicPane {
TableDataColumn column;
String columnExp = (String) this.columnNameComboBox.getSelectedItem();
if (isColumnName(columnExp)) {
String number = columnExp.substring(1);
Pattern pattern = Pattern.compile("[^\\d]");
if (pattern.matcher(number).find()) {
String number = Objects.requireNonNull(columnExp).substring(1);
if (COLUMN_NAME_PATTERN.matcher(number).find()) {
column = TableDataColumn.createColumn(columnExp);
} else {
int serialNumber = Integer.parseInt(columnExp.substring(1));
@ -239,46 +303,31 @@ public class SelectedDataColumnPane extends BasicPane {
return dsColumn;
}
public void setListener(ItemListener i) {
this.itemListener = i;
}
/**
* 添加监听事件
*
* @param i 监听事件
*/
public void addListener(ItemListener i) {
itemListener = i;
tableNameComboBox.addItemListener(i);
columnNameComboBox.addItemListener(i);
private void addListener() {
tableNameComboBox.addItemListener(this.itemListener);
columnNameComboBox.addItemListener(this.itemListener);
tableNameComboBox.addItemListener(this.isNeedReloadListener);
}
/**
* 移除监听事件
*
* @param i 监听事件
*/
public void removeListener(ItemListener i) {
tableNameComboBox.removeItemListener(i);
columnNameComboBox.removeItemListener(i);
private void removeListener() {
tableNameComboBox.removeItemListener(this.itemListener);
columnNameComboBox.removeItemListener(this.itemListener);
tableNameComboBox.removeItemListener(this.isNeedReloadListener);
}
protected void initTableNameComboBox() {
tableNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource());
final ExecutorService executorService = Executors.newSingleThreadExecutor();
tableNameComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
executorService.execute(new Runnable() {
@Override
public void run() {
synchronized (columnNameComboBox) {
columnNameComboBox.loadInstant();
}
}
});
}
}
});
tableNameComboBox.setPreferredSize(new Dimension(100, 20));
}
@ -288,8 +337,8 @@ public class SelectedDataColumnPane extends BasicPane {
}
private void initWithParameterButton() {
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel());
private void initParameterButton() {
editorPane = new UITableEditorPane<>(new ParameterTableModel());
paramButton = new UIButton(Inter.getLocText("TableData_Dynamic_Parameter_Setting"));
paramButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -307,10 +356,11 @@ public class SelectedDataColumnPane extends BasicPane {
});
}
private void initWithParameterButton(final TemplateCellElement cellElement) {
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel());
private void initVerticalParameterButton() {
editorPane = new UITableEditorPane<>(new ParameterTableModel());
paramButton = new UIButton(Inter.getLocText("FR-Designer-Basic_Dynamic_Parameter_Injection"));
paramButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
BasicDialog paramDialog = editorPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
@ -337,6 +387,6 @@ public class SelectedDataColumnPane extends BasicPane {
if (this.tableNameComboBox.getSelectedItem() != null) {
return this.tableNameComboBox.getSelectedItem().calculateColumnNameList();
}
return new ArrayList<String>();
return new ArrayList<>();
}
}

10
designer/src/com/fr/design/mainframe/ElementCasePane.java

@ -4,12 +4,12 @@
package com.fr.design.mainframe;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.FRContext;
import com.fr.base.Formula;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -755,7 +755,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
* @return 返回是否清除内容.
*/
public boolean clearContents() {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return false;
}
boolean b = this.selection.clear(Clear.CONTENTS, this);
@ -1042,7 +1042,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
*/
public UIPopupMenu createRowPopupMenu(MouseEvent evt, int selectedRows) {
UIPopupMenu popupMenu = new UIPopupMenu();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
popupMenu.add(new CleanAuthorityAction(this).createMenuItem());
return popupMenu;
}
@ -1135,7 +1135,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
public UIPopupMenu createColumnPopupMenu(MouseEvent evt, int selectedColumn) {
UIPopupMenu popupMenu = new UIPopupMenu();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
popupMenu.add(new CleanAuthorityAction(this).createMenuItem());
return popupMenu;
}
@ -1236,7 +1236,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
public ShortCut[] shortCuts4Authority() {
return new ShortCut[]{
new NameSeparator(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})),
BaseUtils.isAuthorityEditing() ? new ExitAuthorityEditAction(this) : new AllowAuthorityEditAction(this),
DesignerMode.isAuthorityEditing() ? new ExitAuthorityEditAction(this) : new AllowAuthorityEditAction(this),
};
}

44
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -1,38 +1,42 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.*;
import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction;
import com.fr.design.actions.cell.CellWidgetAttrAction;
import com.fr.design.actions.cell.ConditionAttributesAction;
import com.fr.design.actions.cell.GlobalStyleMenuDef;
import com.fr.design.actions.columnrow.InsertColumnAction;
import com.fr.design.actions.columnrow.InsertRowAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.actions.edit.merge.MergeCellAction;
import com.fr.design.actions.edit.merge.UnmergeCellAction;
import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.report.worksheet.WorkSheet;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.page.ReportSettingsProvider;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/**
* 类说明: 设计面板中最上方的"插入" "单元格"下拉列表Menu模块.
@ -47,7 +51,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
this.addSelectionChangeListener(new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {
if (!isEditable() && !BaseUtils.isAuthorityEditing()) {
if (!isEditable() && !DesignerMode.isAuthorityEditing()) {
return;
}
refreshPropertyPanes();
@ -67,7 +71,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
private void refreshPropertyPanes() {
//在编辑权限,所以要更新权限编辑面板
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
@ -79,11 +83,11 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
// 模板初始化完成后,才能初始化超级链接面板
if (editingTemplate != null && !editingTemplate.isUpMode()) {
Selection editingSelection = getSelection();
// 模板初始化完成后,才能初始化超级链接面板
// 获取超级链接面板并刷新显示
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
if (editingSelection instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
JPanel floatPane = new JPanel(new BorderLayout());
@ -120,7 +124,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
* @return 返回MenuDef数组.
*/
public MenuDef[] menus4Target() {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return super.menus4Target();
}
return (MenuDef[]) ArrayUtils.addAll(super.menus4Target(), new MenuDef[]{createInsertMenuDef(), createCellMenuDef()});

17
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -264,7 +264,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
if (this.getEditingElementCasePane() == null) {
return JWorkBook.this;
}
this.getEditingElementCasePane().getGrid().setEditable(!BaseUtils.isAuthorityEditing());
this.getEditingElementCasePane().getGrid().setEditable(!DesignerMode.isAuthorityEditing());
centerPane.needToShowCoverAndHidPane();
if (centerPane.isUpEditMode()) {
return parameterPane;
@ -294,7 +294,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
}
public JPanel getEastUpPane() {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return allowAuthorityUpPane();
} else {
return exitEastUpPane();
@ -589,7 +589,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
*/
public ShortCut[] shortcut4FileMenu() {
boolean showWorkBookExportMenu = DesignerMode.isVcsMode()
|| BaseUtils.isAuthorityEditing()
|| DesignerMode.isAuthorityEditing()
|| (FRContext.getCurrentEnv() instanceof RemoteEnv);
return (ShortCut[]) ArrayUtils.addAll(super.shortcut4FileMenu(),
showWorkBookExportMenu ? new ShortCut[0] : new ShortCut[]{this.createWorkBookExportMenu()}
@ -634,7 +634,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
public ShortCut[] shortCuts4Authority() {
return new ShortCut[]{
new NameSeparator(Inter.getLocText("FR-Designer_Permissions_Edition")),
BaseUtils.isAuthorityEditing() ? new ExitAuthorityEditAction(this) : new AllowAuthorityEditAction(this),
DesignerMode.isAuthorityEditing() ? new ExitAuthorityEditAction(this) : new AllowAuthorityEditAction(this),
};
}
@ -676,7 +676,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
protected void applyUndoState(WorkBookUndoState u) {
try {
this.setTarget((WorkBook) u.getWorkBook().clone());
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
if (u.getAuthorityType() != BaseUndoState.NORMAL_STATE) {
applyAll(u);
this.undoState = u;
@ -929,7 +929,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
}
}
}
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(allowAuthorityUpPane());
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
@ -967,6 +967,11 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
return ps;
}
@Override
public Parameter[] getJTemplateParameters() {
return this.parameterPane.getAllParameters();
}
/**
* 请求单元格区域的焦点
*/

4
designer/src/com/fr/design/mainframe/ReportComponent.java

@ -5,7 +5,7 @@ package com.fr.design.mainframe;
import javax.swing.JScrollBar;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.AllowAuthorityEditAction;
import com.fr.design.actions.ExitAuthorityEditAction;
import com.fr.design.actions.report.ReportBackgroundAction;
@ -68,7 +68,7 @@ public abstract class ReportComponent<T extends TemplateReport, E extends Elemen
public ShortCut[] shortCuts4Authority() {
return new ShortCut[]{
new NameSeparator(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})),
BaseUtils.isAuthorityEditing() ? new ExitAuthorityEditAction(this) : new AllowAuthorityEditAction(this),
DesignerMode.isAuthorityEditing() ? new ExitAuthorityEditAction(this) : new AllowAuthorityEditAction(this),
};
}

4
designer/src/com/fr/design/mainframe/ReportComponentCardPane.java

@ -4,7 +4,7 @@ import java.awt.CardLayout;
import javax.swing.JComponent;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
@ -125,7 +125,7 @@ public class ReportComponentCardPane extends JComponent implements TargetModifie
} else if (tpl instanceof PolyWorkSheet) {
showPoly((PolyWorkSheet) tpl);
}
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
editingTemplate.setSheetCovered(tpl.getWorkSheetPrivilegeControl().checkInvisible(selectedRoles));

5
designer/src/com/fr/design/mainframe/ReportHyperlinkGroupPaneNoPop.java

@ -24,4 +24,9 @@ public class ReportHyperlinkGroupPaneNoPop extends ReportHyperlinkGroupPane{
protected boolean isNewStyle() {
return false;
}
@Override
public boolean needAutoSave() {
return false;
}
}

3
designer/src/com/fr/design/mainframe/SheetNameTabPane.java

@ -21,6 +21,7 @@ import javax.swing.UIManager;
import com.fr.base.BaseUtils;
import com.fr.base.GraphHelper;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
@ -318,7 +319,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
*/
public void paintComponent(Graphics g) {
super.paintComponent(g);
isAuthorityEditing = BaseUtils.isAuthorityEditing();
isAuthorityEditing = DesignerMode.isAuthorityEditing();
showCount = 0;
// 开始画那些Tab.
Graphics2D g2d = (Graphics2D) g;

9
designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -12,8 +12,8 @@ import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.actions.AllowAuthorityEditAction;
import com.fr.design.actions.ExitAuthorityEditAction;
@ -30,6 +30,7 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.form.FormElementCaseProvider;
import com.fr.form.main.Form;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
@ -50,11 +51,11 @@ public class FormElementCaseDesigner<T extends FormElementCaseProvider, E extend
return elementCasePane;
}
public FormElementCaseDesigner(T sheet) {
public FormElementCaseDesigner(T sheet, Form form) {
super(sheet);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
elementCasePane = new FormElementCasePaneDelegate((FormElementCase) sheet);
elementCasePane = new FormElementCasePaneDelegate((FormElementCase) sheet, form);
elementCasePane.setSelection(getDefaultSelectElement());
this.add(elementCasePane, BorderLayout.CENTER);
elementCasePane.addTargetModifiedListener(new TargetModifiedListener() {
@ -86,7 +87,7 @@ public class FormElementCaseDesigner<T extends FormElementCaseProvider, E extend
public ShortCut[] shortCuts4Authority() {
return new ShortCut[]{
new NameSeparator(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})),
BaseUtils.isAuthorityEditing() ? new ExitAuthorityEditAction(this) : new AllowAuthorityEditAction(this),
DesignerMode.isAuthorityEditing() ? new ExitAuthorityEditAction(this) : new AllowAuthorityEditAction(this),
};
}

4
designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java

@ -20,6 +20,7 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.form.main.Form;
import com.fr.js.NameJavaScriptGroup;
import com.fr.page.ReportSettingsProvider;
import com.fr.report.elementcase.TemplateElementCase;
@ -31,8 +32,9 @@ import com.fr.design.selection.SelectionListener;
*/
public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase>{
public FormElementCasePaneDelegate(FormElementCase sheet) {
public FormElementCasePaneDelegate(FormElementCase sheet, Form form) {
super(sheet);
this.getGrid().setShowPaginateLine(form.getFormMobileAttr().isMobileOnly());
this.addSelectionChangeListener(new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {

5
designer/src/com/fr/design/parameter/ParameterDefinitePane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.base.parameter.ParameterUI;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.actions.AllowAuthorityEditAction;
import com.fr.design.actions.ExitAuthorityEditAction;
@ -458,7 +459,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
* @return 文件菜单的子菜单
*/
public ShortCut[] shortcut4FileMenu() {
return (ShortCut[]) ArrayUtils.addAll(BaseUtils.isAuthorityEditing() ?
return (ShortCut[]) ArrayUtils.addAll(DesignerMode.isAuthorityEditing() ?
new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()),
new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()),
new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())} :
@ -477,7 +478,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
*/
public MenuDef[] menus4Target() {
MenuDef tplMenu = new MenuDef(KeySetUtils.TEMPLATE.getMenuKeySetName(),KeySetUtils.TEMPLATE.getMnemonic());
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
tplMenu.addShortCut(new NameSeparator(Inter.getLocText("FR-Utils_WorkBook")));
tplMenu.addShortCut(new ReportParameterAction(workBook));
tplMenu.addShortCut(new NameSeparator(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})));

110
designer/src/com/fr/design/report/PageSetupPane.java

@ -73,14 +73,6 @@ public class PageSetupPane extends BasicPane {
private OtherPane otherPane;
private UILabel zeroMarginWarn;
public final static PaperSize MOBILE_SMAIL_SIZE = new PaperSize(new MM(142.8f), new MM(254));
public final static PaperSize MOBILE_LARGE_SIZE = new PaperSize(new MM(190.5f), new MM(338.7f));
public static final Object[][] MOBILE_NAME_SIZE_ARRAY = {
{Inter.getLocText("FR-Designer_PaperSize-Mobile-Large"),MOBILE_LARGE_SIZE},
{Inter.getLocText("FR-Designer_PaperSize-Mobile-Small"),MOBILE_SMAIL_SIZE}
};
public PageSetupPane() {
this.initComponents();
}
@ -135,11 +127,9 @@ public class PageSetupPane extends BasicPane {
private UIRadioButton landscapeRadioButton;
private UIRadioButton predefinedRadioButton;
private UIRadioButton mobileRadioButton;
private UIRadioButton customRadioButton;
private UIComboBox predefinedComboBox;
private UIComboBox mobileComboBox;
private UIBasicSpinner paperWidthSpinner;
private UIBasicSpinner paperHeightSpinner;
@ -211,18 +201,12 @@ public class PageSetupPane extends BasicPane {
predefinedRadioButton.setMnemonic('P');
predefinedRadioButton.addActionListener(previewListener);
mobileRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_MobilePhone") + " :");
mobileRadioButton.setMnemonic('M');
mobileRadioButton.addActionListener(previewListener);
customRadioButton = new UIRadioButton(Inter.getLocText("Custom") + ":");
customRadioButton.setMnemonic('C');
customRadioButton.addActionListener(previewListener);
predefinedComboBox = new UIComboBox();
mobileComboBox = new UIComboBox();
paperWidthSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0));
((JSpinner.DefaultEditor) paperWidthSpinner.getEditor()).getTextField().setColumns(7);
@ -240,8 +224,6 @@ public class PageSetupPane extends BasicPane {
predefinedComboBox.setRenderer(paperSizeCellRenderere);
predefinedComboBox.addItemListener(paperSizeItemListener);
mobileComboBox.setRenderer(paperSizeMobileCellRenderere);
mobileComboBox.addItemListener(paperSizeItemMobileListener);
((JSpinner.DefaultEditor) paperWidthSpinner.getEditor()).getTextField().getDocument().addDocumentListener(customTextListener);
((JSpinner.DefaultEditor) paperHeightSpinner.getEditor()).getTextField().getDocument().addDocumentListener(customTextListener);
@ -254,12 +236,6 @@ public class PageSetupPane extends BasicPane {
predefinedComboBox.addItem(tmpPaperSizeNameArray[1]);
}
for(int i=0; i<MOBILE_NAME_SIZE_ARRAY.length;i++){
Object[] tmpPaperSizeNameArray = MOBILE_NAME_SIZE_ARRAY[i];
mobileComboBox.addItem(tmpPaperSizeNameArray[1]);
}
// tow radio buttons.
JPanel radioButtonPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
innerpaperSizePane.add(radioButtonPane);
@ -267,16 +243,8 @@ public class PageSetupPane extends BasicPane {
radioButtonPane.add(predefinedRadioButton);
radioButtonPane.add(predefinedComboBox);
// tow radio buttons.
JPanel mobileButtonPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
innerpaperSizePane.add(mobileButtonPane);
mobileButtonPane.add(mobileRadioButton);
mobileButtonPane.add(mobileComboBox);
ButtonGroup paperSizeRadioButtonGroup = new ButtonGroup();
paperSizeRadioButtonGroup.add(predefinedRadioButton);
paperSizeRadioButtonGroup.add(mobileRadioButton);
paperSizeRadioButtonGroup.add(customRadioButton);
// size and textfields.
@ -457,17 +425,27 @@ public class PageSetupPane extends BasicPane {
break;
}
}
for(int i=0; i<MOBILE_NAME_SIZE_ARRAY.length; i++){
Object[] mobileNameSizeArray = MOBILE_NAME_SIZE_ARRAY[i];
if(ComparatorUtils.equals(paperSize, mobileNameSizeArray[1])){
this.mobileComboBox.setSelectedIndex(i);
this.mobileRadioButton.setSelected(true);
isCustomed = false;
break;
}
}
setAndPopulate(isCustomed, unitType);
populateMargin();
checkMobileSetting(report);
}
private void checkMobileSetting(Report report) {
if (report.getBook().getReportMobileAttr().isMobileCanvasSize()) {
// 当勾选移动端画布大小后,自定义选项不可修改;限制宽度范围
predefinedRadioButton.setEnabled(false);
predefinedComboBox.setEnabled(false);
double maxWidth;
if (unitType == Constants.UNIT_MM) { // 毫米
maxWidth = PaperSize.PAPERSIZE_MOBILE.getWidth().toMMValue4Scale2();
} else { // 英寸
maxWidth = PaperSize.PAPERSIZE_MOBILE.getWidth().toINCHValue4Scale3();
}
maxWidth = Math.round(maxWidth * 100) / 100.0; // 保留两位小数
((SpinnerNumberModel)paperWidthSpinner.getModel()).setMaximum(maxWidth);
}
}
private void unitSet(int unitType) {
@ -539,13 +517,6 @@ public class PageSetupPane extends BasicPane {
} catch (CloneNotSupportedException cloneNotSupportedException) {
// do nothing
}
}else if(this.mobileRadioButton.isSelected()){
try {
psetting.setPaperSize((PaperSize) ((PaperSize) mobileComboBox.getSelectedItem()).clone());
} catch (CloneNotSupportedException cloneNotSupportedException) {
// do nothing
}
} else if (this.customRadioButton.isSelected()) {
if (unitType == Constants.UNIT_CM) {
psetting.setPaperSize(new PaperSize(new CM(((Number) this.paperWidthSpinner.getValue()).floatValue()), new CM(
@ -616,9 +587,6 @@ public class PageSetupPane extends BasicPane {
if (this.predefinedRadioButton.isSelected()) {
ps = (PaperSize) predefinedComboBox.getSelectedItem();
showPagePaneByType(ps,ori);
} else if(this.mobileRadioButton.isSelected()){
ps = (PaperSize) mobileComboBox.getSelectedItem();
showPagePaneByType(ps, ori);
} else if (this.customRadioButton.isSelected()) {
showPagePane.populate(((Number) this.paperWidthSpinner.getValue()).doubleValue(),
((Number) this.paperHeightSpinner.getValue()).doubleValue(), ori, unitType == Constants.UNIT_MM);
@ -692,34 +660,6 @@ public class PageSetupPane extends BasicPane {
sbuf.append(']');
}
/**
* Paper size cell renderer.
*/
private UIComboBoxRenderer paperSizeMobileCellRenderere = new UIComboBoxRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof PaperSize) {
PaperSize paperSize = (PaperSize) value;
for (int i = 0; i < MOBILE_NAME_SIZE_ARRAY.length; i++) {
Object[] tmpPaperSizeNameArray = MOBILE_NAME_SIZE_ARRAY[i];
if (ComparatorUtils.equals(paperSize, tmpPaperSizeNameArray[1])) {
StringBuffer sbuf = new StringBuffer(tmpPaperSizeNameArray[0].toString());
adjustCellRenderByType(sbuf,paperSize);
this.setText(sbuf.toString());
break;
}
}
}
return this;
}
};
/**
* Paper size item listener.
*/
@ -745,18 +685,6 @@ public class PageSetupPane extends BasicPane {
}
}
/**
* Paper size item listener.
*/
private ItemListener paperSizeItemMobileListener = new ItemListener() {
public void itemStateChanged(ItemEvent evt) {
PaperSize paperSize = (PaperSize) mobileComboBox.getSelectedItem();
adjustSpinnerValueByType(paperSize);
mobileRadioButton.setSelected(true);
previewShowPagePane();
}
};
// text listener.
DocumentListener customTextListener = new DocumentListener() {
public void insertUpdate(DocumentEvent e) {

23
designer/src/com/fr/design/report/ReportBackgroundPane.java

@ -1,16 +1,18 @@
package com.fr.design.report;
import java.awt.BorderLayout;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.design.style.background.BackgroundPane;
import com.fr.general.Inter;
import com.fr.page.ReportSettingsProvider;
import javax.swing.JPanel;
import java.awt.BorderLayout;
public class ReportBackgroundPane extends BasicPane {
private UICheckBox isPrintBackgroundCheckBox;
private UICheckBox isExportBackgroundCheckBox;
private BackgroundPane backgroundPane;
public ReportBackgroundPane() {
@ -19,9 +21,12 @@ public class ReportBackgroundPane extends BasicPane {
backgroundPane = new BackgroundPane();
this.add(backgroundPane, BorderLayout.CENTER);
isPrintBackgroundCheckBox = new UICheckBox(
Inter.getLocText("ReportGUI-Print_Background"));
this.add(isPrintBackgroundCheckBox, BorderLayout.SOUTH);
isPrintBackgroundCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Print_Background"));
isExportBackgroundCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Export_Background"));
JPanel sourth = new JPanel();
sourth.add(isExportBackgroundCheckBox);
sourth.add(isPrintBackgroundCheckBox);
this.add(sourth, BorderLayout.SOUTH);
}
@Override
@ -35,6 +40,7 @@ public class ReportBackgroundPane extends BasicPane {
public void populate(ReportSettingsProvider reportSettings) {
this.backgroundPane.populate(reportSettings.getBackground());
this.isPrintBackgroundCheckBox.setSelected(reportSettings.isPrintBackground());
this.isExportBackgroundCheckBox.setSelected(reportSettings.isExportBackground());
}
/**
@ -43,5 +49,6 @@ public class ReportBackgroundPane extends BasicPane {
public void update(ReportSettingsProvider reportSettings) {
reportSettings.setBackground(this.backgroundPane.update());
reportSettings.setPrintBackground(this.isPrintBackgroundCheckBox.isSelected());
reportSettings.setExportBackground(this.isExportBackgroundCheckBox.isSelected());
}
}

10
designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java

@ -12,9 +12,8 @@ import javax.swing.*;
*/
public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
private ReportMobileTemplateSettingsPane reportMobileTemplateSettingsPane; // 模版设置面板
private AppFitBrowserPane appFitBrowserPane;
//工具栏容器
private MobileToolBarPane mobileToolBarPane;
@ -28,6 +27,10 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
JPanel jPanel = new JPanel();
jPanel.setLayout(new BoxLayout(jPanel, BoxLayout.Y_AXIS));
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
reportMobileTemplateSettingsPane = new ReportMobileTemplateSettingsPane();
jPanel.add(reportMobileTemplateSettingsPane);
appFitBrowserPane = new AppFitBrowserPane();
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
jPanel.add(appFitBrowserPane);
@ -46,13 +49,14 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
}
appFitBrowserPane.populateBean(ob);
mobileToolBarPane.populateBean(ob);
reportMobileTemplateSettingsPane.populateBean(ob);
}
@Override
public ElementCaseMobileAttr updateBean() {
ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean();
mobileToolBarPane.updateBean(caseMobileAttr);
reportMobileTemplateSettingsPane.updateBean(caseMobileAttr);
return caseMobileAttr;
}

102
designer/src/com/fr/design/report/mobile/ReportMobileTemplateSettingsPane.java

@ -0,0 +1,102 @@
package com.fr.design.report.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*;
import java.awt.*;
/**
* Created by plough on 2018/1/8.
*/
public class ReportMobileTemplateSettingsPane extends BasicBeanPane<ElementCaseMobileAttr> {
private UICheckBox mobileCanvasSizeCheck; // 设置为手机模版画布大小
public ReportMobileTemplateSettingsPane() {
this.initComponents();
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel contentPane = new JPanel(FRGUIPaneFactory.createBorderLayout());
contentPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L2, 0, 0));
contentPane.add(getMobileCanvasSizeCheckPane(), BorderLayout.CENTER);
borderPane.add(contentPane);
this.add(borderPane);
}
private JPanel getMobileCanvasSizeCheckPane() {
JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout());
mobileCanvasSizeCheck = new UICheckBox(Inter.getLocText("FR-Designer_Set_Mobile_Canvas_Size"));
panel.add(mobileCanvasSizeCheck, BorderLayout.NORTH);
panel.add(getCanvasDescPane(), BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0));
return panel;
}
private JPanel getCanvasDescPane() {
UILabel desc1 = createDescLabel(Inter.getLocText("FR-Designer_Mobile_Screen_Match_Desc"));
UILabel desc2 = createDescLabel(Inter.getLocText("FR-Designer_Mobile_Screen_Zoom_In_Desc"));
UILabel desc3 = createDescLabel(Inter.getLocText("FR-Designer_Mobile_Screen_Zoom_Out_Desc"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{desc1, null},
new Component[]{desc2, null},
new Component[]{desc3, null}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L7, IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1, 0));
return panel;
}
private UILabel createDescLabel(String desc) {
UILabel label = new UILabel(desc);
label.setForeground(Color.gray);
return label;
}
@Override
public void populateBean(ElementCaseMobileAttr ob) {
if (ob == null) {
ob = new ElementCaseMobileAttr();
}
mobileCanvasSizeCheck.setSelected(ob.isMobileCanvasSize());
}
@Override
public ElementCaseMobileAttr updateBean() {
ElementCaseMobileAttr mobileAttr = new ElementCaseMobileAttr();
mobileAttr.setMobileCanvasSize(mobileCanvasSizeCheck.isSelected());
return mobileAttr;
}
@Override
public void updateBean(ElementCaseMobileAttr mobileAttr) {
if(mobileAttr != null) {
mobileAttr.setMobileCanvasSize(mobileCanvasSizeCheck.isSelected());
}
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Template_Settings");
}
}

2
designer/src/com/fr/design/webattr/ReportWebWidgetConstants.java

@ -32,7 +32,7 @@ public class ReportWebWidgetConstants {
public static WidgetOption[] getWriteToolBarInstance() {
return new WidgetOption[]{SUBMIT, VERIFY, EMAIL, EXPORT, PDF, EXCELP, EXCELO, EXCELS, WORD, PRINT, FLASHPRINT, APPLETPRINT, PDFPRINT, IMPORTEXCELDATA, SHOWCELLVALUE,
APPENDCOLUMNROW, DELETECOLUMNROW, SETPRINTEROFFSET, WRITEOFFLINEHTML, CUSTOM_BUTTON, WRITESTASH, WRITESTASHCLEAR, IMPORTEXCELDATA_CUSTOMIZED,
APPENDCOLUMNROW, DELETECOLUMNROW, SETPRINTEROFFSET, CUSTOM_BUTTON, WRITESTASH, WRITESTASHCLEAR, IMPORTEXCELDATA_CUSTOMIZED,
IMPORTEXCEL, IMPORTEXCEL_COVER, IMPORTEXCEL_CLEAN, IMPORTEXCEL_APPEND};
}

4
designer/src/com/fr/design/webattr/ToolBarButton.java

@ -1,6 +1,6 @@
package com.fr.design.webattr;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.BasicDialog;
@ -90,7 +90,7 @@ public class ToolBarButton extends UIButton implements MouseListener {
* @param e 鼠标点击事件
*/
public void mouseClicked(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
auhtorityMouseAction();
return;
}

6
designer/src/com/fr/grid/AbstractGridHeaderMouseHandler.java

@ -18,7 +18,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.FRContext;
import com.fr.base.ScreenResolution;
import com.fr.base.Utils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.ElementCasePane;
@ -417,7 +417,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
this.setToolTipText2(this.getSelectedHeaderTooltip(Math.abs(startMultiSelectIndex - endMultiSelectIndex) + 1));
} else if (dragType == GridUtils.DRAG_CELL_SIZE) {
//权限编辑状态不可以改变行列的宽度
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return;
}
if (!(isDragPermited)) {
@ -488,7 +488,7 @@ public abstract class AbstractGridHeaderMouseHandler extends MouseInputAdapter {
tmpIncreaseSize = sizeList.get(i).toPixD(resolution);
tmpSize2 = tmpIncreaseSize <= 0 ? tmpSize1 + 1 : tmpSize1 + tmpIncreaseSize;
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
break;
}

4
designer/src/com/fr/grid/GridColumnUI.java

@ -9,10 +9,10 @@ import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.cache.list.IntList;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.ElementCasePane;
@ -132,7 +132,7 @@ public class GridColumnUI extends ComponentUI {
}
private void drawAuthority(ElementCase elementCase, Graphics2D g2d, double tmpWidth1, double tmpIncreaseWidth, Dimension size, int i) {
boolean isAuthorityEdited = BaseUtils.isAuthorityEditing();
boolean isAuthorityEdited = DesignerMode.isAuthorityEditing();
if (isAuthorityEdited) {
ColumnRowPrivilegeControl cpc = elementCase.getColumnPrivilegeControl(i);
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();

14
designer/src/com/fr/grid/GridMouseAdapter.java

@ -3,13 +3,13 @@ package com.fr.grid;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JSliderPane;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
@ -157,7 +157,7 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
* 处理左击事件
*/
private void doWithLeftButtonPressed(MouseEvent evt) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
grid.setEditable(false);
}
@ -188,10 +188,10 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
// 得到点击所在的column and row
ColumnRow columnRow = GridUtils.getEventColumnRow_withresolution(reportPane, this.oldEvtX, this.oldEvtY, this.resolution);
TemplateCellElement cellElement = report.getTemplateCellElement(columnRow.getColumn(), columnRow.getRow());
if (clickCount >= 2 && !BaseUtils.isAuthorityEditing()) {
if (clickCount >= 2 && !DesignerMode.isAuthorityEditing()) {
grid.startEditing();
}
if (clickCount == 1 && cellElement != null && cellElement.getWidget() != null && !BaseUtils.isAuthorityEditing()) {
if (clickCount == 1 && cellElement != null && cellElement.getWidget() != null && !DesignerMode.isAuthorityEditing()) {
showWidetWindow(cellElement, report);
}
reportPane.repaint();
@ -362,12 +362,12 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
}
Selection selection = reportPane.getSelection();
if (selection instanceof FloatSelection && !BaseUtils.isAuthorityEditing()) {
if (selection instanceof FloatSelection && !DesignerMode.isAuthorityEditing()) {
doWithFloatElementDragged(evtX, evtY, (FloatSelection) selection);
grid.setDragType(GridUtils.DRAG_FLOAT);
} else if (grid.getDragType() == GridUtils.DRAG_CELLSELECTION_BOTTOMRIGHT_CORNER && !BaseUtils.isAuthorityEditing()) {
} else if (grid.getDragType() == GridUtils.DRAG_CELLSELECTION_BOTTOMRIGHT_CORNER && !DesignerMode.isAuthorityEditing()) {
doWithCellElementDragged(evtX, evtY, (CellSelection) selection);
} else if (grid.getDragType() == GridUtils.DRAG_CELLSELECTION && !BaseUtils.isAuthorityEditing()) {
} else if (grid.getDragType() == GridUtils.DRAG_CELLSELECTION && !DesignerMode.isAuthorityEditing()) {
// peter:获得调整过的Selected Column Row.
ColumnRow selectedCellPoint = GridUtils.getAdjustEventColumnRow_withresolution(reportPane, evtX, evtY, resolution);
if (selectedCellPoint.getColumn() != grid.getDragRectangle().x || selectedCellPoint.getRow() != grid.getDragRectangle().y) {

4
designer/src/com/fr/grid/GridRowUI.java

@ -8,10 +8,10 @@ import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.cache.list.IntList;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.ElementCasePane;
@ -137,7 +137,7 @@ public class GridRowUI extends ComponentUI {
}
private void drawAuthority(ElementCase elementCase, Graphics2D g2d, double tmpHeight1, double tmpIncreaseHeight, Dimension size, int i) {
boolean isAuthorityEdited = BaseUtils.isAuthorityEditing();
boolean isAuthorityEdited = DesignerMode.isAuthorityEditing();
if (isAuthorityEdited) {
ColumnRowPrivilegeControl cpc = elementCase.getRowPrivilegeControl(i);
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();

11
designer/src/com/fr/grid/GridUI.java

@ -1,7 +1,6 @@
package com.fr.grid;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
@ -10,6 +9,7 @@ import com.fr.base.PaperSize;
import com.fr.base.Utils;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.ImageBackground;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.DesignerContext;
@ -41,9 +41,7 @@ import com.fr.report.worksheet.FormElementCase;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ColumnRow;
import com.fr.stable.Constants;
import com.fr.stable.script.CalculatorUtils;
import com.fr.stable.unit.FU;
import com.fr.third.antlr.ANTLRException;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
@ -583,11 +581,6 @@ public class GridUI extends ComponentUI {
}
private void paintPaginateLines(Graphics g, Grid grid) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if(!jTemplate.isJWorkBook()){
//报表块无分页之说
return;
}
Graphics2D g2d = (Graphics2D) g;
// james 画分页线
@ -1037,7 +1030,7 @@ public class GridUI extends ComponentUI {
throw new IllegalArgumentException("The component c to paint must be a Grid!");
}
isAuthority = BaseUtils.isAuthorityEditing();
isAuthority = DesignerMode.isAuthorityEditing();
Graphics2D g2d = (Graphics2D) g;

3
designer/src/com/fr/grid/selection/CellSelection.java

@ -5,6 +5,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.NameStyle;
import com.fr.base.Utils;
import com.fr.base.vcs.DesignerMode;
import com.fr.cache.list.IntList;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction;
@ -463,7 +464,7 @@ public class CellSelection extends Selection {
*/
public UIPopupMenu createPopupMenu(ElementCasePane ePane) {
UIPopupMenu popup = new UIPopupMenu();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
popup.add(new CleanAuthorityAction(ePane).createMenuItem());
return popup;
}

4
designer/src/com/fr/grid/selection/FloatSelection.java

@ -1,7 +1,7 @@
package com.fr.grid.selection;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.cell.CleanAuthorityAction;
import com.fr.design.actions.cell.FloatStyleAction;
import com.fr.design.actions.core.ActionFactory;
@ -118,7 +118,7 @@ public class FloatSelection extends Selection {
@Override
public JPopupMenu createPopupMenu(ElementCasePane ePane) {
UIPopupMenu popup = new UIPopupMenu();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
popup.add(new CleanAuthorityAction(ePane).createMenuItem());
return popup;
}

3
designer/src/com/fr/poly/PolyComponetsBar.java

@ -5,6 +5,7 @@ import com.fr.base.FRContext;
import com.fr.base.chart.BaseChart;
import com.fr.base.chart.BaseChartGetter;
import com.fr.base.chart.BaseChartNameID;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itooltip.MultiLineToolTip;
@ -53,7 +54,7 @@ public class PolyComponetsBar extends JToolBar {
*/
public void checkEnable() {
for (SerIcon serIcon : serIcons) {
serIcon.setEnabled(!BaseUtils.isAuthorityEditing());
serIcon.setEnabled(!DesignerMode.isAuthorityEditing());
}
}

8
designer/src/com/fr/poly/PolyDesigner.java

@ -3,10 +3,10 @@
*/
package com.fr.poly;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
@ -355,7 +355,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
//聚合块不参加权限编辑
if (selectElement == null) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook()) {
//清参数面板
@ -715,7 +715,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
initPolyBlocks();
startEditing(blockName);
if (selection == null) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
} else {
@ -870,7 +870,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
jt.setComposite();
}
DesignerContext.getDesignerFrame().resetToolkitByPlus(DesignerContext.getDesignerFrame().getSelectedJTemplate());
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
} else if (isChooseBlock()) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY_CHART);

3
designer/src/com/fr/poly/actions/DeleteBlockAction.java

@ -9,6 +9,7 @@ import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.TemplateComponentActionInterface;
import com.fr.design.actions.UpdateAction;
import com.fr.general.Inter;
@ -30,7 +31,7 @@ public class DeleteBlockAction extends UpdateAction implements TemplateComponent
@Override
public void actionPerformed(ActionEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return;
}
final PolyDesigner designer = this.getEditingComponent();

7
designer/src/com/fr/poly/creator/ChartBlockEditor.java

@ -10,6 +10,7 @@ import com.fr.base.chart.BaseChart;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BaseChartGetter;
import com.fr.base.chart.BaseChartNameID;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.chart.MiddleChartComponent;
@ -27,7 +28,6 @@ import com.fr.poly.PolyDesigner.SelectionType;
import com.fr.poly.hanlder.ColumnOperationMouseHandler;
import com.fr.poly.hanlder.RowOperationMouseHandler;
import com.fr.report.poly.PolyChartBlock;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
@ -35,7 +35,6 @@ import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
/**
* @author richer
@ -211,7 +210,7 @@ public class ChartBlockEditor extends BlockEditor<MiddleChartComponent, PolyChar
@Override
public void mouseClicked(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return;
}
BaseChart chart = null;
@ -274,7 +273,7 @@ public class ChartBlockEditor extends BlockEditor<MiddleChartComponent, PolyChar
public void resetSelectionAndChooseState() {
designer.setChooseType(SelectionType.CHART_INNER);
// refreshChartComponent();// 选中之后 刷新下图表编辑层
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook()) {
//清参数面板

4
designer/src/com/fr/poly/creator/ECBlockEditor.java

@ -3,8 +3,8 @@
*/
package com.fr.poly.creator;
import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
@ -136,7 +136,7 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
*/
public void resetSelectionAndChooseState() {
designer.setChooseType(SelectionType.INNER);
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook()) {
//清参数面板

6
designer/src/com/fr/poly/creator/ECBlockPane.java

@ -3,7 +3,7 @@
*/
package com.fr.poly.creator;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
@ -55,7 +55,7 @@ public class ECBlockPane extends PolyElementCasePane {
if (!isEditable()) {
return;
}
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
if (designer.getSelection().getEditingElementCasePane() == null) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit());
@ -106,7 +106,7 @@ public class ECBlockPane extends PolyElementCasePane {
* @return 返回MenuDef数组.
*/
public MenuDef[] menus4Target() {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return super.menus4Target();
}
return (MenuDef[]) ArrayUtils.addAll(super.menus4Target(), new MenuDef[]{createInsertMenuDef(), createCellMenuDef()});

8
designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java

@ -9,8 +9,8 @@ import java.awt.event.MouseEvent;
import javax.swing.event.MouseInputAdapter;
import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.beans.location.Absorptionline;
import com.fr.design.beans.location.MoveUtils;
import com.fr.design.beans.location.MoveUtils.RectangleDesigner;
@ -49,7 +49,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter {
*
*/
public void mousePressed(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
designer.noAuthorityEdit();
}
pressed = e.getPoint();
@ -66,7 +66,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter {
*
*/
public void mouseReleased(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
designer.noAuthorityEdit();
}
editor.setDragging(false);
@ -92,7 +92,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter {
*
*/
public void mouseDragged(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
designer.noAuthorityEdit();
return;
}

6
designer/src/com/fr/poly/hanlder/ColumnOperationMouseHandler.java

@ -6,8 +6,8 @@ package com.fr.poly.hanlder;
import java.awt.Point;
import java.awt.event.MouseEvent;
import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.general.ComparatorUtils;
import com.fr.poly.PolyDesigner;
import com.fr.poly.PolyDesigner.SelectionType;
@ -57,7 +57,7 @@ public abstract class ColumnOperationMouseHandler<T extends BlockEditor> extends
*
*/
public void mousePressed(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
designer.noAuthorityEdit();
}
startPoint = e.getPoint();
@ -74,7 +74,7 @@ public abstract class ColumnOperationMouseHandler<T extends BlockEditor> extends
*
*/
public void mouseDragged(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return;
}
TemplateBlock block = editor.getValue();

4
designer/src/com/fr/poly/hanlder/PolyDesignerDropTarget.java

@ -15,10 +15,10 @@ import java.awt.dnd.DropTargetEvent;
import javax.swing.JScrollBar;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChart;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.mainframe.DesignerContext;
import com.fr.grid.Grid;
import com.fr.poly.PolyDesigner;
@ -55,7 +55,7 @@ public class PolyDesignerDropTarget extends DropTargetAdapter {
*/
public void dragEnter(DropTargetDragEvent dtde) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return;
}
// richer:避免在一次拖拽过程中重复查找

6
designer/src/com/fr/poly/hanlder/RowOperationMouseHandler.java

@ -6,8 +6,8 @@ package com.fr.poly.hanlder;
import java.awt.Point;
import java.awt.event.MouseEvent;
import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.general.ComparatorUtils;
import com.fr.poly.PolyDesigner;
import com.fr.poly.PolyDesigner.SelectionType;
@ -55,7 +55,7 @@ public abstract class RowOperationMouseHandler<T extends BlockEditor> extends Bl
*
*/
public void mousePressed(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
designer.noAuthorityEdit();
}
startPoint = e.getPoint();
@ -72,7 +72,7 @@ public abstract class RowOperationMouseHandler<T extends BlockEditor> extends Bl
*
*/
public void mouseDragged(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return;
}
TemplateBlock block = editor.getValue();

4
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -247,9 +247,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
};
DSColumnBasicEditorPane() {
dataPane = new SelectedDataColumnPane(true, true, cellElement);
dataPane = new SelectedDataColumnPane(true, true);
groupPane = new ResultSetGroupDockingPane();
dataPane.addListener(dataListener);
dataPane.setListener(dataListener);
groupPane.setListener(groupListener);
double[] rowSize = {P}, columnSize = {P, F};

7
designer/src/com/fr/start/Designer.java

@ -3,6 +3,7 @@ package com.fr.start;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.file.WebPreviewUtils;
@ -122,7 +123,7 @@ public class Designer extends BaseDesigner {
return menuDef;
}
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
menuDef.addShortCut(SeparatorDef.DEFAULT);
if (FRContext.getCurrentEnv().isRoot()) {
@ -294,7 +295,7 @@ public class Designer extends BaseDesigner {
if (jt == null) {
return;
}
saveButton.setEnabled(!jt.isSaved());
saveButton.setEnabled(!jt.isSaved() && !DesignerMode.isVcsMode());
MutilTempalteTabPane.getInstance().refreshOpenedTemplate(HistoryTemplateListPane.getInstance().getHistoryList());
MutilTempalteTabPane.getInstance().repaint();
if (DesignerEnvManager.getEnvManager().isSupportUndo()) {
@ -319,7 +320,7 @@ public class Designer extends BaseDesigner {
@Override
public JComponent resetToolBar(JComponent toolbarComponent, ToolBarMenuDockPlus plus) {
//如果是处于权限编辑状态
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
if (plus instanceof JWorkBook && plus.toolbars4Target() == null) {
//聚合块编辑
return super.polyToolBar(Inter.getLocText(new String[]{"Polybolck", "DashBoard-Potence", "Edit"}));

4
designer_base/src/com/fr/design/DesignState.java

@ -1,8 +1,8 @@
package com.fr.design;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.env.RemoteEnv;
@ -46,7 +46,7 @@ public class DesignState {
designState += REMOTE;
}
isRoot = env != null && env.isRoot();
isAuthority = BaseUtils.isAuthorityEditing();
isAuthority = DesignerMode.isAuthorityEditing();
}
public int getDesignState() {

2
designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java

@ -1 +1 @@
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } DesignerMode.setMode(DesignerMode.AUTHORITY); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }

5
designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java

@ -1,6 +1,7 @@
package com.fr.design.actions;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.DesignModelAdapter;
import com.fr.design.designer.TargetComponent;
@ -33,8 +34,8 @@ public class ExitAuthorityEditAction extends TemplateComponentAction {
return false;
}
if (BaseUtils.isAuthorityEditing()) {
BaseUtils.setAuthorityEditing(false);
if (DesignerMode.isAuthorityEditing()) {
DesignerMode.setMode(DesignerMode.NORMARL);
WestRegionContainerPane.getInstance().replaceDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus());

9
designer_base/src/com/fr/design/actions/UpdateAction.java

@ -293,13 +293,20 @@ public abstract class UpdateAction extends ShortCut implements Action {
button.setEnabled(this.isEnabled());
//peter:产生tooltip
button.setToolTipText(ActionFactory.createButtonToolTipText(this));
button.setToolTipText(getToolTipText());
object = button;
}
return (JComponent) object;
}
/**
* 重写此方法可以自定义 action 的提示文字
*/
protected String getToolTipText() {
return ActionFactory.createButtonToolTipText(this);
}
/**
* Equals
*/

11
designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java

@ -36,6 +36,9 @@ import java.util.logging.Level;
public class SwitchExistEnv extends MenuDef {
// 标志开始切换环境
private static boolean isSwitching = false;
public SwitchExistEnv() {
this.setMenuKeySet(KeySetUtils.SWITCH_ENV);
this.setName(getMenuKeySet().getMenuName());
@ -101,6 +104,7 @@ public class SwitchExistEnv extends MenuDef {
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
isSwitching = true;
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
Env selectedEnv = envManager.getEnv(this.getName());
try {
@ -117,13 +121,18 @@ public class SwitchExistEnv extends MenuDef {
return;
}
SignIn.signIn(selectedEnv);
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea();
fireDSChanged();
} catch (Exception em) {
FRContext.getLogger().error(em.getMessage(), em);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"}));
TemplatePane.getInstance().editItems();
} finally {
isSwitching = false;
}
}
}
public static boolean isSwitching() {
return isSwitching;
}
}

53
designer_base/src/com/fr/design/actions/help/AboutPane.java

@ -68,28 +68,36 @@ public class AboutPane extends JPanel {
Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK")
}));
if (shouldShowPhoneAndQQ()) {
if (ComparatorUtils.equals(ProductConstants.APP_NAME, FINEREPORT)) {
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE);
contentPane.add(boxCenterAlignmentPane);
}
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane);
}
addPhoneAndQQPane(contentPane);
// 官网
JPanel urlActionPane = getURLActionPane(Inter.getLocText("FR-Designer_Official_Website"), SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL));
BoxCenterAligmentPane actionLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("website." + FRContext.getLocale(), ProductConstants.WEBSITE_URL));
BoxCenterAligmentPane emailLabel = getEmailActionLabel(SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL));
// 支持邮箱
String defaultEmail = SiteCenter.getInstance().acquireUrlByKind("support.email", ProductConstants.SUPPORT_EMAIL);
JPanel emailPane = getEmailActionPane(Inter.getLocText("FR-Designer_Support_Email"),SiteCenter.getInstance().acquireUrlByKind("support.email." + FRContext.getLocale(), defaultEmail));
contentPane.add(actionLabel);
contentPane.add(emailLabel);
contentPane.add(urlActionPane);
contentPane.add(emailPane);
if (shouldShowThanks()) {
addThankPane(contentPane);
}
}
// 是否显示服务电话和 qq
private boolean shouldShowPhoneAndQQ() {
return !FRContext.getLocale().equals(Locale.US);
private void addPhoneAndQQPane(JPanel contentPane) {
BoxCenterAligmentPane boxCenterAlignmentPane;
// 英文版不显示服务电话和QQ
if (FRContext.getLocale().equals(Locale.US)) {
return;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + SiteCenter.getInstance().acquireUrlByKind("service.phone." + FRContext.getLocale(), ProductConstants.COMPARE_TELEPHONE));
contentPane.add(boxCenterAlignmentPane);
// 繁体版不显示QQ
if (FRContext.getLocale().equals(Locale.TAIWAN)) {
return;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ: " + SiteCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane);
}
// 是否显示鸣谢面板
@ -133,7 +141,7 @@ public class AboutPane extends JPanel {
StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX);
}
private BoxCenterAligmentPane getEmailActionLabel(final String mailTo) {
private JPanel getEmailActionPane(final String desc, final String mailTo){
ActionLabel emailLabel = new ActionLabel(mailTo);
emailLabel.addActionListener(new ActionListener() {
@ -147,10 +155,13 @@ public class AboutPane extends JPanel {
}
});
return new BoxCenterAligmentPane(emailLabel);
JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
panel.add(new UILabel(desc));
panel.add(emailLabel);
return panel;
}
private BoxCenterAligmentPane getURLActionLabel(final String url) {
private JPanel getURLActionPane(final String desc, final String url){
ActionLabel actionLabel = new ActionLabel(url);
actionLabel.addActionListener(new ActionListener() {
@Override
@ -163,7 +174,11 @@ public class AboutPane extends JPanel {
}
});
return new BoxCenterAligmentPane(actionLabel);
JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
panel.add(new UILabel(desc));
panel.add(actionLabel);
return panel;
}
class UserLabel extends BoldFontTextLabel {

5
designer_base/src/com/fr/design/data/datapane/ChoosePane.java

@ -466,10 +466,13 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
protected String getTableName() {
String tableName = "";
Object obj = this.tableNameComboBox.getSelectedItem();
Object obj = this.tableNameComboBox.getSelectedItemObject();
if (obj == null) {
obj = this.tableNameComboBox.getSelectedItem();
if (obj == null) {
obj = this.tableNameComboBox.getEditor().getItem();
}
}
if (obj instanceof TreePath) {
Object tp = ((ExpandMutableTreeNode) ((TreePath) obj).getLastPathComponent()).getUserObject();
if (tp instanceof TableProcedure) {

2
designer_base/src/com/fr/design/designer/IntervalConstants.java

@ -27,4 +27,6 @@ public class IntervalConstants {
public static final int INTERVAL_W3 = 49;
public static final int INTERVAL_W4 = 22;
}

3
designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java

@ -1,6 +1,8 @@
package com.fr.design.dialog.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.ChangeListener;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
@ -10,6 +12,7 @@ import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

13
designer_base/src/com/fr/design/event/DesignerOpenedListener.java

@ -0,0 +1,13 @@
package com.fr.design.event;
import java.util.EventListener;
/**
* Created by plough on 2018/1/19.
*/
public interface DesignerOpenedListener extends EventListener {
/**
* Invoked when the target of the listener has changed the rpt content.
*/
public void designerOpened();
}

2
designer_base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

@ -23,7 +23,7 @@ public class GetPluginFromStoreExecutor implements Executor {
private String scope;
public GetPluginFromStoreExecutor(JSONObject info) {
this.category = info.optString("category");
this.category = info.optString("categories");
this.fee = info.optString("fee");
this.seller = info.optString("seller");
this.scope = info.optString("scope");

10
designer_base/src/com/fr/design/file/MutilTempalteTabPane.java

@ -370,7 +370,9 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
templateStartX += realWidth;
}
if (!DesignerMode.isVcsMode()) {
paintListDown(g2d, maxWidth);
}
paintUnderLine(templateStartX, maxWidth, g2d);
}
@ -549,7 +551,9 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
g2d.drawString(sheetName, (int) templateStartX + sheeticon.getIconWidth() + 2 * GAP, getHeight() - GAP * 2);
int closePosition = (int) templateStartX + realWidth - CLOSE.getIconWidth() - SMALLGAP;
int closeY = (getHeight() - closeIcon.getIconHeight()) / 2;
if (!DesignerMode.isVcsMode()) {
closeIcon.paintIcon(this, g2d, closePosition, closeY);
}
return closePosition;
}
@ -605,7 +609,9 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
g2d.drawString(sheetName, (int) templateStartX + sheeticon.getIconWidth() + 2 * GAP, getHeight() - GAP * 2);
int closeY = (getHeight() - closeIcon.getIconHeight()) / 2;
int closePosition = (int) templateStartX + realWidth - CLOSE.getIconWidth() - SMALLGAP;
if (!DesignerMode.isVcsMode()) {
closeIcon.paintIcon(this, g2d, closePosition, closeY);
}
return closePosition;
}
@ -687,7 +693,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
openedTemplate.get(selectedIndex).stopEditing();
selectedIndex = getTemplateIndex(evtX);
//如果在权限编辑情况下,不允许切换到表单类型的工作簿
if (BaseUtils.isAuthorityEditing() && !openedTemplate.get(selectedIndex).isJWorkBook()) {
if (DesignerMode.isAuthorityEditing() && !openedTemplate.get(selectedIndex).isJWorkBook()) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate(openedTemplate.get(tempSelectedIndex));
JOptionPane.showMessageDialog(this, Inter.getLocText("FR-Designer_Form-AuthorityEdited_Cannot_be_Supported")
+ "!", Inter.getLocText("FR-Designer_Alert"), JOptionPane.WARNING_MESSAGE);
@ -726,7 +732,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M
}
filename = OperatingSystem.isWindows() ? filename.replaceAll("/", "\\\\") : filename.replaceAll("\\\\", "/");
if (!specifiedTemplate.isALLSaved()) {
if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) {
specifiedTemplate.stopEditing();
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Utils-Would_you_like_to_save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?",
ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);

4
designer_base/src/com/fr/design/file/NewTemplatePane.java

@ -21,7 +21,7 @@ import java.awt.geom.Rectangle2D;
public abstract class NewTemplatePane extends JComponent implements MouseListener, MouseMotionListener {
private static final Icon GRAY_NEW_CPT = BaseUtils.readIcon("/com/fr/design/images/buttonicon/additicon_grey.png");
private static final int PRE_GAP = 0;
private static final int PRE_GAP = 5;
private static final int HEIGHT = 26;
private Graphics2D g2d;
private Icon newWorkBookIconMode = null;
@ -148,7 +148,7 @@ public abstract class NewTemplatePane extends JComponent implements MouseListene
}
private boolean needGrayNewCpt() {
return BaseUtils.isAuthorityEditing() || DesignerMode.isVcsMode();
return DesignerMode.isAuthorityEditing() || DesignerMode.isVcsMode();
}

2
designer_base/src/com/fr/design/fun/SubmitProvider.java

@ -10,7 +10,7 @@ public interface SubmitProvider extends Mutable{
String MARK_STRING = "SubmitProvider";
int CURRENT_LEVEL = 1;
int CURRENT_LEVEL = 2;
/**

467
designer_base/src/com/fr/design/gui/controlpane/UISimpleListControlPane.java

@ -0,0 +1,467 @@
package com.fr.design.gui.controlpane;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.UIList;
import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import sun.swing.DefaultLookup;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.*;
import java.util.Arrays;
import java.util.Comparator;
/**
* 简单列表面板
* Created by plough on 2018/2/1.
*/
public class UISimpleListControlPane extends BasicPane {
public static final String LIST_NAME = "UISimpleControl_List";
protected UIList nameList;
protected String selectedName;
private ShortCut4JControlPane[] shorts;
private ToolBarDef toolbarDef;
private UIToolbar toolBar;
public UISimpleListControlPane() {
initComponentPane();
}
public ShortCut4JControlPane[] getShorts() {
return shorts;
}
protected void initComponentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(getContentPane(), BorderLayout.CENTER);
this.checkButtonEnabled();
}
protected JPanel getContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel listPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
initListPane(listPane);
contentPane.add(listPane, BorderLayout.CENTER);
shorts = this.createShortcuts();
if (ArrayUtils.isEmpty(shorts)) {
return contentPane;
}
toolbarDef = new ToolBarDef();
for (ShortCut4JControlPane sj : shorts) {
toolbarDef.addShortCut(sj.getShortCut());
}
toolBar = ToolBarDef.createJToolBar();
toolBar.setUI(new UIToolBarUI(){
@Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.WHITE);
g2.fillRect(0, 0, c.getWidth(), c.getHeight());
}
});
toolbarDef.updateToolBar(toolBar);
// 封装一层,加边框
JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER);
toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, UIConstants.RULER_LINE_COLOR));
listPane.add(toolBarPane, BorderLayout.NORTH);
return contentPane;
}
protected ShortCut4JControlPane[] createShortcuts() {
return new ShortCut4JControlPane[]{
moveUpItemShortCut(),
moveDownItemShortCut(),
sortItemShortCut(),
};
}
protected void initListPane(JPanel listPane) {
nameList = createJNameList();
nameList.setName(LIST_NAME);
nameList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS);
listPane.add(new UIScrollPane(nameList), BorderLayout.CENTER);
nameList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameList.addMouseListener(listMouseListener);
nameList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) {
// richie:避免多次update和populate大大降低效率
if (!evt.getValueIsAdjusting()) {
UISimpleListControlPane.this.checkButtonEnabled();
}
}
});
}
public UIList createJNameList() {
UIList nameList = new UIList(new DefaultListModel()) {
@Override
public int locationToIndex(Point location) {
int index = super.locationToIndex(location);
if (index != -1 && !getCellBounds(index, index).contains(location)) {
return -1;
}
else {
return index;
}
}
};
nameList.setCellRenderer(new NameableListCellRenderer(this));
return nameList;
}
protected ShortCut4JControlPane moveUpItemShortCut() {
return new NormalEnableShortCut(new MoveUpItemAction());
}
protected ShortCut4JControlPane moveDownItemShortCut() {
return new NormalEnableShortCut(new MoveDownItemAction());
}
protected ShortCut4JControlPane sortItemShortCut() {
return new NormalEnableShortCut(new SortItemAction());
}
public Nameable[] update() {
java.util.List<Nameable> res = new java.util.ArrayList<Nameable>();
DefaultListModel listModel = (DefaultListModel) this.nameList.getModel();
for (int i = 0, len = listModel.getSize(); i < len; i++) {
res.add(((ListModelElement) listModel.getElementAt(i)).wrapper);
}
return res.toArray(new Nameable[res.size()]);
}
public void populate(Nameable[] nameableArray) {
DefaultListModel listModel = (DefaultListModel) this.nameList.getModel();
listModel.removeAllElements();
if (ArrayUtils.isEmpty(nameableArray)) {
return;
}
listModel.setSize(nameableArray.length);
for (int i = 0; i < nameableArray.length; i++) {
listModel.set(i, new ListModelElement(nameableArray[i]));
}
if (listModel.size() > 0 || this.nameList.getSelectedIndex() != 0) {
this.nameList.setSelectedIndex(0);
}
this.checkButtonEnabled();
}
/**
* 根据name,选中UINameEdList中的item
*/
public void setSelectedName(String name) {
DefaultListModel listModel = (DefaultListModel) this.nameList.getModel();
for (int i = 0, len = listModel.getSize(); i < len; i++) {
Nameable item = ((ListModelElement) listModel.getElementAt(i)).wrapper;
if (ComparatorUtils.equals(name, item.getName())) {
this.nameList.setSelectedIndex(i);
break;
}
}
}
/**
* 获取选中的名字
*/
public String getSelectedName() {
ListModelElement el = (ListModelElement) this.nameList.getSelectedValue();
return el == null ? null : el.wrapper.getName();
}
protected DefaultListModel getModel() {
return (DefaultListModel) this.nameList.getModel();
}
@Override
protected String title4PopupWindow() {
return null;
}
/*
* 上移Item
*/
private class MoveUpItemAction extends UpdateAction {
public MoveUpItemAction() {
this.setName(Inter.getLocText("Utils-Move_Up"));
this.setMnemonic('U');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/up.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
int selectedIndex = nameList.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
// 上移
if (selectedIndex > 0) {
DefaultListModel listModel = (DefaultListModel) nameList.getModel();
Object prevObj = listModel.get(selectedIndex - 1);
Object currentObj = listModel.get(selectedIndex);
listModel.set(selectedIndex - 1, currentObj);
listModel.set(selectedIndex, prevObj);
nameList.setSelectedIndex(selectedIndex - 1);
nameList.ensureIndexIsVisible(selectedIndex - 1);
}
}
}
/*
* 下移Item
*/
private class MoveDownItemAction extends UpdateAction {
public MoveDownItemAction() {
this.setName(Inter.getLocText("Utils-Move_Down"));
this.setMnemonic('D');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/down.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
int selectedIndex = nameList.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
if (selectedIndex < nameList.getModel().getSize() - 1) {
DefaultListModel listModel = (DefaultListModel) nameList.getModel();
Object nextObj = listModel.get(selectedIndex + 1);
Object currentObj = listModel.get(selectedIndex);
listModel.set(selectedIndex + 1, currentObj);
listModel.set(selectedIndex, nextObj);
nameList.setSelectedIndex(selectedIndex + 1);
nameList.ensureIndexIsVisible(selectedIndex + 1);
}
}
}
private class SortItemAction extends UpdateAction {
private boolean isAtoZ = false;
public SortItemAction() {
this.setName(Inter.getLocText("FR-Action_Sort"));
this.setMnemonic('S');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/sortAsc.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
// p:选中的值.
Object selectedValue = nameList.getSelectedValue();
DefaultListModel listModel = (DefaultListModel) nameList.getModel();
if (listModel.getSize() <= 0) {
return;
}
Nameable[] nameableArray = new Nameable[listModel.getSize()];
for (int i = 0; i < listModel.getSize(); i++) {
nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper;
}
// p:排序.
if (isAtoZ) { // 升序
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) {
return ComparatorUtils.compare(o2.getName(), o1.getName());
}
};
isAtoZ = !isAtoZ;
Arrays.sort(nameableArray, nameableComparator);
} else { // 降序
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) {
return ComparatorUtils.compare(o1.getName(), o2
.getName());
}
};
isAtoZ = !isAtoZ;
Arrays.sort(nameableArray, nameableComparator);
}
for (int i = 0; i < nameableArray.length; i++) {
listModel.set(i, new ListModelElement(nameableArray[i]));
}
// p:需要选中以前的那个值.
if (selectedValue != null) {
nameList.setSelectedValue(selectedValue, true);
}
checkButtonEnabled();
// p:需要repaint.
nameList.repaint();
}
}
/*
* UIList的鼠标事件
*/
private MouseListener listMouseListener = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
JList list = (JList) e.getSource();
if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown()
&& !isMenuShortcutKeyDown(e)) {
list.clearSelection();
}
}
private boolean isMenuShortcutKeyDown(InputEvent event) {
return (event.getModifiers() & Toolkit.getDefaultToolkit()
.getMenuShortcutKeyMask()) != 0;
}
};
/**
* 检查按钮可用状态 Check button enabled.
*/
public void checkButtonEnabled() {
for (ShortCut4JControlPane sj : getShorts()) {
sj.checkEnable();
}
}
/**
* 设置选中项
*
* @param index 选中项的序列号
*/
public void setSelectedIndex(int index) {
nameList.setSelectedIndex(index);
}
public class NormalEnableShortCut extends ShortCut4JControlPane {
public NormalEnableShortCut(ShortCut shortCut) {
this.shortCut = shortCut;
}
/**
* 检查是否可用
*/
@Override
public void checkEnable() {
this.shortCut.setEnabled(getModel()
.getSize() > 0
&& UISimpleListControlPane.this.nameList.getSelectedIndex() != -1);
}
}
private class NameableListCellRenderer extends
JPanel implements ListCellRenderer {
private UILabel label;
private UISimpleListControlPane listControlPane;
private Color initialLabelForeground;
public NameableListCellRenderer(UISimpleListControlPane listControlPane) {
super();
this.listControlPane = listControlPane;
initComponents();
setOpaque(true);
setBorder(getNoFocusBorder());
setName("List.cellRenderer");
}
private void initComponents() {
label = new UILabel();
label.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 0));
initialLabelForeground = label.getForeground();
this.setLayout(new BorderLayout());
this.add(label, BorderLayout.CENTER);
}
private Border getNoFocusBorder() {
return BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LIST_ITEM_SPLIT_LINE);
}
private void setText(String t) {
label.setText(t);
}
@Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
setComponentOrientation(list.getComponentOrientation());
Color bg = null;
Color fg = null;
JList.DropLocation dropLocation = list.getDropLocation();
if (dropLocation != null
&& !dropLocation.isInsert()
&& dropLocation.getIndex() == index) {
bg = DefaultLookup.getColor(this, ui, "List.dropCellBackground");
fg = DefaultLookup.getColor(this, ui, "List.dropCellForeground");
isSelected = true;
}
if (isSelected) {
setBackground(bg == null ? list.getSelectionBackground() : bg);
setForeground(fg == null ? list.getSelectionForeground() : fg);
label.setForeground(Color.WHITE);
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
label.setForeground(initialLabelForeground);
}
setText((value == null) ? StringUtils.EMPTY : value.toString());
setEnabled(list.isEnabled());
setFont(list.getFont());
if (value instanceof ListModelElement) {
Nameable wrappee = ((ListModelElement) value).wrapper;
this.setText(wrappee.getName());
}
return this;
}
}
}

36
designer_base/src/com/fr/design/gui/demo/ComboBoxDemo.java

@ -1,34 +1,37 @@
package com.fr.design.gui.demo;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList;
import javax.swing.DefaultListCellRenderer;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.ListCellRenderer;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreePath;
import com.fr.base.FRContext;
import com.fr.design.gui.icombobox.filter.Filter;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.icombobox.ComboCheckBox;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.ExtendedComboBox;
import com.fr.design.gui.icombobox.FRTreeComboBox;
import com.fr.design.gui.icombobox.FilterComboBox;
import com.fr.design.gui.icombobox.LazyComboBox;
import com.fr.design.gui.icombobox.filter.Filter;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.general.Inter;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.ListCellRenderer;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreePath;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList;
/**
* Created by IntelliJ IDEA.
* User: Richer
@ -165,6 +168,7 @@ public class ComboBoxDemo extends JPanel {
// 睡5秒
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
FRContext.getLogger().error(e.getMessage(), e);
}

15
designer_base/src/com/fr/design/gui/demo/SwingComponentsDemo.java

@ -1,16 +1,15 @@
package com.fr.design.gui.demo;
import java.awt.BorderLayout;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import java.awt.BorderLayout;
/**
* Created by IntelliJ IDEA.
@ -19,8 +18,8 @@ import com.fr.design.utils.gui.GUICoreUtils;
* Time: 下午4:54
*/
public class SwingComponentsDemo extends JFrame {
public SwingComponentsDemo() {
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
private SwingComponentsDemo() {
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
init();
JPanel contentPane = (JPanel) getContentPane();
contentPane.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -40,12 +39,12 @@ public class SwingComponentsDemo extends JFrame {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JFrame f = new SwingComponentsDemo();
f.setSize(500, 500);
f.setVisible(true);
GUICoreUtils.centerWindow(f);
f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
}
});
}

11
designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java

@ -5,6 +5,7 @@ import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -132,13 +133,19 @@ public abstract class AbstractAttrNoScrollPane extends BasicPane {
/**
* 返回图标的路径
*/
public abstract String getIconPath();
public String getIconPath() {
// 默认为空,子类有需要再重写
return StringUtils.EMPTY;
}
/**
* 界面标题
* @return 标题
*/
public abstract String title4PopupWindow();
public String title4PopupWindow() {
// 默认为空,子类有需要再重写
return StringUtils.EMPTY;
}
/**
* 设置选中的ID, 用于双击展示界面.

32
designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java

@ -44,15 +44,12 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
@Override
public void on(PluginEvent event) {
refreshNameableCreator(createNameableCreators());
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(HyperlinkProvider.XML_TAG);
}
});
@ -63,6 +60,7 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
*
* @return 返回Nameable按钮数组.
*/
@Override
public NameableCreator[] createNameableCreators() {
Map<String, NameableCreator> nameCreators = new ListMap<>();
NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators();
@ -82,6 +80,7 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
*
* @return 返回标题字符串.
*/
@Override
public String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Hyperlink");
}
@ -91,11 +90,11 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
return Inter.getLocText("FR-Designer_Add_Hyperlink");
}
public void populate(NameJavaScriptGroup nameHyperlink_array) {
java.util.List<NameObject> list = new ArrayList<NameObject>();
if (nameHyperlink_array != null) {
for (int i = 0; i < nameHyperlink_array.size(); i++) {
list.add(new NameObject(nameHyperlink_array.getNameHyperlink(i).getName(), nameHyperlink_array.getNameHyperlink(i).getJavaScript()));
public void populate(NameJavaScriptGroup hyperlinkArray) {
java.util.List<NameObject> list = new ArrayList<>();
if (hyperlinkArray != null) {
for (int i = 0; i < hyperlinkArray.size(); i++) {
list.add(new NameObject(hyperlinkArray.getNameHyperlink(i).getName(), hyperlinkArray.getNameHyperlink(i).getJavaScript()));
}
}
@ -113,20 +112,29 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
*/
public NameJavaScriptGroup updateJSGroup() {
Nameable[] res = this.update();
NameJavaScript[] res_array = new NameJavaScript[res.length];
NameJavaScript[] resArray = new NameJavaScript[res.length];
for (int i = 0; i < res.length; i++) {
NameObject no = (NameObject) res[i];
res_array[i] = new NameJavaScript(no.getName(), (JavaScript) no.getObject());
resArray[i] = new NameJavaScript(no.getName(), (JavaScript) no.getObject());
}
return new NameJavaScriptGroup(res_array);
return new NameJavaScriptGroup(resArray);
}
@Override
public void saveSettings() {
if (isPopulating) {
if (isPopulating || !needAutoSave()) {
return;
}
hyperlinkGroupPaneActionProvider.saveSettings(this);
}
/**
* 是否需要自动保存到超级链接属性中
*
* @return 是否需要自动保存
*/
public boolean needAutoSave() {
return true;
}
}

14
designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java

@ -3,9 +3,23 @@ package com.fr.design.gui.frpane;
import com.fr.design.designer.TargetComponent;
/**
* @author plough
* Created by plough on 2017/7/26.
*/
public interface HyperlinkGroupPaneActionProvider {
/**
* 刷新面板展示
*
* @param hyperlinkGroupPane 超链面板
* @param elementCasePane 模板
*/
void populate(HyperlinkGroupPane hyperlinkGroupPane, TargetComponent elementCasePane);
/**
* 保存到文件
*
* @param hyperlinkGroupPane 超联面板
*/
void saveSettings(HyperlinkGroupPane hyperlinkGroupPane);
}

8
designer_base/src/com/fr/design/gui/ibutton/UISliderButtonUI.java

@ -12,7 +12,7 @@ import javax.swing.plaf.basic.BasicButtonUI;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.text.View;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.stable.Constants;
@ -174,7 +174,7 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp;
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB);
@ -187,7 +187,7 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillRollOver(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp;
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.HOVER_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.POP_DIALOG_BORDER, 1, height - 1, UIConstants.POP_DIALOG_BORDER);
@ -199,7 +199,7 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillPressed(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited) {
Color oldColor = g2d.getColor();
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
g2d.setColor(UIConstants.AUTHORITY_PRESS_BLUE);
} else {
g2d.setColor(UIConstants.POP_DIALOG_BORDER);

13
designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -57,6 +57,7 @@ public class FRTreeComboBox extends UIComboBox {
// richer:下拉展示用的tree
protected JTree tree;
private boolean onlyLeafSelectable = true;
private Object selectedObject = null;
public FRTreeComboBox() {
this(new JTree());
@ -162,6 +163,7 @@ public class FRTreeComboBox extends UIComboBox {
}
public void setSelectedItem(Object o) {
selectedObject = o;
if (o instanceof String) {
this.setSelectedItemString((String) o);
return;
@ -174,6 +176,10 @@ public class FRTreeComboBox extends UIComboBox {
}
}
public Object getSelectedItemObject() {
return selectedObject;
}
private boolean validTreePath(String treePath){
return StringUtils.isNotEmpty(treePath) && treePath.charAt(0) == '[' && treePath.endsWith("]");
}
@ -183,12 +189,7 @@ public class FRTreeComboBox extends UIComboBox {
if (validTreePath(temp)) {
temp = temp.substring(2, temp.length() - 1);
String[] selectedtable = temp.split(",");
String table = selectedtable[selectedtable.length - 1].trim();
if (table.contains(".")) {
String[] temp2 = table.split("\\.");
table = temp2[temp2.length - 1].trim();
}
return table;
return selectedtable[selectedtable.length - 1].trim();
}
return "";
}

137
designer_base/src/com/fr/design/gui/icombobox/LazyComboBox.java

@ -3,105 +3,115 @@
*/
package com.fr.design.gui.icombobox;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.DefaultComboBoxModel;
import javax.swing.SwingWorker;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import javax.swing.plaf.basic.BasicComboPopup;
import com.fr.general.Inter;
import java.awt.Dimension;
import java.util.concurrent.ExecutionException;
/**
* @author richer
* @version 2018年2月6日14点43分 by @yaoh.wu
* @since 6.5.5 创建于2011-6-15 延迟加载的下拉框
*/
public abstract class LazyComboBox extends UIComboBox implements PopupMenuListener {
protected boolean loaded = false;
private List<EventListener> ls = new ArrayList<EventListener>();
private Object initialSelected = null;
private static final int NUM = 80;
private static final String[] PENDING_CONTENT = new String[]{"", Inter.getLocText("Loading") + "..."};
public static final Object PENDING = new Object() {
/**
* 是否加载完成
*/
protected boolean loaded = false;
@Override
public String toString() {
return Inter.getLocText("Loading") + "...";
}
};
/**
* 初始化选项
*/
private Object initialSelected = null;
public LazyComboBox() {
protected LazyComboBox() {
super();
this.setEditor(new FilterComboBoxEditor());
addPopupMenuListener(this);
// updateUI();
}
public void setLoaded(boolean loaded) {
this.loaded = loaded;
}
/**
* 加载下拉框中的选项
*
* @return 下拉框中的选项
*/
public abstract Object[] load();
@Override
public void setSelectedItem(Object anObject) {
initialSelected = anObject;
if (loaded) {
super.setSelectedItem(anObject);
} else {
setModel(new DefaultComboBoxModel(new Object[] { anObject }));
this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject}));
super.setSelectedItem(anObject);
}
}
/**
* 通过调用该方法在点击下拉框按钮之前就加载好数据,不需要出现loading了
*/
public void loadInstant() {
setLoaded(true);
loadList();
}
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
if (loaded) {
return;
}
DefaultComboBoxModel loadingModel = new DefaultComboBoxModel(new String[]{"", Inter.getLocText("Loading") + "..."});
LazyComboBox.this.setModel(loadingModel);
new SwingWorker<Void, Void>() {
DefaultComboBoxModel<String> loadingModel = new DefaultComboBoxModel<>(PENDING_CONTENT);
this.setModel(loadingModel);
new SwingWorker<Object[], Void>() {
@Override
protected Void doInBackground() throws Exception {
final Object selectedObj = getSelectedItem();
loadList();
return null;
protected Object[] doInBackground() {
return load();
}
@Override
public void done() {
LazyComboBox.this.updateUI();
LazyComboBox.this.fireEvent();
try {
LazyComboBox.this.loadList(get());
} catch (InterruptedException | ExecutionException exception) {
FRLogger.getLogger().debug(exception.getMessage());
}
LazyComboBox.this.showPopup();
}
}.execute();
}
/**
* 加载下拉列表
*/
public void loadList() {
DefaultComboBoxModel<Object> model = new DefaultComboBoxModel<>(load());
model.setSelectedItem(initialSelected);
this.setModel(model);
this.selectedItemReminder = initialSelected;
loaded = true;
}
/**
* 计算加载下拉列表
* 加载下拉列表
*
* @param contents 下拉列表内容
*/
public void loadList() {
DefaultComboBoxModel model = new DefaultComboBoxModel(load());
private void loadList(Object[] contents) {
DefaultComboBoxModel<Object> model = new DefaultComboBoxModel<>(contents);
model.setSelectedItem(initialSelected);
LazyComboBox.this.setModel(model);
LazyComboBox.this.selectedItemReminder = initialSelected ;
this.setModel(model);
this.selectedItemReminder = initialSelected;
loaded = true;
}
@ -115,19 +125,6 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
}
public void addClickListener(EventListener l) {
if (ls == null) {
ls = new ArrayList<LazyComboBox.EventListener>();
}
ls.add(l);
}
public void fireEvent() {
for (int i = 0, n = ls.size(); i < n; i++) {
ls.get(i).fireEvent();
}
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
@ -135,26 +132,6 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
return dim;
}
private static class LazyPopMenu extends BasicComboPopup {
public LazyPopMenu(final JComboBox combo) {
super(combo);
LazyComboBox comboc = (LazyComboBox) combo;
comboc.addClickListener(new EventListener() {
@Override
public void fireEvent() {
LazyPopMenu.this.show();
combo.showPopup();
}
});
}
}
private interface EventListener {
void fireEvent();
}
class FilterComboBoxEditor extends UIComboBoxEditor implements DocumentListener {
private Object item;
private volatile boolean filtering = false;
@ -165,12 +142,12 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
textField.getDocument().addDocumentListener(this);
}
@Override
public void setItem(Object item) {
if (filtering) {
return;
}
this.item = item;
this.setting = true;
textField.setSetting(true);
String newText = (item == null) ? "" : item.toString();
@ -179,23 +156,27 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
this.setting = false;
}
@Override
public Object getItem() {
return this.item;
}
@Override
public void insertUpdate(DocumentEvent e) {
handleChange();
}
@Override
public void removeUpdate(DocumentEvent e) {
handleChange();
}
@Override
public void changedUpdate(DocumentEvent e) {
handleChange();
}
protected void handleChange() {
void handleChange() {
if (setting) {
return;
}

44
designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java

@ -4,12 +4,13 @@ import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import javax.swing.ComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.ListCellRenderer;
import javax.swing.plaf.ComboBoxUI;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
import java.awt.Dimension;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
@ -112,8 +113,6 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser
public void setRenderer(ListCellRenderer aRenderer) {
if (aRenderer instanceof UIComboBoxRenderer) {
super.setRenderer(aRenderer);
} else {
//throw new IllegalArgumentException("Must be UIComboBoxRenderer");
}
}
@ -121,13 +120,15 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser
return null;
}
@Override
public void setGlobalName(String name) {
comboBoxName = name;
}
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width + SIZE5, SIZE);//加5的原因在于:render里,每一个项前面了空了一格,要多几像素
//加5的原因在于:render里,每一个项前面了空了一格,要多几像素
return new Dimension(super.getPreferredSize().width + SIZE5, SIZE);
}
/**
@ -147,15 +148,16 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser
/**
*
*/
@Override
public void updateUI() {
setUI(getUIComboBoxUI());
}
/**
*
* @param listener 观察者监听事件
*/
@Override
public void registerChangeListener(UIObserverListener listener) {
uiObserverListener = listener;
}
@ -169,46 +171,28 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser
}
/**
* @return
* @return 是否响应变更事件
*/
@Override
public boolean shouldResponseChangeListener() {
return true;
}
/**
*
* @param listener 观察者监听事件
*/
@Override
public void registerNameListener(GlobalNameListener listener) {
globalNameListener = listener;
}
/**
*
* @return
* @return 是否响应名称事件
*/
@Override
public boolean shouldResponseNameListener() {
return true;
}
/**
* @param args
*/
public static void main(String... args) {
LayoutManager layoutManager = null;
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(layoutManager);
UIComboBox bb = new UIComboBox(new String[]{"", "jerry", "kunsnat", "richer"});
bb.setEditable(true);
bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height);
content.add(bb);
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);
jf.setVisible(true);
}
}

5
designer_base/src/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -1,11 +1,10 @@
package com.fr.design.gui.icontainer;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
@ -281,7 +280,7 @@ public class UIEastResizableContainer extends JPanel {
}
onResize();
refreshContainer();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
DesignerContext.getDesignerFrame().doResize();
}
}

10
designer_base/src/com/fr/design/gui/icontainer/UIModeControlContainer.java

@ -1,6 +1,6 @@
package com.fr.design.gui.icontainer;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
@ -72,7 +72,7 @@ public class UIModeControlContainer extends JLayeredPane {
public void needToShowCoverAndHidPane() {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
this.remove(coverPane);
this.remove(hidePane);
} else {
@ -115,7 +115,7 @@ public class UIModeControlContainer extends JLayeredPane {
if (isHideMode || !upEditMode) {
return;
}
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return;
}
setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
@ -142,7 +142,7 @@ public class UIModeControlContainer extends JLayeredPane {
@Override
public void mouseDragged(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
return;
}
boolean notUpEditMode = isHideMode || !upEditMode;
@ -183,7 +183,7 @@ public class UIModeControlContainer extends JLayeredPane {
setUpPaneHeight(0);
}
if (BaseUtils.isAuthorityEditing() && isSheeetCovered) {
if (DesignerMode.isAuthorityEditing() && isSheeetCovered) {
sheetInvisibleCoverPane.setBounds(0, toolPaneY + toolPaneHeight + UIConstants.SIZE, getWidth(), getHeight() - toolPaneY - toolPaneHeight - sheetCorverGap);
UIModeControlContainer.this.add(sheetInvisibleCoverPane);
UIModeControlContainer.this.setLayer(sheetInvisibleCoverPane, 2);

7
designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -1,11 +1,10 @@
package com.fr.design.gui.icontainer;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.collections.utils.MathUtils;
import javax.swing.*;
import java.awt.*;
@ -443,7 +442,7 @@ public class UIResizableContainer extends JPanel {
containerWidth = toolPaneHeight;
}
refreshContainer();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
DesignerContext.getDesignerFrame().doResize();
}
@ -476,7 +475,7 @@ public class UIResizableContainer extends JPanel {
containerWidth = toolPaneHeight;
}
refreshContainer();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
DesignerContext.getDesignerFrame().doResize();
}
}

8
designer_base/src/com/fr/design/gui/imenu/UIHeadMenu.java

@ -268,7 +268,13 @@ public class UIHeadMenu extends UIMenu {
return (popupMenu == null) ? new Component[0] : popupMenu.getComponents();
}
/**
* 得到子元素
* @return 子元素
*/
public MenuElement[] getSubElements() {
return popupMenu == null ? new MenuElement[0] : new MenuElement[]{popupMenu};
}
}

7
designer_base/src/com/fr/design/gui/imenu/UIMenu.java

@ -284,4 +284,11 @@ public class UIMenu extends JMenu {
return (popupMenu == null) ? new Component[0] : popupMenu.getComponents();
}
/**
* 得到子元素
* @return 子元素
*/
public MenuElement[] getSubElements() {
return popupMenu == null ? new MenuElement[0] : new MenuElement[]{popupMenu};
}
}

29
designer_base/src/com/fr/design/gui/style/BorderPane.java

@ -11,6 +11,7 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.BackgroundQuickUIProvider;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
@ -20,7 +21,12 @@ import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
@ -64,6 +70,7 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
}
protected void initComponents() {
initButtonsWithIcon();
this.setLayout(new BorderLayout(0, 0));
JPanel externalPane = new JPanel(new GridLayout(0, 4));
@ -96,7 +103,7 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
borderPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Border"), 280, 24, panel);
this.add(borderPanel, BorderLayout.NORTH);
backgroundPane = new BackgroundPane();
initBackgroundPane();
backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"), 280, 24, backgroundPane);
this.add(backgroundPanel, BorderLayout.CENTER);
initAllNames();
@ -104,6 +111,26 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
innerToggleButton.addChangeListener(innerToggleButtonChangeListener);
}
private void initBackgroundPane() {
//初始化背景pane并监听插件
backgroundPane = new BackgroundPane();
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
backgroundPane = new BackgroundPane();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(BackgroundQuickUIProvider.MARK_STRING);
}
});
}
ChangeListener outerToggleButtonChangeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {

4
designer_base/src/com/fr/design/gui/style/FRFontPane.java

@ -49,7 +49,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
private JPanel isSuperOrSubPane;
private UIComboBox fontNameComboBox;
private UIComboBox fontSizeStyleComboBox;
private UIComboBox fontSizeComboBox;
protected UIComboBox fontSizeComboBox;
private UIToggleButton bold;
private UIToggleButton italic;
private UIToggleButton underline;
@ -327,7 +327,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
private JPanel createRightPane() {
protected JPanel createRightPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};

37
designer_base/src/com/fr/design/icon/IconPathConstants.java

@ -1 +1,36 @@
package com.fr.design.icon; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 6.5.6 * Date: 12-12-18 * Time: 上午9:42 * 用于保存所有图标路径的类 */ public class IconPathConstants { private IconPathConstants() { } public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png"; public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png"; public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png"; public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png"; public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png"; public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png"; public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png"; public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png"; public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png"; public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png"; public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png"; public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/tab/remove.png"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; public static final String FORBID_ICON_PATH = "/com/fr/web/images/form/forbid.png"; }
package com.fr.design.icon;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date: 12-12-18
* Time: 上午9:42
* 用于保存所有图标路径的类
*/
public class IconPathConstants {
private IconPathConstants() {
}
public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png";
public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png";
public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png";
public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png";
public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png";
public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png";
public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png";
public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png";
public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png";
public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png";
public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png";
public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png";
public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/tab/remove.png";
public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png";
public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png";
public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png";
public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png";
public static final String FORBID_ICON_PATH = "/com/fr/web/images/form/forbid.png";
public static final String EDIT_ICON_PATH = "/com/fr/design/images/control/newEdit.png";
}

BIN
designer_base/src/com/fr/design/images/buttonicon/add_press.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 321 B

BIN
designer_base/src/com/fr/design/images/buttonicon/addicon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 203 B

BIN
designer_base/src/com/fr/design/images/control/newEdit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

31
designer_base/src/com/fr/design/locale/designer.properties

@ -2160,10 +2160,29 @@ FR-Designer_Move_Down=Move down(B)
FR-Designer_Move_To_Top=Move to top(T)
FR-Designer_Move_To_Bottom=Move to bottom(K)
FR-Designer_Tab_Style_Template=Style Template
FR-Designer_Tab_Template_One=Template One
FR-Designer_Tab_Template_Two=Template Two
FR-Designer_Tab_Template_Three=Template Three
FR-Designer_Tab_Template_Four=Template Four
FR-Designer_Tab_Template_Five=Template Five
FR-Designer_Tab_Template_Six=Template Six
FR-Designer_Tab_Banner_Style=Banner Style
FR-Designer_Tab_BookMark_Style=BookMark Style
FR-Designer_Tab_Card_Style=Card Style
FR-Designer_Tab_Menu_Style=Menu Style
FR-Designer_Tab_Pentagon_Style=Pentagon Style
FR-Designer_Tab_Trapezoid_Style=Trapezoid Style
FR-Designer_Tab_Display_Position=Display Position
FR-Designer_Background_Select=Select Background
FR-Designer_Set_Mobile_Only_Template=Set as mobile only template
FR-Designer_Set_Mobile_Canvas_Size=Set as mobile canvas size
FR-Designer_Adaptive_Property_Auto_Match=Adaptive property auto match
FR-Designer_Canvas_Size_Lock_Desc=The size of the canvas is 375*560, the width is locked, the height is customizable
FR-Designer_Mobile_Screen_Match_Desc=4.7 inch screen phone: fit
FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7 inch or more mobile phones: zooming in
FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7 inch mobile phone: zooming out
FR-Designer_Adaptive_Property_Auto_Match_Desc=In order to improve the end template effect of the mobile phone, when using the reserved layout function, the component scaling logic under the adaptive layout is set as "lateral adaptive"
FR-Designer_Template_Settings=Template Settings
FR-Designer_Form_Widget_Rename_Failure=There are the same components, please set the other name
FR-Designer_Joption_News=news
FR-Designer_Zoom_In_Logic=zoom in logic
FR-Designer_Zoom_Out_Logic=zoom out logic
FR-Designer_Chart_Adaptivity=chart adaptivity
FR-Designer_Tip_Chart_Adaptivity_Unavailable=Under the reserved layout state, the chart does not support the setting of self-adaptive
FR-Designer_Official_Website=Official Website:
FR-Designer_Support_Email=Email:
FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=Under the absolute canvas block, the chart does not support the setting of self-adaptive

35
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2141,8 +2141,8 @@ FR-Designer_Float_Visible=Suspended elements are visible
FR-Designer_Widget_String=Character string
FR-Designer_Widget_Field=field
FR-Designer_Widget_Enabled=Control available
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Print_Background=Print Background
FR-Designer_Export_Background=Export Background
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places=
@ -2159,10 +2159,29 @@ FR-Designer_Move_Down=Move down(B)
FR-Designer_Move_To_Top=Move to top(T)
FR-Designer_Move_To_Bottom=Move to bottom(K)
FR-Designer_Tab_Style_Template=Style Template
FR-Designer_Tab_Template_One=Template One
FR-Designer_Tab_Template_Two=Template Two
FR-Designer_Tab_Template_Three=Template Three
FR-Designer_Tab_Template_Four=Template Four
FR-Designer_Tab_Template_Five=Template Five
FR-Designer_Tab_Template_Six=Template Six
FR-Designer_Tab_Banner_Style=Banner Style
FR-Designer_Tab_BookMark_Style=BookMark Style
FR-Designer_Tab_Card_Style=Card Style
FR-Designer_Tab_Menu_Style=Menu Style
FR-Designer_Tab_Pentagon_Style=Pentagon Style
FR-Designer_Tab_Trapezoid_Style=Trapezoid Style
FR-Designer_Tab_Display_Position=Display Position
FR-Designer_Background_Select=Select Background
FR-Designer_Set_Mobile_Only_Template=Set as mobile only template
FR-Designer_Set_Mobile_Canvas_Size=Set as mobile canvas size
FR-Designer_Adaptive_Property_Auto_Match=Adaptive property auto match
FR-Designer_Canvas_Size_Lock_Desc=The size of the canvas is 375*560, the width is locked, the height is customizable
FR-Designer_Mobile_Screen_Match_Desc=4.7 inch screen phone: fit
FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7 inch or more mobile phones: zooming in
FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7 inch mobile phone: zooming out
FR-Designer_Adaptive_Property_Auto_Match_Desc=In order to improve the end template effect of the mobile phone, when using the reserved layout function, the component scaling logic under the adaptive layout is set as "lateral adaptive"
FR-Designer_Template_Settings=Template Settings
FR-Designer_Form_Widget_Rename_Failure=There are the same components, please set the other name
FR-Designer_Joption_News=news
FR-Designer_Zoom_In_Logic=zoom in logic
FR-Designer_Zoom_Out_Logic=zoom out logic
FR-Designer_Chart_Adaptivity=chart adaptivity
FR-Designer_Tip_Chart_Adaptivity_Unavailable=Under the reserved layout state, the chart does not support the setting of self-adaptive
FR-Designer_Official_Website=Official Website:
FR-Designer_Support_Email=Email:
FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=Under the absolute canvas block, the chart does not support the setting of self-adaptive

28
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -2160,10 +2160,26 @@ FR-Designer_Preference_CachingTemplate=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30E
FR-Designer_Preference_MaxCachingTemplate=\u8BBE\u8BA1\u5668\u6700\u5927\u30AD\u30E3\u30C3\u30B7\u30E5\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u6570\uFF1A
FR-Designer_Preference_CachingTemplateTip=\u8A2D\u7F6E\u30920\u8868\u793A\u6A5F\u80FD\u8BBE\u8BA1\u5668\u9589\u9396;\u518D\u958B\u5F8C\u767A\u52B9\u3059\u308B
FR-Designer_Tab_Style_Template=
FR-Designer_Tab_Template_One=
FR-Designer_Tab_Template_Two=
FR-Designer_Tab_Template_Three=
FR-Designer_Tab_Template_Four=
FR-Designer_Tab_Template_Five=
FR-Designer_Tab_Template_Six=
FR-Designer_Tab_Banner_Style=
FR-Designer_Tab_BookMark_Style=
FR-Designer_Tab_Card_Style=
FR-Designer_Tab_Menu_Style=
FR-Designer_Tab_Pentagon_Style=
FR-Designer_Tab_Trapezoid_Style=
FR-Designer_Tab_Display_Position=
FR-Designer_Background_Select=
FR-Designer_Set_Mobile_Only_Template=
FR-Designer_Set_Mobile_Canvas_Size=
FR-Designer_Mobile_Screen_Zoom_In=
FR-Designer_Mobile_Screen_Zoom_Out=
FR-Designer_Adaptive_Property_Auto_Match_Desc=
FR-Designer_Template_Settings=
FR-Designer_Form_Widget_Rename_Failure=\u5B58\u5728\u30EA\u30CD\u30FC\u30E0\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u3001\u4ED6\u306E\u540D\u79F0\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002
FR-Designer_Joption_News=\u30CB\u30E5\u30FC\u30B9
FR-Designer_Zoom_In_Logic=
FR-Designer_Zoom_Out_Logic=
FR-Designer_Chart_Adaptivity=
FR-Designer_Tip_Chart_Adaptivity_Unavailable=
FR-Designer_Official_Website=
FR-Designer_Support_Email=
FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=

35
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2145,14 +2145,13 @@ FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=\uC81C\uACF5\uBAA8\uB450\uC120\uD0DD
FR-Designer_Decimal_Places=\uC18C\uC218\uC218\uB7C9:
FR-Base-Load_Resource_File=\uB85C\uB529\uAD6C\uC131\uD30C\uC77C
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Print_Background=\uC778\uC1C4\uBB38\uC11C\uBC30\uACBD
FR-Designer_Export_Background=\uB0B4\uBCF4\uB0B4\uAE30\uBB38\uC11C\uBC30\uACBD
FR-Designer_Env_Des_Https=
FR-Designer_Format_JavaScript=Format Code
FR-Designer_Tip_Content=
FR-Designer_Chart_Empty_Data=
FR-Designer-Vcs_tab_click=
FR-Designer_Move_Up=
FR-Designer_Move_Down=
FR-Designer_Move_To_Top=
FR-Designer_Move_To_Bottom=
@ -2160,10 +2159,28 @@ FR-Designer_Preference_CachingTemplate=\uD15C\uD50C\uB9BF \uBA54\uBAA8\uB9AC \uC
FR-Designer_Preference_MaxCachingTemplate=\uB514\uC790\uC774\uB108 \uCD5C\uB300 \uCE90\uC2DC \uD15C\uD50C\uB9BF \uAC1C\uC218:
FR-Designer_Preference_CachingTemplateTip=\uC124\uC815 \uC744 0 \uD45C\uC2DC \uB2EB\uAE30 \uC774 \uAE30\uB2A5; \uB2E4\uC2DC \uB514\uC790\uC774\uB108 \uD6C4 \uBC1C\uD6A8\uB41C\uB2E4
FR-Designer_Tab_Style_Template=
FR-Designer_Tab_Template_One=
FR-Designer_Tab_Template_Two=
FR-Designer_Tab_Template_Three=
FR-Designer_Tab_Template_Four=
FR-Designer_Tab_Template_Five=
FR-Designer_Tab_Template_Six=
FR-Designer_Tab_Banner_Style=
FR-Designer_Tab_BookMark_Style=
FR-Designer_Tab_Card_Style=
FR-Designer_Tab_Menu_Style=
FR-Designer_Tab_Pentagon_Style=
FR-Designer_Tab_Trapezoid_Style=
FR-Designer_Tab_Display_Position=
FR-Designer_Background_Select=
FR-Designer_Set_Mobile_Only_Template=
FR-Designer_Set_Mobile_Canvas_Size=
FR-Designer_Adaptive_Property_Auto_Match=
FR-Designer_Mobile_Screen_Zoom_In=
FR-Designer_Mobile_Screen_Zoom_Out=
FR-Designer_Mobile_Screen_Zoom_Out_Desc=
FR-Designer_Adaptive_Property_Auto_Match_Desc=
FR-Designer_Template_Settings=
FR-Designer_Form_Widget_Rename_Failure=\uC874\uC7AC \uB3D9\uBA85 \uAD6C\uC131 \uC694\uC18C \uC124\uC815 \uC880 \uB2E4\uB978 \uC774\uB984
FR-Designer_Joption_News=\uC18C\uC2DD
FR-Designer_Zoom_In_Logic=
FR-Designer_Zoom_Out_Logic=
FR-Designer_Chart_Adaptivity=
FR-Designer_Tip_Chart_Adaptivity_Unavailable=
FR-Designer_Official_Website=
FR-Designer_Support_Email=
FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=

35
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2142,8 +2142,8 @@ FR-Designer_Widgetname=\u63A7\u4EF6\u540D
FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20
FR-Designer-Plugin_Has_Been_Actived=
FR-Designer-Plugin_Has_Been_Disabled=
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Print_Background=\u6253\u5370\u62A5\u8868\u80CC\u666F
FR-Designer_Export_Background=\u5BFC\u51FA\u62A5\u8868\u80CC\u666F
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places=
@ -2160,10 +2160,29 @@ FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C42(B)
FR-Designer_Move_To_Top=\u7F6E\u4E8E\u9876\u5C42(T)
FR-Designer_Move_To_Bottom=\u7F6E\u4E8E\u5E95\u5C42(K)
FR-Designer_Tab_Style_Template=\u6837\u5F0F\u6A21\u677F
FR-Designer_Tab_Template_One=\u6A21\u677F\u4E00
FR-Designer_Tab_Template_Two=\u6A21\u677F\u4E8C
FR-Designer_Tab_Template_Three=\u6A21\u677F\u4E09
FR-Designer_Tab_Template_Four=\u6A21\u677F\u56DB
FR-Designer_Tab_Template_Five=\u6A21\u677F\u4E94
FR-Designer_Tab_Template_Six=\u6A21\u677F\u516D
FR-Designer_Tab_Banner_Style=\u9526\u65D7
FR-Designer_Tab_BookMark_Style=\u4E66\u7B7E\u5F0F
FR-Designer_Tab_Card_Style=\u5361\u7247\u5F0F
FR-Designer_Tab_Menu_Style=\u83DC\u5355\u5F0F
FR-Designer_Tab_Pentagon_Style=\u4E94\u8FB9\u5F62
FR-Designer_Tab_Trapezoid_Style=\u68AF\u5F62
FR-Designer_Tab_Display_Position=\u663E\u793A\u4F4D\u7F6E
FR-Designer_Background_Select=\u9009\u4E2D\u80CC\u666F
FR-Designer_Set_Mobile_Only_Template=\u8BBE\u7F6E\u4E3A\u624B\u673A\u7AEF\u4E13\u5C5E\u6A21\u7248
FR-Designer_Set_Mobile_Canvas_Size=\u8BBE\u7F6E\u4E3A\u624B\u673A\u6A21\u7248\u753B\u5E03\u5927\u5C0F
FR-Designer_Adaptive_Property_Auto_Match=\u81EA\u9002\u5E94\u5C5E\u6027\u81EA\u52A8\u5339\u914D
FR-Designer_Canvas_Size_Lock_Desc=\u753B\u5E03\u5927\u5C0F375*560\uFF0C\u5BBD\u5EA6\u9501\u5B9A\uFF0C\u9AD8\u5EA6\u53EF\u81EA\u5B9A\u4E49
FR-Designer_Mobile_Screen_Match_Desc=4.7\u5BF8\u5C4F\u5E55\u624B\u673A\uFF1A\u9002\u914D
FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7\u5BF8\u4EE5\u4E0A\u624B\u673A\uFF1A\u653E\u5927
FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7\u5BF8\u4EE5\u4E0B\u624B\u673A\uFF1A\u538B\u7F29
FR-Designer_Adaptive_Property_Auto_Match_Desc=\u4E3A\u63D0\u5347\u624B\u673A\u7AEF\u6A21\u7248\u6548\u679C\uFF0C\u5728\u4F7F\u7528\u4FDD\u7559\u5E03\u5C40\u529F\u80FD\u65F6\uFF0C\u8BBE\u7F6E\u81EA\u9002\u5E94\u5E03\u5C40\u65B9\u5F0F\u4E0B\u7684\u7EC4\u4EF6\u7F29\u653E\u903B\u8F91\u4E3A"\u6A2A\u5411\u81EA\u9002\u5E94"
FR-Designer_Template_Settings=\u6A21\u7248\u8BBE\u7F6E
FR-Designer_Form_Widget_Rename_Failure=\u5B58\u5728\u91CD\u540D\u7EC4\u4EF6\uFF0C\u8BF7\u8BBE\u7F6E\u5176\u4ED6\u540D\u79F0
FR-Designer_Joption_News=\u6D88\u606F
FR-Designer_Zoom_In_Logic=\u653E\u5927\u903B\u8F91
FR-Designer_Zoom_Out_Logic=\u7F29\u5C0F\u903B\u8F91
FR-Designer_Chart_Adaptivity=\u56FE\u8868\u81EA\u9002\u5E94
FR-Designer_Tip_Chart_Adaptivity_Unavailable=\u4FDD\u7559\u5E03\u5C40\u72B6\u6001\u4E0B\uFF0C\u56FE\u8868\u4E0D\u652F\u6301\u8BBE\u7F6E\u81EA\u9002\u5E94
FR-Designer_Official_Website=\u5B98\u65B9\u7F51\u7AD9\uFF1A
FR-Designer_Support_Email=\u652F\u6301\u90AE\u7BB1\uFF1A
FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=\u7EDD\u5BF9\u753B\u5E03\u5757\u72B6\u6001\u4E0B\uFF0C\u56FE\u8868\u4E0D\u652F\u6301\u8BBE\u7F6E\u81EA\u9002\u5E94

35
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2141,8 +2141,8 @@ FR-Designer_Float_Visible=\u61F8\u6D6E\u5143\u7D20\u53EF\u898B
FR-Designer_Widget_String=\u5B57\u4E32
FR-Designer_Widget_Field=\u6B04\u4F4D
FR-Designer_Widget_Enabled=\u63A7\u5236\u5143\u4EF6\u53EF\u7528
FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Print_Background=\u5217\u5370\u5831\u8868\u80CC\u666F
FR-Designer_Export_Background=\u532F\u51FA\u5831\u8868\u80CC\u666F
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places=
@ -2159,10 +2159,29 @@ FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C64(B)
FR-Designer_Move_To_Top=\u7F6E\u65BC\u9802\u5C64(T)
FR-Designer_Move_To_Bottom=\u7F6E\u65BC\u5E95\u5C64(K)
FR-Designer_Tab_Style_Template=\u6A23\u5F0F\u6A21\u677F
FR-Designer_Tab_Template_One=\u6A21\u677F\u4E00
FR-Designer_Tab_Template_Two=\u6A21\u677F\u4E8C
FR-Designer_Tab_Template_Three=\u6A21\u677F\u4E09
FR-Designer_Tab_Template_Four=\u6A21\u677F\u56DB
FR-Designer_Tab_Template_Five=\u6A21\u677F\u4E94
FR-Designer_Tab_Template_Six=\u6A21\u677F\u516D
FR-Designer_Tab_Banner_Style=\u9326\u65D7
FR-Designer_Tab_BookMark_Style=\u66F8\u7C64\u5F0F
FR-Designer_Tab_Card_Style=\u5361\u7247\u5F0F
FR-Designer_Tab_Menu_Style=\u83DC\u55AE\u5F0F
FR-Designer_Tab_Pentagon_Style=\u4E94\u908A\u5F62
FR-Designer_Tab_Trapezoid_Style=\u68AF\u5F62
FR-Designer_Tab_Display_Position=\u986F\u793A\u4F4D\u7F6E
FR-Designer_Background_Select=\u9078\u4E2D\u80CC\u666F
FR-Designer_Set_Mobile_Only_Template=\u8A2D\u5B9A\u70BA\u624B\u6A5F\u7AEF\u5C08\u5C6C\u6A21\u7248
FR-Designer_Set_Mobile_Canvas_Size=\u8A2D\u5B9A\u70BA\u624B\u6A5F\u6A21\u7248\u756B\u5E03\u5927\u5C0F
FR-Designer_Adaptive_Property_Auto_Match=\u81EA\u6211\u8ABF\u6574\u5185\u5BB9\u81EA\u52D5\u5339\u914D
FR-Designer_Canvas_Size_Lock_Desc=\u756B\u5E03\u5927\u5C0F375*560\uFF0C\u5BEC\u5EA6\u9396\u5B9A\uFF0C\u9AD8\u5EA6\u53EF\u81EA\u5B9A\u7FA9
FR-Designer_Mobile_Screen_Match_Desc=4.7\u5BF8\u8367\u5E55\u624B\u6A5F\uFF1A\u9069\u914D
FR-Designer_Mobile_Screen_Zoom_In_Desc=4.7\u5BF8\u4EE5\u4E0A\u624B\u6A5F\uFF1A\u653E\u5927
FR-Designer_Mobile_Screen_Zoom_Out_Desc=4.7\u5BF8\u4EE5\u4E0B\u624B\u6A5F\uFF1A\u58D3\u7E2E
FR-Designer_Adaptive_Property_Auto_Match_Desc=\u70BA\u63D0\u5347\u624B\u6A5F\u7AEF\u6A21\u7248\u6548\u679C\uFF0C\u5728\u4F7F\u7528\u4FDD\u7559\u4F48\u5C40\u529F\u80FD\u6642\uFF0C\u8A2D\u5B9A\u81EA\u6211\u8ABF\u6574\u4F48\u5C40\u7BA1\u9053\u4E0B\u7684\u7D44\u4EF6\u7E2E\u653E\u908F\u8F2F\u70BA\u201C\u6A6B\u5411\u81EA\u6211\u8ABF\u6574\u201D
FR-Designer_Template_Settings=\u6A21\u7248\u8A2D\u5B9A
FR-Designer_Form_Widget_Rename_Failure=\u5B58\u5728\u91CD\u540D\u7D44\u4EF6\uFF0C\u8ACB\u8A2D\u5B9A\u5176\u4ED6\u540D\u7A31
FR-Designer_Joption_News=\u6D88\u606F
FR-Designer_Zoom_In_Logic=\u653E\u5927\u908F\u8F2F
FR-Designer_Zoom_Out_Logic=\u7E2E\u5C0F\u908F\u8F2F
FR-Designer_Chart_Adaptivity=\u5716\u8868\u81EA\u6211\u8ABF\u6574
FR-Designer_Tip_Chart_Adaptivity_Unavailable=\u4FDD\u7559\u4F48\u5C40\u72C0\u614B\u4E0B\uFF0C\u5716\u8868\u4E0D\u652F\u6301\u8A2D\u5B9A\u81EA\u6211\u8ABF\u6574
FR-Designer_Official_Website=\u5B98\u65B9\u7DB2\u7AD9\uFF1A
FR-Designer_Support_Email=\u652F\u6301\u90F5\u7BB1\uFF1A
FR-Designer_Tip_Chart_Adaptivity_Unavailable_In_Absolute_Layout=\u7D55\u5C0D\u756B\u5E03\u584A\u72C0\u614B\u4E0B\uFF0C\u5716\u8868\u4E0D\u652F\u6301\u8A2D\u5B9A\u81EA\u6211\u8ABF\u6574

109
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -6,18 +6,26 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.file.SwitchExistEnv;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.event.DesignerOpenedListener;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.*;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.fun.TitlePlaceProcessor;
import com.fr.design.fun.impl.AbstractTemplateTreeShortCutProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuHighLight;
import com.fr.design.gui.iscrollbar.UIScrollBar;
@ -27,6 +35,7 @@ import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.MenuManager;
import com.fr.design.menu.ShortCut;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FILE;
@ -50,33 +59,32 @@ import com.fr.stable.StableUtils;
import com.fr.stable.image4j.codec.ico.ICODecoder;
import com.fr.stable.project.ProjectConstants;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLayeredPane;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import javax.swing.*;
import javax.swing.border.MatteBorder;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.*;
import java.awt.event.*;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener {
@ -89,7 +97,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private static final Integer TOP_LAYER = new Integer((200));
private static java.util.List<App<?>> appList = new java.util.ArrayList<App<?>>();
private ToolBarMenuDock ad;
private List<DesignerOpenedListener> designerOpenedListenerList = new ArrayList<>();
//顶部日志+登陆按钮
private static final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
private static ToolBarMenuDock ad;
private DesktopCardPane centerTemplateCardPane;
@ -173,8 +186,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
}
public void mouseReleased(MouseEvent e) {
if (BaseUtils.isAuthorityEditing()) {
BaseUtils.setAuthorityEditing(false);
if (DesignerMode.isAuthorityEditing()) {
DesignerMode.setMode(DesignerMode.NORMARL);
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
@ -250,7 +263,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
reCalculateFrameSize();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
doResize();
}
}
@ -281,6 +294,22 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
}
}
/**
* 注册"设计器初始化完成"的监听
*/
public void addDesignerOpenedListener(DesignerOpenedListener listener) {
designerOpenedListenerList.add(listener);
}
/**
* 触发"设计器初始化完成"事件
*/
public void fireDesignerOpened() {
for (DesignerOpenedListener listener : designerOpenedListenerList) {
listener.designerOpened();
}
}
protected DesktopCardPane getCenterTemplateCardPane() {
return centerTemplateCardPane;
}
@ -291,41 +320,39 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
protected void initMenuPane() {
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
menuPane.add(initNorthEastPane(), BorderLayout.EAST);
basePane.add(menuPane, BorderLayout.NORTH);
this.resetToolkitByPlus(null);
}
/**
* @param ad
* @return
*/
protected JPanel initNorthEastPane(final ToolBarMenuDock ad) {
protected JPanel initNorthEastPane() {
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
//优先级为-1,保证最后全面刷新一次
GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) {
@Override
public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad);
refreshNorthEastPane();
DesignUtils.refreshDesignerFrame(FRContext.getCurrentEnv());
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign);
return !SwitchExistEnv.isSwitching()
&& context.contain(PluginModule.ExtraDesign);
}
});
refreshNorthEastPane(northEastPane, ad);
refreshNorthEastPane();
return northEastPane;
}
private void refreshNorthEastPane(JPanel northEastPane, ToolBarMenuDock ad) {
public static void refreshNorthEastPane() {
northEastPane.removeAll();
northEastPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
northEastPane.add(LogMessageBar.getInstance());
@ -430,7 +457,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* 刷新
*/
public void refreshDottedLine() {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
populateAuthorityArea();
populateCloseButton();
addDottedLine();
@ -489,7 +516,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
for (int i = 0; i < fixButtons.length; i++) {
combineUp.add(fixButtons[i]);
}
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
combineUp.addSeparator(new Dimension(2, 16));
if (toolbar4Form != null) {
for (int i = 0; i < toolbar4Form.length; i++) {
@ -600,7 +627,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/
public void needToAddAuhtorityPaint() {
newWorkBookPane.setButtonGray(BaseUtils.isAuthorityEditing());
newWorkBookPane.setButtonGray(DesignerMode.isAuthorityEditing());
// 进入或退出权限编辑模式,通知插件
Set<ShortCut> extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts();
for (ShortCut shortCut : extraShortCuts) {
if (shortCut instanceof AbstractTemplateTreeShortCutProvider) {
((AbstractTemplateTreeShortCutProvider) shortCut).notifyFromAuhtorityChange(DesignerMode.isAuthorityEditing());
}
}
}
/**
@ -680,7 +716,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* @param env 环境
*/
public void refreshEnv(Env env) {
this.setTitle();
DesignerFrameFileDealerPane.getInstance().refreshDockingView();
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());

3
designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -119,7 +120,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
HistoryTemplateListPane.getInstance().setCurrentEditingTemplate(jt);
//处理自动新建的模板
MutilTempalteTabPane.getInstance().doWithtemTemplate();
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
RolesAlreadyEditedPane.getInstance().refreshDockingView();
}

3
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
@ -436,7 +437,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 无可用 tab 时,显示提示文字
if (!hasAvailableTab) {
resetPropertyIcons();
if (!hasEnabledTab && BaseUtils.isAuthorityEditing()) {
if (!hasEnabledTab && DesignerMode.isAuthorityEditing()) {
propertyCard.show(rightPane, DEFAULT_AUTHORITY_PANE);
} else {
propertyCard.show(rightPane, DEFAULT_PANE);

34
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -281,7 +281,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
* @return 是则返回true
*/
public boolean isSaved() {
return BaseUtils.isAuthorityEditing() ? this.authoritySaved : this.saved;
return DesignerMode.isAuthorityEditing() ? this.authoritySaved : this.saved;
}
/**
@ -304,7 +304,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
}
public void setSaved(boolean isSaved) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
authoritySaved = isSaved;
} else {
saved = isSaved;
@ -315,7 +315,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
* @return
*/
public UndoManager getUndoManager() {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
if (this.authorityUndoManager == null) {
this.authorityUndoManager = new UndoManager();
int limit = DesignerEnvManager.getEnvManager().getUndoLimit();
@ -389,7 +389,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
return;
}
//如果是在不同的模式下产生的
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
this.getUndoManager().addEdit(new UndoStateEdit(authorityUndoState, newState));
authorityUndoState = newState;
} else {
@ -418,7 +418,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
}
private void fireSuperTargetModified() {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
this.authoritySaved = false;
} else {
this.saved = false;
@ -621,7 +621,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
return false;
}
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
//触发保存服务器工具栏
try {
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
@ -687,7 +687,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
public ShortCut[] shortcut4FileMenu() {
if (DesignerMode.isVcsMode()) {
return VcsScene.shortcut4FileMenu(this);
} else if (BaseUtils.isAuthorityEditing()) {
} else if (DesignerMode.isAuthorityEditing()) {
return new ShortCut[]{new SaveTemplateAction(this), new UndoAction(this), new RedoAction(this)};
} else {
return new ShortCut[]{new SaveTemplateAction(this), new SaveAsTemplateAction(this), new UndoAction(this), new RedoAction(this)};
@ -703,12 +703,14 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
public MenuDef[] menus4Target() {
MenuDef tplMenu = new MenuDef(Inter.getLocText("FR-Designer_M-Template"), 'T');
tplMenu.setAnchor(MenuHandler.TEMPLATE);
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
tplMenu.addShortCut(new NameSeparator(Inter.getLocText("FR-Designer_WorkBook")));
tplMenu.addShortCut(new TableDataSourceAction(this));
tplMenu.addShortCut(shortcut4TemplateMenu());
}
if (!DesignerMode.isVcsMode()) {
tplMenu.addShortCut(shortCuts4Authority());
}
return new MenuDef[]{tplMenu};
}
@ -906,7 +908,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
*/
public void activeJTemplate(int index, JTemplate jt) {
DesignerContext.getDesignerFrame().activateJTemplate(this);
};
}
/**
* 激活已存在的模板
@ -990,10 +992,24 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
return UIConstants.RUN_BIG_ICON;
}
/**
* 获取所有参数
*
* @return
*/
public Parameter[] getParameters() {
return new Parameter[0];
}
/**
* 获取模板参数
*
* @return
*/
public Parameter[] getJTemplateParameters() {
return new Parameter[0];
}
/**
* 请求表单焦点
*/

6
designer_base/src/com/fr/design/mainframe/UndoStateEdit.java

@ -1,7 +1,7 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.general.Inter;
@ -52,7 +52,7 @@ public class UndoStateEdit extends AbstractUndoableEdit {
if (this.old != null) {
this.old.applyState();
}
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
RolesAlreadyEditedPane.getInstance().refreshDockingView();
}
}
@ -67,7 +67,7 @@ public class UndoStateEdit extends AbstractUndoableEdit {
if (this.cur != null) {
this.cur.applyState();
}
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
RolesAlreadyEditedPane.getInstance().refreshDockingView();
}
}

11
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -3,7 +3,6 @@
*/
package com.fr.design.mainframe.toolbar;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
@ -336,7 +335,7 @@ public abstract class ToolBarMenuDock {
}
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_File"), 'F');
ShortCut[] scs = new ShortCut[0];
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
scs = createNewFileShortCuts();
}
if (!ArrayUtils.isEmpty(scs)) {
@ -367,13 +366,13 @@ public abstract class ToolBarMenuDock {
}
protected void addCloseCurrentTemplateAction(MenuDef menuDef) {
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
menuDef.addShortCut(new CloseCurrentTemplateAction());
}
}
protected void addPreferenceAction(MenuDef menuDef) {
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
menuDef.addShortCut(new PreferenceAction());
}
}
@ -409,7 +408,7 @@ public abstract class ToolBarMenuDock {
protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Server"), 'S');
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
menuDef.addShortCut(
new ConnectionListAction(),
createGlobalTDAction()
@ -421,7 +420,7 @@ public abstract class ToolBarMenuDock {
new PlatformManagerAction()
);
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
if (shouldShowPlugin()) {
menuDef.addShortCut(
new PluginManagerAction()

4
designer_base/src/com/fr/design/mainframe/toolbar/VcsScene.java

@ -1,6 +1,6 @@
package com.fr.design.mainframe.toolbar;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.edit.RedoAction;
import com.fr.design.actions.edit.UndoAction;
import com.fr.design.actions.file.ExitDesignerAction;
@ -32,7 +32,7 @@ public class VcsScene {
menuDef.addShortCut(SeparatorDef.DEFAULT);
}
if (!BaseUtils.isAuthorityEditing()) {
if (!DesignerMode.isAuthorityEditing()) {
menuDef.addShortCut(new PreferenceAction());
}

31
designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java

@ -13,6 +13,10 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
/**
* Created by plough on 2017/8/7.
@ -27,7 +31,32 @@ public class BasicPropertyPane extends BasicPane {
protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
widgetName = new UITextField();
widgetName = new UITextField() {
protected void initListener() {
if (shouldResponseChangeListener()) {
addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
}
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
attributeChange();
}
}
});
}
}
};
widgetName.setGlobalName(Inter.getLocText("FR-Designer_Basic"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;

7
designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java

@ -18,7 +18,7 @@ public class AccessibleImgBackgroundEditor extends UneditableAccessibleEditor {
@Override
protected void showEditorPane() {
choosePane = new BackgroundButtonPane();
choosePane = initBackgroundPane();
choosePane.setPreferredSize(new Dimension(600, 400));
BasicDialog dlg = choosePane.showWindow(SwingUtilities.getWindowAncestor(this));
dlg.addDialogActionListener(new DialogActionAdapter() {
@ -32,4 +32,9 @@ public class AccessibleImgBackgroundEditor extends UneditableAccessibleEditor {
choosePane.populate(getValue() instanceof Background ? (Background) getValue() : new ColorBackground());
dlg.setVisible(true);
}
protected BackgroundButtonPane initBackgroundPane(){
return new BackgroundButtonPane();
}
}

17
designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTabBackgroundEditor.java

@ -0,0 +1,17 @@
package com.fr.design.mainframe.widget.accessibles;
import com.fr.design.style.background.BackgroundButtonPane;
import com.fr.design.style.background.BackgroundCardSwitchButtonPane;
/**
* @author kerry
* @date 2018/1/29
*/
public class AccessibleTabBackgroundEditor extends AccessibleImgBackgroundEditor {
public AccessibleTabBackgroundEditor() {
super();
}
@Override
protected BackgroundButtonPane initBackgroundPane(){
return new BackgroundCardSwitchButtonPane();
}
}

40
designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleTabPaneBackgroundEditor.java

@ -0,0 +1,40 @@
package com.fr.design.mainframe.widget.accessibles;
import com.fr.base.background.ColorBackground;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.widget.wrappers.BackgroundWrapper;
import com.fr.design.style.background.BackgroundTabPane;
import com.fr.general.Background;
import javax.swing.SwingUtilities;
import java.awt.Dimension;
/**
* @author kerry
* @date 2018/1/17
*/
public class AccessibleTabPaneBackgroundEditor extends UneditableAccessibleEditor {
private BackgroundTabPane choosePane;
public AccessibleTabPaneBackgroundEditor() {
super(new BackgroundWrapper());
}
@Override
protected void showEditorPane() {
choosePane = new BackgroundTabPane();
choosePane.setPreferredSize(new Dimension(600, 400));
BasicDialog dlg = choosePane.showWindow(SwingUtilities.getWindowAncestor(this));
dlg.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
setValue(choosePane.update());
fireStateChanged();
}
});
choosePane.populate(getValue() instanceof Background ? (Background) getValue() : new ColorBackground());
dlg.setVisible(true);
}
}

2
designer_base/src/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java

@ -43,8 +43,8 @@ public class TemplateStylePane extends BasicPane {
listModel.addElement(new CardTemplateStyle());
listModel.addElement(new BannerTemplateStyle());
listModel.addElement(new BookMarkTemplateStyle());
listModel.addElement(new PentagonTemplateStyle());
listModel.addElement(new MenuTemplateStyle());
listModel.addElement(new PentagonTemplateStyle());
listModel.addElement(new TrapezoidTemplateStyle());
styleList = new JList(listModel);
styleList.setCellRenderer(render);

5
designer_base/src/com/fr/design/mainframe/widget/accessibles/TemplateStylePreviewPane.java

@ -14,7 +14,8 @@ import java.awt.Image;
public class TemplateStylePreviewPane extends JPanel {
private static final int WIDTH = 540;
private static final int HEIGHT = 500;
private static final int HEIGHT = 400;
private static final int OFFSETY = 50;
private TemplateStyle templateStyle;
@ -32,6 +33,6 @@ public class TemplateStylePreviewPane extends JPanel {
super.paint(g);
Graphics2D g2d = (Graphics2D) g.create();
Image image = BaseUtils.readImage(templateStyle.getPreview());
g2d.drawImage(image, 0, 0, WIDTH, HEIGHT, null);
g2d.drawImage(image, 0, OFFSETY, WIDTH, HEIGHT, null);
}
}

7
designer_base/src/com/fr/design/menu/ShortCut.java

@ -29,6 +29,13 @@ public abstract class ShortCut extends AbstractProvider implements Mutable {
private MenuKeySet menuKeySet = null;
/**
* 权限编辑模式变更时候会调用这个方法
* @param isAuhtority
*/
public void notifyFromAuhtorityChange(boolean isAuhtority) {
}
/**
* 将改菜单添加到menul里面去
* @param menu 添加到的menu

3
designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -1,6 +1,7 @@
package com.fr.design.roleAuthority;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
@ -265,7 +266,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
DesignTableDataManager.addDsChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
if (BaseUtils.isAuthorityEditing()) {
if (DesignerMode.isAuthorityEditing()) {
roleTree.refreshTreeNode();
expandTree(roleTree, true);
roleTree.updateUI();

95
designer_base/src/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java

@ -0,0 +1,95 @@
package com.fr.design.style.background;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.GradientBackground;
import com.fr.base.background.ImageBackground;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.gradient.GradientBackgroundPane;
import com.fr.design.style.background.impl.ColorBackgroundPane;
import com.fr.design.style.background.impl.ImageBackgroundPane;
import com.fr.design.style.background.impl.NullBackgroundPane;
import com.fr.general.Background;
import com.fr.general.Inter;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author kerry
* @date 2018/1/29
*/
public class BackgroundCardSwitchButtonPane extends BackgroundButtonPane {
private static Map<Class<? extends Background>, BackgroundUIWrapper> cardSwitchButton = new LinkedHashMap<>();
static {
registerCardSwitchBtnBackground(cardSwitchButton);
}
private static void registerCardSwitchBtnBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color")));
map.put(ImageBackground.class, BackgroundUIWrapper.create()
.setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
map.put(GradientBackground.class, BackgroundUIWrapper.create()
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color")));
}
public BackgroundCardSwitchButtonPane() {
super();
}
@Override
protected void initTabPane() {
int index = 0;
for (Class<? extends Background> key : cardSwitchButton.keySet()) {
BackgroundUIWrapper wrapper = cardSwitchButton.get(key);
wrapper.setIndex(index++);
tabbedPane.addTab(Inter.getLocText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
}
}
@Override
protected BackgroundUIWrapper getBackgroundUIWrapper(Background background) {
return cardSwitchButton.get(background == null ? null : background.getClass());
}
@Override
protected BackgroundDetailPane getTabItemPane(Background background, int index) {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
BackgroundUIWrapper uiWrapper = getBackgroundUIWrapper(background);
quickPane = BackgroundFactory.createByWrapper(uiWrapper);
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
@Override
protected BackgroundDetailPane getTabItemPaneByIndex(int index) {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = createDetailPaneByIndex(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}
public BackgroundDetailPane createDetailPaneByIndex(int index) {
for (BackgroundUIWrapper wrapper : cardSwitchButton.values()) {
if (wrapper.getIndex() == index) {
return BackgroundFactory.createByWrapper(wrapper);
}
}
return new NullBackgroundPane();
}
}

64
designer_base/src/com/fr/design/style/background/BackgroundFactory.java

@ -1,13 +1,29 @@
package com.fr.design.style.background;
import com.fr.base.background.*;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.GradientBackground;
import com.fr.base.background.ImageBackground;
import com.fr.base.background.PatternBackground;
import com.fr.base.background.TextureBackground;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.BackgroundUIProvider;
import com.fr.design.style.background.gradient.GradientBackgroundPane;
import com.fr.design.style.background.impl.*;
import com.fr.design.style.background.impl.ColorBackgroundPane;
import com.fr.design.style.background.impl.ImageBackgroundPane;
import com.fr.design.style.background.impl.ImageBackgroundPane4Browser;
import com.fr.design.style.background.impl.ImageButtonBackgroundPane;
import com.fr.design.style.background.impl.NullBackgroundPane;
import com.fr.design.style.background.impl.PatternBackgroundPane;
import com.fr.design.style.background.impl.TextureBackgroundPane;
import com.fr.general.Background;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType;
import java.util.LinkedHashMap;
import java.util.Map;
@ -29,9 +45,51 @@ public class BackgroundFactory {
registerBrowserImageBackground(browser);
registerExtra(map);
registerExtra(browser);
listenPlugin();
registerButtonBackground(button);
}
private static void listenPlugin() {
PluginFilter filter = new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(BackgroundUIProvider.MARK_STRING);
}
};
GeneralContext.listenPlugin(PluginEventType.BeforeStop, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
Set<BackgroundUIProvider> set = event.getContext().getRuntime().get(BackgroundUIProvider.MARK_STRING);
for (BackgroundUIProvider provider : set) {
map.remove(provider.targetClass());
browser.remove(provider.targetClass());
}
}
}, filter);
GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
Set<BackgroundUIProvider> set = event.getContext().getRuntime().get(BackgroundUIProvider.MARK_STRING);
Class<? extends Background> clazz;
BackgroundUIWrapper wrapper;
for (BackgroundUIProvider provider : set) {
clazz = provider.targetClass();
wrapper = BackgroundUIWrapper.create().setType(provider.targetUIClass()).setTitle(provider.targetTitle());
map.put(clazz, wrapper);
browser.put(clazz, wrapper);
}
}
});
}
private static void registerUniversal(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(null, BackgroundUIWrapper.create()
.setType(NullBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Null")));
@ -139,7 +197,7 @@ public class BackgroundFactory {
return new NullBackgroundPane();
}
private static BackgroundDetailPane createByWrapper(BackgroundUIWrapper wrapper) {
public static BackgroundDetailPane createByWrapper(BackgroundUIWrapper wrapper) {
Class<? extends BackgroundDetailPane> clazz = wrapper.getType();
if (clazz == null) {
clazz = NullBackgroundPane.class;

88
designer_base/src/com/fr/design/style/background/BackgroundTabPane.java

@ -0,0 +1,88 @@
package com.fr.design.style.background;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.GradientBackground;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.gradient.GradientBackgroundPane;
import com.fr.design.style.background.impl.ColorBackgroundPane;
import com.fr.design.style.background.impl.NullBackgroundPane;
import com.fr.general.Background;
import com.fr.general.Inter;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author kerry
* @date 2018/1/17
*/
public class BackgroundTabPane extends BackgroundPane {
private static Map<Class<? extends Background>, BackgroundUIWrapper> tabpane = new LinkedHashMap<>();
static {
registerTabpaneBackground(tabpane);
}
private static void registerTabpaneBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(null, BackgroundUIWrapper.create()
.setType(NullBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Null")));
map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color")));
map.put(GradientBackground.class, BackgroundUIWrapper.create()
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color")));
}
public BackgroundTabPane() {
super();
}
protected void initTabPane() {
int index = 0;
for (Class<? extends Background> key : tabpane.keySet()) {
BackgroundUIWrapper wrapper = tabpane.get(key);
wrapper.setIndex(index++);
tabbedPane.addTab(Inter.getLocText(wrapper.getTitle()), FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane());
}
}
protected BackgroundUIWrapper getBackgroundUIWrapper(Background background) {
return tabpane.get(background == null ? null : background.getClass());
}
protected BackgroundDetailPane getTabItemPane(Background background, int index) {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
BackgroundUIWrapper uiWrapper = getBackgroundUIWrapper(background);
quickPane = BackgroundFactory.createByWrapper(uiWrapper);
quickPane.addChangeListener(backgroundChangeListener);
cacheMap.put(index, quickPane);
}
tabbedPane.setComponentAt(index, quickPane);
tabbedPane.setSelectedIndex(index);
return quickPane;
}
protected BackgroundDetailPane getTabItemPaneByIndex(int index) {
BackgroundDetailPane quickPane = cacheMap.get(index);
if (quickPane == null) {
quickPane = createDetailPaneByIndex(index);
tabbedPane.setComponentAt(index, quickPane);
cacheMap.put(index, quickPane);
quickPane.addChangeListener(backgroundChangeListener);
}
return quickPane;
}
public BackgroundDetailPane createDetailPaneByIndex(int index) {
for (BackgroundUIWrapper wrapper : tabpane.values()) {
if (wrapper.getIndex() == index) {
return BackgroundFactory.createByWrapper(wrapper);
}
}
return new NullBackgroundPane();
}
}

3
designer_base/src/com/fr/design/utils/DesignUtils.java

@ -9,6 +9,7 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.UILookAndFeel;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.env.RemoteEnv;
import com.fr.file.FileFILE;
import com.fr.general.*;
@ -181,7 +182,7 @@ public class DesignUtils {
// 更新CurrentEnv于FRContext & DesignerEnvManager
FRContext.setCurrentEnv(env);
DesignerFrame.refreshNorthEastPane();
refreshDesignerFrame(env);
// 当换了运行环境,重置服务器,让它下次预览时重启
if (env instanceof LocalEnv && !ComparatorUtils.equals(env.getPath(), oldEnvPath)) {

10
designer_base/src/com/fr/design/utils/gui/GUIPaintUtils.java

@ -1,6 +1,6 @@
package com.fr.design.utils.gui;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.stable.Constants;
@ -17,7 +17,7 @@ public class GUIPaintUtils {
public static final void drawBorder(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited) {
Color oldColor = g2d.getColor();
Shape oldClip = g2d.getClip();
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
g2d.setColor(UIConstants.AUTHORITY_LINE_COLOR);
} else {
g2d.setColor(UIConstants.POP_DIALOG_BORDER);
@ -67,7 +67,7 @@ public class GUIPaintUtils {
public static final void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted, Color color) {
GradientPaint gp;
if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, color, 1, height - 1, color);
@ -99,7 +99,7 @@ public class GUIPaintUtils {
GradientPaint gp;
if (hoverColor != null) {
gp = new GradientPaint(1, 1, hoverColor, 1, height - 1, hoverColor);
} else if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
} else if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.HOVER_BLUE);
} else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.ATTRIBUTE_HOVER, 1, height - 1, UIConstants.ATTRIBUTE_HOVER);
@ -129,7 +129,7 @@ public class GUIPaintUtils {
Color oldColor = g2d.getColor();
if (pressedColor != null) {
g2d.setColor(pressedColor);
} else if (BaseUtils.isAuthorityEditing() && isAuthorityEdited) {
} else if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
g2d.setColor(UIConstants.AUTHORITY_PRESS_BLUE);
} else {
g2d.setColor(UIConstants.ATTRIBUTE_PRESS);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save