Source Code Cross Referenced for PropertyHintListCellRenderer.java in  » Report » iReport-2.0.5 » it » businesslogic » ireport » gui » 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 » Report » iReport 2.0.5 » it.businesslogic.ireport.gui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * PropertyHintRendererPanel.java
003:         *
004:         * Created on December 19, 2007, 3:58 PM
005:         */
006:
007:        package it.businesslogic.ireport.gui;
008:
009:        import java.awt.Component;
010:        import java.awt.Insets;
011:        import javax.swing.JList;
012:        import javax.swing.ListCellRenderer;
013:        import javax.swing.UIManager;
014:        import javax.swing.border.EmptyBorder;
015:
016:        /**
017:         *
018:         * @author  gtoffoli
019:         */
020:        public class PropertyHintListCellRenderer extends javax.swing.JPanel
021:                implements  ListCellRenderer {
022:
023:            public void setSelected(boolean b) {
024:                setBackground(b ? UIManager
025:                        .getColor("List.selectionBackground") : UIManager
026:                        .getColor("ToolTip.background"));
027:                jLabelDescription.setForeground(b ? UIManager
028:                        .getColor("List.selectionForeground") : UIManager
029:                        .getColor("ToolTip.foreground"));
030:                jLabelProperty.setForeground(b ? UIManager
031:                        .getColor("List.selectionForeground") : UIManager
032:                        .getColor("ToolTip.foreground"));
033:            }
034:
035:            public void setPropertyName(String s) {
036:                if (s == null)
037:                    s = "";
038:                if (!s.startsWith("<html><b>"))
039:                    s = "<html><b>" + s;
040:                jLabelProperty.setText(s);
041:            }
042:
043:            public void setPropertyDescription(String s) {
044:                if (s == null)
045:                    s = "";
046:                if (!s.startsWith("<html>"))
047:                    s = "<html>" + s;
048:                jLabelDescription.setText(s);
049:            }
050:
051:            /** Creates new form PropertyHintRendererPanel */
052:            public PropertyHintListCellRenderer() {
053:                initComponents();
054:            }
055:
056:            /** This method is called from within the constructor to
057:             * initialize the form.
058:             * WARNING: Do NOT modify this code. The content of this method is
059:             * always regenerated by the Form Editor.
060:             */
061:            // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
062:            private void initComponents() {
063:                java.awt.GridBagConstraints gridBagConstraints;
064:
065:                jLabelProperty = new javax.swing.JLabel();
066:                jLabelDescription = new javax.swing.JLabel();
067:                jSeparator1 = new javax.swing.JSeparator();
068:
069:                setLayout(new java.awt.GridBagLayout());
070:
071:                jLabelProperty.setText("<html><b>Property");
072:                gridBagConstraints = new java.awt.GridBagConstraints();
073:                gridBagConstraints.gridx = 0;
074:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
075:                gridBagConstraints.weightx = 1.0;
076:                gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
077:                add(jLabelProperty, gridBagConstraints);
078:
079:                jLabelDescription.setText("jLabel1");
080:                jLabelDescription
081:                        .setVerticalAlignment(javax.swing.SwingConstants.TOP);
082:                jLabelDescription
083:                        .setVerticalTextPosition(javax.swing.SwingConstants.TOP);
084:                gridBagConstraints = new java.awt.GridBagConstraints();
085:                gridBagConstraints.gridx = 0;
086:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
087:                gridBagConstraints.weightx = 1.0;
088:                gridBagConstraints.weighty = 1.0;
089:                gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);
090:                add(jLabelDescription, gridBagConstraints);
091:
092:                jSeparator1.setMinimumSize(new java.awt.Dimension(1, 1));
093:                jSeparator1.setPreferredSize(new java.awt.Dimension(1, 1));
094:                gridBagConstraints = new java.awt.GridBagConstraints();
095:                gridBagConstraints.gridx = 0;
096:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
097:                add(jSeparator1, gridBagConstraints);
098:            }// </editor-fold>//GEN-END:initComponents
099:
100:            // Variables declaration - do not modify//GEN-BEGIN:variables
101:            private javax.swing.JLabel jLabelDescription;
102:            private javax.swing.JLabel jLabelProperty;
103:            private javax.swing.JSeparator jSeparator1;
104:
105:            // End of variables declaration//GEN-END:variables
106:
107:            public Component getListCellRendererComponent(JList list,
108:                    Object value, int index, boolean isSelected,
109:                    boolean cellHasFocus) {
110:
111:                setSelected(isSelected);
112:                if (value instanceof  PropertyHint) {
113:                    PropertyHint ph = (PropertyHint) value;
114:                    this .setPropertyName(ph.getPropertyName());
115:                    this .setPropertyDescription(ph.getPropertyDescription());
116:                } else {
117:                    this .setPropertyName("" + value);
118:                    this .setPropertyDescription("");
119:                }
120:
121:                if (cellHasFocus) {
122:                    setBorder(UIManager
123:                            .getBorder("List.focusCellHighlightBorder"));
124:                } else {
125:                    setBorder(new EmptyBorder(new Insets(1, 1, 1, 1)));
126:                }
127:
128:                return this;
129:            }
130:
131:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.