Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.SegmentAttributes


        }

        SegmentInstance segmentInstance
                = (SegmentInstance) context.getFormatInstance(segment,
                NDimensionalIndex.ZERO_DIMENSIONS);
        SegmentAttributes attributes = segmentInstance.getAttributes();

        if (attributes == null) {
            logger.error("segment-attributes-missing", new Object[]{name});
            return null;
        }

        LinkAssetReference object = attributes.getSrc();
        if (object == null) {
            logger.error("segment-src-missing", new Object[]{name});
            return null;
        }
View Full Code Here


        try {
            if (!instance.isEmpty()) {
                Segment segment = (Segment)instance.getFormat();
                SegmentInstance segmentInstance = (SegmentInstance) instance;

                SegmentAttributes attributes = segmentInstance.getAttributes();

                if (logger.isDebugEnabled()) {
                    logger.debug("Segment.writeOutput() for "
                                 + attributes.getName());
                }

                String value;
                int ivalue;

                value = (String) segment.getAttribute(
                        FormatConstants.BORDER_COLOUR_ATTRIBUTE);
                attributes.setBorderColor(value);

                value = (String) segment.getAttribute(
                        FormatConstants.FRAME_BORDER_ATTRIBUTE);
                attributes.setFrameBorder("true".equalsIgnoreCase(value));

                value =
                (String)segment.getAttribute(FormatConstants.RESIZE_ATTRIBUTE);
                attributes.setResize("true".equalsIgnoreCase(value));

                value = (String) segment.getAttribute(
                        FormatConstants.SCROLLING_ATTRIBUTE);
                if (value == null ||
                        value.equals(FormatConstants.SCROLLING_VALUE_AUTOMATIC)) {
                    attributes.setScrolling(
                            SegmentAttributes.SCROLLING_AUTOMATIC);
                } else if (value.equals(FormatConstants.SCROLLING_VALUE_NO)) {
                    attributes.setScrolling(SegmentAttributes.SCROLLING_NO);
                } else if (value.equals(FormatConstants.SCROLLING_VALUE_YES)) {
                    attributes.setScrolling(SegmentAttributes.SCROLLING_YES);
                } else {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Unknown scrolling type of " + value);
                    }
                }

                value = (String) segment.getAttribute(
                        FormatConstants.MARGIN_HEIGHT_ATTRIBUTE);
                try {
                    ivalue = Integer.parseInt(value);
                } catch (NumberFormatException nfe) {
                    ivalue = 0;
                }
                attributes.setMarginHeight(ivalue);

                value = (String) segment.getAttribute(
                        FormatConstants.MARGIN_WIDTH_ATTRIBUTE);
                try {
                    ivalue = Integer.parseInt(value);
                } catch (NumberFormatException nfe) {
                    ivalue = 0;
                }
                attributes.setMarginWidth(ivalue);

                // Get the module.
                LayoutModule module = context.getLayoutModule();

                module.writeOpenSegment(attributes);
View Full Code Here

    /**
     * This method tests the method public void writeOpenSegment ( SegmentAttributes )
     * for the com.volantis.mcs.protocols.VolantisProtocol class.
     */
    public void testWriteOpenSegment() throws Exception {
        final SegmentAttributes attributes =
                (SegmentAttributes) ProtocolIntegrationTestHelper.
                provideAttributes(SegmentAttributes.class);

        final VolantisProtocol protocol = getProtocol();

View Full Code Here

    /**
     * Create a new <code>SegmentInstance</code>.
     */
    public SegmentInstance(NDimensionalIndex index) {
        super(index);
        attributes = new SegmentAttributes();
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.protocols.SegmentAttributes

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.