Source Code Cross Referenced for JTaskPane.java in  » Swing-Library » l2fprod-common » com » l2fprod » common » swing » 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 » Swing Library » l2fprod common » com.l2fprod.common.swing 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * L2FProd.com Common Components 7.3 License.
003:         *
004:         * Copyright 2005-2007 L2FProd.com
005:         *
006:         * Licensed under the Apache License, Version 2.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         *
010:         *     http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing, software
013:         * distributed under the License is distributed on an "AS IS" BASIS,
014:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         * See the License for the specific language governing permissions and
016:         * limitations under the License.
017:         */package com.l2fprod.common.swing;
018:
019:        import com.l2fprod.common.swing.plaf.JTaskPaneAddon;
020:        import com.l2fprod.common.swing.plaf.LookAndFeelAddons;
021:        import com.l2fprod.common.swing.plaf.TaskPaneUI;
022:
023:        import java.awt.Dimension;
024:        import java.awt.Rectangle;
025:
026:        import javax.swing.JComponent;
027:        import javax.swing.JViewport;
028:        import javax.swing.Scrollable;
029:
030:        /**
031:         * <code>JTaskPane</code> provides an elegant view
032:         * to display a list of tasks ordered by groups ({@link JTaskPane}.
033:         * 
034:         * <p>
035:         * Although {@link JTaskPaneGroup} can be added to any other
036:         * container, the <code>JTaskPane</code> will provide better
037:         * fidelity when it comes to matching the look and feel of the host operating
038:         * system than any other panel. As example, when using on a Windows platform,
039:         * the <code>JTaskPane</code> will be painted with light gradient
040:         * background. Also <code>JTaskPane</code> takes care of using the
041:         * right {@link java.awt.LayoutManager} (as required by
042:         * {@link JCollapsiblePane}) so that
043:         * {@link JTaskPaneGroup} behaves correctly when collapsing and
044:         * expanding its content.
045:         *  
046:         * <p>
047:         * <code>JTaskPane<code> can be added to a JScrollPane.
048:         * 
049:         * <p>
050:         * Example:
051:         * <pre>
052:         * <code>
053:         * JFrame frame = new JFrame();
054:         * 
055:         * // a container to put all JTaskPaneGroup together
056:         * JTaskPane taskPaneContainer = new JTaskPane();
057:         * 
058:         * // add JTaskPaneGroups to the container
059:         * JTaskPaneGroup actionPane = createActionPane();
060:         * JTaskPaneGroup miscActionPane = createMiscActionPane();
061:         * JTaskPaneGroup detailsPane = createDetailsPane();
062:         * taskPaneContainer.add(actionPane);
063:         * taskPaneContainer.add(miscActionPane);
064:         * taskPaneContainer.add(detailsPane);
065:         *
066:         * // put the action list on the left in a JScrollPane
067:         * // as we have several taskPane and we want to make sure they
068:         * // all get visible.   
069:         * frame.add(new JScrollPane(taskPaneContainer), BorderLayout.EAST);
070:         * 
071:         * // and a file browser in the middle
072:         * frame.add(fileBrowser, BorderLayout.CENTER);
073:         * 
074:         * frame.pack().
075:         * frame.setVisible(true);
076:         * </code>
077:         * </pre>
078:         *
079:         * @author <a href="mailto:fred@L2FProd.com">Frederic Lavigne</a>
080:         * 
081:         * @javabean.attribute
082:         *          name="isContainer"
083:         *          value="Boolean.TRUE"
084:         *          rtexpr="true"
085:         * 
086:         * @javabean.class
087:         *          name="JTaskPane"
088:         *          shortDescription="A component that contains JTaskPaneGroups."
089:         *          stopClass="java.awt.Component"
090:         * 
091:         * @javabean.icons
092:         *          mono16="JTaskPane16-mono.gif"
093:         *          color16="JTaskPane16.gif"
094:         *          mono32="JTaskPane32-mono.gif"
095:         *          color32="JTaskPane32.gif"
096:         */
097:        public class JTaskPane extends JComponent implements  Scrollable {
098:
099:            public final static String UI_CLASS_ID = "TaskPaneUI";
100:
101:            // ensure at least the default ui is registered
102:            static {
103:                LookAndFeelAddons.contribute(new JTaskPaneAddon());
104:            }
105:
106:            /**
107:             * Creates a new empty taskpane.
108:             */
109:            public JTaskPane() {
110:                updateUI();
111:            }
112:
113:            /**
114:             * Notification from the <code>UIManager</code> that the L&F has changed.
115:             * Replaces the current UI object with the latest version from the <code>UIManager</code>.
116:             * 
117:             * @see javax.swing.JComponent#updateUI
118:             */
119:            public void updateUI() {
120:                setUI((TaskPaneUI) LookAndFeelAddons.getUI(this ,
121:                        TaskPaneUI.class));
122:            }
123:
124:            /**
125:             * Sets the L&F object that renders this component.
126:             * 
127:             * @param ui the <code>TaskPaneUI</code> L&F object
128:             * @see javax.swing.UIDefaults#getUI
129:             * 
130:             * @beaninfo bound: true hidden: true description: The UI object that
131:             * implements the taskpane's LookAndFeel.
132:             */
133:            public void setUI(TaskPaneUI ui) {
134:                super .setUI(ui);
135:            }
136:
137:            /**
138:             * Returns the name of the L&F class that renders this component.
139:             * 
140:             * @return the string {@link #UI_CLASS_ID}
141:             * @see javax.swing.JComponent#getUIClassID
142:             * @see javax.swing.UIDefaults#getUI
143:             */
144:            public String getUIClassID() {
145:                return UI_CLASS_ID;
146:            }
147:
148:            /**
149:             * Adds a new <code>JTaskPaneGroup</code> to this JTaskPane.
150:             * 
151:             * @param group
152:             */
153:            public void add(JTaskPaneGroup group) {
154:                super .add(group);
155:            }
156:
157:            /**
158:             * Removes a new <code>JTaskPaneGroup</code> from this JTaskPane.
159:             * 
160:             * @param group
161:             */
162:            public void remove(JTaskPaneGroup group) {
163:                super .remove(group);
164:            }
165:
166:            /**
167:             * @see Scrollable#getPreferredScrollableViewportSize()
168:             */
169:            public Dimension getPreferredScrollableViewportSize() {
170:                return getPreferredSize();
171:            }
172:
173:            /**
174:             * @see Scrollable#getScrollableBlockIncrement(java.awt.Rectangle, int, int)
175:             */
176:            public int getScrollableBlockIncrement(Rectangle visibleRect,
177:                    int orientation, int direction) {
178:                return 10;
179:            }
180:
181:            /**
182:             * @see Scrollable#getScrollableTracksViewportHeight()
183:             */
184:            public boolean getScrollableTracksViewportHeight() {
185:                if (getParent() instanceof  JViewport) {
186:                    return (((JViewport) getParent()).getHeight() > getPreferredSize().height);
187:                } else {
188:                    return false;
189:                }
190:            }
191:
192:            /**
193:             * @see Scrollable#getScrollableTracksViewportWidth()
194:             */
195:            public boolean getScrollableTracksViewportWidth() {
196:                return true;
197:            }
198:
199:            /**
200:             * @see Scrollable#getScrollableUnitIncrement(java.awt.Rectangle, int, int)
201:             */
202:            public int getScrollableUnitIncrement(Rectangle visibleRect,
203:                    int orientation, int direction) {
204:                return 10;
205:            }
206:
207:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.