Package com.volantis.mcs.policies.variants.metadata

Examples of com.volantis.mcs.policies.variants.metadata.Encoding


* an internationalised version of the name.
*/
public class EncodingLabelProvider extends LabelProvider {
    // Javadoc inherited
    public String getText(Object o) {
        Encoding encoding = (Encoding) o;

        String encodingName = encoding.getName().replaceAll(" ", "");
        return EditorMessages.getString(
                "Encoding." + StringUtils.toLowerIgnoreLocale(encodingName) +
                ".label");
    }
View Full Code Here


            metaData.setWidth(data.width);
            metaData.setPixelDepth(data.depth);
        }

        String extension = IOUtils.getExtension(file);
        Encoding imageEncoding = ImageEncoding.COLLECTION.
                getEncodingForExtension(extension);
        if (imageEncoding != null) {
            metaData.setImageEncoding((ImageEncoding) imageEncoding);
        }
View Full Code Here

            File file = (File) o1;
            String fileName = file.getName();
            Iterator encodings = encodingCollection.iterator();
            valid = file.isDirectory();
            while (!valid && encodings.hasNext()) {
                Encoding encoding = (Encoding) encodings.next();
                Iterator extensions = encoding.extensions();
                while (!valid && extensions.hasNext()) {
                    String extension = (String) extensions.next();
                    if (fileName.length() > extension.length() &&
                        fileName.charAt(fileName.length() -
                            extension.length() - 1) == '.' &&
View Full Code Here

    public String getText(Object o) {
        String label = "";
        if (o instanceof EncodingCollection) {
            label = EditorMessages.getString("Encoding." + encodingType + ".allEncodings");
        } else {
            Encoding encoding = (Encoding) o;

            String encodingName = encoding.getName().replaceAll(" ", "");
            String encodingType = EditorMessages.getString(
                    "Encoding." +
                    StringUtils.toLowerIgnoreLocale(encodingName) +
                    ".label");
            StringBuffer encodingContents = new StringBuffer();
            Iterator it = encoding.extensions();
            while (it.hasNext()) {
                encodingContents.append("*.");
                encodingContents.append(it.next());
                if (it.hasNext()) {
                    encodingContents.append(extensionSeparator);
View Full Code Here

    public Variant filter(
            InternalDevice device, Variant variant,
            EncodingCollection requiredEncodings) {

        // Get the encoding from the variant.
        Encoding encoding = getEncoding(variant);

        // If the encoding is not supported by the device then ignore it.
        EncodingCollection supportedEncodings = getSupportedEncodings(device);
        if (!supportedEncodings.contains(encoding)) {
            variant = null;
View Full Code Here

        }

        // Now try all the other encodings.
        Iterator i = supportedEncodings.iterator();
        while (i.hasNext()) {
            Encoding encoding = (Encoding) i.next();

            // Ignore TV as it has either already been checked or is not
            // supported.
            if (encoding == VideoEncoding.TV) {
                continue;
View Full Code Here

        // find a variant with one of those encodings. The encodings are
        // tried in the order they were specified.
        if (requiredEncodings != null) {
            Iterator iterator = requiredEncodings.iterator();
            while (iterator.hasNext()) {
                Encoding encoding = (Encoding) iterator.next();
                variant = policy.getVariantWithEncoding(encoding);
                if (variant != null) {

                    // Filter the variant.
                    variant = filter(targetDevice, variant, requiredEncodings);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.policies.variants.metadata.Encoding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.