Package gov.nih.mipav.view
Class ViewJComponentBase
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
gov.nih.mipav.view.ViewJComponentBase
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable
- Direct Known Subclasses:
ViewJComponentAnimate,ViewJComponentAnimateClip,ViewJComponentColocalizationEM,ViewJComponentColocalizationRegression,ViewJComponentEditImage,ViewJComponentLUT,ViewJComponentLUTTable,ViewJComponentPreviewImage,ViewJComponentSurface
Abstract class used for displaying images in the program MIPAV.
- Version:
- 1.0 August 31, 1999
- Author:
- Matthew J. McAuliffe, Ph.D.
$Logfile: /mipav/src/gov/nih/mipav/view/ViewJComponentBase.java $ $Revision: 135 $ $Date: 1/30/06 2:25p $
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicates the MIPAV cursor is in annotation VOI modestatic final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intUsed to describe cursor mode, this means no VOIs will be drawn.static final intDOCUMENT ME!static final intThis mode is an active VOI mode used by the VOI Handlerstatic final intIndicates the MIPAV cursor is in ellipse VOI modestatic final intThis mode is an active VOI mode used by the VOI Handlerstatic final intDOCUMENT ME!static final intDOCUMENT ME!protected DimensionDOCUMENT ME!protected ImageDOCUMENT ME!protected ImageDOCUMENT ME!protected intInterpolation mode for image displaystatic final intImage interpolation only done for image Astatic final intImage interpolation only done for image Bstatic final intImage interpolation only done for both images A and Bprotected intused by the repaintPaintBrushCursorFast methodprotected intused by the repaintPaintBrushCursorFast methodstatic final intIndicates the MIPAV cursor is in levelset VOI modestatic final intIndicates the MIPAV cursor is in 2D line VOI modestatic final intIndicates the MIPAV cursor is in livewire VOI modestatic final intDOCUMENT ME!protected MemoryImageSourceDOCUMENT ME!protected MemoryImageSourceDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intDOCUMENT ME!static final intNearest neighbor interpolation applied to both imagesstatic final intDOCUMENT ME!static final intIndicates that a VOI has just been created, is not related to the various possible VOI modes that the handler deals withprotected intDOCUMENT ME!static final intIndicates the cursor is in paint can modestatic final intDOCUMENT ME!static final intIndicates the MIPAV cursor is in paint VOI modestatic final intIndicates the MIPAV cursor is in point VOI modestatic final intIndicates the MIPAV cursor is in polyline VOI modestatic final intIndicates the MIPAV cursor is in polyline slice VOI modestatic final intDOCUMENT ME!static final intThis mode is an active VOI mode used by the VOI Handlerstatic final intThis mode is used by the VOI Handler to determine whether VOIs will be drawn.static final intIndicates the MIPAV cursor is in slice rectangle VOI modestatic final intIndicates the MIPAV cursor is in volume rectangle VOI modeprotected floatresolutionX and Y are used to correct difference in intra and inter plane voxel resolution These represent the aspect ratio of the image These are NOT to be confused with the pixel resolutions.protected floatDOCUMENT ME!static final intDOCUMENT ME!static final intIndicates the VOI cursor is in translate modestatic final intDOCUMENT ME!private static final longUse serialVersionUID for interoperability.protected booleanDOCUMENT ME!protected StringDOCUMENT ME!static final intDOCUMENT ME!static final intIndicates the MIPAV cursor is in split VOI modeprotected ColorDOCUMENT ME!static final intIndicates the VOI cursor is in translate modestatic final intIndicates the cursor is in 3D voi drawing mode while in tri-planar viewstatic final intDOCUMENT ME!static final intDOCUMENT ME!static final intIndicates the cursor is in zoom in modestatic final intIndicates the cursor is in zoom out modeprotected floatDOCUMENT ME!protected floatDOCUMENT ME!Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionViewJComponentBase(int width, int height, ModelImage _imageA) creates object of size defined by width invalid input: '&' height.ViewJComponentBase(Dimension compDim) creates object of size defined by width invalid input: '&' height. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose(boolean flag) DOCUMENT ME!voidClean up some resources!protected voidfinalize()Clean up some resources!getImage()Gets the Java image.intGets the interpolation mode.intGet the x position of the last place we drew something from a mouse event.intGet the y position of the last place we drew something from a mouse event.size set to object size.floatResolution correction factor in the x - dimension.floatResolution correction factor in the y - dimension.intgetScaledX(int x) Converts the screen cursor x-coordinate to scaled version using the image's pixel resolution and zoom.intgetScaledY(int y) Converts the screen cursor y-coordinate to scaled version using the image's pixel resolution and zoom.intGets the color of the paint the user has selected from the paint toolbar.booleangetShowMagIntensityEnabled(Graphics g, int width, int height, float mag, int imageType, double minIntensity, double maxIntensity) Returns whether to enable the showIntensity checkbox for mag. boxgets the size of the object taking into account the zoom.floatgetZoomX()Magnification in the x - dimension.floatgetZoomY()Magnification in the y - dimension.voidimportImage(int[] data) Creates a Image object from an array of ints that have been formatted (packed) properly (i.e. aRGB)voidimportImageB(int[] dataB) Creates a Image object from an array of ints that have been formatted (packed) properly (i.e. aRGB) for the magnifier in image BvoidLocalToScreen(WildMagic.LibFoundation.Mathematics.Vector3f localPoint, WildMagic.LibFoundation.Mathematics.Vector3f screenPoint) LocalToScreen converts a point from local coordinates to screen coordinates.protected voidmakePaintBitmapBorder(int[] paintImageBuffer, BitSet paintBitmap, int slice, ViewJFrameBase frame) This method adds an opaque border to the painted area on-screen.protected voidmakePaintImage(int[] paintImageBuffer, BitSet paintBitmap, int slice, ViewJFrameBase frame, boolean b2D) This method creates a buffer that will be used to make an image of the painted area on-screen.voidPaints the image and border.voidpaintCursorBoxComponent(Graphics g, int xNew, int yNew, int width, int height) Paints a box over the image centered about the cursor.voidpaintWindowComponent(Graphics graphics, int xNew, int yNew, int width, int height, float mag) DOCUMENT ME!voidpaintWindowComponent(Graphics graphics, int xNew, int yNew, int width, int height, float mag, Image drawImage) Paints a image B in a window over the image centered about the cursor.voidScreenToLocal(WildMagic.LibFoundation.Mathematics.Vector3f screenPoint, WildMagic.LibFoundation.Mathematics.Vector3f localPoint) ScreenToLocal converts a point from screen coordinates to local coordinates.voidsetInterpolationMode(int mode) Sets the interpolation mode.voidsetResolutions(float rX, float rY) Sets the resolution correction factor in both x and y directions.voidsetShowSliceNumber(boolean flag) Sets whether the slice number is shown.voidsetSliceString(String str) Sets the string painted on the lower left.voidsetTextColor(Color color) Sets the text to the desired color.voidsetZoom(float zX, float zY) Sets the magnification in both x and y directions.voidsetZoomExact(float zX, float zY) Sets the magnification to exactly the zoom specified values in both x and y directions.voidCalls paint without erasing background - this reduces flicker!Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
SMOOTH
public static final int SMOOTHDOCUMENT ME!- See Also:
-
INTERPOLATE_A
public static final int INTERPOLATE_AImage interpolation only done for image A- See Also:
-
INTERPOLATE_B
public static final int INTERPOLATE_BImage interpolation only done for image B- See Also:
-
INTERPOLATE_BOTH
public static final int INTERPOLATE_BOTHImage interpolation only done for both images A and B- See Also:
-
NEAREST_BOTH
public static final int NEAREST_BOTHNearest neighbor interpolation applied to both images- See Also:
-
IMAGE_A
public static final int IMAGE_ADOCUMENT ME!- See Also:
-
IMAGE_B
public static final int IMAGE_BDOCUMENT ME!- See Also:
-
BOTH
public static final int BOTHDOCUMENT ME!- See Also:
-
DEFAULT
public static final int DEFAULTUsed to describe cursor mode, this means no VOIs will be drawn.- See Also:
-
SELECT
public static final int SELECTDOCUMENT ME!- See Also:
-
MOVE
public static final int MOVEDOCUMENT ME!- See Also:
-
RECTANGLE
public static final int RECTANGLEIndicates the MIPAV cursor is in slice rectangle VOI mode- See Also:
-
RECTANGLE3D
public static final int RECTANGLE3DIndicates the MIPAV cursor is in volume rectangle VOI mode- See Also:
-
LEVELSET
public static final int LEVELSETIndicates the MIPAV cursor is in levelset VOI mode- See Also:
-
MOVE_POINT
public static final int MOVE_POINTDOCUMENT ME!- See Also:
-
NEW_POINT
public static final int NEW_POINTDOCUMENT ME!- See Also:
-
DELETE_POINT
public static final int DELETE_POINTDOCUMENT ME!- See Also:
-
WAND
public static final int WANDDOCUMENT ME!- See Also:
-
ELLIPSE
public static final int ELLIPSEIndicates the MIPAV cursor is in ellipse VOI mode- See Also:
-
LINE
public static final int LINEIndicates the MIPAV cursor is in 2D line VOI mode- See Also:
-
POLYLINE
public static final int POLYLINEIndicates the MIPAV cursor is in polyline VOI mode- See Also:
-
NEW_VOI
public static final int NEW_VOIIndicates that a VOI has just been created, is not related to the various possible VOI modes that the handler deals with- See Also:
-
RETRACE
public static final int RETRACEDOCUMENT ME!- See Also:
-
POINT_VOI
public static final int POINT_VOIIndicates the MIPAV cursor is in point VOI mode- See Also:
-
PAINT_VOI
public static final int PAINT_VOIIndicates the MIPAV cursor is in paint VOI mode- See Also:
-
PAINT_CAN
public static final int PAINT_CANIndicates the cursor is in paint can mode- See Also:
-
DROPPER_PAINT
public static final int DROPPER_PAINTThis mode is an active VOI mode used by the VOI Handler- See Also:
-
ERASER_PAINT
public static final int ERASER_PAINTThis mode is an active VOI mode used by the VOI Handler- See Also:
-
MAG_REGION
public static final int MAG_REGIONDOCUMENT ME!- See Also:
-
WIN_REGION
public static final int WIN_REGIONDOCUMENT ME!- See Also:
-
QUICK_LUT
public static final int QUICK_LUTThis mode is used by the VOI Handler to determine whether VOIs will be drawn. A quick lut is implemented in MIPAV as a rectangle VOI- See Also:
-
PROTRACTOR
public static final int PROTRACTORThis mode is an active VOI mode used by the VOI Handler- See Also:
-
ROTATE
public static final int ROTATEIndicates the VOI cursor is in translate mode- See Also:
-
TRANSLATE
public static final int TRANSLATEIndicates the VOI cursor is in translate mode- See Also:
-
MOVE_VOIPOINT
public static final int MOVE_VOIPOINTDOCUMENT ME!- See Also:
-
CENTER_VOI
public static final int CENTER_VOIDOCUMENT ME!- See Also:
-
CUBE_BOUNDS
public static final int CUBE_BOUNDSDOCUMENT ME!- See Also:
-
LIVEWIRE
public static final int LIVEWIREIndicates the MIPAV cursor is in livewire VOI mode- See Also:
-
PAINT_VASC
public static final int PAINT_VASCDOCUMENT ME!- See Also:
-
ANNOTATION
public static final int ANNOTATIONIndicates the MIPAV cursor is in annotation VOI mode- See Also:
-
PROBE
public static final int PROBEDOCUMENT ME!- See Also:
-
MOVE_INTERSECTION_POINT
public static final int MOVE_INTERSECTION_POINTDOCUMENT ME!- See Also:
-
ZOOMING_IN
public static final int ZOOMING_INIndicates the cursor is in zoom in mode- See Also:
-
ZOOMING_OUT
public static final int ZOOMING_OUTIndicates the cursor is in zoom out mode- See Also:
-
POLYLINE_SLICE_VOI
public static final int POLYLINE_SLICE_VOIIndicates the MIPAV cursor is in polyline slice VOI mode- See Also:
-
SPLIT_VOI
public static final int SPLIT_VOIIndicates the MIPAV cursor is in split VOI mode- See Also:
-
VOI_3D
public static final int VOI_3DIndicates the cursor is in 3D voi drawing mode while in tri-planar view- See Also:
-
imageDim
DOCUMENT ME! -
img
DOCUMENT ME! -
imgB
DOCUMENT ME! -
interpMode
protected int interpModeInterpolation mode for image display -
memImageA
DOCUMENT ME! -
memImageB
DOCUMENT ME! -
resolutionX
protected float resolutionXresolutionX and Y are used to correct difference in intra and inter plane voxel resolution These represent the aspect ratio of the image These are NOT to be confused with the pixel resolutions. -
resolutionY
protected float resolutionYDOCUMENT ME! -
showSliceNumber
protected boolean showSliceNumberDOCUMENT ME! -
sliceString
DOCUMENT ME! -
textColor
DOCUMENT ME! -
zoomX
protected float zoomXDOCUMENT ME! -
zoomY
protected float zoomYDOCUMENT ME! -
OUT_OF_BOUNDS
protected int OUT_OF_BOUNDSDOCUMENT ME! -
lastMouseX
protected int lastMouseXused by the repaintPaintBrushCursorFast method -
lastMouseY
protected int lastMouseYused by the repaintPaintBrushCursorFast method
-
-
Constructor Details
-
ViewJComponentBase
creates object of size defined by width invalid input: '&' height.- Parameters:
compDim- width and height of component
-
ViewJComponentBase
creates object of size defined by width invalid input: '&' height.- Parameters:
_imageA- the image that this ViewJComponentBase is a view ofextents- the image width and height
-
-
Method Details
-
dispose
public void dispose(boolean flag) DOCUMENT ME!- Parameters:
flag- DOCUMENT ME!
-
disposeLocal
public void disposeLocal()Clean up some resources! -
getImage
Gets the Java image.- Returns:
- Java image
- See Also:
-
getInterpMode
public int getInterpMode()Gets the interpolation mode.- Returns:
- returns the interpolation mode
-
getLastMouseX
public int getLastMouseX()Get the x position of the last place we drew something from a mouse event.- Returns:
- the x coordinate of the last mouse event
-
getLastMouseY
public int getLastMouseY()Get the y position of the last place we drew something from a mouse event.- Returns:
- the y coordinate of the last mouse event
-
getPreferredSize
size set to object size.- Overrides:
getPreferredSizein classJComponent- Returns:
- dimension with the size
-
getResolutionX
public float getResolutionX()Resolution correction factor in the x - dimension.- Returns:
- correction in the x - dimension
-
getResolutionY
public float getResolutionY()Resolution correction factor in the y - dimension.- Returns:
- correction in the y - dimension
-
getScaledX
public int getScaledX(int x) Converts the screen cursor x-coordinate to scaled version using the image's pixel resolution and zoom.- Parameters:
x- the cursor's x-coordinate- Returns:
- x-coordinate in image space
-
getScaledY
public int getScaledY(int y) Converts the screen cursor y-coordinate to scaled version using the image's pixel resolution and zoom.- Parameters:
y- the cursor's y-coordinate- Returns:
- x-coordinate in image space
-
LocalToScreen
public void LocalToScreen(WildMagic.LibFoundation.Mathematics.Vector3f localPoint, WildMagic.LibFoundation.Mathematics.Vector3f screenPoint) LocalToScreen converts a point from local coordinates to screen coordinates.- Parameters:
localPoint- a 3D point, where x,y represent the point in local slice coordinates and the z value is the slice value.screenPoint- the transfromed localPoint, scaled with the image pixel resolution and zoom.
-
ScreenToLocal
public void ScreenToLocal(WildMagic.LibFoundation.Mathematics.Vector3f screenPoint, WildMagic.LibFoundation.Mathematics.Vector3f localPoint) ScreenToLocal converts a point from screen coordinates to local coordinates.- Parameters:
screenPoint- a 3D point, where x,y represent the point in local slice coordinates and the z value is the slice value. screenPoint is usually taken from the MouseEvent point.localPoint- the transfromed point in local slice coordinates. The z-value represents the current slice.
-
getShowMagIntensityEnabled
public boolean getShowMagIntensityEnabled(Graphics g, int width, int height, float mag, int imageType, double minIntensity, double maxIntensity) Returns whether to enable the showIntensity checkbox for mag. box- Parameters:
g- DOCUMENT ME!width- DOCUMENT ME!height- DOCUMENT ME!mag- DOCUMENT ME!imageType- DOCUMENT ME!minIntensity- DOCUMENT ME!maxIntensity- DOCUMENT ME!- Returns:
- whether to enable showIntensity checkbox
-
getSize
gets the size of the object taking into account the zoom.- Overrides:
getSizein classJComponent- Parameters:
wh- DOCUMENT ME!- Returns:
- dimension with the size
-
getZoomX
public float getZoomX()Magnification in the x - dimension.- Returns:
- magnificaiton in the x - dimension
-
getZoomY
public float getZoomY()Magnification in the y - dimension.- Returns:
- magnificaiton in the y - dimension
-
importImage
public void importImage(int[] data) Creates a Image object from an array of ints that have been formatted (packed) properly (i.e. aRGB)- Parameters:
data- Data (image) to be displayed that has been formatted (packed) properly (i.e. aRGB)
-
importImageB
public void importImageB(int[] dataB) Creates a Image object from an array of ints that have been formatted (packed) properly (i.e. aRGB) for the magnifier in image B- Parameters:
dataB- Data (imageB) to be displayed that has been formatted (packed) properly (i.e. aRGB)
-
paintComponent
Paints the image and border.- Overrides:
paintComponentin classJComponent- Parameters:
g- Graphics handle
-
paintCursorBoxComponent
Paints a box over the image centered about the cursor.- Parameters:
g- graphics componentxNew- x coord in imageyNew- y coord in imagewidth- width of the cursor window in pixelsheight- height of the cursor window in pixels
-
paintWindowComponent
public void paintWindowComponent(Graphics graphics, int xNew, int yNew, int width, int height, float mag) DOCUMENT ME!- Parameters:
graphics- DOCUMENT ME!xNew- DOCUMENT ME!yNew- DOCUMENT ME!width- DOCUMENT ME!height- DOCUMENT ME!mag- DOCUMENT ME!
-
paintWindowComponent
public void paintWindowComponent(Graphics graphics, int xNew, int yNew, int width, int height, float mag, Image drawImage) Paints a image B in a window over the image centered about the cursor.- Parameters:
graphics- graphics componentxNew- x coord in imageyNew- y coord in imagewidth- width of the magnification window in pixels in unit zoomheight- height of the magnification window in pixels in unit zoommag- magnification of the zoom windowdrawImage- DOCUMENT ME!
-
setInterpolationMode
public void setInterpolationMode(int mode) Sets the interpolation mode.- Parameters:
mode- the interpolation mode (i.e. SMOOTH, NEAREST)
-
setResolutions
public void setResolutions(float rX, float rY) Sets the resolution correction factor in both x and y directions.- Parameters:
rX- resolution correction factor in the x directionrY- resolution correction factor in the y direction
-
setShowSliceNumber
public void setShowSliceNumber(boolean flag) Sets whether the slice number is shown.- Parameters:
flag- if true show slice number
-
setSliceString
Sets the string painted on the lower left.- Parameters:
str- str that is painted on the lower left of image
-
setTextColor
Sets the text to the desired color.- Parameters:
color- color of text
-
setZoom
public void setZoom(float zX, float zY) Sets the magnification in both x and y directions.- Parameters:
zX- zoom in the x directionzY- zoom in the y direction
-
setZoomExact
public void setZoomExact(float zX, float zY) Sets the magnification to exactly the zoom specified values in both x and y directions.- Parameters:
zX- zoom in the x directionzY- zoom in the y direction
-
update
Calls paint without erasing background - this reduces flicker!- Overrides:
updatein classJComponent- Parameters:
g- Graphics handle
-
finalize
Clean up some resources! -
makePaintImage
protected void makePaintImage(int[] paintImageBuffer, BitSet paintBitmap, int slice, ViewJFrameBase frame, boolean b2D) This method creates a buffer that will be used to make an image of the painted area on-screen.- Parameters:
paintImageBuffer- int[] the buffer to fill that will make the paint imagepaintBitmap- the bit map representing the painted pixelsslice- the current slice to paint if this is a 3D imageframe- the ViewJFrameBase containing the painted component.b2D- when true this is a 2D image component, when false it is greater than 2D
-
makePaintBitmapBorder
protected void makePaintBitmapBorder(int[] paintImageBuffer, BitSet paintBitmap, int slice, ViewJFrameBase frame) This method adds an opaque border to the painted area on-screen.- Parameters:
paintImageBuffer- int[] the buffer the paint image will be created frompaintBitmap- the bit map representing the painted pixelsslice- the current slice to paint if this is a 3D imageframe- the ViewJFrameBase containing the painted component.
-
getSelectedPaintColor
Gets the color of the paint the user has selected from the paint toolbar.- Parameters:
vjfb- the ViewJFrameBase object that contains the paint toolbar.- Returns:
- int the color of the paint selected by the user, represented as a packed integer
-