SmartObjectProvider

Inheritance: java.lang.Object

public class SmartObjectProvider

Defines the smart object provider that provides getting / setting data sources from global link resources of the PSD file and their contents.

Methods

MethodDescription
convertToSmartObject(Layer[] layers)Converts layers to an embedded smart object.
convertToSmartObject(int[] layerNumbers)Converts layers to an embedded smart object.
create_internalized(LnkeResource externalLinkResource, Lnk2Resource embeddedLinkResource, PsdImage container)Initializes a new instance of the SmartObjectProvider class.
embedAllLinked()Embeds all linked smart objects in the image.
equals(Object arg0)
getClass()
getContentType_internalized(System.Guid uniqueId)Gets the type of the smart object layer content.
getContents_internalized(System.Guid uniqueId)Gets the embedded or linked file contents.
getDataSource_internalized(System.Guid uniqueId)Gets the link data source by unique id.
getLayersForUpdateContents_internalized()It gets or sets layer when contents must be changed
hashCode()
loadContents_internalized(System.Guid uniqueId, LoadOptions options)Loads the contents.
newSmartObjectViaCopy(SmartObjectLayer sourceLayer)Creates a new smart object layer by coping the source one.
notify()
notifyAll()
removeOrphanedDataSources_internalized(System.Collections.Generic.List<System.Guid> actualDataSources)Removes data sources from embedded and external resources that are not present in the provided list of valid GUIDs.
replaceContents_internalized(System.Guid oldUniqueId, byte[] contents)Replaces the contents with the provided contents to embed.
replaceContents_internalized(PlacedResource placedResource, String linkedPath)
replaceContents_internalized(PlacedResource placedResource, String linkedPath, boolean isReplaceOnlyThis)Replaces the contents with the provided external file.
setContents_internalized(System.Guid uniqueId, byte[] data, String fileType)Sets the embedded or external file contents.
setDataSource(LinkDataSource dataSource)Sets (replaces or adds) the link data source in the global link resource.
setLayersForUpdateContents_internalized(System.Collections.Generic.List value)It gets or sets layer when contents must be changed
toString()
updateAllModifiedContent()Updates the content of all modified smart objects in the image.
wait()
wait(long arg0)
wait(long arg0, int arg1)

convertToSmartObject(Layer[] layers)

public final SmartObjectLayer convertToSmartObject(Layer[] layers)

Converts layers to an embedded smart object.

Parameters:

ParameterTypeDescription
layersLayer[]The layers.

Returns: SmartObjectLayer - The created SmartObjectLayer instance.

convertToSmartObject(int[] layerNumbers)

public final SmartObjectLayer convertToSmartObject(int[] layerNumbers)

Converts layers to an embedded smart object.

Parameters:

ParameterTypeDescription
layerNumbersint[]The layer numbers.

Returns: SmartObjectLayer - The created SmartObjectLayer instance.

create_internalized(LnkeResource externalLinkResource, Lnk2Resource embeddedLinkResource, PsdImage container)

public static SmartObjectProvider create_internalized(LnkeResource externalLinkResource, Lnk2Resource embeddedLinkResource, PsdImage container)

Initializes a new instance of the SmartObjectProvider class.

Parameters:

ParameterTypeDescription
externalLinkResourceLnkeResource
embeddedLinkResourceLnk2Resource
containerPsdImageThe container.

Returns: SmartObjectProvider

embedAllLinked()

public final void embedAllLinked()

Embeds all linked smart objects in the image.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getContentType_internalized(System.Guid uniqueId)

public final int getContentType_internalized(System.Guid uniqueId)

Gets the type of the smart object layer content.

Parameters:

ParameterTypeDescription
uniqueIdcom.aspose.ms.System.GuidThe unique identifier.

Returns: int - The type of the smart object layer content.

getContents_internalized(System.Guid uniqueId)

public final byte[] getContents_internalized(System.Guid uniqueId)

Gets the embedded or linked file contents.

Parameters:

ParameterTypeDescription
uniqueIdcom.aspose.ms.System.GuidThe unique identifier of the link data source.

Returns: byte[] - The byte[] contents.

getDataSource_internalized(System.Guid uniqueId)

public final LinkDataSource getDataSource_internalized(System.Guid uniqueId)

Gets the link data source by unique id.

Parameters:

ParameterTypeDescription
uniqueIdcom.aspose.ms.System.GuidThe unique identifier.

Returns: LinkDataSource - The LinkDataSource instance.

getLayersForUpdateContents_internalized()

public final System.Collections.Generic.List<SmartObjectLayer> getLayersForUpdateContents_internalized()

It gets or sets layer when contents must be changed

Returns: com.aspose.ms.System.Collections.Generic.List<com.aspose.psd.fileformats.psd.layers.smartobjects.SmartObjectLayer>

hashCode()

public native int hashCode()

Returns: int

loadContents_internalized(System.Guid uniqueId, LoadOptions options)

public final Image loadContents_internalized(System.Guid uniqueId, LoadOptions options)

Loads the contents.

Parameters:

ParameterTypeDescription
uniqueIdcom.aspose.ms.System.GuidThe unique identifier.
optionsLoadOptionsThe load options.

Returns: Image - The loaded Image instance.

newSmartObjectViaCopy(SmartObjectLayer sourceLayer)

public final SmartObjectLayer newSmartObjectViaCopy(SmartObjectLayer sourceLayer)

Creates a new smart object layer by coping the source one.

Parameters:

ParameterTypeDescription
sourceLayerSmartObjectLayerThe source layer.

Returns: SmartObjectLayer - The cloned SmartObjectLayer instance.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

removeOrphanedDataSources_internalized(System.Collections.Generic.List<System.Guid> actualDataSources)

public final void removeOrphanedDataSources_internalized(System.Collections.Generic.List<System.Guid> actualDataSources)

Removes data sources from embedded and external resources that are not present in the provided list of valid GUIDs. This method cleans up orphaned data sources by comparing against the current valid data source identifiers.

Parameters:

ParameterTypeDescription
actualDataSourcescom.aspose.ms.System.Collections.Generic.List<com.aspose.ms.System.Guid>The list of valid data source GUIDs to retain. Data sources not in this list will be removed.

replaceContents_internalized(System.Guid oldUniqueId, byte[] contents)

public final System.Guid replaceContents_internalized(System.Guid oldUniqueId, byte[] contents)

Replaces the contents with the provided contents to embed.

Parameters:

ParameterTypeDescription
oldUniqueIdcom.aspose.ms.System.GuidThe unique identifier of the existing data source.
contentsbyte[]The contents.

Returns: com.aspose.ms.System.Guid - The unique identifier of the created embedded data source. LiFdDataSource .

replaceContents_internalized(PlacedResource placedResource, String linkedPath)

public final System.Guid replaceContents_internalized(PlacedResource placedResource, String linkedPath)

Parameters:

ParameterTypeDescription
placedResourcePlacedResource
linkedPathjava.lang.String

Returns: com.aspose.ms.System.Guid

replaceContents_internalized(PlacedResource placedResource, String linkedPath, boolean isReplaceOnlyThis)

public final System.Guid replaceContents_internalized(PlacedResource placedResource, String linkedPath, boolean isReplaceOnlyThis)

Replaces the contents with the provided external file.

Parameters:

ParameterTypeDescription
placedResourcePlacedResourceThe placed resource.
linkedPathjava.lang.StringThe absolute path to the linked file.
isReplaceOnlyThisbooleanIf true, then don’t remove data source in global resources.

Returns: com.aspose.ms.System.Guid - The unique identifier Guid of the created linked data source. LiFeDataSource.

setContents_internalized(System.Guid uniqueId, byte[] data, String fileType)

public final void setContents_internalized(System.Guid uniqueId, byte[] data, String fileType)

Sets the embedded or external file contents.

Parameters:

ParameterTypeDescription
uniqueIdcom.aspose.ms.System.GuidThe unique identifier of the link data source.
databyte[]The data.
fileTypejava.lang.StringThe data file type.

setDataSource(LinkDataSource dataSource)

public final void setDataSource(LinkDataSource dataSource)

Sets (replaces or adds) the link data source in the global link resource.

Parameters:

ParameterTypeDescription
dataSourceLinkDataSourceThe link data source.

setLayersForUpdateContents_internalized(System.Collections.Generic.List value)

public final void setLayersForUpdateContents_internalized(System.Collections.Generic.List<SmartObjectLayer> value)

It gets or sets layer when contents must be changed

Parameters:

ParameterTypeDescription
valuecom.aspose.ms.System.Collections.Generic.List<com.aspose.psd.fileformats.psd.layers.smartobjects.SmartObjectLayer>

toString()

public String toString()

Returns: java.lang.String

updateAllModifiedContent()

public final void updateAllModifiedContent()

Updates the content of all modified smart objects in the image.

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int