ru.novosoft.dc.core
Interface PicturePool


public interface PicturePool

A picture pool appoints streams for writing pictures and provides the post-processing of pictures.


Field Summary
static byte ALREADY_PREPARED
          The action type is "skip the picture" because such a picture is already prepared.
static byte PROCESS
          The action type is "process the picture".
static byte SKIP
          The action type is "skip the picture" (the pool cannot process this type of picture).
static byte TRY_ANOTHER
          The action type is "try to skip the picture" (use an alternative if possible but process this picture if no alternative exist).
 
Method Summary
 void finishProcessing(PictureHandler handler, java.io.OutputStream pictureStream, boolean success)
          Complete processing of the picture.
 int requiredAction(PictureHandler handler)
          Analyze the picture and select an action required.
 java.io.OutputStream startProcessing(PictureHandler handler)
          Start processing of a picture.
 void unlikedPictureType(int type)
          Set the specified picture type (a type constant from the PictureType interface) to be unliked.
 

Field Detail

PROCESS

public static final byte PROCESS
The action type is "process the picture".

TRY_ANOTHER

public static final byte TRY_ANOTHER
The action type is "try to skip the picture" (use an alternative if possible but process this picture if no alternative exist).

ALREADY_PREPARED

public static final byte ALREADY_PREPARED
The action type is "skip the picture" because such a picture is already prepared.

SKIP

public static final byte SKIP
The action type is "skip the picture" (the pool cannot process this type of picture).
Method Detail

unlikedPictureType

public void unlikedPictureType(int type)
Set the specified picture type (a type constant from the PictureType interface) to be unliked. If a picture type is unliked, a picture of this format will be replaced to a picture of another format if possible. More exactly, if this type is found in the scope of the "shppict" destination, this destination will be skipped and the alternative "nonshppict" destination will be processed. So, a picture of unliked format is replaced to an alternative if it is possible, but when a picture has no alternative and its format is unliked, this picture will be processed. Unliking of WMF pictures has no sence because a "nonshppict" alternative is usually WMF.

requiredAction

public int requiredAction(PictureHandler handler)
Analyze the picture and select an action required.

startProcessing

public java.io.OutputStream startProcessing(PictureHandler handler)
Start processing of a picture. Create a stream to write the picture and return it or null if cannot start.

finishProcessing

public void finishProcessing(PictureHandler handler,
                             java.io.OutputStream pictureStream,
                             boolean success)
Complete processing of the picture.
Parameters:
handler - a handler if picture to be completed
pictureStream - a stream of the picture
success - if true, the picture reading was successfull


Other Novosoft LLC products:
Handy Backup Handy Password manager