org.nuiton.math.matrix.gui
Class MatrixPanelEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.nuiton.math.matrix.gui.MatrixEditor
                      extended by org.nuiton.math.matrix.gui.MatrixPanelEditor
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.TableModelListener

public class MatrixPanelEditor
extends MatrixEditor
implements javax.swing.event.TableModelListener

JPanel contenant une JTable pour afficher une Matrice a une ou deux dimension. TODO: Une methode permettant de retourne la sous matrice de la selection que la matrice soit reprensentée en lineaire ou non. (avoir un mapping cellule de table vers element de matrice Created: 29 oct. 2004

Version:
$Revision: 168 $ Mise a jour: $Date: 2009-07-17 18:18:45 +0200 (ven., 17 juil. 2009) $ par : $Author: echatellier $
Author:
Benjamin Poussin
See Also:
Serialized Form

Nested Class Summary
 
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
protected  javax.swing.JButton bEdit
           
protected  boolean dimensionEdit
          Boolean to autorize matrice dimension changes.
protected  javax.swing.JScrollPane editArea
           
protected  boolean enabled
          Deprecated. since 2.0.0 : duplicate field from parent for nothing!
protected  boolean linearModel
          if true, use linear representation of matrix
protected  boolean linearModelShowDefault
          if false don't show default value in matrix (ex: 0)
protected  org.nuiton.util.ListenerSet<MatrixPanelListener> listeners
           
protected  MatrixND m
           
protected  MatrixPopupMenu popupMenu
           
protected  javax.swing.JTable table
           
protected  MatrixTableModel tableModel
           
protected  boolean visible
          Deprecated. since 2.0.0 : duplicate field from parent for nothing!
 
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
MatrixPanelEditor()
          Construct a new JPanel to edit matrix.
MatrixPanelEditor(boolean dimensionEdit)
          Construct a new JPanel to edit matrix.
MatrixPanelEditor(boolean dimensionEdit, int width, int height)
          Construct a new JPanel to edit matrix.
MatrixPanelEditor(MatrixND m, boolean dimensionEdit)
          Construct a new JPanel to edit matrix.
 
Method Summary
 void addMatrixListener(MatrixPanelListener l)
          Deprecated. since 2.0.0 : this is not a valid listener adder
 void addMatrixPanelListener(MatrixPanelListener l)
           
protected  void fireEvent()
           
 javax.swing.JButton getButtonEdit()
           
protected  MatrixFactory getFactory()
           
 MatrixND getMatrix()
           
 MatrixPanelListener[] getMatrixPanelListeners()
           
 javax.swing.JTable getTable()
           
protected  void initDimensionEdit()
           
protected  void initObject(MatrixND m)
           
protected  void initObjet()
           
 boolean isDimensionEdit()
          Get the value of dimensionEdit.
 boolean isEnabled()
           
 java.lang.Boolean isLinearModel()
           
 java.lang.Boolean isLinearModelShowDefault()
           
 boolean isVisible()
           
static void main(java.lang.String[] args)
          Une petite fonction main pour le test...
 void removeMatrixPanelListener(MatrixPanelListener l)
           
 void setDimensionEdit(boolean v)
          Set the value of dimensionEdit.
 void setEnabled(boolean enabled)
          Enable the matrix to be edited.
 void setLinearModel(java.lang.Boolean linearModel)
           
 void setLinearModelShowDefault(java.lang.Boolean linearModelShowDefault)
           
 void setMatrix(MatrixND m)
           
 void setVisible(boolean visible)
          Set the matrix visible.
 void tableChanged(javax.swing.event.TableModelEvent e)
           
 
Methods inherited from class org.nuiton.math.matrix.gui.MatrixEditor
setEnabled, setVisible
 
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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, 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, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, 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

listeners

protected org.nuiton.util.ListenerSet<MatrixPanelListener> listeners

table

protected javax.swing.JTable table

m

protected MatrixND m

tableModel

protected MatrixTableModel tableModel

editArea

protected javax.swing.JScrollPane editArea

popupMenu

protected MatrixPopupMenu popupMenu

linearModel

protected boolean linearModel
if true, use linear representation of matrix


linearModelShowDefault

protected boolean linearModelShowDefault
if false don't show default value in matrix (ex: 0)


enabled

@Deprecated
protected boolean enabled
Deprecated. since 2.0.0 : duplicate field from parent for nothing!
Boolean to authorize table editing.


visible

@Deprecated
protected boolean visible
Deprecated. since 2.0.0 : duplicate field from parent for nothing!
Boolean to show matrix.


dimensionEdit

protected boolean dimensionEdit
Boolean to autorize matrice dimension changes.


bEdit

protected javax.swing.JButton bEdit
Constructor Detail

MatrixPanelEditor

public MatrixPanelEditor(MatrixND m,
                         boolean dimensionEdit)
Construct a new JPanel to edit matrix.

Parameters:
m - the matrix to edit.
dimensionEdit - to enabled matrix dimension changes.

MatrixPanelEditor

public MatrixPanelEditor(boolean dimensionEdit,
                         int width,
                         int height)
Construct a new JPanel to edit matrix.

Parameters:
dimensionEdit - to enabled matrix dimension changes.
width - width prefered for the component
height - height prefered for the component

MatrixPanelEditor

public MatrixPanelEditor(boolean dimensionEdit)
Construct a new JPanel to edit matrix.

Parameters:
dimensionEdit - to enabled matrix dimension changes.

MatrixPanelEditor

public MatrixPanelEditor()
Construct a new JPanel to edit matrix. Matrix dimension can not change.

Method Detail

getFactory

protected MatrixFactory getFactory()

addMatrixListener

@Deprecated
public void addMatrixListener(MatrixPanelListener l)
Deprecated. since 2.0.0 : this is not a valid listener adder

Parameters:
l - listener to add

addMatrixPanelListener

public void addMatrixPanelListener(MatrixPanelListener l)
Parameters:
l - listener to add
Since:
2.0.0

removeMatrixPanelListener

public void removeMatrixPanelListener(MatrixPanelListener l)
Parameters:
l - listener to remove
Since:
2.0.0

getMatrixPanelListeners

public MatrixPanelListener[] getMatrixPanelListeners()
Returns:
the listeners registred
Since:
2.0.0

initObjet

protected void initObjet()

getButtonEdit

public javax.swing.JButton getButtonEdit()
Specified by:
getButtonEdit in class MatrixEditor

isLinearModel

public java.lang.Boolean isLinearModel()
Specified by:
isLinearModel in class MatrixEditor
Returns:
Returns the linearModel.

setLinearModel

public void setLinearModel(java.lang.Boolean linearModel)
Specified by:
setLinearModel in class MatrixEditor
Parameters:
linearModel - The linearModel to set.

isLinearModelShowDefault

public java.lang.Boolean isLinearModelShowDefault()
Specified by:
isLinearModelShowDefault in class MatrixEditor
Returns:
Returns the linearModelShowDefault.

setLinearModelShowDefault

public void setLinearModelShowDefault(java.lang.Boolean linearModelShowDefault)
Specified by:
setLinearModelShowDefault in class MatrixEditor
Parameters:
linearModelShowDefault - The linearModelShowDefault to set.

isDimensionEdit

public boolean isDimensionEdit()
Get the value of dimensionEdit.

Returns:
value of dimensionEdit.

setDimensionEdit

public void setDimensionEdit(boolean v)
Set the value of dimensionEdit.

Parameters:
v - Value to assign to dimensionEdit.

initDimensionEdit

protected void initDimensionEdit()

initObject

protected void initObject(MatrixND m)

getTable

public javax.swing.JTable getTable()
Specified by:
getTable in class MatrixEditor

setMatrix

public void setMatrix(MatrixND m)
               throws MatrixException
Specified by:
setMatrix in class MatrixEditor
Throws:
MatrixException

getMatrix

public MatrixND getMatrix()
Specified by:
getMatrix in class MatrixEditor

setEnabled

public void setEnabled(boolean enabled)
Enable the matrix to be edited. By default, the matrix is editable.

Overrides:
setEnabled in class javax.swing.JComponent

isEnabled

public boolean isEnabled()
Overrides:
isEnabled in class java.awt.Component

setVisible

public void setVisible(boolean visible)
Set the matrix visible. By default, the matrix is visible.

Overrides:
setVisible in class javax.swing.JComponent
Parameters:
visible -

isVisible

public boolean isVisible()
Overrides:
isVisible in class java.awt.Component

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
Specified by:
tableChanged in interface javax.swing.event.TableModelListener

fireEvent

protected void fireEvent()
Specified by:
fireEvent in class MatrixEditor

main

public static void main(java.lang.String[] args)
Une petite fonction main pour le test...

Parameters:
args -


Copyright © 2004-2009 CodeLutin. All Rights Reserved.