3.5.2 - PX Image Display - JdlPXImage

John W. Campbell

3.5.2.1 Introduction

This class provides an image object. Its functions are based on the image display from the XDL_VIEW toolkit (J.W. Campbell, J. Appl. Cryst. (1995) 28 236-242) designed originally for the display of single crystal X-ray diffraction images. It may be used for measuring positions on the image and has facilities for overlaying symbols, vectors or text on top of the displayed image. A magnifying window within the object shows a magnified version of a portion of the image from the main image display area. The image may also be zoomed in a number of ways. Various options are available if the image display window is resized. An option is available to print the currently displayed image. An option is available to integrate additional user based functions if required.

Class, fields, constructor and methods:

Class Details
Accessible Fields
Constructor
Set Image Data
Add Overlay Data
Found Spots List
Set Special User Options
Set and Get Resources
Standard Positioning and Sizing
Add/Remove Action Listener
Get Returned Data
Overriden Superclass Methods

3.5.2.2 Class Details

Package:
Jdl.JdlView;
Class name:
JdlPXImage
Class definition:
public class JdlPXImage
Extends:
JPanel
Implements:
JdlDrawPanelDrawer
JdlFramedPanelDrawer
MouseListener
MouseMotionListener

ActionListener
JdlViewObject
Printable
Actions:
An action event will be generated when a pixel or (selected rectangle) position is input. The command action string is 'button pressed'. The position data may be retrieved using the getPosition(..) method. An action is also generated when a user-options dialog is displayed or dismissed with command strings "user option on" or "user option off" respectively.

3.5.2.3 Accessible Fields

The following accessible fields have been defined:

public final int IMAGE_BACKGROUND_INCLUDED
Background option: Background included.
public final int IMAGE_BACKGROUND_EXCLUDED
Background option: Background excluded.
public final int IMAGE_BACKGROUND_ONLY
Background option: Background only.
public final int IMAGE_COLOR_BW
Colour option: Black on white.
public final int IMAGE_COLOR_WB
Colour option: White on black.
public final int IMAGE_COLOR_USER
Colour option: User defined colour.
static final long serialVersionUID
public final static int PREFERRED
Size Constraint: preferred size.
public final static int FREE
Size/Location Constraint: free.
public final static int RESIZE_NONE
Resize option - do not resize image area.
public final static int RESIZE_AMOUNT
Resize option - increase(/decrease) area displayed - keep aspect ratio.
public final static int RESIZE_ZOOM
Resize option - zoom image on resize - keep aspect ratio.
public final static int RESIZE_RUBBER
Resize option - zoom image on resize - stretch/squash pixels.
Graphics off_screen_gr
BufferedImage buf_image
Graphics buf_gr
JdlImagePosition pos

3.5.2.4 Constructor

3.5.2.4.1 Introduction

A single constructor is available.

Constructor:

Constructs a JdlPXImage object with the basic resources required.

3.5.2.4.2 Constructs a JdlPXImage object with the basic resources required.

Constructor Definition:
public JdlPXImage(JdlImageData imgd, int w, int h, int ncomp, int rsz_opt, JdlViewOptions view_opts)
Parameters List:
imgd
A JdlImageData object containing details of the image to be displayed. This may be null with image data being defined later using the
w
The required (input) width for the image display area of the object. The actual size used may change if the shape of the image is not the same as that defined by 'w' and 'h'. If 'w' and 'h' are input as zero, then the input image width will be set to the minimum width of 100 if its use is required.
h
The required (input) height for the image display area of the object. The actual size used may change if the shape of the image is not the same as that defined by 'w' and 'h'. If 'w' and 'h' are input as zero, then the input image height will be set to the minimum height of 100 if its use is required. Note: 'w' and 'h' must either both be given values (>0) or both be zero.
ncomp
If w and h are both zero, then the image display area size will be calculated from the actual image size compressed by this factor; in this case ncomp must be >0.
rsz_opt
Flag indicating required handling if the object is resized:
= 0, Do not resize the image area = 1, Increase(/decrease) the amount of the image displayed - keep aspect ratio = 2, Zoom image on resize - keep aspect ratio = 3, Zoom image on resize - stretch/squash pixels as needed to fit new size
view_opts
Object to set non-default options for borders, active strip, colours and fonts.

3.5.2.5 Set Image Data

3.5.2.5.1 Introduction

This section has methods to input a new image or a background image or to get the current image data details.

Methods:

Set new image - setImageData
Set new image - setImageData
Set background image - setImageBgData
See if image present - isImagePresent
Get image data - getImageData
Get 'ax1' pixel scaling factor - getScalingFactorAx1
Get 'ax2' pixel scaling factor - getScalingFactorAx2

3.5.2.5.2 Set new image - setImageData

This method sets the image data resource for a new image. Note that, if the image size or axis order have changed, a new mid_point position for the image will be set.

Method Definition:
public void setImageData (JdlImageData imgd, boolean reset_size, int ncomp)
Parameters List:
imgd
The new image data object with details of the required new image.
reset_size
If true image display area size will be recalculated from the new image data. If false, the current image area display size will be used (based on the current input image width and height).
ncomp
If reset_size is true then the image display area size will be recalculated from the new image size, compressing it by a factor of ncomp.

3.5.2.5.3 Set new image - setImageData

This method sets the image data resource for a new image. Note that, if the image size or axis order have changed, a new mid-point position for the image will be set.

Method Definition:
public void setImageData (JdlImageData imgd, int w, int h, int ncomp)
Parameters List:
imgd
The new image data object with details of the required new image.
w
The required (input) width for the image display area of the object. The actual size used may change if the shape of the image is not the same as that defined by 'w' and 'h'. If 'w' and 'h' are input as zero, then the input image width will be set to the minimum width of 100 if its use is required.
h
The required (input) height for the image display area of the object. The actual size used may change if the shape of the image is not the same as that defined by 'w' and 'h'. If 'w' and 'h' are input as zero, then the input image height will be set to the minimum height of 100 if its use is required. Note: 'w' and 'h' must either both be given values (>0) or both be zero.
ncomp
If w and h are both zero, then the image display area size will be calculated from the actual image size compressed by this factor; in this case ncomp must be >0.

3.5.2.5.4 Set background image - setImageBgData

This method sets the background image data resource.

Method Definition:
public void setImageBgData (JdlImageData bgimg)
Parameters List:
bgimg
An image data object with details of the required background image. (only uses the bg_cmp and bg_img fields - assumes that the remainder are compatible with main image!). May be null to remove background image.

3.5.2.5.5 See if image present - isImagePresent

This method determines whether or not a valid image is currently present.

Method Definition:
public boolean isImagePresent()
Parameters List:
none
Method Return:
True if image present, false if not.

3.5.2.5.6 Get image data - getImageData

This method returns the current image data resource.

Method Definition:
public JdlImageData getImageData()
Parameters List:
none
Method Return:
Returns the current JdlImageData object.

3.5.2.5.7 Get 'ax1' pixel scaling factor - getScalingFactorAx1

Returns the current image scaling factor for the display along the first local axis i.e. number of displayed pixels per image pixel if the image has been expanded or 1/(current compression factor) if the image is currently compressed.

Method Definition:
public double getScalingFactorAx1()
Parameters List:
none
Method Return:
The scaling factor (>1 if image expanded, 1 if one pixel displayed for each image pixel or <1 if more than one image pixel compressed into one image display pixel)

3.5.2.5.8 Get 'ax2' pixel scaling factor - getScalingFactorAx2

Returns the current image scaling factor for the display along the second local axis i.e. number of displayed pixels per image pixel if the image has been expanded or 1/(current compression factor) if the image is currently compressed.

Method Definition:
public double getScalingFactorAx2()
Parameters List:
none
Method Return:
The scaling factor (>1 if image expanded, 1 if one pixel displayed for each image pixel or <1 if more than one image pixel compressed into one image display pixel)

3.5.2.6 Add Overlay Data

3.5.2.6.1 Introduction

This section has methods to draw symbols, lines or text on top of the image display. There are some specific methods for drawing sets of symbols for found and predicted spots based on spot list objects in the Jdl.JdlPX package. There is also a method to set/clear a symbol marking the image centre.

Methods:

Mark/unmark centre - markCentre
Add overlay symbol - addSymbol
Clear overlay symbols - clearSymbols
Delete an overlay symbol - deleteSymbol
Delete overlay symbols - deleteSymbols
Add an overlay vector. - addVector
Add overlay vectors - addVectors
Add overlay vectors - addVectorsPos
Add overlay boxes - addBoxes
Clear overlay vectors - clearVectors
Delete overlay vector - deleteVector
Draw overlay text - addText
Clear text overlays - clearText
Delete a text overlay - deleteText

3.5.2.6.2 Mark/unmark centre - markCentre

This method marks or removes the mark for the current centre position if set (any existing marked centre will be removed before another is drawn).

Method Definition:
public void markCentre(Color colr, int ov_num, boolean mark)
Parameters List:
color
Overlay colour.
ov_num
Overlay number 1 or 2.
mark
If true mark the centre, if false remove the centre mark.

3.5.2.6.3 Add overlay symbol - addSymbol

This method outputs an overlay symbol.

Method Definition:
public void addSymbol (int symb_id, int ax1_pixel, int ax2_pixel, int symbol, Color color, int ov_num, boolean img_upd)
Parameters List:
symb_id
User selected number to identify the symbol (0-1000000 - other numbers reserved). The same number may be used for more than one symbol to identify a group of symbols e.g. for deleting them.
ax1_pixel
The local axis 1 pixel position (from 1 up - refers to complete uncompressed image).
ax2_pixel
The local axis 2 pixel position
symbol
The symbol type:
= 1 to 10, vertical cross - increasing size 1 to 19 pixels in steps of 2
= 11 to 20, cross - increasing size 1 to 19 pixels height in steps of 2
= 21 to 30, square - increasing size 1 to 19 pixels in steps of 2
Note: 1, 11 and 21 are single points.
color
Overlay colour.
ov_num
Overlay number 1 or 2.
img_upd
=true Update the image & magnifying window after drawing the symbol; this should be used when a single symbol is drawn or when the final symbol of a series of symbols is drawn, =false Do not; this enables a series of symbols to be drawn much more rapidly; it should be used when a series of symbols is to be drawn for all but the final symbol.

3.5.2.6.4 Clear overlay symbols - clearSymbols

Clears all the current overlay symbols from the image display and clears the stored list of symbols.

Method Definition:
public void clearSymbols()
Parameters List:
none

3.5.2.6.5 Delete an overlay symbol - deleteSymbol

Deletes an overlay symbol from the image display and the stored overlay symbols list. This version of the method is for a symbol at a specific known position.

Method Definition:
public void deleteSymbol (int symb_id, int ax1_pixel, int ax2_pixel, int symbol, Color color, int ov_num)
Parameters List:
symb_id
If >=0, then only delete the symbol if it matches this id. If <0, then ignore this check.
ax1_pixel
Local axis 1 pixel position of the symbol (from 1 up - refers to complete uncompressed image).
ax2_pixel
Local axis 2 pixel position of the symbol (from 1 up - refers to complete uncompressed image).
symbol
If > 0 then only delete the symbol if it is of the type 'symbol' (see the 'symbol' method for details of symbol types).
color
If != null then only delete the symbol if it is of the colour 'color'.
ov_num
If > 0 then only delete the symbol if it is of the overlay number ov_num (1 or 2).

3.5.2.6.6 Delete overlay symbols - deleteSymbols

Deletes an overlay symbol or symbols from the image display and the stored overlay symbols list. The symbols to be deleted are identified by the symbol id's.

Method Definition:
public void deleteSymbols (int symb_id)
Parameters List:
symb_id
The id of the symbol(s) to be deleted.

3.5.2.6.7 Add an overlay vector. - addVector

Draw an overlay vector (line) on the image.

Method Definition:
public void addVector (int vect_id, int ax1_1_pixel, int ax2_1_pixel, int ax1_2_pixel, int ax2_2_pixel, Color color, int ov_num, boolean img_upd)
Parameters List:
vect_id
User selected number to identify vector (0-1000000 - other numbers reserved). The same number may be used for more than one vector to identify a group of vectors.
ax1_1_pixel
The vector start local axis 1 pixel position (from 1 up - refers to complete uncompressed image.
ax2_1_pixel
The vector start local axis 2 pixel position.
ax1_2_pixel
The vector end local axis 1 pixel position.
ax2_2_pixel
The vector end local axis 2 pixel position.
color
Overlay colour.
ov_num
Overlay number 1 or 2.
img_upd
=true Update the image & magnifying window after drawing the vector; this should be used when a single vector is drawn or when the final vector of a series of vectors is drawn, =false Do not; this enables a series of vectors to be drawn much more rapidly; it should be used when a series of vectors is to be drawn for all but the final vector.

3.5.2.6.8 Add overlay vectors - addVectors

Draw a set of overlay vectors (lines) on the image. If many vectors are to be added, this will be more efficient than adding individual vectors using the addVector(..) method above.

Method Definition:
public void addVectors (int vect_id, int nvect, int ax1_1_pixel[], int ax2_1_pixel[], int ax1_2_pixel[], int ax2_2_pixel[], Color color, int ov_num)
Parameters List:
vect_id
User selected number to identify vector (0-1000000 - other numbers reserved). The same number may be used for more than one vector or set of vectors to identify a group of vectors.
nvect
Number of vectors to be added
ax1_1_pixel
The vector start local axis 1 pixel positions (from 1 up - refers to complete uncompressed image (array of nvect values).
ax2_1_pixel
The vector start local axis 2 pixel positions (array of nvect values).
ax1_2_pixel
The vector end local axis 1 pixel positions (array of nvect values).
ax2_2_pixel
The vector end local axis 2 pixel positions (array of nvect values).
color
Overlay colour.
ov_num
Overlay number 1 or 2.

3.5.2.6.9 Add overlay vectors - addVectorsPos

Draw a set of overlay vectors (lines) on the image. If many vectors are to be added, this will be more efficient than adding individual vectors using the addVector method. In contrast to the previous addVector(..) and addVectors(..) methods, this method allows additional options for positioning the ends of the vector with respect to the displayed pixel which may be useful when an image is zoomed.

Method Definition:
public void addVectorsPos (int vect_id, int nvect, int ax1_1_pixel[], int ax2_1_pixel[], int ax1_2_pixel[], int ax2_2_pixel[], int ax1_1_pos[], int ax2_1_pos[], int ax1_2_pos[], int ax2_2_pos[], Color color, int ov_num, boolean repaint)
Parameters List:
vect_id
User selected number to identify vector (0-1000000 - other numbers reserved). The same number may be used for more than one vector or set of vectors to identify a group of vectors.
num_vect
Number of vectors to be added.
ax1_1_pixel
The vector start local axis 1 pixel positions (from 1 up - refers to complete uncompressed image (array of nvect values).
ax2_1_pixel
The vector start local axis 2 pixel positions (array of nvect values).
ax1_2_pixel
The vector end local axis 1 pixel positions (array of nvect values).
ax2_2_pixel
The vector end local axis 2 pixel positions (array of nvect values).
ax1_1_pos
Position option flags for local axis 1 start pixels (array of nvect values):
= -1, Low side of displayed pixel
= +1, High side of displayed pixel
= -2, Just outside low side
= +2, Just outside high side
ax2_1_pos
Position option flags for local axis 2 start pixels (array of nvect values):
= -1, Low side of displayed pixel
= +1, High side of displayed pixel
= -2, Just outside low side
= +2, Just outside high side
ax1_1_pos
Position option flags for local axis 1 end pixels (array of nvect values):
= -1, Low side of displayed pixel
= +1, High side of displayed pixel
= -2, Just outside low side
= +2, Just outside high side
ax2_1_pos
Position option flags for local axis 2 end pixels (array of nvect values):
= -1, Low side of displayed pixel
= +1, High side of displayed pixel
= -2, Just outside low side
= +2, Just outside high side
color
Overlay colour.
ov_num
Overlay number 1 or 2.

3.5.2.6.10 Add overlay boxes - addBoxes

Draw a set of overlay boxes surrounding sets of pixels on the image. The method saves each box as a set of vectors (see also addVectorsPos(..). The user supplies a vector identifier set number for the box vectors and this is used to identify the set of vectors for deletion if required.

Method Definition:
public void addBoxes (int vect_id, int num_box, int ax1_1_pixel[], int ax2_1_pixel[], int ax1_2_pixel[], int ax2_2_pixel[], int pos, Color color, int ov_num, boolean magw_upd)
Parameters List:
vect_id
User selected number to identify vector (0-1000000 - other numbers reserved). The same number may be used for more than one vector or set of vectors to identify a group of vectors.
num_box
Number of boxes to be added.
ax1_1_pixel
The vector start local axis 1 pixel positions (from 1 up - refers to complete uncompressed image (array of num_box values).
ax2_1_pixel
The vector start local axis 2 pixel positions (array of num_box values).
ax1_2_pixel
The vector end local axis 1 pixel positions (array of num_box values).
ax2_2_pixel
The vector end local axis 2 pixel positions (array of num_box values).
pos
Position flag:
= 1, Position just within pixel boundaries
= 2, Position just outside pixel boundaries
color
Overlay colour.
ov_num
Overlay number 1 or 2.
magw_upd
= true Update the magnifying window after drawing the boxes; this should be used when all the required boxes have been defined, =false Do not.

3.5.2.6.11 Clear overlay vectors - clearVectors

Clear all the current overlay vectors from the image display and clear the stored list of vectors.

Method Definition:
public void clearVectors()
Parameters List:
none

3.5.2.6.12 Delete overlay vector - deleteVector

Delete an overlay vector or group of vectors.

Method Definition:
public void deleteVector (int vect_id)
Parameters List:
vect_id
The vector id of the vector or group of vectors to be deleted.

3.5.2.6.13 Draw overlay text - addText

This method draws an overlayed text string on the image.

Method Definition:
public void addText (int text_id, int ax1_pixel, int ax2_pixel, String string, Color color, Font font, int ov_num)
Parameters List:
text_id
User selected text string identifier (used to identify a string or set of strings for deletion) (0-20000).
ax1_pixel
Pixel position wrt. local axis 1 for start of text string output.
ax2_pixel
Pixel position wrt. local axis 2 for start of text string output.
string
The text string.
color
Overlay colour.
font
Font for required font.
ov_num
Overlay number 1 or 2.

3.5.2.6.14 Clear text overlays - clearText

Clear all overlay text strings from the image display and from the stored list of overlay text strings.

Method Definition:
public void clearText()
Parameters List:
none

3.5.2.6.15 Delete a text overlay - deleteText

Delete an overlay text string from the image display and from the stored list of overlay text strings.

Method Definition:
public void deleteText (int text_id)
Parameters List:
text_id
The text identifier of the string or set of strings to be removed.

3.5.2.7 Found Spots List

3.5.2.7.1 Introduction

This section has methods to set or get details of a list of found spots for the current image and to display/remove symbols at the found spot positions.

Methods:

Set found spots list - setFoundSpotsList
Show found spots - showFoundSpots
Clear found spots - removeFoundSpots
Return found spots list - getFoundSpotsList
Found spots list present - foundSpotsListPresent

3.5.2.7.2 Set found spots list - setFoundSpotsList

This method sets a list of found spots for the image.

Method Definition:
public void setFoundSpotsList(JdlSearchImageSpotsList spotlist)
Parameters List:
spotlist
The JdlSearchImageSpotsList spots list (a reference to the list will be stored). Any currently displayed spot list symbols will be removed. If null, any stored spots list will be removed. The spot list will also be removed if a new image is input.

3.5.2.7.3 Show found spots - showFoundSpots

Display symbols for the currently stored found spots list if present. JdlSearchImageSpotsList.

Method Definition:
public void showFoundSpots(int symbol, Color color, int symb_bad, Color colr_bad, int ov_num)
Parameters List:
symbol
The symbol type:
= 1 to 10, vertical cross - increasing size 1 to 19 pixels in steps of 2
= 11 to 20, cross - increasing size 1 to 19 pixels height in steps of 2
= 21 to 30, square - increasing size 1 to 19 pixels in steps of 2
Note: 1, 11 and 21 are single points.
color
Overlay colour.
symb_bad
The symbol type for bad spots (=0 if not to be displayed)
colr_bad
Overlay colour for bad spots.
ov_num
Overlay number 1 or 2.

3.5.2.7.4 Clear found spots - removeFoundSpots

This method clears the symbols for any found spots displayed using the showFoundSpots(..) method.

Method Definition:
public void removeFoundSpots()
Parameters List:
none

3.5.2.7.5 Return found spots list - getFoundSpotsList

This method returns a reference to the currently stored found spots list.

Method Definition:
public JdlSearchImageSpotsList getFoundSpotsList()
Parameters List:
none
Method Return:
The currently stored JdlSearchImageSpotsList object (null if none)

3.5.2.7.6 Found spots list present - foundSpotsListPresent

This method tests whether or not there is a found spots list currently stored.

Method Definition:
public boolean foundSpotsListPresent()
Parameters List:
none
Method Return:
True if found spots list stored, false if not.

3.5.2.8 Set Special User Options

3.5.2.8.1 Introduction

This section has methods to set a user defined colour map or additional user options to be integrated into the display.

Methods:

Set user colour map - setColormap
Get number of colours - getNumberOfColours
Set user defined options - setUserOptions

3.5.2.8.2 Set user colour map - setColormap

This method sets the 'ncolor' colours for a new user defined colour map to be used for the image display when the user defined colour map option has been selected. The order of the defined colours if from low image pixel values to high image pixel values. The current value for 'ncolor' may be found using the getNumberOfColours(..) method.

Method Definition:
public void setColormap (int red[], int green[], int blue[])
Parameters List:
red[]
'ncolor' Red components 0 to 255.
green[]
'ncolor' Green components 0 to 255.
blue[]
'ncolor' Blue components 0 to 255.

3.5.2.8.3 Get number of colours - getNumberOfColours

Returns the number of colours required for a user defined colour map.

Method Definition:
public int getNumberOfColours()
Parameters List:
none
Method Return:
The number of colours required.

3.5.2.8.4 Set user defined options - setUserOptions

This method passed a JdlPXImageUserOptions object which contains additional functions to be made available from within the JdlPXImage object. An example is the Protein Crystallography JdlIPDispOptions object. Note that any DDM parameters, that the object uses and that have been set prior to calling this method, will be used as the current values and updated in the JdlPXImage's internal JdlDiffractionDataModule object.

Method Definition:
public void setUserOptions(JdlPXImageUserOptions opts)
Parameters List:
opt
A user options object.

3.5.2.9 Set and Get Resources

3.5.2.9.1 Introduction

This section contains methods to set and get values for a series of resources associated with the image display.

Methods:

Get DDM reference - getDDM
Set axis 1 name - setIX1Name
Get axis 1 name. - getIX1Name
Set axis 2 name - setIX2Name
Get axis 2 name - getIX2Name
Set background option - setImageBackgroundOption
Get background option - getImageBackgroundOption
Set colour option - setColorOption
Get colour option - getColorOption
Set contrast - setContrastvalue
Get contrast - getContrastValue
Set display order - setDisplayOrder
Set display order - setPictureDisplayOrder
Get display order - getDisplayOrder
Get display order - getPictureDisplayOrder
Get image centre - getImageCentre
Set shadow thickness - setImageShadowThickness
Get shadow thickness - getImageShadowThickness
Set top margin - setImageTopMargin
Get top margin - getImageTopMargin
Set intensities font - setIntensitiesFont
Get intensities font - getIntensitiesFont
Set keep zoom - setKeepZoom
Get keep zoom - getKeepZoom
Set labels font - setLabelsFont
Get labels font - getLabelsFont
Set magnification factor - setMagnificationFactor
Get magnification factor - getMagnificationFactor
Set maximum threshold - setMaximumThreshold
Get maximum threshold - getMaximumThreshold
Set minimum threshold - setMinimumThreshold
Get minimum threshold - getMinimumThreshold
Set overlay option - setOverlayOption
Get overlay option - getOverlayOption
Set overlay type - setOverlayType
Get overlay type - getOverlayType
Set intensities option - setShowIntensities
Get intensities option - getShowIntensities
Set surround thickness - setSurroundThickness
Get surround thickness - getSurroundThickness
Set thresholds font - setThresholdsFont
Get thresholds font - getThresholdsFont
Set overlay 'x' offset - setXOverlayOffset
Get overlay 'x' offset - getXOverlayOffset
Set overlay 'y' offset - setYOverlayOffset
Get overlay 'y' offset - getYOverlayOffset
Set background parameters - setBgCalcParameters
Get background compression - getBackgroundCompression
Get background box - getBackgroundBox
Get background percent - getBackgroundPercent

3.5.2.9.2 Get DDM reference - getDDM

This method returns a reference to the internal JdlDiffractionDataModule object which may be used to share its parameters between sets of added user options. Note that the following image based parameters must NOT be SET directly using this object: IMAGE_DATA, AXORD, NXRASTS, NYRASTS, NULL_PIXEL, PIX_X, PIX_Y; these must only be set via an input JdlImageData object. Also the IX1_NAME and IX2_NAME parameters should not be set directly but may be set using the setIX1Name(..) and IX2Name(..) methods if required. These restrictions also apply to any objects implementing the JdlPXImageUserOptions interface.

Method Definition:
public JdlDiffractionDataModule getDDM()
Parameters List:
none
Method Return:
The reference to the DDM object.

3.5.2.9.3 Set axis 1 name - setIX1Name

This method sets the image local axis 1 name string resource.

Method Definition:
public void setIX1Name(String str)
Parameters List:
str
The required label string (default = "xd"). Maximum length is 4 characters.

3.5.2.9.4 Get axis 1 name. - getIX1Name

This method returns the image local axis 1 name string resource.

Method Definition:
public String getIX1Name()
Parameters List:
none
Method Return:
Returns the image axis label string.

3.5.2.9.5 Set axis 2 name - setIX2Name

This method sets the image local axis 2 name string resource.

Method Definition:
public void setIX2Name(String str)
Parameters List:
str
The required label string (default = "yd"). Maximum length is 4 characters.

3.5.2.9.6 Get axis 2 name - getIX2Name

This method returns the image local axis 2 name string resource.

Method Definition:
public String getIX2Name()
Parameters List:
none
Method Return:
Returns the image axis label string.

3.5.2.9.7 Set background option - setImageBackgroundOption

This method sets the background image option resource.

Method Definition:
public void setImageBackgroundOption(int bgopt)
Parameters List:
bgopt
The required backgound option type:
= 0, background included (default)
= 1, background subtracted
= 2, background only
(IMAGE_BACKGROUND_INCLUDED, IMAGE_BACKGROUND_EXCLUDED, IMAGE_BACKGROUND_ONLY)

3.5.2.9.8 Get background option - getImageBackgroundOption

This method returns the image background option resource.

Method Definition:
public int getImageBackgroundOption()
Parameters List:
none
Method Return:
Returns background option type:
= 0, background included
= 1, background subtracted
= 2, background only
(IMAGE_BACKGROUND_INCLUDED,IMAGE_BACKGROUND_EXCLUDED, IMAGE_BACKGROUND_ONLY)

3.5.2.9.9 Set colour option - setColorOption

This method sets the colour option resource.

Method Definition:
public void setColorOption(int copt)
Parameters List:
copt
The required colour option type:
= 1, black on white (dedault)
= 2, white on black
= 3, user defined colours
(IMAGE_COLOR_BW, IMAGE_COLOR_WB, IMAGE_COLOR_USER)

3.5.2.9.10 Get colour option - getColorOption

This method returns the colour option resource.

Method Definition:
public int getColorOption()
Parameters List:
none
Method Return:
Returns colour option type:
= 1, black on white
= 2, white on black
= 3, user defined colours
(IMAGE_COLOR_BW, IMAGE_COLOR_WB, IMAGE_COLOR_USER)

3.5.2.9.11 Set contrast - setContrastvalue

This method sets the contrast value resource.

Method Definition:
public void setContrastvalue (int cval)
Parameters List:
cval
The contrast value 0-1023 (default = 1023).

3.5.2.9.12 Get contrast - getContrastValue

This method returns the contrast value resource.

Method Definition:
public int getContrastValue()
Parameters List:
none
Method Return:
Returns the contrast value 0-1023.

3.5.2.9.13 Set display order - setDisplayOrder

This method sets the display order resource for a diffraction image.

Method Definition:
public void setDisplayOrder (int jord)
Parameters List:
jord
The display order:
= 1, +ax1 X (horiz) +ax2 Y (vert)
= 2, +ax1 X (horiz) -ax2 Y (vert)
= 3, -ax1 X (horiz) +ax2 Y (vert)
= 4, -ax1 X (horiz) -ax2 Y (vert)
= 5, +ax2 X (horiz) +ax1 Y (vert)
= 6, +ax2 X (horiz) -ax1 Y (vert)
= 7, -ax2 X (horiz) +ax1 Y (vert)
= 8, -ax2 X (horiz) -ax1 Y (vert)

3.5.2.9.14 Set display order - setPictureDisplayOrder

This method sets the display order resource for a picture image.

Method Definition:
public void setPictureDisplayOrder (int jord)
Parameters List:
jord
The display order (normally 1):
= 1, +ax1 X (horiz) +ax2 Y (vert)
= 2, +ax1 X (horiz) -ax2 Y (vert)
= 3, -ax1 X (horiz) +ax2 Y (vert)
= 4, -ax1 X (horiz) -ax2 Y (vert)
= 5, +ax2 X (horiz) +ax1 Y (vert)
= 6, +ax2 X (horiz) -ax1 Y (vert)
= 7, -ax2 X (horiz) +ax1 Y (vert)
= 8, -ax2 X (horiz) -ax1 Y (vert)

3.5.2.9.15 Get display order - getDisplayOrder

This method returns the display order resource for a diffraction image.

Method Definition:
public int getDisplayOrder()
Parameters List:
none
Method Return:
The display order (1-8) (see setDisplayOrder(..) for details).

3.5.2.9.16 Get display order - getPictureDisplayOrder

This method returns the display order resource for a picture image.

Method Definition:
public int getPictureDisplayOrder()
Parameters List:
none
Method Return:
The display order (1-8) (see setPictureDisplayOrder(..) for details).

3.5.2.9.17 Get image centre - getImageCentre

This method returns the image centre (mid_point).

Method Definition:
public JdlXY getImageCentre()
Parameters List:
none
Method Return:
The image centre in rasters along ax1 (JdlXY.x) and along ax2 (JdlXY.y).

3.5.2.9.18 Set shadow thickness - setImageShadowThickness

This method sets the image shadow thickness resource.

Method Definition:
public void setImageShadowThickness(int th)
Parameters List:
th
Shadow thickness for image and magnifying window frames (default = 4).

3.5.2.9.19 Get shadow thickness - getImageShadowThickness

This method returns the image shadow thickness resource.

Method Definition:
public int getImageShadowThickness()
Parameters List:
none
Method Return:
Returns the image shadow thickness.

3.5.2.9.20 Set top margin - setImageTopMargin

This method sets the image top margin resource.

Method Definition:
public void setImageTopMargin(int th)
Parameters List:
th
Top margin thickness between separator and top of image frame area (default = 6).

3.5.2.9.21 Get top margin - getImageTopMargin

This method returns the image top margin resource.

Method Definition:
public int getImageTopMargin()
Parameters List:
none
Method Return:
Returns the image top margin.

3.5.2.9.22 Set intensities font - setIntensitiesFont

This method sets the intensities font resource.

Method Definition:
public void setIntensitiesFont (Font font)
Parameters List:
font
The required font for the pixel intensities on a zoomed image (Default = null for same as thresholds font) - a fixed width font is recommended.

3.5.2.9.23 Get intensities font - getIntensitiesFont

This method returns the intensities font resource.

Method Definition:
public Font getIntensitiesFont()
Parameters List:
none
Method Return:
Returns the intensities font.

3.5.2.9.24 Set keep zoom - setKeepZoom

This method sets the keep zoom resource.

Method Definition:
public void setKeepZoom (boolean zoom)
Parameters List:
zoom
Keep zoom state if new image input (provided it has the same size etc.)
= true, yes
= false, (the default) reset to un-zoomed on new image

3.5.2.9.25 Get keep zoom - getKeepZoom

This method returns the keep zoom resource.

Method Definition:
public boolean getKeepZoom ()
Parameters List:
none
Method Return:
Returns the value of the keep zoom resource.

3.5.2.9.26 Set labels font - setLabelsFont

This method sets the labels font resource.

Method Definition:
public void setLabelsFont (Font font)
Parameters List:
font
The required font for the label (parameter name) (Default = JdlResources bold text font).

3.5.2.9.27 Get labels font - getLabelsFont

This method returns the labels font resource.

Method Definition:
public Font getLabelsFont()
Parameters List:
none
Method Return:
Returns the current labels font.

3.5.2.9.28 Set magnification factor - setMagnificationFactor

This method sets the magnification factor option.

Method Definition:
public void setMagnificationFactor (int mag)
Parameters List:
mag
The magnification factor option for the magnifying window 1-7 default = 3 (1=x2, 2=x3, 3=x4, 4=x5, 5=x6, 6=x7, 7=x8).

3.5.2.9.29 Get magnification factor - getMagnificationFactor

This method returns the magnification factor option.

Method Definition:
public int getMagnificationFactor()
Parameters List:
none
Method Return:
Returns the magnification factor option 1-7.

3.5.2.9.30 Set maximum threshold - setMaximumThreshold

This method sets the maximum threshold resource.

Method Definition:
public void setMaximumThreshold (int thr)
Parameters List:
thr
The maximum threshold for the image display.

3.5.2.9.31 Get maximum threshold - getMaximumThreshold

This method returns the maximum threshold resource.

Method Definition:
public int getMaximumThreshold()
Parameters List:
none
Method Return:
Returns the maximum threshold value.

3.5.2.9.32 Set minimum threshold - setMinimumThreshold

This method sets the minimum threshold resource.

Method Definition:
public void setMinimumThreshold (int thr)
Parameters List:
thr
The minimum threshold for the image display (default = 0).

3.5.2.9.33 Get minimum threshold - getMinimumThreshold

This method returns the minimum threshold resource.

Method Definition:
public int getMinimumThreshold()
Parameters List:
none
Method Return:
Returns the minimum threshold value.

3.5.2.9.34 Set overlay option - setOverlayOption

This method sets the overlay option resource.

Method Definition:
public void setOverlayOption (int ovly)
Parameters List:
ovly
The overlay option 1-4:
= 1, on (default)
= 2, off
= 3, offset
or:
= 3, only overlay 1 on
= 4, only overlay 2 on
see setOverlayType(..)

3.5.2.9.35 Get overlay option - getOverlayOption

This method returns the overlay option resource.

Method Definition:
public int getOverlayOption()
Parameters List:
none
Method Return:
Returns the overlay option 1-4.

3.5.2.9.36 Set overlay type - setOverlayType

This method sets the overlay type resource.

Method Definition:
public void setOverlayType (int ov)
Parameters List:
ov
The overlay type 1-2 (default = 1):
= 1, on/off/offset = 2, on/off/ov1_on/ov2_on.

3.5.2.9.37 Get overlay type - getOverlayType

This method returns the overlay type resource.

Method Definition:
public int getOverlayType()
Parameters List:
none
Method Return:
Returns the overlay type 1-2.

3.5.2.9.38 Set intensities option - setShowIntensities

This method sets the show intensities resource.

Method Definition:
public void setShowIntensities (boolean flag)
Parameters List:
flag
Option to show pixel intensities on a highly zoomed image:
= true, yes (the default)
= false, do not

3.5.2.9.39 Get intensities option - getShowIntensities

This method returns the show intensities resource.

Method Definition:
public boolean getShowIntensities ()
Parameters List:
none
Method Return:
Returns the show intensities option flag (true or false).

3.5.2.9.40 Set surround thickness - setSurroundThickness

This method sets the surround thickness resource.

Method Definition:
public void setSurroundThickness(int th)
Parameters List:
th
Surround border thickness added to the minimum requirements for the layout (default = 6).

3.5.2.9.41 Get surround thickness - getSurroundThickness

This method returns the surround thickness resource.

Method Definition:
public int getSurroundThickness()
Parameters List:
none
Method Return:
Returns the surround thickness.

3.5.2.9.42 Set thresholds font - setThresholdsFont

This method sets the thresholds font resource.

Method Definition:
public void setThresholdsFont (Font font)
Parameters List:
font
The required font for the minimum and maximum threshold items (Default is the JdlViewManager fixed font) - a fixed width font is recommended.

3.5.2.9.43 Get thresholds font - getThresholdsFont

This method returns the thresholds font resource.

Method Definition:
public Font getThresholdsFont()
Parameters List:
none
Method Return:
Returns the thresholds font.

3.5.2.9.44 Set overlay 'x' offset - setXOverlayOffset

This method sets the X overlay offset resource.

Method Definition:
public void setXOverlayOffset (int offset)
Parameters List:
offset
The offset in 'x' in pixels for an offset overlay (default = -4).

3.5.2.9.45 Get overlay 'x' offset - getXOverlayOffset

This method returns the X overlay offset resource.

Method Definition:
public int getXOverlayOffset ()
Parameters List:
none
Method Return:
Returns the 'x' overlay offset.

3.5.2.9.46 Set overlay 'y' offset - setYOverlayOffset

This method sets the Y overlay offset resource.

Method Definition:
public void setYOverlayOffset (int offset)
Parameters List:
offset
The offset in 'y' in pixels for an offset overlay (default = 4).

3.5.2.9.47 Get overlay 'y' offset - getYOverlayOffset

This method returns the Y overlay offset resource.

Method Definition:
public int getYOverlayOffset ()
Parameters List:
none
Method Return:
Returns the 'y' overlay offset.

3.5.2.9.48 Set background parameters - setBgCalcParameters

Set parameters for control of background image calculations.

Method Definition:
public void setBgCalcParameters(int bg_cmp_start, int npbox, int percent)
Parameters List:
bg_cmp_start
Background image compression factor to use in calculation of the background image.
npbox
Number of pixels dimension for background image calculation box size.
percent
Percentage of box pixels to take as background.

3.5.2.9.49 Get background compression - getBackgroundCompression

Get the compression factor to be used in calculating a background image.

Method Definition:
public int getBackgroundCompression()
Parameters List:
none
Method Return:
The compression factor.

3.5.2.9.50 Get background box - getBackgroundBox

Get background calculation box dimension in pixels.

Method Definition:
public int getBackgroundBox()
Parameters List:
none
Method Return:
The box dimension

3.5.2.9.51 Get background percent - getBackgroundPercent

Get the percentage of pixels in a box to be considered as background when calculatiing a background image.

Method Definition:
public int getBackgroundPercent()
Parameters List:
none
Method Return:
The percentage of background pixels.

3.5.2.10 Standard Positioning and Sizing

3.5.2.10.1 Introduction

This section contains the standard methods for positioning and sizing JdlView objects and getting the current minimum height and width values.

Methods:

Set position constraints - setLocationConstraints
Set size constraints - setSizeConstraints
Set minimum height - setMinimumHeight
Set minimum width - setMinimumWidth

3.5.2.10.2 Set position constraints - setLocationConstraints

Set constraints on the Jdl object positioning.

Method Definition:
public void setLocationConstraints (int constraint_x, int constraint_y)
Parameters List:
constraint_x
Constrain the Jdl Object 'x' position = the required Jdl Object 'x' position (overrides setLocation method) or FREE if the 'x' position may be set by the setLocation method and hence possibly by the layout manager.
constraint_y
Constrain the Jdl Object 'y' position = the required the Jdl Object 'y'position (overrides setLocation method) or FREE if the 'y' position may be set by the setLocation method and hence possibly by the layout manager.

3.5.2.10.3 Set size constraints - setSizeConstraints

Set constraints on the Jdl Object resizing permitted.

Method Definition:
public void setSizeConstraints (int constraint_w, int constraint_h)
Parameters List:
constraint_w
Constrain the Jdl Object width = the required Jdl Object width, or PREFERRED (default) if the width is to be calculated from the current resources, or FREE if the width may be resized to anything greater than the minimum width required.
constraint_h
Constrain the Jdl Object height = the required Jdl Object height, or PREFERRED (default) if the height is to be calculated from the current resources, or FREE if the height may be resized to anything greater than the minimum height required.

3.5.2.10.4 Set minimum height - setMinimumHeight

Set the minimum height resource.

Method Definition:
public void setMinimumHeight(int minh)
Parameters List:
minh
The minimum height required for the object (ignored if less than that required by the minimum layout) (default = 0).

3.5.2.10.5 Set minimum width - setMinimumWidth

Set the minimum width resource.

Method Definition:
public void setMinimumWidth(int minw)
Parameters List:
minh
The minimum width required for the object (ignored if less than that required by the minimum layout) (default = 0).

3.5.2.11 Add/Remove Action Listener

3.5.2.11.1 Introduction

This section has methods to add or remove an action listener.

Methods:

Add action listener - addActionListener
Remove action listener - removeActionListener

3.5.2.11.2 Add action listener - addActionListener

This adds the specified action listener to receive action events from this object.

Method Definition:
public void addActionListener(ActionListener listener)
Parameters List:
listener
The action listener to be added.

3.5.2.11.3 Remove action listener - removeActionListener

This removes the specified action listener so that it no longer receives action events from this object.

Method Definition:
public void removeActionListener(ActionListener listener)
Parameters List:
listener
The action listener to be removed.

3.5.2.12 Get Returned Data

3.5.2.12.1 Introduction

This section has methods to get data from the object relating to an action and following that action.

Methods:

Get mouse position - getPosition
Get last user options - getLastDisplayedUserOptions
Get last command string - getReturnedCommand

3.5.2.12.2 Get mouse position - getPosition

Get selected mouse position data from an action event.

Method Definition:
public JdlImagePosition getPosition()
Parameters List:
none
Method Return:
Returns the position data in a JdlImagePosition object.

3.5.2.12.3 Get last user options - getLastDisplayedUserOptions

This method returns a reference to the last user defined options object which has been displayed.

Method Definition:
public JdlPXImageUserOptions getLastDisplayedUserOptions()
Parameters List:
none
Method Return:
A reference to the object or null if none has been displayed.

3.5.2.12.4 Get last command string - getReturnedCommand

This method returns the command string from the last action command.

Method Definition:
public String getReturnedCommand()
Parameters List:
none
Method Return:
The action command string (null if no actions yet delivered).

3.5.2.13 Overriden Superclass Methods

3.5.2.13.1 Introduction

This section contains methods which override the corresponding superclass methods. These are basically standard for JdlView objects and comprise methods to set background and foreground colours and to get the minimum and preferred sizes for the object. (The paintComponent and setSize methods are also over-ridden but they are not normally called by the user).

Methods:

Set background - setBackground
Set background colours - setBackground
Set foreground - setForeground
Get minimum size - getMinimumSize
Get preferred size - getPreferredSize

3.5.2.13.2 Set background - setBackground

This method sets the background colour resource.

Method Definition:
public void setBackground (Color c)
Parameters List:
c
The color to become this object's background color.

3.5.2.13.3 Set background colours - setBackground

This method sets the background colour resource and brighter and darker shades of that colour (e.g. for 3-D frames).

Method Definition:
public void setBackground (Color c, Color brighter, Color darker)
Parameters List:
c
The background colour.
brighter
A brighter shade of the background colour.
darker
A darker shade of the background colour.

3.5.2.13.4 Set foreground - setForeground

This method sets the foreground colour resource.

Method Definition:
public void setForeground (Color c)
Parameters List:
c
The color to become this object's foreground color.

3.5.2.13.5 Get minimum size - getMinimumSize

This method returns the minimum size of the component.

Method Definition:
public Dimension getMinimumSize()
Parameters List:
none

3.5.2.13.6 Get preferred size - getPreferredSize

This method returns the preferred size of the component.

Method Definition:
public Dimension getPreferredSize()
Parameters List:
none

⇑ Up 3   ⇑ Up 2   ⇑ Up 1   ⇑ Top of this