Package org.richfaces.component

Examples of org.richfaces.component.UIPaint2D


  /* (non-Javadoc)
   * @see org.ajax4jsf.resource.InternetResourceBase#getDataToStore(javax.faces.context.FacesContext, java.lang.Object)
   */
  protected Object getDataToStore(FacesContext context, Object data) {
    if (data instanceof UIPaint2D) {
      UIPaint2D paint2D = (UIPaint2D) data;
      ImageData dataToStore = new ImageData();
      dataToStore._width = paint2D.getWidth();
      dataToStore._height = paint2D.getHeight();
      dataToStore._data = paint2D.getData();
     
      dataToStore._paint = UIComponentBase.saveAttachedState(context, paint2D.getPaint());
      String format = paint2D.getFormat();
      if("jpeg".equalsIgnoreCase(format)) {
        dataToStore._format = 1;
      } else if("png".equalsIgnoreCase(format)) {
        dataToStore._format = 2;
      }
     
      String bgColor = paint2D.getBgcolor();
      try {
        dataToStore._bgColor = HtmlColor.decode(bgColor).getRGB();
      } catch (Exception e) {}
      dataToStore.cacheable = paint2D.isCacheable();
      return dataToStore;
     
    } else {
      throw new FacesException("Data for painting image resource not instance of UIPaint2D");
    }
View Full Code Here


   * @param facesContext
   * @return dimensions of the image to be displayed on page
   */
  public Dimension getDimensions(FacesContext facesContext, Object data){
    if (data instanceof UIPaint2D) {
      UIPaint2D paint2D = (UIPaint2D) data;
      return new Dimension(paint2D.getWidth(),paint2D.getHeight());
    }
    return new Dimension(1,1);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.ajax4jsf.resource.InternetResourceBase#getDataToStore(javax.faces.context.FacesContext, java.lang.Object)
   */
  protected Object getDataToStore(FacesContext context, Object data) {
    if (data instanceof UIPaint2D) {
      UIPaint2D paint2D = (UIPaint2D) data;
      ImageData dataToStore = new ImageData();
      dataToStore._width = paint2D.getWidth();
      dataToStore._height = paint2D.getHeight();
      dataToStore._data = paint2D.getData();
     
      dataToStore._paint = UIComponentBase.saveAttachedState(context, paint2D.getPaint());
      String format = paint2D.getFormat();
      if("jpeg".equalsIgnoreCase(format)) {
        dataToStore._format = 1;
      } else if("png".equalsIgnoreCase(format)) {
        dataToStore._format = 2;
      }
     
      String bgColor = paint2D.getBgcolor();
      try {
        dataToStore._bgColor = HtmlColor.decode(bgColor).getRGB();
      } catch (Exception e) {}
      dataToStore.cacheable = paint2D.isCacheable();
      return dataToStore;
     
    } else {
      throw new FacesException("Data for painting image resource not instance of UIPaint2D");
    }
View Full Code Here

   * @param facesContext
   * @return dimensions of the image to be displayed on page
   */
  public Dimension getDimensions(FacesContext facesContext, Object data){
    if (data instanceof UIPaint2D) {
      UIPaint2D paint2D = (UIPaint2D) data;
      return new Dimension(paint2D.getWidth(),paint2D.getHeight());
    }
    return new Dimension(1,1);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.ajax4jsf.resource.InternetResourceBase#getDataToStore(javax.faces.context.FacesContext, java.lang.Object)
   */
  protected Object getDataToStore(FacesContext context, Object data) {
    if (data instanceof UIPaint2D) {
      UIPaint2D paint2D = (UIPaint2D) data;
      ImageData dataToStore = new ImageData();
      dataToStore._width = paint2D.getWidth();
      dataToStore._height = paint2D.getHeight();
      dataToStore._data = paint2D.getData();
     
      dataToStore._paint = UIComponentBase.saveAttachedState(context, paint2D.getPaint());
      String format = paint2D.getFormat();
      if("jpeg".equalsIgnoreCase(format)) {
        dataToStore._format = 1;
      } else if("png".equalsIgnoreCase(format)) {
        dataToStore._format = 2;
      }
     
      String bgColor = paint2D.getBgcolor();
      try {
        dataToStore._bgColor = HtmlColor.decode(bgColor).getRGB();
      } catch (Exception e) {}
      return dataToStore;
     
View Full Code Here

   * @param facesContext
   * @return dimensions of the image to be displayed on page
   */
  public Dimension getDimensions(FacesContext facesContext, Object data){
    if (data instanceof UIPaint2D) {
      UIPaint2D paint2D = (UIPaint2D) data;
      return new Dimension(paint2D.getWidth(),paint2D.getHeight());
    }
    return new Dimension(1,1);
  }
View Full Code Here

TOP

Related Classes of org.richfaces.component.UIPaint2D

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.