Package com.volantis.mcs.protocols

Examples of com.volantis.mcs.protocols.ImageAttributes


        privateSetUp();
        DOMOutputBuffer buffer = new DOMOutputBuffer();
        buffer.initialise();

        // Initialise our protocol attributes with an id attribute.
        ImageAttributes attributes = new ImageAttributes();
        attributes.setLocalSrc(true);
        attributes.setSrc(null);
        attributes.setAltText("    ");

        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        attributes.setPane(outPane);

        protocol.doImage(buffer, attributes);

        // No src and whitespace text generates no output
        Element root = buffer.getCurrentElement();
View Full Code Here


     * Test the image element. If there is an AssetURLSuffix set then it should
     * be appended to the image URL.
     */
    public void testDoImageNoSuffix() throws ProtocolException {
        privateSetUp();
        ImageAttributes ia = new ImageAttributes();
        ia.setStyles(StylesBuilder.getDeprecatedStyles());
        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        ia.setPane(outPane);
        ia.setAltText("AltText");
        ia.setSrc("http://www.images.com/test/test.jpg");
        ia.setLocalSrc(false);
        protocol.writeImage(ia);

        // Check the image tag and attributes
        Element nullElement = buffer.popElement();
        Element element = (Element) nullElement.getHead();
View Full Code Here

        assertEquals("AltText", element.getAttributeValue("alt"));
    }

    public void testDoImageSuffix() throws ProtocolException {
        privateSetUp();
        ImageAttributes ia = new ImageAttributes();
        ia.setStyles(StylesBuilder.getDeprecatedStyles());
        Pane outPane = new Pane(null);
        outPane.setName("MyPane");
        outPane.setDestinationArea(null);
        ia.setPane(outPane);
        ia.setAltText("AltText");
        ia.setSrc("http://www.images.com/test/test.jpg");
        ia.setAssetURLSuffix("?name=fred");
        ia.setLocalSrc(false);
        protocol.writeImage(ia);

        // Check the image tag and attributes
        Element nullElement = buffer.popElement();
        Element element = (Element) nullElement.getHead();
View Full Code Here

        // Needed to allow the call to getTextFromReference within doImage to work
        context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);

        ImageAttributes attrs = new ImageAttributes();
        attrs.setSrc("http://www.volantis.com/my_image.jpg");
        attrs.setLocalSrc(true);
        attrs.setAltText("my_alt_text");
        attrs.setWidth("10");
        attrs.setHeight("20");

        protocol.doImage(buffer, attrs);

        String expected = "<img alt=\"my_alt_text\" height=\"20\" " +
                "localsrc=\"http://www.volantis.com/my_image.jpg\" " +
View Full Code Here

        // this should be ignored - invalid.
        properties.setComputedValue(StylePropertyDetails.FONT_SIZE,
                FontSizeKeywords.SMALL);

        ImageAttributes imageAttributes = new ImageAttributes();
        imageAttributes.setSrc("images/background.jpg");
        imageAttributes.setAlign("middle");
        protocol.doImage(buffer, imageAttributes);

        verifyStyleVerticalAlignIMG(bufferToString(buffer));
    }
View Full Code Here

        // Needed to allow the call to getTextFromReference within doImage to work
        context = new TestMarinerPageContext();

        protocol.setMarinerPageContext(context);

        ImageAttributes attrs = new ImageAttributes();
        attrs.setSrc("http://www.volantis.com/my_image.jpg");
        attrs.setLocalSrc(true);
        attrs.setAltText("my_alt_text");
        attrs.setWidth("10");
        attrs.setHeight("20");
        attrs.setBorder("5");

        protocol.doImage(buffer, attrs);

        String expected = "<img alt=\"my_alt_text\" " +
                "height=\"20\" src=\"http://www.volantis.com/my_image.jpg\" " +
View Full Code Here

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

        final VolantisProtocol protocol = getProtocol();

View Full Code Here

                String imageUrl = imageRef.getURL();
                // If we were able to get one
                if (imageUrl != null) {

                    DOMOutputBuffer dom = (DOMOutputBuffer) buffer;
                    ImageAttributes attributes = new ImageAttributes();
                    // Stylistic properties
                    ElementDetails elementDetails = icon.getElementDetails();
                    if (elementDetails != null) {
                        attributes.setElementDetails(elementDetails);
                    }
                    // Image properties
                    attributes.setSrc(imageUrl);
                    attributes.setAltText(getAltText(item));
                   
                    // Extension point for subclasses.
                    addImageAttributes(icon, attributes);
                   
                    imageOutput.outputImage(dom, attributes);
View Full Code Here

     * @param protocol
     * @return
     */
    private ImageAttributes createErrorImage(VolantisProtocol protocol) {
       
        ImageAttributes imageAttributes = new ImageAttributes();
        imageAttributes.setSrc(calculatedImagePath + GEN_IMAGE_NAME);
        imageAttributes.setWidth(StringConvertor.valueOf(this.imageSizePx));
        imageAttributes.setHeight(StringConvertor.valueOf(this.imageSizePx));
        return imageAttributes;
    }
View Full Code Here

            for (int j = 0; j < MAIN_IMAGES_TABLE_SIZE; j++) {
                createTableCellElement(protocol, idCollector, true);
                AnchorAttributes aAttributes = new AnchorAttributes();
                aAttributes.setHref("javascript:void(0)");
                protocol.writeOpenAnchor(aAttributes);
                ImageAttributes iAttributes = new ImageAttributes();
                iAttributes.setSrc("");
                protocol.writeImage(iAttributes);
                protocol.writeCloseAnchor(aAttributes);
                closeTableDataCellElement(protocol);
            }
            closeTableRowElement(protocol);
View Full Code Here

TOP

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

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.