Source Code Cross Referenced for Scrollable.java in  » 6.0-JDK-Core » swing » javax » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1997-2003 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package javax.swing;
027
028        import java.awt.Dimension;
029        import java.awt.Rectangle;
030
031        /** 
032         * An interface that provides information to a scrolling container
033         * like JScrollPane.  A complex component that's likely to be used 
034         * as a viewing a JScrollPane viewport (or other scrolling container) 
035         * should implement this interface.
036         * 
037         * @see JViewport
038         * @see JScrollPane
039         * @see JScrollBar
040         * @version 1.19 05/05/07
041         * @author Hans Muller
042         */
043        public interface Scrollable {
044            /**
045             * Returns the preferred size of the viewport for a view component.
046             * For example, the preferred size of a <code>JList</code> component
047             * is the size required to accommodate all of the cells in its list.
048             * However, the value of <code>preferredScrollableViewportSize</code>
049             * is the size required for <code>JList.getVisibleRowCount</code> rows.
050             * A component without any properties that would affect the viewport
051             * size should just return <code>getPreferredSize</code> here.
052             * 
053             * @return the preferredSize of a <code>JViewport</code> whose view
054             *    is this <code>Scrollable</code>
055             * @see JViewport#getPreferredSize
056             */
057            Dimension getPreferredScrollableViewportSize();
058
059            /**
060             * Components that display logical rows or columns should compute
061             * the scroll increment that will completely expose one new row
062             * or column, depending on the value of orientation.  Ideally, 
063             * components should handle a partially exposed row or column by 
064             * returning the distance required to completely expose the item.
065             * <p>
066             * Scrolling containers, like JScrollPane, will use this method
067             * each time the user requests a unit scroll.
068             * 
069             * @param visibleRect The view area visible within the viewport
070             * @param orientation Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
071             * @param direction Less than zero to scroll up/left, greater than zero for down/right.
072             * @return The "unit" increment for scrolling in the specified direction.
073             *         This value should always be positive.
074             * @see JScrollBar#setUnitIncrement
075             */
076            int getScrollableUnitIncrement(Rectangle visibleRect,
077                    int orientation, int direction);
078
079            /**
080             * Components that display logical rows or columns should compute
081             * the scroll increment that will completely expose one block
082             * of rows or columns, depending on the value of orientation. 
083             * <p>
084             * Scrolling containers, like JScrollPane, will use this method
085             * each time the user requests a block scroll.
086             * 
087             * @param visibleRect The view area visible within the viewport
088             * @param orientation Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
089             * @param direction Less than zero to scroll up/left, greater than zero for down/right.
090             * @return The "block" increment for scrolling in the specified direction.
091             *         This value should always be positive.
092             * @see JScrollBar#setBlockIncrement
093             */
094            int getScrollableBlockIncrement(Rectangle visibleRect,
095                    int orientation, int direction);
096
097            /**
098             * Return true if a viewport should always force the width of this 
099             * <code>Scrollable</code> to match the width of the viewport. 
100             * For example a normal 
101             * text view that supported line wrapping would return true here, since it
102             * would be undesirable for wrapped lines to disappear beyond the right
103             * edge of the viewport.  Note that returning true for a Scrollable
104             * whose ancestor is a JScrollPane effectively disables horizontal
105             * scrolling.
106             * <p>
107             * Scrolling containers, like JViewport, will use this method each 
108             * time they are validated.  
109             * 
110             * @return True if a viewport should force the Scrollables width to match its own.
111             */
112            boolean getScrollableTracksViewportWidth();
113
114            /**
115             * Return true if a viewport should always force the height of this 
116             * Scrollable to match the height of the viewport.  For example a 
117             * columnar text view that flowed text in left to right columns 
118             * could effectively disable vertical scrolling by returning
119             * true here.
120             * <p>
121             * Scrolling containers, like JViewport, will use this method each 
122             * time they are validated.  
123             * 
124             * @return True if a viewport should force the Scrollables height to match its own.
125             */
126            boolean getScrollableTracksViewportHeight();
127        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.