Class MediaDeviceDescription
java.lang.Object
com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription
Class that bundles all the values of a media device description.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The bits per component.private int
The color index.private static final MediaDeviceDescription
private float
The height in points.private boolean
Indicates if the media device is a grid.private int
The the number of bits per pixel on a monochrome (greyscale) device.private String
The orientation.private float
The resolution in DPI.private String
The scan value.private String
The type.private float
The width in points. -
Constructor Summary
ConstructorsConstructorDescriptionMediaDeviceDescription
(String type) SeeMediaType
class constants for possible values.MediaDeviceDescription
(String type, float width, float height) Creates a newMediaDeviceDescription
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic MediaDeviceDescription
Creates the defaultMediaDeviceDescription
.int
Gets the bits per component.int
Gets the color index.static MediaDeviceDescription
Gets defaultMediaDeviceDescription
instance.float
Gets the height in points.int
Gets the number of bits per pixel on a monochrome (greyscale) device.Gets the orientation.float
Gets the resolution in DPI.getScan()
Gets the scan value.getType()
Gets the type.float
getWidth()
Gets the width in points.boolean
isGrid()
Checks if the media device is a grid.setBitsPerComponent
(int bitsPerComponent) Sets the bits per component.setColorIndex
(int colorIndex) Sets the color index.setGrid
(boolean grid) Sets the grid value.setHeight
(float height) Sets the height in points.setMonochrome
(int monochrome) Sets the number of bits per pixel on a monochrome (greyscale) device.setOrientation
(String orientation) Sets the orientation.setResolution
(float resolution) Sets the resolution in DPI.Sets the scan value.setWidth
(float width) Sets the width in points.
-
Field Details
-
DEFAULT
-
type
The type. -
bitsPerComponent
private int bitsPerComponentThe bits per component. -
colorIndex
private int colorIndexThe color index. -
width
private float widthThe width in points. -
height
private float heightThe height in points. -
isGrid
private boolean isGridIndicates if the media device is a grid. -
scan
The scan value. -
orientation
The orientation. -
monochrome
private int monochromeThe the number of bits per pixel on a monochrome (greyscale) device. -
resolution
private float resolutionThe resolution in DPI.
-
-
Constructor Details
-
MediaDeviceDescription
SeeMediaType
class constants for possible values.- Parameters:
type
- a type of the media to use.
-
MediaDeviceDescription
Creates a newMediaDeviceDescription
instance.- Parameters:
type
- the typewidth
- the widthheight
- the height
-
-
Method Details
-
createDefault
Creates the defaultMediaDeviceDescription
.- Returns:
- the media device description
-
getDefault
Gets defaultMediaDeviceDescription
instance. 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
Gets the type.- Returns:
- the type
-
getBitsPerComponent
public int getBitsPerComponent()Gets the bits per component.- Returns:
- the bits per component
-
setBitsPerComponent
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
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
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
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
Sets the grid value.- Parameters:
grid
- the grid value- Returns:
- the media device description
-
getScan
Gets the scan value.- Returns:
- the scan value
-
setScan
Sets the scan value.- Parameters:
scan
- the scan value- Returns:
- the media device description
-
getOrientation
Gets the orientation.- Returns:
- the orientation
-
setOrientation
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
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
Sets the resolution in DPI.- Parameters:
resolution
- the resolution- Returns:
- the media device description
-