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

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


        this.includeCollection = includeCollection;
    }

    // Javadoc inherited
    public Object[] getElements(Object o) {
        EncodingCollection collection = (EncodingCollection) o;
        Iterator encodings = collection.iterator();
        List elements = new ArrayList();
        if (includeCollection) {
            elements.add(collection);
        }
        while (encodings.hasNext()) {
View Full Code Here


    // Javadoc inherited
    protected Map getComboDescriptors() {
        Map comboDescriptors = new HashMap();

        List encodingList = new ArrayList();
        EncodingCollection collection = AudioEncoding.COLLECTION;
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            encodingList.add(it.next());
        }

        ILabelProvider labelProvider = new EncodingLabelProvider();
View Full Code Here

public class TextPolicyEditor extends VariablePolicyEditor {
    // Javadoc inherited
    protected Map getComboDescriptors() {
        Map comboDescriptors = new HashMap();
        List encodingList = new ArrayList();
        EncodingCollection collection = TextEncoding.COLLECTION;
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            encodingList.add(it.next());
        }

        ILabelProvider labelProvider = new EncodingLabelProvider();
View Full Code Here

    // Javadoc inherited
    protected Map getComboDescriptors() {
        Map comboDescriptors = new HashMap();

        List encodingList = new ArrayList();
        EncodingCollection collection = ScriptEncoding.COLLECTION;
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            encodingList.add(it.next());
        }

        ILabelProvider labelProvider = new EncodingLabelProvider();
View Full Code Here

    protected Map getComboDescriptors() {
        Map comboDescriptors = new HashMap();

        // encoding
        List encodingList = new ArrayList();
        EncodingCollection collection = ImageEncoding.COLLECTION;
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            encodingList.add(it.next());
        }

        ILabelProvider labelProvider = new EncodingLabelProvider();
View Full Code Here

        // 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;
        }

        // If the encoding is not in the required encodings then ignore it.
        if (requiredEncodings != null && !requiredEncodings.contains(encoding)) {
View Full Code Here

    public Variant selectVariant(
            SelectionContext context, ActivatedVariablePolicy variablePolicy) {

        InternalDevice device = context.getDevice();

        EncodingCollection supportedEncodings = device.getSupportedVideoEncodings();
        Variant variant;

        // Try TV first if it is supported.
        if (supportedEncodings.contains(VideoEncoding.TV)) {
            variant = variablePolicy.getVariantWithEncoding(VideoEncoding.TV);
            if (variant != null) {
                return variant;
            }
        }

        // 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.
View Full Code Here

        List images = new ArrayList(genericVariants);

        int maxWidth = -1;
        int deviceWidth = device.getPixelsX();

        EncodingCollection supportedEncodings =
                device.getSupportedImageEncodings();

        // Check each image is supported by the requesting device.  If not then
        // we can discard the image from our selection. Also remove any images that
        // are wider than the width of the device.
//        for (int i = 0; i < images.length; i++) {
        for (Iterator i = images.iterator(); i.hasNext();) {
            Variant variant = (Variant) i.next();
            ImageMetaData image = (ImageMetaData) variant.getMetaData();

            ImageEncoding encoding = image.getImageEncoding();
            if (!supportedEncodings.contains(encoding)) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Discarding variant " + variant +
                            " as device does not support encoding.");
                }
                i.remove();
View Full Code Here

TOP

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

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.