com.flexive.shared.media
Class FxMediaSelector

java.lang.Object
  extended by com.flexive.shared.media.FxMediaSelector
All Implemented Interfaces:
java.io.Serializable

public class FxMediaSelector
extends java.lang.Object
implements java.io.Serializable

A media selector by primary key, xpath etc. of an instance with optional operation requests like scaling or flipping

Version:
$Rev
Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Constructor Summary
FxMediaSelector()
          Empty Ctor
FxMediaSelector(FxPK pk)
          Ctor
 
Method Summary
 java.awt.Rectangle getCrop()
          Get the crop region if set
 java.lang.String getFilename()
          Get the filename to append to links
 FxLanguage getLanguage()
          Get the requested language for the image
 java.lang.String getLanguageIso()
          Get the iso code of the desired translation for multilingual images
 FxPK getPK()
          Get the primary key
 int getRotationAngle()
          Get the rotation angle
 int getScaleHeight()
          Get the height to scale to
 int getScaleWidth()
          Get the width to scale to
 BinaryDescriptor.PreviewSizes getSize()
          Get the requested (pre-scaled) thumbnail size (0..4)
 long getTimestamp()
          Get the timestamp to append to links
 java.lang.String getXPath()
          Get the XPath of the property containing the image
 boolean hasFilename()
          Append a filename to links?
 boolean hasPK()
          Is a primary key set?
 boolean hasTimestamp()
          Is a timestamp for a link requested?
 boolean isApplyManipulations()
           
 boolean isCrop()
          Is a crop operation requested?
 java.lang.Boolean isFlipHorizontal()
          Flip horizontal?
 java.lang.Boolean isFlipVertical()
          Flip vertical?
 boolean isForceImage()
          If the binary does not represent an image and the "original" preview size was chosen, the biggest thumbnail is returned instead.
 boolean isScaleHeight()
          Scale to a given height?
 boolean isScaleWidth()
          Scale to a given width?
 java.lang.Boolean isUseType()
          Use the assignments default binary image from the type if present?
 FxMediaSelector setCrop(java.awt.Rectangle crop)
          Crop the image to the given rectangle
 FxMediaSelector setFilename(java.lang.String filename)
          Set the filename to append to a link
 FxMediaSelector setFlipHorizontal(java.lang.Boolean flipH)
          Flip the image horizontal?
 FxMediaSelector setFlipVertical(java.lang.Boolean flipV)
          Flip the image vertical?
 void setForceImage(boolean forceImage)
           
 FxMediaSelector setLang(java.lang.String lang)
          Setter for the language
 FxMediaSelector setLangFallback(java.lang.Boolean langFallback)
          Use the language fallback to the default language if desired language does not exist?
 FxMediaSelector setPK(FxPK pk)
          Setter for the primary key
 FxMediaSelector setRotationAngle(int angle)
          Rotate the image by the given degrees
 FxMediaSelector setScaleHeight(int scaleHeight)
          Set a height to scale to
 FxMediaSelector setScaleWidth(int scaleWidth)
          Set a width to scale to
 FxMediaSelector setSize(BinaryDescriptor.PreviewSizes size)
          Set the preview or original size to use
 FxMediaSelector setTimestamp(long timestamp)
          Set the timestamp to append to links
 FxMediaSelector setUseType(java.lang.Boolean useType)
          Set the flag to use the assignments default binary image from the type if present
 FxMediaSelector setXPath(java.lang.String xp)
          Setter for the XPath
 boolean useCrop()
          Perform a crop?
 boolean useLangFallback()
          Fallback to the default language if no image present for the requested?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxMediaSelector

public FxMediaSelector()
Empty Ctor


FxMediaSelector

public FxMediaSelector(FxPK pk)
Ctor

Parameters:
pk - primary key
Method Detail

setPK

public FxMediaSelector setPK(FxPK pk)
Setter for the primary key

Parameters:
pk - primary key
Returns:
this object, useful for chaining

setUseType

public FxMediaSelector setUseType(java.lang.Boolean useType)
Set the flag to use the assignments default binary image from the type if present

Parameters:
useType - use the assignments default binary image from the type if present
Returns:
this object, useful for chaining

setXPath

public FxMediaSelector setXPath(java.lang.String xp)
Setter for the XPath

Parameters:
xp - xpath
Returns:
this object, useful for chaining

setLang

public FxMediaSelector setLang(java.lang.String lang)
Setter for the language

Parameters:
lang - language
Returns:
this object, useful for chaining

setLangFallback

public FxMediaSelector setLangFallback(java.lang.Boolean langFallback)
Use the language fallback to the default language if desired language does not exist?

Parameters:
langFallback - this object, useful for chaining
Returns:
this object, useful for chaining

setSize

public FxMediaSelector setSize(BinaryDescriptor.PreviewSizes size)
Set the preview or original size to use

Parameters:
size - preview or original size
Returns:
this object, useful for chaining

setScaleWidth

public FxMediaSelector setScaleWidth(int scaleWidth)
Set a width to scale to

Parameters:
scaleWidth - width to scale to
Returns:
this object, useful for chaining

setScaleHeight

public FxMediaSelector setScaleHeight(int scaleHeight)
Set a height to scale to

Parameters:
scaleHeight - height to scale to
Returns:
this object, useful for chaining

setRotationAngle

public FxMediaSelector setRotationAngle(int angle)
Rotate the image by the given degrees

Parameters:
angle - degrees to rotate
Returns:
this object, useful for chaining

setFlipHorizontal

public FxMediaSelector setFlipHorizontal(java.lang.Boolean flipH)
Flip the image horizontal?

Parameters:
flipH - flip horizontal?
Returns:
this object, useful for chaining

setFlipVertical

public FxMediaSelector setFlipVertical(java.lang.Boolean flipV)
Flip the image vertical?

Parameters:
flipV - flip vertical?
Returns:
this object, useful for chaining

setCrop

public FxMediaSelector setCrop(java.awt.Rectangle crop)
Crop the image to the given rectangle

Parameters:
crop - rectangle to crop
Returns:
this object, useful for chaining

isCrop

public boolean isCrop()
Is a crop operation requested?

Returns:
crop operation requested?

setFilename

public FxMediaSelector setFilename(java.lang.String filename)
Set the filename to append to a link

Parameters:
filename - filename to append to a link
Returns:
this object, useful for chaining

hasTimestamp

public boolean hasTimestamp()
Is a timestamp for a link requested?

Returns:
timestamp requested

getTimestamp

public long getTimestamp()
Get the timestamp to append to links

Returns:
timestamp to append to links

setTimestamp

public FxMediaSelector setTimestamp(long timestamp)
Set the timestamp to append to links

Parameters:
timestamp - timestamp to append to links
Returns:
this object, useful for chaining

getFilename

public java.lang.String getFilename()
Get the filename to append to links

Returns:
filename to append to links

hasFilename

public boolean hasFilename()
Append a filename to links?

Returns:
append a filename to links

isUseType

public java.lang.Boolean isUseType()
Use the assignments default binary image from the type if present?

Returns:
use the assignments default binary image from the type if present

getRotationAngle

public int getRotationAngle()
Get the rotation angle

Returns:
rotation angle

isFlipHorizontal

public java.lang.Boolean isFlipHorizontal()
Flip horizontal?

Returns:
flip horizontal?

isFlipVertical

public java.lang.Boolean isFlipVertical()
Flip vertical?

Returns:
flip vertical?

getCrop

public java.awt.Rectangle getCrop()
Get the crop region if set

Returns:
crop region

useCrop

public boolean useCrop()
Perform a crop?

Returns:
perform a crop?

hasPK

public boolean hasPK()
Is a primary key set?

Returns:
primary key set

getXPath

public java.lang.String getXPath()
Get the XPath of the property containing the image

Returns:
XPath of the property containing the image

getPK

public FxPK getPK()
Get the primary key

Returns:
primary key

getSize

public BinaryDescriptor.PreviewSizes getSize()
Get the requested (pre-scaled) thumbnail size (0..4)

Returns:
requested (pre-scaled) thumbnail size (0..4)

getLanguageIso

public java.lang.String getLanguageIso()
Get the iso code of the desired translation for multilingual images

Returns:
iso code of the desired translation

useLangFallback

public boolean useLangFallback()
Fallback to the default language if no image present for the requested?

Returns:
fallback to the default language?

getLanguage

public FxLanguage getLanguage()
                       throws FxApplicationException
Get the requested language for the image

Returns:
requested language
Throws:
FxApplicationException - on errors

isScaleHeight

public boolean isScaleHeight()
Scale to a given height?

Returns:
scale to a given height?

getScaleHeight

public int getScaleHeight()
Get the height to scale to

Returns:
height to scale to

isScaleWidth

public boolean isScaleWidth()
Scale to a given width?

Returns:
scale to a given width?

getScaleWidth

public int getScaleWidth()
Get the width to scale to

Returns:
width to scale to

isApplyManipulations

public boolean isApplyManipulations()

isForceImage

public boolean isForceImage()
If the binary does not represent an image and the "original" preview size was chosen, the biggest thumbnail is returned instead.

Returns:
if the returned binary must be an image

setForceImage

public void setForceImage(boolean forceImage)