Source Code Cross Referenced for ZMoneyCalculatorWindow.java in  » ERP-CRM-Financial » Personal-Finance-Manager » br » com » gfpshare » beans » 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 » ERP CRM Financial » Personal Finance Manager » br.com.gfpshare.beans 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on 10/01/2004
003:         * 
004:         * ============================================================================
005:         * GNU Lesser General Public License
006:         * ============================================================================
007:         *
008:         * Swing Components - visit http://sf.net/projects/gfd
009:         * 
010:         * Copyright (C) 2004  Igor Regis da Silva Simões
011:         * 
012:         * This library is free software; you can redistribute it and/or
013:         * modify it under the terms of the GNU Lesser General Public
014:         * License as published by the Free Software Foundation; either
015:         * version 2.1 of the License, or (at your option) any later version.
016:         * 
017:         * This library is distributed in the hope that it will be useful,
018:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
019:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
020:         * Lesser General Public License for more details.
021:         * 
022:         * You should have received a copy of the GNU Lesser General Public
023:         * License along with this library; if not, write to the Free Software
024:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
025:         */
026:
027:        package br.com.gfpshare.beans;
028:
029:        import java.awt.Frame;
030:        import java.awt.KeyboardFocusManager;
031:        import java.util.Date;
032:
033:        import javax.swing.JFormattedTextField;
034:        import javax.swing.JWindow;
035:        import javax.swing.SwingUtilities;
036:        import javax.swing.border.BevelBorder;
037:
038:        import br.com.gfpshare.beans.event.CalculatorEvent;
039:        import br.com.gfpshare.beans.event.MoneyCalculatorEventListener;
040:
041:        /**
042:         *  Janela que exbibe um calendário para o componete de escolha de datas.<br><br>
043:         *  
044:         *  Para usá-la deve-se instanciá-la e passar sua referência para o contrutor de ICalendarTextField <br>
045:         *  Exemplo: <br>
046:         *      ICalendarTextField texto = new ICalendarTextField(new ICalendarWindow(owner)); <br>
047:         *  Onde owner é o frame ao qual deve ser associada a janela que exibe o calendário.
048:         *
049:         *  @author Administrador
050:         *  @created 20/01/2004
051:         *  @see br.com.gfpshare.beans.ZCalendarTextField br.com.igor.beans.ICalendarPanel
052:         */
053:        public class ZMoneyCalculatorWindow extends JWindow implements 
054:                MoneyCalculatorEventListener {
055:            private JFormattedTextField texto = null;
056:            private boolean abilitado = false;
057:            private MoneyCalculatorPanel painel = null;
058:
059:            /**
060:             *  Cria uma nova instância de ICalendarWindow
061:             * @param owner O Frame owner desta janela
062:             */
063:            public ZMoneyCalculatorWindow(Frame owner) {
064:                super (owner == null ? KeyboardFocusManager
065:                        .getCurrentKeyboardFocusManager().getFocusedWindow()
066:                        : owner);
067:                setVisible(false);
068:                painel = new MoneyCalculatorPanel();
069:                painel.setBorder(new BevelBorder(BevelBorder.RAISED));
070:                setContentPane(painel);
071:                painel.addMoneyCalculatorEventListener(this );
072:                setSize(190, 180);
073:            }
074:
075:            /**  Cria uma nova instância de ICalendarWindow
076:             * @param owner O Frame owner desta janela
077:             * @param date A data padrão do calendário
078:             * @param texto O componente de texto que receberá o rasultado do calendário
079:             */
080:            public ZMoneyCalculatorWindow(Frame owner, Date date,
081:                    JFormattedTextField texto) {
082:                this (owner);
083:                this .texto = texto;
084:            }
085:
086:            /**
087:             * @param text Seta o componente de edição de texto usado.
088:             */
089:            public void setTextComponent(JFormattedTextField text) {
090:                this .texto = text;
091:            }
092:
093:            /**  Configura a janela passando a data que será exibida por padrão e o ICalendarTextField que
094:             *  receberá a data selecionada pelo usuário.
095:             * @param value valor padrão do calendário
096:             */
097:            public void setValue(Object value) {
098:                ((MoneyCalculatorPanel) getContentPane()).setValue(value);
099:            }
100:
101:            /**  Trata os eventos de fechamento do calendário
102:             * @param e Evento de calendário
103:             */
104:            public void fechandoCalculadora(CalculatorEvent e) {
105:                setVisible(false);
106:                setAbilitado(false);
107:                if (texto != null)
108:                    texto.requestFocus();
109:            }
110:
111:            /**  Trata os eventos de abertura do calendário
112:             * @param e Evento de calendário
113:             */
114:            public void abrindoCalculadora(CalculatorEvent e) {
115:                //Não implementado
116:            }
117:
118:            /**  Indica que o calendário pode ser exibido
119:             * @param enabled Booleano indicando se o componente está habilitado para ser exibido
120:             */
121:            public void setAbilitado(boolean enabled) {
122:                if (enabled)
123:                    SwingUtilities.updateComponentTreeUI(this );
124:                abilitado = enabled;
125:                painel.setAtivo(enabled);
126:            }
127:
128:            /**
129:             * @see br.com.gfpshare.beans.event.MoneyCalculatorEventListener#isAbilitado()
130:             */
131:            public boolean isAbilitado() {
132:                return abilitado;
133:            }
134:
135:            /**
136:             * @see br.com.gfpshare.beans.event.MoneyCalculatorEventListener#valorAlterado(br.com.gfpshare.beans.event.CalculatorEvent)
137:             */
138:            public void valorAlterado(CalculatorEvent e) {
139:                if (texto != null) {
140:                    if (((MoneyCalculatorPanel) e.getSource()).getValue() != null
141:                            && !((MoneyCalculatorPanel) e.getSource())
142:                                    .getValue().equals(""))
143:                        try {
144:                            texto.setValue(Double
145:                                    .valueOf(((MoneyCalculatorPanel) e
146:                                            .getSource()).getValue()));
147:                        } catch (Exception ex) {
148:                            texto.setValue(null);
149:                        }
150:                    else
151:                        texto.setValue(null);
152:                }
153:            }
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.