View Javadoc

1   /*
2    *  File: HierarchicalViewState.java 
3    *  Copyright (c) 2004-2007  Peter Kliem (Peter.Kliem@jaret.de)
4    *  A commercial license is available, see http://www.jaret.de.
5    *
6    *  This program is free software; you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation; either version 2 of the License, or
9    *  (at your option) any later version.
10   *
11   *  This program is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   *  GNU General Public License for more details.
15   *
16   *  You should have received a copy of the GNU General Public License
17   *  along with this program; if not, write to the Free Software
18   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */
20  package de.jaret.util.ui.timebars.model;
21  
22  /**
23   * Interface describing the viewstate of a hierarchical time bar model (expanded/not expanded). Please note that the
24   * HierarchicalViewStateListener does not support the selection of nodes by path, so equal nodes will always have an
25   * equal state. Maybe this will change in future version.
26   * 
27   * @author Peter Kliem
28   * @version $Id: HierarchicalViewState.java 531 2007-08-12 22:25:36Z olk $
29   */
30  public interface HierarchicalViewState {
31      /**
32       * Check whether a node is expanded.
33       * 
34       * @param node node to check
35       * @return true if expanded
36       */
37      boolean isExpanded(TimeBarNode node);
38  
39      /**
40       * Set the expanded state for a single node.
41       * 
42       * @param node node to set the expand state for
43       * @param expanded true for expanded
44       */
45      void setExpanded(TimeBarNode node, boolean expanded);
46  
47      /**
48       * Set the expanded state for a node and all of it's children.
49       * 
50       * @param node starting node
51       * @param expanded expanded state to set
52       */
53      void setExpandedRecursive(TimeBarNode node, boolean expanded);
54  
55      /**
56       * Add a view state listener.
57       * 
58       * @param hvsListener listener to add
59       */
60      void addHierarchicalViewstateListener(HierarchicalViewStateListener hvsListener);
61  
62      /**
63       * Remove a view state listener.
64       * 
65       * @param hvsListener listener to remove
66       */
67      void remHierarchicalViewStateListener(HierarchicalViewStateListener hvsListener);
68  }