pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.statistics.model
Class AbstractResolution

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.statistics.model.AbstractResolution
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ScreenResolution

@MappedSuperclass
public abstract class AbstractResolution
extends AbstractBasicEntity

A abstract base class to derive an "entity representing a resolution" from.

To be removed if no further sub-classes are to be derived from AbstractResolution.

Version:
$Revision: 1548 $
Author:
Thomas Weber
See Also:
Serialized Form

Nested Class Summary
static class AbstractResolution.Format
          Enumerates the formats for screen resolutions.
 
Constructor Summary
protected AbstractResolution()
          Deprecated. 
protected AbstractResolution(AbstractResolution.Format f)
          Creates a default ScreenResolution.
  AbstractResolution(int xRes, int yRes)
          Creates a new resolution.
 
Method Summary
 AbstractResolution.Format getFormat()
          Returns the format.
 java.lang.Integer getX()
          Returns the available pixels in horizontal direction.
 java.lang.Integer getY()
          Returns the available pixels in vertical direction.
 boolean isFormat(AbstractResolution.Format f)
          Returns whether the ScreenResolution matches the given ScreenResolution.Format.
 boolean isMatch(int[] xyRes)
          Checks the given values for x- and y-resolution against the x- and y-values of the ScreenResolution.
 boolean isMatch(int xRes, int yRes)
          Checks the given values for x- and y-resolution against the x- and y-values of the ScreenResolution.
 boolean isMatch(ScreenResolution screenResolution)
          Checks the values the x- and y-values of the given ScreenResolution against the x- and y-values of the ScreenResolution.
 java.lang.String toString()
          Returns a string-representation of the ScreenResolution.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractResolution

@Deprecated
protected AbstractResolution()
Deprecated. 

Used by HibernateTM and JAXB.


AbstractResolution

public AbstractResolution(int xRes,
                          int yRes)
Creates a new resolution.

Parameters:
xRes - pixels in horizontal direction
yRes - pixels in vertical direction

AbstractResolution

protected AbstractResolution(AbstractResolution.Format f)
Creates a default ScreenResolution.

Parameters:
f - the ScreenResolution.Format
Method Detail

getX

public final java.lang.Integer getX()
Returns the available pixels in horizontal direction.

Returns:
the available pixels in horizontal direction

getY

public final java.lang.Integer getY()
Returns the available pixels in vertical direction.

Returns:
the available pixels in vertical direction

getFormat

public final AbstractResolution.Format getFormat()
Returns the format.

Returns:
the format

isFormat

public final boolean isFormat(AbstractResolution.Format f)
Returns whether the ScreenResolution matches the given ScreenResolution.Format.

Parameters:
f - the ScreenResolution.Format
Returns:
true if and only if the formats match, false otherwise

isMatch

public final boolean isMatch(int[] xyRes)
Checks the given values for x- and y-resolution against the x- and y-values of the ScreenResolution.

Parameters:
xyRes - the x-y-resolution
Returns:
true if and only if the given values for x- and y-resolution are a match against the x- and y-values of the ScreenResolution, false otherwise

isMatch

public final boolean isMatch(int xRes,
                             int yRes)
Checks the given values for x- and y-resolution against the x- and y-values of the ScreenResolution.

Parameters:
xRes - the x-resolution
yRes - the y-resolution
Returns:
true if and only if the given values for x- and y-resolution are a match against the x- and y-values of the ScreenResolution, false otherwise

isMatch

public final boolean isMatch(ScreenResolution screenResolution)
Checks the values the x- and y-values of the given ScreenResolution against the x- and y-values of the ScreenResolution.

Parameters:
screenResolution - the ScreenResolution
Returns:
true if and only if the given ScreenResolution is a match against the x- and y-values of the ScreenResolution, false otherwise

toString

public final java.lang.String toString()
Returns a string-representation of the ScreenResolution.

Overrides:
toString in class java.lang.Object
Returns:
a string-representation