Package com.iizix.prop.ui
Class UIImage2
java.lang.Object
com.iizix.prop.GProp<GProp<?>[]>
com.iizix.prop.PropCnr
com.iizix.prop.ui.UIComp
com.iizix.prop.ui.UIImage2
- All Implemented Interfaces:
- EventListener,- IFocusComp,- IMessageBox,- IComponent,- ICustomDataProvider,- IGProp<GProp<?>[]>,- IPropCnr,- IUIComp,- IUIContextMenuOwner,- IUIFocusComp,- IVSComponentListener,- IVSComponentState,- IVSFieldListener,- Cloneable
- Direct Known Subclasses:
- EUIImage2
Image Crop and Upload UI component.
- Author:
- Christopher Mindus
- Nested Class Summary- Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox- IMessageBox.Icon- Nested classes/interfaces inherited from interface com.iizix.prop.vs.IVSComponentState- IVSComponentState.State
- Field SummaryFieldsModifier and TypeFieldDescription- static final StringThe default supported image types and file etensions: ".jpg,.jpeg,image/jpeg,.png,image/png".- static final GSizeThe default viewport size: 100x100.- Fields inherited from class com.iizix.prop.ui.UIComp- EMPTY, REMOTE_FOCUS_EVENT, styles, vsField- Fields inherited from class com.iizix.prop.PropCnr- EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID- Fields inherited from class com.iizix.prop.GProp- GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2- Fields inherited from interface com.iizix.prop.IGProp- EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE- Fields inherited from interface com.iizix.gyro.IMessageBox- ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNING- Fields inherited from interface com.iizix.prop.ui.IUIComp- ERROR, INFORMATION, NONE, WARNING
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- boolean- addListener- (IUIImage2Listener listener) Adds a new listener for changes in this image property.- booleanReturns if the component can be aligned left, right, center, or horizontal fill.- booleanReturns if the component can be aligned top, bottom, middle or vertical fill.- clone()Creates a clone out of this property.Returns the size of the component in pixels.- final intGets the device type: -1=mobile, 0=both, 1=desktop.- getImage()Gets the image.- byte[]Gets the image file data.- intGets the image height.Gets the image orientation.Gets the image type.- intGets the image width.- intGets the maximum file size of an image.- intGets the maximum width or height allowed for a user selected image.- intGets the minimum width or height allowed for a user selected image.Gets the original image file name when the user selected the image.Gets the supported image formats.Gets the viewport size.- doubleGets the image zoom factor.- booleanReturns if the component has implicit component horizontal fill.- booleanReturns if the component has implicit component vertical fill.- boolean- isCircle()Gets if the selected cropping area is a circle or of rectangular shape.- booleanReturns if the component can show the context menu in mobile mode.- booleanDoes this component require an explicitly defined height?- booleanDoes this component require an explicitly defined width?- booleanDoes this component require a height?- booleanDoes this component require a width?- void- onEventSelf- (GEvent event) Self events.- void- onRemoteEvent- (RemoteEvent event) Called when a remote property event should be processed by this property.- boolean- removeListener- (IUIImage2Listener listener) Removes a listener for changes in this image property.- boolean- setCircle- (boolean isCircle) Gets if the selected cropping area is a circle or of rectangular shape.- boolean- setImage- (IImageTarget image) Sets the image.- boolean- setImageFileData- (String fileName, byte[] data) Sets the image file data and the original file name (path is removed).- boolean- setMaximumFileSize- (int size) Sets the maximum file size of an image.- boolean- setMinMaxWidthOrHeight- (int min, int max) Sets the minimum and maximum width or height allowed for a user selected image.- boolean- setSupportedImageTypes- (String types) Sets the supported image types.- boolean- setViewport- (GSize size) Sets the viewport size.- boolean- setZoomFactor- (double zoomFactor) Sets the image zoom factor.- protected boolean- shouldSerializeToXML- (int programType, GProp<?> childProp) Method used to check for child property serialization to XML.- boolean- verify- (PropVerification verification) Verifies this property container.- Methods inherited from class com.iizix.prop.ui.UIComp- add, addMappings, assignFontInfoResolver, canAcceptUIContainerFocus, canFillX, canFillY, canRequestFocus, canRequestFocus, clearErrorMessage, couldRequestFocusIfVirtualized, createStyles, createTitleProp, disconnectVSField, doUpdateVSFieldFromUIComponent, enterVSProcessing, exitVSProcessing, fireSelection, fireSelection, forbiddenGetCustomDataMap, getBadge, getBestVSFieldValueType, getComponentID, getComponentMappings, getCSSClassNames, getErrorMessage, getErrorMessage, getErrorMessageEx, getErrorMessageString, getErrorMessageString, getErrorMessageStringEx, getFirstContainerVSStateFocus, getFixHeight, getFixWidth, getFontInfo, getForcedAlignX, getForcedAlignY, getKStringText, getLayout, getLayoutMgr, getLayoutMgr, getMappedVSComponent, getMessage, getMessageText, getPixelHeight, getPixelWidth, getPredefinedProps, getSize, getStyles, getStyles, getText, getTitle, getTitleKS, getTitlePKS, getTooltip, getTooltipText, getTrigger, getUIPanel, getUIParent, getValue, getValue, getVirtualSpace, getVSField, getVSStateFocus, hasExplicitHeight, hasExplicitWidth, hasFocus, hasImplicitHeight, hasImplicitWidth, hasSelectionChanged, initPropCnr, invokeOnUICreateTree, isEnabled, isMobile, isReadOnly, isRTL, isVisible, isVSFieldDisconnected, onBroken, onComponentSelectedInParent, onFocusGained, onNotifySelectionChanged, onParentStateChanged, onPrepare, onPrepare, onPropDispose, onResolved, onSelectionChanged, onStateChanged, onValueChanged, processVSComponentSelection, reconnectVSField, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusEx, requestFocusEx, requestFocusEx, requestFocusEx, resetComponentID, setBadge, setBadge, setComponentToVSField, setCSSClassNames, setCSSClassNames2, setEnabled, setEnabled, setErrorMessage, setErrorMessage, setErrorMessage, setErrorMessage, setHTMLText, setLayoutMgr, setMessage, setMessage, setReadOnly, setReadOnly, setText, setText, setTitle, setTitle, setTitle, setTooltip, setTooltip, setUIContainerFocus, setVisible, setVisible, setVSFieldMessageToComponent, setVSFieldToComponent, verifyComponentScope- Methods inherited from class com.iizix.prop.PropCnr- __transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, completeVirtualize, containsProp, containsProp, convertLoadedProp, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verifyInternalUseOnly, verifyTree, virtualize- Methods inherited from class com.iizix.prop.GProp- addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPropInvalidateCache, onPropParentChanged, onPropValueSet, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning- Methods inherited from class java.lang.Object- getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface com.iizix.IComponent- messageBox- Methods inherited from interface com.iizix.prop.ICustomDataProvider- getCustomData, putCustomData, putCustomDataIfAbsent- Methods inherited from interface com.iizix.gyro.IFocusComp- requestFocus, requestFocus, requestFocusEx, requestFocusEx- Methods inherited from interface com.iizix.prop.IGProp- addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, getValueClasses, getVSReference, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onPropTreeInitialized, removePropError, removePropListener, renameProp, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toElementString, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropType, validatePropValue, warning, warning, warning- Methods inherited from interface com.iizix.gyro.IMessageBox- messageBox, messageBox, messageBox- Methods inherited from interface com.iizix.prop.IPropCnr- addProp, addProp, addProp2, addProp2, canRequestFocus, canRequestFocus, canRequestFocus, containsProp, containsProp, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, enablePropCommunication, enablePropHashMap, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsError, getExtendsName, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropCnr, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getString, getString, getString, getString, hasFocus, initializeExtendsFramework, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsRoot, isPropAddRemoveAllowed, isPropExtended, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, requestFocus, requestFocusEx, setBool, setBool, setBool, setBool, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, usePropHashMap, usesPropIndex, validateClassInstances- Methods inherited from interface com.iizix.prop.ui.IUIComp- getContainerFirstUIComponent, getContainerFirstUIComponentNull, getFirstUIComponent, getFirstUIComponentNull, getPanelUIComponent, getPanelUIComponentNull, getUIRef- Methods inherited from interface com.iizix.prop.ui.IUIContextMenuOwner- getContainedContextMenu, getContextMenu, getReferencedContextMenu, isContextMenuSupported, onBroken, onResolved- Methods inherited from interface com.iizix.prop.ui.IUIFocusComp- onFocusGained, onFocusLost
- Field Details- DEFAULT_VIEWPORT_SIZEThe default viewport size: 100x100.
- DEFAULT_SUPPORTED_IMAGE_TYPESThe default supported image types and file etensions: ".jpg,.jpeg,image/jpeg,.png,image/png".- See Also:
 
 
- Constructor Details- UIImage2public UIImage2()Creates the component without a name. The name must be set in all cases using the- setPropertyAtomcall.
- UIImage2Creates the component with the specified name. All system-reserved names for components begins with "$".- Parameters:
- propertyAtom- the name of the component, unique within it's parent.
 
- UIImage2Creates the component with the specified name, initialized to contain the- GPropitems. All system-reserved names for components begins with "$".- Parameters:
- propertyAtom- The name of the component, unique within it's parent.
- newValue- The array of all properties the component should have.
- Throws:
- PropException- when at least one of the properties to initialize the component with is invalid.
 
 
- Method Details- cloneCreates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.- Cloning is used for "virtualization" of a property tree in the server. Client property classes will therefore throw - CloneNotSupportedException.- Once a tree has been cloned, the change-flag is reset, and the create-flag is set. All listeners are also removed! The new cloned property is an orphan, i.e. has no parent set. All children properties are also (deep) cloned. - Note that the cloning process is done WITHOUT thread synchronization for performance reasons, thus no modifications should be done to the tree! 
- shouldSerializeToXMLMethod used to check for child property serialization to XML. Override this method and return false to avoid writing the child property to XML. The default is to write all properties.- Overrides:
- shouldSerializeToXMLin class- PropCnr
- Parameters:
- programType- From PropFactory.getProgramType(): 0=- PropFactory.CLIENT, 1=- PropFactory.SERVERor 2=- PropFactory.EDITOR.
- childProp- The child property.
- Returns:
- true (default if not VOLATILE) to save to XML, false to avoid writing the property to XML.
 
- getDeviceTypepublic final int getDeviceType()Gets the device type: -1=mobile, 0=both, 1=desktop.- Specified by:
- getDeviceTypein interface- IUIComp
 
- isMobileContextMenuSupportedpublic boolean isMobileContextMenuSupported()Returns if the component can show the context menu in mobile mode.- Specified by:
- isMobileContextMenuSupportedin interface- IUIContextMenuOwner
- Returns:
- Image crop and upload component does NOT support context menus for mobile.
 
- onEventSelfSelf events.- Specified by:
- onEventSelfin interface- IGProp<GProp<?>[]>
- Overrides:
- onEventSelfin class- UIComp
- Parameters:
- event- The event.
 
- onRemoteEventCalled when a remote property event should be processed by this property.- Specified by:
- onRemoteEventin interface- IGProp<GProp<?>[]>
- Overrides:
- onRemoteEventin class- UIComp
- Parameters:
- event- The remote event.
 
- mustHaveWidthpublic boolean mustHaveWidth()Does this component require a width?- Overrides:
- mustHaveWidthin class- UIComp
- Returns:
- true if the width must be defined and non-zero, false otherwise.
 
- mustHaveHeightpublic boolean mustHaveHeight()Does this component require a height?- Overrides:
- mustHaveHeightin class- UIComp
- Returns:
- true if the height must be defined and non-zero, false otherwise.
 
- mustHaveExplicitWidthpublic boolean mustHaveExplicitWidth()Does this component require an explicitly defined width?- Overrides:
- mustHaveExplicitWidthin class- UIComp
- Returns:
- true if the width must be defined and non-zero, false otherwise.
 
- mustHaveExplicitHeightpublic boolean mustHaveExplicitHeight()Does this component require an explicitly defined height?- Overrides:
- mustHaveExplicitHeightin class- UIComp
- Returns:
- true if the height must be defined and non-zero, false otherwise.
 
- hasImplicitAlignFillXpublic boolean hasImplicitAlignFillX()Returns if the component has implicit component horizontal fill.- Overrides:
- hasImplicitAlignFillXin class- UIComp
- Returns:
- Always true: true means component will always fill the space in X.
 
- hasImplicitAlignFillYpublic boolean hasImplicitAlignFillY()Returns if the component has implicit component vertical fill.- Overrides:
- hasImplicitAlignFillYin class- UIComp
- Returns:
- Always: true means component will always fill the space in Y.
 
- canAlignXpublic boolean canAlignX()Returns if the component can be aligned left, right, center, or horizontal fill.
- canAlignYpublic boolean canAlignY()Returns if the component can be aligned top, bottom, middle or vertical fill.
- getApproximateSizeReturns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).- Specified by:
- getApproximateSizein class- UIComp
- Returns:
- The size of the image and when no image is set 64x64.
 
- addListenerAdds a new listener for changes in this image property. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeListenerRemoves a listener for changes in this image property.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- getImageGets the image.- Returns:
- An image, null for none.
 
- setImageSets the image.- When setting the image (assuming - imageis not- null):- the image width, height, user selected image file data is cleared.
- The file type will match the set image file name extension as "jpeg"/"jpg" or "png".
- The image orientation will be reset to default "NO_CHANGE".
- The user selected original file name will also be cleared.
- Crop points will be reset.
 - Parameters:
- image- The image, null for none.
- Returns:
- true for changed (or the original file name is cleared, or the file image data is cleared), false for no change.
- Throws:
- IllegalArgumentException- If image type is not of bitmap type, i.e. it's an SVG or FontIcon.
 
- setViewportSets the viewport size.- Parameters:
- size- The viewport size, or null for default 100x100.
- Returns:
- true if changed, false otherwise.
- Throws:
- IllegalArgumentException- If any size is less than 10 or larger than 99999.
 
- getViewportGets the viewport size.- Returns:
- The viewport size.
 
- getZoomFactorpublic double getZoomFactor()Gets the image zoom factor.- Returns:
- A double value for the zoom, greater than zero, defaults to 1d.
 
- setZoomFactorpublic boolean setZoomFactor- (double zoomFactor) Sets the image zoom factor.- Parameters:
- zoomFactor- A double value for the zoom, greater than zero, defaults to- 1d.
- Returns:
- true if changed, false otherwise.
- Throws:
- IllegalArgumentException- If the zoom factor is zero or less.
 
- isCirclepublic boolean isCircle()Gets if the selected cropping area is a circle or of rectangular shape.- Returns:
- trueif circular,- falseif rectangular shaped.
 
- setCirclepublic boolean setCircle- (boolean isCircle) Gets if the selected cropping area is a circle or of rectangular shape.- Parameters:
- isCircle- Flag for circle cropping area:- trueif circular,- falseif rectangular shaped.
- Returns:
- trueif changed,- falsefor no change.
 
- getMinimumWidthOrHeightpublic int getMinimumWidthOrHeight()Gets the minimum width or height allowed for a user selected image.- Returns:
- The minimum width or height, zero for no minimum, default is 50.
 
- getMaximumWidthOrHeightpublic int getMaximumWidthOrHeight()Gets the maximum width or height allowed for a user selected image.- Returns:
- The maximum width or height, zero for no maximum, default is 4096.
 
- setMinMaxWidthOrHeightpublic boolean setMinMaxWidthOrHeight- (int min, int max) Sets the minimum and maximum width or height allowed for a user selected image.- Parameters:
- min- The minimum width or height, zero for no minimum, default is 50.
- max- The maximum width or height, zero for no maximum, default is 4096.
- Returns:
- trueif changed,- falsefor no change.
- Throws:
- IllegalArgumentException- If- minor- maxis less than zero, or if- minis larger than- max.
 
- getMaximumFileSizepublic int getMaximumFileSize()Gets the maximum file size of an image.- Returns:
- The maximum file size, default 5 MB (5_242_880 bytes).
 
- setMaximumFileSizepublic boolean setMaximumFileSize- (int size) Sets the maximum file size of an image.- Parameters:
- size- The maximum file size, default 5 MB (5_242_880 bytes).
- Returns:
- trueif changed,- falsefor no change.
- Throws:
- IllegalArgumentException- If- sizeis zero or less, or larger than 8 MB (8_388_608 bytes).
 
- getImageFileDatapublic byte[] getImageFileData()Gets the image file data.- Returns:
- The file data byte array, nullif image source is not user selected.
 
- setImageFileDataSets the image file data and the original file name (path is removed). Only valid file extensions can be specified.- Parameters:
- fileName- The file name (ignored if- datais- null.
- data- The file data byte array,- nullto clear it so that the user can select an image.
- Returns:
- true for changed (original file name, file image data, previous IImageTarget, width, height, orientation, crop points and/or zoom), false for no change.
- Throws:
- IllegalArgumentException- If the file extension is not '.png', '.jpg' or '.jpeg', or if the image cannot be decoded in the media formats 'image/jpeg' or 'image/png'.
- NullPointerException- If the- fileNameis- nulland- datais present.
 
- getImageWidthpublic int getImageWidth()Gets the image width.- Returns:
- The image width, zero if image source is not user selected.
 
- getImageHeightpublic int getImageHeight()Gets the image height.- Returns:
- The image height, zero if image source is not user selected.
 
- getImageTypeGets the image type.- Returns:
- The image type, UNKNOWN for none.
 
- getSupportedImageTypesGets the supported image formats.- Returns:
- A string with supported image formats separated by comma. It is a combination of file extensions if the string starts with a '.' (dot). Otherwise it is a media file type such as 'image/jpeg' and/or 'image/png'. The default is list is:- .jpg
- .jpeg
- image/jpeg
- .png
- image/png
 
 
- setSupportedImageTypesSets the supported image types.- Parameters:
- types- The string with supported image formats separated by comma. It is a combination of file extensions if the string starts with a '.' (dot). Otherwise it is a media file type such as 'image/jpeg' and/or 'image/png'. Accepted values are case sensitive and are:- .jpg
- .jpeg
- image/jpeg
- .png
- image/png
 - A - nullor- emptystring will set the default types.
- Returns:
- true if changed, false for no change.
- Throws:
- IllegalArgumentException- If an invalid image media type is found, or a file extension is invalid, or if the string is not in lower case.
 
- getImageOrientationGets the image orientation.- Returns:
- The image orientation.
 
- getOriginalImageFileNameGets the original image file name when the user selected the image.- Returns:
- The file name, nullif image source is not user selected.
 
- verifyVerifies this property container. The check performed is the extension of classes and that no circular reference is present.