orgposada.nummethpos.vectorpos
Class PanelMatrix

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--orgposada.nummethpos.vectorpos.PanelMatrix
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class PanelMatrix
extends java.awt.Panel

Interfaz grafica para una matriz o vector.

Version:
1.0, 04/10/2001
Author:
Omar Posada Villarreal
See Also:
Serialized Form

Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
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
protected  java.awt.GridBagConstraints gbCons
          Restricciones de la distribucion de los componentes.
protected  java.awt.GridBagLayout gbLay
          Distribucion de los componentes.
protected  java.awt.Label labColumns
          Etiqueta para el numero de columnas.
 java.awt.Label labName
          Etiqueta para descripcion de la matriz.
protected  java.awt.Label labRows
          Etiqueta para el numero de renglones.
 java.awt.TextArea taMatrix
          Entrada de la matriz.
 java.awt.TextField tfColumns
          Entrada de el numero de columnas.
 java.awt.TextField tfRows
          Entrada del numero de renglones.
 
Fields inherited from class java.awt.Panel
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
accessibleContext, 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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PanelMatrix()
          Constructor similar al "Applet.init()" pero no es "Applet".
 
Method Summary
private  void addComponents()
          Declara, instancia, configura y agrega los componentes a los contenedores.
private  void addToGridBag(java.awt.Component comp, int row, int column, int width, int height, java.awt.GridBagLayout gridBagLay, java.awt.GridBagConstraints gridBagCons)
          Agrega un componente a una distribucion GridBag.
 double[][] getMatrix()
          Parsea el texto en busca de una matriz bien formada.
 double[] getVectorColumn()
          Obtiene el vector (o primera columna) de la matriz.
 void setForInput(boolean forInput)
          Establece si la matriz se puede o no cambiar.
private  void setGridBagConstraintsToDefault(java.awt.GridBagConstraints gridBagCons)
           
 void setMatrix(double[][] matrix)
          Muestra una matriz.
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, setLayout, transferFocus, update, validate, validateTree, writeObject
 
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, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

gbLay

protected java.awt.GridBagLayout gbLay
Distribucion de los componentes.

gbCons

protected java.awt.GridBagConstraints gbCons
Restricciones de la distribucion de los componentes.

labRows

protected java.awt.Label labRows
Etiqueta para el numero de renglones.

labColumns

protected java.awt.Label labColumns
Etiqueta para el numero de columnas.

labName

public java.awt.Label labName
Etiqueta para descripcion de la matriz.

tfRows

public java.awt.TextField tfRows
Entrada del numero de renglones.

tfColumns

public java.awt.TextField tfColumns
Entrada de el numero de columnas.

taMatrix

public java.awt.TextArea taMatrix
Entrada de la matriz.
Constructor Detail

PanelMatrix

public PanelMatrix()
Constructor similar al "Applet.init()" pero no es "Applet".
Method Detail

addComponents

private void addComponents()
                    throws java.lang.Exception
Declara, instancia, configura y agrega los componentes a los contenedores.

addToGridBag

private void addToGridBag(java.awt.Component comp,
                          int row,
                          int column,
                          int width,
                          int height,
                          java.awt.GridBagLayout gridBagLay,
                          java.awt.GridBagConstraints gridBagCons)
Agrega un componente a una distribucion GridBag.
Parameters:
comp - Componente a agregar.
row - Posicion vertical.
column - Posicion horizontal.
width - Columnas de ancho.
height - Renglones de altura.
gridBagLay - Distribucion.
gridBagCons - Restricciones.

setGridBagConstraintsToDefault

private void setGridBagConstraintsToDefault(java.awt.GridBagConstraints gridBagCons)

setForInput

public void setForInput(boolean forInput)
Establece si la matriz se puede o no cambiar.
Parameters:
forInput - true. Se puede cambiar. False. Sin cambios, para salida

getMatrix

public double[][] getMatrix()
                     throws java.lang.IllegalArgumentException
Parsea el texto en busca de una matriz bien formada.
Throws:
java.lang.IllegalArgumentException - Los renglones y columnas no son positivos, o el numero de elementos encontrados es menor del esperado (numero de elementos < (rows * columns) ). O por Problemas en la lectura de la cadena.

setMatrix

public void setMatrix(double[][] matrix)
Muestra una matriz. Las columnas se separan con tabulado "\t". Los renglones se separan con otra linea "\n".
Parameters:
matrix - Arreglo bidimensional.

getVectorColumn

public double[] getVectorColumn()
Obtiene el vector (o primera columna) de la matriz.
Returns:
Arreglo de un vector.