CADI.Viewer
Class Viewer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by CADI.Viewer.Viewer
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class Viewer
extends javax.swing.JFrame

This class defines the main frame of the CADI Viewer application.

Version:
1.0.2 2009/05/01
Author:
Group on Interactive Coding of Images (GICI)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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 static java.lang.String APPLICATION_TITLE
          The application's title.
private  javax.swing.JCheckBox automatic
          It is the item "Automatic" of the menu "Edit".
private  boolean automaticMode
          Indicates whether the automatic mode for recovering the image quality is or not set.
(package private)  javax.swing.JButton backwardButton
          Backward button in the tool bar.
private  java.awt.image.BufferedImage bufImage
           
private  ClientProperties clientProperties
          This object contains the user preferences to be used by the JPIP client.
private  javax.swing.JMenuItem closeImage
          It is the item "Close image" of the menu "File"
private  javax.swing.JMenuItem closeSession
          It is the item "Close session" of the menu "File"
private  javax.swing.JList componentList
          This object is used to select the components of the image in the controlPane.
private  int[] components
          Contains the indixes of the image component which are being displayed.
private static int CONTROL_PANE_WIDTH
          Width of the control pane.
private  javax.swing.JButton controlAcceptButton
          It is the accept button of the controlPane.
private  javax.swing.JPanel controlPane
          This panel is used to place the application controls (sliders, spinners, thumbnail, ...) and it is the left side of the splitPane.
private  javax.swing.JButton controlUndoButton
          It is the undo button of the controlPane.
private static int DEFAULT_HEIGHT
          Default height of the viewer.
private static int DEFAULT_WIDTH
          Default width of the viewer.
private  DisplayPane displayPane
          This pane is used to display the image.
private  javax.swing.JMenuItem exit
          It is the item "Exit" of the menu "File" and it exits from the application.
private  float[] fImagePixels
           
(package private)  javax.swing.JButton forwardButton
          Forward button in the tool bar.
private  javax.swing.JMenuItem frameSizeDownMenuItem
          It is the item "Frame size down" of the menu "Tools".
private  javax.swing.JMenuItem frameSizeUpMenuItem
          It is the item "Frame size up" of the menu "Tools".
private  ImageData imageData
          This object contains the image that is being displayed in the displayPane.
private  boolean imageEqualization
           
private  javax.swing.JMenuItem imageParameters
          It is the item "Image parameters" of the menu "Tools".
private  int indexOfURL
           
private  javax.swing.JPanel jFrameContentPane
          It is the root pane of the application.
private  Client jpipClient
          This object is a JPIP client that will be used to get images from the server and to decompress them.
private  int layer
          Is the highest achieved layer of the displayed image.
private  javax.swing.JMenuItem layerDownMenuItem
          It is the item "Layer up" of the menu "Tools".
private  SliderAndSpinnerPanel layerPanel
          This object is used to control the layer slider and its associated spinner in the controlPane.
private  javax.swing.JMenuItem layerUpMenuItem
          It is the item "Layer up" of the menu "Tools".
(package private)  javax.swing.DefaultListModel listModel
          It is the list model of the componentList.
private  javax.swing.JMenuItem lookAndFeel
          It is the item "Look and Feel" of the menu "Edit".
private static int MAX_NUMBER_LAST_REQUEST
          Is the maximum number of the last request that will be saved to allow the backward.
private  MemoryMonitorBar memoryMonitorBar
          This object is used to monitor the memory consumption as a progress bar in the status bar.
private  javax.swing.JMenuBar menuBar
          Menu bar for the menu options.
private  javax.swing.JMenuItem openImage
          It is the item "Open Image" of the menu "File" and it opens a local image.
private  OpenImageDialog openImageDialog
          This object creates a frame where the user can write the image to be loaded.
private  javax.swing.JMenuItem openURL
          It is the item "Open URL" of the menu "File".
private  OpenURLDialog openURLDialog
          This object creates a frame where the user can write the target to be requested, the server and the server's port.
private  int port
          It is the port number of the server.
private  javax.swing.JMenuItem preferences
          It is the item "Preferences" of the menu "Edit".
private  int proxyPort
          Is the port of the proxy.
private  java.lang.String proxyServer
          Is the name of the proxy server, if it is used.
private  int quality
          Is the quality, in percentage, of the displayed image.
private  SliderAndSpinnerPanel qualityPanel
          This object is used to control the quality level slider and its associated spinner in the controlPane.
private  int resolutionLevel
          Is the image resolution level that is being displayed.
private  SliderAndSpinnerPanel resolutionLevelPanel
          This object is used to control the resolution level slider and its associated spinner in the controlPane.
private  javax.swing.JMenuItem saveAs
          It is the item "Save as" of the menu "File" and it allows to save the actual image.
private  javax.swing.JMenuItem saveCache
          Is the item "Save cache" of the menu "File" and it allows to save the content of the client cache.
private  java.lang.String server
          Contains the server name where the image are get from.
private  SpeedAndTargetMonitor speedAndTargetMonitor
          This object is used to monitor the speed of the transmission and amount of recieved bytes in the status bar.
private  javax.swing.JSplitPane splitPane
          This pane will contain the controlPane on the left side and the displayPane on the right side.
private  javax.swing.JPanel statusBar
          This panel is used to display applications' status information.
private  StatusText statusText
          This object represent the status text of the status bar.
private  java.lang.String target
          It is the resource name (an image).
private  ImageData thumbnailData
          This object contains the thumbnail image to be displayed on the thumbnailDisplay.
private  ThumbnailDisplay thumbnailDisplay
          This object contains a thumbnail of the image which is being displayed in the displayPane.
private  javax.swing.JToolBar toolBar
          Tool bar where the buttons will be placed.
private  java.lang.String url
          Contains the url that has been put in the URLTextField by the user, or the latest requested URL to be displayed in the URLTextField.
private  java.util.ArrayList<java.lang.String> urls
           
private  javax.swing.JTextField URLTextField
          Is a text field that is placed in the tool bar and it is used for input an URL.
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Viewer()
          Constructor.
 
Method Summary
private  void automaticDisplay()
          This method performs an automatic recovering of the image.
private  void changeLookAndFeel()
          Changes the look and feel.
private  void changePreferences()
          Changes the the jpip client preferences.
private  void closeImage()
          Close the connection with the jpip client;
private  void closeSession()
          Close the jpip client session.
private  void createAndShowGUI()
          Creates and shows the graphical user interface.
private  javax.swing.JButton createButton(javax.swing.Icon icon, java.lang.String toolTipText, int width, int height)
          Creates a button with a fixes dimensions.
private  javax.swing.JPanel createComponentPane(int panelWidth)
          Creates the component pane.
private  javax.swing.JPanel createControlButtons()
          Creates the control buttons panel of the control panel.
private  javax.swing.JPanel createControlPane()
          Creates the control pane, where the sliders and spinners will be located.
private  javax.swing.JPanel createDisplayPane()
          Creates de display pane.
private  javax.swing.JPanel createJFrameContentPane(int width, int height)
          Creates the principal content pane.
private  javax.swing.JMenuBar createMenuBar(int width, int height)
          This method creates the menu bar
private  javax.swing.JSplitPane createSplitPane()
          Creates the split pane.
private  javax.swing.JPanel createStatusAndProgressBar()
          Creates the status text and the progress bar.
private  javax.swing.JToolBar createToolBar(int width, int height)
          Creates the tool bar.
private  void displayThumbnail()
          Displays a thumbnail of the main image.
private  void exit()
          Closes the CADI Viewer application.
 long getDownloadedBytes()
          Definition in Client.getDownloadedBytes().
 boolean getImage(int[] components, int[] fsiz, int[] roff, int[] rsiz, int layer, int quality)
          Get the image at component, resolution level, layer, and quality required by the user.
 boolean getImage(int[] components, int resolutionLevel, int[] roff, int[] rsiz, int layer, int quality)
          Get the image at component, resolution level, layer, and quality required by the user.
private  void getImage(java.lang.String url)
          Gets an image from a URL.
 float getSpeed()
          Definition in Client.getSpeed().
private  java.awt.image.BufferedImage imageSamplesToBufferedImage(float[][][] imageSamplesFloat)
          This method converts from a three dimensional array representation to a bufferered image representation.
private  java.awt.image.BufferedImage imageSamplesToBufferedImageThumbnail(float[][][] imageSamplesFloatThumbnail, int[] precision)
          This method converts from a three dimensional array representation to a bufferered image representation.
private  void openImage()
          Opens the Open Image Dialog window and get the specifies image and properties.
private  void openURL()
          Opens the URL Dialog window and get the specifies target.
 void rePaintImage()
          This method forces the repainting of the displayed image.
private  void resetSlidersAndSpinners()
          Resets the sliders and spinners with the new image values.
private  void saveCache()
          Save the client cache in a file.
private  void saveImage()
          Save the image samples in a file.
private  void setThresholdsAndColorMaps()
          This method sets visible thresholds and changes colormap of the displayed image.
private  void showImageParameters()
          Show the image parameters for image which is being showed.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

APPLICATION_TITLE

private static final java.lang.String APPLICATION_TITLE
The application's title.

See Also:
Constant Field Values

DEFAULT_HEIGHT

private static final int DEFAULT_HEIGHT
Default height of the viewer.

See Also:
Constant Field Values

DEFAULT_WIDTH

private static final int DEFAULT_WIDTH
Default width of the viewer. Its value is a proportion of the DEFAULT_HEIGHT to have a good aspect.

See Also:
Constant Field Values

CONTROL_PANE_WIDTH

private static final int CONTROL_PANE_WIDTH
Width of the control pane. Its value is adjusted to have a good look of the controls' sliders and spinners.

See Also:
Constant Field Values

MAX_NUMBER_LAST_REQUEST

private static final int MAX_NUMBER_LAST_REQUEST
Is the maximum number of the last request that will be saved to allow the backward.

See Also:
Constant Field Values

jFrameContentPane

private javax.swing.JPanel jFrameContentPane
It is the root pane of the application.


menuBar

private javax.swing.JMenuBar menuBar
Menu bar for the menu options.


toolBar

private javax.swing.JToolBar toolBar
Tool bar where the buttons will be placed.


splitPane

private javax.swing.JSplitPane splitPane
This pane will contain the controlPane on the left side and the displayPane on the right side. The width of the left size is fixed (see CONTROL_PANE_WIDTH) and it cannot be changed.


displayPane

private DisplayPane displayPane
This pane is used to display the image.


statusBar

private javax.swing.JPanel statusBar
This panel is used to display applications' status information.

See Also:
statusText, speedAndTargetMonitor, memoryMonitorBar

controlPane

private javax.swing.JPanel controlPane
This panel is used to place the application controls (sliders, spinners, thumbnail, ...) and it is the left side of the splitPane.


backwardButton

javax.swing.JButton backwardButton
Backward button in the tool bar.


forwardButton

javax.swing.JButton forwardButton
Forward button in the tool bar.


URLTextField

private javax.swing.JTextField URLTextField
Is a text field that is placed in the tool bar and it is used for input an URL.


componentList

private javax.swing.JList componentList
This object is used to select the components of the image in the controlPane.


listModel

javax.swing.DefaultListModel listModel
It is the list model of the componentList.


resolutionLevelPanel

private SliderAndSpinnerPanel resolutionLevelPanel
This object is used to control the resolution level slider and its associated spinner in the controlPane.


layerPanel

private SliderAndSpinnerPanel layerPanel
This object is used to control the layer slider and its associated spinner in the controlPane.


qualityPanel

private SliderAndSpinnerPanel qualityPanel
This object is used to control the quality level slider and its associated spinner in the controlPane.


controlAcceptButton

private javax.swing.JButton controlAcceptButton
It is the accept button of the controlPane.


controlUndoButton

private javax.swing.JButton controlUndoButton
It is the undo button of the controlPane.


thumbnailDisplay

private ThumbnailDisplay thumbnailDisplay
This object contains a thumbnail of the image which is being displayed in the displayPane.


thumbnailData

private ImageData thumbnailData
This object contains the thumbnail image to be displayed on the thumbnailDisplay.


openURL

private javax.swing.JMenuItem openURL
It is the item "Open URL" of the menu "File". It opens the openURLDialog where the target, server and port data will be introduced.


openImage

private javax.swing.JMenuItem openImage
It is the item "Open Image" of the menu "File" and it opens a local image.


closeImage

private javax.swing.JMenuItem closeImage
It is the item "Close image" of the menu "File"


closeSession

private javax.swing.JMenuItem closeSession
It is the item "Close session" of the menu "File"


saveAs

private javax.swing.JMenuItem saveAs
It is the item "Save as" of the menu "File" and it allows to save the actual image.


saveCache

private javax.swing.JMenuItem saveCache
Is the item "Save cache" of the menu "File" and it allows to save the content of the client cache.


exit

private javax.swing.JMenuItem exit
It is the item "Exit" of the menu "File" and it exits from the application.


preferences

private javax.swing.JMenuItem preferences
It is the item "Preferences" of the menu "Edit". It opens a window where the client parameters.


lookAndFeel

private javax.swing.JMenuItem lookAndFeel
It is the item "Look and Feel" of the menu "Edit". It opens a window where the application's look and feel can be changed.


automatic

private javax.swing.JCheckBox automatic
It is the item "Automatic" of the menu "Edit". It allows to choose the automatic image recovering.


imageParameters

private javax.swing.JMenuItem imageParameters
It is the item "Image parameters" of the menu "Tools". It opens a frame (see showImageParameters()) where the image data will be shown.


frameSizeUpMenuItem

private javax.swing.JMenuItem frameSizeUpMenuItem
It is the item "Frame size up" of the menu "Tools". It increases the frame size of the displayed image.


frameSizeDownMenuItem

private javax.swing.JMenuItem frameSizeDownMenuItem
It is the item "Frame size down" of the menu "Tools". It decreases the frame size of the displayed image.


layerUpMenuItem

private javax.swing.JMenuItem layerUpMenuItem
It is the item "Layer up" of the menu "Tools". It increases the quality layer of the displayed image.


layerDownMenuItem

private javax.swing.JMenuItem layerDownMenuItem
It is the item "Layer up" of the menu "Tools". It decreases the quality layer of the displayed image.


statusText

private StatusText statusText
This object represent the status text of the status bar.


speedAndTargetMonitor

private SpeedAndTargetMonitor speedAndTargetMonitor
This object is used to monitor the speed of the transmission and amount of recieved bytes in the status bar.


memoryMonitorBar

private MemoryMonitorBar memoryMonitorBar
This object is used to monitor the memory consumption as a progress bar in the status bar.


server

private java.lang.String server
Contains the server name where the image are get from.


port

private int port
It is the port number of the server.

See Also:
server

proxyServer

private java.lang.String proxyServer
Is the name of the proxy server, if it is used.


proxyPort

private int proxyPort
Is the port of the proxy.

See Also:
server

target

private java.lang.String target
It is the resource name (an image).


jpipClient

private Client jpipClient
This object is a JPIP client that will be used to get images from the server and to decompress them.


clientProperties

private ClientProperties clientProperties
This object contains the user preferences to be used by the JPIP client. It values are set through the preferences menu item.


url

private java.lang.String url
Contains the url that has been put in the URLTextField by the user, or the latest requested URL to be displayed in the URLTextField.


urls

private java.util.ArrayList<java.lang.String> urls

indexOfURL

private int indexOfURL

components

private int[] components
Contains the indixes of the image component which are being displayed.


resolutionLevel

private int resolutionLevel
Is the image resolution level that is being displayed.


layer

private int layer
Is the highest achieved layer of the displayed image.


quality

private int quality
Is the quality, in percentage, of the displayed image.


imageData

private ImageData imageData
This object contains the image that is being displayed in the displayPane.


bufImage

private java.awt.image.BufferedImage bufImage

fImagePixels

private float[] fImagePixels

openURLDialog

private OpenURLDialog openURLDialog
This object creates a frame where the user can write the target to be requested, the server and the server's port.


openImageDialog

private OpenImageDialog openImageDialog
This object creates a frame where the user can write the image to be loaded.


automaticMode

private boolean automaticMode
Indicates whether the automatic mode for recovering the image quality is or not set.

See Also:
automatic

imageEqualization

private boolean imageEqualization
Constructor Detail

Viewer

public Viewer()
Constructor.

Method Detail

getImage

public boolean getImage(int[] components,
                        int[] fsiz,
                        int[] roff,
                        int[] rsiz,
                        int layer,
                        int quality)
Get the image at component, resolution level, layer, and quality required by the user.

If an error is produced while image is recovering, a error message is shown.

Parameters:
components - definition in components
fsiz - definition in ViewWindowField.fsiz
roff - definition in ViewWindowField.roff
rsiz - definition in ViewWindowField.rsiz
layer - definition in ViewWindowField.layers
quality - JPIPResponseFields.quality
Returns:
true if there is no error fetching the image. Otherwise, returns false.

getImage

public boolean getImage(int[] components,
                        int resolutionLevel,
                        int[] roff,
                        int[] rsiz,
                        int layer,
                        int quality)
Get the image at component, resolution level, layer, and quality required by the user.

If an error is produced while image is recovering, a error message is shown.

Parameters:
components - definition in components
resolutionLevel - definition in resolutionLevel
roff - definition in ViewWindowField.roff
rsiz - definition in ViewWindowField.rsiz
layer - definition in ViewWindowField.layers
quality - JPIPResponseFields.quality
Returns:
true if there is no error fetching the image. Otherwise, returns false.

getSpeed

public float getSpeed()
Definition in Client.getSpeed().

Returns:
the speed in bytes per second.

getDownloadedBytes

public long getDownloadedBytes()
Definition in Client.getDownloadedBytes().

Returns:
the total downloaded bytes of this target.

createAndShowGUI

private void createAndShowGUI()
Creates and shows the graphical user interface.


createMenuBar

private javax.swing.JMenuBar createMenuBar(int width,
                                           int height)
This method creates the menu bar

Returns:
JMenuBar the menu bar.

createJFrameContentPane

private javax.swing.JPanel createJFrameContentPane(int width,
                                                   int height)
Creates the principal content pane.

Returns:
JPanel the principal content pane.

createToolBar

private javax.swing.JToolBar createToolBar(int width,
                                           int height)
Creates the tool bar.

Returns:
JToolBar the tool bar.

createButton

private javax.swing.JButton createButton(javax.swing.Icon icon,
                                         java.lang.String toolTipText,
                                         int width,
                                         int height)
Creates a button with a fixes dimensions.

Parameters:
icon - the button's icon
toolTipText - the text to display in the tool tip.
width - width of the button
height - height of the button
Returns:
a JButton

createSplitPane

private javax.swing.JSplitPane createSplitPane()
Creates the split pane.

Returns:
JSplitPane the split pane.

createControlPane

private javax.swing.JPanel createControlPane()
Creates the control pane, where the sliders and spinners will be located.

Returns:
the control pane.

createDisplayPane

private javax.swing.JPanel createDisplayPane()
Creates de display pane. This is the pane where image will be dispalyed.

Returns:
the display pane.

createStatusAndProgressBar

private javax.swing.JPanel createStatusAndProgressBar()
Creates the status text and the progress bar.

Returns:
the status text and the progress bar.

createComponentPane

private javax.swing.JPanel createComponentPane(int panelWidth)
Creates the component pane.

Returns:
a JPanel with the component pane.
See Also:
createControlPane()

createControlButtons

private javax.swing.JPanel createControlButtons()
Creates the control buttons panel of the control panel.

Returns:
the control buttons panel
See Also:
createControlPane()

openURL

private void openURL()
Opens the URL Dialog window and get the specifies target.


openImage

private void openImage()
Opens the Open Image Dialog window and get the specifies image and properties.


automaticDisplay

private void automaticDisplay()
This method performs an automatic recovering of the image.


closeImage

private void closeImage()
Close the connection with the jpip client;


closeSession

private void closeSession()
Close the jpip client session.


showImageParameters

private void showImageParameters()
Show the image parameters for image which is being showed.


exit

private void exit()
Closes the CADI Viewer application.


resetSlidersAndSpinners

private void resetSlidersAndSpinners()
Resets the sliders and spinners with the new image values.


saveImage

private void saveImage()
Save the image samples in a file.


saveCache

private void saveCache()
Save the client cache in a file.


getImage

private void getImage(java.lang.String url)
Gets an image from a URL. This method is used to get an image from the URL which has been input in the URLTextField.

Parameters:
url - the URL to locate the

displayThumbnail

private void displayThumbnail()
Displays a thumbnail of the main image.


changePreferences

private void changePreferences()
Changes the the jpip client preferences.


changeLookAndFeel

private void changeLookAndFeel()
Changes the look and feel.


setThresholdsAndColorMaps

private void setThresholdsAndColorMaps()
This method sets visible thresholds and changes colormap of the displayed image.


rePaintImage

public void rePaintImage()
This method forces the repainting of the displayed image.


imageSamplesToBufferedImage

private java.awt.image.BufferedImage imageSamplesToBufferedImage(float[][][] imageSamplesFloat)
This method converts from a three dimensional array representation to a bufferered image representation.

Parameters:
imageSamplesFloat - a three-dimensional array with the image samples
Returns:
a buffered image.

imageSamplesToBufferedImageThumbnail

private java.awt.image.BufferedImage imageSamplesToBufferedImageThumbnail(float[][][] imageSamplesFloatThumbnail,
                                                                          int[] precision)
This method converts from a three dimensional array representation to a bufferered image representation.

Parameters:
imageSamplesFloatThumbnail - a three-dimensional array with the image samples
precision - an one-dimensional array with the precision (bit-depth) for each image component.
Returns:
a buffered image.


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)