Package com.oorian.messaging.commands
Class LoadImageCommand
java.lang.Object
com.oorian.messaging.commands.Command
com.oorian.messaging.commands.LoadImageCommand
Command to preload an image on the client side with callback notification.
This command instructs the client to load an image into the browser cache before it's needed for display. It supports a callback mechanism to notify when the image has completed loading, enabling synchronization and progress tracking.
Features:
- Preloads images into browser cache
- URL encoding for safe transmission
- Callback notification on load completion
- Supports image optimization strategies
Usage:
// Preload an image with callback
LoadImageCommand loadImg = new LoadImageCommand("images/photo.jpg", "imageLoadedCallback");
JsonObject json = loadImg.toJson();
- Since:
- 2007
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLoadImageCommand(String imageUrl, String callbackId) Constructs a new LoadImageCommand to preload an image with callback notification. -
Method Summary
Modifier and TypeMethodDescriptiontoJson()Generates the JSON representation of this load image command.Methods inherited from class com.oorian.messaging.commands.Command
getElementId, getId, setElementId, toString
-
Constructor Details
-
LoadImageCommand
Constructs a new LoadImageCommand to preload an image with callback notification.- Parameters:
imageUrl- the URL of the image to preloadcallbackId- the ID of the callback to invoke when the image is loaded
-
-
Method Details