|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfable.imageviewer.component.ImageComponentImage
public class ImageComponentImage
This class manages the imageCanvas for the ImageView and things related to it. These include the selections and the Rectangles describing the image, the original image, the oriented image, and the oriented original image.
Field Summary |
---|
Fields inherited from interface fable.imageviewer.internal.IImagesVarKeys |
---|
BTN_IMG_ADD, BTN_IMG_ADD_PLOT, BTN_IMG_DELETE, BTN_IMG_SETTINGS, BTN_IMG_SUBTRACT, BTN_IMG_SUBTRACT_PLOT, COORD_BL, COORD_BR, COORD_CUSTOM, COORD_TL, COORD_TR, coordNameValues, O_MOOM, O_MOOP, O_OMMO, O_OMPO, O_OPMO, O_OPPO, O_POOM, O_POOP, orientNameValues, PALETTE_AUTUMN, PALETTE_BLUES, PALETTE_COLOR, PALETTE_GREENS, PALETTE_GREY, PALETTE_PASTEL1, PALETTE_RAINBOW1, PALETTE_RAINBOW2, PALETTE_REDS, PALETTE_SPRING, PALETTE_SUMMER, PALETTE_WINTER, paletteNameValues |
Constructor Summary | |
---|---|
ImageComponentImage(ImageComponent iv,
ImageComponentUI controls)
Constructor. |
Method Summary | |
---|---|
void |
calculateMainRectangles()
Calculates the origRect, orientedOrigRect, and orientedRect from the imageRect and the imageModel. |
void |
changeImageRect(org.eclipse.swt.graphics.Rectangle rect,
float[] areaAsFloat,
java.lang.String fileName,
ImageModel _imageModel)
Sets a new image rectangle to display along with the new data and name of the file. |
void |
clearCanvas()
Clear the imageCanvas. |
org.eclipse.swt.graphics.ImageData |
createImageData(float _minimum,
float _maximum,
org.eclipse.swt.graphics.PaletteData palette)
Creates an ImageData with pixels scaled between minimum and maximum, oriented according to the current orientation, and using the specified palette. |
org.eclipse.swt.graphics.Image |
createScreenImage(org.eclipse.swt.graphics.ImageData data)
Converts an ImageData into an Image with the appropriate scaling and sets the global scaling parameters. |
void |
displayImage()
Update the image display. |
void |
dispose()
Called when the View is to be disposed |
org.eclipse.swt.graphics.Image |
getImage()
|
org.eclipse.swt.graphics.Rectangle |
getImageRect()
|
org.eclipse.swt.graphics.Rectangle |
getOrientedOrigRect()
|
org.eclipse.swt.graphics.Rectangle |
getOrientedRect()
|
org.eclipse.swt.graphics.Rectangle |
getOrigRect()
|
org.eclipse.swt.graphics.Rectangle |
getSelectedArea()
|
java.lang.Boolean |
getSelectOn()
|
float[] |
imageToOriented(float[] point)
Returns the unscaled, oriented image coordinates for the specified original image coordinates given as a float[]. |
org.eclipse.swt.graphics.Point |
imageToOriented(org.eclipse.swt.graphics.Point point)
Returns the unscaled, oriented image coordinates for the specified original image coordinates given as a Point. |
void |
initializeCanvas()
Does initial setup for the canvas. |
boolean |
isImageChanged()
|
org.eclipse.swt.graphics.Point |
orientedToImage(org.eclipse.swt.graphics.Point point)
Returns the original image coordinates for the specified unscaled, oriented image coordinates. |
void |
resetZoom()
Resets the zoom to full size. |
org.eclipse.swt.graphics.Rectangle |
screenRectangleToImageRectangle(org.eclipse.swt.graphics.Rectangle screenRect,
boolean ordered)
Converts a Rectangle in screen coordinates to a Rectangle in the original image coordinates and insures it is in bounds and has non-negative width and height. |
org.eclipse.swt.graphics.Rectangle |
screenRectangleToOrientedImageRectangle(org.eclipse.swt.graphics.Rectangle screenRect,
boolean ordered)
Converts a Rectangle in screen coordinates to a Rectangle in the oriented image coordinates and insures it is in bounds and has non-negative width and height. |
void |
selectZoom(ZoomSelection zoomselect)
|
void |
setImageChanged(boolean imageChanged)
|
void |
setImageRect(org.eclipse.swt.graphics.Rectangle imageRect)
|
void |
setSelectOn(java.lang.Boolean selectOn)
|
void |
showPeaks()
Draws red squares around all peaks using the currentLinePeakWidth. |
void |
showSelectedPeaks(float[] peaksToColor)
First calls showPeaks to draw red squares, then draws green squares around all peaks in the array using the currentLinePeakWidth. |
void |
showSelection(boolean force)
Draws the current selection on the screen and calls showSelectedArea, showSelectedLine, or showProfile, as appropriate. |
void |
showZoom(org.eclipse.swt.events.MouseEvent ev,
boolean in)
Zooms in or out centered on the mouse coordinates. |
org.eclipse.swt.graphics.Point |
tcToScreen(float tcY,
float tcZ)
Returns the current oriented and scaled screen coordinates for a point (y, z) in the TotalCrys coordinate system. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageComponentImage(ImageComponent iv, ImageComponentUI controls)
iv
- controls
- imageCanvas
- Method Detail |
---|
public void initializeCanvas()
public void dispose()
public void calculateMainRectangles()
public void showSelection(boolean force)
public void showZoom(org.eclipse.swt.events.MouseEvent ev, boolean in)
ev
- in
- True to zoom in, false to zoom out.public void resetZoom()
public void showPeaks()
public void showSelectedPeaks(float[] peaksToColor)
peaksToColor
- An array of TotalCryst coordinates [y0,z0,y1,z1,...] to have a
green square. Used in PeakSearchSptView to show the selected
peaks in green.public void changeImageRect(org.eclipse.swt.graphics.Rectangle rect, float[] areaAsFloat, java.lang.String fileName, ImageModel _imageModel)
rect
- The new Rectangle.areaAsFloat
- The new data.fileName
- The new name of the file._imageModel
- The new ImageModel. If null, then make a new ImageModel.public void displayImage()
public org.eclipse.swt.graphics.ImageData createImageData(float _minimum, float _maximum, org.eclipse.swt.graphics.PaletteData palette)
minimum
- Maximum data value.maximum
- Minimum data value.palette
- PaletteData to use for ImageData.
public org.eclipse.swt.graphics.Image createScreenImage(org.eclipse.swt.graphics.ImageData data)
data
- The ImageData.
public org.eclipse.swt.graphics.Point orientedToImage(org.eclipse.swt.graphics.Point point)
point
- The coordinates of the oriented image.
public org.eclipse.swt.graphics.Point imageToOriented(org.eclipse.swt.graphics.Point point)
point
- The coordinates of the original image (x, y}.
public float[] imageToOriented(float[] point)
point
- The coordinates of the original image {x, y}.
public org.eclipse.swt.graphics.Rectangle screenRectangleToImageRectangle(org.eclipse.swt.graphics.Rectangle screenRect, boolean ordered)
screenRect
- ordered
- Whether the returned Rectangle is ordered so x + width > x and
y + height > y.
public org.eclipse.swt.graphics.Rectangle screenRectangleToOrientedImageRectangle(org.eclipse.swt.graphics.Rectangle screenRect, boolean ordered)
screenRect
- ordered
- Whether the returned Rectangle is ordered so x + width > x and
y + height > y.
public org.eclipse.swt.graphics.Point tcToScreen(float tcY, float tcZ)
tcY
- The value of y in the TotalCrys system.tcZ
- The value of z in the TotalCrys system.
public void clearCanvas()
public org.eclipse.swt.graphics.Rectangle getSelectedArea()
public void selectZoom(ZoomSelection zoomselect)
public boolean isImageChanged()
public void setImageChanged(boolean imageChanged)
imageChanged
- the imageChanged to setpublic org.eclipse.swt.graphics.Rectangle getImageRect()
public void setImageRect(org.eclipse.swt.graphics.Rectangle imageRect)
imageRect
- the imageRect to setpublic org.eclipse.swt.graphics.Rectangle getOrigRect()
public org.eclipse.swt.graphics.Rectangle getOrientedOrigRect()
public org.eclipse.swt.graphics.Rectangle getOrientedRect()
public java.lang.Boolean getSelectOn()
public void setSelectOn(java.lang.Boolean selectOn)
selectOn
- the selectOn to setpublic org.eclipse.swt.graphics.Image getImage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |