From: Mark W. <ri...@us...> - 2002-02-28 14:51:32
|
Update of /cvsroot/ipcop/IPCopJ/org/ipcop In directory usw-pr-cvs1:/tmp/cvs-serv18006/org/ipcop Modified Files: IPCopJ.java IPCopJRightPanel.java Log Message: Code reformat (and test with netbeans) Index: IPCopJ.java =================================================================== RCS file: /cvsroot/ipcop/IPCopJ/org/ipcop/IPCopJ.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IPCopJ.java 28 Feb 2002 12:33:42 -0000 1.2 --- IPCopJ.java 28 Feb 2002 14:35:44 -0000 1.3 *************** *** 15,71 **** public class IPCopJ extends JApplet { ! ! //Do you want to not show lines? if so unset the following ! private boolean playWithLineStyle = false; //Line Style choose one of : Angled, Horizontal, or None (default) ! private String lineStyle = "Angled"; ! ! //Initialise the Applet GUI To keep this simple there is a createNodes method ! //that actually creates the tree structure. ! public void init() { ! ! //Now start the top of our tree here to use and to define root for use ! DefaultMutableTreeNode root = new DefaultMutableTreeNode("Ipcop Firewall Menu:"); ! ! //create the rest of the tree by calling the method ! //createNodes() in the MakeTree class; ! new IPCopJMakeTree().createNodes(root); ! ! //make the tree and make is single selection of nodes only ! final JTree tree = new JTree(root); ! tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); ! ! //Now I need to implement a tree listener to detect node changes so ! //i can update the rightHand pane this is now seperated out ! //put this in a different java file to allow people to edit different parts ! tree.addTreeSelectionListener(new IPCopJCustomTreeListener()); ! ! //Just some eye candy stuff really if the initial variables are set to true ! if (playWithLineStyle) { ! tree.putClientProperty("JTree.lineStyle", lineStyle); } ! ! //Go about putting together the GUI ! JScrollPane leftHand = new JScrollPane(tree); ! ! //In a similar way we can use the tree listener result to ! //tell us which method to call :) ! ! //JScrollPane rightHand = new JScrollPane(new IPCopJRightPanel().examplePanel()); ! ! JSplitPane Overall = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); ! //Add stuff we made to the JSplitPane ! Overall.setLeftComponent(leftHand); ! ! //Set up some dimension stuff ! Overall.setPreferredSize(new Dimension(650, 400)); ! Dimension leftSize = new Dimension(250, 400); ! leftHand.setMinimumSize(leftSize); ! ! Overall.setDividerLocation(235); ! ! //Add everything to the Aplet structure ! getContentPane().add(Overall, BorderLayout.CENTER); ! } ! } --- 15,71 ---- public class IPCopJ extends JApplet { ! ! //Do you want to not show lines? if so unset the following ! private boolean playWithLineStyle = false; //Line Style choose one of : Angled, Horizontal, or None (default) ! private String lineStyle = "Angled"; ! ! //Initialise the Applet GUI To keep this simple there is a createNodes method ! //that actually creates the tree structure. ! public void init() { ! ! //Now start the top of our tree here to use and to define root for use ! DefaultMutableTreeNode root = new DefaultMutableTreeNode("Ipcop Firewall Menu:"); ! ! //create the rest of the tree by calling the method ! //createNodes() in the MakeTree class; ! new IPCopJMakeTree().createNodes(root); ! ! //make the tree and make is single selection of nodes only ! final JTree tree = new JTree(root); ! tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); ! ! //Now I need to implement a tree listener to detect node changes so ! //i can update the rightHand pane this is now seperated out ! //put this in a different java file to allow people to edit different parts ! tree.addTreeSelectionListener(new IPCopJCustomTreeListener()); ! ! //Just some eye candy stuff really if the initial variables are set to true ! if (playWithLineStyle) { ! tree.putClientProperty("JTree.lineStyle", lineStyle); } ! ! //Go about putting together the GUI ! JScrollPane leftHand = new JScrollPane(tree); ! ! //In a similar way we can use the tree listener result to ! //tell us which method to call :) ! ! //JScrollPane rightHand = new JScrollPane(new IPCopJRightPanel().examplePanel()); ! ! JSplitPane Overall = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); ! //Add stuff we made to the JSplitPane ! Overall.setLeftComponent(leftHand); ! ! //Set up some dimension stuff ! Overall.setPreferredSize(new Dimension(650, 400)); ! Dimension leftSize = new Dimension(250, 400); ! leftHand.setMinimumSize(leftSize); ! ! Overall.setDividerLocation(235); ! ! //Add everything to the Aplet structure ! getContentPane().add(Overall, BorderLayout.CENTER); ! } ! } Index: IPCopJRightPanel.java =================================================================== RCS file: /cvsroot/ipcop/IPCopJ/org/ipcop/IPCopJRightPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IPCopJRightPanel.java 28 Feb 2002 12:33:42 -0000 1.2 --- IPCopJRightPanel.java 28 Feb 2002 14:35:45 -0000 1.3 *************** *** 8,15 **** //change the contents of the right hand window depending on the node selected public class IPCopJRightPanel { ! ! public void Selection() { ! System.out.println("DO STUFF (Make a right table change)"); ! } ! } --- 8,15 ---- //change the contents of the right hand window depending on the node selected public class IPCopJRightPanel { ! ! public void Selection() { ! System.out.println("DO STUFF (Make a right table change)"); ! } ! } |