info.informatica.doc.style.css.j2d
Class HeadlessStyleDatabase

java.lang.Object
  extended by info.informatica.doc.style.css.AbstractStyleDatabase
      extended by info.informatica.doc.style.css.j2d.Java2DStyleDatabase
          extended by info.informatica.doc.style.css.j2d.HeadlessStyleDatabase
All Implemented Interfaces:
StyleDatabase

public class HeadlessStyleDatabase
extends Java2DStyleDatabase

CSS style database for headless devices.

Useful for testing.

Author:
Carlos Amengual (amengual at informatica.info)

Field Summary
 
Fields inherited from class info.informatica.doc.style.css.AbstractStyleDatabase
DEFAULT_GENERIC_FONT_FAMILY, DEFAULT_INITIAL_COLOR
 
Constructor Summary
HeadlessStyleDatabase()
           
 
Method Summary
protected  float cmToPixels(float cm)
          Converts from centimeters to pixels.
protected  float deviceResolutionFactor()
          This method is used to normalize sizes to a 1024x768 screen.
 float getDocumentHeight()
          Gets the height of the document (or screen viewport) in the natural unit for the device.
 float getDocumentWidth()
          Gets the width of the document (or screen viewport) in the natural unit for the device.
protected  float pxTocm(int px)
          Converts from pixels to centimeters.
 
Methods inherited from class info.informatica.doc.style.css.j2d.Java2DStyleDatabase
clipColorValue, clipColorValue, getAWTColor, getDefaultGenericFontFamily, getFontSizeFromIdentifier, getGraphicsConfiguration, getNaturalUnit, getWidthSize, isFontFamilyAvailable, setGraphicsConfiguration, setNaturalUnit
 
Methods inherited from class info.informatica.doc.style.css.AbstractStyleDatabase
floatValueConversion, floatValueConversion, getDefaultGenericFontFamily, getExSizeInPt, getInitialColor, getScrollbarWidth, setInitialColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeadlessStyleDatabase

public HeadlessStyleDatabase()
Method Detail

deviceResolutionFactor

protected float deviceResolutionFactor()
Description copied from class: Java2DStyleDatabase
This method is used to normalize sizes to a 1024x768 screen.

Overrides:
deviceResolutionFactor in class Java2DStyleDatabase
Returns:
the factor by which screensize-dependent quantities can be multiplied to be normalized.

cmToPixels

protected float cmToPixels(float cm)
Description copied from class: AbstractStyleDatabase
Converts from centimeters to pixels.

Overrides:
cmToPixels in class Java2DStyleDatabase
Parameters:
cm - the value, in centimeters, to be converted.
Returns:
the value, expressed in pixels.

pxTocm

protected float pxTocm(int px)
Description copied from class: AbstractStyleDatabase
Converts from pixels to centimeters.

Overrides:
pxTocm in class Java2DStyleDatabase
Parameters:
px - the value, in pixels, to be converted.
Returns:
the value, expressed in centimeters.

getDocumentHeight

public float getDocumentHeight()
Description copied from interface: StyleDatabase
Gets the height of the document (or screen viewport) in the natural unit for the device.

Specified by:
getDocumentHeight in interface StyleDatabase
Overrides:
getDocumentHeight in class Java2DStyleDatabase
Returns:
the height of the document.

getDocumentWidth

public float getDocumentWidth()
Description copied from interface: StyleDatabase
Gets the width of the document (or screen viewport) in the natural unit for the device.

Specified by:
getDocumentWidth in interface StyleDatabase
Overrides:
getDocumentWidth in class Java2DStyleDatabase
Returns:
the width of the document.


Copyright © 2011 informatica.info. All Rights Reserved.