plough 8 years ago
parent
commit
860bfde6bc
  1. 1
      .gitignore
  2. 16
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  3. 345
      designer_base/src/com/fr/design/actions/server/ConnectionListAction.java
  4. 266
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java
  5. 324
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionListPane.java
  6. 155
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionManagerPane.java
  7. 15
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionShowPane.java
  8. 13
      designer_base/src/com/fr/design/formula/VariableResolverAdapter.java
  9. 52
      designer_base/src/com/fr/design/gui/style/BorderPane.java
  10. BIN
      designer_base/src/com/fr/design/images/control/tab/end.png
  11. BIN
      designer_base/src/com/fr/design/images/control/tab/end_not.png
  12. BIN
      designer_base/src/com/fr/design/images/control/tab/first.png
  13. BIN
      designer_base/src/com/fr/design/images/control/tab/first_not.png
  14. BIN
      designer_base/src/com/fr/design/images/control/tab/next.png
  15. BIN
      designer_base/src/com/fr/design/images/control/tab/next_not.png
  16. BIN
      designer_base/src/com/fr/design/images/control/tab/prev.png
  17. BIN
      designer_base/src/com/fr/design/images/control/tab/prev_not.png
  18. 4
      designer_base/src/com/fr/design/locale/designer.properties
  19. 4
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  20. 6
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  21. 6
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  22. 6
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  23. 6
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  24. 15
      designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java
  25. 2
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java
  26. 31
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  27. 156
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  28. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveEndAction.java
  29. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveFirstAction.java
  30. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMoveNextAction.java
  31. 2
      designer_form/src/com/fr/design/designer/creator/cardlayout/TabMovePrevAction.java
  32. 10
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  33. 17
      designer_form/src/com/fr/design/mainframe/ComponentTree.java
  34. 1
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  35. 7
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  36. 7
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

1
.gitignore vendored

@ -3,5 +3,6 @@ designer_base/bin
designer_chart/bin
designer_form/bin
*.iml
designer_base/src/com/fr/design/locale/.idea

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) {

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

@ -1,171 +1,176 @@
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.ModifiedTable;
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.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.util.HashMap;
/**
* DatasourceList Action
*/
public class ConnectionListAction extends UpdateAction {
private static final int BYTENUM = 1444;
public ConnectionListAction() {
this.setMenuKeySet(DEFINE_DATA_CONNECTION);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/connection.png"));
}
public static final MenuKeySet DEFINE_DATA_CONNECTION = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'D';
}
@Override
public String getMenuName() {
return Inter.getLocText("Server-Define_Data_Connection");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
/**
* 执行动作
*
* @param evt 事件
*/
public void actionPerformed(ActionEvent evt) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() {
public void complete() {
populate(datasourceManager);
}
protected void renameConnection(String oldName, String newName) {
datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName);
}
};
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
if (!doWithDatasourceManager(datasourceManager, backupManager, databaseManagerPane, databaseListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
writeFile(datasourceManager);
}
public void doCancel() {
datasourceManager.synchronizedWithServer();
}
});
databaseListDialog.setVisible(true);
}
private void writeFile(DatasourceManagerProvider datasourceManager) {
Env currentEnv = FRContext.getCurrentEnv();
try {
boolean isSuccess = currentEnv.writeResource(datasourceManager);
if (!isSuccess) {
throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist"));
}
} catch (Exception e) {
throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist"));
}
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
/**
* 是否正常更新完datasourceManager
*
* @param datasourceManager
* @param databaseManagerPane
* @return
*/
private boolean doWithDatasourceManager(DatasourceManagerProvider datasourceManager, DatasourceManager backupManager,
ConnectionManagerPane databaseManagerPane, BasicDialog databaseListDialog) {
databaseManagerPane.update(datasourceManager);
HashMap<String, Connection> modifyDetails = datasourceManager.getConnectionModifyDetails();
modifyDetails.clear();
Env currentEnv = FRContext.getCurrentEnv();
ModifiedTable localModifiedTable = datasourceManager.checkConnectionModifyTable(backupManager, currentEnv.getUserID());
boolean isFailed = false;
if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) {
//如果是本地,并且有远程用户时则更新自己的修改表
datasourceManager.updateSelfConnectionTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER);
} else {
if (!currentEnv.isSupportLocalFileOperate()) {
//如果是远程,则去取服务器的最新的修改表,检查有没有冲突
ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.CONNECTION);
if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) {
//有冲突,进行提示
String title = Inter.getLocText(new String[]{"Select", "Single", "Setting"});
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), localModifiedTable.getWaringMessage(), title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION) {
//点击是,进行相应刷新去冲突
datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.CONNECTION);
//要是有重命名冲突的,则对详细的修改表先进行修改
datasourceManager.doWithConnectionConflict(localModifiedTable);
localModifiedTable.removeConfilct();
modifyDetails.clear();
//更新面板
databaseManagerPane.populate(datasourceManager);
} else {
//更新失败,继续停留页面
isFailed = true;
}
}
}
}
//存在请重命名则不能更新
int index = datasourceManager.isConnectionMapContainsRename();
if (index != -1) {
isFailed = true;
databaseManagerPane.setSelectedIndex(index);
}
databaseListDialog.setDoOKSucceed(!isFailed);
//如果修改成功,则去远程端增量修改修改表
if (!isFailed && !currentEnv.isSupportLocalFileOperate()) {
currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.CONNECTION);
localModifiedTable.clear();
modifyDetails.clear();
}
return !isFailed;
}
public void update() {
this.setEnabled(true);
}
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.base.ModifiedTable;
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;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.util.HashMap;
/**
* DatasourceList Action
*/
public class ConnectionListAction extends UpdateAction {
public ConnectionListAction() {
this.setMenuKeySet(DEFINE_DATA_CONNECTION);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/connection.png"));
}
public static final MenuKeySet DEFINE_DATA_CONNECTION = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'D';
}
@Override
public String getMenuName() {
return Inter.getLocText("Server-Define_Data_Connection");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
/**
* 执行动作
*
* @param evt 事件
*/
public void actionPerformed(ActionEvent evt) {
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
final ConnectionManagerPane databaseManagerPane = new ConnectionManagerPane() {
public void complete() {
populate(datasourceManager);
}
protected void renameConnection(String oldName, String newName) {
datasourceManager.getConnectionLocalModifyTable().rename(oldName, newName);
}
};
final BasicDialog databaseListDialog = databaseManagerPane.showLargeWindow(designerFrame, null);
databaseListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
if (!databaseManagerPane.isNamePermitted()) {
databaseListDialog.setDoOKSucceed(false);
return;
}
if (!doWithDatasourceManager(datasourceManager, backupManager, databaseManagerPane, databaseListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
writeFile(datasourceManager);
}
public void doCancel() {
datasourceManager.synchronizedWithServer();
}
});
databaseListDialog.setVisible(true);
}
/**
* @param datasourceManager
*/
public static void writeFile(DatasourceManagerProvider datasourceManager) {
Env currentEnv = FRContext.getCurrentEnv();
try {
boolean isSuccess = currentEnv.writeResource(datasourceManager);
if (!isSuccess) {
throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist"));
}
} catch (Exception e) {
throw new RuntimeException(Inter.getLocText("FR-Designer_Already_exist"));
}
DesignerContext.getDesignerBean("databasename").refreshBeanElement();
}
/**
* 更新datasourceManager
*
* @param datasourceManager datasource管理对象
* @param backupManager datasource管理对象备份
* @param connectionShowPane datasource面板
* @param databaseListDialog datasource管理对话框
* @return boolean 是否更新成功
*/
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();
ModifiedTable localModifiedTable = datasourceManager.checkConnectionModifyTable(backupManager, currentEnv.getUserID());
boolean isFailed = false;
if (currentEnv.isSupportLocalFileOperate() && !((LocalEnv) currentEnv).isNoRemoteUser()) {
//如果是本地,并且有远程用户时则更新自己的修改表
datasourceManager.updateSelfConnectionTotalModifiedTable(localModifiedTable, ModifiedTable.LOCAL_MODIFIER);
} else {
if (!currentEnv.isSupportLocalFileOperate()) {
//如果是远程,则去取服务器的最新的修改表,检查有没有冲突
ModifiedTable currentServerModifyTable = currentEnv.getDataSourceModifiedTables(DatasourceManager.CONNECTION);
if (localModifiedTable.checkModifiedTableConflictWithServer(currentServerModifyTable, currentEnv.getUserID())) {
//有冲突,进行提示
String title = Inter.getLocText(new String[]{"Select", "Single", "Setting"});
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), localModifiedTable.getWaringMessage(), title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION) {
//点击是,进行相应刷新去冲突
datasourceManager.synchronizedWithServer(backupManager, DatasourceManager.CONNECTION);
//要是有重命名冲突的,则对详细的修改表先进行修改
datasourceManager.doWithConnectionConflict(localModifiedTable);
localModifiedTable.removeConfilct();
modifyDetails.clear();
//更新面板
connectionShowPane.populate(datasourceManager);
} else {
//更新失败,继续停留页面
isFailed = true;
}
}
}
}
//存在请重命名则不能更新
int index = datasourceManager.isConnectionMapContainsRename();
if (index != -1) {
isFailed = true;
connectionShowPane.setSelectedIndex(index);
}
databaseListDialog.setDoOKSucceed(!isFailed);
//如果修改成功,则去远程端增量修改修改表
if (!isFailed && !currentEnv.isSupportLocalFileOperate()) {
currentEnv.writeDataSourceModifiedTables(localModifiedTable, DatasourceManager.CONNECTION);
localModifiedTable.clear();
modifyDetails.clear();
}
return !isFailed;
}
public void update() {
this.setEnabled(true);
}
}

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

@ -1,128 +1,140 @@
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.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
/**
* 选择数据连接的下拉框
*
* @editor zhou
* @since 2012-3-28下午3:02:30
*/
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>();
public ConnectionComboBoxPanel(Class<? extends Connection> cls) {
super();
this.cls = cls;
// alex:添加item change监听,当改变时改变DesignerEnvManager中的最近选中的数据连接
this.itemComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
String selected = ConnectionComboBoxPanel.this.getSelectedItem();
if (StringUtils.isNotBlank(selected)) {
DesignerEnvManager.getEnvManager().setRecentSelectedConnection(selected);
}
}
});
refreshItems();
}
/*
* 刷新ComboBox.items
*/
protected java.util.Iterator<String> items() {
nameList = new ArrayList<String>();
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance();
java.util.Iterator<String> nameIt = mgr.getConnectionNameIterator();
while (nameIt.hasNext()) {
String conName = nameIt.next();
Connection connection = mgr.getConnection(conName);
filterConnection(connection, conName, nameList);
}
return nameList.iterator();
}
protected void filterConnection(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{AbstractDatabaseConnection.class});
}
public int getConnectionSize() {
return nameList.size();
}
public String getConnection(int i) {
return nameList.get(i);
}
/*
* 弹出对话框编辑Items
*/
protected void editItems() {
final ConnectionListPane connectionListPane = new ConnectionListPane();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
connectionListPane.populate(datasourceManager);
BasicDialog connectionListDialog = connectionListPane.showLargeWindow(
SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), new DialogActionAdapter() {
public void doOk() {
connectionListPane.update(datasourceManager);
// marks:保存数据
Env currentEnv = FRContext.getCurrentEnv();
try {
currentEnv.writeResource(datasourceManager);
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
}
}
});
connectionListDialog.setVisible(true);
refreshItems();
}
public void populate(com.fr.data.impl.Connection connection) {
editButton.setEnabled(FRContext.getCurrentEnv().isRoot());
if (connection instanceof NameDatabaseConnection) {
this.setSelectedItem(((NameDatabaseConnection) connection).getName());
} else {
String s = DesignerEnvManager.getEnvManager().getRecentSelectedConnection();
if (StringUtils.isNotBlank(s)) {
for (int i = 0; i < this.getConnectionSize(); i++) {
String t = this.getConnection(i);
if (ComparatorUtils.equals(s, t)) {
this.setSelectedItem(s);
break;
}
}
}
// alex:如果这个ComboBox还是没有选中,那么选中第一个
if (StringUtils.isBlank(this.getSelectedItem()) && this.getConnectionSize() > 0) {
this.setSelectedItem(this.getConnection(0));
}
}
}
package com.fr.design.data.datapane.connect;
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;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
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;
/**
* 选择数据连接的下拉框
*
* @editor zhou
* @since 2012-3-28下午3:02:30
*/
public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
private Class<? extends Connection> cls; // 所取的Connection都是cls及其子类
private List<String> nameList = new ArrayList<String>();
public ConnectionComboBoxPanel(Class<? extends Connection> cls) {
super();
this.cls = cls;
// alex:添加item change监听,当改变时改变DesignerEnvManager中的最近选中的数据连接
this.itemComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
String selected = ConnectionComboBoxPanel.this.getSelectedItem();
if (StringUtils.isNotBlank(selected)) {
DesignerEnvManager.getEnvManager().setRecentSelectedConnection(selected);
}
}
});
refreshItems();
}
/*
* 刷新ComboBox.items
*/
protected Iterator<String> items() {
nameList = new ArrayList<String>();
DatasourceManagerProvider mgr = DatasourceManager.getProviderInstance();
Iterator<String> nameIt = mgr.getConnectionNameIterator();
while (nameIt.hasNext()) {
String conName = nameIt.next();
Connection connection = mgr.getConnection(conName);
filterConnection(connection, conName, nameList);
}
return nameList.iterator();
}
protected void filterConnection(Connection connection, String conName, List<String> nameList) {
connection.addConnection(nameList, conName, new Class[]{AbstractDatabaseConnection.class});
}
public int getConnectionSize() {
return nameList.size();
}
public String getConnection(int i) {
return nameList.get(i);
}
/*
* 弹出对话框编辑Items
*/
protected void editItems() {
final ConnectionListPane connectionListPane = new ConnectionListPane();
final DatasourceManagerProvider datasourceManager = DatasourceManager.getProviderInstance();
final DatasourceManager backupManager = datasourceManager.getBackUpManager();
connectionListPane.populate(datasourceManager);
final BasicDialog connectionListDialog = connectionListPane.showLargeWindow(
SwingUtilities.getWindowAncestor(ConnectionComboBoxPanel.this), null);
connectionListDialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
if (!connectionListPane.isNamePermitted()) {
connectionListDialog.setDoOKSucceed(false);
return;
}
if (!ConnectionListAction.doWithDatasourceManager(datasourceManager, backupManager, connectionListPane,
connectionListDialog)) {
//如果更新失败,则不关闭对话框,也不写xml文件,并且将对话框定位在请重命名的那个对象页面
return;
}
// marks:保存数据
ConnectionListAction.writeFile(datasourceManager);
}
public void doCancel() {
datasourceManager.synchronizedWithServer();
}
});
connectionListDialog.setVisible(true);
refreshItems();
}
/**
* @param connection 数据库链接
*/
public void populate(Connection connection) {
editButton.setEnabled(FRContext.getCurrentEnv().isRoot());
if (connection instanceof NameDatabaseConnection) {
this.setSelectedItem(((NameDatabaseConnection) connection).getName());
} else {
String s = DesignerEnvManager.getEnvManager().getRecentSelectedConnection();
if (StringUtils.isNotBlank(s)) {
for (int i = 0; i < this.getConnectionSize(); i++) {
String t = this.getConnection(i);
if (ComparatorUtils.equals(s, t)) {
this.setSelectedItem(s);
break;
}
}
}
// alex:如果这个ComboBox还是没有选中,那么选中第一个
if (StringUtils.isBlank(this.getSelectedItem()) && this.getConnectionSize() > 0) {
this.setSelectedItem(this.getConnection(0));
}
}
}
}

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

@ -1,163 +1,163 @@
package com.fr.design.data.datapane.connect;
import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
import java.util.*;
/**
* Connection List Pane.
*/
public class ConnectionListPane extends JListControlPane {
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>();
public ConnectionListPane() {
renameMap.clear();
this.addEditingListner(new PropertyChangeAdapter() {
public void propertyChange() {
isNamePermitted = true;
String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) {
String[] warning = new String[]{"NOT_NULL_Des", "Please_Rename"};
String[] sign = new String[]{",", "!"};
nameableList.stopEditing();
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), Inter.getLocText(warning, sign));
setWarnigText(editingIndex);
isNamePermitted = false;
return;
}
if (!ComparatorUtils.equals(tempName, selectedName)
&& isNameRepeted(new List[]{Arrays.asList(allListNames)}, tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
String message = Inter.getLocText(new String[]{"Utils-has_been_existed", "DashBoard-ConnectionList", "Please_Rename"}, new String[]{"", tempName + ",", "!"});
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message);
setWarnigText(editingIndex);
}
if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) {
rename(selectedName, tempName);
}
}
});
}
protected void rename(String oldName, String newName) {
if (renameMap.containsKey(selectedName)) {
renameMap.remove(selectedName);
}
renameMap.put(selectedName, newName);
}
/**
* 名字是否允许
*
* @return /
*/
public boolean isNamePermitted() {
return isNamePermitted;
}
/**
* 检查按钮可用状态 Check button enabled.
*/
public void checkButtonEnabled() {
super.checkButtonEnabled();
isNamePermitted = !isContainsRename();
}
public HashMap<String, String> getRenameMap() {
return renameMap;
}
/**
* 创建菜单项
*
* @return 菜单项
*/
public NameableCreator[] createNameableCreators() {
NameableCreator[] creators = new NameableCreator[]{new NameObjectCreator(
"JDBC",
"/com/fr/design/images/data/source/jdbcTableData.png",
JDBCDatabaseConnection.class,
DatabaseConnectionPane.JDBC.class
), new NameObjectCreator(
"JNDI",
"/com/fr/design/images/data/source/jdbcTableData.png",
JNDIDatabaseConnection.class,
DatabaseConnectionPane.JNDI.class
)};
Set<ConnectionProvider> pluginCreators = ExtraDesignClassManager.getInstance().getArray(ConnectionProvider.XML_TAG);
for (ConnectionProvider provider : pluginCreators) {
NameObjectCreator creator = new NameObjectCreator(
provider.nameForConnection(),
provider.iconPathForConnection(),
provider.classForConnection(),
provider.appearanceForConnection()
);
creators = ArrayUtils.add(creators, creator);
}
return creators;
}
@Override
protected String title4PopupWindow() {
return TITLE_NAME;
}
/**
* Populate.
*
* @param datasourceManager the new datasourceManager.
*/
public void populate(DatasourceManagerProvider datasourceManager) {
Iterator<String> nameIt = datasourceManager.getConnectionNameIterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) {
String name = nameIt.next();
nameObjectList.add(new NameObject(name, datasourceManager.getConnection(name)));
}
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
/**
* Update.
*/
public void update(DatasourceManagerProvider datasourceManager) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
datasourceManager.clearAllConnection();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
datasourceManager.putConnection(nameObject.getName(), (Connection) nameObject.getObject());
}
}
package com.fr.design.data.datapane.connect;
import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.ConnectionProvider;
import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
import java.util.*;
/**
* Connection List Pane.
*/
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>();
public ConnectionListPane() {
renameMap.clear();
this.addEditingListner(new PropertyChangeAdapter() {
public void propertyChange() {
isNamePermitted = true;
String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) {
String[] warning = new String[]{"NOT_NULL_Des", "Please_Rename"};
String[] sign = new String[]{",", "!"};
nameableList.stopEditing();
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), Inter.getLocText(warning, sign));
setWarnigText(editingIndex);
isNamePermitted = false;
return;
}
if (!ComparatorUtils.equals(tempName, selectedName)
&& isNameRepeted(new List[]{Arrays.asList(allListNames)}, tempName)) {
isNamePermitted = false;
nameableList.stopEditing();
String message = Inter.getLocText(new String[]{"Utils-has_been_existed", "DashBoard-ConnectionList", "Please_Rename"}, new String[]{"", tempName + ",", "!"});
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ConnectionListPane.this), message);
setWarnigText(editingIndex);
}
if (isNamePermitted && !ComparatorUtils.equals(tempName, selectedName)) {
rename(selectedName, tempName);
}
}
});
}
protected void rename(String oldName, String newName) {
if (renameMap.containsKey(selectedName)) {
renameMap.remove(selectedName);
}
renameMap.put(selectedName, newName);
}
/**
* 名字是否允许
*
* @return /
*/
public boolean isNamePermitted() {
return isNamePermitted;
}
/**
* 检查按钮可用状态 Check button enabled.
*/
public void checkButtonEnabled() {
super.checkButtonEnabled();
isNamePermitted = !isContainsRename();
}
public HashMap<String, String> getRenameMap() {
return renameMap;
}
/**
* 创建菜单项
*
* @return 菜单项
*/
public NameableCreator[] createNameableCreators() {
NameableCreator[] creators = new NameableCreator[]{new NameObjectCreator(
"JDBC",
"/com/fr/design/images/data/source/jdbcTableData.png",
JDBCDatabaseConnection.class,
DatabaseConnectionPane.JDBC.class
), new NameObjectCreator(
"JNDI",
"/com/fr/design/images/data/source/jdbcTableData.png",
JNDIDatabaseConnection.class,
DatabaseConnectionPane.JNDI.class
)};
Set<ConnectionProvider> pluginCreators = ExtraDesignClassManager.getInstance().getArray(ConnectionProvider.XML_TAG);
for (ConnectionProvider provider : pluginCreators) {
NameObjectCreator creator = new NameObjectCreator(
provider.nameForConnection(),
provider.iconPathForConnection(),
provider.classForConnection(),
provider.appearanceForConnection()
);
creators = ArrayUtils.add(creators, creator);
}
return creators;
}
@Override
protected String title4PopupWindow() {
return TITLE_NAME;
}
/**
* Populate.
*
* @param datasourceManager the new datasourceManager.
*/
public void populate(DatasourceManagerProvider datasourceManager) {
Iterator<String> nameIt = datasourceManager.getConnectionNameIterator();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
while (nameIt.hasNext()) {
String name = nameIt.next();
nameObjectList.add(new NameObject(name, datasourceManager.getConnection(name)));
}
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
/**
* Update.
*/
public void update(DatasourceManagerProvider datasourceManager) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
datasourceManager.clearAllConnection();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
datasourceManager.putConnection(nameObject.getName(), (Connection) nameObject.getObject());
}
}
}

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

@ -1,78 +1,79 @@
package com.fr.design.data.datapane.connect;
import com.fr.base.FRContext;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.util.HashMap;
public class ConnectionManagerPane extends LoadingBasicPane {
private UITextField connectionTextField;
private ConnectionListPane connectionListPane;
protected void initComponents(JPanel container) {
container.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel connectionPathPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
container.add(connectionPathPane, BorderLayout.NORTH);
connectionPathPane.setBorder(BorderFactory.createEmptyBorder(6, 2, 2, 2));
connectionPathPane.add(new UILabel(Inter.getLocText("FR-Designer_Save_Path") + ":"), BorderLayout.WEST);
this.connectionTextField = new UITextField();
connectionPathPane.add(connectionTextField, BorderLayout.CENTER);
this.connectionTextField.setEditable(false);
connectionListPane = new ConnectionListPane(){
protected void rename(String oldName,String newName) {
super.rename(oldName,newName);
renameConnection(oldName,newName);
}
};
container.add(connectionListPane, BorderLayout.CENTER);
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Server-Define_Data_Connection");
}
public HashMap<String, String> getRenameMap() {
return connectionListPane.getRenameMap();
}
public void populate(DatasourceManagerProvider datasourceManager) {
this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
+ File.separator + datasourceManager.fileName());
this.connectionListPane.populate(datasourceManager);
}
public void update(DatasourceManagerProvider datasourceManager) {
this.connectionListPane.update(datasourceManager);
}
/**
* 设置选中项
*
* @param index 选中项的序列号
*/
public void setSelectedIndex(int index) {
this.connectionListPane.setSelectedIndex(index);
}
/**
* 名字是否允许
* @return 允许返回true
*/
public boolean isNamePermitted() {
return connectionListPane.isNamePermitted();
}
package com.fr.design.data.datapane.connect;
import com.fr.base.FRContext;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.DatasourceManagerProvider;
import com.fr.general.Inter;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.util.HashMap;
public class ConnectionManagerPane extends LoadingBasicPane implements ConnectionShowPane {
private UITextField connectionTextField;
private ConnectionListPane connectionListPane;
protected void initComponents(JPanel container) {
container.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel connectionPathPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
container.add(connectionPathPane, BorderLayout.NORTH);
connectionPathPane.setBorder(BorderFactory.createEmptyBorder(6, 2, 2, 2));
connectionPathPane.add(new UILabel(Inter.getLocText("FR-Designer_Save_Path") + ":"), BorderLayout.WEST);
this.connectionTextField = new UITextField();
connectionPathPane.add(connectionTextField, BorderLayout.CENTER);
this.connectionTextField.setEditable(false);
connectionListPane = new ConnectionListPane() {
protected void rename(String oldName, String newName) {
super.rename(oldName, newName);
renameConnection(oldName, newName);
}
};
container.add(connectionListPane, BorderLayout.CENTER);
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Server-Define_Data_Connection");
}
public HashMap<String, String> getRenameMap() {
return connectionListPane.getRenameMap();
}
public void populate(DatasourceManagerProvider datasourceManager) {
this.connectionTextField.setText(FRContext.getCurrentEnv().getPath() + File.separator + ProjectConstants.RESOURCES_NAME
+ File.separator + datasourceManager.fileName());
this.connectionListPane.populate(datasourceManager);
}
public void update(DatasourceManagerProvider datasourceManager) {
this.connectionListPane.update(datasourceManager);
}
/**
* 设置选中项
*
* @param index 选中项的序列号
*/
public void setSelectedIndex(int index) {
this.connectionListPane.setSelectedIndex(index);
}
/**
* 名字是否允许
*
* @return 允许返回true
*/
public boolean isNamePermitted() {
return connectionListPane.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);
}

13
designer_base/src/com/fr/design/formula/VariableResolverAdapter.java

@ -4,12 +4,16 @@ import com.fr.base.ConfigManager;
import com.fr.base.Parameter;
import com.fr.design.DesignModelAdapter;
import com.fr.base.ConfigManagerProvider;
import com.fr.plugin.ExtraClassManager;
import com.fr.script.ScriptConstants;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.fun.BuiltInParametersProvider;
import com.fr.stable.script.CalculatorProvider;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public abstract class VariableResolverAdapter implements VariableResolver {
private static final int TABLE_DATA_PARA = 0;
@ -21,7 +25,7 @@ public abstract class VariableResolverAdapter implements VariableResolver {
* @return 内置参数
*/
public String[] resolveCurReportVariables() {
return new String[] { ScriptConstants.SUMMARY_TAG + "page_number",
String [] variables = new String[] { ScriptConstants.SUMMARY_TAG + "page_number",
ScriptConstants.SUMMARY_TAG + "totalPage_number",
// 下面是权限相关的参数
ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_USERNAME, ScriptConstants.DETAIL_TAG + Constants.P.PRIVILEGE_AUTHORITY,
@ -32,6 +36,13 @@ public abstract class VariableResolverAdapter implements VariableResolver {
CalculatorProvider.REPORT_NAME, CalculatorProvider.FORMLET_NAME, CalculatorProvider.SERVLET_URL, CalculatorProvider.SERVER_SCHEMA, CalculatorProvider.SERVER_NAME,
CalculatorProvider.SERVER_PORT, CalculatorProvider.SERVER_URL, CalculatorProvider.CONTEXT_PATH, CalculatorProvider.SESSION_ID
};
Set<BuiltInParametersProvider> set = ExtraClassManager.getInstance().getArray(BuiltInParametersProvider.XML_TAG);
for (BuiltInParametersProvider provider : set) {
return (String[]) ArrayUtils.addAll(variables, new String []{
ScriptConstants.DETAIL_TAG + provider.getParametersName()
});
}
return variables;
}
private Parameter[] getCurrentModeParameters(int type) {

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

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

@ -596,3 +596,7 @@ FR-Designer_AxisReversed=AxisValue
FR-Designer_Logarithmic=Logarithmic
FR-Designer_Chart_Log_Base=Log Base
FR-Designer_Chart_F_Radar_Axis=Chart_F_Radar_Axis
FR-Designer_Style=Style
FR-Designer_Color=Color
FR-Designer_Border=Border
FR-Designer_Background-Pattern=Pattern

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

@ -596,4 +596,8 @@ FR-Designer_AxisReversed=Axis in reverse order
FR-Designer_Logarithmic=Log scale
FR-Designer_Chart_Log_Base=Log Base
FR-Designer_Chart_F_Radar_Axis=Value Axis
FR-Designer_Style=Style
FR-Designer_Color=Color
FR-Designer_Border=Border
FR-Designer_Background-Pattern=Pattern

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

@ -560,4 +560,8 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=
FR-Designer_AxisReversed=\u8EF8\u9006\u9806
FR-Designer_Logarithmic=\u5BFE\u6570\u76EE\u76DB\u308A
FR-Designer_Chart_Log_Base=\u5E95\u6570
FR-Designer_Chart_F_Radar_Axis=\u5782\u76F4\u8EF8
FR-Designer_Chart_F_Radar_Axis=\u5782\u76F4\u8EF8
FR-Designer_Style=\u30B9\u30BF\u30A4\u30EB
FR-Designer_Color=\u8272
FR-Designer_Border=\u67A0
FR-Designer_Background-Pattern=\u30D1\u30BF\u30FC\u30F3

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

@ -555,4 +555,8 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=
FR-Designer_AxisReversed=\uCD95\uC5ED\uC21C
FR-Designer_Logarithmic=\uB85C\uADF8\uB208\uAE08
FR-Designer_Chart_Log_Base=\uAE30\uC218
FR-Designer_Chart_F_Radar_Axis=\uAC12\uCD95
FR-Designer_Chart_F_Radar_Axis=\uAC12\uCD95
FR-Designer_Style=\uC591\uC2DD
FR-Designer_Color=\uC0C9
FR-Designer_Border=\uD14C\uB450\uB9AC
FR-Designer_Background-Pattern=\uC774\uBBF8\uC9C0

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

@ -595,4 +595,8 @@ FR-Designer_Too_Small_To_Paste=\u6B64\u5904\u65E0\u6CD5\u7C98\u8D34\uFF0C\u5C0F\
FR-Designer_AxisReversed=\u8F74\u9006\u5E8F
FR-Designer_Logarithmic=\u5BF9\u6570\u523B\u5EA6
FR-Designer_Chart_Log_Base=\u5E95\u6570
FR-Designer_Chart_F_Radar_Axis=\u503C\u8F74
FR-Designer_Chart_F_Radar_Axis=\u503C\u8F74
FR-Designer_Style=\u6837\u5F0F
FR-Designer_Color=\u989C\u8272
FR-Designer_Border=\u8FB9\u6846
FR-Designer_Background-Pattern=\u56FE\u6848

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

@ -581,4 +581,8 @@ FR-Designer_Mouse_Click_Tips=
FR-Designer_AxisReversed=\u8EF8\u9006\u5E8F
FR-Designer_Logarithmic=\u5C0D\u6578\u523B\u5EA6
FR-Designer_Chart_Log_Base=\u5E95\u6578
FR-Designer_Chart_F_Radar_Axis=\u503C\u8EF8
FR-Designer_Chart_F_Radar_Axis=\u503C\u8EF8
FR-Designer_Style=\u6A23\u5F0F
FR-Designer_Color=\u984F\u8272
FR-Designer_Border=\u6846\u7DDA
FR-Designer_Background-Pattern=\u5716\u6848

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

2
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

@ -95,6 +95,8 @@ public class FormHyperlinkPane extends BasicBeanPane<FormHyperlinkProvider> {
parameterList.toArray(parameters);
formHyperlink.setParameters(parameters);
} else {
formHyperlink.setParameters(null);
}
}

31
designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -25,6 +25,10 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
private ChartDataPane parent;
protected AbstractTableDataContentPane getDataContentPane() {
return dataContentPane;
}
public TableDataPane(ChartDataPane parent) {
this.parent = parent;
initDataPane();
@ -103,34 +107,41 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
* @param collection 图表属性的集合
*/
public void refreshContentPane(ChartCollection collection) {
refreshContentPane(getContentPane(collection.getSelectedChart().getPlot()));
}
protected void refreshContentPane(AbstractTableDataContentPane contentPane) {
if(dataContentPane != null) {
remove(dataContentPane);
}
dataContentPane = getContentPane(collection.getSelectedChart().getPlot());
dataContentPane = contentPane;
if(dataContentPane != null) {
add(dataContentPane, BorderLayout.CENTER);
}
}
/**
* 更新界面属性
* 更新界面属性
*/
public void populateBean(ChartCollection collection) {
if(collection == null) {
return;
}
TableDataDefinition data = (TableDataDefinition)collection.getSelectedChart().getFilterDefinition();
populateDSName(data);
if(dataContentPane != null) {
dataContentPane.populateBean(collection);
}
}
protected void populateDSName(TableDataDefinition dataDefinition){
TableData tableData = null;
if(data != null) {
tableData = data.getTableData();
if(dataDefinition != null) {
tableData = dataDefinition.getTableData();
}
onSelectTableData();
checkBoxUse();
tableDataPane.populateBean(tableData);
if(dataContentPane != null) {
dataContentPane.populateBean(collection);
}
}
/**
@ -141,6 +152,10 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
dataContentPane.updateBean(collection);
}
TopDefinition dataDefinition = (TopDefinition)collection.getSelectedChart().getFilterDefinition();
updateDSName(dataDefinition);
}
protected void updateDSName(TopDefinition dataDefinition) {
if(dataDefinition instanceof TableDataDefinition) {
TableDataWrapper tableDataWrapper = tableDataPane.getTableDataWrapper();
if (dataDefinition != null && tableDataWrapper != null){

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

@ -10,9 +10,11 @@ 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.ElementCaseToolBarEditor;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
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;
@ -34,8 +36,8 @@ import java.beans.PropertyDescriptor;
import java.util.Set;
public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{
private UILabel imageLable;
private CoverReportPane coverPanel;
private UILabel imageLable;
private CoverReportPane coverPanel;
private FormDesigner designer;
//缩略图
private BufferedImage thumbnailImage;
@ -64,18 +66,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
}
/**
* 是否支持设置标题
* @return 是返回true
*/
public boolean hasTitleStyle() {
* 是否支持设置标题
* @return 是返回true
*/
public boolean hasTitleStyle() {
return true;
}
/**
* 返回组件属性值
* @return 返回组件属性值
* @throws IntrospectionException 异常
*/
/**
* 返回组件属性值
* @return 返回组件属性值
* @throws IntrospectionException 异常
*/
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{
@ -86,7 +88,8 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
@Override
public void propertyChange() {
makeVisible(toData().isVisible());}
makeVisible(toData().isVisible());
}
}),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setI18NName(
@ -97,12 +100,11 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
public void propertyChange() {
initStyle();
}
}),
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setI18NName(Inter.getLocText("FR-Layout_Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class)
new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_toolbar"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
};
@ -149,30 +151,30 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
return "text_field_16.png";
}
/**
* 返回组件默认名
* @return 组件类名(小写)
*/
public String createDefaultName() {
return "report";
}
/**
* 返回组件默认名
* @return 组件类名(小写)
*/
public String createDefaultName() {
return "report";
}
@Override
protected JComponent initEditor() {
if (editor == null) {
setBorder(DEFALUTBORDER);
editor = new JPanel();
editor.setBackground(null);
editor.setLayout(null);
imageLable = initImageBackground();
coverPanel = new CoverReportPane();
coverPanel.setPreferredSize(imageLable.getPreferredSize());
coverPanel.setBounds(imageLable.getBounds());
editor.add(coverPanel);
coverPanel.setVisible(false);
editor.add(imageLable);
editor = new JPanel();
editor.setBackground(null);
editor.setLayout(null);
imageLable = initImageBackground();
coverPanel = new CoverReportPane();
coverPanel.setPreferredSize(imageLable.getPreferredSize());
coverPanel.setBounds(imageLable.getBounds());
editor.add(coverPanel);
coverPanel.setVisible(false);
editor.add(imageLable);
}
return editor;
}
@ -185,7 +187,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
BufferedImage image = getThumbnailImage();
setLabelBackground(image, imageLable);
return imageLable;
return imageLable;
}
/**
@ -194,16 +196,16 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
private void setLabelBackground(Image image, UILabel imageLable){
ImageIcon icon = new ImageIcon(image);
imageLable.setIcon(icon);
imageLable.setOpaque(true);
imageLable.setLayout(null);
imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());
imageLable.setOpaque(true);
imageLable.setLayout(null);
imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());
}
/**
* 是否展现覆盖的pane
* @param display 是否
*/
public void displayCoverPane(boolean display){
/**
* 是否展现覆盖的pane
* @param display 是否
*/
public void displayCoverPane(boolean display){
coverPanel.setVisible(display);
coverPanel.setBounds(1, 1, (int) editor.getBounds().getWidth(), (int) editor.getBounds().getHeight());
editor.repaint();
@ -216,41 +218,41 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
coverPanel.destroyHelpDialog();
}
public JComponent getCoverPane(){
return coverPanel;
}
public JComponent getCoverPane(){
return coverPanel;
}
/**
* 初始化大小
* @return 尺寸
*/
/**
* 初始化大小
* @return 尺寸
*/
public Dimension initEditorSize() {
return BORDER_PREFERRED_SIZE;
}
/**
* 是否是报表块
* @return
*/
/**
* 是否是报表块
* @return
*/
public boolean isReport() {
return true;
}
/**
* 该组件是否可以拖入参数面板
* @return 是则返回true
*/
public boolean canEnterIntoParaPane(){
return false;
}
/**
* 返回报表块对应的widget
* @return 返回ElementCaseEditor
*/
public ElementCaseEditor toData() {
return ((ElementCaseEditor) data);
}
/**
* 该组件是否可以拖入参数面板
* @return 是则返回true
*/
public boolean canEnterIntoParaPane(){
return false;
}
/**
* 返回报表块对应的widget
* @return 返回ElementCaseEditor
*/
public ElementCaseEditor toData() {
return ((ElementCaseEditor) data);
}
public FormElementCaseProvider getElementCase() {
return toData().getElementCase();
@ -301,14 +303,14 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
}
private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){
FormDesigner designer = editingMouseListener.getDesigner();
if (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR){
FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e);
//切换设计器
designer.switchTab(component);
}
}
private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){
FormDesigner designer = editingMouseListener.getDesigner();
if (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR){
FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e);
//切换设计器
designer.switchTab(component);
}
}
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {

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

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) {

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