Source Code Cross Referenced for ISpinnerDateModel.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 11/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.util.Date;
030:
031:        import javax.swing.SpinnerDateModel;
032:        import javax.swing.event.EventListenerList;
033:
034:        import br.com.gfpshare.beans.event.ISpinnerModelEvent;
035:        import br.com.gfpshare.beans.event.ISpinnerModelListener;
036:
037:        /**
038:         *  Esta classe representa um modelo de dados de datas para um JSpinner, que dispara eventos conforma seu conteúdo é navegado
039:         *
040:         * @author Igor Regis da Silva Simões
041:         *  @created 18/01/2004
042:         */
043:        public class ISpinnerDateModel extends SpinnerDateModel {
044:
045:            /**
046:             *  Lista de listeners dos eventos gerador por este model.
047:             */
048:            private EventListenerList listeners = new EventListenerList();
049:
050:            /** Cria uma nova instância de ISpinnerDateModel */
051:            public ISpinnerDateModel() {
052:                super ();
053:            }
054:
055:            /**  Cria uma nova instância de ISpinnerDateModel
056:             * @param value Valor que será o padrão para o model
057:             * @param start A data mínima que pode ser selecionada
058:             * @param end   A data máxima que pode ser selecionada
059:             * @param calendarField O campo da data que será exibido. Ex.: MES, ANO...
060:             */
061:            public ISpinnerDateModel(Date value, Comparable start,
062:                    Comparable end, int calendarField) {
063:                super (value, start, end, calendarField);
064:            }
065:
066:            /**  Retorna o próximo valor a ser exibido e dispara um evento
067:             * @return Retorna o próximo valor válido
068:             */
069:            @Override
070:            public Object getNextValue() {
071:                Object retValue;
072:
073:                (new Thread() {
074:                    @Override
075:                    public void run() {
076:                        try {
077:                            fireProximoValorSelecionado();
078:                        } catch (Exception e) {
079:                            e.printStackTrace();
080:                        }
081:                    }
082:                }).start();
083:
084:                retValue = super .getNextValue();
085:                return retValue;
086:            }
087:
088:            /**
089:             *  Retorna o valor prévio a ser exibido e dispara um evento
090:             * @return Retorna o valor válido anterior
091:             */
092:            @Override
093:            public Object getPreviousValue() {
094:                Object retValue;
095:
096:                (new Thread() {
097:                    @Override
098:                    public void run() {
099:                        try {
100:                            firePrevioValorSelecionado();
101:                        } catch (Exception e) {
102:                            e.printStackTrace();
103:                        }
104:                    }
105:                }).start();
106:
107:                retValue = super .getPreviousValue();
108:                return retValue;
109:            }
110:
111:            /** 
112:             *  Adiciona um listener ao model
113:             *  @param listener  Listener a ser adicionado
114:             */
115:            public void addModelListener(ISpinnerModelListener listener) {
116:                listeners.add(ISpinnerModelListener.class, listener);
117:            }
118:
119:            /**
120:             *  Remove um listener do model
121:             *  @param listener  Listener a ser removido
122:             */
123:            public void removeModelListener(ISpinnerModelListener listener) {
124:                listeners.remove(ISpinnerModelListener.class, listener);
125:            }
126:
127:            /**
128:             *  Notifica todos os listener registrados de que o valor seguinte foi solicitado ao model
129:             */
130:            private void fireProximoValorSelecionado() {
131:                Object[] listeners = this .listeners
132:                        .getListeners(ISpinnerModelListener.class);
133:
134:                for (int i = 0; i < listeners.length; i++) {
135:                    ((ISpinnerModelListener) listeners[i])
136:                            .proximoValorSelecionado(new ISpinnerModelEvent(
137:                                    this ));
138:                }
139:            }
140:
141:            /**
142:             *  Notifica todos os listener registrados de que o valor anterior foi solicitado ao model
143:             */
144:            private void firePrevioValorSelecionado() {
145:                Object[] listeners = this .listeners
146:                        .getListeners(ISpinnerModelListener.class);
147:
148:                for (int i = 0; i < listeners.length; i++)
149:                    ((ISpinnerModelListener) listeners[i])
150:                            .previoValorSelecionado(new ISpinnerModelEvent(this));
151:            }
152:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.