Package io.sf.carte.doc.style.css.om
Class AbstractStyleDatabase
java.lang.Object
io.sf.carte.doc.style.css.om.AbstractStyleDatabase
- All Implemented Interfaces:
StyleDatabase
,Serializable
Abstract base class for CSS Style databases.
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractStyleDatabase.FontFormat
fontFormatFromContentType
(String conType) protected AbstractStyleDatabase.FontFormat
fontFormatFromRule
(String format) Gets the real name of the default font.Gives the initial (default) value for the 'color' property on this device.getUsedFontFamily
(CSSComputedProperties computedStyle) Gets the used font family name according to the given style.protected abstract boolean
isFontFamilyAvailable
(String fontFamily) protected boolean
isFontFamilyAvailable
(String requestedFamily, CSSComputedProperties style) protected boolean
loadFontFace
(String familyName, AbstractStyleDatabase.FontFormat fontFormat, InputStream is, CSSFontFaceRule rule) void
Try to load the font family according to the given font face rule, and make it available to this object.void
setInitialColor
(String initialColor) Sets the initial (default) value for the 'color' property on this device.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.StyleDatabase
getColorDepth, getDefaultGenericFontFamily, getDeviceHeight, getDeviceWidth, getEnvValue, getExSizeInPt, getFontSizeFromIdentifier, getNaturalUnit, getSystemFontDeclaration, getWidthSize, isFontFaceName, supports
-
Field Details
-
DEFAULT_GENERIC_FONT_FAMILY
- See Also:
-
-
Constructor Details
-
AbstractStyleDatabase
public AbstractStyleDatabase()
-
-
Method Details
-
getInitialColor
Description copied from interface:StyleDatabase
Gives the initial (default) value for the 'color' property on this device.- Specified by:
getInitialColor
in interfaceStyleDatabase
- Returns:
- the default color value.
-
setInitialColor
Description copied from interface:StyleDatabase
Sets the initial (default) value for the 'color' property on this device.- Specified by:
setInitialColor
in interfaceStyleDatabase
- Parameters:
initialColor
- the String representing default color value.
-
getDefaultGenericFontFamily
Description copied from interface:StyleDatabase
Gets the real name of the default font.For example, if the default generic font name is 'serif', this method should return the same as getDefaultGenericFontFamily("serif").
- Specified by:
getDefaultGenericFontFamily
in interfaceStyleDatabase
- Returns:
- the name of the default real font.
-
getUsedFontFamily
Description copied from interface:StyleDatabase
Gets the used font family name according to the given style.- Specified by:
getUsedFontFamily
in interfaceStyleDatabase
- Parameters:
computedStyle
- the computed style.- Returns:
- the name of the used font family.
-
isFontFamilyAvailable
-
loadFontFaceRule
Description copied from interface:StyleDatabase
Try to load the font family according to the given font face rule, and make it available to this object.- Specified by:
loadFontFaceRule
in interfaceStyleDatabase
- Parameters:
rule
- the font face rule.
-
fontFormatFromContentType
-
fontFormatFromRule
-
loadFontFace
protected boolean loadFontFace(String familyName, AbstractStyleDatabase.FontFormat fontFormat, InputStream is, CSSFontFaceRule rule) throws IOException - Throws:
IOException
-
isFontFamilyAvailable
-