Class MediaDeviceDescription
- java.lang.Object
-
- com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription
-
public class MediaDeviceDescription extends java.lang.ObjectClass that bundles all the values of a media device description.
-
-
Field Summary
Fields Modifier and Type Field Description private intbitsPerComponentThe bits per component.private intcolorIndexThe color index.private static MediaDeviceDescriptionDEFAULTprivate floatheightThe height in points.private booleanisGridIndicates if the media device is a grid.private intmonochromeThe the number of bits per pixel on a monochrome (greyscale) device.private java.lang.StringorientationThe orientation.private floatresolutionThe resolution in DPI.private java.lang.StringscanThe scan value.private java.lang.StringtypeThe type.private floatwidthThe width in points.
-
Constructor Summary
Constructors Constructor Description MediaDeviceDescription(java.lang.String type)SeeMediaTypeclass constants for possible values.MediaDeviceDescription(java.lang.String type, float width, float height)Creates a newMediaDeviceDescriptioninstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MediaDeviceDescriptioncreateDefault()Creates the defaultMediaDeviceDescription.intgetBitsPerComponent()Gets the bits per component.intgetColorIndex()Gets the color index.static MediaDeviceDescriptiongetDefault()Gets defaultMediaDeviceDescriptioninstance.floatgetHeight()Gets the height in points.intgetMonochrome()Gets the number of bits per pixel on a monochrome (greyscale) device.java.lang.StringgetOrientation()Gets the orientation.floatgetResolution()Gets the resolution in DPI.java.lang.StringgetScan()Gets the scan value.java.lang.StringgetType()Gets the type.floatgetWidth()Gets the width in points.booleanisGrid()Checks if the media device is a grid.MediaDeviceDescriptionsetBitsPerComponent(int bitsPerComponent)Sets the bits per component.MediaDeviceDescriptionsetColorIndex(int colorIndex)Sets the color index.MediaDeviceDescriptionsetGrid(boolean grid)Sets the grid value.MediaDeviceDescriptionsetHeight(float height)Sets the height in points.MediaDeviceDescriptionsetMonochrome(int monochrome)Sets the number of bits per pixel on a monochrome (greyscale) device.MediaDeviceDescriptionsetOrientation(java.lang.String orientation)Sets the orientation.MediaDeviceDescriptionsetResolution(float resolution)Sets the resolution in DPI.MediaDeviceDescriptionsetScan(java.lang.String scan)Sets the scan value.MediaDeviceDescriptionsetWidth(float width)Sets the width in points.
-
-
-
Field Detail
-
DEFAULT
private static final MediaDeviceDescription DEFAULT
-
type
private java.lang.String type
The type.
-
bitsPerComponent
private int bitsPerComponent
The bits per component.
-
colorIndex
private int colorIndex
The color index.
-
width
private float width
The width in points.
-
height
private float height
The height in points.
-
isGrid
private boolean isGrid
Indicates if the media device is a grid.
-
scan
private java.lang.String scan
The scan value.
-
orientation
private java.lang.String orientation
The orientation.
-
monochrome
private int monochrome
The the number of bits per pixel on a monochrome (greyscale) device.
-
resolution
private float resolution
The resolution in DPI.
-
-
Constructor Detail
-
MediaDeviceDescription
public MediaDeviceDescription(java.lang.String type)
SeeMediaTypeclass constants for possible values.- Parameters:
type- a type of the media to use.
-
MediaDeviceDescription
public MediaDeviceDescription(java.lang.String type, float width, float height)Creates a newMediaDeviceDescriptioninstance.- Parameters:
type- the typewidth- the widthheight- the height
-
-
Method Detail
-
createDefault
public static MediaDeviceDescription createDefault()
Creates the defaultMediaDeviceDescription.- Returns:
- the media device description
-
getDefault
public static MediaDeviceDescription getDefault()
Gets defaultMediaDeviceDescriptioninstance. Do not modify any fields of the returned media device description because it may lead to unpredictable results. UsecreateDefault()if you want to modify device description.- Returns:
- the default media device description
-
getType
public java.lang.String getType()
Gets the type.- Returns:
- the type
-
getBitsPerComponent
public int getBitsPerComponent()
Gets the bits per component.- Returns:
- the bits per component
-
setBitsPerComponent
public MediaDeviceDescription setBitsPerComponent(int bitsPerComponent)
Sets the bits per component.- Parameters:
bitsPerComponent- the bits per component- Returns:
- the media device description
-
getColorIndex
public int getColorIndex()
Gets the color index.- Returns:
- the color index
-
setColorIndex
public MediaDeviceDescription setColorIndex(int colorIndex)
Sets the color index.- Parameters:
colorIndex- the color index- Returns:
- the media device description
-
getWidth
public float getWidth()
Gets the width in points.- Returns:
- the width
-
setWidth
public MediaDeviceDescription setWidth(float width)
Sets the width in points.- Parameters:
width- the width- Returns:
- the media device description
-
getHeight
public float getHeight()
Gets the height in points.- Returns:
- the height
-
setHeight
public MediaDeviceDescription setHeight(float height)
Sets the height in points.- Parameters:
height- the height- Returns:
- the media device description
-
isGrid
public boolean isGrid()
Checks if the media device is a grid.- Returns:
- true, if is grid
-
setGrid
public MediaDeviceDescription setGrid(boolean grid)
Sets the grid value.- Parameters:
grid- the grid value- Returns:
- the media device description
-
getScan
public java.lang.String getScan()
Gets the scan value.- Returns:
- the scan value
-
setScan
public MediaDeviceDescription setScan(java.lang.String scan)
Sets the scan value.- Parameters:
scan- the scan value- Returns:
- the media device description
-
getOrientation
public java.lang.String getOrientation()
Gets the orientation.- Returns:
- the orientation
-
setOrientation
public MediaDeviceDescription setOrientation(java.lang.String orientation)
Sets the orientation.- Parameters:
orientation- the orientation- Returns:
- the media device description
-
getMonochrome
public int getMonochrome()
Gets the number of bits per pixel on a monochrome (greyscale) device.- Returns:
- the number of bits per pixel on a monochrome (greyscale) device
-
setMonochrome
public MediaDeviceDescription setMonochrome(int monochrome)
Sets the number of bits per pixel on a monochrome (greyscale) device.- Parameters:
monochrome- the number of bits per pixel on a monochrome (greyscale) device- Returns:
- the media device description
-
getResolution
public float getResolution()
Gets the resolution in DPI.- Returns:
- the resolution
-
setResolution
public MediaDeviceDescription setResolution(float resolution)
Sets the resolution in DPI.- Parameters:
resolution- the resolution- Returns:
- the media device description
-
-