Java Doc for ScrollingTabLayoutModel.java in  » IDE-Netbeans » library » org » netbeans » swing » tabcontrol » plaf » 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 » library » org.netbeans.swing.tabcontrol.plaf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.swing.tabcontrol.plaf.ScrollingTabLayoutModel

ScrollingTabLayoutModel
final public class ScrollingTabLayoutModel implements TabLayoutModel(Code)
Layout model which manages an offset into a set of scrollable tabs, and recalculates its layout on a change. Also handles adding extra pixels to the selected tab if necessary. Basics of how it works:

Wrapppers a DefaultTabLayoutModel, which can simply calculate tab widths and 0 based positions. Listens to the data model for changes, and sets a flag when a change happens to mark the cached widths and positions as dirty. On any call to fetch sizes, first checks if the cached values are good, recalculates if needed, and returns the result.
author:
   Tim Boudreau



Field Summary
 TabDataModelmdl
    
 intpixelsToAddToSelection
     Integer count of pixels that should be added to the width of the selected tab.
 SingleSelectionModelsel
    

Constructor Summary
public  ScrollingTabLayoutModel(TabLayoutModel wrapped, SingleSelectionModel sel, TabDataModel mdl)
    
public  ScrollingTabLayoutModel(TabLayoutModel wrapped, SingleSelectionModel sel, TabDataModel mdl, int minimumXposition)
    

Method Summary
public  voidclearCachedData()
     External operations on the selection or data model can invalidate cached widths.
public  intcountVisibleTabs(int width)
    
public  intdropIndexOfPoint(int x, int y)
    
 booleanensureAvailableSpaceUsed(boolean useCached)
    
public  ActiongetBackwardAction()
    
 intgetCachedFirstVisibleTab()
     Used when components are deleted, so that if the user scrolls to close some tabs, and the selection is offscreen, we don't infuriatingly re-scroll away from the end tabs.
 intgetCachedLastVisibleTab()
     Used when components are deleted, so that if the user scrolls to close some tabs, and the selection is offscreen, we don't infuriatingly re-scroll away from the end tabs.
public  intgetFirstVisibleTab(int width)
    
public  ActiongetForwardAction()
    
public  intgetH(int index)
    
public  intgetLastVisibleTab(int width)
    
 intgetMinimumLeftClippedWidth()
     Probably these should be made into constructor arguments.
 intgetMinimumRightClippedWidth()
     Probably these should be made into constructor arguments.
public  intgetOffset()
     Get the offset - the number of tabs that are scrolled over.
public  intgetPixelsToAddToSelection()
     Some look and feel specs require that the selected tab be wider.
public  intgetW(int index)
    
public  intgetX(int index)
    
public  intgetY(int index)
    
public  intindexOfPoint(int x, int y)
    
public  booleanisLastTabClipped()
    
public  booleanmakeVisible(int index, int width)
     Make a tab visible, according to the rules of the spec.
public  voidsetMinimumXposition(int x)
    
public  intsetOffset(int i)
     Set the offset - the number of tabs that should be hidden to the left. The default is -1 - tab 0 is showing.
public  voidsetPadding(Dimension d)
    
public  voidsetPixelsToAddToSelection(int i)
     Some UIs will want to make the selected tab a little wider than the rest.
public  voidsetWidth(int width)
     Sets the current cached width the model thinks it has for displaying tabs.

Field Detail
mdl
TabDataModel mdl(Code)
The tabDataModel, which we occasionally need to get data from



pixelsToAddToSelection
int pixelsToAddToSelection(Code)
Integer count of pixels that should be added to the width of the selected tab. They will be subtracted from the surrounding tabs



sel
SingleSelectionModel sel(Code)
The selection model we will get the current selection from when we need to ensure it is visible




Constructor Detail
ScrollingTabLayoutModel
public ScrollingTabLayoutModel(TabLayoutModel wrapped, SingleSelectionModel sel, TabDataModel mdl)(Code)
Creates a new instance of ScrollingTabLayoutModel



ScrollingTabLayoutModel
public ScrollingTabLayoutModel(TabLayoutModel wrapped, SingleSelectionModel sel, TabDataModel mdl, int minimumXposition)(Code)




Method Detail
clearCachedData
public void clearCachedData()(Code)
External operations on the selection or data model can invalidate cached widths. The UI will listen for such changes and call this method if the data we have cached is probably no good anymore.



countVisibleTabs
public int countVisibleTabs(int width)(Code)
Return the number of tabs currently visible



dropIndexOfPoint
public int dropIndexOfPoint(int x, int y)(Code)



ensureAvailableSpaceUsed
boolean ensureAvailableSpaceUsed(boolean useCached)(Code)



getBackwardAction
public Action getBackwardAction()(Code)
Returns an Action that the control buttons can call to scroll backward



getCachedFirstVisibleTab
int getCachedFirstVisibleTab()(Code)
Used when components are deleted, so that if the user scrolls to close some tabs, and the selection is offscreen, we don't infuriatingly re-scroll away from the end tabs.



getCachedLastVisibleTab
int getCachedLastVisibleTab()(Code)
Used when components are deleted, so that if the user scrolls to close some tabs, and the selection is offscreen, we don't infuriatingly re-scroll away from the end tabs.



getFirstVisibleTab
public int getFirstVisibleTab(int width)(Code)
Returns the index of the first tab that is visible (may be clipped - if it == getOffset() then it is



getForwardAction
public Action getForwardAction()(Code)
Returns an Action that the control buttons can call to scroll forward



getH
public int getH(int index)(Code)



getLastVisibleTab
public int getLastVisibleTab(int width)(Code)
Returns the last visible tab, which may or may not be clipped



getMinimumLeftClippedWidth
int getMinimumLeftClippedWidth()(Code)
Probably these should be made into constructor arguments. The minimum space to be used for a left-clipped tab



getMinimumRightClippedWidth
int getMinimumRightClippedWidth()(Code)
Probably these should be made into constructor arguments. The minimum space to be used for a right-clipped tab



getOffset
public int getOffset()(Code)
Get the offset - the number of tabs that are scrolled over. The default value is -1, which means no tabs are scrolled off to the left. 0 means the first tab is visible but clipped...and so forth



getPixelsToAddToSelection
public int getPixelsToAddToSelection()(Code)
Some look and feel specs require that the selected tab be wider. This method sets the number of pixels to add to its width. It is important that the underlying layout model's padX property include enough padding that 1-2 pixels may be stolen without causing overlap problems. The default is 0.



getW
public int getW(int index)(Code)
Returns a cached width, after checking the changed flag and calling change() if recalculation is needed



getX
public int getX(int index)(Code)



getY
public int getY(int index)(Code)



indexOfPoint
public int indexOfPoint(int x, int y)(Code)



isLastTabClipped
public boolean isLastTabClipped()(Code)
Returns true if the last tab displayed is clipped and should therefore be painted as a clipped tab



makeVisible
public boolean makeVisible(int index, int width)(Code)
Make a tab visible, according to the rules of the spec. Returns whether or not a repaint of the entire control is required. The width of the tab view is passed to this method, so that it can tell if the width has changed (in which case it needs to recalculate tab bounds), or if it can use the existing cached values.

This method will not trigger a repaint - it just adjusts the cached withs and positions of tabs so that the next repaint will paint correctly. It may be called as part of a more complex operation which would not want to trigger spurious repaints - but the return value should be noted, and if the return value is true, the caller should repaint the tab displayer whenever it is done doing what it is doing.




setMinimumXposition
public void setMinimumXposition(int x)(Code)



setOffset
public int setOffset(int i)(Code)
Set the offset - the number of tabs that should be hidden to the left. The default is -1 - tab 0 is showing. If set to 0, tab 0 still shows but is clipped, and so forth.



setPadding
public void setPadding(Dimension d)(Code)



setPixelsToAddToSelection
public void setPixelsToAddToSelection(int i)(Code)
Some UIs will want to make the selected tab a little wider than the rest.
Parameters:
  i -



setWidth
public void setWidth(int width)(Code)
Sets the current cached width the model thinks it has for displaying tabs. This is used to trigger a recalculation if it differs from the previously passed value



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.