org.silverpeas.image.option
Class DimensionOption

java.lang.Object
  extended by org.silverpeas.image.option.AbstractImageToolOption
      extended by org.silverpeas.image.option.DimensionOption

public class DimensionOption
extends AbstractImageToolOption

Author:
Yohann Chastagnier

Method Summary
 Integer getHeight()
           
 Integer getWidth()
           
static DimensionOption height(Integer height)
          Creates a new option on the dimension from the specified height in pixels.
static DimensionOption width(Integer width)
          Creates a new option on the dimension from the specified width in pixels.
static DimensionOption widthAndHeight(Integer width, Integer height)
          Creates a new option on the dimension from the specified width and height in pixels.
 
Methods inherited from class org.silverpeas.image.option.AbstractImageToolOption
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

widthAndHeight

public static DimensionOption widthAndHeight(Integer width,
                                             Integer height)
Creates a new option on the dimension from the specified width and height in pixels.

Parameters:
width - the width in pixels. If null, the height will only be taken into account by ImageTool when resizing an image.
height - the height in pixels. If null, the width will only be taken into account by ImageTool when resizing an image.
Returns:
an instance of DimensionOption type.

width

public static DimensionOption width(Integer width)
Creates a new option on the dimension from the specified width in pixels. The height will be computed from the width to keep the same ratio than the original image.

Parameters:
width - the width in pixels.
Returns:
an instance of DimensionOption type.

height

public static DimensionOption height(Integer height)
Creates a new option on the dimension from the specified height in pixels. The width will be computed from the height to keep the same ratio than the original image.

Parameters:
height - the height in pixels.
Returns:
an instance of DimensionOption type.

getWidth

public Integer getWidth()
Returns:
the width

getHeight

public Integer getHeight()
Returns:
the height


Copyright © 2016 Silverpeas. All Rights Reserved.