jip
Class HistogramWindow

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--jip.HistogramWindow
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class HistogramWindow
extends javax.swing.JFrame
implements java.awt.event.ActionListener

Descripción:
Clase que calcula y muestra los resultados del histograma para la secuencia o el frame seleccionado. Tambien puede generar el resultado como imagen o cono fichero ASCII.

See Also:
Serialized Form

Inner Class Summary
 class HistogramWindow.MyMouseListener
           Descripción:
Clase para escuchar y capturar eventos de raton.
 
Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  javax.swing.JLabel cota_maxima
          Cota Máxima
(package private)  int div
          Variable Auxiliar
(package private)  int hBlue
          Variable Auxiliar.
(package private)  int hByte
          Variable Auxiliar.
(package private)  int hGreen
          Variable Auxiliar.
(package private)  int his
          Variable Auxiliar.
(package private)  int hLum
          Variable Auxiliar.
(package private)  int hReal
          Variable Auxiliar.
(package private)  int hRed
          Variable Auxiliar.
(package private)  int hWord
          Variable Auxiliar.
(package private)  JIPImage img
          Imagen de entrada
(package private)  javax.swing.JLabel in
          Etiqueta para valores de Intensidad
(package private)  javax.swing.JLabel intensidad
          Etiqueta de Intensidad
(package private)  int max
          Variable Auxiliar
(package private)  int maximo
          Variable Auxiliar
(package private)  javax.swing.JMenuBar menuBar
          Barra de Menú
(package private)  HistogramWindow.MyMouseListener mml
          Mouse Listener
(package private)  int nIntR
          Variable Auxiliar.
(package private)  int nItems
          Número de Items
(package private)  javax.swing.JLabel oc
          Etiqueta para Valores de Ocurrencias
(package private)  javax.swing.JLabel ocurrencias
          Numero de Ocurrencias
(package private)  javax.swing.JPanel pane
          Panel
(package private)  int[] ptos
          Array de puntos
(package private)  float[] ptosF
          Array de puntos (flotantes)
(package private)  RealDataHistogram[] ptosR
          Array de ocurrencias e intensidades
(package private)  int[] ptosW
          Array de puntos (enteros)
(package private)  JIPImage res
          Imagen de salida
 
Fields inherited from class javax.swing.JFrame
accessibleContext, defaultCloseOperation, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, warningString, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
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
HistogramWindow(JIPImage image)
           Descripción:
Contructor de la clase.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           Descripción:
Metodo para la relizacion de los calculos segun el evento dado.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, 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, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

menuBar

javax.swing.JMenuBar menuBar
Barra de Menú

img

JIPImage img
Imagen de entrada

res

JIPImage res
Imagen de salida

intensidad

javax.swing.JLabel intensidad
Etiqueta de Intensidad

ocurrencias

javax.swing.JLabel ocurrencias
Numero de Ocurrencias

in

javax.swing.JLabel in
Etiqueta para valores de Intensidad

oc

javax.swing.JLabel oc
Etiqueta para Valores de Ocurrencias

cota_maxima

javax.swing.JLabel cota_maxima
Cota Máxima

pane

javax.swing.JPanel pane
Panel

mml

HistogramWindow.MyMouseListener mml
Mouse Listener

max

int max
Variable Auxiliar

nItems

int nItems
Número de Items

his

int his
Variable Auxiliar. Indica si existe algun histograma calculado

hLum

int hLum
Variable Auxiliar. Indica si existe histograma de luminosidad

hRed

int hRed
Variable Auxiliar. Indica si existe histograma de rojo

hGreen

int hGreen
Variable Auxiliar. Indica si existe histograma de verde

hBlue

int hBlue
Variable Auxiliar. Indica si existe histograma de azul

hByte

int hByte
Variable Auxiliar. Indica si existe histograma de Byte

hWord

int hWord
Variable Auxiliar. Indica si existe histograma de Word

hReal

int hReal
Variable Auxiliar. Indica si existe histograma de Real

nIntR

int nIntR
Variable Auxiliar. Indica el numero de intensidades de tipo real

maximo

int maximo
Variable Auxiliar

div

int div
Variable Auxiliar

ptos

int[] ptos
Array de puntos

ptosW

int[] ptosW
Array de puntos (enteros)

ptosF

float[] ptosF
Array de puntos (flotantes)

ptosR

RealDataHistogram[] ptosR
Array de ocurrencias e intensidades
Constructor Detail

HistogramWindow

public HistogramWindow(JIPImage image)

Descripción:
Contructor de la clase. En el constructor se inicializan las estructuras de datos necesarias para la realizacion de los calculos. Algunas estructuras son dependientes del tipo de la imagen a tratar. Otras son comunes para cualquier tipo de imagen. Los tipos tratados son: [tCOLOR, tBYTE, tBIT, tWORD y tREAL] Segun el tipo: [tCOLOR]: Este tipo genera un menu con cuatro histogramas distintos. Estos son, Histograma de luminosidad, resultado de la media de los histogramas RGB. Histograma RED, Histograma GREEN, Histograma BLUE, para las tres bandas correspondientes. [tBYTE, tBIT, tWORD, tREAL]: Para estos tipos solo se genera un histograma completo. Dentro de cada menu existen dos opciones, Guardar ASCII y Guardar JIP, estas opciones son accesibles una vez hayamos calculado algun histograma y permiten salvar los datos del mismo como fichero ASCII o como imagen respectivamente. Estructuras comunes: Las estructuras comunes son aquellas que nos indican datos numericos sobre el histograma. Estas son comunes a todos los tipos y su descripcion es la siguiente: Intensidad: Muestra la intensidad selecionada. Ocurrencias: Muestra el numero total de ocurrencias en % para la intensidad selecionada. Maximo: Muestra el numero maximo de ocurrencias dado en la imagen.

Parameters:
image - Objeto JIPImage a tratar perteneciente a la secuencia
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

Descripción:
Metodo para la relizacion de los calculos segun el evento dado.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - , evento tratado, segun dicho evento se realizaran los siguientes acciones: Guardar ASCII: el histograma mostrado por pantalla se guardara en modo texto en el fichero creado para tal efecto y cuyo nombre dependera del tipo de imagen y del histograma calculado para ella. Cuando se seleciona esta opcion del menu no se calcula el histograma, para que esta opcion funcione debe haber un histograma ya calculado. En el caso de que no haya ningun histograma la opcion no hace nada. Guardar JIP: Esta opcion, como la anterior, graba el histograma mostrado en forma de secuencia JIP con un solo frame, cuyo tipo es el mismo que el de la imagen de entrada. El nombre del fichero viene dado segun el nombre de la imagen y el tipo de histograma selecionado.