|
|||||||||
| 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
CADI.Viewer.Display.DisplayPane
public class DisplayPane
This class implements a panel where the images will be displayed. When image size is greater than the displayer panel, scrolling is supporting automatically.
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
| Nested Class Summary | |
|---|---|
(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. |
| 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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
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. |
| 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 | |
|---|---|
DisplayPane(javax.swing.JFrame parent,
int width,
int height,
ImageData imageData)
Constructor. |
|
| Method Summary | |
|---|---|
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. |
| 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, 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, 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 |
| 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 |
|---|
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
scrollerprivate javax.swing.JScrollBar verticalScrollBar
scrollerprivate 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
selectionAreaprivate java.awt.Point panningOrigin
private DisplayPane.ScrollBarsAdjustmentListener listener
| Constructor Detail |
|---|
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 panel| Method Detail |
|---|
public 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.
action - definition in action.actionpublic 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.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 mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic 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 | ||||||||