Java Doc for DefaultOutlineModel.java in  » IDE-Netbeans » web.core » org » netbeans » swing » outline » 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 » IDE Netbeans » web.core » org.netbeans.swing.outline 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.swing.outline.DefaultOutlineModel

DefaultOutlineModel
public class DefaultOutlineModel implements OutlineModel(Code)
Proxies a standard TreeModel and TableModel, translating events between the two. Note that the constructor is not public; the TableModel that is proxied is the OutlineModel's own. To make use of this class, implement RowModel - that is a mini-table model in which the TreeModel is responsible for defining the set of rows; it is passed an object from the tree, which it may use to generate values for the other columns. Pass that and the TreeModel you want to use to createOutlineModel.

A note on TableModelEvents produced by this model: There is a slight impedance mismatch between TableModelEvent and TreeModelEvent. When the tree changes, it is necessary to fire TableModelEvents to update the display. However, TreeModelEvents support changes to discontiguous segments of the model (i.e. "child nodes 3, 4 and 9 were deleted"). TableModelEvents have no such concept - they operate on contiguous ranges of rows. Therefore, one incoming TreeModelEvent may result in more than one TableModelEvent being fired. Discontiguous TreeModelEvents will be broken into their contiguous segments, which will be fired sequentially (in the case of removals, in reverse order). So, the example above would generate two TableModelEvents, the first indicating that row 9 was removed, and the second indicating that rows 3 and 4 were removed.

Clients which need to know whether the TableModelEvent they have just received is one of a group (perhaps they update some data structure, and should not do so until the table's state is fully synchronized with that of the tree model) may call areMoreEventsPending().

In the case of TreeModelEvents which add items to an unexpanded tree node, a simple value change TableModelEvent will be fired for the row in question on the tree column index.

Note also that if the model is large-model, removal events may only indicate those indices which were visible at the time of removal, because less data is retained about the position of nodes which are not displayed. In this case, the only issue is the accuracy of the scrollbar in the model; in practice this is a non-issue, since it is based on the Outline's row count, which will be accurate.

A note to subclassers, if we even leave this class non-final: If you do not use ProxyTableModel and RowMapper (which probably means you are doing something wrong), do not fire structural changes from the TableModel. This class is designed such that the TreeModel is entirely in control of the count and contents of the rows of the table. It and only it may fire structural changes.

Note that this class enforces access only on the event dispatch thread with assertions. All events fired by the underlying table and tree model must be fired on the event dispatch thread.
author:
   Tim Boudreau




Constructor Summary
protected  DefaultOutlineModel(TreeModel treeModel, TableModel tableModel, boolean largeModel)
     Creates a new instance of DefaultOutlineModel.

Method Summary
final public synchronized  voidaddTableModelListener(TableModelListener l)
    
final public synchronized  voidaddTreeModelListener(TreeModelListener l)
    
public  booleanareMoreEventsPending()
    
public static  OutlineModelcreateOutlineModel(TreeModel treeModel, RowModel rowModel)
    
public static  OutlineModelcreateOutlineModel(TreeModel treeModel, RowModel rowModel, boolean isLargeModel)
    
final public  ObjectgetChild(Object parent, int index)
    
final public  intgetChildCount(Object parent)
    
final public  ClassgetColumnClass(int columnIndex)
    
final public  intgetColumnCount()
    
public  StringgetColumnName(int columnIndex)
    
final public  intgetIndexOfChild(Object parent, Object child)
    
final public  AbstractLayoutCachegetLayout()
    
final public  ObjectgetRoot()
    
final public  intgetRowCount()
    
public  NodeRowModelgetRowNodeModel()
    
 TableModelgetTableModel()
    
 TreeModelgetTreeModel()
    
final public  TreePathSupportgetTreePathSupport()
    
final public  ObjectgetValueAt(int rowIndex, int columnIndex)
    
public  booleanisCellEditable(int rowIndex, int columnIndex)
    
public  booleanisLargeModel()
    
final public  booleanisLeaf(Object node)
    
final public synchronized  voidremoveTableModelListener(TableModelListener l)
    
final public synchronized  voidremoveTreeModelListener(TreeModelListener l)
    
public  voidsetNodeColumnName(String inName)
    
final public  voidsetValueAt(Object aValue, int rowIndex, int columnIndex)
    
final public  voidvalueForPathChanged(javax.swing.tree.TreePath path, Object newValue)
    


Constructor Detail
DefaultOutlineModel
protected DefaultOutlineModel(TreeModel treeModel, TableModel tableModel, boolean largeModel)(Code)
Creates a new instance of DefaultOutlineModel. Note Do not fire table structure changes from the wrapped TableModel (value changes are okay). Changes that affect the number of rows must come from the TreeModel.




Method Detail
addTableModelListener
final public synchronized void addTableModelListener(TableModelListener l)(Code)
Delegates to the EventBroadcaster for this model



addTreeModelListener
final public synchronized void addTreeModelListener(TreeModelListener l)(Code)
Delegates to the EventBroadcaster for this model



areMoreEventsPending
public boolean areMoreEventsPending()(Code)



createOutlineModel
public static OutlineModel createOutlineModel(TreeModel treeModel, RowModel rowModel)(Code)
Create a small model OutlineModel using the supplied tree model and row model
Parameters:
  treeModel - The tree model that is the data model for the expandabletree column of an Outline
Parameters:
  rowModel - The row model which will supply values for each row basedon the tree node in that row in the tree model



createOutlineModel
public static OutlineModel createOutlineModel(TreeModel treeModel, RowModel rowModel, boolean isLargeModel)(Code)
Create an OutlineModel using the supplied tree model and row model, specifying if it is a large-model tree



getChild
final public Object getChild(Object parent, int index)(Code)



getChildCount
final public int getChildCount(Object parent)(Code)



getColumnClass
final public Class getColumnClass(int columnIndex)(Code)
Delegates to the RowMapper for > 0 columns; column 0 always returns Object.class



getColumnCount
final public int getColumnCount()(Code)



getColumnName
public String getColumnName(int columnIndex)(Code)



getIndexOfChild
final public int getIndexOfChild(Object parent, Object child)(Code)



getLayout
final public AbstractLayoutCache getLayout()(Code)



getRoot
final public Object getRoot()(Code)



getRowCount
final public int getRowCount()(Code)



getRowNodeModel
public NodeRowModel getRowNodeModel()(Code)



getTableModel
TableModel getTableModel()(Code)
Accessor for EventBroadcaster



getTreeModel
TreeModel getTreeModel()(Code)
Accessor for EventBroadcaster



getTreePathSupport
final public TreePathSupport getTreePathSupport()(Code)



getValueAt
final public Object getValueAt(int rowIndex, int columnIndex)(Code)



isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)(Code)



isLargeModel
public boolean isLargeModel()(Code)



isLeaf
final public boolean isLeaf(Object node)(Code)



removeTableModelListener
final public synchronized void removeTableModelListener(TableModelListener l)(Code)
Delegates to the EventBroadcaster for this model



removeTreeModelListener
final public synchronized void removeTreeModelListener(TreeModelListener l)(Code)
Delegates to the EventBroadcaster for this model



setNodeColumnName
public void setNodeColumnName(String inName)(Code)
Added 4/19/2004 David Botterill



setValueAt
final public void setValueAt(Object aValue, int rowIndex, int columnIndex)(Code)
Delegates to the RowModel (or TableModel) for non-0 columns



valueForPathChanged
final public void valueForPathChanged(javax.swing.tree.TreePath path, Object newValue)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws 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.