001 /* 002 Copyright (C) 2002 Renaud Pawlak, Laurent Martelli 003 004 This program is free software; you can redistribute it and/or modify 005 it under the terms of the GNU Lesser General Public License as 006 published by the Free Software Foundation; either version 2 of the 007 License, or (at your option) any later version. 008 009 This program is distributed in the hope that it will be useful, but 010 WITHOUT ANY WARRANTY; without even the implied warranty of 011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 Lesser General Public License for more details. 013 014 You should have received a copy of the GNU Lesser General Public 015 License along with this program; if not, write to the Free Software 016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 017 USA */ 018 019 package org.objectweb.jac.aspects.gui; 020 021 import javax.swing.tree.TreeNode; 022 import javax.swing.tree.TreePath; 023 024 /** 025 * The GUI terget independant tree view. */ 026 027 public interface TreeView { 028 029 /** 030 * Set the root node of the tree. 031 * @param root the root node 032 */ 033 void setRootNode(AbstractNode root); 034 035 /** 036 * Add a child node to a node 037 * @param parent the node to add the child node to 038 * @param child the node to add 039 */ 040 void addNode(AbstractNode parent, AbstractNode child); 041 042 /** 043 * Upcalled when a substance changed for a given node. 044 * 045 * @param node the node that changed 046 */ 047 void nodeChanged(TreeNode node); 048 049 /** 050 * Upcalled when nodes where removed in this tree. 051 * 052 * @param node the parent node from where the nodes were removed 053 * @param indices the indices of the removed nodes 054 * @param removedNodes the removed nodes 055 */ 056 void nodesWereRemoved(TreeNode node,int[] indices, Object[] removedNodes); 057 058 /** 059 * Upcalled when nodes where inserted in this tree. 060 * 061 * @param node the parent node from where the nodes were inserted 062 * @param indices the indices of the inserted nodes 063 */ 064 void nodesWereInserted(TreeNode node,int[] indices); 065 066 /** 067 * Sets the selected node for this tree. 068 * 069 * @param selectionPath a tree path indicating the selected node 070 */ 071 void setSelection(TreePath selectionPath); 072 }