|
|||||||||
| 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
CmpSpots.DrawHistogram
class DrawHistogram
File: DrawHistogram class is used to draw an image intensity histogram
| 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 | |
|---|---|
int |
activeBin
active bin idx of SCALED sHist[0:nHist-1] else -1 |
private java.awt.Color |
activeBinColor
Active bin peak on histogram color |
float |
activeBinValue
active bin data value corresponding to activeBinidx of SCALED sHist[0:nHist-1]. |
float |
binScale
sHist[] Bin width sampling or averaging distance computed as floating (nHist/nShist) to map hist[] to a sHist[] bin. |
private int |
cHeight
working canvas height |
private static CmpSpots |
cs
link to global instance |
private static CmpShowImage |
csi
|
private int |
cWidth
working canvas width |
private java.lang.String |
dataName
name of the data used in histogram |
private java.lang.String |
dataUnits
data units abbreviation |
(package private) java.awt.Dimension |
frameSize
size of frame |
private java.awt.Color |
histColor
|
private java.awt.Color |
histTopColor
|
private java.awt.Color |
labelColor
|
private java.awt.Font |
largeFont
medium font used for labeling |
float |
maxDataValue
The maximum data value at hist[max index] |
int |
maxHistFreqValue
The maximum frequency in hist[] |
int |
maxShistFreq
max sHist Frequency in sHist value to be displayed |
int |
maxShistIdx
max non-zero bin of sHist to be displayed |
int |
meanDataGrayValue
mean non-zero data gray value of sHist to display for Image density |
float |
meanDataValue
mean non-zero data value of sHist to be displayed |
int |
meanShistIdx
mean non-zero bin of sHist to be displayed |
private java.awt.Color |
meanValueBinColor
Mean value bin peak on histogram color |
int |
medianDataGrayValue
median non-zero data gray value of sHist to display for Image density |
float |
medianDataValue
median non-zero data value of sHist to be displayed |
int |
medianShistIdx
median non-zero bin of sHist to be displayed |
private java.awt.Color |
medianValueBinColor
Median value bin peak on histogram color |
private java.awt.Font |
mediumFont
medium font used for labeling |
float |
minDataValue
The minimum data value at hist[0] |
int |
minHistFreqValue
The minimum frequency value in hist[] |
int |
minShistFreq
min sHist Frequency in sHist value to be displayed |
int |
minShistIdx
min non-zero bin of sHist to be displayed |
int |
modeDataGrayValue
mode non-zero data gray value of sHist to display for Image density |
float |
modeDataValue
mode non-zero data value of sHist to be displayed |
int |
modeShistIdx
mode non-zero bin of sHist to be displayed |
private java.awt.Color |
modeValueBinColor
Mode value bin peak on histogram color |
private int |
nShist
size of input unscaled histogram[] data |
private java.awt.Color |
optBkgrdColor
|
int |
preferredHeight
preferred size of canvas |
int |
preferredWidth
preferred size of canvas |
float |
scaleFreq
sHist[] frequency scale factor computed as floating (maxHistFreq/nShist) |
(package private) static long |
serialVersionUID
frame id |
private int[] |
sHist
local SCALED histogram [0:nShist-1]data |
private int[] |
sHistDisp
local SCALED histogram [0:nShist-1] scaled to max data value of nShist |
private static Util |
util
link to global instance |
int |
xLRHC
lower Y right hand corner of hist. |
private int[] |
xPainted
local SCALED histogram X position |
int |
xULHC
upper X left hand corner of hist. |
int |
yLRHC
lower Y right hand corner of hist. |
int |
yULHC
upper Y left hand corner of hist. |
| 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 | |
|---|---|
DrawHistogram(CmpShowImage csi,
java.awt.Dimension frameSize)
DrawHistogram() - create a blank histogram canvas |
|
| Method Summary | |
|---|---|
private static void |
drawFilledBox(java.awt.Graphics g,
int xC,
int yC,
int width,
java.awt.Color color)
drawFilledBox() - draw plus sign at the specified color. |
private static void |
drawFilledRectangle(java.awt.Graphics g,
int x1,
int x2,
int y1,
int y2,
java.awt.Color color)
drawFilledRectangle() - draw plus sign at the specified color. |
java.awt.Dimension |
getPreferredSize()
getPreferredSize() - getPreferredSize, must be implemented for ScrollPane to be displayed correctly. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
mouseDragged() - process mouse event |
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
boolean |
mouseHandler(int x,
int y)
mouseHandler() - search for the active bin if any |
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
mouseReleased() - process mouse event |
void |
paintComponent(java.awt.Graphics g)
paintComponent() - draw histogram of hist[]. |
boolean |
setHistData(java.lang.String title,
java.lang.String dataName,
java.lang.String dataUnits,
java.lang.String horizCaption,
java.lang.String vertCaption,
int[] hist,
float minDataValue,
float maxDataValue)
setHistData() - set the hist data, title, Horiz and Vert captions and then repaint to start drawing it. |
| 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, 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 |
| 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 static CmpShowImage csi
private static CmpSpots cs
private static Util util
public int preferredWidth
public int preferredHeight
private java.awt.Font mediumFont
private java.awt.Font largeFont
private java.awt.Color optBkgrdColor
private java.awt.Color histColor
private java.awt.Color histTopColor
private java.awt.Color activeBinColor
private java.awt.Color meanValueBinColor
private java.awt.Color modeValueBinColor
private java.awt.Color medianValueBinColor
private java.awt.Color labelColor
java.awt.Dimension frameSize
private int cWidth
private int cHeight
private java.lang.String dataName
private java.lang.String dataUnits
private int[] sHist
private int nShist
private int[] sHistDisp
private int[] xPainted
public int activeBin
public float activeBinValue
public int xULHC
public int yULHC
public int xLRHC
public int yLRHC
public int minShistIdx
public int maxShistIdx
public int meanShistIdx
public int medianShistIdx
public int modeShistIdx
public int minShistFreq
public int maxShistFreq
public int minHistFreqValue
public int maxHistFreqValue
public float meanDataValue
public float medianDataValue
public float modeDataValue
public int meanDataGrayValue
public int medianDataGrayValue
public int modeDataGrayValue
public float minDataValue
public float maxDataValue
public float binScale
public float scaleFreq
| Constructor Detail |
|---|
public DrawHistogram(CmpShowImage csi,
java.awt.Dimension frameSize)
csi - is CmpShowImageframeSize - is size of canvas| Method Detail |
|---|
public java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponent
public boolean setHistData(java.lang.String title,
java.lang.String dataName,
java.lang.String dataUnits,
java.lang.String horizCaption,
java.lang.String vertCaption,
int[] hist,
float minDataValue,
float maxDataValue)
title - title of histogramdataName - of the type of data useddataUnits - of the type of data usedhorizCaption - horizontal captionvertCaption - vertical captionhist - is the histogram array of any sizeminDataValue - is the value the data at hist[0]maxDataValue - is the value the data at hist[max index]
private static final void drawFilledBox(java.awt.Graphics g,
int xC,
int yC,
int width,
java.awt.Color color)
g - is graphics contextx - is center of objecty - is center of objectwidth - is width of objectcolor - is color to draw
private static final void drawFilledRectangle(java.awt.Graphics g,
int x1,
int x2,
int y1,
int y2,
java.awt.Color color)
g - is graphics contextx1 - is Left edgex1 - is Left edgey1 - is top edgecolor - is color to drawpublic void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentg - is graphics context
public boolean mouseHandler(int x,
int y)
x - mouse positiony - mouse position
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - is mouse pressed eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - is mouse pressed eventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic 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 mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||