public class RawImageViewer extends javax.swing.JPanel implements IRawImageListener, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected JImage |
imagePanel |
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
RawImageViewer()
Create a new RawImageViewer
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt) |
void |
addRoiListener(IRoiListener l)
Add the specified ROI Listener
|
void |
clearModel()
Removes all listener belonging to the viewer.
|
void |
errorChange(ErrorEvent errorEvent) |
boolean |
getAutoZoom()
Determines wheter this image viewer has auto zoom enabled.
|
java.awt.Dimension |
getCurrentImageSize()
Returns the current image size
|
Gradient |
getGradient()
Returns current colormap
|
java.awt.Insets |
getImageMargin()
Returns image margin.
|
JImage |
getImagePanel()
Returns the image panel
|
int |
getImageXCoord(int x)
Converts the component horizontal coordinate to the image coordinate.
|
int |
getImageYCoord(int y)
Converts the component vertical coordinate to the image coordinate.
|
java.awt.Rectangle |
getSelection()
Return current floating rectangle selection
|
int |
getSelectionMode()
Returns the floating selection mode
|
JLAxis |
getXAxis()
Returns a handle to the x axis.
|
JLAxis |
getYAxis()
Return a handle to the Y axis.
|
int |
getZoom()
Return the current zoom factor index.
|
boolean |
isAlignToGrid()
Returns true is floating selection are aligned to grid
|
boolean |
isBestFit()
Returns true when best fit is on
|
boolean |
isGradientVisible()
Returns true when the gradient is visible.
|
boolean |
isNegative()
Returns true only if negative image is displayed
|
boolean |
isSelectionEnabled()
Returns true is floating selection is enabled
|
boolean |
isShowingMenu()
Returns true is the image viewer menu is displayed when clicking
on the right mouse button.
|
boolean |
isStatusLineVisible()
Returns true when the status line is visible.
|
boolean |
isToolbarVisible()
Returns true when the toolbar is visible.
|
static void |
main(java.lang.String[] args) |
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 |
rawImageChange(RawImageEvent evt) |
void |
removeRoiListener(IRoiListener l)
Remove the specified ROI Listener
|
void |
setAlignToGrid(boolean b)
Sets the align to grid mode for floating selection
|
void |
setAutoZoom(boolean auto)
Enables or disables the auto zoom.
|
void |
setBestFit(boolean b)
Displays the image using the whole color range.
|
void |
setCrossCursor(boolean enable)
Enable or disable the cross cursor.
|
void |
setCrossCursorColor(java.awt.Color c)
Set the cross cursor color.
|
void |
setData(java.lang.String encFormat,
byte[] rawData)
Sets data to display.
|
void |
setGradient(Gradient g)
Sets the colormap
|
void |
setGradientVisible(boolean b)
Displays or hides the gradient (right panel).
|
void |
setImageMargin(java.awt.Insets i)
Sets the image margin.
|
void |
setModel(IRawImage v)
Sets the model.
|
void |
setNegative(boolean b)
Displays negative image when enabled
|
void |
setSelection(java.awt.Rectangle r)
Sets the floating selection.
|
void |
setSelectionEnabled(boolean b)
True is floating selection is enabled
|
void |
setSelectionMode(int m)
Sets the floating selection mode
|
void |
setShowingMenu(boolean b)
True to enable menu displayed when clicking on right mouse button.
|
void |
setStatusLineVisible(boolean b)
Displays or hides the status line (bottom panel).
|
void |
setToolbarVisible(boolean b)
Displays or hides the toolbar.
|
void |
setZoom(int zoomIndex)
Sets the image zoom factor.
|
void |
showSettings() |
void |
stateChange(AttributeStateEvent evt) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, update
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, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
protected JImage imagePanel
public void setData(java.lang.String encFormat, byte[] rawData)
rawData
- Handle to datapublic void setBestFit(boolean b)
b
- Best fit togglepublic boolean isBestFit()
public void setGradient(Gradient g)
g
- New gradient colormappublic Gradient getGradient()
public void setNegative(boolean b)
b
- True for negtive imagepublic boolean isNegative()
public void setToolbarVisible(boolean b)
b
- True if toolbar is displayedpublic boolean isToolbarVisible()
public void setStatusLineVisible(boolean b)
b
- True if status line is displayedpublic boolean isStatusLineVisible()
public int getZoom()
setZoom(int)
public void setZoom(int zoomIndex)
Possible zoomIndex values are: 0 : 400% 1 : 200% 2 : 100% 3 : 50% 4 : 25% 5 : 12.5%
zoomIndex
- ZoomFactor index (see description).public void setAutoZoom(boolean auto)
auto
- AutoZoom flagpublic boolean getAutoZoom()
setAutoZoom(boolean)
public void setAlignToGrid(boolean b)
b
- True to enablepublic boolean isAlignToGrid()
public boolean isShowingMenu()
public void setShowingMenu(boolean b)
b
- True to enable the menupublic void addRoiListener(IRoiListener l)
l
- ROI listenerpublic void removeRoiListener(IRoiListener l)
l
- ROI listenerpublic void setSelection(java.awt.Rectangle r)
r
- Rectangle to selectpublic java.awt.Rectangle getSelection()
public java.awt.Insets getImageMargin()
public void setImageMargin(java.awt.Insets i)
i
- Image marginpublic void setSelectionEnabled(boolean b)
b
- True to allow floating selectionpublic boolean isSelectionEnabled()
public void setCrossCursor(boolean enable)
enable
- True to enable cross cursor, false otherwise.public void setCrossCursorColor(java.awt.Color c)
c
- Cursor colorsetCrossCursor(boolean)
public int getSelectionMode()
public void setSelectionMode(int m)
m
- 0 for Line selection, 1 fro rectangle selectionpublic JLAxis getXAxis()
public JLAxis getYAxis()
public void setGradientVisible(boolean b)
b
- True if status line is displayedpublic boolean isGradientVisible()
public int getImageXCoord(int x)
x
- Component horizontal coordinatepublic int getImageYCoord(int y)
y
- Component vertical coordinatepublic java.awt.Dimension getCurrentImageSize()
public JImage getImagePanel()
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
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
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 mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void errorChange(ErrorEvent errorEvent)
errorChange
in interface IErrorListener
public void stateChange(AttributeStateEvent evt)
stateChange
in interface IAttributeStateListener
public void rawImageChange(RawImageEvent evt)
rawImageChange
in interface IRawImageListener
public void setModel(IRawImage v)
v
- Value to assign to model.public void clearModel()
public void showSettings()
public static void main(java.lang.String[] args)