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
ConstructorsModifierConstructorDescriptionprotectedConstruct a canvas to display the given document. -
Method Summary
Modifier and TypeMethodDescriptionprotected floatGet 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 intGet the number of bits per pixel in a monochrome frame buffer.protected StringThe orientation.protected abstract StringDescribes the behavior of the device when content overflows the initial containing block in the block axisprotected abstract StringDescribes the behavior of the device when content overflows the initial containing block in the inline axis.protected StringThe pointing device quality.protected StringThe desire for light or dark color schemes.protected StringThe desire for less motion on the page.protected floatGet the device resolution.protected StringThe display scan type.protected StringThe display update frequency.protected booleanIs this device a grid device?booleanmatchesFeature(String feature, CSSTypedValue value) Does this canvas support the given media feature?protected voidsetDocument(CSSDocument doc) protected booleansupportsGamut(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, waitMethods 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:CSSCanvasGets the document to which this canvas applies.- Specified by:
getDocumentin interfaceCSSCanvas- Returns:
- the document.
-
setDocument
-
getFeatureValue
Description copied from interface:CSSCanvasProvide the value of the requested media feature.- Specified by:
getFeatureValuein interfaceCSSCanvas- Parameters:
feature- the media feature.- Returns:
- the value of the requested media feature, or
nullif the feature is not known or not supported.
-
matchesFeature
Description copied from interface:CSSCanvasDoes this canvas support the given media feature?- Specified by:
matchesFeaturein interfaceCSSCanvas- Parameters:
feature- the media feature name.value- the optional feature value to be tested against.- Returns:
trueif the feature (with the given value, if any) is supported,falseotherwise.
-
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
0if the device does not use a color lookup table.
-
isGridDevice
protected boolean isGridDevice()Is this device a grid device?- Returns:
trueif a grid device,falseif 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
0if the device is not a monochrome device.
-
getOrientation
The orientation.- Returns:
- the orientation (
portraitorlandscape).
-
getOverflowBlock
Describes the behavior of the device when content overflows the initial containing block in the block axis- Returns:
- the
overflow-blockfeature.
-
getOverflowInline
Describes the behavior of the device when content overflows the initial containing block in the inline axis.- Returns:
- the
overflow-inlinefeature.
-
getPointerAccuracy
The pointing device quality.- Returns:
- the
pointerfeature
-
getPrefersColorScheme
The desire for light or dark color schemes.- Returns:
- the
prefers-color-schemefeature
-
getPrefersReducedMotion
The desire for less motion on the page.- Returns:
- the
prefers-reduced-motionfeature
-
getResolution
protected float getResolution()Get the device resolution.- Returns:
- the device resolution, in
dpi.
-
getScanType
The display scan type.- Returns:
- the
scanfeature.
-
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,p3orrec2020.- Returns:
trueif the gamut is supported.
-