📄 workflow_showflowmanager.java
字号:
package treedoc;
//将文档与流程进行管理的类
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
public class workflow_showFlowManager
extends JPanel {
JList jList1 = new JList();
workflow_StepMain wsm = new workflow_StepMain("");
workflow_IntoSql isql = new workflow_IntoSql("");
JFrame jff;
JTree jtree2;
DefaultMutableTreeNode root1, node2;
String doc;
BorderLayout borderLayout1 = new BorderLayout();
public workflow_showFlowManager(String docname, JFrame jf, JTree jtree1,
DefaultMutableTreeNode root) {
doc = docname;
jff = jf;
jtree2 = jtree1;
root1 = root;
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(borderLayout1);
jList1.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
jList1.setBackground(SystemColor.textHighlightText);
jList1.setFont(new java.awt.Font("Dialog", 1, 14));
jList1.setBorder(BorderFactory.createEtchedBorder());
jList1.setDoubleBuffered(false);
jList1.setVerifyInputWhenFocusTarget(true);
jList1.setSelectedIndex( -1);
jList1.setListData(wsm.get_workflow());
jList1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jList1.addMouseListener(new workflow_showFlowManager_jList1_mouseAdapter(this));
this.add(jList1, BorderLayout.CENTER);
}
void jList1_mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) { //将流程进行关联
isql.DocAflow(jList1.getSelectedValue().toString(), doc);
JOptionPane.showMessageDialog(null, jList1.getSelectedValue().toString()+"流程已经和该文件关联");
// cell.removeFromParent();
jtree2.updateUI();
jtree2.setRowHeight(25);
createnode1(doc,jList1.getSelectedValue().toString());
jtree2.updateUI();
jtree2.setRowHeight(25);
jff.dispose();
}
}
public void createnode1(Object nodename,String wf_name) {
try {
DefaultMutableTreeNode nodel = new DefaultMutableTreeNode(nodename+"@"+wf_name);
jtree2.isEditable();
if (root1.getChildCount() == 4) {
node2 = (DefaultMutableTreeNode) root1.getChildAt(2);
}
node2.add(nodel);
jtree2.setRowHeight(25);
jtree2.updateUI();
jtree2.setRowHeight(25);
}
catch (Exception e) {
System.out.println(e);
}
}
}
class workflow_showFlowManager_jList1_mouseAdapter
extends java.awt.event.MouseAdapter {
workflow_showFlowManager adaptee;
workflow_showFlowManager_jList1_mouseAdapter(workflow_showFlowManager adaptee) {
this.adaptee = adaptee;
}
public void mouseClicked(MouseEvent e) {
adaptee.jList1_mouseClicked(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -