modules/graphics/src/main/java/com/sun/javafx/css/FontFaceImpl.java
Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -23,10 +23,13 @@
* questions.
*/
package com.sun.javafx.css;
+import javafx.css.FontFace;
+import javafx.css.StyleConverter.StringStore;
+
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -35,17 +38,17 @@
import java.util.Set;
/**
* A FontFace is a @font-face definition from CSS file
*/
-final public class FontFace {
+final public class FontFaceImpl extends FontFace {
public static enum FontFaceSrcType {URL,LOCAL, REFERENCE}
private final Map<String,String> descriptors;
private final List<FontFaceSrc> sources;
- public FontFace(Map<String, String> descriptors, List<FontFaceSrc> sources) {
+ public FontFaceImpl(Map<String, String> descriptors, List<FontFaceSrc> sources) {
this.descriptors = descriptors;
this.sources = sources;
}
public Map<String, String> getDescriptors() {
@@ -74,11 +77,11 @@
sb.append("; ");
sb.append(" }");
return sb.toString();
}
- final void writeBinary(final DataOutputStream os, final StringStore stringStore) throws IOException
+ public final void writeBinary(final DataOutputStream os, final StringStore stringStore) throws IOException
{
Set<Map.Entry<String,String>> entrySet = getDescriptors() != null ? getDescriptors().entrySet() : null;
int nEntries = entrySet != null ? entrySet.size() : 0;
os.writeShort(nEntries);
if (entrySet != null) {
@@ -98,11 +101,11 @@
fontFaceSrc.writeBinary(os, stringStore);
}
}
- final static FontFace readBinary(int bssVersion, DataInputStream is, String[] strings) throws IOException
+ public final static FontFaceImpl readBinary(int bssVersion, DataInputStream is, String[] strings) throws IOException
{
int nEntries = is.readShort();
Map<String,String> descriptors = new HashMap(nEntries);
for (int n=0; n<nEntries; n++) {
int index = is.readInt();
@@ -117,12 +120,11 @@
for (int n=0; n<nEntries; n++) {
FontFaceSrc fontFaceSrc = FontFaceSrc.readBinary(bssVersion, is, strings);
fontFaceSrcs.add(fontFaceSrc);
}
- return new FontFace(descriptors, fontFaceSrcs);
-
+ return new FontFaceImpl(descriptors, fontFaceSrcs);
}
public static class FontFaceSrc {
private final FontFaceSrcType type;
private final String src;