Source Code Cross Referenced for ProgressPanel.java in  » Database-Client » SQL-Workbench » workbench » gui » dbobjects » 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 » Database Client » SQL Workbench » workbench.gui.dbobjects 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ProgressPanel.java
003:         *
004:         * This file is part of SQL Workbench/J, http://www.sql-workbench.net
005:         *
006:         * Copyright 2002-2008, Thomas Kellerer
007:         * No part of this code maybe reused without the permission of the author
008:         *
009:         * To contact the author please send an email to: support@sql-workbench.net
010:         *
011:         */
012:        package workbench.gui.dbobjects;
013:
014:        import java.awt.Dimension;
015:        import java.awt.FontMetrics;
016:        import java.awt.Window;
017:        import java.io.File;
018:        import javax.swing.SwingUtilities;
019:
020:        import workbench.gui.components.WbButton;
021:        import workbench.interfaces.Interruptable;
022:        import workbench.resource.ResourceMgr;
023:        import workbench.storage.RowActionMonitor;
024:
025:        /**
026:         *
027:         * @author  support@sql-workbench.net
028:         */
029:        public class ProgressPanel extends javax.swing.JPanel implements 
030:                RowActionMonitor {
031:
032:            private Interruptable spooler;
033:
034:            /** Creates new form SpoolerProgress */
035:            public ProgressPanel(Interruptable aWorker) {
036:                this .spooler = aWorker;
037:                initComponents();
038:            }
039:
040:            public void setRowInfo(long aRow) {
041:                this .rowInfo.setText(Long.toString(aRow));
042:            }
043:
044:            public void setRowInfo(String info) {
045:                this .rowInfo.setText(info);
046:            }
047:
048:            public void setInfoText(String aText) {
049:                this .progressInfoText.setText(aText);
050:            }
051:
052:            public void setFilename(String aFilename) {
053:                File f = new File(aFilename);
054:                String fullName = f.getAbsolutePath();
055:                this .fileNameField.setToolTipText(fullName);
056:                this .fileNameField.setText(fullName);
057:                FontMetrics fm = this .getFontMetrics(this .fileNameField
058:                        .getFont());
059:                int w = fm.stringWidth(aFilename) + 10;
060:                int h = fm.getHeight() + 2;
061:                Dimension d = new Dimension(w, h < 22 ? 22 : h);
062:                fileNameField.setPreferredSize(d);
063:                fileNameField.setMinimumSize(d);
064:                this .invalidate();
065:            }
066:
067:            public void setRowSize(int cols) {
068:                FontMetrics fm = this .getFontMetrics(this .getFont());
069:                int w = fm.charWidth(' ');
070:                int h = fm.getHeight() + 2;
071:                Dimension d = new Dimension(w * cols, h < 22 ? 22 : h);
072:                this .rowInfo.setPreferredSize(d);
073:                this .rowInfo.setMinimumSize(d);
074:                this .invalidate();
075:            }
076:
077:            public void setInfoSize(int cols) {
078:                this .progressInfoText.setColumns(cols);
079:                this .doLayout();
080:                this .updateUI();
081:            }
082:
083:            public void jobFinished() {
084:            }
085:
086:            public void setCurrentObject(String object, long number,
087:                    long totalObjects) {
088:            }
089:
090:            public void setCurrentRow(long currentRow, long totalRows) {
091:                if (currentRow > -1)
092:                    this .rowInfo.setText(Long.toString(currentRow));
093:            }
094:
095:            public void saveCurrentType(String type) {
096:            }
097:
098:            public void restoreType(String type) {
099:            }
100:
101:            public void setMonitorType(int aType) {
102:            }
103:
104:            public int getMonitorType() {
105:                return RowActionMonitor.MONITOR_PLAIN;
106:            }
107:
108:            /** This method is called from within the constructor to
109:             * initialize the form.
110:             * WARNING: Do NOT modify this code. The content of this method is
111:             * always regenerated by the Form Editor.
112:             */
113:            // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
114:            private void initComponents() {
115:                java.awt.GridBagConstraints gridBagConstraints;
116:
117:                fileNameField = new javax.swing.JTextField();
118:                infoPanel = new javax.swing.JPanel();
119:                progressInfoText = new javax.swing.JTextField();
120:                rowInfo = new javax.swing.JLabel();
121:                cancelButton = new WbButton();
122:
123:                setLayout(new java.awt.GridBagLayout());
124:
125:                fileNameField.setEditable(false);
126:                fileNameField.setBorder(new javax.swing.border.CompoundBorder(
127:                        new javax.swing.border.EtchedBorder(),
128:                        new javax.swing.border.EmptyBorder(new java.awt.Insets(
129:                                2, 2, 2, 2))));
130:                fileNameField.setDisabledTextColor(java.awt.Color.black);
131:                fileNameField.setMargin(new java.awt.Insets(0, 2, 0, 0));
132:                gridBagConstraints = new java.awt.GridBagConstraints();
133:                gridBagConstraints.gridx = 0;
134:                gridBagConstraints.gridy = 1;
135:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
136:                gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
137:                add(fileNameField, gridBagConstraints);
138:
139:                infoPanel.setLayout(new java.awt.BorderLayout(0, 5));
140:
141:                infoPanel.setBorder(new javax.swing.border.CompoundBorder(
142:                        new javax.swing.border.EtchedBorder(),
143:                        new javax.swing.border.EmptyBorder(new java.awt.Insets(
144:                                2, 2, 2, 2))));
145:                progressInfoText.setColumns(10);
146:                progressInfoText.setEditable(false);
147:                progressInfoText.setBorder(null);
148:                progressInfoText.setDisabledTextColor(java.awt.Color.black);
149:                infoPanel.add(progressInfoText, java.awt.BorderLayout.CENTER);
150:
151:                rowInfo
152:                        .setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
153:                rowInfo.setMaximumSize(new java.awt.Dimension(32768, 18));
154:                rowInfo.setMinimumSize(new java.awt.Dimension(30, 18));
155:                rowInfo.setPreferredSize(new java.awt.Dimension(50, 18));
156:                infoPanel.add(rowInfo, java.awt.BorderLayout.EAST);
157:
158:                gridBagConstraints = new java.awt.GridBagConstraints();
159:                gridBagConstraints.gridx = 0;
160:                gridBagConstraints.gridy = 0;
161:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
162:                gridBagConstraints.weightx = 1.0;
163:                gridBagConstraints.insets = new java.awt.Insets(5, 6, 0, 6);
164:                add(infoPanel, gridBagConstraints);
165:
166:                cancelButton.setText(ResourceMgr.getString("LblCancel"));
167:                cancelButton
168:                        .addActionListener(new java.awt.event.ActionListener() {
169:                            public void actionPerformed(
170:                                    java.awt.event.ActionEvent evt) {
171:                                cancelButtonActionPerformed(evt);
172:                            }
173:                        });
174:
175:                gridBagConstraints = new java.awt.GridBagConstraints();
176:                gridBagConstraints.gridx = 0;
177:                gridBagConstraints.gridy = 2;
178:                gridBagConstraints.weighty = 1.0;
179:                gridBagConstraints.insets = new java.awt.Insets(12, 0, 4, 0);
180:                add(cancelButton, gridBagConstraints);
181:
182:            }
183:
184:            // </editor-fold>//GEN-END:initComponents
185:
186:            private void cancelButtonActionPerformed(
187:                    java.awt.event.ActionEvent evt)//GEN-FIRST:event_cancelButtonActionPerformed
188:            {//GEN-HEADEREND:event_cancelButtonActionPerformed
189:                if (this .spooler != null) {
190:                    if (this .spooler.confirmCancel())
191:                        this .spooler.cancelExecution();
192:                }
193:            }//GEN-LAST:event_cancelButtonActionPerformed
194:
195:            // Variables declaration - do not modify//GEN-BEGIN:variables
196:            private javax.swing.JButton cancelButton;
197:            private javax.swing.JTextField fileNameField;
198:            private javax.swing.JPanel infoPanel;
199:            private javax.swing.JTextField progressInfoText;
200:            private javax.swing.JLabel rowInfo;
201:            // End of variables declaration//GEN-END:variables
202:
203:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.