public class ImageDisplayPanel extends JPanel implements MouseMotionListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected JButton |
autocutButton |
protected int |
bitpix
number of bits per pixel in source image
|
protected JLabel |
bitpixLabel |
protected JLabel |
bitpixValue |
protected JLabel |
decLabel |
protected JLabel |
decValue |
protected JLabel |
equinoxLabel |
protected JLabel |
equinoxValue |
protected JLabel |
highLabel |
protected JTextField |
highValue |
protected MainImageDisplay |
imageDisplay |
protected ImageProcessor |
imageProcessor |
protected GridBagUtil |
layout |
protected JLabel |
lowLabel |
protected JTextField |
lowValue |
protected JLabel |
maxLabel |
protected static int |
maxScale |
protected JLabel |
maxValue |
protected JLabel |
minLabel |
protected static int |
minScale |
protected JLabel |
minValue |
protected static NumberFormat |
nf
Used to format pixel coordinates.
|
protected JLabel |
objectLabel |
protected JLabel |
objectValue |
protected int |
orient
panel orientation: one of SwingConstants.HORIZONTAL, .VERTICAL
|
protected JLabel |
raLabel |
protected JLabel |
raValue |
protected JLabel |
scaleLabel |
protected JMenu |
scaleMenu |
protected JMenuBar |
scaleMenuBar |
protected JLabel |
valueLabel |
protected JLabel |
valueValue |
protected JLabel |
xLabel |
protected JLabel |
xValue |
protected JLabel |
yLabel |
protected JLabel |
yValue |
protected JButton |
zoomInButton |
protected JButton |
zoomOutButton |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ImageDisplayPanel()
Default constructor: must call setImageDisplay() later
|
ImageDisplayPanel(MainImageDisplay imageDisplay)
Constructor: defaults to vertical layout
|
ImageDisplayPanel(MainImageDisplay imageDisplay,
int orient)
Create a panel for controlling the given image display
|
Modifier and Type | Method and Description |
---|---|
protected void |
addScaleMenuItem(ButtonGroup group,
String label,
float value)
Add a radio button menu item to the scale menu and given group
with the given label and scale value.
|
protected void |
autoSetCutLevels()
Automatically set the image cut levels based on the image data
|
int |
getBitsPerPixel()
Return the number of bits per pixel in the source image.
|
MainImageDisplay |
getImageDisplay() |
String |
getObjectName()
Return the name of the source image, if known, otherwise an empty string.
|
String |
getScaleLabel(float value)
Get the scale menu label for the given float scale factor.
|
protected void |
horizontalPanelLayout()
Combine the panel items in a horizontal layout
|
void |
incScale(boolean zoomIn)
Zoom the image in or out, depending on the given argument.
|
protected void |
makePanelItems()
Make the display panel items
|
protected void |
makeScaleMenu()
Add a menu with zoom settings
|
protected void |
makeZoomButtons()
Add buttons "Z" and "z" to zoom in and out by 1 factor.
|
void |
mouseDragged(MouseEvent e)
Invoked when a mouse button is pressed on the image and then
dragged.
|
void |
mouseMoved(MouseEvent e) |
protected void |
setCutLevels()
Set the image cut levels according to the values in the low and high cut level
fields.
|
void |
setImageDisplay(MainImageDisplay imageDisplay)
Set the ImageDisplay to work with
|
void |
setScale(float value)
Set the scale for the image to the given value and update the menu
label.
|
protected void |
updateValues()
fill in the label and text field values, where known
|
protected void |
verticalPanelLayout()
Combine the panel items in a vertical layout
|
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 ImageProcessor imageProcessor
protected MainImageDisplay imageDisplay
protected GridBagUtil layout
protected JLabel objectLabel
protected JLabel objectValue
protected JLabel xLabel
protected JLabel xValue
protected JLabel yLabel
protected JLabel yValue
protected JLabel valueLabel
protected JLabel valueValue
protected JLabel raLabel
protected JLabel raValue
protected JLabel decLabel
protected JLabel decValue
protected JLabel equinoxLabel
protected JLabel equinoxValue
protected JLabel minLabel
protected JLabel minValue
protected JLabel maxLabel
protected JLabel maxValue
protected JLabel bitpixLabel
protected JLabel bitpixValue
protected JLabel lowLabel
protected JTextField lowValue
protected JLabel highLabel
protected JTextField highValue
protected JButton autocutButton
protected JLabel scaleLabel
protected JMenuBar scaleMenuBar
protected JMenu scaleMenu
protected JButton zoomInButton
protected JButton zoomOutButton
protected static final int minScale
protected static final int maxScale
protected int orient
protected int bitpix
protected static NumberFormat nf
public ImageDisplayPanel(MainImageDisplay imageDisplay, int orient)
public ImageDisplayPanel(MainImageDisplay imageDisplay)
public ImageDisplayPanel()
public void setImageDisplay(MainImageDisplay imageDisplay)
public MainImageDisplay getImageDisplay()
protected void makePanelItems()
protected void makeScaleMenu()
protected void addScaleMenuItem(ButtonGroup group, String label, float value)
public void setScale(float value)
public String getScaleLabel(float value)
public void incScale(boolean zoomIn)
protected void makeZoomButtons()
protected void horizontalPanelLayout()
protected void verticalPanelLayout()
protected void updateValues()
public String getObjectName()
public int getBitsPerPixel()
protected void setCutLevels()
protected void autoSetCutLevels()
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.