cds.aladin
Class ViewSimple

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by cds.aladin.ViewSimple
All Implemented Interfaces:
java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DropTargetListener, java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener

public final class ViewSimple
extends javax.swing.JComponent
implements java.awt.event.MouseWheelListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, java.awt.event.ActionListener, java.awt.dnd.DropTargetListener, java.awt.dnd.DragSourceListener, java.awt.dnd.DragGestureListener

Gestionnaire de la vue. Il s'agit d'afficher les plans acifs (voir ToolBox) dans l'ordre de visibilite selon l'echelle indiquee par le zoom (voir ZoomView)

La souris a differentes fonctions suivant l'outil (Tool bar) active. Ce peut etre la simple selection d'une source, le dessin d'objet graphique, le zoom pointe...

Version:
1.2 : (1 dec 00) Meilleure gestion de la source montree + gestion du plan Add, 1.1 : (28 mars 00) Modif debug -> trace + label pour les plans, 1.0 : (11 mai 99) Toilettage du code, 0.91 - 3 dec 1998 Nettoyage du code, 0.9 - 31 mars 1998
Author:
P. Fernique CDS
See Also:
aladin.ToolBox(), aladin.Zoomview(), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Reactions aux differents boutons du menu
 void dragDropEnd(java.awt.dnd.DragSourceDropEvent DragSourceDropEvent)
           
 void dragEnter(java.awt.dnd.DragSourceDragEvent DragSourceDragEvent)
           
 void dragEnter(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)
           
 void dragExit(java.awt.dnd.DragSourceEvent DragSourceEvent)
           
 void dragExit(java.awt.dnd.DropTargetEvent dropTargetEvent)
           
 void dragGestureRecognized(java.awt.dnd.DragGestureEvent dragGestureEvent)
           
 void dragOver(java.awt.dnd.DragSourceDragEvent DragSourceDragEvent)
           
 void dragOver(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)
           
 void drop(java.awt.dnd.DropTargetDropEvent dropTargetDropEvent)
           
 void dropActionChanged(java.awt.dnd.DragSourceDragEvent DragSourceDragEvent)
           
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
          Positionne les mesures dans la fenetre des infos.
 void mouseReleased1(double x, double y, java.awt.event.MouseEvent e)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
           
 void paintComponent(java.awt.Graphics gr)
           
 java.lang.String toString()
           
 void update(java.awt.Graphics gr)
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, 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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

dragGestureRecognized

public void dragGestureRecognized(java.awt.dnd.DragGestureEvent dragGestureEvent)
Specified by:
dragGestureRecognized in interface java.awt.dnd.DragGestureListener

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)
Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent dropTargetEvent)
Specified by:
dragExit in interface java.awt.dnd.DropTargetListener

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)
Specified by:
dragOver in interface java.awt.dnd.DropTargetListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)
Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener

dragDropEnd

public void dragDropEnd(java.awt.dnd.DragSourceDropEvent DragSourceDropEvent)
Specified by:
dragDropEnd in interface java.awt.dnd.DragSourceListener

dragEnter

public void dragEnter(java.awt.dnd.DragSourceDragEvent DragSourceDragEvent)
Specified by:
dragEnter in interface java.awt.dnd.DragSourceListener

dragExit

public void dragExit(java.awt.dnd.DragSourceEvent DragSourceEvent)
Specified by:
dragExit in interface java.awt.dnd.DragSourceListener

dragOver

public void dragOver(java.awt.dnd.DragSourceDragEvent DragSourceDragEvent)
Specified by:
dragOver in interface java.awt.dnd.DragSourceListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DragSourceDragEvent DragSourceDragEvent)
Specified by:
dropActionChanged in interface java.awt.dnd.DragSourceListener

drop

public void drop(java.awt.dnd.DropTargetDropEvent dropTargetDropEvent)
Specified by:
drop in interface java.awt.dnd.DropTargetListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Reactions aux differents boutons du menu

Specified by:
actionPerformed in interface java.awt.event.ActionListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Positionne les mesures dans la fenetre des infos. et reaffiche la fenetre des tools et de la vue en fonctions des objets selectionnes protected void setMesure() { boolean flagExtApp = aladin.hasExtApp(); String listOid[] = null; int nbOid=0; aladin.mesure.removeAllElements(); Enumeration e = aladin.view.vselobj.elements(); //long b = System.currentTimeMillis(); if( flagExtApp ) listOid = new String[aladin.view.vselobj.size()]; // vecteur des sources supprimer de vselobj Vector v = new Vector(); while( e.hasMoreElements() ) { Objet o = (Objet) e.nextElement(); if( o instanceof Source ) { // pas de selection pour les objets ne "passant" pas le filtre if( ((Source)o).noFilterInfluence() || ((Source)o).isSelected() ) { o.info(aladin); } else { ((Source)o).select = false; //vselobj.removeElement(o); v.addElement(o); } // Test si cette source provient d'une application cooperative // type VOPlot, et si oui, fait le callBack adequat if( flagExtApp ) { String oid = ((Source)o).getOID(); if( oid!=null ) listOid[nbOid++]=oid; } } } // on supprime de vselobj toutes les sources qui doivent l'etre Enumeration eObjTodel = v.elements(); while( eObjTodel.hasMoreElements() ) aladin.view.vselobj.removeElement(eObjTodel.nextElement()); //long end = System.currentTimeMillis(); //System.out.println(end-b); aladin.toolbox.toolMode(); aladin.mesure.mcanvas.fullRepaint(); // Callback adequat pour la liste des sources que l'application cooperative // doit selectionner if( flagExtApp ) aladin.callbackSelectExtApp(listOid,nbOid); // Calculs pour CDS team aladin.view.forCDSteam(); aladin.view.repaintAll(); }

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseReleased1

public void mouseReleased1(double x,
                           double y,
                           java.awt.event.MouseEvent e)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

toString

public java.lang.String toString()
Overrides:
toString in class java.awt.Component

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

update

public void update(java.awt.Graphics gr)
Overrides:
update in class javax.swing.JComponent

paintComponent

public void paintComponent(java.awt.Graphics gr)
Overrides:
paintComponent in class javax.swing.JComponent


Copyright © 2009 UDS/CNRS