cds.aladin
Class MetaDataTree

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by cds.aladin.BasicTree
                  extended by cds.aladin.MetaDataTree
All Implemented Interfaces:
WidgetFinder, java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener

public class MetaDataTree
extends BasicTree
implements WidgetFinder, java.awt.event.KeyListener

Classe MetaDataTree Arbre utilisé pour afficher les ressources sous forme hiérarchique

Version:
0.7 Mars 2006 - Ajout des étiquettes colorées pour les répertoires 0.6 5 Juin 2003 - Découplement de cette classe avec TreeView 0.5 Février 2003 - Création
Author:
Thomas Boch [CDS]
See Also:
Serialized Form

Nested Class Summary
static interface MetaDataTree.SortableColumn
          Interface allowing us to have sortable columns in the flatview of the tree
 
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 ae)
           
 boolean findWidget(java.lang.String name)
          Find a "home-made" widget by its name
static void genericSort(java.lang.Object[] nodes, java.lang.String sortField, boolean descSort)
          sort according to the value of the field fieldName
 java.awt.Point getWidgetLocation(java.lang.String name)
          ici, le parametre name sera un peu special : debut du nom + "/" + nom bande
 void keyPressed(java.awt.event.KeyEvent keyEvent)
           
 void keyReleased(java.awt.event.KeyEvent keyEvent)
           
 void keyTyped(java.awt.event.KeyEvent keyEvent)
           
 void mouseExited(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent evt)
           
static java.lang.String replace(java.lang.String text, java.lang.String repl, java.lang.String with, int max)
           
 BasicNode searchNodeByName(java.lang.String name)
          recherche dans les noeuds par nom
 void setColorLabel(boolean colorLabel)
           
 void setFlat(boolean b)
           
static void sort(java.lang.Object[] nodes, MetaDataTree.SortableColumn c, boolean descSort)
          Sort the array of nodes
 boolean useColorLabel()
           
 
Methods inherited from class cds.aladin.BasicTree
getMinimumSize, getPreferredSize, getSelectedLeaves, getSize, mouseClicked, mouseDragged, mouseEntered, mouseMoved, mouseReleased, openAllNodes, paintComponent, setAllNodes, setBackground
 
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, getNextFocusableComponent, getPopupLocation, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, 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, 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, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setFlat

public void setFlat(boolean b)
Overrides:
setFlat in class BasicTree

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class BasicTree

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class BasicTree

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class BasicTree

sort

public static void sort(java.lang.Object[] nodes,
                        MetaDataTree.SortableColumn c,
                        boolean descSort)
Sort the array of nodes

Parameters:
nodes - array to be sorted
c - the sort we use
descSort - true if the sort must be descendent

genericSort

public static void genericSort(java.lang.Object[] nodes,
                               java.lang.String sortField,
                               boolean descSort)
sort according to the value of the field fieldName


replace

public static java.lang.String replace(java.lang.String text,
                                       java.lang.String repl,
                                       java.lang.String with,
                                       int max)
Parameters:
text - text to search and replace in
repl - String to search for
with - String to replace with
max - Maximum number of values to replace. If -1, replace all occurences of repl
Returns:
String the string with replacements processed

searchNodeByName

public BasicNode searchNodeByName(java.lang.String name)
Description copied from class: BasicTree
recherche dans les noeuds par nom

Overrides:
searchNodeByName in class BasicTree
Parameters:
name - nom du noeud recherché
Returns:
le premier BasicNode correspondant, null si non trouvé

findWidget

public boolean findWidget(java.lang.String name)
Description copied from interface: WidgetFinder
Find a "home-made" widget by its name

Specified by:
findWidget in interface WidgetFinder
Parameters:
name - name of the widget we look for
Returns:
boolean true if widget found, false otherwise

getWidgetLocation

public java.awt.Point getWidgetLocation(java.lang.String name)
ici, le parametre name sera un peu special : debut du nom + "/" + nom bande

Specified by:
getWidgetLocation in interface WidgetFinder
Parameters:
name - name of the widget
Returns:
Point location of the widget within the object

useColorLabel

public boolean useColorLabel()
Returns:
Returns the colorLabel.

setColorLabel

public void setColorLabel(boolean colorLabel)
Parameters:
colorLabel - The colorLabel to set.

keyPressed

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

keyReleased

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

keyTyped

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


Copyright © 2009 UDS/CNRS