Source Code Cross Referenced for AquaPainter.java in  » Swing-Library » jide-common » com » jidesoft » plaf » aqua » 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 » jide common » com.jidesoft.plaf.aqua 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)${NAME}
003:         *
004:         * Copyright 2002 - 2004 JIDE Software Inc. All rights reserved.
005:         */
006:        package com.jidesoft.plaf.aqua;
007:
008:        import apple.laf.AquaImageFactory;
009:        import com.jidesoft.icons.IconsFactory;
010:        import com.jidesoft.plaf.UIDefaultsLookup;
011:        import com.jidesoft.plaf.basic.BasicPainter;
012:        import com.jidesoft.plaf.basic.ThemePainter;
013:        import com.jidesoft.swing.JideSwingUtilities;
014:        import sun.java2d.SunGraphics2D;
015:
016:        import javax.swing.*;
017:        import java.awt.*;
018:        import java.util.logging.Logger;
019:
020:        /**
021:         * Painter for Aqua style L&F.
022:         * <p/>
023:         * Please note, this class is an internal class which is meant to be used by other JIDE classes only.
024:         * Future version might break your build if you use it.
025:         */
026:        public class AquaPainter extends BasicPainter {
027:            private static final Logger LOGGER = Logger
028:                    .getLogger(AquaPainter.class.getName());
029:
030:            private static AquaPainter _instance;
031:            private final static ImageIcon SELECTED = IconsFactory
032:                    .getImageIcon(AquaPainter.class, "icons/selected.gif");
033:            private final static ImageIcon ROLLOVER = IconsFactory
034:                    .getImageIcon(AquaPainter.class, "icons/rollover.gif");
035:            private final static ImageIcon PRESSED = IconsFactory.getImageIcon(
036:                    AquaPainter.class, "icons/pressed.gif");
037:            private final static Color ROLLOVER_BACKGROUND = new Color(238,
038:                    238, 238);
039:            private final static Color SELECTED_BACKGROUND = new Color(153,
040:                    153, 153);
041:            private final static Color PRESSED_BACKGROUND = new Color(195, 195,
042:                    195);
043:
044:            public static ThemePainter getInstance() {
045:                if (_instance == null) {
046:                    _instance = new AquaPainter();
047:                }
048:                return _instance;
049:            }
050:
051:            public AquaPainter() {
052:            }
053:
054:            @Override
055:            public Color getCommandBarTitleBarBackground() {
056:                return UIDefaultsLookup.getColor("JideButton.background");
057:            }
058:
059:            @Override
060:            public void paintButtonBackground(JComponent c, Graphics g,
061:                    Rectangle rect, int orientation, int state) {
062:                if (state == STATE_DEFAULT) {
063:                    super .paintButtonBackground(c, g, rect, orientation, state);
064:                } else if (state == STATE_ROLLOVER) {
065:                    paintImageBorder(g, rect, ROLLOVER, ROLLOVER_BACKGROUND);
066:                } else if (state == STATE_SELECTED) {
067:                    paintImageBorder(g, rect, SELECTED, SELECTED_BACKGROUND);
068:                } else if (state == STATE_PRESSED) {
069:                    paintImageBorder(g, rect, PRESSED, PRESSED_BACKGROUND);
070:                }
071:            }
072:
073:            private void paintImageBorder(Graphics g, Rectangle rect,
074:                    ImageIcon icon, Color background) {
075:                JideSwingUtilities.drawImageBorder(g, icon, rect, new Insets(3,
076:                        3, 3, 3), false);
077:
078:                if (background != null) {
079:                    Color oldColor = g.getColor();
080:                    g.setColor(background);
081:                    g.fillRect(rect.x + 3, rect.y + 3, rect.width - 6,
082:                            rect.height - 6);
083:                    g.setColor(oldColor);
084:                }
085:            }
086:
087:            @Override
088:            public void paintCollapsiblePaneTitlePaneBackgroundEmphasized(
089:                    JComponent c, Graphics g, Rectangle rect, int orientation,
090:                    int state) {
091:                try {
092:                    AquaImageFactory.drawFrameTitleBackground(
093:                            (SunGraphics2D) g, rect.x, rect.y, rect.width,
094:                            rect.height, true, false, false);
095:                } catch (Exception e) {
096:                    LOGGER.warning(e.getLocalizedMessage());
097:                }
098:            }
099:
100:            @Override
101:            public void paintCollapsiblePaneTitlePaneBackground(JComponent c,
102:                    Graphics g, Rectangle rect, int orientation, int state) {
103:                try {
104:                    AquaImageFactory.drawFrameTitleBackground(
105:                            (SunGraphics2D) g, rect.x, rect.y, rect.width,
106:                            rect.height, false, false, false);
107:                } catch (Exception e) {
108:                    LOGGER.warning(e.getLocalizedMessage());
109:                }
110:            }
111:
112:            @Override
113:            public void paintDockableFrameTitlePane(JComponent c, Graphics g,
114:                    Rectangle rect, int orientation, int state) {
115:                try {
116:                    AquaImageFactory.drawFrameTitleBackground(
117:                            (SunGraphics2D) g, rect.x, rect.y, rect.width,
118:                            rect.height, state == STATE_SELECTED, false, false);
119:                } catch (Exception e) {
120:                    LOGGER.warning(e.getLocalizedMessage());
121:                }
122:            }
123:
124:            @Override
125:            public void paintCommandBarTitlePane(JComponent c, Graphics g,
126:                    Rectangle rect, int orientation, int state) {
127:                try {
128:                    AquaImageFactory.drawFrameTitleBackground(
129:                            (SunGraphics2D) g, rect.x, rect.y, rect.width,
130:                            rect.height, true, false, false);
131:                } catch (Exception e) {
132:                    LOGGER.warning(e.getLocalizedMessage());
133:                }
134:            }
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.