Examples of ImageAttributes


Examples of com.volantis.mcs.protocols.ImageAttributes

    /**
     * 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

Examples of com.volantis.mcs.protocols.ImageAttributes

                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

Examples of com.volantis.mcs.protocols.ImageAttributes

     * @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

Examples of com.volantis.mcs.protocols.ImageAttributes

            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

Examples of com.volantis.mcs.protocols.ImageAttributes

                } else {
                    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);
            }
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

        for (int j = 0; j < 4 * 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

Examples of com.volantis.mcs.protocols.ImageAttributes

        MarinerRequestContext requestContext =
        context.getInitialRequestContext();
       
       
        ImageAttributes imageAttributes = attributes.getImageAttributes();
        if(imageAttributes == null){
            // widget is not supported therefore image attributes were not set.
            written = false;
        } else {
            String url = imageAttributes.getSrc();
            // transcode the image.
            try {
                url = ContextInternals.constructImageURL(
                           requestContext, url);
            } catch (RepositoryException e) {
                throw new XDIMEException(e);
            }
     
            createFakeAssetURLMapEntry(requestContext, url);
                   
            // Rewrite the URL with PageURLRewriter.
            url = getPageContext(context)
                    .getAssetResolver()
                    .rewriteURLWithPageURLRewriter(url, PageURLType.IMAGE);
                   
            imageAttributes.setSrc(url);
            written = true;
        }
        return written;
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

            return;
        }

        url = resolver.rewriteURLWithPageURLRewriter(url, PageURLType.IMAGE);

        ImageAttributes imageAttributes = new ImageAttributes();

        BaseLocation location = resolver.getBaseLocation(selectedVariant);
        imageAttributes.setLocalSrc(location == BaseLocation.DEVICE);

        Variant variant = selectedVariant.getVariant();
        ImageMetaData image = (ImageMetaData) variant.getMetaData();
        // Make a note of whether this image is a convertible
        // image asset
        if (image.getConversionMode() == ImageConversionMode.ALWAYS_CONVERT) {
            imageAttributes.setConvertibleImageAsset(true);
        } else {
            imageAttributes.setConvertibleImageAsset(false);
        }

        imageAttributes.setHeight(StringConvertor.valueOf(image.getHeight()));
        imageAttributes.setWidth(StringConvertor.valueOf(image.getWidth()));
        imageAttributes.setSrc(url);
        imageAttributes.setAltText(alt);
        protocol.writeImage(imageAttributes);
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.ImageAttributes

            // Extract necessary info from the image reference
            String reference = image.getURL();

            if (reference != null) {
                // There is a url to use
                ImageAttributes attributes = new ImageAttributes();
                attributes.setSrc(reference);
                imageOutput.outputImage(dom, attributes);
            } else {
                logger.warn("render-reference-error", new Object[]{
                        ImageAssetReference.class.toString(),
                        image});
View Full Code Here

Examples of net.java.textilej.parser.ImageAttributes

    @Override
    public void emit() {
      String imageUrl = group(1);
      String optionsString = group(2);

      ImageAttributes attributes = new ImageAttributes();
      if (optionsString != null) {
        String[] options = optionsString.split("\\s*\\|\\s*");
        for (String option: options) {
          if ("center".equals(option)) {
            attributes.setAlign(Align.Middle);
          } else if ("left".equals(option)) {
            attributes.setAlign(Align.Left);
          } else if ("right".equals(option)) {
            attributes.setAlign(Align.Right);
          } else if ("none".equals(option)) {
            attributes.setAlign(null);
          } else if ("thumb".equals(option)||"thumbnail".equals(option)) {
            // ignore
          } else if (option.matches("\\d+px")) {
            try {
              int size = Integer.parseInt(option.substring(0,option.length()-2));
              attributes.setWidth(size);
              attributes.setHeight(size);
            } catch (NumberFormatException e) {
              // ignore
            }
          } else if ("frameless".equals(option)) {
            attributes.setBorder(0);
          } else if ("frame".equals(option)) {
            attributes.setBorder(1);
          } else {
            attributes.setTitle(option);
          }
        }
      }
      builder.image(attributes, imageUrl);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.