Source Code Cross Referenced for ZCalendarFrame.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 20/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.util.Date;
031:
032:        import javax.swing.JDialog;
033:        import javax.swing.SwingUtilities;
034:
035:        import br.com.gfpshare.beans.event.ICalendarEvent;
036:        import br.com.gfpshare.beans.event.ICalendarEventListener;
037:
038:        /**
039:         * Janela que exbibe um calendário para o componete de escolha de datas. <br>
040:         * <br>
041:         * Para usá-la deve-se instanciá-la e passar sua referência para o contrutor de ICalendarTextField <br>
042:         * Exemplo: <br>
043:         * ICalendarTextField texto = new ICalendarTextField(new ICalendarFrame(owner)); <br>
044:         * Onde owner é o frame ao qual deve ser associada a janela que exibe o calendário.
045:         * 
046:         * @author Administrador
047:         * @created 20/01/2004
048:         * @see br.com.gfpshare.beans.ZCalendarTextField br.com.igor.beans.ICalendarPanel
049:         */
050:        public class ZCalendarFrame extends JDialog implements  ICalendar,
051:                ICalendarEventListener {
052:
053:            private ICalendarField texto = null;
054:
055:            private boolean abilitado = false;
056:
057:            /**
058:             * Cria uma nova instancia de ICalendarFrame, permitindo torná-la modal
059:             * 
060:             * @param owner O Frame owner da janela de calandário
061:             * @param modal Indica se esta janela deve ser exibida como modal
062:             */
063:            public ZCalendarFrame(Frame owner, boolean modal) {
064:                super (owner, modal);
065:                ZCalendarPanel painel = new ZCalendarPanel();
066:                painel.addCalendarListener(this );
067:                setContentPane(painel);
068:                setSize(180, 150);
069:            }
070:
071:            /**
072:             * Cria uma nova instancia de ICalendarFrame
073:             * 
074:             * @param owner O Frame owner da janela de calandário
075:             * @param modal Indica se esta janela deve ser exibida como modal
076:             * @param date Data padrãop do calandário
077:             * @param texto Componente de texto que receberá o resultado do que foi selecionado no calendário
078:             */
079:            public ZCalendarFrame(Frame owner, boolean modal, Date date,
080:                    ICalendarField texto) {
081:                this (owner, modal);
082:                this .texto = texto;
083:            }
084:
085:            /**
086:             * @see br.com.gfpshare.beans.ICalendar#setTextComponent(br.com.gfpshare.beans.ICalendarField)
087:             */
088:            public void setTextComponent(ICalendarField text) {
089:                this .texto = text;
090:            }
091:
092:            /**
093:             * Configura a janela passando a data que será exibida por padrão e o ICalendarTextField que receberá a data selecionada pelo usuário.
094:             * 
095:             * @param data Data padrãop do calandário
096:             */
097:            public void setDate(java.util.Date data) {
098:                ((ZCalendarPanel) getContentPane()).setDate(data);
099:            }
100:
101:            /**
102:             * Trata os eventos de mudança de dia no calendário
103:             * 
104:             * @param e Evento de calendário
105:             */
106:            public void diaSelecionado(ICalendarEvent e) {
107:                texto.setCalendar(((ZCalendarPanel) e.getSource())
108:                        .getCalendar());
109:            }
110:
111:            /**
112:             * Trata os eventos de mudança de mês no calendário
113:             * 
114:             * @param e Evento de calendário
115:             */
116:            public void mesSelecionado(ICalendarEvent e) {
117:                texto.setCalendar(((ZCalendarPanel) e.getSource())
118:                        .getCalendar());
119:            }
120:
121:            /**
122:             * Trata os eventos de mudança de ano no calendário
123:             * 
124:             * @param e Evento de calendário
125:             */
126:            public void anoSelecionado(ICalendarEvent e) {
127:                texto.setCalendar(((ZCalendarPanel) e.getSource())
128:                        .getCalendar());
129:            }
130:
131:            /**
132:             * Trata os eventos de fechamento do calendário
133:             * 
134:             * @param e Evento de calendário
135:             */
136:            public void fechandoCalendario(ICalendarEvent e) {
137:                setVisible(false);
138:                texto.requestFocus();
139:            }
140:
141:            /**
142:             * Trata os eventos de abertura do calendário
143:             * 
144:             * @param e Evento de calendário
145:             */
146:            public void abrindoCalendario(ICalendarEvent e) {
147:                //Não fazemos nada
148:            }
149:
150:            /**
151:             * Indica que o calendário pode ser exibido
152:             * 
153:             * @param enabled Booleano indicando quando o componente está habilitado para exibição
154:             */
155:            public void setAbilitado(boolean enabled) {
156:                if (enabled)
157:                    SwingUtilities.updateComponentTreeUI(this );
158:                abilitado = enabled;
159:            }
160:
161:            /**
162:             * @see br.com.gfpshare.beans.ICalendar#isAbilitado()
163:             */
164:            public boolean isAbilitado() {
165:                return abilitado;
166:            }
167:
168:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.