public class ColormapViewer extends BorderedPanel implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, LUT.LUTChannelListener
Modifier and Type | Class and Description |
---|---|
static interface |
ColormapViewer.ColormapPositionListener |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ColormapViewer(LUT.LUTChannel lutChannel) |
Modifier and Type | Method and Description |
---|---|
void |
addColormapPositionListener(ColormapViewer.ColormapPositionListener listener)
Add a listener
|
void |
addNotify() |
void |
colormapPositionChanged(int index,
int value)
mouse position on colormap info changed
|
java.awt.Color |
getColor(IcyColorMapComponent cmc)
get color of specified band
|
java.awt.Color |
getColor(int index)
return the final color for specified index
|
java.awt.Color |
getColorFromPixel(int pixel)
return the final color for specified pixel position
|
IcyColorMap |
getColormap() |
double |
getDistance(IcyColorMapComponent.ControlPoint cp,
java.awt.Point p)
Return distance between control point and the specified point
|
int |
getPixelPosX(IcyColorMapComponent.ControlPoint cp)
Get X pixel position
|
int |
getPixelPosY(IcyColorMapComponent.ControlPoint cp)
Get Y pixel position
|
int |
indexToPix(int index)
Translate index to pixel
|
boolean |
isAlphaEnabled() |
boolean |
isOverlapped(IcyColorMapComponent.ControlPoint cp,
java.awt.Point p)
Return true if pixel (x, y) is over the control point
|
boolean |
isOverlapped(IcyColorMapComponent cmc,
java.awt.Point pos)
Check if point is over any point in colormap
|
void |
lutChannelChanged(LUT.LUTChannelEvent e) |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
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) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
onColormapChanged()
process on colormap change
|
int |
pixToIndex(int pixel)
Translate pixel to index
|
int |
pixToValue(int pixel)
Translate pixel to value
|
void |
removeColormapPositionListener(ColormapViewer.ColormapPositionListener listener)
Remove a listener
|
void |
removeNotify() |
void |
setAlphaEnabled(boolean value) |
void |
setCurrentElements(IcyColorMapComponent cmc,
IcyColorMapComponent.ControlPoint cp)
set current controller or control point
|
void |
setPixelPosition(IcyColorMapComponent.ControlPoint cp,
int x,
int y)
Set position from a pixel position
|
int |
valueToPix(int value)
Translate value to pixel
|
getClientHeight, getClientWidth, getClientX, getClientY
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
public ColormapViewer(LUT.LUTChannel lutChannel)
public void addNotify()
addNotify
in class javax.swing.JComponent
public void removeNotify()
removeNotify
in class javax.swing.JComponent
public IcyColorMap getColormap()
public int indexToPix(int index)
index
- public int pixToIndex(int pixel)
pixel
- public int valueToPix(int value)
value
- public int pixToValue(int pixel)
pixel
- public boolean isAlphaEnabled()
public void setAlphaEnabled(boolean value)
public void setCurrentElements(IcyColorMapComponent cmc, IcyColorMapComponent.ControlPoint cp)
public java.awt.Color getColor(int index)
public java.awt.Color getColor(IcyColorMapComponent cmc)
public java.awt.Color getColorFromPixel(int pixel)
public boolean isOverlapped(IcyColorMapComponent cmc, java.awt.Point pos)
pos
- pointpublic boolean isOverlapped(IcyColorMapComponent.ControlPoint cp, java.awt.Point p)
p
- pointpublic double getDistance(IcyColorMapComponent.ControlPoint cp, java.awt.Point p)
p
- pointpublic void setPixelPosition(IcyColorMapComponent.ControlPoint cp, int x, int y)
x
- y
- public int getPixelPosX(IcyColorMapComponent.ControlPoint cp)
public int getPixelPosY(IcyColorMapComponent.ControlPoint cp)
public void onColormapChanged()
public void addColormapPositionListener(ColormapViewer.ColormapPositionListener listener)
listener
- public void removeColormapPositionListener(ColormapViewer.ColormapPositionListener listener)
listener
- public void colormapPositionChanged(int index, int value)
public void lutChannelChanged(LUT.LUTChannelEvent e)
lutChannelChanged
in interface LUT.LUTChannelListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
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 void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener