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