?? differentialwizard.java
字號:
package cdt.projects.tree.wizards.diffdx;import javax.swing.*;import javax.swing.text.Position;import javax.swing.tree.TreePath;import cdt.projects.Project;import cdt.projects.tree.nodes.Hold;import cdt.projects.tree.nodes.Node;import cdt.wizard.WizardFrame;/** * Initiates a wizard to configure the differential diagnosises in an interactive case. */public class DifferentialWizard extends WizardFrame { /** The JFrame acting as the parent to this wizard. */ private JFrame parent; /** * Creates the differential diagnosis wizard. * * @param parent The parent JFrame, in this case typically an instance of * {@link cdt.Frame1 Frame1}. */ public DifferentialWizard(JFrame parent) { super(parent); this.parent = parent; JTree projectTree = Project.currentProject.getTree(); // Finds the 'Differential Diagnosises' folder in the ProjectTree TreePath treePath = projectTree.getNextMatch("Differential Diagnosis", 0, Position.Bias.Forward); Node diffDiagFolder = null; if(null != treePath && treePath.getLastPathComponent() instanceof Hold) { diffDiagFolder = (Node)treePath.getLastPathComponent(); } else { diffDiagFolder = new Hold("Differential Diagnosis"); diffDiagFolder.setFile(Node.foldername(diffDiagFolder.getName())); Hold rootNode = (Hold)projectTree.getPathForRow(0).getLastPathComponent(); rootNode.addNodeInto(diffDiagFolder); } treePath = projectTree.getNextMatch("Final Diagnosis", 0, Position.Bias.Forward); Node finalDiagFolder = null; if(null != treePath && treePath.getLastPathComponent() instanceof Hold) { finalDiagFolder = (Node)treePath.getLastPathComponent(); } else { finalDiagFolder = new Hold("Final Diagnosis"); Hold rootNode = (Hold)projectTree.getPathForRow(0).getLastPathComponent(); finalDiagFolder.setFile(Node.foldername(finalDiagFolder.getName())); rootNode.addNodeInto(finalDiagFolder); } projectTree.updateUI(); putData("diffDiagFolder", diffDiagFolder); putData("finalDiagFolder", finalDiagFolder); init(); } /** * Sets up the layout of this page. */ public void customize() { showPreviousButton(false); showFinishButton(false); setTitle("Differential Diagnosis Wizard"); JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(new JLabel("This wizard configures the differential diagnosis for an interactive case, " +"and")); panel.add(new JLabel("will overwrite any old differential diagnosis information that you may have")); panel.add(new JLabel(" ")); panel.add(new JLabel("Please hit the 'next' button to begin the differential diagnosis" + " creation process.")); centerPanel.add(panel); } /** * Moves to the next page in the wizard. */ public void nextAction() { pushFrame(this); setVisible(false); // Creates the folder to store the new quiz in data.put("new diffDxFolder", new Hold("Differential Diagnosises")); data.put("new finalDxFolder", new Hold("Final Diagnosis")); Project.currentProject.getTree().firePageNeededEvent(); // Creates the next page in the wizard new DifferentialWizard1(parent); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -