Source Code Cross Referenced for EffectingFrame.java in  » Graphic-Library » apollo » org » apollo » datamodel » 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 » Graphic Library » apollo » org.apollo.datamodel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Apollo - Motion capture and animation system
003:         * Copyright (c) 2005 Apollo
004:         * 
005:         * This program is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU General Public License
007:         * as published by the Free Software Foundation; either version 2
008:         * of the License, or (at your option) any later version.
009:         * 
010:         * This program is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013:         * GNU General Public License for more details.
014:         * 
015:         * You should have received a copy of the GNU General Public License
016:         * along with this program; if not, write to the Free Software
017:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
018:         *
019:         * http://www.gnu.org/copyleft/gpl.html
020:         *
021:         * @author Giovane.Kuhn - brain@netuno.com.br
022:         *
023:         */
024:        package org.apollo.datamodel;
025:
026:        import java.io.Serializable;
027:        import java.util.ArrayList;
028:        import java.util.List;
029:
030:        import org.apollo.ColorGenerator;
031:
032:        /**
033:         * A class to represent a frame of video effecting, providing info about its markers
034:         * @author Giovane.Kuhn on 23/05/2005
035:         */
036:        public final class EffectingFrame implements  Serializable {
037:
038:            private static final long serialVersionUID = 1L;
039:
040:            /** List with marker in this frame */
041:            private List<Marker> markers;
042:
043:            /** List with markers that was removed */
044:            private List<Marker> removedMarkers;
045:
046:            /** Frame sequence, start at 0 */
047:            private int sequence;
048:
049:            public int getSequence() {
050:                return sequence;
051:            }
052:
053:            public void setSequence(int sequence) {
054:                this .sequence = sequence;
055:            }
056:
057:            public List<Marker> getMarkers() {
058:                return markers;
059:            }
060:
061:            public void setMarkers(List<Marker> markers) {
062:                this .markers = markers;
063:            }
064:
065:            public void addMarker(Marker marker) {
066:                if (markers == null) {
067:                    markers = new ArrayList<Marker>();
068:                }
069:                markers.add(marker);
070:            }
071:
072:            public void removeMarker(Marker marker) {
073:                if (markers == null) {
074:                    return;
075:                }
076:                // maintain effect markers, to reset later
077:                marker.reset();
078:                if (markers.remove(marker)
079:                        && marker.getOrigin() == Marker.ORIGIN_EFFECT) {
080:                    addRemovedMarker(marker);
081:                }
082:            }
083:
084:            private void addRemovedMarker(Marker marker) {
085:                if (removedMarkers == null) {
086:                    removedMarkers = new ArrayList<Marker>();
087:                }
088:                removedMarkers.add(marker);
089:            }
090:
091:            public void reset(boolean toOriginalMarkers) {
092:                if (markers == null) {
093:                    return;
094:                }
095:                List<Marker> toRemove = new ArrayList<Marker>();
096:                for (Marker m : markers) {
097:                    m.reset();
098:
099:                    // maintaint only effect markers
100:                    if (toOriginalMarkers
101:                            && m.getOrigin() != Marker.ORIGIN_EFFECT) {
102:                        toRemove.add(m);
103:                    }
104:                }
105:                // restore to an original point
106:                if (toOriginalMarkers) {
107:                    // remove marker thar isn't effect marker
108:                    for (Marker m : toRemove) {
109:                        markers.remove(m);
110:                    }
111:                    // add removed effect markers
112:                    if (removedMarkers != null) {
113:                        markers.addAll(removedMarkers);
114:                        removedMarkers = null;
115:                    }
116:                }
117:
118:            }
119:
120:            public void uncolorizeMarkers() {
121:                if (markers == null) {
122:                    return;
123:                }
124:                for (Marker m : markers) {
125:                    m.setColor(null);
126:                }
127:            }
128:
129:            public void colorizeMarkers(ColorGenerator cg) {
130:                if (markers == null) {
131:                    return;
132:                }
133:                for (Marker m : markers) {
134:                    if (m.getColor() == null) {
135:                        m.setColor(cg.next());
136:                    }
137:                }
138:            }
139:
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.