|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Canvas ScrollableImageCanvas
class ScrollableImageCanvas
ScrollableImageCanvas class supports a scrollable canvas Define a scrollable image canvas. Note the scroll bars may or may not exist and so we need to test for this.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Canvas |
---|
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private boolean |
altMod
ALT/Mouse |
(package private) BrightnessContrastFilter |
bcImgF
Instance of Brightness/Contrast Filter. |
(package private) int |
bkGrdX
bk grd X |
(package private) int |
bkGrdY
bk grd Y |
(package private) java.awt.Point |
centerPt
center point |
(package private) int |
cHeight
canvas height |
(package private) int |
circleX
img X coords for circle |
(package private) int |
circleY
img Y coords for circle |
(package private) java.awt.Color[] |
color_text
text list items colors |
private boolean |
ctrlMod
CTRL/Mouse |
private boolean |
ctrlShiftMod
CTRL-SHIFT/Mouse |
java.awt.Point |
curPos
keep track of current "+" where last clicked in 1.0 (mag) state |
ImageScroller |
currentIS
right or left IS that is being flickered |
(package private) int |
cWidth
canvas width |
(package private) Flicker |
flk
|
java.awt.Point |
flkCurPos
|
(package private) java.awt.Font[] |
font_text
text list fonts |
int |
guardHeight
size of top & bottom guard region |
int |
guardImgHeight
size of img with guard region |
int |
guardImgWidth
size of img with guard region |
boolean |
guardRegionFlag
guard region flag |
int |
guardWidth
size of right & left guard region |
(package private) int |
gValue
gray value of (x,y) pixel object |
(package private) int |
imgRoiX1
The true position of ROI with respect to the image not canvas |
(package private) int |
imgRoiX2
The true position of ROI with respect to the image not canvas |
(package private) int |
imgRoiY1
The true position of ROI with respect to the image not canvas |
(package private) int |
imgRoiY2
The true position of ROI with respect to the image not canvas |
(package private) Info |
info
|
ImageScroller |
is
Parent class |
(package private) java.lang.String |
isName
name of ImageScroller parent |
(package private) java.lang.String |
lastlastISName
from time before... |
(package private) int |
MAX_TEXT
max # of text items |
(package private) java.awt.Dimension |
maxCanvasDim
Maximum canvas size |
(package private) int |
nTextItems
actual # text items to display |
int |
preferredHeight
preferred size of canvas |
int |
preferredWidth
preferred size of canvas |
(package private) java.lang.String |
saveAsImgFile
Name of GIF file to save the next repaint. |
(package private) java.awt.Point |
scrollPos
current scroll position |
(package private) static java.awt.Color |
selectedImageColor
selected image title color |
private boolean |
shiftMod
SHIFT/Mouse |
(package private) int |
sicHeight
image height |
(package private) int |
sicWidth
image width |
(package private) java.lang.String[] |
text
text list items |
(package private) int |
ticX
tic mark X |
(package private) int |
ticY
tic mark Y |
(package private) int |
tSize
target Size |
(package private) static java.awt.Color |
unselectedImageColor
selected image title color |
(package private) boolean |
useScrollBarsFlag
create and use scrollers flag |
(package private) Util |
util
new boundary state |
(package private) java.awt.Dimension |
viewPortSize
dimensions of the view port |
(package private) int[] |
x_text
x text list items positions |
(package private) int |
X_TRIAL_OBJ_OFFSET
offset to draw trial obj |
(package private) int |
xBase
+ base address of ULHC of clipped image in image canvas used in last paint |
(package private) int |
xCtr
center coords of image, for zoom/dezoom |
(package private) int |
xImg
+ image address (x,y)+(xBase,yBase) |
(package private) int |
xObj
|
(package private) int[] |
y_text
y text list items positions |
(package private) int |
Y_TRIAL_OBJ_OFFSET
offset to draw label |
(package private) int |
yBase
|
(package private) int |
yCtr
center coords of image, for zoom/dezoom |
(package private) int |
yImg
+ externally set (x,y) object position |
(package private) int |
yObj
|
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ScrollableImageCanvas(java.awt.Image img,
ImageScroller is,
Flicker flk,
boolean useScrollBarsFlag)
ScrollableImageCanvas() - constructor. |
Method Summary | |
---|---|
void |
cleanup()
cleanup() - destroy data structures |
void |
clearLandmarkTextListToDraw()
clearLandmarkTextListToDraw() - disable text list of landmarks to draw in canvas. |
void |
copy(ScrollableImageCanvas newSIC)
copy() - destroy data structures |
private void |
drawBackgroundCircleInImage(java.awt.Graphics g,
java.awt.Image pImg)
drawBackgroundCircleInImage() - draw background circle in window if visible. |
private void |
drawCircleAroundSpot(java.awt.Graphics g,
int xC,
int yC,
java.awt.Color color,
int radius,
int thickness)
drawCircleAroundSpot() - draw a circle around spot if visible. |
void |
drawImageTitle()
drawImageTitle() - draw title in image. |
private void |
drawLandmarksTextInImage(java.awt.Graphics g,
int xFlkOrigin,
int yFlkOrigin)
drawLandmarksTextInImage() - redraw landmark text[] in the image at (x,y)[] locs with the specified color and fonts. |
private void |
drawMeasCircleInImage(java.awt.Graphics g,
java.awt.Image pImg)
drawMeasCircleInImage() - draw measurement circles in window if visible. |
private void |
drawRoiInImage(java.awt.Graphics g,
java.awt.Image iImg)
drawRoiInImage() - draw region of interest in window if visible. |
private void |
drawSpotMeasurementsInImage(java.awt.Graphics g,
java.awt.Image pImg)
drawSpotMeasurementsInImage() - Draw spot measurements in image if valid and is visible. |
private void |
drawTargetOverlay(java.awt.Graphics g,
ImageScroller is,
ImageScroller currentIS)
drawTargetOverlay() - Draw Target Overlay in the ImageScroller window. |
private void |
drawTrialObjInImage(java.awt.Graphics g)
drawTrialObjInImage() - redraw xyObj in window if visible. |
java.awt.Point |
getImgPosition()
getImgPosition() - get the Image position. |
java.awt.Point |
getNewImageCenterPoint()
getNewImageCenterPoint() - Calc new center point in image based on scrollers |
java.awt.Point |
getObjPosition()
getObjPosition() - get the object position. |
java.awt.Dimension |
getPreferredSize()
getPreferredSize() - getPreferredSize, must be implemented for ScrollPane to be displayed correctly. |
java.awt.Point |
guardRegionCorrection(java.awt.Point pt)
guardRegionCorrection() - return guard region location |
private void |
highlightActiveIS()
highlightActiveIS() - highlight ScrollableImageCanvas. |
void |
keyPressed(java.awt.event.KeyEvent e)
keyPressed() - handle key pressed events |
void |
keyReleased(java.awt.event.KeyEvent e)
keyReleased() - handle key down events |
void |
keyTyped(java.awt.event.KeyEvent e)
keyTyped() - handle key down events |
(package private) boolean |
mapRelCircleCoordstoImageCoords(int cX,
int cY,
int bX,
int bY,
java.awt.Image pImg)
mapRelCircleCoordstoImageCoords() - remap circle center and background (x,y) coords in current canvas to img coords (x,y). |
(package private) boolean |
mapRelRoiCoordstoImageCoords(int x1,
int x2,
int y1,
int y2,
java.awt.Image pImg)
mapRelRoiCoordstoImageCoords() - remap ROI(x,y) in current canvas to img ROI(x,y). |
(package private) void |
mapRelXYtoImage(java.awt.event.MouseEvent e,
int x,
int y)
mapRelXYtoImage() - map (x,y) Mouse in current canvas to (xImg,yImg) as well as updating the parent.(xImg,yImg) values which are RELATIVE to the current image. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
mouseDragged() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase). |
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
mousePressed() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase). |
void |
mouseReleased(java.awt.event.MouseEvent e)
mouseReleased() - update (xImg,yImg) with relative position in canvas by adding (x,y) to paint ULHC base address (xBase,yBase). |
void |
paint(java.awt.Graphics g)
paint() - repaint scrollable canvas in region defined by scroll bars |
boolean |
processBCimage(ImageData id)
processBCimage() - process colormap image by running the filter. |
void |
setCanvasSize(int size)
setCanvasSize() - change the size of this Canvas. |
void |
setCanvasSize(int preferredWidth,
int preferredHeight)
setCanvasSize() - change the size of this Canvases. |
void |
setImgPosition(int xImg,
int yImg)
setImgPosition() - set the Image position. |
void |
setLandmarksTextListToDraw(int nTextItems,
java.awt.Color[] color_text,
java.lang.String[] text,
java.awt.Font[] font_text,
int[] x_text,
int[] y_text)
setLandmarksTextListToDraw() - set text list including color and position. |
void |
setObjPosition(int xObj,
int yObj)
setObjPosition() - set the object position. |
(package private) void |
setTrialLMS(int x,
int y)
setTrialLMS() - set trial landmark in & center image, save object(x,y). |
(package private) void |
showImageMousePositions(java.awt.event.MouseEvent e,
java.lang.String msgs,
int x,
int y)
showImageMousePositions() - show the image mouse positions Only report if debugging... |
void |
update(java.awt.Graphics g)
update() - update without background the scrollable canvas |
(package private) void |
updateClickableCanvas()
updateClickableCanvas() - perform clickable canvas update operations invoked by various controls. |
void |
updateImageScrollableTitles(boolean forceUpdateFlag)
updateImageScrollableTitles() - update 1 or 2 scrollable images |
(package private) void |
updateScrollCanvas()
updateScrollCanvas() - scroll the image in the scrollable canvas. |
Methods inherited from class java.awt.Canvas |
---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Util util
Flicker flk
Info info
final int tSize
final int MAX_TEXT
final int X_TRIAL_OBJ_OFFSET
final int Y_TRIAL_OBJ_OFFSET
public ImageScroller is
java.lang.String isName
java.lang.String lastlastISName
java.lang.String saveAsImgFile
BrightnessContrastFilter bcImgF
int nTextItems
int xBase
int yBase
int xImg
int yImg
int xObj
int yObj
int imgRoiX1
int imgRoiX2
int imgRoiY1
int imgRoiY2
int circleX
int circleY
int bkGrdX
int bkGrdY
int ticX
int ticY
int gValue
private boolean ctrlMod
private boolean shiftMod
private boolean ctrlShiftMod
private boolean altMod
static java.awt.Color selectedImageColor
static java.awt.Color unselectedImageColor
java.awt.Color[] color_text
java.lang.String[] text
java.awt.Font[] font_text
int[] x_text
int[] y_text
java.awt.Dimension maxCanvasDim
java.awt.Point centerPt
java.awt.Point scrollPos
java.awt.Dimension viewPortSize
int cWidth
int cHeight
int sicWidth
int sicHeight
public int guardWidth
public int guardHeight
public int guardImgWidth
public int guardImgHeight
int xCtr
int yCtr
public int preferredWidth
public int preferredHeight
boolean useScrollBarsFlag
public ImageScroller currentIS
public java.awt.Point curPos
public java.awt.Point flkCurPos
public boolean guardRegionFlag
Constructor Detail |
---|
ScrollableImageCanvas(java.awt.Image img, ImageScroller is, Flicker flk, boolean useScrollBarsFlag)
img
- is the image to createis
- is the image scroller associated with the imageflk
- is the link to the main class.Method Detail |
---|
public void copy(ScrollableImageCanvas newSIC)
public void cleanup()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public void setCanvasSize(int size)
size
- is new sizepublic void setCanvasSize(int preferredWidth, int preferredHeight)
preferredWidth
- is new widthpreferredHeight
- is new heightpublic void setImgPosition(int xImg, int yImg)
xImg
- is the image position.yImg
- is the image positionpublic java.awt.Point getImgPosition()
public void setObjPosition(int xObj, int yObj)
xObj
- is object positionyObj
- is object positionpublic java.awt.Point getObjPosition()
public void setLandmarksTextListToDraw(int nTextItems, java.awt.Color[] color_text, java.lang.String[] text, java.awt.Font[] font_text, int[] x_text, int[] y_text)
nTextItems
- to setcolor_text
- list to settext
- list to setfont_text
- list to setx_text
- list to sety_text
- list to setpublic void clearLandmarkTextListToDraw()
private final void drawLandmarksTextInImage(java.awt.Graphics g, int xFlkOrigin, int yFlkOrigin)
g
- is graphics contextxFlkOrigin
- new x (0,0) to draw img to in flicker window onlyyFlkOrigin
- new y (0,0) to draw img to in flicker window onlypublic java.awt.Point getNewImageCenterPoint()
private final void drawTrialObjInImage(java.awt.Graphics g)
g
- is graphics contextfinal boolean mapRelRoiCoordstoImageCoords(int x1, int x2, int y1, int y2, java.awt.Image pImg)
x1
- is ROI coordsx2
- is ROI coordsy1
- is ROI coordsy2
- is ROI coords
private final void drawRoiInImage(java.awt.Graphics g, java.awt.Image iImg)
g
- is graphics contextfinal boolean mapRelCircleCoordstoImageCoords(int cX, int cY, int bX, int bY, java.awt.Image pImg)
cX
- is circle x coordscY
- is circle y coordsbX
- is background coordsbX
- is background y coords
private final void drawBackgroundCircleInImage(java.awt.Graphics g, java.awt.Image pImg)
g
- is graphics contextprivate final void drawMeasCircleInImage(java.awt.Graphics g, java.awt.Image pImg)
g
- is graphics contextprivate final void drawSpotMeasurementsInImage(java.awt.Graphics g, java.awt.Image pImg)
Location switches Action ----------------------------- ---------------------------- flk.viewDrawSpotLocCircleFlag Draw circle or flk.viewDrawSpotLocPlusFlag Draw '+' or neither Don't indicate location Annotation switches Action draw right of location ----------------------------- ----------------------------- flk.viewDrawSpotAnnNbrFlag Draw s.nbr or flk.viewDrawSpotAnnIdFlag Draw s.id or "" or neither Don't indicate annotation
g
- is graphics contextprivate void drawCircleAroundSpot(java.awt.Graphics g, int xC, int yC, java.awt.Color color, int radius, int thickness)
g
- is graphics contextxC
- is center of circleyC
- is center of the circlecolor
- to useradius
- to draw circlethickness
- (0,1,2) of the lineprivate void drawTargetOverlay(java.awt.Graphics g, ImageScroller is, ImageScroller currentIS)
final void showImageMousePositions(java.awt.event.MouseEvent e, java.lang.String msgs, int x, int y)
e
- is mouse eventmsgs
- is message to displayx
- is image object positiony
- is image object positionfinal void mapRelXYtoImage(java.awt.event.MouseEvent e, int x, int y)
e
- is mouse eventx
- is image cursory
- is image cursorpublic final void updateImageScrollableTitles(boolean forceUpdateFlag)
forceUpdateFlag
- statepublic final void drawImageTitle()
final void setTrialLMS(int x, int y)
x
- is trial LMS cursory
- is trial LMS cursorpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
e
- is KeyEventpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
e
- is KeyEventpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
e
- is KeyEventpublic boolean processBCimage(ImageData id)
id
- is the ImageData to get the image to process
void updateClickableCanvas()
void updateScrollCanvas()
private void highlightActiveIS()
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- is MouseEventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- is MouseEventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- is MouseEventpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public java.awt.Point guardRegionCorrection(java.awt.Point pt)
public void update(java.awt.Graphics g)
update
in class java.awt.Canvas
g
- is graphics contextpublic void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
g
- is graphics context
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |