Browse Source

remote design pilot

master
yaoh.wu 7 years ago
parent
commit
9b99bfb7cc
  1. 24
      designer-base/src/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java
  2. 48
      designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  3. 2
      designer-base/src/com/fr/design/remote/ui/AuthorityListControlPane.java
  4. 20
      designer-base/src/com/fr/design/remote/ui/UserManagerPane.java
  5. 8
      designer-base/src/com/fr/design/remote/ui/list/AddedMemberList.java
  6. 10
      designer-base/src/com/fr/design/remote/ui/list/AuthorityListCellRenderer.java

24
designer-base/src/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java

@ -6,24 +6,18 @@
package com.fr.design.gui.itree.checkboxtree; package com.fr.design.gui.itree.checkboxtree;
import java.awt.BorderLayout; import com.fr.design.gui.icheckbox.UICheckBox;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.io.Serializable;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JTree; import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.*;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.*;
import com.fr.design.gui.icheckbox.UICheckBox; import java.awt.event.MouseEvent;
import com.fr.design.layout.FRGUIPaneFactory; import java.io.Serializable;
/** /**
@ -84,8 +78,7 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende
if (selectionModel.isPathSelected(path, selectionModel.isDigIn())) { if (selectionModel.isPathSelected(path, selectionModel.isDigIn())) {
_checkBox.setState(TristateCheckBox.SELECTED); _checkBox.setState(TristateCheckBox.SELECTED);
_checkBox.setSelected(true); _checkBox.setSelected(true);
} } else {
else {
_checkBox.setState(selectionModel.isDigIn() && selectionModel.isPartiallySelected(path) ? null : TristateCheckBox.NOT_SELECTED); _checkBox.setState(selectionModel.isDigIn() && selectionModel.isPartiallySelected(path) ? null : TristateCheckBox.NOT_SELECTED);
_checkBox.setSelected(false); _checkBox.setSelected(false);
} }
@ -102,6 +95,7 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende
Border border = treeCellRendererComponent.getBorder(); Border border = treeCellRendererComponent.getBorder();
setBorder(border); setBorder(border);
treeCellRendererComponent.setBorder(BorderFactory.createEmptyBorder()); treeCellRendererComponent.setBorder(BorderFactory.createEmptyBorder());
//todo 可能会发生数组越界,需要处理一下
if (getComponentCount() == 2) { if (getComponentCount() == 2) {
remove(1); remove(1);
} }

48
designer-base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -8,31 +8,14 @@ import com.fr.base.FRContext;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.BBSAction; import com.fr.design.actions.community.*;
import com.fr.design.actions.community.BugAction; import com.fr.design.actions.file.*;
import com.fr.design.actions.community.NeedAction;
import com.fr.design.actions.community.QuestionAction;
import com.fr.design.actions.community.SignAction;
import com.fr.design.actions.community.UpAction;
import com.fr.design.actions.community.VideoAction;
import com.fr.design.actions.file.CloseCurrentTemplateAction;
import com.fr.design.actions.file.ExitDesignerAction;
import com.fr.design.actions.file.OpenRecentReportMenuDef;
import com.fr.design.actions.file.OpenTemplateAction;
import com.fr.design.actions.file.PreferenceAction;
import com.fr.design.actions.file.SwitchExistEnv;
import com.fr.design.actions.help.AboutAction; import com.fr.design.actions.help.AboutAction;
import com.fr.design.actions.help.TutorialAction; import com.fr.design.actions.help.TutorialAction;
import com.fr.design.actions.help.WebDemoAction; import com.fr.design.actions.help.WebDemoAction;
import com.fr.design.actions.help.alphafine.AlphaFineAction; import com.fr.design.actions.help.alphafine.AlphaFineAction;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.actions.server.ConnectionListAction; import com.fr.design.actions.server.*;
import com.fr.design.actions.server.FunctionManagerAction;
import com.fr.design.actions.server.GlobalParameterAction;
import com.fr.design.actions.server.GlobalTableDataAction;
import com.fr.design.actions.server.PlatformManagerAction;
import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.remote.action.RemoteDesignAuthorityManagerAction;
import com.fr.design.file.NewTemplatePane; import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.fun.TableDataPaneProcessor;
@ -47,6 +30,7 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
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.action.RemoteDesignAuthorityManagerAction;
import com.fr.design.utils.ThemeUtils; import com.fr.design.utils.ThemeUtils;
import com.fr.env.RemoteEnv; import com.fr.env.RemoteEnv;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -61,23 +45,10 @@ import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.Icon; import javax.swing.*;
import javax.swing.JComponent; import java.awt.*;
import javax.swing.JMenuBar; import java.util.*;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Set;
/** /**
* @author richer * @author richer
@ -443,9 +414,8 @@ public abstract class ToolBarMenuDock {
return processor == null ? new GlobalTableDataAction() : processor.createServerTDAction(); return processor == null ? new GlobalTableDataAction() : processor.createServerTDAction();
} }
protected boolean shouldShowRemotePermission() { private boolean shouldShowRemotePermission() {
// todo 依据是否是远程设计 并且当前登录的用户是否是管理员 进行判断 是否展示远程设计权限管理 return FRContext.getCurrentEnv() != null && FRContext.getCurrentEnv().isRoot();
return true;
} }
protected boolean shouldShowPlugin() { protected boolean shouldShowPlugin() {

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

@ -49,7 +49,7 @@ public class AuthorityListControlPane extends BasicPane {
private AuthorityList authorityList; private AuthorityList authorityList;
private static final int SHORT_WIDTH = 30; private static final int SHORT_WIDTH = 90;
private ListEditorControlPane editorCtrl; private ListEditorControlPane editorCtrl;

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

@ -10,25 +10,14 @@ 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.RemoteMember;
import com.fr.design.remote.Utils; import com.fr.design.remote.Utils;
import com.fr.design.remote.ui.list.AddedMemberList; import com.fr.design.remote.ui.list.*;
import com.fr.design.remote.ui.list.AddedMemberListCellRender;
import com.fr.design.remote.ui.list.AddingMemberList;
import com.fr.design.remote.ui.list.AddingMemberListCellRender;
import com.fr.design.remote.ui.list.MemberListSelectedChangeListener;
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;
import javax.swing.BorderFactory; import javax.swing.*;
import javax.swing.DefaultListModel;
import javax.swing.JPanel;
import javax.swing.ListSelectionModel;
import javax.swing.SwingWorker;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
@ -114,7 +103,8 @@ public class UserManagerPane extends BasicPane {
addingList.repaint(); addingList.repaint();
resetAddedMembers(); resetAddedMembers();
sync2AddedMembersFormAdded(); sync2AddedMembersFormAdded();
// 不需要重复更新右侧列表显示 // 不需要重复更新右侧列表显示 但是更新一下计数显示
countLabel.setText(Inter.getLocText("已选择{R1}人", String.valueOf(addedMembers.size())));
} }
}; };

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

@ -2,7 +2,7 @@ package com.fr.design.remote.ui.list;
import com.fr.design.remote.RemoteMember; import com.fr.design.remote.RemoteMember;
import javax.swing.DefaultListModel; import javax.swing.*;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.Vector; import java.util.Vector;
@ -33,8 +33,10 @@ public class AddedMemberList extends MemberList {
@Override @Override
protected void displaySelected() { protected void displaySelected() {
RemoteMember member = getSelectedValue(); RemoteMember member = getSelectedValue();
member.setSelected(!member.isSelected()); if (member != null) {
((DefaultListModel<RemoteMember>) getModel()).removeElement(member); member.setSelected(!member.isSelected());
((DefaultListModel<RemoteMember>) getModel()).removeElement(member);
}
revalidate(); revalidate();
repaint(); repaint();
fireSelectedChange(); fireSelectedChange();

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

@ -4,17 +4,11 @@ import com.fr.base.BaseUtils;
import com.fr.design.remote.RemoteDesignAuthority; import com.fr.design.remote.RemoteDesignAuthority;
import sun.swing.DefaultLookup; import sun.swing.DefaultLookup;
import javax.swing.JLabel; import javax.swing.*;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import java.awt.Color; import java.awt.*;
import java.awt.Component;
/*
* NameableListCellRenderer
*/
public class AuthorityListCellRenderer extends public class AuthorityListCellRenderer extends
JLabel implements ListCellRenderer<RemoteDesignAuthority> { JLabel implements ListCellRenderer<RemoteDesignAuthority> {

Loading…
Cancel
Save