Package org.nuiton.math.matrix.gui
Class MatrixPopupMenu
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPopupMenu
org.nuiton.math.matrix.gui.MatrixPopupMenu
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,MenuElement
Ajout d'un menu contextuel sur la matrice dans l'editeur.
Created: 22 mars 2006 12:11:46
- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- ruchaud
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPopupMenu
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.SeparatorNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JFileChooserFile chooser.protected MatrixEditorMatrix editor where this menu is attached.protected JMenuSend to clip board menu item.protected ActionCopy all matrix action.protected ActionPaste all matrix action.protected ActionPaste selection matrix action.protected ActionCopy selection matrix action.protected JMenuSend to file menu item.protected ActionExport all matrix to file action.protected ActionImport all matrix from file.protected ActionImport selection from file.protected ActionExport selection to file.protected JCheckBoxMenuItemExport with semantics checkbox.Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAsk user for new value to fill into matrix.protected voidFill editor matrix with identity matrix.protected voidDesactive le menu si la matrice ne supporte pas le mode CSV.protected JMenuInit export to file action.protected ReaderInit import from clip board reader.protected WriterInit export to clip board writer.protected int[]Get matrix first selection coordinates.protected JFileChooserGet file chooser to csv file (import/export).protected ReaderInit import from file reader.protected WriterInit export to file writer.protected MatrixNDGet matrix in matrix editor.protected MatrixNDGet selected matrix in editor.protected JMenuInit send to clip board action.protected ActionInit emport to clip board action.protected ActionInit import from clip board action.Init import selection from clip board action.protected ActionInit emport selection to clip board action.protected JMenuInit export to file action.protected ActionInit export to file action.protected ActionInit import from file action.protected ActionInit import selection from file action.protected ActionInit export selection to file action.protected voidExport matrix to clip board.protected voidImport matrix from clip board.protected voidImport from clip board.protected voidExport selection to clip board.protected voidExport to file.protected voidImport from file.protected voidImport selection from file.protected voidExport 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, updateUIMethods 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, updateMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
matrixEditor
Matrix editor where this menu is attached. -
fileChooser
File chooser. -
sendToClipBoard
Send to clip board menu item. -
sendToFile
Send to file menu item. -
withSemantics
Export with semantics checkbox. -
sendToClipBoardAllCopyAction
Copy all matrix action. -
sendToClipBoardAllPasteAction
Paste all matrix action. -
sendToClipBoardSelectionCopyAction
Copy selection matrix action. -
sendToClipBoardCurrentPasteAction
Paste selection matrix action. -
sendToFileAllCopyAction
Export all matrix to file action. -
sendToFileAllPasteAction
Import all matrix from file. -
sendToFileSelectionCopyAction
Export selection to file. -
sendToFileCurrentPasteAction
Import selection from file.
-
-
Constructor Details
-
MatrixPopupMenu
Init popop menu.- Parameters:
matrixEditor- matrix editor where menu is attached
-
-
Method Details
-
getSendToClipBoard
Init send to clip board action.- Returns:
- retourne le menu d'action pour le bloc note
-
getSendToFile
Init export to file action.- Returns:
- retourne le menu d'action pour les fichiers CSV
-
getApplyDataAction
Init export to file action.- Returns:
- retourne le menu d'action pour les fichiers CSV
-
getFileChooserWriter
Init export to file writer.- Returns:
- retourne un writer du fichier choisi dans le selecteur de fichier
- Throws:
IOException
-
getClipBoardWriter
Init export to clip board writer.- Returns:
- retourne un writer pour le bloc note
-
getFileChooserReader
Init import from file reader.- Returns:
- retourne un reader du fichier choisi dans le selecteur de fichier
- Throws:
IOException
-
getClipBoardReader
Init import from clip board reader.- Returns:
- retourne le contenu du bloc note sous la forme d'un reader
- Throws:
IOExceptionUnsupportedFlavorException
-
firePopupMenuWillBecomeVisible
protected void firePopupMenuWillBecomeVisible()Desactive le menu si la matrice ne supporte pas le mode CSV.- Overrides:
firePopupMenuWillBecomeVisiblein classJPopupMenu
-
getMatrix
Get matrix in matrix editor.- Returns:
- matrice en cours de saisie dans l'editeur
-
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
Get file chooser to csv file (import/export).- Returns:
- selecteur de fichier CSV
-
getSendToClipBoardAllCopyAction
Init emport to clip board action.- Returns:
- retourne l'action du bloc note permettant la copie entiere de la matrice
-
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
Init emport selection to clip board action.- Returns:
- retourne l'action du bloc note permettant la copie de la partie selectionnee
-
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
Init export to file action.- Returns:
- retourne l'action du fichier permettant la copie entiere de la matrice
-
getSendToFileAllPasteAction
Init import from file action.- Returns:
- retourne l'action du fichier permettant la recopie entere de la matrice depuis le fichier
-
getSendToFileSelectionCopyAction
Init export selection to file action.- Returns:
- retourne l'action du fichier permettant la copie de la partie selectionnee
-
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.
-