Package com.oorian.messaging.commands
Class LoadImagesCommand
java.lang.Object
com.oorian.messaging.commands.Command
com.oorian.messaging.commands.LoadImagesCommand
Command to preload multiple images on the client side.
This command instructs the client to load multiple images into the browser cache before they're needed for display. This is useful for optimizing page performance by preloading image galleries, slideshows, or other image-heavy content.
Features:
- Preloads multiple images in a single command
- URL encoding for safe transmission
- Batch image loading optimization
- Supports single or multiple image URLs
Usage:
// Preload multiple images
List<String> urls = Arrays.asList("img1.jpg", "img2.jpg", "img3.jpg");
LoadImagesCommand loadImgs = new LoadImagesCommand(urls);
// Or preload a single image
LoadImagesCommand loadImg = new LoadImagesCommand("single.jpg");
JsonObject json = loadImg.toJson();
- Since:
- 2007
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLoadImagesCommand(String imageUrl) Constructs a new LoadImagesCommand to preload a single image.LoadImagesCommand(List<String> imageUrls) Constructs a new LoadImagesCommand to preload multiple images. -
Method Summary
Modifier and TypeMethodDescriptiontoJson()Generates the JSON representation of this load images command.Methods inherited from class com.oorian.messaging.commands.Command
getElementId, getId, setElementId, toString
-
Constructor Details
-
LoadImagesCommand
Constructs a new LoadImagesCommand to preload multiple images.- Parameters:
imageUrls- the list of image URLs to preload
-
LoadImagesCommand
Constructs a new LoadImagesCommand to preload a single image.- Parameters:
imageUrl- the URL of the image to preload
-
-
Method Details