Browse Source

Merge pull request #65 in DESIGN/design from ~YAOH.WU/design:feature/10.0 to feature/10.0

* commit '27fa4a838e893610098d0a050249da188e0ac478':
  REPORT-6700 国际化
  无任务,代码规范
  无任务,代码规范
  REPORT-6700 部分规范
  ui调整
  REPORT-8449 交互问题bug修复
  REPORT-6700 适配
master
superman 7 years ago
parent
commit
54870097f4
  1. 170
      designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  2. 2
      designer-base/src/com/fr/design/remote/RemoteDesignAuthorityCreator.java
  3. 72
      designer-base/src/com/fr/design/remote/RemoteMember.java
  4. 47
      designer-base/src/com/fr/design/remote/Utils.java
  5. 18
      designer-base/src/com/fr/design/remote/action/RemoteDesignAuthorityManagerAction.java
  6. 59
      designer-base/src/com/fr/design/remote/button/IconButton.java
  7. 18
      designer-base/src/com/fr/design/remote/ui/AuthorityEditorPane.java
  8. 24
      designer-base/src/com/fr/design/remote/ui/AuthorityListControlPane.java
  9. 3
      designer-base/src/com/fr/design/remote/ui/AuthorityManagerPane.java
  10. 78
      designer-base/src/com/fr/design/remote/ui/UserManagerPane.java
  11. 25
      designer-base/src/com/fr/design/remote/ui/list/AddedMemberList.java
  12. 21
      designer-base/src/com/fr/design/remote/ui/list/AddedMemberListCellRender.java
  13. 21
      designer-base/src/com/fr/design/remote/ui/list/AddingMemberList.java
  14. 11
      designer-base/src/com/fr/design/remote/ui/list/AddingMemberListCellRender.java
  15. 2
      designer-base/src/com/fr/design/remote/ui/list/AuthorityListCellRenderer.java
  16. 11
      designer-base/src/com/fr/design/remote/ui/list/MemberList.java

170
designer-base/src/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -1,20 +1,29 @@
package com.fr.design.gui.itree.filetree; package com.fr.design.gui.itree.filetree;
import com.fr.base.Env;
import com.fr.base.env.EnvContext;
import com.fr.base.env.proxy.EnvProxy;
import com.fr.base.env.resource.EnvConfigUtils;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.env.operator.file.TplFileOperator;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.text.Position; import javax.swing.text.Position;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
/* /*
* 显示Env下的reportlets目录下面的所有cpt文件 * 显示Env下的reportlets目录下面的所有cpt文件
*/ */
public class TemplateFileTree extends EnvFileTree { public class TemplateFileTree extends EnvFileTree {
public TemplateFileTree() { public TemplateFileTree() {
super(ProjectConstants.REPORTLETS_NAME, null, null); super(ProjectConstants.REPORTLETS_NAME, null, null);
@ -42,33 +51,32 @@ public class TemplateFileTree extends EnvFileTree {
return null; return null;
} }
public String[] getSelectedTemplatePaths(){ public String[] getSelectedTemplatePaths() {
TreePath[] selectedTreePaths = this.getSelectionPaths(); TreePath[] selectedTreePaths = this.getSelectionPaths();
if (ArrayUtils.isEmpty(selectedTreePaths)) { if (ArrayUtils.isEmpty(selectedTreePaths)) {
return ArrayUtils.EMPTY_STRING_ARRAY; return ArrayUtils.EMPTY_STRING_ARRAY;
} }
List<String> selectedPathList = new ArrayList<String>(); List<String> selectedPathList = new ArrayList<String>();
for(TreePath treepath : selectedTreePaths){ for (TreePath treepath : selectedTreePaths) {
ExpandMutableTreeNode currentTreeNode = (ExpandMutableTreeNode) treepath.getLastPathComponent(); ExpandMutableTreeNode currentTreeNode = (ExpandMutableTreeNode) treepath.getLastPathComponent();
Object userObject = currentTreeNode.getUserObject(); Object userObject = currentTreeNode.getUserObject();
if (userObject instanceof FileNode) { if (userObject instanceof FileNode) {
FileNode fn = (FileNode) userObject; FileNode fn = (FileNode) userObject;
if (!fn.isDirectory()) { if (!fn.isDirectory()) {
String envPath = fn.getEnvPath(); String envPath = fn.getEnvPath();
if (envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) { if (envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) {
selectedPathList.add(envPath.substring(ProjectConstants.REPORTLETS_NAME.length())); selectedPathList.add(envPath.substring(ProjectConstants.REPORTLETS_NAME.length()));
} }
} }
} }
} }
return selectedPathList.toArray(new String[0]); return selectedPathList.toArray(new String[0]);
} }
public TreePath getNextMatch(String prefix, int startingRow, public TreePath getNextMatch(String prefix, int startingRow, Position.Bias bias) {
Position.Bias bias) {
int max = getRowCount(); int max = getRowCount();
if (prefix == null) { if (prefix == null) {
@ -78,9 +86,7 @@ public class TemplateFileTree extends EnvFileTree {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
prefix = prefix.toUpperCase(); prefix = prefix.toUpperCase();
// start search from the next/previous element from the selected element
// start search from the next/previous element froom the
// selected element
int increment = (bias == Position.Bias.Forward) ? 1 : -1; int increment = (bias == Position.Bias.Forward) ? 1 : -1;
int row = startingRow; int row = startingRow;
do { do {
@ -96,4 +102,110 @@ public class TemplateFileTree extends EnvFileTree {
} while (row != startingRow); } while (row != startingRow);
return null; return null;
} }
public FileNode[] listFile(String path) {
String username = EnvConfigUtils.getUsername(EnvContext.currentEnv());
String extra = EnvProxy.get(TplFileOperator.class).readExtraResourcePath(path);
return EnvProxy.get(TplFileOperator.class).list(username, extra, path);
}
/*
* 改变Env后,根据构造函数时设置的RootPaths,重新加载
*/
public void refreshEnv(Env env) {
DefaultTreeModel defaultTreeModel = (DefaultTreeModel) this.getModel();
ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) defaultTreeModel.getRoot();
rootTreeNode.removeAllChildren();
FileNode[] fns;
// 如果rootPaths是null的话列出所有文件
if (subPathes == null) {
fns = listFileNodes(this.treeRootPath);
} else {
// 重新加载新的FileDirectoryNode
fns = new FileNode[subPathes.length];
for (int i = 0; i < subPathes.length; i++) {
fns[i] = new FileNode(StableUtils.pathJoin(this.treeRootPath, subPathes[i]), true);
}
}
ExpandMutableTreeNode[] subTreeNodes = fileNodeArray2TreeNodeArray(fns);
for (ExpandMutableTreeNode node : subTreeNodes) {
rootTreeNode.add(node);
}
defaultTreeModel.reload(rootTreeNode);
}
protected ExpandMutableTreeNode[] loadChildTreeNodes(ExpandMutableTreeNode treeNode) {
FileNode[] fn_array = listFileNodes(treeNode);
return fileNodeArray2TreeNodeArray(fn_array);
}
/*
* 把FileNode[]转成ExpandMutableTreeNode[]
*/
private ExpandMutableTreeNode[] fileNodeArray2TreeNodeArray(FileNode[] fileNodes) {
ExpandMutableTreeNode[] res = new ExpandMutableTreeNode[fileNodes.length];
for (int i = 0; i < res.length; i++) {
FileNode fn = fileNodes[i];
res[i] = new ExpandMutableTreeNode(fn);
if (fn.isDirectory()) {
res[i].add(new ExpandMutableTreeNode());
}
}
return res;
}
private FileNode[] listFileNodes(String filePath) {
FileNode[] fileNodes = null;
try {
fileNodes = listFile(filePath);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
if (fileNodes == null) {
fileNodes = new FileNode[0];
}
// 用FileNodeFilter过滤一下
if (filter != null) {
List<FileNode> list = new ArrayList<FileNode>();
for (FileNode fileNode : fileNodes) {
if (filter.accept(fileNode)) {
list.add(fileNode);
}
}
fileNodes = list.toArray(new FileNode[list.size()]);
}
Arrays.sort(fileNodes, new FileNodeComparator());
return fileNodes;
}
/*
* 求当前TreeNode下所有的FileNode.
*/
private FileNode[] listFileNodes(ExpandMutableTreeNode currentTreeNode) {
if (currentTreeNode == null) {
return new FileNode[0];
}
Object object = currentTreeNode.getUserObject();
if (object instanceof FileNode) {
return this.listFileNodes(((FileNode) object).getEnvPath());
}
return new FileNode[0];
}
} }

2
designer-base/src/com/fr/design/remote/RemoteDesignAuthorityCreator.java

@ -3,7 +3,7 @@ package com.fr.design.remote;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.report.DesignAuthority; import com.fr.report.DesignAuthority;
import javax.swing.*; import javax.swing.Icon;
public class RemoteDesignAuthorityCreator { public class RemoteDesignAuthorityCreator {

72
designer-base/src/com/fr/design/remote/RemoteMember.java

@ -1,72 +0,0 @@
package com.fr.design.remote;
import com.fr.general.Inter;
public class RemoteMember {
public static final RemoteMember DEFAULT_MEMBER =
new RemoteMember(Inter.getLocText("FR-Designer_Remote_Design_Loading"));
private String username;
private String realName;
private String userId;
private boolean selected;
public RemoteMember() {
}
public RemoteMember(String username) {
this.username = username;
}
public RemoteMember username(String username) {
this.username = username;
return this;
}
public RemoteMember realName(String realName) {
this.realName = realName;
return this;
}
public RemoteMember userId(String userId) {
this.userId = userId;
return this;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
}

47
designer-base/src/com/fr/design/remote/Utils.java

@ -1,47 +0,0 @@
package com.fr.design.remote;
import com.fr.base.FRContext;
import com.fr.decision.webservice.bean.user.UserAdditionBean;
import com.fr.decision.webservice.v10.user.UserService;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
public class Utils {
private Utils() {
}
public static Collection<? extends RemoteMember> getRemoteMember(String keyword) {
List<UserAdditionBean> userBeans = new ArrayList<>();
try {
Map<String, Object> result =
UserService.getInstance().getAllUsers(
FRContext.getCurrentEnv().getUser(),
1,
10,
keyword,
"",
true);
userBeans = (List<UserAdditionBean>) result.get("items");
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
List<RemoteMember> res = new ArrayList<>();
for (UserAdditionBean userBean : userBeans) {
res.add(
new RemoteMember()
.username(userBean.getUsername())
.realName(userBean.getRealName())
.userId(userBean.getId())
);
}
return res;
}
}

18
designer-base/src/com/fr/design/remote/action/RemoteDesignAuthorityManagerAction.java

@ -2,13 +2,15 @@ package com.fr.design.remote.action;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.env.proxy.EnvProxy;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.remote.ui.AuthorityManagerPane; import com.fr.design.remote.ui.AuthorityManagerPane;
import com.fr.env.RemoteEnv; import com.fr.env.operator.authority.AuthorityOperator;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.report.DesignAuthority; import com.fr.report.DesignAuthority;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -20,7 +22,7 @@ public class RemoteDesignAuthorityManagerAction extends UpdateAction {
public RemoteDesignAuthorityManagerAction() { public RemoteDesignAuthorityManagerAction() {
this.setName(Inter.getLocText("FR-Designer_Remote_Design_Authority_Manager")); this.setName(Inter.getLocText("Fine-Designer_Remote_Design_Authority_Manager"));
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Remote_Design_Permission_Manager_normal@1x.png")); this.setSmallIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Remote_Design_Permission_Manager_normal@1x.png"));
} }
@ -34,12 +36,13 @@ public class RemoteDesignAuthorityManagerAction extends UpdateAction {
if (!FRContext.getCurrentEnv().isLocalEnv()) { if (!FRContext.getCurrentEnv().isLocalEnv()) {
try { try {
DesignAuthority[] authorities = ((RemoteEnv) FRContext.getCurrentEnv()).getAuthorities(); // 远程设计获取全部设计成员的权限列表
DesignAuthority[] authorities = EnvProxy.get(AuthorityOperator.class).getAuthorities();
if (authorities != null && authorities.length != 0) { if (authorities != null && authorities.length != 0) {
managerPane.populate(authorities); managerPane.populate(authorities);
} }
} catch (Exception exception) { } catch (Exception exception) {
FRContext.getLogger().error(exception.getMessage()); FineLoggerFactory.getLogger().error(exception.getMessage(), exception);
} }
} }
@ -48,7 +51,12 @@ public class RemoteDesignAuthorityManagerAction extends UpdateAction {
public void doOk() { public void doOk() {
DesignAuthority[] authorities = managerPane.update(); DesignAuthority[] authorities = managerPane.update();
if (!FRContext.getCurrentEnv().isLocalEnv()) { if (!FRContext.getCurrentEnv().isLocalEnv()) {
boolean success = ((RemoteEnv) FRContext.getCurrentEnv()).updateAuthorities(authorities); boolean success = false;
try {
success = EnvProxy.get(AuthorityOperator.class).updateAuthorities(authorities);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
FRContext.getLogger().info("update remote design authority: " + success); FRContext.getLogger().info("update remote design authority: " + success);
} }
} }

59
designer-base/src/com/fr/design/remote/button/IconButton.java

@ -0,0 +1,59 @@
package com.fr.design.remote.button;
import com.fr.base.BaseUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StringUtils;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
public final class IconButton extends JButton {
public IconButton() {
super(StringUtils.EMPTY);
setContentAreaFilled(false);
setFocusPainted(false);
setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Remove_x.png"));
setBorder(null);
}
@Override
protected void paintBorder(Graphics g) {
}
@Override
protected void paintComponent(Graphics g) {
final Graphics2D g2 = (Graphics2D) g.create();
g2.setPaint(
new GradientPaint(
new Point(0, 0),
new Color(0xF5F5F7),
new Point(0, getPreferredSize().height),
new Color(0xF5F5F7)
)
);
g2.fillRect(0, 0, getPreferredSize().width, getPreferredSize().height);
g2.dispose();
super.paintComponent(g);
}
public static void main(String[] args) {
JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(null);
IconButton a = new IconButton();
a.setBounds(0, 0, a.getPreferredSize().width, a.getPreferredSize().height);
content.add(a);
GUICoreUtils.centerWindow(jf);
jf.setSize(400, 400);
jf.setVisible(true);
}
}

18
designer-base/src/com/fr/design/remote/ui/AuthorityEditorPane.java

@ -2,8 +2,8 @@ package com.fr.design.remote.ui;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.remote.ui.tree.FileAuthorityTree; import com.fr.design.remote.ui.tree.FileAuthorityTree;
@ -14,23 +14,28 @@ import com.fr.report.DesignAuthority;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.border.EmptyBorder;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
public class AuthorityEditorPane extends BasicBeanPane<DesignAuthority> { public class AuthorityEditorPane extends BasicBeanPane<DesignAuthority> {
private UILabel label = new UILabel();
private FileAuthorityTree tree = new FileAuthorityTree(); private FileAuthorityTree tree = new FileAuthorityTree();
public AuthorityEditorPane() { public AuthorityEditorPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder()); this.setBorder(
this.add(label, BorderLayout.NORTH); BorderFactory.createCompoundBorder(
new EmptyBorder(6, 0, 6, 6),
UITitledBorder.createBorderWithTitle(
Inter.getLocText("Fine-Designer_Remote_Design_Template_Authority_Config")
)
)
);
IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form"}); IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form"});
tree.setDigIn(true); tree.setDigIn(true);
tree.setFileNodeFilter(filter); tree.setFileNodeFilter(filter);
@ -41,7 +46,7 @@ public class AuthorityEditorPane extends BasicBeanPane<DesignAuthority> {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Remote_Design_Configure_Authority"); return Inter.getLocText("Fine-Designer_Remote_Design_Configure_Authority");
} }
@Override @Override
@ -49,7 +54,6 @@ public class AuthorityEditorPane extends BasicBeanPane<DesignAuthority> {
if (ob == null) { if (ob == null) {
return; return;
} }
label.setText(ob.getUsername());
DesignAuthority.Item[] items = ob.getItems(); DesignAuthority.Item[] items = ob.getItems();
if (items == null) { if (items == null) {

24
designer-base/src/com/fr/design/remote/ui/AuthorityListControlPane.java

@ -15,12 +15,13 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.remote.RemoteDesignAuthorityCreator; import com.fr.design.remote.RemoteDesignAuthorityCreator;
import com.fr.design.remote.RemoteMember;
import com.fr.design.remote.ui.list.AuthorityList; import com.fr.design.remote.ui.list.AuthorityList;
import com.fr.design.remote.ui.list.AuthorityListCellRenderer; import com.fr.design.remote.ui.list.AuthorityListCellRenderer;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.env.RemoteDesignMember;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.log.FineLoggerFactory;
import com.fr.report.DesignAuthority; import com.fr.report.DesignAuthority;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -77,7 +78,7 @@ public class AuthorityListControlPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.authorityCreators = new RemoteDesignAuthorityCreator[]{ this.authorityCreators = new RemoteDesignAuthorityCreator[]{
new RemoteDesignAuthorityCreator( new RemoteDesignAuthorityCreator(
Inter.getLocText("FR-Designer_Remote_Design_User"), Inter.getLocText("Fine-Designer_Remote_Design_User"),
BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"), BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"),
DesignAuthority.class, DesignAuthority.class,
AuthorityEditorPane.class) AuthorityEditorPane.class)
@ -92,8 +93,8 @@ public class AuthorityListControlPane extends BasicPane {
// 右侧卡片布局 // 右侧卡片布局
cardLayout = new CardLayout(); cardLayout = new CardLayout();
cardPane = new JPanel(cardLayout); cardPane = new JPanel(cardLayout);
UILabel selectLabel = new UILabel(); UILabel emptyLabel = new UILabel();
cardPane.add(selectLabel, UNSELECTED_EDITOR_NAME); cardPane.add(emptyLabel, UNSELECTED_EDITOR_NAME);
cardPane.add(editorCtrl, SELECTED_EDITOR_NAME); cardPane.add(editorCtrl, SELECTED_EDITOR_NAME);
// 左右分割布局 // 左右分割布局
@ -169,7 +170,7 @@ public class AuthorityListControlPane extends BasicPane {
for (int i = 0, len = listModel.getSize(); i < len; i++) { for (int i = 0, len = listModel.getSize(); i < len; i++) {
res.add((DesignAuthority) listModel.getElementAt(i)); res.add((DesignAuthority) listModel.getElementAt(i));
} }
return res.toArray(new DesignAuthority[0]); return res.toArray(new DesignAuthority[res.size()]);
} }
public void populate(DesignAuthority[] authorities) { public void populate(DesignAuthority[] authorities) {
@ -231,6 +232,12 @@ public class AuthorityListControlPane extends BasicPane {
public void addAuthority(DesignAuthority authority, int index) { public void addAuthority(DesignAuthority authority, int index) {
DefaultListModel<DesignAuthority> model = (DefaultListModel<DesignAuthority>) authorityList.getModel(); DefaultListModel<DesignAuthority> model = (DefaultListModel<DesignAuthority>) authorityList.getModel();
for (int i = 0; i < model.size(); i++) {
if (model.get(i).getUserId().equals(authority.getUserId())) {
return;
}
}
model.add(index, authority); model.add(index, authority);
authorityList.setSelectedIndex(index); authorityList.setSelectedIndex(index);
authorityList.ensureIndexIsVisible(index); authorityList.ensureIndexIsVisible(index);
@ -318,7 +325,7 @@ public class AuthorityListControlPane extends BasicPane {
if (p[i] != null) { if (p[i] != null) {
try { try {
p[i].checkValid(); p[i].checkValid();
} catch (Exception e) { } catch (Exception ignore) {
return i; return i;
} }
} }
@ -333,6 +340,7 @@ public class AuthorityListControlPane extends BasicPane {
try { try {
checkValid(); checkValid();
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
JOptionPane.showMessageDialog(AuthorityListControlPane.this, exp.getMessage()); JOptionPane.showMessageDialog(AuthorityListControlPane.this, exp.getMessage());
authorityList.setSelectedIndex(idx); authorityList.setSelectedIndex(idx);
return true; return true;
@ -476,8 +484,8 @@ public class AuthorityListControlPane extends BasicPane {
@Override @Override
public void doOk() { public void doOk() {
// 获取添加的用户到权限编辑面板 // 获取添加的用户到权限编辑面板
List<RemoteMember> members = userManagerPane.update(); List<RemoteDesignMember> members = userManagerPane.update();
for (RemoteMember member : members) { for (RemoteDesignMember member : members) {
DesignAuthority authority = new DesignAuthority(); DesignAuthority authority = new DesignAuthority();
authority.setUsername(member.getUsername()); authority.setUsername(member.getUsername());
authority.setUserId(member.getUserId()); authority.setUserId(member.getUserId());

3
designer-base/src/com/fr/design/remote/ui/AuthorityManagerPane.java

@ -6,7 +6,6 @@ import com.fr.report.DesignAuthority;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.util.Arrays;
public class AuthorityManagerPane extends BasicPane { public class AuthorityManagerPane extends BasicPane {
@ -24,7 +23,7 @@ public class AuthorityManagerPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Remote_Design_Authority_Manager"); return Inter.getLocText("Fine-Designer_Remote_Design_Authority_Manager");
} }
public void populate(DesignAuthority[] authorities) { public void populate(DesignAuthority[] authorities) {

78
designer-base/src/com/fr/design/remote/ui/UserManagerPane.java

@ -1,5 +1,8 @@
package com.fr.design.remote.ui; package com.fr.design.remote.ui;
import com.fr.base.env.EnvContext;
import com.fr.base.env.proxy.EnvProxy;
import com.fr.base.env.resource.EnvConfigUtils;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -8,13 +11,13 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.remote.RemoteMember;
import com.fr.design.remote.Utils;
import com.fr.design.remote.ui.list.AddedMemberList; import com.fr.design.remote.ui.list.AddedMemberList;
import com.fr.design.remote.ui.list.AddedMemberListCellRender; import com.fr.design.remote.ui.list.AddedMemberListCellRender;
import com.fr.design.remote.ui.list.AddingMemberList; import com.fr.design.remote.ui.list.AddingMemberList;
import com.fr.design.remote.ui.list.AddingMemberListCellRender; import com.fr.design.remote.ui.list.AddingMemberListCellRender;
import com.fr.design.remote.ui.list.MemberListSelectedChangeListener; import com.fr.design.remote.ui.list.MemberListSelectedChangeListener;
import com.fr.env.RemoteDesignMember;
import com.fr.env.operator.decision.DecisionOperator;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.guava.collect.ImmutableList; import com.fr.third.guava.collect.ImmutableList;
@ -26,6 +29,7 @@ import javax.swing.ListSelectionModel;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
@ -46,16 +50,16 @@ public class UserManagerPane extends BasicPane {
/** /**
* 获取的决策平台成员 * 获取的决策平台成员
*/ */
private List<RemoteMember> addingMembers = new ArrayList<>(); private List<RemoteDesignMember> addingMembers = new ArrayList<>();
/** /**
* 添加到设计的决策平台成员 * 添加到设计的决策平台成员
*/ */
private List<RemoteMember> addedMembers = new ArrayList<>(); private List<RemoteDesignMember> addedMembers = new ArrayList<>();
/** /**
* 决策平台成员列表model * 决策平台成员列表model
*/ */
private DefaultListModel<RemoteMember> addingListModel = new DefaultListModel<>(); private DefaultListModel<RemoteDesignMember> addingListModel = new DefaultListModel<>();
/** /**
* 搜索输入框 * 搜索输入框
*/ */
@ -95,18 +99,25 @@ public class UserManagerPane extends BasicPane {
/** /**
* 添加到设计的决策成员计数标签 * 添加到设计的决策成员计数标签
*/ */
private DefaultListModel<RemoteMember> addedListModel; private DefaultListModel<RemoteDesignMember> addedListModel;
/**
* 左侧列表变动事件
*/
private MemberListSelectedChangeListener addingListChangeListener = new MemberListSelectedChangeListener() { private MemberListSelectedChangeListener addingListChangeListener = new MemberListSelectedChangeListener() {
@Override @Override
public void selectedChange() { public void selectedChange() {
resetAddedMembers(); // 右侧列表发生变化后,将右侧列表中选中但是在左侧列表中没有的成员添加进来,同时移除取消选中的
sync2AddedMembersFromAdding(); sync2AddedMembersFromAdding();
// 刷新右侧列表显示
addToAddedMemberList(); addToAddedMemberList();
} }
}; };
/**
* 右侧列表变动事件
*/
private MemberListSelectedChangeListener addedListChangeListener = new MemberListSelectedChangeListener() { private MemberListSelectedChangeListener addedListChangeListener = new MemberListSelectedChangeListener() {
@Override @Override
public void selectedChange() { public void selectedChange() {
@ -116,10 +127,12 @@ public class UserManagerPane extends BasicPane {
sync2AddedMembersFormAdded(); sync2AddedMembersFormAdded();
// 不需要重复更新右侧列表显示 但是更新一下计数显示 // 不需要重复更新右侧列表显示 但是更新一下计数显示
countLabel.setText( countLabel.setText(
Inter.getLocText("FR-Designer_Remote_Design_Selected_Member_Count", Inter.getLocText("Fine-Designer_Remote_Design_Selected_Member_Count",
String.valueOf(addedMembers.size()) String.valueOf(addedMembers.size())
) )
); );
// 刷新左侧列表显示
addToMemberList();
} }
}; };
@ -144,7 +157,7 @@ public class UserManagerPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Remote_Design_Add_Member"); return Inter.getLocText("Fine-Designer_Remote_Design_Add_Member");
} }
private JPanel createLeftPanel() { private JPanel createLeftPanel() {
@ -154,7 +167,7 @@ public class UserManagerPane extends BasicPane {
BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder(
new EmptyBorder(6, 0, 0, 0), new EmptyBorder(6, 0, 0, 0),
UITitledBorder.createBorderWithTitle( UITitledBorder.createBorderWithTitle(
Inter.getLocText("FR-Designer_Remote_Design_Decision_Member") Inter.getLocText("Fine-Designer_Remote_Design_Decision_Member")
) )
) )
); );
@ -162,10 +175,10 @@ public class UserManagerPane extends BasicPane {
// 搜索 // 搜索
JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
searchPanel.setBorder(BorderFactory.createEmptyBorder()); searchPanel.setBorder(BorderFactory.createEmptyBorder());
keyField.setPreferredSize(new Dimension(200, 20)); keyField.setPreferredSize(new Dimension(250, 20));
keyField.requestFocus(); keyField.requestFocus();
keyField.addKeyListener(keyFieldKeyListener); keyField.addKeyListener(keyFieldKeyListener);
keyButton.setText(Inter.getLocText("FR-Designer_Remote_Design_Search")); keyButton.setText(Inter.getLocText("Fine-Designer_Remote_Design_Search"));
keyButton.addActionListener(keyButtonActionListener); keyButton.addActionListener(keyButtonActionListener);
searchPanel.add(keyField); searchPanel.add(keyField);
searchPanel.add(keyButton); searchPanel.add(keyButton);
@ -194,16 +207,18 @@ public class UserManagerPane extends BasicPane {
BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder(
new EmptyBorder(6, 0, 0, 0), new EmptyBorder(6, 0, 0, 0),
UITitledBorder.createBorderWithTitle( UITitledBorder.createBorderWithTitle(
Inter.getLocText("FR-Designer_Remote_Design_Selected_Member") Inter.getLocText("Fine-Designer_Remote_Design_Selected_Member")
) )
) )
); );
// 计数 // 计数
countLabel.setText( countLabel.setText(
Inter.getLocText("FR-Designer_Remote_Design_Selected_Member_Count", Inter.getLocText("Fine-Designer_Remote_Design_Selected_Member_Count",
String.valueOf(addedMembers.size())) String.valueOf(addedMembers.size()))
); );
countLabel.setBorder(BorderFactory.createEmptyBorder(7, 12, 8, 0));
countLabel.setForeground(new Color(0x8F8F92));
addedListModel = new DefaultListModel<>(); addedListModel = new DefaultListModel<>();
addedList = new AddedMemberList(addedListModel); addedList = new AddedMemberList(addedListModel);
@ -224,7 +239,13 @@ public class UserManagerPane extends BasicPane {
private void addToMemberList() { private void addToMemberList() {
addingListModel.clear(); addingListModel.clear();
for (RemoteMember member : addingMembers) { for (RemoteDesignMember member : addingMembers) {
// 如果包含在右侧列表中,那么左侧列表默认选中
if (addedMembers.contains(member)) {
member.setSelected(true);
} else {
member.setSelected(false);
}
addingListModel.addElement(member); addingListModel.addElement(member);
} }
addingList.revalidate(); addingList.revalidate();
@ -233,20 +254,20 @@ public class UserManagerPane extends BasicPane {
private void addToAddedMemberList() { private void addToAddedMemberList() {
addedListModel.clear(); addedListModel.clear();
for (RemoteMember member : addedMembers) { for (RemoteDesignMember member : addedMembers) {
addedListModel.addElement(member); addedListModel.addElement(member);
} }
addedList.revalidate(); addedList.revalidate();
addedList.repaint(); addedList.repaint();
countLabel.setText( countLabel.setText(
Inter.getLocText("FR-Designer_Remote_Design_Selected_Member_Count", Inter.getLocText("Fine-Designer_Remote_Design_Selected_Member_Count",
String.valueOf(addedMembers.size()) String.valueOf(addedMembers.size())
)); ));
} }
private void resetMembers() { private void resetMembers() {
addingMembers.clear(); addingMembers.clear();
addingMembers.add(RemoteMember.DEFAULT_MEMBER); addingMembers.add(RemoteDesignMember.DEFAULT_MEMBER);
} }
private void resetAddedMembers() { private void resetAddedMembers() {
@ -256,11 +277,12 @@ public class UserManagerPane extends BasicPane {
private void searchAddingMembers(final String keyword) { private void searchAddingMembers(final String keyword) {
final SwingWorker getMemberWorker = new SwingWorker<List<RemoteMember>, Void>() { final SwingWorker getMemberWorker = new SwingWorker<List<RemoteDesignMember>, Void>() {
@Override @Override
protected List<RemoteMember> doInBackground() { protected List<RemoteDesignMember> doInBackground() {
addingMembers.clear(); addingMembers.clear();
addingMembers.addAll(Utils.getRemoteMember(keyword)); String username = EnvConfigUtils.getUsername(EnvContext.currentEnv());
addingMembers.addAll(EnvProxy.get(DecisionOperator.class).getMembers(username, keyword));
return addingMembers; return addingMembers;
} }
@ -274,25 +296,29 @@ public class UserManagerPane extends BasicPane {
private void sync2AddedMembersFromAdding() { private void sync2AddedMembersFromAdding() {
RemoteMember[] members = new RemoteMember[addingListModel.getSize()]; RemoteDesignMember[] members = new RemoteDesignMember[addingListModel.getSize()];
// shallow copy // shallow copy
addingListModel.copyInto(members); addingListModel.copyInto(members);
for (RemoteMember member : members) { for (RemoteDesignMember member : members) {
if (member.isSelected()) {
if (!member.isSelected()) {
addedMembers.remove(member);
}
if (member.isSelected() && !addedMembers.contains(member)) {
addedMembers.add(member); addedMembers.add(member);
} }
} }
} }
private void sync2AddedMembersFormAdded() { private void sync2AddedMembersFormAdded() {
RemoteMember[] members = new RemoteMember[addedListModel.getSize()]; RemoteDesignMember[] members = new RemoteDesignMember[addedListModel.getSize()];
// shallow copy // shallow copy
addedListModel.copyInto(members); addedListModel.copyInto(members);
addedMembers.addAll(Arrays.asList(members)); addedMembers.addAll(Arrays.asList(members));
} }
public ImmutableList<RemoteMember> update() { public ImmutableList<RemoteDesignMember> update() {
return ImmutableList.copyOf(addedMembers); return ImmutableList.copyOf(addedMembers);
} }
} }

25
designer-base/src/com/fr/design/remote/ui/list/AddedMemberList.java

@ -1,8 +1,9 @@
package com.fr.design.remote.ui.list; package com.fr.design.remote.ui.list;
import com.fr.design.remote.RemoteMember; import com.fr.env.RemoteDesignMember;
import javax.swing.*; import javax.swing.DefaultListModel;
import java.awt.Point;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.Vector; import java.util.Vector;
@ -12,30 +13,38 @@ public class AddedMemberList extends MemberList {
super(); super();
} }
public AddedMemberList(DefaultListModel<RemoteMember> dataModel) { public AddedMemberList(DefaultListModel<RemoteDesignMember> dataModel) {
super(dataModel); super(dataModel);
} }
public AddedMemberList(RemoteMember[] listData) { public AddedMemberList(RemoteDesignMember[] listData) {
super(listData); super(listData);
} }
public AddedMemberList(Vector<? extends RemoteMember> listData) { public AddedMemberList(Vector<? extends RemoteDesignMember> listData) {
super(listData); super(listData);
} }
@Override @Override
protected boolean shouldDisplaySelected(MouseEvent e) { protected boolean shouldDisplaySelected(MouseEvent e) {
return true; Point point = e.getPoint();
int rX = point.x;
int rY = point.y;
int index = this.getSelectedIndex();
int x = 280;
int y = 25 * index;
int width = 20;
int height = 25;
return x <= rX && rX <= x + width && y <= rY && rY <= y + height;
} }
@Override @Override
protected void displaySelected() { protected void displaySelected() {
RemoteMember member = getSelectedValue(); RemoteDesignMember member = getSelectedValue();
if (member != null) { if (member != null) {
member.setSelected(!member.isSelected()); member.setSelected(!member.isSelected());
((DefaultListModel<RemoteMember>) getModel()).removeElement(member); ((DefaultListModel<RemoteDesignMember>) getModel()).removeElement(member);
} }
revalidate(); revalidate();
repaint(); repaint();

21
designer-base/src/com/fr/design/remote/ui/list/AddedMemberListCellRender.java

@ -1,45 +1,44 @@
package com.fr.design.remote.ui.list; package com.fr.design.remote.ui.list;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.remote.RemoteMember; import com.fr.design.remote.button.IconButton;
import com.fr.env.RemoteDesignMember;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
public class AddedMemberListCellRender extends JPanel implements ListCellRenderer<RemoteMember> { public class AddedMemberListCellRender extends JPanel implements ListCellRenderer<RemoteDesignMember> {
private UILabel label; private UILabel label;
private UIButton uiButton;
public AddedMemberListCellRender() { public AddedMemberListCellRender() {
this.setBorder(BorderFactory.createEmptyBorder()); this.setBorder(BorderFactory.createEmptyBorder());
this.setLayout(new FlowLayout(FlowLayout.LEFT)); this.setLayout(new FlowLayout(FlowLayout.LEFT));
label = new UILabel(); label = new UILabel();
label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png")); label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"));
label.setPreferredSize(new Dimension(270, 20));
uiButton = new UIButton(); this.setPreferredSize(new Dimension(this.getPreferredSize().width, 25));
uiButton.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Remove_x.png"));
this.add(label); this.add(label);
this.add(uiButton); this.add(new IconButton());
} }
@Override @Override
public Component getListCellRendererComponent(JList<? extends RemoteMember> list, RemoteMember member, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList<? extends RemoteDesignMember> list, RemoteDesignMember member, int index, boolean isSelected, boolean cellHasFocus) {
this.setLabelText(member.getUsername()); this.setLabelText(member.getRealName() + "(" + member.getUsername() + ")");
return this; return this;
} }
private void setLabelText(String name) { private void setLabelText(String name) {
label.setText(name); label.setText(name);
} }
} }

21
designer-base/src/com/fr/design/remote/ui/list/AddingMemberList.java

@ -1,8 +1,9 @@
package com.fr.design.remote.ui.list; package com.fr.design.remote.ui.list;
import com.fr.design.remote.RemoteMember; import com.fr.env.RemoteDesignMember;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import java.awt.Point;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.Vector; import java.util.Vector;
@ -13,23 +14,23 @@ public class AddingMemberList extends MemberList {
super(); super();
} }
public AddingMemberList(DefaultListModel<RemoteMember> dataModel) { public AddingMemberList(DefaultListModel<RemoteDesignMember> dataModel) {
super(dataModel); super(dataModel);
} }
public AddingMemberList(RemoteMember[] listData) { public AddingMemberList(RemoteDesignMember[] listData) {
super(listData); super(listData);
} }
public AddingMemberList(Vector<? extends RemoteMember> listData) { public AddingMemberList(Vector<? extends RemoteDesignMember> listData) {
super(listData); super(listData);
} }
@Override @Override
protected void displaySelected() { protected void displaySelected() {
RemoteMember member = getSelectedValue(); RemoteDesignMember member = getSelectedValue();
member.setSelected(!member.isSelected()); member.setSelected(!member.isSelected());
revalidate(); revalidate();
repaint(); repaint();
@ -38,7 +39,15 @@ public class AddingMemberList extends MemberList {
@Override @Override
protected boolean shouldDisplaySelected(MouseEvent e) { protected boolean shouldDisplaySelected(MouseEvent e) {
return true; Point point = e.getPoint();
int rX = point.x;
int rY = point.y;
int index = this.getSelectedIndex();
int x = 280;
int y = 25 * index;
int width = 25;
int height = 25;
return x <= rX && rX <= x + width && y <= rY && rY <= y + height;
} }
} }

11
designer-base/src/com/fr/design/remote/ui/list/AddingMemberListCellRender.java

@ -3,16 +3,17 @@ package com.fr.design.remote.ui.list;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.remote.RemoteMember; import com.fr.env.RemoteDesignMember;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
public class AddingMemberListCellRender extends JPanel implements ListCellRenderer<RemoteMember> { public class AddingMemberListCellRender extends JPanel implements ListCellRenderer<RemoteDesignMember> {
private UILabel label; private UILabel label;
private UICheckBox check; private UICheckBox check;
@ -23,6 +24,8 @@ public class AddingMemberListCellRender extends JPanel implements ListCellRender
this.setLayout(new FlowLayout(FlowLayout.LEFT)); this.setLayout(new FlowLayout(FlowLayout.LEFT));
label = new UILabel(); label = new UILabel();
label.setPreferredSize(new Dimension(270, 20));
this.setPreferredSize(new Dimension(this.getPreferredSize().width, 25));
label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png")); label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"));
check = new UICheckBox(); check = new UICheckBox();
@ -35,8 +38,8 @@ public class AddingMemberListCellRender extends JPanel implements ListCellRender
@Override @Override
public Component getListCellRendererComponent(JList list, RemoteMember member, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, RemoteDesignMember member, int index, boolean isSelected, boolean cellHasFocus) {
this.setLabelText(member.getUsername()); this.setLabelText(member.getRealName() + "(" + member.getUsername() + ")");
check.setSelected(member.isSelected()); check.setSelected(member.isSelected());
return this; return this;
} }

2
designer-base/src/com/fr/design/remote/ui/list/AuthorityListCellRenderer.java

@ -82,7 +82,7 @@ public class AuthorityListCellRenderer extends
setBorder(border); setBorder(border);
this.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png")); this.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"));
this.setText(authority.getUsername()); this.setText(authority.getRealName() + "(" + authority.getUsername() + ")");
return this; return this;
} }

11
designer-base/src/com/fr/design/remote/ui/list/MemberList.java

@ -1,6 +1,7 @@
package com.fr.design.remote.ui.list; package com.fr.design.remote.ui.list;
import com.fr.design.remote.RemoteMember;
import com.fr.env.RemoteDesignMember;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JList; import javax.swing.JList;
@ -12,19 +13,19 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.Vector; import java.util.Vector;
public abstract class MemberList extends JList<RemoteMember> { public abstract class MemberList extends JList<RemoteDesignMember> {
public MemberList(DefaultListModel<RemoteMember> dataModel) { public MemberList(DefaultListModel<RemoteDesignMember> dataModel) {
super(dataModel); super(dataModel);
init(); init();
} }
public MemberList(RemoteMember[] listData) { public MemberList(RemoteDesignMember[] listData) {
super(listData); super(listData);
init(); init();
} }
public MemberList(Vector<? extends RemoteMember> listData) { public MemberList(Vector<? extends RemoteDesignMember> listData) {
super(listData); super(listData);
init(); init();
} }

Loading…
Cancel
Save