Source Code Cross Referenced for JTableFrame.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:         * Copyright (C) 2005 - 2008 JasperSoft Corporation.  All rights reserved. 
003:         * http://www.jaspersoft.com.
004:         *
005:         * Unless you have purchased a commercial license agreement from JasperSoft,
006:         * the following license terms apply:
007:         *
008:         * This program is free software; you can redistribute it and/or modify
009:         * it under the terms of the GNU General Public License version 2 as published by
010:         * the Free Software Foundation.
011:         *
012:         * This program is distributed WITHOUT ANY WARRANTY; and without the
013:         * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014:         * See the GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018:         * or write to:
019:         *
020:         * Free Software Foundation, Inc.,
021:         * 59 Temple Place - Suite 330,
022:         * Boston, MA  USA  02111-1307
023:         *
024:         *
025:         *
026:         *
027:         * JTableFrame.java
028:         * 
029:         * Created on 20 maggio 2003, 20.20
030:         *
031:         */
032:
033:        package it.businesslogic.ireport.gui;
034:
035:        import javax.swing.*;
036:        import java.util.*;
037:        import java.awt.dnd.*;
038:        import java.awt.event.*;
039:        import javax.swing.table.*;
040:
041:        /**
042:         *
043:         * @author  Administrator
044:         */
045:        public class JTableFrame extends javax.swing.JInternalFrame {
046:
047:            /** Creates new form JTableFrame */
048:            java.awt.Point origin = null;
049:
050:            public JTableFrame() {
051:                initComponents();
052:                ((javax.swing.plaf.basic.BasicInternalFrameUI) getUI())
053:                        .getNorthPane().setPreferredSize(
054:                                new java.awt.Dimension(0, 15));
055:
056:                this .jList1.setModel(new DefaultListModel());
057:                ((DefaultListModel) this .jList1.getModel())
058:                        .addElement("Field1");
059:                ((DefaultListModel) this .jList1.getModel())
060:                        .addElement("Field2");
061:                ((DefaultListModel) this .jList1.getModel())
062:                        .addElement("Field3");
063:                ((DefaultListModel) this .jList1.getModel())
064:                        .addElement("Field4");
065:                ((DefaultListModel) this .jList1.getModel())
066:                        .addElement("Field5");
067:                ((DefaultListModel) this .jList1.getModel())
068:                        .addElement("Field6");
069:                ((DefaultListModel) this .jList1.getModel())
070:                        .addElement("Field7");
071:                ((DefaultListModel) this .jList1.getModel())
072:                        .addElement("Field8");
073:                ((DefaultListModel) this .jList1.getModel())
074:                        .addElement("Field9");
075:                ((DefaultListModel) this .jList1.getModel())
076:                        .addElement("Field10");
077:                this .dragSource = DragSource.getDefaultDragSource();
078:                this .dgListener = new java.awt.dnd.DragGestureListener() {
079:                    public void dragGestureRecognized(DragGestureEvent dge) {
080:                        jList1dragGestureRecognized(dge);
081:                    }
082:                };
083:                this .dsListener = new DSListener();
084:                /*
085:                new DragSourceListener(){
086:                    public void dragDropEnd(DragSourceDropEvent dsde) {} 
087:                    public void dragEnter(DragSourceDragEvent dsde) {}
088:                    public void dragExit(DragSourceEvent dse) {}
089:                    public void dragOver(DragSourceDragEvent dsde) {}
090:                    public void dropActionChanged(DragSourceDragEvent dsde){}
091:                };
092:                 **/
093:
094:                this .dragSource.createDefaultDragGestureRecognizer(this ,
095:                        DnDConstants.ACTION_COPY_OR_MOVE, this .dgListener);
096:
097:                jList1.setDragEnabled(true);
098:                jList1
099:                        .setTransferHandler(new it.businesslogic.ireport.gui.dnd.ListColumnTransferableHandler());
100:            }
101:
102:            private DragSource dragSource;
103:            private DragGestureListener dgListener;
104:            private DragSourceListener dsListener;
105:
106:            public void jList1dragGestureRecognized(DragGestureEvent dge) {
107:
108:            }
109:
110:            /** This method is called from within the constructor to
111:             * initialize the form.
112:             * WARNING: Do NOT modify this code. The content of this method is
113:             * always regenerated by the Form Editor.
114:             */
115:            private void initComponents() {//GEN-BEGIN:initComponents
116:                jScrollPane1 = new javax.swing.JScrollPane();
117:                jList1 = new javax.swing.JList();
118:
119:                setBackground(new java.awt.Color(255, 255, 255));
120:                setResizable(true);
121:                setTitle("My Table");
122:                setFrameIcon(null);
123:                addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
124:                    public void mouseDragged(java.awt.event.MouseEvent evt) {
125:                        formMouseDragged(evt);
126:                    }
127:                });
128:
129:                jList1.setDragEnabled(true);
130:                jList1
131:                        .addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
132:                            public void mouseDragged(
133:                                    java.awt.event.MouseEvent evt) {
134:                                jList1MouseDragged(evt);
135:                            }
136:                        });
137:
138:                jScrollPane1.setViewportView(jList1);
139:
140:                getContentPane()
141:                        .add(jScrollPane1, java.awt.BorderLayout.CENTER);
142:
143:                pack();
144:            }//GEN-END:initComponents
145:
146:            private void jList1MouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jList1MouseDragged
147:                JComponent c = (JComponent) evt.getSource();
148:                TransferHandler handler = c.getTransferHandler();
149:                handler.exportAsDrag(c, evt, TransferHandler.COPY);
150:            }//GEN-LAST:event_jList1MouseDragged
151:
152:            private void formMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseDragged
153:
154:            }//GEN-LAST:event_formMouseDragged
155:
156:            // Variables declaration - do not modify//GEN-BEGIN:variables
157:            private javax.swing.JScrollPane jScrollPane1;
158:            private javax.swing.JList jList1;
159:
160:            // End of variables declaration//GEN-END:variables
161:
162:            class DSListener implements  DragSourceListener {
163:
164:                /**
165:                 * @param e the event
166:                 */
167:                public void dragDropEnd(DragSourceDropEvent e) {
168:                    if (e.getDropSuccess() == false) {
169:                        System.out.println("not successful");
170:                        return;
171:                    }
172:
173:                    /*
174:                     * the dropAction should be what the drop target specified
175:                     * in acceptDrop
176:                     */
177:                    //System.out.println( "dragdropend action " + e.getDropAction() );
178:                    // this is the action selected by the drop target
179:                    //if(e.getDropAction() == DnDConstants.ACTION_MOVE)
180:                    //DragLabel.this.setText("");
181:                }
182:
183:                /**
184:                 * @param e the event
185:                 */
186:                public void dragEnter(DragSourceDragEvent e) {
187:                    //System.out.println( "draglabel enter " + e);
188:                    DragSourceContext context = e.getDragSourceContext();
189:                    //intersection of the users selected action, and the source and target actions
190:                    int myaction = e.getDropAction();
191:                    //if( (myaction & 1) != 0) {	
192:                    context.setCursor(DragSource.DefaultCopyDrop);
193:                    //} else {
194:                    //context.setCursor(DragSource.DefaultCopyNoDrop);	  	
195:                    //}
196:                }
197:
198:                /**
199:                 * @param e the event
200:                 */
201:                public void dragOver(DragSourceDragEvent e) {
202:                    DragSourceContext context = e.getDragSourceContext();
203:                    int sa = context.getSourceActions();
204:                    int ua = e.getUserAction();
205:                    int da = e.getDropAction();
206:                    int ta = e.getTargetActions();
207:                    //System.out.println("dl dragOver source actions" + sa);
208:                    //System.out.println("user action" + ua);
209:                    //System.out.println("drop actions" + da);
210:                    //System.out.println("target actions" + ta);      
211:                }
212:
213:                /**
214:                 * @param e the event
215:                 */
216:                public void dragExit(DragSourceEvent e) {
217:                    //System.out.println( "draglabel exit " + e);      
218:                    DragSourceContext context = e.getDragSourceContext();
219:                }
220:
221:                /**
222:                 * for example, press shift during drag to change to
223:                 * a link action
224:                 * @param e the event     
225:                 */
226:                public void dropActionChanged(DragSourceDragEvent e) {
227:                    DragSourceContext context = e.getDragSourceContext();
228:                    context.setCursor(DragSource.DefaultCopyNoDrop);
229:                }
230:            }
231:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.