Class InputPicture

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Badgeable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable

@Component public class InputPicture extends Control
This class extends Control and implements the graphic user interface object that allows to capture an image from the file system, position it in the field and trim it. The InputPicture consists of a square pane in which the scanned image will be displayed and some buttons to the side for some basic editing operations.
A typical use of this component is the acquisition / modification of the user picture.
See Also:
GCApi:
component
  • Field Details

    • SET_OPERATION

      public static final int SET_OPERATION
      See Also:
    • UPLOAD_OPERATION

      public static final int UPLOAD_OPERATION
      See Also:
    • DELETE_OPERATION

      public static final int DELETE_OPERATION
      See Also:
    • LOAD_DEFAULT_OPERATION

      public static final int LOAD_DEFAULT_OPERATION
      See Also:
    • _p

      protected Picture _p
    • _lastOperation

      protected int _lastOperation
    • _width

      protected int _width
    • _height

      protected int _height
    • _finalWidth

      protected int _finalWidth
    • _finalHeight

      protected int _finalHeight
    • _version

      protected long _version
    • _quality

      protected float _quality
    • _format

      protected String _format
  • Constructor Details

    • InputPicture

      public InputPicture()
  • Method Details

    • setWIDTH

      public void setWIDTH(String s)
      Sets the width of the acquisition panel
      Parameters:
      s - The width of the acquisition panel, expressed in pixel
    • setHEIGHT

      public void setHEIGHT(String s)
      Sets the height of the acquisition panel
      Parameters:
      s - The height of the acquisition panel, expressed in pixel
    • setFORMAT

      public void setFORMAT(String s)
      Sets the format in which the image will be acquired.
      Parameters:
      s - Possible values are: "jpg" (that is the default one) and "png"
    • setQUALITY

      public void setQUALITY(String s)
      Sets the image quality to a value between 0 and 1. A compression quality setting of 0.0 is most generically interpreted as "high compression is important," and therefore the produced image’s size will be low. Otherwise setting quality to 1.0 is most generically interpreted as "high image quality is important"
      Parameters:
      s - A value from 0 to 1 that defines the image quality
    • setFINALWIDTH

      public void setFINALWIDTH(String s)
      Sets the width, expressed in pixels, of the acquired image. If set to -1, that is the default value, will be considered the width value (setWIDTH(java.lang.String))
      Parameters:
      s - The width, in pixel, of the image
    • setFINALHEIGHT

      public void setFINALHEIGHT(String s)
      Sets the height, expressed in pixels, of the acquired image. If set to -1, that is the default value, will be considered the height value (setHEIGHT(java.lang.String))
      Parameters:
      s - The height, in pixel, of the image
    • setPicture

      public void setPicture(Picture p)
      Sets the Picture
      Parameters:
      p - The picture to set to the input
    • deletePicture

      public void deletePicture()
      Deletes the picture
    • getPicture

      public Picture getPicture()
      Returns the Picture
      Returns:
      The picture set to the input
    • getFinalWidth

      public int getFinalWidth()
      Sets the width, expressed in pixels, of the acquired image.
      Returns:
      The width of the acquired image.
    • getFinalHeight

      public int getFinalHeight()
      Sets the height, expressed in pixels, of the acquired image.
      Returns:
      The height of the acquired image.
    • onCrop

      public boolean onCrop(UIMessage evt)
      Called when the user click the button to perform the crop action
      Parameters:
      evt - The UIMessage passed to the event
      Returns:
      false
    • onUp

      public boolean onUp(UIMessage evt)
      Called when the user click the button to perform the upload of the image
      Parameters:
      evt - The UIMessage passed to the event
      Returns:
      true
    • onDelete

      public boolean onDelete(UIMessage evt)
      Manages the event of deleting a picture
      Parameters:
      evt - Not used
      Returns:
      true
    • getLastOperation

      protected int getLastOperation()
    • setLastOperation

      protected void setLastOperation(int operation)
    • setDefaultPicture

      public void setDefaultPicture()
      Sets the default picture
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Description copied from class: Component
      Abstract method that must be extended and returns the html code of the Component
      Specified by:
      getHtml in class Component
      Parameters:
      es - The EntitySet to which the element belongs
      Returns:
      The html of the Component
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Description copied from class: Component
      Every component can add a script to the StringBuilder, script executed when the component is created.
      Overrides:
      buildSetupScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script