Package gov.nih.mipav.view
Class ViewJPanelHistoLUT
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gov.nih.mipav.view.ViewJPanelHistoLUT
- All Implemented Interfaces:
HistoLUTParent,MouseListener,MouseMotionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
public class ViewJPanelHistoLUT
extends JPanel
implements HistoLUTParent, MouseListener, MouseMotionListener
Panel containing the histogram component (the graph) and the lut component (the gradient vertical bar).
- Version:
- 1.0
- Author:
- Evan McCreedy
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classNotice when the user cancels the color chooser dialog.private classPick up the selected color and change the image border color.Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested 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 TypeFieldDescriptionprivate ViewJColorChooserThe LUT color chooser.private ViewJComponentHLUTBaseThe histogram LUT of the image.private ViewJComponentLUTLookup table of image.static final intIndicates a grayscale LUT.private ModelHistogramModel histogram.private intThe type of histogram component to show.private ModelImageThe image.private ModelLUTThe grayscale lookup table for the image.private intThe LUT index used when chaning the LUT color by clicking on the ViewJComponentLUT.private JDialogRecordLUTLUT recorder.private HistoLUTParentThe component containing this panel.static final intIndicates a RGB LUT.private ModelRGBThe RGB lookup table.private static final longUse serialVersionUID for interoperability.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
ConstructorsConstructorDescriptionViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelLUT lut, ModelHistogram histogram) Deprecated.ViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelRGB RGBT, ModelHistogram histogram) Deprecated.ViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelStorageBase lut, ModelHistogram histogram) Create this panel. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeletes local memory.voiddragPoint(MouseEvent mouseEvent) Handle the dragging of a transfer function point.voidfinalize()Clean up the panel memory.Get the histogram LUT component.Get the LUT component.Get the LUT recorder reference.voidinitGUI()Construct the panel.booleanIndicates if real-time update of the image should take place.voidmouseClicked(MouseEvent mouseEvent) Calls color chooser.voidmouseDragged(MouseEvent mouseEvent) Continually updates the image depending on where the mouse is.voidmouseEntered(MouseEvent mouseEvent) Unchanged.voidmouseExited(MouseEvent mouseEvent) Unchanged.voidmouseMoved(MouseEvent mouseEvent) Changes the LUT text field display based on the Y value of the mouse when inside ViewJComponentLUT.voidmousePressed(MouseEvent mouseEvent) Checks whether the user is making new points in the lut function or not.voidmouseReleased(MouseEvent mouseEvent) Updates the image and shows it in case a new point has been added to the function (or removed).voidAccessor to disable the all RGB color channels button if one of the lines has moved.voidReplaces the LUT and builds a new LUT component.voidsetRangeText(float x, float y, int _index) Set the range value of the text field.voidShow the LUT recorder dialog.voidRedraw the componentLUT.voidupdateFrames(boolean flag) Update all of the image frames that display the image this histo lut is for.voidSets the position string in the LUT text field.voidUpdate the LUT recorder table transfer function.voidupdateLUTRecorder(ModelLUT _lut) Update the LUT table of LUTRecorder.voidupdateThresholdFields(float lower, float upper) Method to update the threshold text fields when the lower or upper threshold changes.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, updateMethods 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, 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:
-
GRAY_LUT
public static final int GRAY_LUTIndicates a grayscale LUT.- See Also:
-
RGB_LUT
public static final int RGB_LUTIndicates a RGB LUT.- See Also:
-
colorChooser
The LUT color chooser. -
componentHistogram
The histogram LUT of the image. The square one. -
componentLUT
Lookup table of image. The narrow rectangular one. -
histogram
Model histogram. -
histoLUTType
private int histoLUTTypeThe type of histogram component to show. -
image
The image. -
lut
The grayscale lookup table for the image. -
LUTIndex
private int LUTIndexThe LUT index used when chaning the LUT color by clicking on the ViewJComponentLUT. -
lutRecorder
LUT recorder. -
parent
The component containing this panel. -
RGBT
The RGB lookup table.
-
-
Constructor Details
-
ViewJPanelHistoLUT
public ViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelStorageBase lut, ModelHistogram histogram) Create this panel.- Parameters:
parent- component which will hold this panelimage- the imagelut- the image luthistogram- the image histogram
-
ViewJPanelHistoLUT
public ViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelLUT lut, ModelHistogram histogram) Deprecated.Create this panel.- Parameters:
parent- component which will hold this panelimage- the imagelut- the image luthistogram- the image histogram
-
ViewJPanelHistoLUT
public ViewJPanelHistoLUT(HistoLUTParent parent, ModelImage image, ModelRGB RGBT, ModelHistogram histogram) Deprecated.Creates a new ViewJPanelHistoLUT object.- Parameters:
parent- HistoLUTParentimage- ModelImageRGBT- ModelRGBhistogram- ModelHistogram
-
-
Method Details
-
disposeLocal
public void disposeLocal()Deletes local memory. -
dragPoint
Handle the dragging of a transfer function point.- Specified by:
dragPointin interfaceHistoLUTParent- Parameters:
mouseEvent- the point dragging event
-
finalize
public void finalize()Clean up the panel memory. -
getHistoLUTComponent
Get the histogram LUT component.- Returns:
- the histogram component
-
getLUTComponent
Get the LUT component.- Returns:
- the lut component
-
getLUTRecorder
Get the LUT recorder reference.- Returns:
- JDialogRecordLUT recorder dialog reference
-
initGUI
public void initGUI()Construct the panel. -
isImageUpdate
public boolean isImageUpdate()Indicates if real-time update of the image should take place.- Specified by:
isImageUpdatein interfaceHistoLUTParent- Returns:
trueif real time update should take place
-
mouseClicked
Calls color chooser.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
mouseEvent- Event that triggered function
-
mouseDragged
Continually updates the image depending on where the mouse is.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
mouseEvent- event that triggered this function
-
mouseEntered
Unchanged.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
mouseEvent- event
-
mouseExited
Unchanged.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
mouseEvent- event
-
mouseMoved
Changes the LUT text field display based on the Y value of the mouse when inside ViewJComponentLUT.- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
mouseEvent- Event that triggered this function
-
mousePressed
Checks whether the user is making new points in the lut function or not.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
mouseEvent- event that triggered function
-
mouseReleased
Updates the image and shows it in case a new point has been added to the function (or removed).- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
mouseEvent- the event that triggered this function
-
setAllOff
public void setAllOff()Accessor to disable the all RGB color channels button if one of the lines has moved.- Specified by:
setAllOffin interfaceHistoLUTParent
-
setLUT
Replaces the LUT and builds a new LUT component.- Specified by:
setLUTin interfaceHistoLUTParent- Parameters:
newLUT- New LUT
-
setRangeText
public void setRangeText(float x, float y, int _index) Set the range value of the text field.- Specified by:
setRangeTextin interfaceHistoLUTParent- Parameters:
x- the x threshold range valuey- the y threshold range value_index- the cursor index
-
showLUTRecorder
public void showLUTRecorder()Show the LUT recorder dialog. -
updateComponentLUT
public void updateComponentLUT()Redraw the componentLUT.- Specified by:
updateComponentLUTin interfaceHistoLUTParent
-
updateFrames
public void updateFrames(boolean flag) Update all of the image frames that display the image this histo lut is for.- Specified by:
updateFramesin interfaceHistoLUTParent- Parameters:
flag- this boolean indicates if the frame that displays the image should re-export the image and apply new LUT- See Also:
-
updateLUTPositionString
Sets the position string in the LUT text field.- Specified by:
updateLUTPositionStringin interfaceHistoLUTParent- Parameters:
str- the position string
-
updateLUTRecorder
public void updateLUTRecorder()Update the LUT recorder table transfer function. -
updateLUTRecorder
Update the LUT table of LUTRecorder.- Parameters:
_lut- ModelLUT lut table
-
updateThresholdFields
public void updateThresholdFields(float lower, float upper) Method to update the threshold text fields when the lower or upper threshold changes.- Specified by:
updateThresholdFieldsin interfaceHistoLUTParent- Parameters:
lower- the lower threshold valueupper- the upper threshold value
-