|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ngs.image.ImageModel
public class ImageModel
Controller / Model for manipulation of BufferedImages provided by an ImageSource.
Field Summary | |
---|---|
static int |
FIT_BOTH
|
static int |
FIT_HEIGHT
|
static int |
FIT_NONE
|
static int |
FIT_WIDTH
|
Constructor Summary | |
---|---|
ImageModel()
Creates a new ImageModel with a small thread pool for handling manipulation commands asynchronously, and no ImageSource. |
|
ImageModel(ImageSource source)
Constructs a new ImageModel for controlling the given ImageSource. |
Method Summary | |
---|---|
void |
addImageListener(ImageEventListener iel)
Adds an ImageEventListener to inform interested parties that a specific type of event has occurred. |
void |
addRotation(int degrees)
Adds the number of degrees to the current rotation. |
void |
adjustBrightness(int by)
Adjusts the current brightness value by the given increment. |
void |
adjustContrast(float by)
Adds the given increment to the current contrast value. |
void |
clearClip()
Removes the current clip if there is one. |
void |
error(String message)
Handles an error occurring from a source. |
BufferedImage |
extendRender(BufferedImage image)
ImageModel subclasses can override this method to extend the rendering process. |
int |
getBrightness()
Gets the current brightness value. |
Rectangle |
getClip()
Retrieves the current clip bounds if we in sub-clip mode. |
float |
getContrast()
Gets the current contrast value. |
int |
getFitMode()
Gets the fitMode |
BufferedImage |
getImage()
Gets the current BufferedImage to be rendered by a view for this model. |
int |
getImageCount()
Forwards the request to the ImageSource. |
int |
getImagePage()
Gets which image from the given ImageSource is currently being made available for render. |
Dimension |
getPageSize()
Gets the dimension of the current page, scaled by the current scale factor. |
Dimension |
getPageSize(Dimension d)
Gets the dimension of the current page, scaled by the current scale factor. |
int |
getRotation()
Gets the current rotation in degrees |
float |
getScale()
Gets the scale. |
ImageSource |
getSource()
Gets the ImageSource for this ImageModel |
AffineTransform |
getTransform()
|
void |
invert()
Tells the model to render the image with all colors inverted. |
boolean |
isInverted()
Returns weather or not this instance is going to invert the image. |
void |
nextPage()
Moves to the next image. |
BufferedImage |
preRender(BufferedImage image)
ImageModel subclasses can override this method to extend the rendering process. |
void |
prevPage()
Moves to the previous Image. |
void |
queueRender()
Places a new entry into the render Queue. |
void |
removeImageListener(ImageEventListener iel)
Removes an ImageEventListener used to inform interested parties that a specific type of event has occurred. |
void |
removeSource()
Removes the source that's currently in use. |
void |
render()
Immediately re-render and fire an event when done. |
void |
scaleBy(float factor)
Scales the Current scale factor by the given amount. |
void |
setBrightness(int offset)
Sets the Brightness. |
void |
setClip(Rectangle rect)
Otherwise, we clear the scale and go to full page rendering mode. |
void |
setContrast(float contrast)
Sets the current contrast value. |
void |
setFitMode(Rectangle rect,
int fitMode)
Sets the fit mode |
void |
setImagePage(int page)
Sets the current image to be rendered to the given index into the current ImageSource. |
void |
setRotation(int degrees)
Sets the rotation to the given degrees If the combined rotation is > 360, we automatically subtract 360, so that the calculated radians remain within the 0 - 360 degree equivalent range. |
void |
setScale(float scale)
Sets the scale factor for rendering the current Image. |
void |
setScale(float scalex,
float scaley)
Sets the scale factor for rendering the current Image. |
void |
setSource(ImageSource source)
Sets the ImageSource for this ImageModel to use when retrieving images |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FIT_NONE
public static final int FIT_WIDTH
public static final int FIT_HEIGHT
public static final int FIT_BOTH
Constructor Detail |
---|
public ImageModel()
public ImageModel(ImageSource source)
Method Detail |
---|
public BufferedImage getImage()
public void addImageListener(ImageEventListener iel)
public void removeImageListener(ImageEventListener iel)
public void setSource(ImageSource source)
public ImageSource getSource()
public void removeSource()
public void setClip(Rectangle rect)
public void setFitMode(Rectangle rect, int fitMode)
public int getFitMode()
public Rectangle getClip()
public void clearClip()
public Dimension getPageSize()
public Dimension getPageSize(Dimension d)
public void error(String message)
public int getImageCount()
public void setImagePage(int page)
public int getImagePage()
public void nextPage()
public void prevPage()
public void setRotation(int degrees)
public int getRotation()
public void addRotation(int degrees)
public void setScale(float scalex, float scaley)
public void setScale(float scale)
public void scaleBy(float factor)
public float getScale()
public void setBrightness(int offset)
public void adjustBrightness(int by)
public int getBrightness()
public void setContrast(float contrast)
public void adjustContrast(float by)
public float getContrast()
public void invert()
public boolean isInverted()
public BufferedImage preRender(BufferedImage image)
public BufferedImage extendRender(BufferedImage image)
public AffineTransform getTransform()
public void queueRender()
public void render()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |