Java Doc for Dimension.java in  » 6.0-JDK-Core » AWT » java » awt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.geom.Dimension2D
      java.awt.Dimension

Dimension
public class Dimension extends Dimension2D implements java.io.Serializable(Code)
The Dimension class encapsulates the width and height of a component (in integer precision) in a single object. The class is associated with certain properties of components. Several methods defined by the Component class and the LayoutManager interface return a Dimension object.

Normally the values of width and height are non-negative integers. The constructors that allow you to create a dimension do not prevent you from setting a negative value for these properties. If the value of width or height is negative, the behavior of some methods defined by other objects is undefined.
version:
   1.40, 05/05/07
author:
   Sami Shaio
author:
   Arthur van Hoff
See Also:   java.awt.Component
See Also:   java.awt.LayoutManager
since:
   1.0



Field Summary
public  intheight
     The height dimension; negative values can be used.
public  intwidth
     The width dimension; negative values can be used.

Constructor Summary
public  Dimension()
     Creates an instance of Dimension with a width of zero and a height of zero.
public  Dimension(Dimension d)
     Creates an instance of Dimension whose width and height are the same as for the specified dimension.
public  Dimension(int width, int height)
     Constructs a Dimension and initializes it to the specified width and specified height.

Method Summary
public  booleanequals(Object obj)
     Checks whether two dimension objects have equal values.
public  doublegetHeight()
    
public  DimensiongetSize()
     Gets the size of this Dimension object.
public  doublegetWidth()
    
public  inthashCode()
     Returns the hash code for this Dimension.
public  voidsetSize(double width, double height)
     Sets the size of this Dimension object to the specified width and height in double precision.
public  voidsetSize(Dimension d)
     Sets the size of this Dimension object to the specified size.
public  voidsetSize(int width, int height)
     Sets the size of this Dimension object to the specified width and height.
public  StringtoString()
     Returns a string representation of the values of this Dimension object's height and width fields.

Field Detail
height
public int height(Code)
The height dimension; negative values can be used.
See Also:   Dimension.getSize
See Also:   Dimension.setSize
since:
   1.0



width
public int width(Code)
The width dimension; negative values can be used.
See Also:   Dimension.getSize
See Also:   Dimension.setSize
since:
   1.0




Constructor Detail
Dimension
public Dimension()(Code)
Creates an instance of Dimension with a width of zero and a height of zero.



Dimension
public Dimension(Dimension d)(Code)
Creates an instance of Dimension whose width and height are the same as for the specified dimension.
Parameters:
  d - the specified dimension for the width and height values



Dimension
public Dimension(int width, int height)(Code)
Constructs a Dimension and initializes it to the specified width and specified height.
Parameters:
  width - the specified width
Parameters:
  height - the specified height




Method Detail
equals
public boolean equals(Object obj)(Code)
Checks whether two dimension objects have equal values.



getHeight
public double getHeight()(Code)

since:
   1.2



getSize
public Dimension getSize()(Code)
Gets the size of this Dimension object. This method is included for completeness, to parallel the getSize method defined by Component. the size of this dimension, a new instance of Dimension with the same width and height
See Also:   java.awt.Dimension.setSize
See Also:   java.awt.Component.getSize
since:
   1.1



getWidth
public double getWidth()(Code)

since:
   1.2



hashCode
public int hashCode()(Code)
Returns the hash code for this Dimension. a hash code for this Dimension



setSize
public void setSize(double width, double height)(Code)
Sets the size of this Dimension object to the specified width and height in double precision. Note that if width or height are larger than Integer.MAX_VALUE, they will be reset to Integer.MAX_VALUE.
Parameters:
  width - the new width for the Dimension object
Parameters:
  height - the new height for the Dimension object
since:
   1.2



setSize
public void setSize(Dimension d)(Code)
Sets the size of this Dimension object to the specified size. This method is included for completeness, to parallel the setSize method defined by Component.
Parameters:
  d - the new size for this Dimension object
See Also:   java.awt.Dimension.getSize
See Also:   java.awt.Component.setSize
since:
   1.1



setSize
public void setSize(int width, int height)(Code)
Sets the size of this Dimension object to the specified width and height. This method is included for completeness, to parallel the setSize method defined by Component.
Parameters:
  width - the new width for this Dimension object
Parameters:
  height - the new height for this Dimension object
See Also:   java.awt.Dimension.getSize
See Also:   java.awt.Component.setSize
since:
   1.1



toString
public String toString()(Code)
Returns a string representation of the values of this Dimension object's height and width fields. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null. a string representation of this Dimension object



Methods inherited from java.awt.geom.Dimension2D
public Object clone()(Code)(Java Doc)
abstract public double getHeight()(Code)(Java Doc)
abstract public double getWidth()(Code)(Java Doc)
abstract public void setSize(double width, double height)(Code)(Java Doc)
public void setSize(Dimension2D d)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.