Browse Source

Merge pull request #866 in BA/design from ~PAUL/design:master to master

* commit 'ee78c63f92afe56ea6112748becef733305a637b': (72 commits)
  国际化
  无JIRA任务,国际化翻译更新
  无JIRA任务,国际化翻译更新
  REPORT-2626 移除国际化文件中的无效key
  REPORT-2626 移除国际化文件中的无效key
  国际化修改 design部分第51-750个key的翻译修改 庄奇syoki 20170509
  Signed-off-by: unknown <李晓丽>
  国际化修改 design部分 1-50个 1901-结束部分key的翻译修改 20170508 庄奇syoki
  REPORT-2483 & REPORT-2484 国际化key转移;外文版的国际化文件和中文版不一致
  无JIRA任务  新release合并遗漏
  无任务,line separator
  REPORT-2537
  无任务,冲突调整,release到dev
  无JIRA任务,国际化,把release、master中的key合并到dev中
  无JIRA任务,解决冲突
  ct
  ct
  ct
  ct
  1
  ...
master
superman 8 years ago
parent
commit
099b4ec3ba
  1. 252
      designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  2. 831
      designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java
  3. 16
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  4. 27
      designer_base/src/com/fr/design/actions/server/ConnectionListAction.java
  5. 25
      designer_base/src/com/fr/design/beans/location/MoveUtils.java
  6. 45
      designer_base/src/com/fr/design/beans/location/WidgetForbidWindow.java
  7. 40
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  8. 2
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java
  9. 3
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java
  10. 15
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java
  11. 52
      designer_base/src/com/fr/design/gui/style/BorderPane.java
  12. BIN
      designer_base/src/com/fr/design/images/control/tab/end.png
  13. BIN
      designer_base/src/com/fr/design/images/control/tab/end_not.png
  14. BIN
      designer_base/src/com/fr/design/images/control/tab/first.png
  15. BIN
      designer_base/src/com/fr/design/images/control/tab/first_not.png
  16. BIN
      designer_base/src/com/fr/design/images/control/tab/next.png
  17. BIN
      designer_base/src/com/fr/design/images/control/tab/next_not.png
  18. BIN
      designer_base/src/com/fr/design/images/control/tab/prev.png
  19. BIN
      designer_base/src/com/fr/design/images/control/tab/prev_not.png
  20. 1470
      designer_base/src/com/fr/design/locale/designer.properties
  21. 1471
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  22. 1998
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  23. 1475
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  24. 1426
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  25. 1456
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  26. 15
      designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java
  27. 336
      designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java
  28. 3
      designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java
  29. 26
      designer_base/src/com/fr/design/style/color/ColorSelectDetailPane.java
  30. 39
      designer_base/src/com/fr/design/style/color/ColorSelectPane.java
  31. 50
      designer_base/src/com/fr/design/style/color/NewColorSelectPane.java
  32. 17
      designer_base/src/com/fr/design/style/color/RecentUseColorPane.java
  33. 29
      designer_base/src/com/fr/design/style/color/UsedColorPane.java
  34. 2
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java
  35. 6
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  36. 7
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
  37. 6
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  38. 3
      designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java
  39. 6
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  40. 44
      designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
  41. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java
  42. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java
  43. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java
  44. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java
  45. 10
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  46. 17
      designer_form/src/com/fr/design/mainframe/ComponentTree.java
  47. 1
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  48. 5
      designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java
  49. 7
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  50. 2
      designer_form/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java
  51. 7
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

252
designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java

File diff suppressed because one or more lines are too long

831
designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java

File diff suppressed because one or more lines are too long

16
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -67,7 +67,12 @@ public class CellWidgetCardPane extends BasicPane {
treeTabPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
widgetPropertyPane = new BasicWidgetPropertySettingPane();
attriTabPane.add(widgetPropertyPane, BorderLayout.NORTH);
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8));
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties"));
northPane.add(basic);
basic.add(widgetPropertyPane);
attriTabPane.add(northPane, BorderLayout.NORTH);
attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
attriTabPane.add(attriCardPane, BorderLayout.CENTER);
attriCardLayout = (CardLayout) attriCardPane.getLayout();
@ -88,15 +93,6 @@ public class CellWidgetCardPane extends BasicPane {
this.tabbedPane.setEnabled(true);
}
attriTabPane.remove(widgetPropertyPane);
widgetPropertyPane = new BasicWidgetPropertySettingPane();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8));
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties"));
northPane.add(basic);
basic.add(widgetPropertyPane);
attriTabPane.add(northPane, BorderLayout.NORTH);
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() {
@Override
public void did(DataCreatorUI ui, String cardName) {

27
designer_base/src/com/fr/design/actions/server/ConnectionListAction.java

@ -8,6 +8,7 @@ import com.fr.data.impl.Connection;
import com.fr.dav.LocalEnv;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionManagerPane;
import com.fr.design.data.datapane.connect.ConnectionShowPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
@ -25,7 +26,6 @@ import java.util.HashMap;
* DatasourceList Action
*/
public class ConnectionListAction extends UpdateAction {
private static final int BYTENUM = 1444;
public ConnectionListAction() {
this.setMenuKeySet(DEFINE_DATA_CONNECTION);
@ -92,7 +92,10 @@ public class ConnectionListAction extends UpdateAction {
}
private void writeFile(DatasourceManagerProvider datasourceManager) {
/**
* @param datasourceManager
*/
public static void writeFile(DatasourceManagerProvider datasourceManager) {
Env currentEnv = FRContext.getCurrentEnv();
try {
boolean isSuccess = currentEnv.writeResource(datasourceManager);
@ -106,15 +109,17 @@ public class ConnectionListAction extends UpdateAction {
}
/**
* 是否正常更新datasourceManager
* 更新datasourceManager
*
* @param datasourceManager
* @param databaseManagerPane
* @return
* @param datasourceManager datasource管理对象
* @param backupManager datasource管理对象备份
* @param connectionShowPane datasource面板
* @param databaseListDialog datasource管理对话框
* @return boolean 是否更新成功
*/
private boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager backupManager,
ConnectionManagerPane databaseManagerPane, BasicDialog databaseListDialog) {
databaseManagerPane.update(datasourceManager);
public static boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager
backupManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) {
connectionShowPane.update(datasourceManager);
HashMap<String, Connection> modifyDetails = datasourceManager.getConnectionModifyDetails();
modifyDetails.clear();
Env currentEnv = FRContext.getCurrentEnv();
@ -139,7 +144,7 @@ public class ConnectionListAction extends UpdateAction {
localModifiedTable.removeConfilct();
modifyDetails.clear();
//更新面板
databaseManagerPane.populate(datasourceManager);
connectionShowPane.populate(datasourceManager);
} else {
//更新失败,继续停留页面
isFailed = true;
@ -152,7 +157,7 @@ public class ConnectionListAction extends UpdateAction {
int index = datasourceManager.isConnectionMapContainsRename();
if (index != -1) {
isFailed = true;
databaseManagerPane.setSelectedIndex(index);
connectionShowPane.setSelectedIndex(index);
}
databaseListDialog.setDoOKSucceed(!isFailed);
//如果修改成功,则去远程端增量修改修改表

25
designer_base/src/com/fr/design/beans/location/MoveUtils.java

@ -30,7 +30,9 @@ public class MoveUtils {
* 获取块边界的迭代器
*
* @return 块边界的迭代器
*
* @date 2015-2-12-下午2:43:47
*
*/
RectangleIterator createRectangleIterator();
@ -38,7 +40,9 @@ public class MoveUtils {
* 设置X轴的线
*
* @param line 连接线
*
* @date 2015-2-12-下午2:44:04
*
*/
void setXAbsorptionline(Absorptionline line);
@ -46,7 +50,9 @@ public class MoveUtils {
* 设置Y轴的线
*
* @param line 连接线
*
* @date 2015-2-12-下午2:44:04
*
*/
void setYAbsorptionline(Absorptionline line);
@ -54,6 +60,7 @@ public class MoveUtils {
* 获取当前选中块的垂直线数组
*
* @return 块的垂直线数组
*
*/
int[] getVerticalLine();
@ -61,47 +68,42 @@ public class MoveUtils {
* 获取当前选中块的水平线数组
*
* @return 块的水平线数组
*
*/
int[] getHorizontalLine();
/**
* 设置designer内部组件是否重叠的标志位
*
* @param isIntersects 是否重叠
*/
void setWidgetsIntersected(boolean isIntersects);
/**
* 获取designer内部组件是否重叠的标志位
*
* @return 重叠
*/
boolean isWidgetsIntersected();
/**
* 获取designer相对屏幕的位置
*
* @return 位置
*/
Point getDesignerLocationOnScreen();
/**
* 设置等距线
*
* @param line 吸附线
*/
void setEquidistantLine(Absorptionline line);
/**
* 获取设计器垂直滚动条的值
*
* @return 滚动条的值
*/
int getDesignerScrollVerticalValue();
/**
* 获取设计器水平滚动条的值
*
* @return 滚动条的值
*/
int getDesignerScrollHorizontalValue();
@ -113,7 +115,9 @@ public class MoveUtils {
* 是否存在下一个块
*
* @return 是否存在下一个块
*
* @date 2015-2-12-下午2:41:32
*
*/
boolean hasNext();
@ -121,7 +125,9 @@ public class MoveUtils {
* 获取下一个块的bounds
*
* @return 下一个块的bounds
*
* @date 2015-2-12-下午2:41:55
*
*/
Rectangle nextRectangle();
@ -129,7 +135,9 @@ public class MoveUtils {
* 获取块的垂直线数组
*
* @return 块的垂直线数组
*
* @date 2015-2-12-下午2:42:27
*
*/
int[] getVerticalLine();
@ -137,7 +145,9 @@ public class MoveUtils {
* 获取块的水平线数组
*
* @return 块的水平线数组
*
* @date 2015-2-12-下午2:42:27
*
*/
int[] getHorizontalLine();
}
@ -275,8 +285,11 @@ public class MoveUtils {
* @param width 宽度
* @param height 高度
* @param designer 块设计器
*
* @return 吸附后坐标
*
* @date 2015-2-12-下午2:39:16
*
*/
public static Point sorption(int x, int y, int width, int height, RectangleDesigner designer, boolean isParameterLayout) {

45
designer_base/src/com/fr/design/beans/location/WidgetForbidWindow.java

@ -1,45 +0,0 @@
package com.fr.design.beans.location;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.icon.IconPathConstants;
import com.fr.general.Inter;
import javax.swing.*;
/**
* Created by zhouping on 2016/7/24.
*/
public class WidgetForbidWindow extends JWindow {
private static final int WIDTH = 150;
private static final int HEIGHT = 20;
private UIButton promptButton = new UIButton(Inter.getLocText("FR-Designer_Forbid_Widgets_Intersects"), BaseUtils.readIcon(IconPathConstants.FORBID_ICON_PATH));
/**
* 构造函数
*/
public WidgetForbidWindow() {
this.add(promptButton);
this.setSize(WIDTH, HEIGHT);
}
/**
* 在指定位置显示窗口, 默认将window的中心点放到指定位置上
*
* @param x x坐标
* @param y y坐标
*/
public void showWindow(int x, int y) {
this.setLocation(x - WIDTH / 2, y - HEIGHT / 2);
this.setVisible(true);
}
/**
* 隐藏当前窗口
*/
public void hideWindow() {
this.setVisible(false);
}
}

40
designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java

@ -1,11 +1,11 @@
package com.fr.design.data.datapane.connect;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.server.ConnectionListAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.file.DatasourceManager;
@ -17,6 +17,7 @@ import javax.swing.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
@ -31,7 +32,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
*/
private static final long serialVersionUID = 1L;
private Class<? extends Connection> cls; // 所取的Connection都是cls及其子类
private java.util.List<String> nameList = new ArrayList<String>();
private List<String> nameList = new ArrayList<String>();
public ConnectionComboBoxPanel(Class<? extends Connection> cls) {
super();
@ -53,11 +54,11 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
/*
* 刷新ComboBox.items
*/
protected java.util.Iterator<String> items() {
protected Iterator<String> items() {
nameList = new ArrayList<String>();
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance();
java.util.Iterator<String> nameIt = mgr.getConnectionNameIterator();
Iterator<String> nameIt = mgr.getConnectionNameIterator();
while (nameIt.hasNext()) {
String conName = nameIt.next();
Connection connection = mgr.getConnection(conName);
@ -71,7 +72,6 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
connection.addConnection(nameList, conName, new Class[]{AbstractDatabaseConnection.class});
}
public int getConnectionSize() {
return nameList.size();
}
@ -86,25 +86,37 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
protected void editItems() {
final ConnectionListPane connectionListPane = new ConnectionListPane();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
connectionListPane.populate(datasourceManager);
BasicDialog connectionListDialog = connectionListPane.showLargeWindow(
SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), new DialogActionAdapter() {
final BasicDialog connectionListDialog = connectionListPane.showLargeWindow(
SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), null);
connectionListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
connectionListPane.update(datasourceManager);
if (!connectionListPane.isNamePermitted()) {
connectionListDialog.setDoOKSucceed(false);
return;
}
if (!ConnectionListAction.doWithDatasourceManager(datasourceManager, backupManager, connectionListPane,
connectionListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(datasourceManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
ConnectionListAction.writeFile(datasourceManager);
}
public void doCancel() {
datasourceManager.synchronizedWithServer();
}
});
connectionListDialog.setVisible(true);
refreshItems();
}
public void populate(com.fr.data.impl.Connection connection) {
/**
* @param connection 数据库链接
*/
public void populate(Connection connection) {
editButton.setEnabled(FRContext.getCurrentEnv().isRoot());
if (connection instanceof NameDatabaseConnection) {
this.setSelectedItem(((NameDatabaseConnection) connection).getName());

2
designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -23,7 +23,7 @@ import java.util.*;
/**
* Connection List Pane.
*/
public class ConnectionListPane extends JListControlPane {
public class ConnectionListPane extends JListControlPane implements ConnectionShowPane {
public static final String TITLE_NAME = Inter.getLocText("Server-Define_Data_Connection");
private boolean isNamePermitted = true;
private HashMap<String, String> renameMap = new HashMap<String, String>();

3
designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

@ -14,7 +14,7 @@ import java.awt.*;
import java.io.File;
import java.util.HashMap;
public class ConnectionManagerPane extends LoadingBasicPane {
public class ConnectionManagerPane extends LoadingBasicPane implements ConnectionShowPane {
private UITextField connectionTextField;
private ConnectionListPane connectionListPane;
@ -69,6 +69,7 @@ public class ConnectionManagerPane extends LoadingBasicPane {
/**
* 名字是否允许
*
* @return 允许返回true
*/
public boolean isNamePermitted() {

15
designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java

@ -0,0 +1,15 @@
package com.fr.design.data.datapane.connect;
import com.fr.file.DatasourceManagerProvider;
/**
* Created by yaoh.wu on 2017/4/22.
* 数据链接显示面板
*/
public interface ConnectionShowPane {
void update(DatasourceManagerProvider datasourceManager);
void populate(DatasourceManagerProvider datasourceManager);
void setSelectedIndex(int index);
}

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

@ -51,34 +51,16 @@ public class BorderPane extends AbstractBasicStylePane {
}
protected void initComponents() {
topToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/top.png"));
leftToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/left.png"));
bottomToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/bottom.png"));
rightToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/right.png"));
horizontalToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/horizontal.png"));
verticalToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/vertical.png"));
this.currentLineCombo = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY);
this.currentLineColorPane = new NewColorSelectBox(100);
initButtonsWithIcon();
this.setLayout(new BorderLayout(0, 6));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize1 = {p, f};
double[] rowSize1 = {p, p};
double p = TableLayout.PREFERRED, f = TableLayout.FILL;
double[] columnSize1 = {p, f}, rowSize1 = {p, p};
Component[][] components1 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Style") + ":"), currentLineCombo},
new Component[]{new UILabel(Inter.getLocText("Color") + ":"), currentLineColorPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Style") + ":"), currentLineCombo},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Color") + ":"), currentLineColorPane},
};
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components1, rowSize1, columnSize1);
double[] columnSize2 = {p, f};
double[] rowSize2 = {p, p};
double[] columnSize2 = {p, f}, rowSize2 = {p, p};
JPanel externalPane = new JPanel(new GridLayout(0, 4));
externalPane.add(topToggleButton);
externalPane.add(leftToggleButton);
@ -87,23 +69,15 @@ public class BorderPane extends AbstractBasicStylePane {
JPanel insidePane = new JPanel(new GridLayout(0, 2));
insidePane.add(horizontalToggleButton);
insidePane.add(verticalToggleButton);
Component[][] components2 = new Component[][]{
new Component[]{outerToggleButton = new UIToggleButton(BaseUtils.readIcon("com/fr/design/images/m_format/out.png")), innerToggleButton = new UIToggleButton(BaseUtils.readIcon("com/fr/design/images/m_format/in.png"))},
new Component[]{externalPane, insidePane,}
};
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components2, rowSize2, columnSize2);
this.setLayout(new BorderLayout(0, 6));
this.add(northPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
this.currentLineColorPane.setSelectObject(Color.BLACK);
outerToggleButton.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
boolean value = outerToggleButton.isSelected();
@ -113,9 +87,7 @@ public class BorderPane extends AbstractBasicStylePane {
rightToggleButton.setSelected(value);
}
});
innerToggleButton.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
boolean value = innerToggleButton.isSelected();
@ -123,12 +95,22 @@ public class BorderPane extends AbstractBasicStylePane {
verticalToggleButton.setSelected(value);
}
});
}
private void initButtonsWithIcon(){
topToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/top.png"));
leftToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/left.png"));
bottomToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/bottom.png"));
rightToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/right.png"));
horizontalToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/horizontal.png"));
verticalToggleButton = new UIToggleButton(BaseUtils.readIcon("/com/fr/base/images/dialog/border/vertical.png"));
this.currentLineCombo = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY);
this.currentLineColorPane = new NewColorSelectBox(100);
}
@Override
public String title4PopupWindow() {
return Inter.getLocText("Border");
return Inter.getLocText("FR-Designer_Border");
}
public void populate(Style style) {

BIN
designer_base/src/com/fr/design/images/control/tab/end.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

BIN
designer_base/src/com/fr/design/images/control/tab/end_not.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

BIN
designer_base/src/com/fr/design/images/control/tab/first.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

BIN
designer_base/src/com/fr/design/images/control/tab/first_not.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

BIN
designer_base/src/com/fr/design/images/control/tab/next.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

BIN
designer_base/src/com/fr/design/images/control/tab/next_not.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

BIN
designer_base/src/com/fr/design/images/control/tab/prev.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

BIN
designer_base/src/com/fr/design/images/control/tab/prev_not.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

15
designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java

@ -26,17 +26,16 @@ import java.awt.geom.Rectangle2D;
public class PatternBackgroundQuickPane extends BackgroundQuickPane {
private int patternIndex = 0; // pattern setIndex.
private final static int DEFAULT_DIM_HEIGHT = 190;
private ColorSelectBox foregroundColorPane;
private ColorSelectBox backgroundColorPane;
private PatternButton[] patternButtonArray;
public PatternBackgroundQuickPane() {
this.setLayout(new BorderLayout(0, 4));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(contentPane, BorderLayout.NORTH);
contentPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5));
JPanel typePane2 = new JPanel();
contentPane.add(typePane2);
typePane2.setLayout(new GridLayout(0, 8, 1, 1));
@ -48,15 +47,11 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane {
patternButtonGroup.add(patternButtonArray[i]);
typePane2.add(patternButtonArray[i]);
}
JPanel colorPane = new JPanel(new GridLayout(0, 2));
foregroundColorPane = new ColorSelectBox(70);
backgroundColorPane = new ColorSelectBox(70);
foregroundColorPane.setSelectObject(Color.lightGray);
backgroundColorPane.setSelectObject(Color.black);
colorPane.add(this.createLabelColorPane(Inter.getLocText("Foreground") + ":", foregroundColorPane));
colorPane.add(this.createLabelColorPane(Inter.getLocText("Background") + ":", backgroundColorPane));
colorPane.add(this.createLabelColorPane(Inter.getLocText("FR-Designer_Foreground") + ":", foregroundColorPane));
colorPane.add(this.createLabelColorPane(Inter.getLocText("FR-Designer_Background") + ":", backgroundColorPane));
this.add(colorPane, BorderLayout.CENTER);
foregroundColorPane.addSelectChangeListener(colorChangeListener);
backgroundColorPane.addSelectChangeListener(colorChangeListener);
@ -65,7 +60,7 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane {
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = 190;
dim.height = DEFAULT_DIM_HEIGHT;
return dim;
}
@ -206,6 +201,6 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane {
@Override
public String title4PopupWindow() {
return Inter.getLocText("Background-Pattern");
return Inter.getLocText("FR-Designer_Background-Pattern");
}
}

336
designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

@ -6,32 +6,56 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.GeneralUtils;
import com.fr.general.SiteCenter;
import com.fr.general.*;
import com.fr.general.http.HttpClient;
import com.fr.stable.*;
import org.json.JSONObject;
import com.fr.stable.xml.*;
import com.fr.third.javax.xml.stream.XMLStreamException;
import com.fr.json.JSONObject;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.HashMap;
/**
* 做模板的过程和耗时收集辅助类
* Created by plough on 2017/2/21.
*/
public class TemplateInfoCollector<T extends IOFile> implements Serializable {
private static final String FILE_NAME = "tplInfo.ser";
public class TemplateInfoCollector<T extends IOFile> implements Serializable, XMLReadable, XMLWriter {
private static final String FILE_NAME = "tpl.info";
private static final String OBJECT_FILE_NAME = "tplInfo.ser";
private static TemplateInfoCollector instance;
private HashMap<String, HashMap<String, Object>> templateInfoList;
private Map<String, HashMap<String, Object>> templateInfoList;
private String designerOpenDate; //设计器最近一次打开日期
private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数
private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数
private static final int COMPLETE_DAY_COUNT = 15; // 判断模板是否完成的天数
private static final int ONE_THOUSAND = 1000;
static final long serialVersionUID = 2007L;
private static final String XML_DESIGNER_OPEN_DATE = "DesignerOpenDate";
private static final String XML_TEMPLATE_INFO_LIST = "TemplateInfoList";
private static final String XML_TEMPLATE_INFO = "TemplateInfo";
private static final String XML_PROCESS_MAP = "processMap";
private static final String XML_CONSUMING_MAP = "consumingMap";
private static final String ATTR_DAY_COUNT = "day_count";
private static final String ATTR_TEMPLATE_ID = "templateID";
private static final String ATTR_PROCESS = "process";
private static final String ATTR_FLOAT_COUNT = "float_count";
private static final String ATTR_WIDGET_COUNT = "widget_count";
private static final String ATTR_CELL_COUNT = "cell_count";
private static final String ATTR_BLOCK_COUNT = "block_count";
private static final String ATTR_REPORT_TYPE = "report_type";
private static final String ATTR_ACTIVITYKEY = "activitykey";
private static final String ATTR_JAR_TIME = "jar_time";
private static final String ATTR_CREATE_TIME = "create_time";
private static final String ATTR_UUID = "uuid";
private static final String ATTR_TIME_CONSUME = "time_consume";
private static final String ATTR_VERSION = "version";
private static final String ATTR_USERNAME = "username";
private static final String JSON_CONSUMING_MAP = "jsonConsumingMap";
private static final String JSON_PROCESS_MAP = "jsonProcessMap";
@SuppressWarnings("unchecked")
private TemplateInfoCollector() {
@ -61,27 +85,57 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
return new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), FILE_NAME));
}
private static File getObjectInfoFile() {
return new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), OBJECT_FILE_NAME));
}
public static TemplateInfoCollector getInstance() {
if (instance == null) {
// 先尝试从文件读取
instance = new TemplateInfoCollector();
readXMLFile(instance, getInfoFile());
// 兼容过渡。如果没有新文件,则从老文件读取数据。以后都是读写新的 xml 文件
if (!getInfoFile().exists() && getObjectInfoFile().exists()) {
try {
ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile()));
ObjectInputStream is = new ObjectInputStream(new FileInputStream(getObjectInfoFile()));
instance = (TemplateInfoCollector) is.readObject();
} catch (FileNotFoundException ex) {
// 如果之前没有存储过,则创建新对象
instance = new TemplateInfoCollector();
} catch (InvalidClassException ex) {
// 如果 TemplateInfoCollecor 类结构有改动,则放弃之前收集的数据(下次保存时覆盖)
// 这种情况主要在开发、测试过程中遇到,正式上线后不应该出现
instance = new TemplateInfoCollector();
} catch (Exception ex) {
// 什么也不做,instance 使用新值
}
catch (Exception ex) {
FRLogger.getLogger().error(ex.getMessage(), ex);
}
}
return instance;
}
private static void readXMLFile(XMLReadable xmlReadable, File xmlFile){
if (xmlFile == null || !xmlFile.exists()) {
return;
}
String charset = EncodeConstants.ENCODING_UTF_8;
try {
String fileContent = getFileContent(xmlFile);
InputStream xmlInputStream = new ByteArrayInputStream(fileContent.getBytes(charset));
InputStreamReader inputStreamReader = new InputStreamReader(xmlInputStream, charset);
XMLableReader xmlReader = XMLableReader.createXMLableReader(inputStreamReader);
if (xmlReader != null) {
xmlReader.readXMLObject(xmlReadable);
}
xmlInputStream.close();
} catch (FileNotFoundException e) {
FRContext.getLogger().error(e.getMessage());
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage());
} catch (XMLStreamException e) {
FRContext.getLogger().error(e.getMessage());
}
}
private static String getFileContent(File xmlFile) throws FileNotFoundException, UnsupportedEncodingException{
InputStream is = new FileInputStream(xmlFile);
return IOUtils.inputStream2String(is);
}
private boolean shouldCollectInfo() {
if (FRContext.getCurrentEnv() instanceof RemoteEnv) { // 远程设计不收集数据
return false;
@ -104,8 +158,8 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
*/
@SuppressWarnings("unchecked")
public String loadProcess(T t) {
HashMap<String, Object> processMap = (HashMap<String, Object>) templateInfoList.get(t.getTemplateID()).get("processMap");
return (String)processMap.get("process");
HashMap<String, Object> processMap = (HashMap<String, Object>) templateInfoList.get(t.getTemplateID()).get(XML_PROCESS_MAP);
return (String)processMap.get(ATTR_PROCESS);
}
/**
@ -120,9 +174,8 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
*/
private void saveInfo() {
try {
ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile()));
os.writeObject(instance);
os.close();
FileOutputStream out = new FileOutputStream(getInfoFile());
XMLTools.writeOutputStreamXML(this, out);
} catch (Exception ex) {
FRLogger.getLogger().error(ex.getMessage());
}
@ -135,8 +188,8 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
if (designerOpenFirstTime()) {
for (String key : templateInfoList.keySet()) {
HashMap<String, Object> templateInfo = templateInfoList.get(key);
int dayCount = (int)templateInfo.get("day_count") + 1;
templateInfo.put("day_count", dayCount);
int dayCount = (int)templateInfo.get(ATTR_DAY_COUNT) + 1;
templateInfo.put(ATTR_DAY_COUNT, dayCount);
}
setDesignerOpenDate();
}
@ -160,21 +213,20 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
if (inList(t)) { // 已有记录
templateInfo = templateInfoList.get(t.getTemplateID());
// 更新 conusmingMap
HashMap<String, Object> consumingMap = (HashMap<String, Object>) templateInfo.get("consumingMap");
timeConsume += (long)consumingMap.get("time_consume"); // 加上之前的累计编辑时间
consumingMap.put("time_consume", timeConsume);
HashMap<String, Object> consumingMap = (HashMap<String, Object>) templateInfo.get(XML_CONSUMING_MAP);
timeConsume += (long)consumingMap.get(ATTR_TIME_CONSUME); // 加上之前的累计编辑时间
consumingMap.put(ATTR_TIME_CONSUME, timeConsume);
}
else { // 新增
templateInfo = new HashMap<>();
templateInfo.put("consumingMap", getNewConsumingMap(templateID, openTime, timeConsume));
templateInfo.put(XML_CONSUMING_MAP, getNewConsumingMap(templateID, openTime, timeConsume));
}
// 直接覆盖 processMap
templateInfo.put("processMap", getProcessMap(templateID, jt));
templateInfo.put(XML_PROCESS_MAP, getProcessMap(templateID, jt));
// 保存模板时,让 day_count 归零
templateInfo.put("day_count", 0);
templateInfo.put(ATTR_DAY_COUNT, 0);
templateInfoList.put(templateID, templateInfo);
@ -190,14 +242,14 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime());
String jarTime = GeneralUtils.readBuildNO();
String version = ProductConstants.VERSION;
consumingMap.put("username", username);
consumingMap.put("uuid", uuid);
consumingMap.put("activitykey", activitykey);
consumingMap.put("templateID", templateID);
consumingMap.put("create_time", createTime);
consumingMap.put("time_consume", timeConsume);
consumingMap.put("jar_time", jarTime);
consumingMap.put("version", version);
consumingMap.put(ATTR_USERNAME, username);
consumingMap.put(ATTR_UUID, uuid);
consumingMap.put(ATTR_ACTIVITYKEY, activitykey);
consumingMap.put(ATTR_TEMPLATE_ID, templateID);
consumingMap.put(ATTR_CREATE_TIME, createTime);
consumingMap.put(ATTR_TIME_CONSUME, timeConsume);
consumingMap.put(ATTR_JAR_TIME, jarTime);
consumingMap.put(ATTR_VERSION, version);
return consumingMap;
}
@ -205,15 +257,15 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
private HashMap<String, Object> getProcessMap(String templateID, JTemplate jt) {
HashMap<String, Object> processMap = new HashMap<>();
processMap.put("templateID", templateID);
processMap.put("process", jt.getProcess());
processMap.put(ATTR_TEMPLATE_ID, templateID);
processMap.put(ATTR_PROCESS, jt.getProcess());
TemplateProcessInfo info = jt.getProcessInfo();
processMap.put("report_type", info.getReportType());
processMap.put("cell_count", info.getCellCount());
processMap.put("float_count", info.getFloatCount());
processMap.put("block_count", info.getBlockCount());
processMap.put("widget_count", info.getWidgetCount());
processMap.put(ATTR_REPORT_TYPE, info.getReportType());
processMap.put(ATTR_CELL_COUNT, info.getCellCount());
processMap.put(ATTR_FLOAT_COUNT, info.getFloatCount());
processMap.put(ATTR_BLOCK_COUNT, info.getBlockCount());
processMap.put(ATTR_WIDGET_COUNT, info.getWidgetCount());
return processMap;
}
@ -227,11 +279,11 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
String processUrl = SiteCenter.getInstance().acquireUrlByKind("tempinfo.process") + "/single";
ArrayList<HashMap<String, String>> completeTemplatesInfo = getCompleteTemplatesInfo();
for (HashMap<String, String> templateInfo : completeTemplatesInfo) {
String jsonConsumingMap = templateInfo.get("jsonConsumingMap");
String jsonProcessMap = templateInfo.get("jsonProcessMap");
String jsonConsumingMap = templateInfo.get(JSON_CONSUMING_MAP);
String jsonProcessMap = templateInfo.get(JSON_PROCESS_MAP);
if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) {
// 清空记录
removeFromTemplateInfoList(templateInfo.get("templateID"));
removeFromTemplateInfoList(templateInfo.get(ATTR_TEMPLATE_ID));
}
}
saveInfo();
@ -251,7 +303,12 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
}
String res = httpClient.getResponseText();
boolean success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
boolean success;
try {
success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
} catch (Exception ex) {
success = false;
}
return success;
}
@ -264,21 +321,21 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
ArrayList<String> testTemplateKeys = new ArrayList<>(); // 保存测试模板的key
for (String key : templateInfoList.keySet()) {
HashMap<String, Object> templateInfo = templateInfoList.get(key);
if ((int)templateInfo.get("day_count") <= COMPLETE_DAY_COUNT) { // 未完成模板
if ((int)templateInfo.get(ATTR_DAY_COUNT) <= COMPLETE_DAY_COUNT) { // 未完成模板
continue;
}
if (isTestTemplate(templateInfo)) {
testTemplateKeys.add(key);
continue;
}
HashMap<String, Object> consumingMap = (HashMap<String, Object>) templateInfo.get("consumingMap");
HashMap<String, Object> processMap = (HashMap<String, Object>) templateInfo.get("processMap");
HashMap<String, Object> consumingMap = (HashMap<String, Object>) templateInfo.get(XML_CONSUMING_MAP);
HashMap<String, Object> processMap = (HashMap<String, Object>) templateInfo.get(XML_PROCESS_MAP);
String jsonConsumingMap = new JSONObject(consumingMap).toString();
String jsonProcessMap = new JSONObject(processMap).toString();
HashMap<String, String> jsonTemplateInfo = new HashMap<>();
jsonTemplateInfo.put("jsonConsumingMap", jsonConsumingMap);
jsonTemplateInfo.put("jsonProcessMap", jsonProcessMap);
jsonTemplateInfo.put("templateID", key);
jsonTemplateInfo.put(JSON_CONSUMING_MAP, jsonConsumingMap);
jsonTemplateInfo.put(JSON_PROCESS_MAP, jsonProcessMap);
jsonTemplateInfo.put(ATTR_TEMPLATE_ID, key);
completeTemplatesInfo.add(jsonTemplateInfo);
}
// 删除测试模板
@ -294,12 +351,12 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
@SuppressWarnings("unchecked")
private boolean isTestTemplate(HashMap<String, Object> templateInfo) {
HashMap<String, Object> processMap = (HashMap<String, Object>) templateInfo.get("processMap");
int reportType = (int)processMap.get("report_type");
int cellCount = (int)processMap.get("cell_count");
int floatCount = (int)processMap.get("float_count");
int blockCount = (int)processMap.get("block_count");
int widgetCount = (int)processMap.get("widget_count");
HashMap<String, Object> processMap = (HashMap<String, Object>) templateInfo.get(XML_PROCESS_MAP);
int reportType = (int)processMap.get(ATTR_REPORT_TYPE);
int cellCount = (int)processMap.get(ATTR_CELL_COUNT);
int floatCount = (int)processMap.get(ATTR_FLOAT_COUNT);
int blockCount = (int)processMap.get(ATTR_BLOCK_COUNT);
int widgetCount = (int)processMap.get(ATTR_WIDGET_COUNT);
boolean isTestTemplate = false;
if (reportType == 0) { // 普通报表
isTestTemplate = cellCount <= VALID_CELL_COUNT && floatCount <= 1 && widgetCount <= VALID_WIDGET_COUNT;
@ -311,6 +368,157 @@ public class TemplateInfoCollector<T extends IOFile> implements Serializable {
return isTestTemplate;
}
@SuppressWarnings("unchecked")
@Override
public void readXML(XMLableReader reader) {
if (reader.isChildNode()) {
try {
String name = reader.getTagName();
if (XML_DESIGNER_OPEN_DATE.equals(name)) {
this.designerOpenDate = reader.getElementValue();
} else if(XML_TEMPLATE_INFO_LIST.equals(name)){
readTemplateInfoList(reader);
}
} catch (Exception ex) {
// 什么也不做,使用默认值
}
}
}
private void readTemplateInfoList(XMLableReader reader) {
reader.readXMLObject(new XMLReadable() {
public void readXML(XMLableReader reader) {
if (XML_TEMPLATE_INFO.equals(reader.getTagName())) {
TemplateInfo templateInfo = new TemplateInfo();
reader.readXMLObject(templateInfo);
templateInfoList.put(templateInfo.getTemplateID(), templateInfo.getTemplateInfo());
}
}
});
}
@Override
public void writeXML(XMLPrintWriter writer) {
writer.startTAG("TplInfo");
writer.startTAG(XML_DESIGNER_OPEN_DATE);
writer.textNode(designerOpenDate);
writer.end();
writeTemplateInfoList(writer);
writer.end();
}
private void writeTemplateInfoList(XMLPrintWriter writer){
//启停
writer.startTAG(XML_TEMPLATE_INFO_LIST);
for (String templateID : templateInfoList.keySet()) {
new TemplateInfo(templateInfoList.get(templateID)).writeXML(writer);
}
writer.end();
}
private class TemplateInfo implements XMLReadable, XMLWriter {
private int dayCount;
private String templateID;
private HashMap<String, Object> processMap = new HashMap<>();
private HashMap<String, Object> consumingMap = new HashMap<>();
@SuppressWarnings("unchecked")
public TemplateInfo(HashMap<String, Object> templateInfo) {
this.dayCount = (int)templateInfo.get(ATTR_DAY_COUNT);
this.processMap = (HashMap<String, Object>) templateInfo.get(XML_PROCESS_MAP);
this.consumingMap = (HashMap<String, Object>) templateInfo.get(XML_CONSUMING_MAP);
this.templateID = (String) processMap.get(ATTR_TEMPLATE_ID);
}
public TemplateInfo() {}
public String getTemplateID() {
return templateID;
}
public HashMap<String, Object> getTemplateInfo() {
HashMap<String, Object> templateInfo = new HashMap<>();
templateInfo.put(XML_PROCESS_MAP, processMap);
templateInfo.put(XML_CONSUMING_MAP, consumingMap);
templateInfo.put(ATTR_DAY_COUNT, dayCount);
return templateInfo;
}
public void writeXML(XMLPrintWriter writer) {
writer.startTAG(XML_TEMPLATE_INFO);
if (StringUtils.isNotEmpty(templateID)) {
writer.attr(ATTR_TEMPLATE_ID, this.templateID);
}
if (dayCount >= 0) {
writer.attr(ATTR_DAY_COUNT, this.dayCount);
}
writeProcessMap(writer);
writeConsumingMap(writer);
writer.end();
}
private void writeProcessMap(XMLPrintWriter writer) {
writer.startTAG(XML_PROCESS_MAP);
writer.attr(ATTR_PROCESS, (String)processMap.get(ATTR_PROCESS));
writer.attr(ATTR_FLOAT_COUNT, (int)processMap.get(ATTR_FLOAT_COUNT));
writer.attr(ATTR_WIDGET_COUNT, (int)processMap.get(ATTR_WIDGET_COUNT));
writer.attr(ATTR_CELL_COUNT, (int)processMap.get(ATTR_CELL_COUNT));
writer.attr(ATTR_BLOCK_COUNT, (int)processMap.get(ATTR_BLOCK_COUNT));
writer.attr(ATTR_REPORT_TYPE, (int)processMap.get(ATTR_REPORT_TYPE));
writer.end();
}
private void writeConsumingMap(XMLPrintWriter writer) {
writer.startTAG(XML_CONSUMING_MAP);
writer.attr(ATTR_ACTIVITYKEY, (String)consumingMap.get(ATTR_ACTIVITYKEY));
writer.attr(ATTR_JAR_TIME, (String)consumingMap.get(ATTR_JAR_TIME));
writer.attr(ATTR_CREATE_TIME, (String)consumingMap.get(ATTR_CREATE_TIME));
writer.attr(ATTR_UUID, (String)consumingMap.get(ATTR_UUID));
writer.attr(ATTR_TIME_CONSUME, (long)consumingMap.get(ATTR_TIME_CONSUME));
writer.attr(ATTR_VERSION, (String)consumingMap.get(ATTR_VERSION));
writer.attr(ATTR_USERNAME, (String)consumingMap.get(ATTR_USERNAME));
writer.end();
}
public void readXML(XMLableReader reader) {
if (!reader.isChildNode()) {
dayCount = reader.getAttrAsInt(ATTR_DAY_COUNT, 0);
templateID = reader.getAttrAsString(ATTR_TEMPLATE_ID, StringUtils.EMPTY);
} else {
try {
String name = reader.getTagName();
if (XML_PROCESS_MAP.equals(name)) {
processMap.put(ATTR_PROCESS, reader.getAttrAsString(ATTR_PROCESS, StringUtils.EMPTY));
processMap.put(ATTR_FLOAT_COUNT, reader.getAttrAsInt(ATTR_FLOAT_COUNT, 0));
processMap.put(ATTR_WIDGET_COUNT, reader.getAttrAsInt(ATTR_WIDGET_COUNT, 0));
processMap.put(ATTR_CELL_COUNT, reader.getAttrAsInt(ATTR_CELL_COUNT, 0));
processMap.put(ATTR_BLOCK_COUNT, reader.getAttrAsInt(ATTR_BLOCK_COUNT, 0));
processMap.put(ATTR_REPORT_TYPE, reader.getAttrAsInt(ATTR_REPORT_TYPE, 0));
processMap.put(ATTR_TEMPLATE_ID, templateID);
} else if(XML_CONSUMING_MAP.equals(name)){
consumingMap.put(ATTR_ACTIVITYKEY, reader.getAttrAsString(ATTR_ACTIVITYKEY, StringUtils.EMPTY));
consumingMap.put(ATTR_JAR_TIME, reader.getAttrAsString(ATTR_JAR_TIME, StringUtils.EMPTY));
consumingMap.put(ATTR_CREATE_TIME, reader.getAttrAsString(ATTR_CREATE_TIME, StringUtils.EMPTY));
consumingMap.put(ATTR_TEMPLATE_ID, templateID);
consumingMap.put(ATTR_UUID, reader.getAttrAsString(ATTR_UUID, StringUtils.EMPTY));
consumingMap.put(ATTR_TIME_CONSUME, reader.getAttrAsLong(ATTR_TIME_CONSUME, 0));
consumingMap.put(ATTR_VERSION, reader.getAttrAsString(ATTR_VERSION, "8.0"));
consumingMap.put(ATTR_USERNAME, reader.getAttrAsString(ATTR_USERNAME, StringUtils.EMPTY));
}
} catch (Exception ex) {
// 什么也不做,使用默认值
}
}
}
}
public static void main(String[] args) {
TemplateInfoCollector tic = TemplateInfoCollector.getInstance();
tic.sendTemplateInfo();

3
designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java

@ -84,6 +84,9 @@ public class ColorSelectConfigManager extends XMLFileManager implements ColorSel
* @param color 颜色
*/
public void addToColorQueue(Color color) {
if(color == null){
return;
}
// 过滤重复的最近使用颜色
// 因为有个后进先出的问题,最近使用的颜色需要放到最前面所以没用set
if (colors.contains(color)) {

26
designer_base/src/com/fr/design/style/color/ColorSelectDetailPane.java

@ -1,24 +1,20 @@
package com.fr.design.style.color;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import javax.swing.JColorChooser;
import javax.swing.JPanel;
import javax.swing.*;
import javax.swing.colorchooser.AbstractColorChooserPanel;
import javax.swing.colorchooser.ColorSelectionModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import java.awt.*;
/**
* 颜色选择器更多颜色面板
* @author focus
*
* @author focus
*/
public class ColorSelectDetailPane extends BasicPane {
private static final int SELECT_PANEL_HEIGHT = 245;
@ -26,13 +22,13 @@ public class ColorSelectDetailPane extends BasicPane{
private Color color;
// 颜色选择器面板
JColorChooser selectedPanel;
private JColorChooser selectedPanel;
// 最近使用颜色面板
JPanel recentUsePanel;
private JPanel recentUsePanel;
// 预览
JPanel previewPanel;
private JPanel previewPanel;
public JColorChooser getSelectedPanel() {
return selectedPanel;
@ -50,10 +46,6 @@ public class ColorSelectDetailPane extends BasicPane{
this.color = color;
}
public ColorSelectDetailPane() {
super();
}
public ColorSelectDetailPane(Color color) {
if (color == null) {
color = Color.white;

39
designer_base/src/com/fr/design/style/color/ColorSelectPane.java

@ -3,26 +3,23 @@
*/
package com.fr.design.style.color;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.Inter;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
/**
* The pane used to select color
@ -34,7 +31,8 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
//color setting action.
private ArrayList<ChangeListener> colorChangeListenerList = new ArrayList<ChangeListener>();
ColorSelectDetailPane pane;
/* default */ ColorSelectDetailPane pane;
/**
* Constructor.
@ -104,14 +102,14 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
return menuColorPane;
}
// 第一行,1个取色按钮 + 7个最近使用的颜色
// 第一行,1个取色按钮 + 1个留空的单元格 + 6个最近使用的颜色
protected JPanel getRow1Pane() {
JPanel row1Pane = new JPanel(FRGUIPaneFactory.createBorderLayout());
row1Pane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 0));
row1Pane.setPreferredSize(new Dimension(135, 24)); // 宽度为 16 * 8 + 7
// 最近使用
UsedColorPane usedColorPane = new UsedColorPane(1, 8, 1, ColorSelectConfigManager.getInstance().getColors(), this, true, true);
UsedColorPane usedColorPane = new UsedColorPane(1, 8, 1, this, true, true);
usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8));
row1Pane.add(usedColorPane.getPane());
return row1Pane;
@ -125,7 +123,8 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
/**
* Add change listener.
* 增加监听
* @param 监听
*
* @param changeListener
*/
public void addChangeListener(ChangeListener changeListener) {
this.colorChangeListenerList.add(changeListener);
@ -166,8 +165,6 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
/**
* 选中颜色
* @param 颜色单元格
*
*/
@Override
public void colorSetted(ColorCell colorCell) {
@ -176,8 +173,8 @@ public class ColorSelectPane extends TransparentPane implements ColorSelectable
/**
* 初始化中央面板
* @param centerPane 中央面板
*
* @param centerPane 中央面板
*/
@Override
public void initCenterPaneChildren(JPanel centerPane) {

50
designer_base/src/com/fr/design/style/color/NewColorSelectPane.java

@ -1,33 +1,25 @@
package com.fr.design.style.color;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.design.constants.UIConstants;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
/**
*
* @author zhou
* @since 2012-5-29上午10:39:35
*/
@ -47,7 +39,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
private final static int WINDWO_HEIGHT = 150;
// 最近使用颜色
UsedColorPane usedColorPane;
private UsedColorPane usedColorPane;
/**
* Constructor.
@ -85,7 +77,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
row1Pane.setPreferredSize(new Dimension(135, 16)); // 宽度为 16 * 8 + 7
centerPane.add(row1Pane);
// 最近使用
usedColorPane = new UsedColorPane(1, 8, 1, ColorSelectConfigManager.getInstance().getColors(), this, true, false);
usedColorPane = new UsedColorPane(1, 8, 1, this, true, false);
usedColorPane.getPane().setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8));
row1Pane.add(usedColorPane.getPane());
@ -102,7 +94,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
// mod by anchore 16/11/16
UIButton customButton = new UIButton(Inter.getLocText("FR-Designer-Basic_More_Color"));
//UIButton customButton = new UIButton(Inter.getLocText(new String[]{"More", "Color"}) + "...");
customButton.addMouseListener(new MouseAdapter() {
@Override
@ -118,11 +109,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
}
/**
* 添加监听
* @param 监听列表
* Add change listener.
*
* @param 监听列表 Add change listener.
*/
public void addChangeListener(ChangeListener changeListener) {
this.colorChangeListenerList.add(changeListener);
@ -135,6 +125,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
/**
* 获取颜色
*
* @return 颜色
* Return the color.
*/
@ -158,8 +149,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
/**
* Set the color.
*
* @param color
* the new color.
* @param color the new color.
*/
@Override
public void setColor(Color color) {
@ -179,6 +169,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
/**
* 设置颜色
*
* @param 颜色位置
*/
@Override
@ -189,6 +180,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
protected void doTransparent() {
setColor(null);
}
protected void customButtonPressed() {
pane = new ColorSelectDetailPane(Color.WHITE);
ColorSelectDialog.showDialog(DesignerContext.getDesignerFrame(), pane, Color.WHITE, this);
@ -204,12 +196,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
/**
* 更新最近使用颜色
*
*/
public void updateUsedColor() {
usedColorPane.updateUsedColor();
}
}

17
designer_base/src/com/fr/design/style/color/RecentUseColorPane.java

@ -1,25 +1,20 @@
package com.fr.design.style.color;
import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.JColorChooser;
import javax.swing.JPanel;
import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.*;
import java.awt.*;
public class RecentUseColorPane extends BasicPane implements ColorSelectable {
JColorChooser chooser;
private JColorChooser chooser;
@Override
protected String title4PopupWindow() {
return null;
}
public RecentUseColorPane() {
}
public RecentUseColorPane(JColorChooser chooser) {
this.chooser = chooser;
@ -28,14 +23,12 @@ public class RecentUseColorPane extends BasicPane implements ColorSelectable{
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(centerPane, BorderLayout.CENTER);
// 最近使用
UsedColorPane pane = new UsedColorPane(2, 10, ColorSelectConfigManager.getInstance().getColors(),this);
UsedColorPane pane = new UsedColorPane(2, 10, this);
centerPane.add(pane.getPane());
}
/**
* 选中颜色
*
* @param 颜色
*/
@Override
public void colorSetted(ColorCell color) {

29
designer_base/src/com/fr/design/style/color/UsedColorPane.java

@ -1,16 +1,14 @@
package com.fr.design.style.color;
import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.SpecialUIButton;
import javax.swing.*;
import java.awt.*;
public class UsedColorPane extends BasicPane {
// 默认显示颜色
public static final Color DEFAULT_COLOR = new Color(222, 222, 222);
// 最近使用面板列数
@ -23,8 +21,7 @@ public class UsedColorPane extends BasicPane{
private boolean needPickColorButton;
// 是否在取色时实时设定颜色
private boolean setColorRealTime;
// 最近使用颜色
private Object[] colors;
// 最近使用面板
private JPanel pane;
@ -38,9 +35,6 @@ public class UsedColorPane extends BasicPane{
this.pane = pane;
}
public UsedColorPane(){
}
/**
* 构造函数
@ -52,19 +46,18 @@ public class UsedColorPane extends BasicPane{
* @param needPickColorButton 是否需要加上取色器按钮
* @param setColorRealTime 取色器是否实时设定颜色
*/
public UsedColorPane(int rows,int columns,int reserveCells, Object[] colors, ColorSelectable selectable, boolean needPickColorButton, boolean setColorRealTime){
public UsedColorPane(int rows, int columns, int reserveCells, ColorSelectable selectable, boolean needPickColorButton, boolean setColorRealTime) {
this.columns = columns;
this.rows = rows;
this.reserveCells = reserveCells;
this.colors = colors;
this.selectable = selectable;
this.needPickColorButton = needPickColorButton;
this.setColorRealTime = setColorRealTime;
initialComponents();
}
public UsedColorPane(int rows,int columns, Object[] colors,ColorSelectable selectable){
this(rows, columns, 0, colors, selectable, false, false);
public UsedColorPane(int rows, int columns, ColorSelectable selectable) {
this(rows, columns, 0, selectable, false, false);
}
private void initialComponents() {
@ -72,6 +65,7 @@ public class UsedColorPane extends BasicPane{
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(rows, columns, 1, 1));
panel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
//最近使用颜色
Color[] colors = ColorSelectConfigManager.getInstance().getColors();
int size = colors.length;
@ -90,7 +84,7 @@ public class UsedColorPane extends BasicPane{
i++;
}
while (i < total) {
Color color = i < size ? colors[size-1-i]: DEFAULT_COLOR;
Color color = i < size ? colors[size - (i - this.reserveCells) - 1] : DEFAULT_COLOR;
panel.add(new ColorCell(color == null ? DEFAULT_COLOR : color, selectable));
i++;
}
@ -99,7 +93,6 @@ public class UsedColorPane extends BasicPane{
/**
* 更新最近使用颜色
*
*/
public void updateUsedColor() {
int total = columns * rows;
@ -107,7 +100,7 @@ public class UsedColorPane extends BasicPane{
int size = colors.length;
for (int i = this.reserveCells; i < total; i++) {
ColorCell cell = (ColorCell) this.pane.getComponent(i);
Color color = i < size ? colors[size-1-i]: DEFAULT_COLOR;
Color color = i < size ? colors[size - (i - this.reserveCells) - 1] : DEFAULT_COLOR;
cell.setColor(color == null ? DEFAULT_COLOR : color);
}
}

2
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -39,6 +39,7 @@ public class MinMaxValuePane extends JPanel {
mainUnitField = new UITextField(6);
isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit"));
secUnitField = new UITextField(6);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
@ -53,6 +54,7 @@ public class MinMaxValuePane extends JPanel {
protected double[] getRowSize(double p) {
return new double[]{p, p, p, p};
}
protected void addComponentListener(Component[][] components) {
for (int i = 0; i < components.length; i++) {
addListener((UICheckBox) components[i][0]);

6
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

@ -77,9 +77,8 @@ public class ChartTextAttrPane extends BasicPane {
public void populate(FRFont frFont) {
UIObserverListener listener = fontNameComboBox == null ? null : fontNameComboBox.getUiObserverListener();
removeAllComboBoxListener();
if (frFont == null) {
return;
}
if (frFont != null) {
fontNameComboBox.setSelectedItem(frFont.getFamily());
bold.setSelected(frFont.isBold());
italic.setSelected(frFont.isItalic());
@ -89,6 +88,7 @@ public class ChartTextAttrPane extends BasicPane {
if (fontColor != null) {
fontColor.setColor(frFont.getForeground());
}
}
//更新结束后,注册监听器
registerAllComboBoxListener(listener);

7
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java

@ -41,7 +41,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/**
* 是否能在指定位置添加组件
*
* @param creator 组件
* @param x 坐标x
* @param y 坐标y
@ -67,7 +66,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
creator.setBounds(rec);
return false;
}
//判断组件能不能拖入绝对布局
//判断下组件能不能拖入绝对布局
if (!creator.canEnterIntoAbsolutePane()){
return false;
}
@ -120,7 +119,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/**
* 判断是否鼠标在组件的三等分区域如果组件在布局管理器中间上下左右都可能会三等分
*
* @param parentComp 鼠标所在区域的组件
* @param x 坐标x
* @param y 坐标y
@ -270,7 +268,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/**
* 新拖入组件时计算调整其他关联组件位置大小
*
* @param child 新拖入的组件
* @param x 鼠标所在x坐标
* @param y 鼠标所在y坐标
@ -295,7 +292,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/**
* 组件拖拽后调整大小
*
* @param creator 组件
*/
@Override
@ -310,7 +306,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
/**
* 调整组件大小到合适尺寸位置
*
* @param creator 组件
* @param x 坐标x
* @param y 坐标y

6
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -16,14 +16,12 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.designer.properties.FRFitLayoutConstraints;
import com.fr.design.designer.properties.FRFitLayoutPropertiesGroupModel;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.JForm;
import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.general.ComparatorUtils;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import java.awt.*;
import java.util.ArrayList;
@ -1013,7 +1011,7 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
setAdjustedSize(tabLayout, offset, isHor);
for (int m = 0; m < tabLayout.getComponentCount(); m++) {
XCreator childCreator = tabLayout.getXCreator(m);
BoundsWidget wgt = (BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData());
WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData());
wgt.setBounds(tabLayout.getComponent(m).getBounds());
}
adjustCreatorsSize(percent, tabLayout, isHor);

3
designer_form/src/com/fr/design/designer/beans/location/AccessDirection.java

@ -11,6 +11,7 @@ import com.fr.design.mainframe.FormSelection;
import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WParameterLayout;
import java.awt.*;
@ -182,7 +183,6 @@ public abstract class AccessDirection implements Direction {
/**
* 更新鼠标指针形状
*
* @param formEditor 设计界面组件
*/
public void updateCursor(FormDesigner formEditor) {
@ -198,7 +198,6 @@ public abstract class AccessDirection implements Direction {
/**
* 生成组件备用的bound
*
* @param formEditor 设计界面组件
*/
public void backupBounds(FormDesigner formEditor) {

6
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -10,11 +10,9 @@ import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.*;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider;
import com.fr.form.FormProvider;
@ -104,7 +102,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setI18NName(Inter.getLocText("FR-Layout_Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class)
new CRPropertyDescriptor("toolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class)
.setI18NName(Inter.getLocText("Form-EC_toolbar"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
};

44
designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -3,14 +3,6 @@
*/
package com.fr.design.designer.creator;
import java.awt.*;
import java.awt.event.ContainerEvent;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.HashMap;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.LayoutAdapter;
@ -20,16 +12,26 @@ import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.form.layout.FRAbsoluteLayout;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.mainframe.*;
import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.Connector;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WLayout;
import com.fr.general.FRScreen;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import java.awt.*;
import java.awt.event.ContainerEvent;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.HashMap;
/**
* @author richer
* @since 6.5.3
@ -88,6 +90,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 返回容器大小的百分比
*
* @return the containerPercent
*/
public double getContainerPercent() {
@ -96,6 +99,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 设置容器大小的百分比
*
* @param containerPercent the containerPercent to set
*/
public void setContainerPercent(double containerPercent) {
@ -106,6 +110,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 返回界面处根据百分比调整后的最小宽度
*
* @return 最小宽度
*/
public int getActualMinWidth() {
@ -114,6 +119,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 返回界面处根据百分比调整后的最小高度
*
* @return 最小高度
*/
public int getActualMinHeight() {
@ -122,6 +128,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 返回界面处根据百分比调整后的间隔大小且为偶数
*
* @return 间隔
*/
public int getAcualInterval() {
@ -164,7 +171,8 @@ public class XWAbsoluteLayout extends XLayoutContainer {
tabLayout.updateBoundsWidget();
}
}
BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); Rectangle rectangle = dealWidgetBound(xCreator.getBounds());
BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData());
Rectangle rectangle = dealWidgetBound(xCreator.getBounds());
}
private Rectangle calculateBound(Rectangle rec, double pw, double ph) {
@ -207,6 +215,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
* 更新子组件的Bound
* 这边主要用于绝对布局子组件在适应区域选项时
* 涉及到的不同分辨率下缩放
*
* @param minHeight 最小高度
*/
@Override
@ -231,6 +240,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 增加对齐线
*
* @param connector 对齐线
*/
public void addConnector(Connector connector) {
@ -244,6 +254,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 去除对齐线
*
* @param connector 对齐线
*/
public void removeConnector(Connector connector) {
@ -253,6 +264,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 返回对应的widget容器
*
* @return 返回WAbsoluteLayout
*/
@Override
@ -267,6 +279,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 返回默认的容器name
*
* @return 返回绝对布局容器名
*/
@Override
@ -324,6 +337,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 当前组件zorder位置替换新的控件
*
* @param widget 控件
* @param oldcreator 旧组件
* @return 组件
@ -342,6 +356,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 组件增加
*
* @param e 容器事件
*/
@Override
@ -359,6 +374,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* 在设计界面中有组件移除的时候需要通知WLayout容器重新paint
*
* @param e 容器事件
*/
@Override
@ -388,14 +404,14 @@ public class XWAbsoluteLayout extends XLayoutContainer {
XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout();
if (xTopLayout != null && !xTopLayout.isEditable()) {
return xTopLayout;
}
else{
} else {
return this;
}
}
/**
* 得到属性名
*
* @return 属性名
* @throws java.beans.IntrospectionException
*/
@ -468,6 +484,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* body大小手动调整的时候
* 按照比例调整组件的宽度
*
* @param percent 比例
*/
@Override
@ -484,6 +501,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
/**
* body大小手动调整的时候
* 按照比例调整组件的高度
*
* @param percent 比例
*/
@Override

2
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java

@ -14,7 +14,7 @@ public class TabMoveEndAction extends TabMoveAction {
public TabMoveEndAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t, xCardSwitchButton);
this.setName(Inter.getLocText("FR-Designer-Move_Tab_End"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/rightright.png"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/tab/end.png"));
}
//改变Tab的索引号

2
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java

@ -14,7 +14,7 @@ public class TabMoveFirstAction extends TabMoveAction {
public TabMoveFirstAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t, xCardSwitchButton);
this.setName(Inter.getLocText("FR-Designer-Move_Tab_First"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/leftleft.png"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/tab/first.png"));
}
@Override

2
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java

@ -14,7 +14,7 @@ public class TabMoveNextAction extends TabMoveAction {
public TabMoveNextAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t, xCardSwitchButton);
this.setName(Inter.getLocText("FR-Designer-Move_Tab_Next"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/right.png"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/tab/next.png"));
}
@Override

2
designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java

@ -14,7 +14,7 @@ public class TabMovePrevAction extends TabMoveAction {
public TabMovePrevAction(FormDesigner t, XCardSwitchButton xCardSwitchButton) {
super(t, xCardSwitchButton);
this.setName(Inter.getLocText("FR-Designer-Move_Tab_Prev"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/left.png"));
this.setSmallIcon(IOUtils.readIcon("com/fr/design/images/control/tab/prev.png"));
}
@Override

10
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -3,10 +3,6 @@
*/
package com.fr.design.designer.creator.cardlayout;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.models.SelectionModel;
@ -17,12 +13,18 @@ import com.fr.design.designer.creator.XWBorderLayout;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.general.IOUtils;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.general.Inter;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
/**
* card布局主体框架
*

17
designer_form/src/com/fr/design/mainframe/ComponentTree.java

@ -1,21 +1,14 @@
package com.fr.design.mainframe;
import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.DropMode;
import javax.swing.JPopupMenu;
import javax.swing.JTree;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.*;
import com.fr.design.designer.treeview.ComponentTreeCellRenderer;
import com.fr.design.designer.treeview.ComponentTreeModel;
@ -92,9 +85,9 @@ public class ComponentTree extends JTree {
}
}
public void setAndScrollSelectionPath(TreePath treepath) {
setSelectionPath(treepath);
scrollPathToVisible(treepath);
public void setAndScrollSelectionPath(TreePath[] treepath) {
setSelectionPaths(treepath);
scrollPathToVisible(treepath[0]);
}
@ -112,7 +105,6 @@ public class ComponentTree extends JTree {
public TreePath[] getSelectedTreePath() {
XCreator[] creators = designer.getSelectionModel().getSelection().getSelectedCreators();
TreePath[] paths = new TreePath[creators.length];
for (int i = 0; i < paths.length; i++) {
paths[i] = buildTreePath(creators[i]);
}
@ -141,7 +133,7 @@ public class ComponentTree extends JTree {
paths[i] = buildTreePath(searchList.get(i));
}
if(paths.length > 0) {
setAndScrollSelectionPath(paths[0]);
setAndScrollSelectionPath(paths);
} else {
setSelectionPath();
}
@ -217,4 +209,5 @@ public class ComponentTree extends JTree {
Object[] components = path.toArray();
return new TreePath(components);
}
}

1
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -1018,7 +1018,6 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
}
if (!BaseUtils.isAuthorityEditing()) {
selectionModel.setSelectedCreators(selected);
TreePath path = e.getNewLeadSelectionPath();

5
designer_form/src/com/fr/design/mainframe/FormSelectionUtils.java

@ -25,7 +25,6 @@ public class FormSelectionUtils {
//组件重命名后缀
private static final String POSTFIX = "_c";
private FormSelectionUtils() {
}
@ -134,8 +133,10 @@ public class FormSelectionUtils {
boolean xOut = x < 0 || x + copiedCreator.getWidth() / 2 + xoffset > container.getWidth();
boolean yOut = y < 0 || y + copiedCreator.getHeight() / 2 + yoffset > container.getHeight();
boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset)
&& (y - DELAY_X_Y == container.getHeight() - copiedCreator.getHeight() / 2 - yoffset);
y = yOut ? container.getHeight() - copiedCreator.getHeight() / 2 - yoffset : y;
boolean isEdge = (x - DELAY_X_Y == container.getWidth() - copiedCreator.getWidth() / 2 - xoffset);
if (xOut) {
if (isEdge) {
//向左偏移

7
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -259,8 +259,11 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
xCreator = designer.getRootComponent();
}
XLayoutContainer container = XCreatorUtils.getHotspotContainer(xCreator);
//TODO container可能为空,引发空指针异常
return xCreator.acceptType(XWParameterLayout.class) || container.acceptType(XWParameterLayout.class);
boolean xCreatorAccept = xCreator.acceptType(XWParameterLayout.class);
boolean containerAccept = container!=null && container.acceptType(XWParameterLayout.class);
return xCreatorAccept || containerAccept;
}
public void setEditingFormDesigner(BaseFormDesigner editor) {

2
designer_form/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java

@ -35,8 +35,6 @@ public class JFormProcessInfo extends TemplateProcessInfo<Form> {
WLayout wl = (WLayout) template.getContainer().getWidget(i);
widgetCount += wl.getWidgetCount();
}
int a = 1;
int b = 2;
return widgetCount;
}
}

7
designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -65,7 +65,6 @@ public class UITreeComboBox extends JComboBox{
* @param o Object
*/
public void setSelectedItem(Object o){
tree.setSelectionPath((TreePath)o);
getModel().setSelectedItem(o);
}
@ -110,7 +109,7 @@ public class UITreeComboBox extends JComboBox{
int index, boolean isSelected, boolean cellHasFocus){
if(tree != null && tree.getSelectedTreePath().length > 0){
TreePath path = tree.getSelectedTreePath()[0];
tree.setAndScrollSelectionPath(path);
tree.setAndScrollSelectionPath(tree.getSelectedTreePath());
Object node = path.getLastPathComponent();
value = node;
TreeCellRenderer r = tree.getCellRenderer();
@ -132,7 +131,7 @@ public class UITreeComboBox extends JComboBox{
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
TreePath[] paths = tree.getSelectedTreePath();
if (tree != null && paths.length > 0) {
tree.setAndScrollSelectionPath(paths[0]);
tree.setAndScrollSelectionPath(paths);
setSelectedItem(paths[0]);
MenuSelectionManager.defaultManager().clearSelectedPath();
}
@ -141,7 +140,7 @@ public class UITreeComboBox extends JComboBox{
tree.refreshUI();
TreePath[] paths = tree.getSelectedTreePath();
if (tree != null && paths.length > 0) {
tree.setAndScrollSelectionPath(paths[0]);
tree.setAndScrollSelectionPath(paths);
setSelectedItem(paths[0]);
MenuSelectionManager.defaultManager().clearSelectedPath();
}

Loading…
Cancel
Save