public class DisplayPane
extends javax.swing.JPanel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
This class needs an object of the parent because when a region size is selected a new window of interest must be requested. This request is performed through a method of the parent object.
Usage example:
constructor
setThumbnailDisplayer
displayImage
clear || setAction || increaseResolutionLevel ||
decreaseResolutionLevel || increaseQualityLayer || decreaseQualityLayer
Modifier and Type | Class and Description |
---|---|
(package private) class |
DisplayPane.Displayer
This class implements the drawing area where image will be displayed.
|
(package private) class |
DisplayPane.ScrollBarsAdjustmentListener
This class is used to manage the scroll bars adjustment listener.
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
private int |
action
Indicates the action which is doing on the displayer.
|
private java.awt.Cursor |
cursor
Indicates the cursor type used into the image area.
|
private DisplayPane.Displayer |
displayer
Is the panel where images will be displayed, i.e. the drawing area.
|
private int[] |
fsiz
Frame size
|
private int |
height
Height of the panel.
|
private javax.swing.JScrollBar |
horizontalScrollBar
Horizontal scroll bar of the scroll pane
|
private java.awt.Image |
image
Image to be displayer
|
private ImageData |
imageData |
private DisplayPane.ScrollBarsAdjustmentListener |
listener
Scroll bars listener
|
static int |
NOTHING |
static int |
PANNING |
private java.awt.Point |
panningOrigin
Contains the initial mouse coordinates when a panning is being done.
|
private javax.swing.JFrame |
parent
Reference to the parent object.
|
private int[] |
roff
Region offset
|
private int[] |
rsiz
Region size
|
private javax.swing.JScrollPane |
scroller
Is a scroll pane where the
displayer will be placed. |
static int |
SELECTING |
private java.awt.Rectangle |
selectionArea
Contains the rectangle coordinates (upper left corner, width and height)
of the selected area on the Image Display Area.
|
private java.awt.Color |
selectionAreaColor
Indicates the color that will be used when a window of interes is
selected
|
private ThumbnailDisplay |
thumbnailDisplay
Reference to the thumbnail display panel.
|
private javax.swing.JScrollBar |
verticalScrollBar
Vertical scroll bar of the scroll pane
|
static int |
WAITING |
private int |
width
Width of the panel.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DisplayPane(javax.swing.JFrame parent,
int width,
int height,
ImageData imageData)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the thumbnail display.
|
void |
decreaseQualityLayer()
Reduce the quality layer reducing the of the recovered image.
|
void |
decreaseResolutionLevel()
Decreases the frame size.
|
void |
displayImage(java.awt.image.BufferedImage bufImage,
int[] fsiz,
int[] roff,
int[] rsiz)
Displays an image in the displayer.
|
java.awt.Dimension |
getViewportSize()
Returns the current size of the image scroll pane's view port (the size
of the image display area)
|
void |
increaseQualityLayer()
Gets a new quality layer to improve the quality of the recovered image..
|
void |
increaseResolutionLevel()
Increases the frame size.
|
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 |
rePaintImage()
This method forces to displayed image to be repainted.
|
void |
setAction(int action)
Set the action which is doing in the display pane.
|
void |
setThumbnailDisplayer(ThumbnailDisplay thumbnailDisplay)
Sets a reference to the thumbnail display panel.
|
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, 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, 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, transferFocusBackward, transferFocusUpCycle
private javax.swing.JFrame parent
private int width
private int height
private java.awt.Image image
private ImageData imageData
private int[] fsiz
private int[] roff
private int[] rsiz
private ThumbnailDisplay thumbnailDisplay
ThumbnailDisplay.movePanner(int, int, int, int, int, int)
method is used.private int action
cursor
) will change depending of the value of this
attribue. The allowed values are:public static int NOTHING
public static int PANNING
public static int SELECTING
public static int WAITING
private javax.swing.JScrollPane scroller
displayer
will be placed.private javax.swing.JScrollBar horizontalScrollBar
scroller
private javax.swing.JScrollBar verticalScrollBar
scroller
private DisplayPane.Displayer displayer
private java.awt.Cursor cursor
The default cursor value is Cursor.DEFAULT_CURSOR
private java.awt.Rectangle selectionArea
private final java.awt.Color selectionAreaColor
selectionArea
private java.awt.Point panningOrigin
private DisplayPane.ScrollBarsAdjustmentListener listener
public DisplayPane(javax.swing.JFrame parent, int width, int height, ImageData imageData)
parent
- reference to the parent windowwidth
- width of the panelheight
- height of the panelpublic void setThumbnailDisplayer(ThumbnailDisplay thumbnailDisplay)
thumbnailDisplay
- reference to the thumbnail display panel.public void displayImage(java.awt.image.BufferedImage bufImage, int[] fsiz, int[] roff, int[] rsiz)
bufImage
- the image to be displayed.public void rePaintImage()
public void clear()
public void setAction(int action)
Moreover, the cursor type changes according to the action.
public void increaseResolutionLevel()
public void decreaseResolutionLevel()
public void increaseQualityLayer()
public void decreaseQualityLayer()
public java.awt.Dimension getViewportSize()
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
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)