Java Doc for ExpansionState.java in  » Testing » KeY » de » uka » ilkd » key » gui » prooftree » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » KeY » de.uka.ilkd.key.gui.prooftree 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.AbstractCollection
      java.util.AbstractSet
         de.uka.ilkd.key.gui.prooftree.ExpansionState

ExpansionState
public class ExpansionState extends AbstractSet implements Serializable(Code)
Cache/Access JTree's expansion state. The interface of JTree to access the expanded paths is rather incomplete, since expanded paths under collapsed ancestors cannot be accessed at all (without modifying the expansion states, which doesn't work with vetos of TreeWillExpand- Listeners). By listening to TreeExpansionEvents, this class mirrors the expansion state for each path individually, independent from that of its ancestors. It also listens to the TreeModel to remove paths that have become invalid. ExpansionStates are serializable if the TreePaths themselves are, which they are if their components are. Typically you will want to only serialize the state(), which doesn't also serialize the JTree (If you wanted to serialize the JTree, you wouldn't need to the state for serialization purposes at all.) There are two ways to use this class: a) always have a ExpansionState around. Then the results will always be completely right (and always accessible without a lot of overhead). Serializing/exporting: Collection state = cache.state(new HashSet()); out.writeObject(state); When reading the state and creating the JTree, a new ExpansionState is created: Set state = (Set)in.readObject(); JTree tree = new JTree(data); ExpansionState cache = new ExpansionState(tree, state); Actually I don't like the side-effect of the constructor. Collections.EMPTY_SET can of course be used if there is no state yet. b) Only request the state on demand, and also restore it. This has less overhead during execution, but a) has to modify the expansion structure while trying to build the state, b) may actually confuse it due to vetoes of TreeWillExpandListeners, and c) may give wrong results for the same reason. Serializing/exporting: out.writeObject(ExpansionState.paths(tree, new HashSet())); Reading the state: Set state = (Set)in.readObject(); JTree tree = new JTree(data); ExpansionState.setPaths(tree, state); Note the example code uses HashSet because setPaths() does (and very probably always will) make use of contains(), which should thus be fast.



Constructor Summary
public  ExpansionState(JTree t)
     For the given JTree.
public  ExpansionState(JTree tree, Collection state)
     For the given JTree, with the given set of expanded paths.
public  ExpansionState(JTree tree, Collection state, boolean assumeCollapsed)
     For the given JTree, with the given set of expanded paths.

Method Summary
protected  Objectclone()
    
public static  voidcollapseAll(JTree tree)
     Will re-expand the root if it was expanded and the tree has an invisible root (otherwise the tree will appear empty, and there is no easy way for the user to change that.
public static  voidcollapseAll(JTree tree, TreePath root)
     requires: root is not a leaf.
public  booleancontains(Object item)
    
public  booleancontainsAll(Collection c)
    
public  booleancontainsAllAncestors(Collection c)
    
public  booleancontainsAncestors(TreePath path)
    
public  voiddisconnect(JTree t)
    
public static  voidexpandAll(JTree tree)
    
public static  voidexpandAll(JTree tree, TreePath path)
     requires: path is not a leaf.
public  booleanisEmpty()
    
public  Iteratoriterator()
    
public static  Collectionpaths(JTree tree, Collection result)
     All paths in the JTree that are expanded, including those under hidden parents.
public static  voidsetPaths(JTree tree, Collection paths)
     Try to expand exactly the paths given in paths.
public static  voidsetPaths(JTree tree, Collection paths, boolean assumeCollapsed)
     assumedCollapsed: if true, assume that (if at all) only the root is expanded.
public  intsize()
    
public  Collectionstate(Collection result)
    


Constructor Detail
ExpansionState
public ExpansionState(JTree t)(Code)
For the given JTree. Assumes only the root is expanded, if at all (for example, a freshly created JTree, or one for which the model has just been set)



ExpansionState
public ExpansionState(JTree tree, Collection state)(Code)
For the given JTree, with the given set of expanded paths. This is equivalent to using the normal constructor, and then calling setPaths(tree, state).



ExpansionState
public ExpansionState(JTree tree, Collection state, boolean assumeCollapsed)(Code)
For the given JTree, with the given set of expanded paths. This is equivalent to using the normal constructor, and then calling setPaths(tree, state, false);




Method Detail
clone
protected Object clone() throws CloneNotSupportedException(Code)



collapseAll
public static void collapseAll(JTree tree)(Code)
Will re-expand the root if it was expanded and the tree has an invisible root (otherwise the tree will appear empty, and there is no easy way for the user to change that.



collapseAll
public static void collapseAll(JTree tree, TreePath root)(Code)
requires: root is not a leaf. That implies that the tree's model is not null and does have a root.



contains
public boolean contains(Object item)(Code)



containsAll
public boolean containsAll(Collection c)(Code)



containsAllAncestors
public boolean containsAllAncestors(Collection c)(Code)
Are all the ancestors (including the paths) expanded?



containsAncestors
public boolean containsAncestors(TreePath path)(Code)
Are all the ancestors (including the path) expanded?



disconnect
public void disconnect(JTree t)(Code)



expandAll
public static void expandAll(JTree tree)(Code)



expandAll
public static void expandAll(JTree tree, TreePath path)(Code)
requires: path is not a leaf. That implies the tree has a model, and that has a root.



isEmpty
public boolean isEmpty()(Code)



iterator
public Iterator iterator()(Code)



paths
public static Collection paths(JTree tree, Collection result)(Code)
All paths in the JTree that are expanded, including those under hidden parents. The result is the same as if attaching an ExpansionState to the JTree (in creation state) and then calling state() on it. To return the proper result, this method must temporarily expand paths. If any TreeWillExpandListeners veto that, the result is undefined.



setPaths
public static void setPaths(JTree tree, Collection paths)(Code)
Try to expand exactly the paths given in paths. Of course requires them to be valid in the current TreeModel. Will give undefined results if any TreeWillExpandListeners veto. This implementation does not assume all paths are collapsed.



setPaths
public static void setPaths(JTree tree, Collection paths, boolean assumeCollapsed)(Code)
assumedCollapsed: if true, assume that (if at all) only the root is expanded. That way, the iteration over the tree nodes only goes to the maximum level of the nodes in 'paths'.



size
public int size()(Code)



state
public Collection state(Collection result)(Code)



Methods inherited from java.util.AbstractSet
public boolean equals(Object o)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean removeAll(Collection c)(Code)(Java Doc)

Methods inherited from java.util.AbstractCollection
public boolean add(Object o)(Code)(Java Doc)
public boolean addAll(Collection c)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public boolean contains(Object o)(Code)(Java Doc)
public boolean containsAll(Collection c)(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
abstract public Iterator iterator()(Code)(Java Doc)
public boolean remove(Object o)(Code)(Java Doc)
public boolean removeAll(Collection c)(Code)(Java Doc)
public boolean retainAll(Collection c)(Code)(Java Doc)
abstract public int size()(Code)(Java Doc)
public Object[] toArray()(Code)(Java Doc)
public Object[] toArray(Object[] a)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object o)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify() throws IllegalMonitorStateException(Code)(Java Doc)
final public void notifyAll() throws IllegalMonitorStateException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait() throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)
final public void wait(long ms) throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)
final public void wait(long ms, int ns) throws IllegalMonitorStateException, InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.