Source Code Cross Referenced for AnnotationDesc.java in  » Swing-Library » abeille-forms-designer » org » netbeans » editor » 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 » Swing Library » abeille forms designer » org.netbeans.editor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *                 Sun Public License Notice
003:         *
004:         * The contents of this file are subject to the Sun Public License
005:         * Version 1.0 (the "License"). You may not use this file except in
006:         * compliance with the License. A copy of the License is available at
007:         * http://www.sun.com/
008:         *
009:         * The Original Code is NetBeans. The Initial Developer of the Original
010:         * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun
011:         * Microsystems, Inc. All Rights Reserved.
012:         */
013:
014:        package org.netbeans.editor;
015:
016:        import java.awt.Image;
017:        import java.beans.PropertyChangeListener;
018:        import java.beans.PropertyChangeSupport;
019:
020:        import javax.swing.Action;
021:
022:        /**
023:         * Description of the annotation. The annotations is defined by AnnotationType,
024:         * length, offset and description.
025:         * 
026:         * @author David Konecny
027:         * @since 07/2001
028:         */
029:        public abstract class AnnotationDesc extends Object {
030:
031:            /** Property name of the tip text */
032:            public static final String PROP_SHORT_DESCRIPTION = "shortDescription";
033:
034:            /** Property name of the annotation type */
035:            public static final String PROP_ANNOTATION_TYPE = "annotationType";
036:
037:            /** Virtual property for fronting of annotation */
038:            public static final String PROP_MOVE_TO_FRONT = "moveToFront";
039:
040:            /** Support for property change listeners */
041:            private PropertyChangeSupport support;
042:
043:            /**
044:             * This is sequential number which is used for cycling through the
045:             * anotations. Each added annotion gets number and this number if necessary
046:             * is used for cycling through the annotations - cycle causes that
047:             * annotation with higher number is shown. If no higher number exist the
048:             * cycling starts from the begining.
049:             */
050:            private int order;
051:
052:            /** Unique counter used for order variable. */
053:            private static int counter = 0;
054:
055:            /** Length of the annotated text. If -1 than whole line is annotated */
056:            private int length;
057:
058:            /**
059:             * Private member used by Annotations class. After the annotation is
060:             * attached to document, the Mark which is crated (or shared with some other
061:             * annotation) is stored here. Only for internal purpose of Annoations class
062:             */
063:            private Mark mark;
064:
065:            /**
066:             * AnnotationType attached to this annotation. Annotation has a few pass
067:             * through methods to AnnotationType for simple access to the annotation
068:             * type information.
069:             */
070:            private AnnotationType type = null;
071:
072:            public AnnotationDesc(int offset, int length) {
073:                counter++;
074:                this .order = counter;
075:                this .length = length;
076:                support = new PropertyChangeSupport(this );
077:            }
078:
079:            /** Gets annotation coloring. This is pass through method to annotation type */
080:            public Coloring getColoring() {
081:                return type.getColoring();
082:            }
083:
084:            /** Gets glyph image. This is pass through method to annotation type */
085:            public Image getGlyph() {
086:                return type.getGlyphImage();
087:            }
088:
089:            /** Checks whether the annotation type has its own glyph icon */
090:            public boolean isDefaultGlyph() {
091:                return type.isDefaultGlyph();
092:            }
093:
094:            /**
095:             * Is annotation type visible. This is pass through method to annotation
096:             * type
097:             */
098:            public boolean isVisible() {
099:                return type.isVisible();
100:            }
101:
102:            /** Internal order of the annotations. Used for correct cycling. */
103:            public int getOrderNumber() {
104:                return order;
105:            }
106:
107:            /** Returns list of actions associated to this annotation type. */
108:            public Action[] getActions() {
109:                return type.getActions();
110:            }
111:
112:            /** Whether this annotation annotates whole line or just part of the text */
113:            public boolean isWholeLine() {
114:                return length == -1;
115:            }
116:
117:            /** Get length of the annotation */
118:            public int getLength() {
119:                return length;
120:            }
121:
122:            /** Set Mark which represent this annotation in document */
123:            void setMark(Mark mark) {
124:                this .mark = mark;
125:            }
126:
127:            /** Get Mark which represent this annotation in document */
128:            Mark getMark() {
129:                return mark;
130:            }
131:
132:            /** Getter for annotation type object */
133:            public AnnotationType getAnnotationTypeInstance() {
134:                return type;
135:            }
136:
137:            /** Getter for annotation type name */
138:            public abstract String getAnnotationType();
139:
140:            /** Getter for localized tooltip text for this annotation */
141:            public abstract String getShortDescription();
142:
143:            /** Getter for offset of this annotation */
144:            public abstract int getOffset();
145:
146:            /** Getter for line number of this annotation */
147:            public abstract int getLine();
148:
149:            /**
150:             * Method for fetching AnnotationType which correspond to the name of the
151:             * annotation type stored in annotation.
152:             */
153:            public void updateAnnotationType() {
154:                type = AnnotationTypes.getTypes().getType(getAnnotationType());
155:            }
156:
157:            /**
158:             * Add listeners on changes of annotation properties
159:             * 
160:             * @param l
161:             *            change listener
162:             */
163:            final public void addPropertyChangeListener(PropertyChangeListener l) {
164:                support.addPropertyChangeListener(l);
165:            }
166:
167:            /**
168:             * Remove listeners on changes of annotation properties
169:             * 
170:             * @param l
171:             *            change listener
172:             */
173:            final public void removePropertyChangeListener(
174:                    PropertyChangeListener l) {
175:                support.removePropertyChangeListener(l);
176:            }
177:
178:            /** Fire property change to registered listeners. */
179:            final protected void firePropertyChange(String propertyName,
180:                    Object oldValue, Object newValue) {
181:                support.firePropertyChange(propertyName, oldValue, newValue);
182:            }
183:
184:            public String toString() {
185:                return "Annotation: type='" + getAnnotationType() + "', line="
186:                        + getLine() + // NOI18N
187:                        ", offset=" + getOffset() + ", length=" + length + // NOI18N
188:                        ", coloring=" + getColoring(); // NOI18N
189:            }
190:
191:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.