ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
package com.vci.client.auth2.view;
 
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
 
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextField;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
 
import com.vci.client.auth2.action.CheckRightAction;
import com.vci.client.auth2.action.DelAction;
import com.vci.client.auth2.action.EditAction;
import com.vci.client.auth2.action.NewAction;
import com.vci.client.auth2.action.OpsAllClearAction;
import com.vci.client.auth2.action.OpsAllSelectAction;
import com.vci.client.auth2.action.RefreshAction;
import com.vci.client.auth2.action.SaveRuleAction;
import com.vci.client.auth2.action.SelectDepAction;
import com.vci.client.auth2.action.SelectRoleAction;
import com.vci.client.auth2.action.SelectUserAction;
import com.vci.client.auth2.model.BooleanTableModel;
import com.vci.client.auth2.model.RoleModel;
import com.vci.client.auth2.model.UserGroupModel;
import com.vci.client.auth2.model.UserModel;
import com.vci.client.auth2.utils.ActionConstants;
import com.vci.client.auth2.utils.RightManagerHelper;
import com.vci.client.auth2.vo.OpItem;
import com.vci.client.common.VCIBasePanel;
import com.vci.client.framework.rightConfig.object.FunctionObject;
import com.vci.client.framework.specialrole.ModuleInterface.IModuleShow;
import com.vci.client.omd.btm.ui.BtmTree;
import com.vci.client.omd.btm.wrapper.BtmItemWrapper;
import com.vci.client.omd.provider.LifeCycleProvider;
import com.vci.client.omd.provider.LinkTypeProvider;
import com.vci.client.ui.util.PostorderEnumeration;
import com.vci.common.qt.object.Symbol;
import com.vci.corba.framework.data.CheckValue;
import com.vci.corba.framework.data.GrandValue;
import com.vci.corba.common.VCIError;
import com.vci.corba.omd.btm.BtmItem;
import com.vci.corba.omd.lcm.LifeCycle;
import com.vci.corba.omd.lcm.TransitionVO;
import com.vci.corba.omd.ltm.LinkType;
 
public class AbstractUIFunclet extends VCIBasePanel implements IModuleShow {
    /**
     * 
     */
    private static final long serialVersionUID = -3727722741228601983L;
    // instance
    private static AbstractUIFunclet instance = null;
    // 工具条
    private JPanel toolBarPanel = new ToolBarPanel();
    // 左侧区域
    private JPanel leftMainPanel = new JPanel();
    // 右侧区域
    private RightMainPanel rightMainPanel = new RightMainPanel(this);
    // 类型资源树
    private BtmTree resourceTree = new BtmTree();
    private JPanel tipPanel = new JPanel();
    // Action
    private JButton[] actions;
    // 常量
    private GridBagConstraints gbc;
    private FlowLayout flowlayout = new FlowLayout(FlowLayout.LEFT, 0, 0);
    private static FunctionObject funcObj = new FunctionObject();
 
    public static JPanel getInstance() {
        // 2015.12.17 liucq 每次需要重新加载
        instance = new AbstractUIFunclet(funcObj);
        return instance;
    }
 
    public RightMainPanel getRightMainPanel() {
        return rightMainPanel;
    }
 
    public void setRightMainPanel(RightMainPanel rightMainPanel) {
        this.rightMainPanel = rightMainPanel;
    }
 
    public JPanel getLeftMainPanel() {
        return leftMainPanel;
    }
 
    public void setLeftMainPanel(JPanel leftMainPanel) {
        this.leftMainPanel = leftMainPanel;
    }
 
    public JPanel getTipPanel() {
        return tipPanel;
    }
 
    public void setTipPanel(JPanel tipPanel) {
        this.tipPanel = tipPanel;
    }
 
    public BtmTree getResourceTree() {
        return resourceTree;
    }
 
    public void setResourceTree(BtmTree resourceTree) {
        this.resourceTree = resourceTree;
    }
 
    public JButton[] getActions() {
        return actions;
    }
 
    public void setActions(JButton[] actions) {
        this.actions = actions;
        updateMenu();
    }
 
    public void updateMenu() {
        for (JButton b : actions) {
            toolBarPanel.add(b);
        }
    }
 
    public JPanel getToolBar() {
        toolBarPanel.setLayout(flowlayout);
        return toolBarPanel;
    }
 
    public AbstractUIFunclet(FunctionObject funcObj) {
        super(funcObj);
        init();
    }
 
    private void init() {
        initUI();
        initData();
        initDetailData();
    }
 
    private void initDetailData() {
        this.getRightMainPanel().getFunclet().enable(false);
        this.getRightMainPanel().getRuleNameTextField().setEnabled(false);
        this.getRightMainPanel().getOrdinaryOpPanel().setEnabled(false);
        this.getRightMainPanel().getRelationAndLifeCycleOpPanel().setEnabled(false);
        this.getRightMainPanel().getSelectedSubjectComponent().setEnabled(false);
    }
 
    private void initData() {
        // 规则信息
        BooleanTableModel rules = new BooleanTableModel();
        this.getRightMainPanel().getRuleTable().setModel(rules);
        UserModel usermodel = new UserModel();
        this.getRightMainPanel().getUserTable().setModel(usermodel);
 
        RoleModel roleModel = new RoleModel();
        this.getRightMainPanel().getRoleTable().setModel(roleModel);
 
        UserGroupModel ugModel = new UserGroupModel();
        this.getRightMainPanel().getUserGroupTable().setModel(ugModel);
 
        // 增加树监听器
        this.addResourceTreeSelectListener();
        // 新增
        NewAction add = new NewAction("新增");
        add.setDragEnable(true);
        add.setFunclet(this);
        // 修改
        EditAction edit = new EditAction("编辑");
        edit.setDragEnable(true);
        edit.setFunclet(this);
        // 刷新
        RefreshAction modify = new RefreshAction("刷新");
        modify.setFunclet(this);
        modify.setDragEnable(true);
        // 删除
        DelAction del = new DelAction("删除");
        del.setFunclet(this);
        del.setDragEnable(true);
        // 保存
        SaveRuleAction save = new SaveRuleAction("保存");
        save.setFunclet(this);
        save.setDragEnable(true);
 
        // 查看授权结果
        CheckRightAction checkRight = new CheckRightAction("查看授权结果");
        checkRight.setFunclet(this);
        checkRight.setDragEnable(true);
        // this.setActions(new JButton[] { add, modify, del, save, edit });
        // right center tool bar
        this.getRightMainPanel().getRightCenterToolBar().add(add);
        this.getRightMainPanel().getRightCenterToolBar().add(modify);
        this.getRightMainPanel().getRightCenterToolBar().add(del);
        this.getRightMainPanel().getRightCenterToolBar().add(save);
        this.getRightMainPanel().getRightCenterToolBar().add(edit);
        this.getRightMainPanel().getRightCenterToolBar().add(checkRight);
        SelectUserAction selectUser = new SelectUserAction("选择用户");
        selectUser.setFunclet(this);
        SelectRoleAction selectRole = new SelectRoleAction("选择角色");
        selectRole.setFunclet(this);
        SelectDepAction selectDep = new SelectDepAction("选择用户组");
        selectDep.setFunclet(this);
        this.getRightMainPanel().setSubjectActions(new JButton[] { selectUser, selectRole, selectDep });
 
        OpsAllClearAction clear = new OpsAllClearAction("清空");
        clear.setFunclet(this);
        OpsAllSelectAction allSelelct = new OpsAllSelectAction("全选");
        allSelelct.setFunclet(this);
 
        this.getRightMainPanel().setOperationActions(new JButton[] { clear, allSelelct });
        // 一般操作
//        String[] operations = ActionConstants.getInstance().getAllBusinessActionNames();//IRightConstant.OPS_ORDINARY.split(",");
 
//        ((OrdinaryOpPanel) this.getRightMainPanel().getOrdinaryOpPanel())
//                .setOperations(operations);
 
        this.enable(false);
    }
 
    private void initUI() {
        this.gbc = new GridBagConstraints();
        this.gbc.gridx = 0;
        this.gbc.gridy = 0;
        this.gbc.weightx = 0.7;
        this.gbc.weighty = 1.0;
        this.gbc.fill = GridBagConstraints.HORIZONTAL;
        this.setBackground(Color.WHITE);
        this.setLayout(new BorderLayout(0, 0));
        // Tool bar
        this.add(getToolBar(actions), BorderLayout.NORTH);
        // split
        getRightMainPanel().setFunclet(this);
        this.add(getSplitPane(JSplitPane.HORIZONTAL_SPLIT, getLeftMain(), getRightMainPanel()), BorderLayout.CENTER);
    }
 
    private JPanel getToolBar(JButton[] buttons) {
        toolBarPanel.setLayout(flowlayout);
        if (buttons == null) {
            return toolBarPanel;
        }
        for (JButton b : buttons) {
            toolBarPanel.add(b);
        }
        return toolBarPanel;
    }
 
    private JPanel getLeftMain() {
        // main panel
        leftMainPanel.setLayout(new BorderLayout());
        JPanel leftNorthPanel = new JPanel();
        JPanel leftCenterPanel = new JPanel();
        //JPanel leftSouthPanel = new JPanel();
 
        // JScrollPane滚动条
        JScrollPane jscrollPane = new JScrollPane();
 
        leftMainPanel.add(leftNorthPanel, BorderLayout.NORTH);
        leftMainPanel.add(leftCenterPanel, BorderLayout.CENTER);
        //leftMainPanel.add(leftSouthPanel, BorderLayout.SOUTH);
 
        // left main center tree
        leftCenterPanel.setLayout(new BorderLayout());
        leftCenterPanel.add(jscrollPane, BorderLayout.CENTER);
        jscrollPane.getViewport().add(resourceTree);
        // left main north text
        final JTextField textField = new JTextField();
        // add by caill
        // 给业务类型树添加定位按钮
        final JButton sel = new JButton("定位");
        leftNorthPanel.setLayout(new GridBagLayout());
        leftNorthPanel.add(textField, gbc);
        leftNorthPanel.add(sel);
        // add by caill start
        // 为定位按钮添加点击事件
        sel.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                // e.getSource();
                String test = textField.getText().trim();
                DefaultTreeModel model = (DefaultTreeModel) resourceTree.getModel();
                model.reload();
                TreeNode root = (TreeNode) model.getRoot();
                PostorderEnumeration enumeration = new PostorderEnumeration(root);
                while (enumeration.hasMoreElements()) {
                    DefaultMutableTreeNode element = (DefaultMutableTreeNode) enumeration.nextElement();
                    if (element.getUserObject() instanceof BtmItemWrapper) {
                        BtmItemWrapper wrapper = (BtmItemWrapper) element.getUserObject();
 
                        if (wrapper != null && wrapper.btmItem != null && wrapper.btmItem.name.equals(test)) {
                            TreeNode[] path = element.getPath();
                            TreePath treePath = new TreePath(path);
                            resourceTree.setSelectionPath(treePath);
                            return;
                        }
                    }
                }
                if (test.equals("")) {
                    JOptionPane.showMessageDialog(com.vci.client.LogonApplication.frame, "请输入业务类型", "提示",
                            JOptionPane.INFORMATION_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(com.vci.client.LogonApplication.frame,
                            "{ " + test + " }业务类型不存在", "提示", JOptionPane.INFORMATION_MESSAGE);
                }
 
            }
 
        });
        // add by caill end
        textField.addActionListener(new ActionListener() {
 
            @Override
            public void actionPerformed(ActionEvent e) {
                JTextField text = (JTextField) e.getSource();
                String test = text.getText().trim();
                DefaultTreeModel model = (DefaultTreeModel) resourceTree.getModel();
                model.reload();
                TreeNode root = (TreeNode) model.getRoot();
                PostorderEnumeration enumeration = new PostorderEnumeration(root);
                while (enumeration.hasMoreElements()) {
                    DefaultMutableTreeNode element = (DefaultMutableTreeNode) enumeration.nextElement();
                    if (element.getUserObject() instanceof BtmItemWrapper) {
                        BtmItemWrapper wrapper = (BtmItemWrapper) element.getUserObject();
 
                        if (wrapper != null && wrapper.btmItem != null && wrapper.btmItem.name.equals(test)) {
                            TreeNode[] path = element.getPath();
                            TreePath treePath = new TreePath(path);
                            resourceTree.setSelectionPath(treePath);
                            return;
                        }
                        ;
                    }
                }
                if (test.equals("")) {
                    JOptionPane.showMessageDialog(com.vci.client.LogonApplication.frame, "请输入业务类型", "提示",
                            JOptionPane.INFORMATION_MESSAGE);
                } else {
                    JOptionPane.showMessageDialog(com.vci.client.LogonApplication.frame,
                            "{ " + test + " }业务类型不存在", "提示", JOptionPane.INFORMATION_MESSAGE);
                }
 
            }
 
        });
 
        // left main south tool bar
//        leftSouthPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
//        ExpandAction one = new ExpandAction("1");
//        one.setFunclet(this);
//        one.setLevel(1);
//        leftSouthPanel.add(one);
//
//        ExpandAction two = new ExpandAction("2");
//        two.setFunclet(this);
//        two.setLevel(2);
//        leftSouthPanel.add(two);
//
//        ExpandAction third = new ExpandAction("3");
//        third.setFunclet(this);
//        third.setLevel(3);
//        leftSouthPanel.add(third);
//
//        ExpandAction four = new ExpandAction("4");
//        four.setFunclet(this);
//        four.setLevel(4);
//        leftSouthPanel.add(four);
//
//        ExpandAction five = new ExpandAction("5");
//        five.setFunclet(this);
//        five.setLevel(5);
//        leftSouthPanel.add(five);
//
//        ExpandAction six = new ExpandAction("6");
//        six.setFunclet(this);
//        six.setLevel(6);
//        leftSouthPanel.add(six);
 
        return leftMainPanel;
    }
 
    private JSplitPane getSplitPane(int type, JComponent one, JComponent other) {
        // split (JSplitPane.HORIZONTAL_SPLIT)
        JSplitPane centerPanel = new JSplitPane(type, one, other);
        centerPanel.setDividerLocation(Toolkit.getDefaultToolkit().getScreenSize().width / 5);
        // 是否可以展开
        centerPanel.setOneTouchExpandable(true);
        return centerPanel;
    }
 
    public void enable(boolean value) {
        // 规则名称
        this.getRightMainPanel().getRuleNameTextField().setEnabled(value);
        // 规则面板的Combobox
        this.getRightMainPanel().getRuleTypeCombbox().setEnabled(value);
        // 主体面板的Action
        JButton[] actions = this.getRightMainPanel().getSubjectActions();
        for (JButton button : actions) {
            button.setEnabled(value);
        }
        // 操作面板Action
 
        JButton[] opActions = this.getRightMainPanel().getOperationActions();
        for (JButton button : opActions) {
            button.setEnabled(value);
        }
        // 一般操作控件
        JCheckBox[] checkBoxs = ((OrdinaryOpPanel) this.getRightMainPanel().getOrdinaryOpPanel()).getOpCheckBoxs();
        for (JCheckBox cb : checkBoxs) {
 
            // cb.isSelected()
            cb.setEnabled(value);
        }
        // 关系和跃迁
        JCheckBox[] rlcheckBoxs = ((RelationAndLifeCycleOpPanel) this.getRightMainPanel()
                .getRelationAndLifeCycleOpPanel()).getOpCheckBoxs();
        for (JCheckBox cb : rlcheckBoxs) {
 
            // cb.isSelected()
            cb.setEnabled(value);
        }
 
    }
 
    public AbstractUIFunclet getFunclet() {
        return this;
    }
 
    public void addResourceTreeSelectListener() {
        BtmTree tree = getFunclet().getResourceTree();
        
        tree.addTreeSelectionListener(new TreeSelectionListener() {
            public void valueChanged(TreeSelectionEvent e) {
                TreePath path = e.getPath();
                if (path == null) {
                    return;
                }
                DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
                if (!node.isRoot()) {
                    BtmItemWrapper bizItem = (BtmItemWrapper) node.getUserObject();
                    // 重新刷新规则面板信息
                    GrandValue[] dataSets = RightManagerHelper.getRightDatas(bizItem.btmItem.name);
                    // 设置规则Table
                    // add by caill 2015.12.18 增加参数bizItem.btmItem.name
                    RightManagerHelper.setRuleListDatas(getFunclet(), dataSets, bizItem.btmItem.name);
                    // 刷新操作中的生命周期与链接
 
                    initLcOfOperationPanel(bizItem.btmItem);
                    initActions(bizItem.btmItem.name);
 
                } else {
                    RightManagerHelper.clear(getFunclet());
                }
                enable(false);
                getRightMainPanel().getLeft().setEnabled(false);
                getRightMainPanel().getRight().setEnabled(false);
            }
        });
        
//        tree.addMouseListener(new MouseListener() {
//
//            @Override
//            public void mouseReleased(MouseEvent e) {
//
//            }
//
//            @Override
//            public void mousePressed(MouseEvent e) {
//
//            }
//
//            @Override
//            public void mouseExited(MouseEvent e) {
//
//            }
//
//            @Override
//            public void mouseEntered(MouseEvent e) {
//
//            }
//
//            @Override
//            public void mouseClicked(MouseEvent e) {
//                BtmTree resource = (BtmTree) e.getSource();
//                TreePath path = resource.getSelectionPath();
//                if (path == null) {
//                    return;
//                }
//                DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
//                if (!node.isRoot()) {
//                    BtmItemWrapper bizItem = (BtmItemWrapper) node.getUserObject();
//                    // 重新刷新规则面板信息
//                    GrandValue[] dataSets = RightManagerHelper.getRightDatas(bizItem.btmItem.name);
//                    // 设置规则Table
//                    // add by caill 2015.12.18 增加参数bizItem.btmItem.name
//                    RightManagerHelper.setRuleListDatas(getFunclet(), dataSets, bizItem.btmItem.name);
//                    // 刷新操作中的生命周期与链接
//
//                    initLcOfOperationPanel(bizItem.btmItem);
//                    initActions(bizItem.btmItem.name);
//
//                } else {
//                    RightManagerHelper.clear(getFunclet());
//                }
//                enable(false);
//                getRightMainPanel().getLeft().setEnabled(false);
//                getRightMainPanel().getRight().setEnabled(false);
//            }
//        });
 
    }
 
    private void initActions(String typeName) {
        // String[] operations =
        // ActionConstants.getInstance().getAllBuinessActionNamesByType(typeName,
        // "business");//IRightConstant.OPS_ORDINARY.split(",");
        // ((OrdinaryOpPanel)
        // this.getRightMainPanel().getOrdinaryOpPanel()).setOperations(operations);
        // add by caill start 2015.12.18
        Map<String, String> operations2 = ActionConstants.getInstance().getAllBuinessActionNamesByType2(typeName,
                "business");
        ((OrdinaryOpPanel) this.getRightMainPanel().getOrdinaryOpPanel()).setOperations2(operations2);
        // add by caill end
    }
 
    public void initLcOfOperationPanel(BtmItem btmName) {
        // 初始化
        ((RelationAndLifeCycleOpPanel) this.getRightMainPanel().getRelationAndLifeCycleOpPanel()).removeAll();
        // 关系和跃迁
        // 缓存中读取链接的信息
        LinkType[] links = null;
        LifeCycle lifeCycle = null;
        try {
            links = LinkTypeProvider.getInstance().getLinkTypeByBtmName(btmName.name, Symbol.FROM);
            LifeCycle[] lifeCyles = LifeCycleProvider.getInstance().getLifeCyles();
            for (int m = 0; m < lifeCyles.length; m++) {
                if (lifeCyles[m].name.equals(btmName.lifeCycle)) {
                    lifeCycle = lifeCyles[m];
                    break;
                }
            }
        } catch (Throwable e) {
            e.printStackTrace();
        }
        List<String> rloperations = new ArrayList<String>();
        //
//        String[] linkActions = ActionConstants.getInstance().getAllLinkActionNames();
        // add by caill start 2016.1.6 将关系和跃迁区域内的英文显示为中文
        List<String> rloperationsChina = new ArrayList<String>();
        Map<String, String> linkActions = ActionConstants.getInstance().getAllBuinessActionNamesByType2(btmName.name,
                "link");// 将对应的中英文值存放到map中
        Set<String> keys = null;
        if (linkActions.size() > 0) {
            keys = linkActions.keySet();
        }
        for (int i = 0; i < links.length; i++) {
            if (keys.size() != 0) {
                for (Iterator<String> iterator = keys.iterator(); iterator.hasNext();) {
                    JCheckBox cb = new JCheckBox();
                    String key = iterator.next();
                    rloperations.add(links[i].name + "." + linkActions.get(key));
                    rloperationsChina.add(links[i].name + "." + key); // 增加一个list用来存放中文值
                }
            }
        }
        // add by caill end
        /*
         * String[] linkActions =
         * ActionConstants.getInstance().getAllBuinessActionNamesByType(btmName.name,
         * "link"); for (int i = 0; i < links.length; i++) { for (int j = 0; j <
         * linkActions.length; j++) { rloperations.add(links[i].name + "." +
         * linkActions[j]); } }
         */
        TransitionVO[] transitions = lifeCycle != null ? lifeCycle.routes : new TransitionVO[0];
        for (int j = 0; j < transitions.length; j++) {
            rloperations.add(lifeCycle.name + "." + transitions[j].connect);
        }
        ((RelationAndLifeCycleOpPanel) this.getRightMainPanel().getRelationAndLifeCycleOpPanel()).setOperations(
                rloperations.toArray(new String[rloperations.size()]),
                rloperationsChina.toArray(new String[rloperationsChina.size()])); // add by caill 2016.1.6
                                                                                    // 添加rloperationsChina参数以便将中文值传递过去
        // 关系和跃迁
        JCheckBox[] rlcheckBoxs = ((RelationAndLifeCycleOpPanel) this.getRightMainPanel()
                .getRelationAndLifeCycleOpPanel()).getOpCheckBoxs();
        for (JCheckBox cb : rlcheckBoxs) {
            // cb.isSelected()
            cb.setEnabled(false);
        }
    }
 
    public static void main(String[] args) {
//        CheckValue params = new CheckValue();
//        try {
//            params.users = "1";
//            params.roles = "测试角色";
//            params.userGroups = "";
//            params.paramValues = "";
//            params.businesstype = "PartClsf";
//            params.opname = "mody";
//            params.objectmoid = "";
//            params.objectroid = "";
//            params.objectoid = "D2AB2C96-9BF4-AB14-BEF9-85CFF0036D0B";
//
//            String where = RightManagerHelper.getAuth2Service().checkRight(params);
//            String[] ops = where.split(":");
//            List<OpItem> opitems = new ArrayList<OpItem>();
//            for (String s : ops) {
//                if (s != null && !s.equals("")) {
//                    OpItem item = new OpItem();
//                    String[] op = s.split(",");
//                    item.setName(op[0]);
//                    item.setValue(op[1]);
//                    opitems.add(item);
//                }
//
//            }
//
//        } catch (VCIError e) {
//            e.printStackTrace();
//        }
        // UserEntityObject ueo = new UserEntityObject();
        // ueo.setIp("192.168.0.50");
        // ueo.setUserName("eddieliu");
        // com.vci.rmip.logon.client.LogonApplication.userEntityObject = ueo;
        // UserObject user = new UserObject();
        // user.setUserType(2);
        // user.setUserName("shebei");
        // user.setTrueName("设备");
        // com.vci.rmip.logon.client.LogonApplication.userObject = user;
        //
        // VCIJFrame frame = new VCIJFrame();
        // frame.setSize(1600, 880);
        // com.vci.rmip.logon.client.LogonApplication.frame = frame;
        //
        // AbstractUIFunclet view = (AbstractUIFunclet) AbstractUIFunclet
        // .getInstance();
        //
        // frame.add(view);
        // // 规则信息
        // RuleModel rules = new RuleModel();
        // view.getRightMainPanel().getRuleTable().setModel(rules);
        //
        // UserModel usermodel = new UserModel();
        // view.getRightMainPanel().getUserTable().setModel(usermodel);
        //
        // RoleModel roleModel = new RoleModel();
        // view.getRightMainPanel().getRoleTable().setModel(roleModel);
        //
        // UserGroupModel ugModel = new UserGroupModel();
        // view.getRightMainPanel().getUserGroupTable().setModel(ugModel);
        // // 增加树监听器
        // view.addResourceTreeSelectListener();
        // // 新增
        // NewAction add = new NewAction("新增");
        // add.setDragEnable(true);
        // add.setFunclet(view);
        // // 修改
        // EditAction edit = new EditAction("编辑");
        // edit.setDragEnable(true);
        // edit.setFunclet(view);
        // // 刷新
        // RefreshAction modify = new RefreshAction("刷新");
        // modify.setFunclet(view);
        // modify.setDragEnable(true);
        // // 删除
        // DelAction del = new DelAction("删除");
        // del.setFunclet(view);
        // del.setDragEnable(true);
        // // 保存
        // SaveRuleAction save = new SaveRuleAction("保存");
        // save.setFunclet(view);
        // save.setDragEnable(true);
        // // view.setActions(new JButton[] { add, modify, del, save, edit });
        // // right center tool bar
        // view.getRightMainPanel().getRightCenterToolBar().add(add);
        // view.getRightMainPanel().getRightCenterToolBar().add(modify);
        // view.getRightMainPanel().getRightCenterToolBar().add(del);
        // view.getRightMainPanel().getRightCenterToolBar().add(save);
        // view.getRightMainPanel().getRightCenterToolBar().add(edit);
        // SelectUserAction selectUser = new SelectUserAction("选择用户");
        // selectUser.setFunclet(view);
        // SelectRoleAction selectRole = new SelectRoleAction("选择角色");
        // selectRole.setFunclet(view);
        // SelectDepAction selectDep = new SelectDepAction("选择部门");
        // selectDep.setFunclet(view);
        // view.getRightMainPanel().setSubjectActions(
        // new JButton[] { selectUser, selectRole, selectDep });
        //
        // OpsAllClearAction clear = new OpsAllClearAction("清空");
        // clear.setFunclet(view);
        // OpsAllSelectAction allSelelct = new OpsAllSelectAction("全选");
        // allSelelct.setFunclet(view);
        //
        // view.getRightMainPanel().setOperationActions(
        // new JButton[] { clear, allSelelct });
        // // 一般操作
        // String[] operations =
        // "add,del,mody,change,view,query,revision,delall,object,version,hello,upload,download"
        // .split(",");
        //
        // ((OrdinaryOpPanel) view.getRightMainPanel().getOrdinaryOpPanel())
        // .setOperations(operations);
        // // 关系和跃迁
        // String[] rloperations =
        // "ptop.add ,ptop.del,ptop.mody,lc.begin,lc.end"
        // .split(",");
        // ((RelationAndLifeCycleOpPanel) view.getRightMainPanel()
        // .getRelationAndLifeCycleOpPanel()).setOperations(rloperations);
        // view.enable(false);
        // frame.show();
    }
 
    @Override
    public String getUserID() {
        // TODO Auto-generated method stub
        return null;
    }
 
    @Override
    public String getRoleID() {
        // TODO Auto-generated method stub
        return null;
    }
 
    @Override
    public JPanel getModuleComponent() {
        // TODO Auto-generated method stub
        return null;
    }
 
    @Override
    public String getModuleName() {
        // TODO Auto-generated method stub
        return null;
    }
 
    @Override
    public String getIconName() {
        // TODO Auto-generated method stub
        return null;
    }
 
    @Override
    public String getModuleShowInfo() {
        // TODO Auto-generated method stub
        return null;
    }
 
}