Source Code Cross Referenced for Point.java in  » IDE-Eclipse » swt » org » eclipse » swt » graphics » 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 » IDE Eclipse » swt » org.eclipse.swt.graphics 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2005 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.swt.graphics;
011:
012:        import org.eclipse.swt.internal.SerializableCompatibility;
013:
014:        /**
015:         * Instances of this class represent places on the (x, y)
016:         * coordinate plane.
017:         * <p>
018:         * The coordinate space for rectangles and points is considered
019:         * to have increasing values downward and to the right from its
020:         * origin making this the normal, computer graphics oriented notion
021:         * of (x, y) coordinates rather than the strict mathematical one.
022:         * </p>
023:         * <p>
024:         * The hashCode() method in this class uses the values of the public
025:         * fields to compute the hash value. When storing instances of the
026:         * class in hashed collections, do not modify these fields after the
027:         * object has been inserted.  
028:         * </p>
029:         * <p>
030:         * Application code does <em>not</em> need to explicitly release the
031:         * resources managed by each instance when those instances are no longer
032:         * required, and thus no <code>dispose()</code> method is provided.
033:         * </p>
034:         *
035:         * @see Rectangle
036:         */
037:
038:        public final class Point implements  SerializableCompatibility {
039:
040:            /**
041:             * the x coordinate of the point
042:             */
043:            public int x;
044:
045:            /**
046:             * the y coordinate of the point
047:             */
048:            public int y;
049:
050:            static final long serialVersionUID = 3257002163938146354L;
051:
052:            /**
053:             * Constructs a new point with the given x and y coordinates.
054:             *
055:             * @param x the x coordinate of the new point
056:             * @param y the y coordinate of the new point
057:             */
058:            public Point(int x, int y) {
059:                this .x = x;
060:                this .y = y;
061:            }
062:
063:            /**
064:             * Compares the argument to the receiver, and returns true
065:             * if they represent the <em>same</em> object using a class
066:             * specific comparison.
067:             *
068:             * @param object the object to compare with this object
069:             * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
070:             *
071:             * @see #hashCode()
072:             */
073:            public boolean equals(Object object) {
074:                if (object == this )
075:                    return true;
076:                if (!(object instanceof  Point))
077:                    return false;
078:                Point p = (Point) object;
079:                return (p.x == this .x) && (p.y == this .y);
080:            }
081:
082:            /**
083:             * Returns an integer hash code for the receiver. Any two 
084:             * objects that return <code>true</code> when passed to 
085:             * <code>equals</code> must return the same value for this
086:             * method.
087:             *
088:             * @return the receiver's hash
089:             *
090:             * @see #equals(Object)
091:             */
092:            public int hashCode() {
093:                return x ^ y;
094:            }
095:
096:            /**
097:             * Returns a string containing a concise, human-readable
098:             * description of the receiver.
099:             *
100:             * @return a string representation of the point
101:             */
102:            public String toString() {
103:                return "Point {" + x + ", " + y + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
104:            }
105:
106:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.