|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
CADI.Viewer.Viewer
public class Viewer
This class defines the main frame of the CADI Viewer application.
| 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 |
|---|
private static final java.lang.String APPLICATION_TITLE
private static final int DEFAULT_HEIGHT
private static final int DEFAULT_WIDTH
DEFAULT_HEIGHT to have a good aspect.
private static final int CONTROL_PANE_WIDTH
private static final int MAX_NUMBER_LAST_REQUEST
private javax.swing.JPanel jFrameContentPane
private javax.swing.JMenuBar menuBar
private javax.swing.JToolBar toolBar
private javax.swing.JSplitPane splitPane
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.
private DisplayPane displayPane
private javax.swing.JPanel statusBar
statusText,
speedAndTargetMonitor,
memoryMonitorBarprivate javax.swing.JPanel controlPane
splitPane.
javax.swing.JButton backwardButton
javax.swing.JButton forwardButton
private javax.swing.JTextField URLTextField
private javax.swing.JList componentList
controlPane.
javax.swing.DefaultListModel listModel
componentList.
private SliderAndSpinnerPanel resolutionLevelPanel
controlPane.
private SliderAndSpinnerPanel layerPanel
controlPane.
private SliderAndSpinnerPanel qualityPanel
controlPane.
private javax.swing.JButton controlAcceptButton
controlPane.
private javax.swing.JButton controlUndoButton
controlPane.
private ThumbnailDisplay thumbnailDisplay
displayPane.
private ImageData thumbnailData
thumbnailDisplay.
private javax.swing.JMenuItem openURL
openURLDialog where the target, server and port data will
be introduced.
private javax.swing.JMenuItem openImage
private javax.swing.JMenuItem closeImage
private javax.swing.JMenuItem closeSession
private javax.swing.JMenuItem saveAs
private javax.swing.JMenuItem saveCache
private javax.swing.JMenuItem exit
private javax.swing.JMenuItem preferences
private javax.swing.JMenuItem lookAndFeel
private javax.swing.JCheckBox automatic
private javax.swing.JMenuItem imageParameters
showImageParameters()) where the image data will be shown.
private javax.swing.JMenuItem frameSizeUpMenuItem
private javax.swing.JMenuItem frameSizeDownMenuItem
private javax.swing.JMenuItem layerUpMenuItem
private javax.swing.JMenuItem layerDownMenuItem
private StatusText statusText
private SpeedAndTargetMonitor speedAndTargetMonitor
private MemoryMonitorBar memoryMonitorBar
private java.lang.String server
private int port
serverprivate java.lang.String proxyServer
private int proxyPort
serverprivate java.lang.String target
private Client jpipClient
private ClientProperties clientProperties
preferences menu item.
private java.lang.String url
URLTextField by the
user, or the latest requested URL to be displayed in the
URLTextField.
private java.util.ArrayList<java.lang.String> urls
private int indexOfURL
private int[] components
private int resolutionLevel
private int layer
private int quality
private ImageData imageData
displayPane.
private java.awt.image.BufferedImage bufImage
private float[] fImagePixels
private OpenURLDialog openURLDialog
private OpenImageDialog openImageDialog
private boolean automaticMode
automaticprivate boolean imageEqualization
| Constructor Detail |
|---|
public Viewer()
| Method Detail |
|---|
public boolean getImage(int[] components,
int[] fsiz,
int[] roff,
int[] rsiz,
int layer,
int quality)
If an error is produced while image is recovering, a error message is shown.
components - definition in componentsfsiz - definition in ViewWindowField.fsizroff - definition in ViewWindowField.roffrsiz - definition in ViewWindowField.rsizlayer - definition in ViewWindowField.layersquality - JPIPResponseFields.quality
true if there is no error fetching the image.
Otherwise, returns false.
public boolean getImage(int[] components,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layer,
int quality)
If an error is produced while image is recovering, a error message is shown.
components - definition in componentsresolutionLevel - definition in resolutionLevelroff - definition in ViewWindowField.roffrsiz - definition in ViewWindowField.rsizlayer - definition in ViewWindowField.layersquality - JPIPResponseFields.quality
true if there is no error fetching the image.
Otherwise, returns false.public float getSpeed()
Client.getSpeed().
public long getDownloadedBytes()
Client.getDownloadedBytes().
private void createAndShowGUI()
private javax.swing.JMenuBar createMenuBar(int width,
int height)
private javax.swing.JPanel createJFrameContentPane(int width,
int height)
private javax.swing.JToolBar createToolBar(int width,
int height)
private javax.swing.JButton createButton(javax.swing.Icon icon,
java.lang.String toolTipText,
int width,
int height)
icon - the button's icontoolTipText - the text to display in the tool tip.width - width of the buttonheight - height of the button
private javax.swing.JSplitPane createSplitPane()
private javax.swing.JPanel createControlPane()
private javax.swing.JPanel createDisplayPane()
private javax.swing.JPanel createStatusAndProgressBar()
private javax.swing.JPanel createComponentPane(int panelWidth)
createControlPane()private javax.swing.JPanel createControlButtons()
createControlPane()private void openURL()
private void openImage()
private void automaticDisplay()
private void closeImage()
private void closeSession()
private void showImageParameters()
private void exit()
private void resetSlidersAndSpinners()
private void saveImage()
private void saveCache()
private void getImage(java.lang.String url)
URLTextField.
url - the URL to locate theprivate void displayThumbnail()
private void changePreferences()
private void changeLookAndFeel()
private void setThresholdsAndColorMaps()
public void rePaintImage()
private java.awt.image.BufferedImage imageSamplesToBufferedImage(float[][][] imageSamplesFloat)
imageSamplesFloat - a three-dimensional array with the image
samples
private java.awt.image.BufferedImage imageSamplesToBufferedImageThumbnail(float[][][] imageSamplesFloatThumbnail,
int[] precision)
imageSamplesFloatThumbnail - a three-dimensional array with the
image samplesprecision - an one-dimensional array with the precision (bit-depth)
for each image component.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||