4,10 → 4,10 |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.43 $ |
* @version $Revision: 1.44 $ |
* |
* Last modification: $Date: 2003/07/19 14:12:50 $ |
* $Id: UpdateView.java,v 1.43 2003/07/19 14:12:50 cstollen Exp $ |
* Last modification: $Date: 2003/07/21 18:55:34 $ |
* $Id: UpdateView.java,v 1.44 2003/07/21 18:55:34 smcsporr Exp $ |
*/ |
|
package src.gui; |
16,6 → 16,7 |
import java.awt.event.ActionListener; |
|
import java.util.Enumeration; |
import java.util.LinkedList; |
|
import javax.swing.JOptionPane; |
|
44,7 → 45,7 |
* |
* @author Christian Stollenwerk |
* |
* @version $Revision: 1.43 $ Last modification: $Date: 2003/07/19 14:12:50 $ |
* @version $Revision: 1.44 $ Last modification: $Date: 2003/07/21 18:55:34 $ |
*/ |
public class UpdateView implements ActionListener, UpdateViewInterface, |
OurEventListener, TreeModelListener, TreeExpansionListener { |
61,7 → 62,7 |
private PluginManagerInterface pluginManagerInterface; |
private int dividerPosition; |
private PopUpJTree newPopUpJTree; |
private Enumeration treeVisibleList; |
private LinkedList treeVisibleList; |
private boolean makeTreeView = false; |
|
public UpdateView() { |
148,22 → 149,31 |
newPopUpJTree = new PopUpJTree(newTreeModel); |
newPopUpJTree.addTreeExpansionListener(this); |
newPopUpJTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); |
newPopUpJTree.setRootVisible(false); |
|
|
// set the elements visible, which have been visible before |
treeVisibleList = documentManagerInterface.getActualVisibleTree(); |
System.out.println("treeVisibleList = " + treeVisibleList); |
if(treeVisibleList != null) { |
if(treeVisibleList.size() != 0) { |
makeTreeView = true; |
System.out.println("treeVisibleList.hasMoreElements() = " + treeVisibleList.hasMoreElements()); |
while(treeVisibleList.hasMoreElements()) { |
TreePath nextElement = (TreePath)treeVisibleList.nextElement(); |
System.out.println("expandPath " + nextElement); |
newPopUpJTree.expandPath(nextElement); |
|
int selectedRow=((Integer)treeVisibleList.getFirst()).intValue(); |
treeVisibleList.removeFirst(); |
Integer[] intList = (Integer[])treeVisibleList.toArray(); |
java.util.Arrays.sort(intList); |
newPopUpJTree.expandRow(0); |
|
for(int i =0; i<intList.length;i++){ |
|
|
newPopUpJTree.expandRow(intList[i].intValue()); |
|
} |
|
newPopUpJTree.treeDidChange(); |
makeTreeView = false; |
} |
newPopUpJTree.setRootVisible(false); |
|
//added 070703 Sascha W. |
TreeSelectionListener hui = pluginManagerInterface.getTreeSelectionListener(); |
308,9 → 318,15 |
*/ |
public void treeExpanded(TreeExpansionEvent arg0) { |
if(! makeTreeView) { |
System.out.println("setActualVisibleTree: " + newPopUpJTree.getExpandedDescendants(newPopUpJTree.getPathForRow(1))); |
documentManagerInterface.setActualVisibleTree(newPopUpJTree.getExpandedDescendants( |
newPopUpJTree.getPathForRow(1))); |
Enumeration list = newPopUpJTree.getExpandedDescendants(newPopUpJTree.getPathForRow(0)); |
LinkedList ll = new LinkedList(); |
ll.addFirst(new Integer(newPopUpJTree.getSelectionRows()[0])); |
while(list.hasMoreElements()) { |
TreePath nextElement = (TreePath)list.nextElement(); |
ll.add(new Integer(newPopUpJTree.getRowForPath(nextElement))); |
} |
|
documentManagerInterface.setActualVisibleTree(ll); |
} |
} |
} |