Package io.sf.carte.doc.style.css.om
Class AbstractCSSCanvas
java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSCanvas
- All Implemented Interfaces:
CSSCanvas
Abstract base class useful for CSSCanvas implementations.
-
Constructor Summary
ModifierConstructorDescriptionprotected
Construct a canvas to display the given document. -
Method Summary
Modifier and TypeMethodDescriptionprotected float
Get the number of entries in the color lookup table of the device.Gets the document to which this canvas applies.getFeatureValue
(String feature) Provide the value of the requested media feature.protected int
Get the number of bits per pixel in a monochrome frame buffer.protected String
The orientation.protected abstract String
Describes the behavior of the device when content overflows the initial containing block in the block axisprotected abstract String
Describes the behavior of the device when content overflows the initial containing block in the inline axis.protected String
The pointing device quality.protected String
The desire for light or dark color schemes.protected String
The desire for less motion on the page.protected float
Get the device resolution.protected String
The display scan type.protected String
The display update frequency.protected boolean
Is this device a grid device?boolean
matchesFeature
(String feature, CSSTypedValue value) Does this canvas support the given media feature?protected void
setDocument
(CSSDocument doc) protected boolean
supportsGamut
(String gamut) Check whether a color gamut is supported.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.style.css.CSSCanvas
getCapHeight, getStyleDatabase, getViewport, isActivePseudoClass, reloadStyleState, stringWidth
-
Constructor Details
-
AbstractCSSCanvas
Construct a canvas to display the given document.- Parameters:
doc
- the document to display.
-
-
Method Details
-
getDocument
Description copied from interface:CSSCanvas
Gets the document to which this canvas applies.- Specified by:
getDocument
in interfaceCSSCanvas
- Returns:
- the document.
-
setDocument
-
getFeatureValue
Description copied from interface:CSSCanvas
Provide the value of the requested media feature.- Specified by:
getFeatureValue
in interfaceCSSCanvas
- Parameters:
feature
- the media feature.- Returns:
- the value of the requested media feature, or
null
if the feature is not known or not supported.
-
matchesFeature
Description copied from interface:CSSCanvas
Does this canvas support the given media feature?- Specified by:
matchesFeature
in interfaceCSSCanvas
- Parameters:
feature
- the media feature name.value
- the optional feature value to be tested against.- Returns:
true
if the feature (with the given value, if any) is supported,false
otherwise.
-
getColorIndex
protected float getColorIndex()Get the number of entries in the color lookup table of the device.- Returns:
- the number of entries in the color lookup table of the device, or
0
if the device does not use a color lookup table.
-
isGridDevice
protected boolean isGridDevice()Is this device a grid device?- Returns:
true
if a grid device,false
if bitmap.
-
getMonoBitsPerPixel
protected int getMonoBitsPerPixel()Get the number of bits per pixel in a monochrome frame buffer.- Returns:
- the number of bits per pixel in a monochrome frame buffer, or
0
if the device is not a monochrome device.
-
getOrientation
The orientation.- Returns:
- the orientation (
portrait
orlandscape
).
-
getOverflowBlock
Describes the behavior of the device when content overflows the initial containing block in the block axis- Returns:
- the
overflow-block
feature.
-
getOverflowInline
Describes the behavior of the device when content overflows the initial containing block in the inline axis.- Returns:
- the
overflow-inline
feature.
-
getPointerAccuracy
The pointing device quality.- Returns:
- the
pointer
feature
-
getPrefersColorScheme
The desire for light or dark color schemes.- Returns:
- the
prefers-color-scheme
feature
-
getPrefersReducedMotion
The desire for less motion on the page.- Returns:
- the
prefers-reduced-motion
feature
-
getResolution
protected float getResolution()Get the device resolution.- Returns:
- the device resolution, in
dpi
.
-
getScanType
The display scan type.- Returns:
- the
scan
feature.
-
getUpdateFrequency
The display update frequency.- Returns:
- the update feature.
-
supportsGamut
Check whether a color gamut is supported.- Parameters:
gamut
- the color-gamut to check, likesrgb
,p3
orrec2020
.- Returns:
true
if the gamut is supported.
-