com.intellij.openapi.util
Class DimensionService

java.lang.Object
  extended by com.intellij.openapi.util.DimensionService
All Implemented Interfaces:
ApplicationComponent, BaseComponent, JDOMExternalizable

public class DimensionService
extends java.lang.Object
implements JDOMExternalizable, ApplicationComponent

This class represents map between strings and rectangles. It's intended to store sizes of window, dialogs, etc.


Method Summary
 void disposeComponent()
          Component should dispose system resources or perform another cleanup in this method.
 java.lang.String getComponentName()
          Unique name of this component.
 int getExtendedState(java.lang.String key)
           
static DimensionService getInstance()
           
 java.awt.Point getLocation(java.lang.String key)
           
 java.awt.Dimension getSize(java.lang.String key)
           
 void initComponent()
          Component should do initialization and communication with another components in this method.
 void readExternal(org.jdom.Element element)
           
 void setExtendedState(java.lang.String key, int extendedState)
           
 void setLocation(java.lang.String key, java.awt.Point point)
          Store specified point under the key.
 void setSize(java.lang.String key, java.awt.Dimension size)
          Store specified size under the key.
 void writeExternal(org.jdom.Element element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DimensionService getInstance()

initComponent

public void initComponent()
Description copied from interface: BaseComponent
Component should do initialization and communication with another components in this method.

Specified by:
initComponent in interface BaseComponent

disposeComponent

public void disposeComponent()
Description copied from interface: BaseComponent
Component should dispose system resources or perform another cleanup in this method.

Specified by:
disposeComponent in interface BaseComponent

getLocation

public java.awt.Point getLocation(java.lang.String key)
Returns:
point stored under the specified key. The method returns null if there is no stored value under the key. If point is outside of current screen bounds then the method returns null. It properly works in multimonitor configuration.
Throws:
java.lang.IllegalArgumentException - if key is null.

setLocation

public void setLocation(java.lang.String key,
                        java.awt.Point point)
Store specified point under the key. If point is null then the value stored under key will be removed.

Throws:
java.lang.IllegalArgumentException - if key is null.

getSize

public java.awt.Dimension getSize(java.lang.String key)
Returns:
point stored under the specified key. The method returns null if there is no stored value under the key.
Throws:
java.lang.IllegalArgumentException - if key is null.

setSize

public void setSize(java.lang.String key,
                    java.awt.Dimension size)
Store specified size under the key. If size is null then the value stored under key will be removed.

Throws:
java.lang.IllegalArgumentException - if key is null.

readExternal

public void readExternal(org.jdom.Element element)
                  throws InvalidDataException
Specified by:
readExternal in interface JDOMExternalizable
Throws:
InvalidDataException

writeExternal

public void writeExternal(org.jdom.Element element)
                   throws WriteExternalException
Specified by:
writeExternal in interface JDOMExternalizable
Throws:
WriteExternalException

getComponentName

public java.lang.String getComponentName()
Description copied from interface: BaseComponent
Unique name of this component. If there is another component with the same name or name is null internal assertion will occur.

Specified by:
getComponentName in interface BaseComponent
Returns:
the name of this component

setExtendedState

public void setExtendedState(java.lang.String key,
                             int extendedState)

getExtendedState

public int getExtendedState(java.lang.String key)