|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
Landmark.LmsScrollableImagePanel
public class LmsScrollableImagePanel
The LmsScrollableImagePanel class implements a scrollable Panel GUI to display an image used in the landmarking program.
Edited and refactored by Greg Thornwall, SAIC and Peter Lemkin
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The Open2Dprot Mozilla and Legal files are available on http://Open2Dprot.sourceforge.net/.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
boolean |
altMod
ALT/Mouse |
private Landmark |
cs
instance of the main Landmark class |
private LmsWizardPopup |
csi
instance of the main/calling class |
boolean |
ctrlMod
CTRL/Mouse |
boolean |
ctrlShiftMod
CTRL-SHIFT/Mouse |
int |
curLMS
current landmark set of current spot. |
java.awt.Color |
cursorColor
Overlay color for cursor |
private DbSample |
dbS
instance of sample |
private DbSample |
dbSorig
instance of sample |
java.lang.String |
fontFamily
|
java.awt.Image |
img
image to display |
java.awt.Font |
largeFont
|
java.awt.Color |
lmDBcolor
Overlay color for user defined landmarks |
java.awt.Color |
lmsColor
Overlay color for spots in the currently selected landmark set |
java.awt.Font |
mediumFont
|
java.awt.Color |
nonLMScolor
Overlay color for spot that are NOT in the currently selected landmark set. |
java.awt.Image |
oImage
for outside/offscreen painting |
int |
pixHeight
img height |
int |
pixWidth
img width |
int |
preferredHeight
preferred size of canvas |
int |
preferredWidth
preferred size of canvas |
(package private) static long |
serialVersionUID
frame id |
boolean |
shiftMod
SHIFT/Mouse |
ScrollableImage |
si
|
java.lang.String |
side
indicates left or right side by "right" or "left" |
java.awt.Font |
smallFont
|
int |
xImg
image address (x,y)+(xBase,yBase) where base address of ULHC of clipped image in image canvas used in last paint |
int |
yImg
image address (x,y)+(xBase,yBase) where base address of ULHC of clipped image in image canvas used in last paint |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 | |
|---|---|
LmsScrollableImagePanel(LmsWizardPopup csi,
DbSample dbS,
java.awt.Image img,
int scrollPaneWidth,
int scrollPaneHeight,
java.lang.Object parentObj,
java.lang.String side)
ScrollableImageCanvas() - constructor. |
|
| Method Summary | |
|---|---|
private void |
drawCircle(java.awt.Graphics g,
int x,
int y,
int radius,
java.awt.Color color)
drawCircle() - draw circle at the specified color and radius. |
void |
drawOverLays(java.awt.Graphics g,
java.awt.Image imgToDraw,
int w,
int h)
drawOverLays() - paint the scrollable image canvas which includes the image, optional ROI's, overlay spots, optional histogram that is repainted in another class. |
java.awt.Dimension |
getPreferredSize()
getPreferredSize() - getPreferredSize, must be implemented for ScrollPane to be displayed correctly. |
void |
keyPressed(java.awt.event.KeyEvent e)
keyPressed() - handle key down events |
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
private boolean |
mapRelXYtoImage(java.awt.event.MouseEvent e)
mapRelXYtoImage() - map (x,y) Mouse in current canvas to (xImg,yImg) as well as updating the parent. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
mouseDragged() - display data and set coordinates of current pixel in current image. |
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
mouseMoved() - Change cursor to + when moved over this (Component) |
void |
mousePressed(java.awt.event.MouseEvent e)
mousePressed() - display data and set coordinates of current pixel in current image. |
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paintPanel(java.awt.Graphics g,
java.awt.Image imgToDraw,
int w,
int h,
boolean offscreenFlag)
paintPanel() - repaint scrollable canvas in region defined by scroll bars. |
(package private) java.lang.String |
showImageMousePositions(int x,
int y,
java.lang.String msgs)
showImageMousePositions() - show the image mouse positions |
void |
update(java.awt.Graphics g)
update() - update without background the scrollable canvas |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| 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, 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, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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 |
| Methods 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final long serialVersionUID
private LmsWizardPopup csi
private Landmark cs
private DbSample dbS
private DbSample dbSorig
public boolean ctrlMod
public boolean shiftMod
public boolean ctrlShiftMod
public boolean altMod
public java.lang.String fontFamily
public java.awt.Font smallFont
public java.awt.Font mediumFont
public java.awt.Font largeFont
public int xImg
public int yImg
public int curLMS
public int preferredWidth
public int preferredHeight
public java.awt.Color cursorColor
public java.awt.Color lmDBcolor
public java.awt.Color lmsColor
public java.awt.Color nonLMScolor
public ScrollableImage si
public java.lang.String side
public java.awt.Image img
public java.awt.Image oImage
public int pixWidth
public int pixHeight
| Constructor Detail |
|---|
public LmsScrollableImagePanel(LmsWizardPopup csi,
DbSample dbS,
java.awt.Image img,
int scrollPaneWidth,
int scrollPaneHeight,
java.lang.Object parentObj,
java.lang.String side)
csi - is the image scroller associated with the imagedbS - DbSampleimg - is the image to displayscrollPaneWidth - width of scroller windowscrollPaneHeight - height of scroller windowparentObj - for painting via invokeside - "right" or "left" String for painting the correct upper img| Method Detail |
|---|
public java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponent
final java.lang.String showImageMousePositions(int x,
int y,
java.lang.String msgs)
x - is relative image object positiony - is relative image object positionmsgs - is message to displaypublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenere - is KeyEventpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerprivate final boolean mapRelXYtoImage(java.awt.event.MouseEvent e)
e - is mouse event
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - is MouseEventpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - is MouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - is MouseEventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void update(java.awt.Graphics g)
update in class javax.swing.JComponentg - is graphics context
private final void drawCircle(java.awt.Graphics g,
int x,
int y,
int radius,
java.awt.Color color)
g - is graphics contextx - is center of circley - is center of circleradius - is the size of the circlecolor - is color to draw
public void drawOverLays(java.awt.Graphics g,
java.awt.Image imgToDraw,
int w,
int h)
g - is graphics context.
public void paintPanel(java.awt.Graphics g,
java.awt.Image imgToDraw,
int w,
int h,
boolean offscreenFlag)
g - is graphics contextimgToDraw - image to draww - widthh - heightoffscreenFlag - draw g to image
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||