Package org.eclipse.imagen.media.viewer
Class DisplayHistogram
Object
Component
Container
JComponent
DisplayHistogram
- All Implemented Interfaces:
MouseMotionListener,ImageObserver,MenuContainer,Serializable,EventListener
This class displays a histogram (instance of Histogram) as a component. Only the first histogram band ins considered
for plotting. The component has a tooltip which displays the bin index and bin count for the bin under the mouse
cursor.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Component
Component.BaselineResizeBehavior -
Field Summary
Fields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionDisplayHistogram(String title) The constructor for this class, which will set its fields' values and get some information about the histogram. -
Method Summary
Modifier and TypeMethodDescriptionThis method informs the maximum size of this component, which will be the same as the preferred size.This method informs the minimum size of this component, which will be the same as the preferred size.This method informs the preferred size of this component, which will be constant.voidThis method does not do anything, it is here to keep the MouseMotionListener interface happy.voidThis method will be called when the mouse is moved over the component.voidsetBinWidth(int newWidth) Override the default bin width (for plotting)voidsetHeight(int h) Override the default height for the plot.voidsetImage(PlanarImage wrapRenderedImage) voidsetIndexMultiplier(int i) Override the index multiplying factor (for bins with width !voidsetMaxCount(int m) Set the maximum value (used to scale the histogram y-axis).voidsetSkipIndexes(int i) Override the index skipping factor (determines how many labels will be printed on the index axis).Methods inherited from class JComponent
addAncestorListener, addNotify, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, 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, removeNotify, 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, updateUIMethods inherited from class Container
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, validateMethods inherited from class Component
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, getAccessibleContext, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, 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
-
Constructor Details
-
DisplayHistogram
The constructor for this class, which will set its fields' values and get some information about the histogram.- Parameters:
title- the title of the plot.
-
-
Method Details
-
setBinWidth
public void setBinWidth(int newWidth) Override the default bin width (for plotting) -
setHeight
public void setHeight(int h) Override the default height for the plot.- Parameters:
h- the new height.
-
setIndexMultiplier
public void setIndexMultiplier(int i) Override the index multiplying factor (for bins with width != 1) -
setSkipIndexes
public void setSkipIndexes(int i) Override the index skipping factor (determines how many labels will be printed on the index axis). -
setMaxCount
public void setMaxCount(int m) Set the maximum value (used to scale the histogram y-axis). The default value is defined in the constructor and can be overriden with this method. -
getMaximumSize
This method informs the maximum size of this component, which will be the same as the preferred size.- Overrides:
getMaximumSizein classJComponent
-
getMinimumSize
This method informs the minimum size of this component, which will be the same as the preferred size.- Overrides:
getMinimumSizein classJComponent
-
getPreferredSize
This method informs the preferred size of this component, which will be constant.- Overrides:
getPreferredSizein classJComponent
-
mouseDragged
This method does not do anything, it is here to keep the MouseMotionListener interface happy.- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
This method will be called when the mouse is moved over the component. It will set the tooltip text on the component to show the histogram data.- Specified by:
mouseMovedin interfaceMouseMotionListener
-
setImage
-