org.nuiton.math.matrix.gui
Class MatrixPopupMenu

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPopupMenu
                  extended by org.nuiton.math.matrix.gui.MatrixPopupMenu
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, MenuElement

public class MatrixPopupMenu
extends JPopupMenu

Ajout d'un menu contextuel sur la matrice dans l'editeur. Created: 22 mars 2006 12:11:46

Version:
$Revision: 360 $ Last update: $Date: 2011-05-24 09:58:26 +0200 (mar., 24 mai 2011) $ by : $Author: echatellier $
Author:
ruchaud
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPopupMenu
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.Separator
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JFileChooser fileChooser
          File chooser.
protected  MatrixEditor matrixEditor
          Matrix editor where this menu is attached.
protected  JMenu sendToClipBoard
          Send to clip board menu item.
protected  Action sendToClipBoardAllCopyAction
          Copy all matrix action.
protected  Action sendToClipBoardAllPasteAction
          Paste all matrix action.
protected  Action sendToClipBoardCurrentPasteAction
          Paste selection matrix action.
protected  Action sendToClipBoardSelectionCopyAction
          Copy selection matrix action.
protected  JMenu sendToFile
          Send to file menu item.
protected  Action sendToFileAllCopyAction
          Export all matrix to file action.
protected  Action sendToFileAllPasteAction
          Import all matrix from file.
protected  Action sendToFileCurrentPasteAction
          Import selection from file.
protected  Action sendToFileSelectionCopyAction
          Export selection to file.
protected  JCheckBoxMenuItem withSemantics
          Export with semantics checkbox.
 
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
MatrixPopupMenu(MatrixEditor matrixEditor)
          Init popop menu.
 
Method Summary
protected  void dataFillValuePerformed()
          Ask user for new value to fill into matrix.
protected  void dataIdentityPerformed()
          Fill editor matrix with identity matrix.
protected  void firePopupMenuWillBecomeVisible()
          Desactive le menu si la matrice ne supporte pas le mode CSV.
protected  JMenu getApplyDataAction()
          Init export to file action.
protected  Reader getClipBoardReader()
          Init import from clip board reader.
protected  Writer getClipBoardWriter()
          Init export to clip board writer.
protected  int[] getCoordinatesFirstCellSelectedMatrix()
          Get matrix first selection coordinates.
protected  JFileChooser getFileChooser()
          Get file chooser to csv file (import/export).
protected  Reader getFileChooserReader()
          Init import from file reader.
protected  Writer getFileChooserWriter()
          Init export to file writer.
protected  MatrixND getMatrix()
          Get matrix in matrix editor.
protected  MatrixND getSelectedMatrix()
          Get selected matrix in editor.
protected  JMenu getSendToClipBoard()
          Init send to clip board action.
protected  Action getSendToClipBoardAllCopyAction()
          Init emport to clip board action.
protected  Action getSendToClipBoardAllPasteAction()
          Init import from clip board action.
 Action getSendToClipBoardCurrentPasteAction()
          Init import selection from clip board action.
protected  Action getSendToClipBoardSelectionCopyAction()
          Init emport selection to clip board action.
protected  JMenu getSendToFile()
          Init export to file action.
protected  Action getSendToFileAllCopyAction()
          Init export to file action.
protected  Action getSendToFileAllPasteAction()
          Init import from file action.
protected  Action getSendToFileCurrentPasteAction()
          Init import selection from file action.
protected  Action getSendToFileSelectionCopyAction()
          Init export selection to file action.
protected  void sendToClipBoardAllCopyPerformed()
          Export matrix to clip board.
protected  void sendToClipBoardAllPastePerformed()
          Import matrix from clip board.
protected  void sendToClipBoardCurrentPastePerformed()
          Import from clip board.
protected  void sendToClipBoardSelectionCopyPerformed()
          Export selection to clip board.
protected  void sendToFileAllCopyPerformed()
          Export to file.
protected  void sendToFileAllPastePerformed()
          Import from file.
protected  void sendToFileCurrentPastePerformed()
          Import selection from file.
protected  void sendToFileSelectionCopyPerformed()
          Export selection to file.
 
Methods inherited from class javax.swing.JPopupMenu
add, add, add, addMenuKeyListener, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, 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, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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, setEnabled, 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, 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, isEnabled, 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, 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, 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

matrixEditor

protected MatrixEditor matrixEditor
Matrix editor where this menu is attached.


fileChooser

protected JFileChooser fileChooser
File chooser.


sendToClipBoard

protected JMenu sendToClipBoard
Send to clip board menu item.


sendToFile

protected JMenu sendToFile
Send to file menu item.


withSemantics

protected JCheckBoxMenuItem withSemantics
Export with semantics checkbox.


sendToClipBoardAllCopyAction

protected Action sendToClipBoardAllCopyAction
Copy all matrix action.


sendToClipBoardAllPasteAction

protected Action sendToClipBoardAllPasteAction
Paste all matrix action.


sendToClipBoardSelectionCopyAction

protected Action sendToClipBoardSelectionCopyAction
Copy selection matrix action.


sendToClipBoardCurrentPasteAction

protected Action sendToClipBoardCurrentPasteAction
Paste selection matrix action.


sendToFileAllCopyAction

protected Action sendToFileAllCopyAction
Export all matrix to file action.


sendToFileAllPasteAction

protected Action sendToFileAllPasteAction
Import all matrix from file.


sendToFileSelectionCopyAction

protected Action sendToFileSelectionCopyAction
Export selection to file.


sendToFileCurrentPasteAction

protected Action sendToFileCurrentPasteAction
Import selection from file.

Constructor Detail

MatrixPopupMenu

public MatrixPopupMenu(MatrixEditor matrixEditor)
Init popop menu.

Parameters:
matrixEditor - matrix editor where menu is attached
Method Detail

getSendToClipBoard

protected JMenu getSendToClipBoard()
Init send to clip board action.

Returns:
retourne le menu d'action pour le bloc note

getSendToFile

protected JMenu getSendToFile()
Init export to file action.

Returns:
retourne le menu d'action pour les fichiers CSV

getApplyDataAction

protected JMenu getApplyDataAction()
Init export to file action.

Returns:
retourne le menu d'action pour les fichiers CSV

getFileChooserWriter

protected Writer getFileChooserWriter()
                               throws IOException
Init export to file writer.

Returns:
retourne un writer du fichier choisi dans le selecteur de fichier
Throws:
IOException

getClipBoardWriter

protected Writer getClipBoardWriter()
Init export to clip board writer.

Returns:
retourne un writer pour le bloc note

getFileChooserReader

protected Reader getFileChooserReader()
                               throws IOException
Init import from file reader.

Returns:
retourne un reader du fichier choisi dans le selecteur de fichier
Throws:
IOException

getClipBoardReader

protected Reader getClipBoardReader()
                             throws UnsupportedFlavorException,
                                    IOException
Init import from clip board reader.

Returns:
retourne le contenu du bloc note sous la forme d'un reader
Throws:
IOException
UnsupportedFlavorException

firePopupMenuWillBecomeVisible

protected void firePopupMenuWillBecomeVisible()
Desactive le menu si la matrice ne supporte pas le mode CSV.

Overrides:
firePopupMenuWillBecomeVisible in class JPopupMenu

getMatrix

protected MatrixND getMatrix()
Get matrix in matrix editor.

Returns:
matrice en cours de saisie dans l'editeur

getSelectedMatrix

protected MatrixND getSelectedMatrix()
Get selected matrix in editor.

Returns:
la sous matrice en cours de saisie dans l'editeur c'est a dire la partie selectionnee

getCoordinatesFirstCellSelectedMatrix

protected int[] getCoordinatesFirstCellSelectedMatrix()
Get matrix first selection coordinates.

Returns:
retourne les coordonnees de la première cellule selectionnee

getFileChooser

protected JFileChooser getFileChooser()
Get file chooser to csv file (import/export).

Returns:
selecteur de fichier CSV

getSendToClipBoardAllCopyAction

protected Action getSendToClipBoardAllCopyAction()
Init emport to clip board action.

Returns:
retourne l'action du bloc note permettant la copie entiere de la matrice

getSendToClipBoardAllPasteAction

protected Action getSendToClipBoardAllPasteAction()
Init import from clip board action.

Returns:
retourne l'action du bloc note permettant la recopie entere de la matrice depuis le bloc note

getSendToClipBoardSelectionCopyAction

protected Action getSendToClipBoardSelectionCopyAction()
Init emport selection to clip board action.

Returns:
retourne l'action du bloc note permettant la copie de la partie selectionnee

getSendToClipBoardCurrentPasteAction

public Action getSendToClipBoardCurrentPasteAction()
Init import selection from clip board action.

Returns:
retourne l'action du bloc note permettant la recopie de la partie selectionnee de la matrice depuis le bloc note

sendToClipBoardAllCopyPerformed

protected void sendToClipBoardAllCopyPerformed()
Export matrix to clip board.


sendToClipBoardAllPastePerformed

protected void sendToClipBoardAllPastePerformed()
Import matrix from clip board.


sendToClipBoardSelectionCopyPerformed

protected void sendToClipBoardSelectionCopyPerformed()
Export selection to clip board.


sendToClipBoardCurrentPastePerformed

protected void sendToClipBoardCurrentPastePerformed()
Import from clip board.


getSendToFileAllCopyAction

protected Action getSendToFileAllCopyAction()
Init export to file action.

Returns:
retourne l'action du fichier permettant la copie entiere de la matrice

getSendToFileAllPasteAction

protected Action getSendToFileAllPasteAction()
Init import from file action.

Returns:
retourne l'action du fichier permettant la recopie entere de la matrice depuis le fichier

getSendToFileSelectionCopyAction

protected Action getSendToFileSelectionCopyAction()
Init export selection to file action.

Returns:
retourne l'action du fichier permettant la copie de la partie selectionnee

getSendToFileCurrentPasteAction

protected Action getSendToFileCurrentPasteAction()
Init import selection from file action.

Returns:
retourne l'action du fichier permettant la recopie de la partie selectionnee de la matrice depuis le fichier

sendToFileAllCopyPerformed

protected void sendToFileAllCopyPerformed()
Export to file.


sendToFileAllPastePerformed

protected void sendToFileAllPastePerformed()
Import from file.


sendToFileSelectionCopyPerformed

protected void sendToFileSelectionCopyPerformed()
Export selection to file.


sendToFileCurrentPastePerformed

protected void sendToFileCurrentPastePerformed()
Import selection from file.


dataIdentityPerformed

protected void dataIdentityPerformed()
Fill editor matrix with identity matrix.


dataFillValuePerformed

protected void dataFillValuePerformed()
Ask user for new value to fill into matrix.



Copyright © 2004-2011 CodeLutin. All Rights Reserved.