ikbs.tools.trees
Class Node

java.lang.Object
  extended by java.util.Observable
      extended by ikbs.tools.trees.Composant
          extended by ikbs.tools.trees.Node
All Implemented Interfaces:
Noeud, Selectable, java.util.Observer
Direct Known Subclasses:
Hasse, NoeudDecisionGraph, NoeudIllustration, NoeudRef, NoeudTaxonomic

public class Node
extends Composant
implements Noeud, Selectable


Field Summary
 boolean activeNode
           
protected  boolean affAttributs
           
protected  boolean affMenu
           
static double angleArrow
           
protected  AttributsList attributs
           
protected  boolean bordered
           
protected  boolean clicked
           
static java.awt.Color defaultColor
           
protected  boolean marque
           
protected  boolean marque2
           
protected static int num
           
protected  boolean racine
           
static java.awt.Color racineColor
           
protected  java.awt.Rectangle rect3
           
protected  java.util.Vector relationArrive
           
protected  java.util.Vector relationDepart
           
protected  boolean selected
           
protected  boolean visible
           
 int widthArrow
           
 
Fields inherited from class ikbs.tools.trees.Composant
bgColor, cible_color, dimension, heightLabel, label, labelColor, shadow_color, shadowSize, show, widthLabel, x, y
 
Constructor Summary
Node()
          Constructeur de la classe noeud.
Node(java.awt.Point position)
           
Node(java.lang.String nom)
           
Node(java.lang.String nom, java.awt.Point position)
           
 
Method Summary
 void addAttribut(Attribut unAttribut)
          * Les méthodes pour gerer les attributs **
 void addObserver(java.util.Observer o)
           
 void addRelationArrive(Relation uneRelation)
           
 void addRelationDepart(Relation uneRelation)
           
 boolean affAttributs()
           
 boolean affMenu()
           
 Attribut attribut(int i)
           
 Attribut attribut(java.lang.String nomAtt)
           
 AttributsList attributs()
           
 void bouge(int dx, int dy)
           
 void calculDimension(java.awt.FontMetrics fmObj, java.awt.FontMetrics fmAtt, java.awt.FontMetrics fmRel)
          Pour calculer la dimension de this, de ses attributs et de ses relations
 void calculDimensionAtt(java.awt.FontMetrics fm)
          Pour calculer la dimension des attributs
 void calculDimensionMButton(java.awt.FontMetrics fm)
          Calcul de la dimension des MButton
 void calculDimensionObj(java.awt.FontMetrics fm)
          Pour calculer la dimension des objets de l'arbre
 void calculDimensionRel(java.awt.FontMetrics fm)
          Pour calculer la dimension des relations
 void changeFormeRelation(int forme)
          * Les méthodes pour s'afficher **
 java.lang.Object clone()
          Retourne une copie profonde de this (sans les relations)
 Attribut createAttribute()
           
 Attribut dansAttributs(int x, int y)
           
 java.util.Vector fils()
           
 Noeud fils(int i)
           
 int find(Attribut att)
          Retourne l'index de l'attribut de label label
 boolean getActiveNode()
          Accès à la variable qui détermine si le noeud affiche ouu pas une flêche pouur le masquage des fils
 boolean getClicked()
          L'objet est-il cliqué
 boolean getMarque()
           
 boolean getMarque2()
           
 boolean getRacine()
           
 boolean getSelected()
          retourne true si l'objet est sélectionné
 java.awt.Point infDroit()
           
 int infDroitX()
           
 int infDroitY()
           
protected  void init()
           
 void initColor()
           
 boolean isFilsVisible()
           
 int largeur(Noeud n)
           
 int maxHauteur()
           
 int maxLargeur()
           
 int nbAtt()
           
 int nbFils()
           
 int nbRelationArrive()
           
 int nbRelationDepart()
           
 void paint(java.awt.Graphics g, int xRel, int yRel)
          On dessine le noeud
 void paintActive(java.awt.Graphics g, int xRel, int yRel)
          Dessin de la flêche pour développer/masquer les noeuds
 void paintArrow(java.awt.Graphics g, int x1, int y1, int x2, int y2)
          Pour dessiner la flêche (x1, y1) : coordonnées du point d'origine (x2, y2) : coordonnées du point destination
 void paintAtt(java.awt.Graphics g, int xRel, int yRel)
           
 void paintAttShadow(java.awt.Graphics g, int xRel, int yRel)
           
protected  void paintLabel(java.awt.Graphics g, java.awt.FontMetrics fm, int xRel, int yRel)
           
 void paintRelations(java.awt.Graphics g, int xRel, int yRel)
          Dessin des relations
 void paintShadow(java.awt.Graphics g, int xRel, int yRel)
           
 boolean racine()
           
 Attribut rechAttPrecedent(java.lang.String label)
           
 Attribut rechAttribut(java.lang.String label)
           
 Attribut rechAttSuivant(java.lang.String label)
           
 int rechIndiceRelArrive(Noeud n)
           
 int rechIndiceRelDepart(Noeud n)
           
 Relation rechRelationArrive(Noeud n)
           
 Relation rechRelationDepart(Noeud n)
           
 Relation rechRelationDepart(java.lang.String s)
           
 java.awt.Rectangle rect()
           
 java.awt.Rectangle rect2()
           
 java.awt.Rectangle rect3()
           
 java.awt.Rectangle rectRels()
           
 java.util.Vector relationArrive()
           
 Relation relationArrive(int i)
           
 java.util.Vector relationDepart()
           
 Relation relationDepart(int i)
           
 java.util.Vector relations()
           
 void removeAttribut(java.lang.String s)
           
 void removeRelation(Relation uneRelation)
           
 void removeRelationArrive(Noeud unNoeud)
           
 void removeRelationArrive(Relation uneRelation)
           
 void removeRelationDepart(Noeud unNoeud)
           
 void removeRelationDepart(Relation uneRelation)
           
 void removeRelations()
          On efface toutes les relations du noeud
 Attribut selectAttributs(int x, int y)
           
 void setActiveNode(boolean b)
          Le noeud est actif pour le masquage/démasquage de ses fils
 void setAffAttributs(boolean b)
           
 void setAffMenu(boolean b)
           
 void setAttributs(AttributsList attributs)
           
 void setBgColor(java.awt.Color c)
           
 void setBgColorAtt(java.awt.Color c)
           
 void setBordered(boolean b)
           
 void setClicked(boolean b)
          L'objet est cliqué
static void setDefaultColor(java.awt.Color c)
          Affectation de la couleur du noeud
 void setLabelColorAtt(java.awt.Color c)
           
 void setMarque(boolean b)
           
 void setMarque2(boolean b)
           
 void setPosLien(int pos)
           
 void setPosSup(java.awt.Point p)
           
 void setRacine(boolean b)
           
static void setRacineColor(java.awt.Color c)
          Affectation de la couleur de la racine
 void setRelationArrive(int i, Relation rel)
           
 void setRelationDepart(int i, Relation rel)
           
 void setSelected(boolean b)
          Interface selectable *
 void setShowArrow(boolean b)
           
 void setVisible(boolean v)
           
 void showLabelRelations(boolean b)
           
 java.awt.Point supGauche()
           
 int supGaucheX()
           
 int supGaucheY()
           
 void update(java.util.Observable o, java.lang.Object args)
          Implémente Observer Retransmet directement aux observateurs (l'environnement graphique) les paramètres de update
 void updateAttribut(int index, Attribut newAttribut)
           
 boolean visible()
           
 
Methods inherited from class ikbs.tools.trees.Composant
bgColor, dansRect, dimension, getInfo, getLabel, height, heightLabel, hideLabel, labelColor, pos, setDimension, setHeight, setHeightLabel, setLabel, setLabelColor, setPos, setPos, setPos, setWidth, setWidthLabel, setX, setY, showed, showLabel, sourisDans, toString, width, widthLabel, x, xd, y
 
Methods inherited from class java.util.Observable
clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ikbs.tools.trees.Noeud
dansRect, getInfo, getLabel, height, setLabel, setLabelColor, setPos, sourisDans, width, x, y
 
Methods inherited from interface ikbs.tools.trees.Selectable
getLabel
 

Field Detail

defaultColor

public static java.awt.Color defaultColor

racineColor

public static java.awt.Color racineColor

angleArrow

public static double angleArrow

activeNode

public boolean activeNode

num

protected static int num

selected

protected boolean selected

clicked

protected boolean clicked

racine

protected boolean racine

marque

protected boolean marque

marque2

protected boolean marque2

relationDepart

protected java.util.Vector relationDepart

relationArrive

protected java.util.Vector relationArrive

attributs

protected AttributsList attributs

affAttributs

protected boolean affAttributs

visible

protected boolean visible

affMenu

protected boolean affMenu

bordered

protected boolean bordered

rect3

protected java.awt.Rectangle rect3

widthArrow

public int widthArrow
Constructor Detail

Node

public Node()
Constructeur de la classe noeud. Appel du constructeur de la classe Composant

See Also:
ikbs.graphics.Composant

Node

public Node(java.lang.String nom)

Node

public Node(java.lang.String nom,
            java.awt.Point position)

Node

public Node(java.awt.Point position)
Method Detail

getActiveNode

public boolean getActiveNode()
Accès à la variable qui détermine si le noeud affiche ouu pas une flêche pouur le masquage des fils


setActiveNode

public void setActiveNode(boolean b)
Le noeud est actif pour le masquage/démasquage de ses fils

Specified by:
setActiveNode in interface Noeud

setDefaultColor

public static void setDefaultColor(java.awt.Color c)
Affectation de la couleur du noeud


setAttributs

public void setAttributs(AttributsList attributs)

setRacineColor

public static void setRacineColor(java.awt.Color c)
Affectation de la couleur de la racine


init

protected void init()

initColor

public void initColor()
Specified by:
initColor in interface Noeud

addObserver

public void addObserver(java.util.Observer o)
Specified by:
addObserver in interface Noeud
Overrides:
addObserver in class java.util.Observable

setRacine

public void setRacine(boolean b)
Specified by:
setRacine in interface Noeud

getRacine

public boolean getRacine()

affMenu

public boolean affMenu()

setAffMenu

public void setAffMenu(boolean b)

setBordered

public void setBordered(boolean b)

update

public void update(java.util.Observable o,
                   java.lang.Object args)
Implémente Observer Retransmet directement aux observateurs (l'environnement graphique) les paramètres de update

Specified by:
update in interface java.util.Observer

bouge

public void bouge(int dx,
                  int dy)
Specified by:
bouge in interface Noeud

setPosSup

public void setPosSup(java.awt.Point p)
Specified by:
setPosSup in interface Noeud

relations

public java.util.Vector relations()

relationDepart

public java.util.Vector relationDepart()
Specified by:
relationDepart in interface Noeud

relationArrive

public java.util.Vector relationArrive()
Specified by:
relationArrive in interface Noeud

maxLargeur

public int maxLargeur()
Specified by:
maxLargeur in interface Noeud

largeur

public int largeur(Noeud n)
Specified by:
largeur in interface Noeud

maxHauteur

public int maxHauteur()
Specified by:
maxHauteur in interface Noeud

relationDepart

public Relation relationDepart(int i)
Specified by:
relationDepart in interface Noeud

relationArrive

public Relation relationArrive(int i)
Specified by:
relationArrive in interface Noeud

setRelationDepart

public void setRelationDepart(int i,
                              Relation rel)

setRelationArrive

public void setRelationArrive(int i,
                              Relation rel)

addRelationDepart

public void addRelationDepart(Relation uneRelation)
Specified by:
addRelationDepart in interface Noeud

addRelationArrive

public void addRelationArrive(Relation uneRelation)
Specified by:
addRelationArrive in interface Noeud

nbRelationDepart

public int nbRelationDepart()

nbRelationArrive

public int nbRelationArrive()
Specified by:
nbRelationArrive in interface Noeud

rechIndiceRelDepart

public int rechIndiceRelDepart(Noeud n)

rechRelationDepart

public Relation rechRelationDepart(Noeud n)

rechRelationDepart

public Relation rechRelationDepart(java.lang.String s)

rechIndiceRelArrive

public int rechIndiceRelArrive(Noeud n)

rechRelationArrive

public Relation rechRelationArrive(Noeud n)
Specified by:
rechRelationArrive in interface Noeud

removeRelation

public void removeRelation(Relation uneRelation)

removeAttribut

public void removeAttribut(java.lang.String s)
Specified by:
removeAttribut in interface Noeud

removeRelations

public void removeRelations()
On efface toutes les relations du noeud

Specified by:
removeRelations in interface Noeud

removeRelationDepart

public void removeRelationDepart(Relation uneRelation)
Specified by:
removeRelationDepart in interface Noeud

removeRelationDepart

public void removeRelationDepart(Noeud unNoeud)

removeRelationArrive

public void removeRelationArrive(Relation uneRelation)
Specified by:
removeRelationArrive in interface Noeud

removeRelationArrive

public void removeRelationArrive(Noeud unNoeud)

fils

public java.util.Vector fils()
Specified by:
fils in interface Noeud

fils

public Noeud fils(int i)
Specified by:
fils in interface Noeud

nbFils

public int nbFils()
Specified by:
nbFils in interface Noeud

isFilsVisible

public boolean isFilsVisible()
Specified by:
isFilsVisible in interface Noeud

racine

public boolean racine()

setMarque

public void setMarque(boolean b)
Specified by:
setMarque in interface Noeud

getMarque

public boolean getMarque()
Specified by:
getMarque in interface Noeud

setMarque2

public void setMarque2(boolean b)
Specified by:
setMarque2 in interface Noeud

getMarque2

public boolean getMarque2()
Specified by:
getMarque2 in interface Noeud

affAttributs

public boolean affAttributs()
Specified by:
affAttributs in interface Noeud

visible

public boolean visible()
Specified by:
visible in interface Noeud

setVisible

public void setVisible(boolean v)
Specified by:
setVisible in interface Noeud

setAffAttributs

public void setAffAttributs(boolean b)
Specified by:
setAffAttributs in interface Noeud

attributs

public AttributsList attributs()
Specified by:
attributs in interface Noeud

attribut

public Attribut attribut(java.lang.String nomAtt)

attribut

public Attribut attribut(int i)

rechAttribut

public Attribut rechAttribut(java.lang.String label)
Specified by:
rechAttribut in interface Noeud

rechAttSuivant

public Attribut rechAttSuivant(java.lang.String label)
Specified by:
rechAttSuivant in interface Noeud

rechAttPrecedent

public Attribut rechAttPrecedent(java.lang.String label)
Specified by:
rechAttPrecedent in interface Noeud

calculDimensionObj

public void calculDimensionObj(java.awt.FontMetrics fm)
Pour calculer la dimension des objets de l'arbre

Specified by:
calculDimensionObj in interface Noeud

calculDimensionMButton

public void calculDimensionMButton(java.awt.FontMetrics fm)
Calcul de la dimension des MButton


calculDimension

public void calculDimension(java.awt.FontMetrics fmObj,
                            java.awt.FontMetrics fmAtt,
                            java.awt.FontMetrics fmRel)
Pour calculer la dimension de this, de ses attributs et de ses relations

Specified by:
calculDimension in interface Noeud

calculDimensionAtt

public void calculDimensionAtt(java.awt.FontMetrics fm)
Pour calculer la dimension des attributs

Specified by:
calculDimensionAtt in interface Noeud

calculDimensionRel

public void calculDimensionRel(java.awt.FontMetrics fm)
Pour calculer la dimension des relations

Specified by:
calculDimensionRel in interface Noeud

rect

public java.awt.Rectangle rect()
Specified by:
rect in interface Noeud
Specified by:
rect in class Composant

rect2

public java.awt.Rectangle rect2()
Specified by:
rect2 in interface Noeud

rect3

public java.awt.Rectangle rect3()
Specified by:
rect3 in interface Noeud

rectRels

public java.awt.Rectangle rectRels()
Specified by:
rectRels in interface Noeud

setSelected

public void setSelected(boolean b)
Interface selectable *

Specified by:
setSelected in interface Noeud
Specified by:
setSelected in interface Selectable

getSelected

public boolean getSelected()
Description copied from interface: Selectable
retourne true si l'objet est sélectionné

Specified by:
getSelected in interface Selectable

setClicked

public void setClicked(boolean b)
Description copied from interface: Selectable
L'objet est cliqué

Specified by:
setClicked in interface Selectable

getClicked

public boolean getClicked()
Description copied from interface: Selectable
L'objet est-il cliqué

Specified by:
getClicked in interface Selectable

supGaucheX

public int supGaucheX()
Specified by:
supGaucheX in interface Noeud

supGaucheY

public int supGaucheY()
Specified by:
supGaucheY in interface Noeud

supGauche

public java.awt.Point supGauche()

infDroitX

public int infDroitX()
Specified by:
infDroitX in interface Noeud

infDroitY

public int infDroitY()
Specified by:
infDroitY in interface Noeud

infDroit

public java.awt.Point infDroit()

addAttribut

public void addAttribut(Attribut unAttribut)
* Les méthodes pour gerer les attributs **

Specified by:
addAttribut in interface Noeud

createAttribute

public Attribut createAttribute()
Specified by:
createAttribute in interface Noeud

updateAttribut

public void updateAttribut(int index,
                           Attribut newAttribut)

find

public int find(Attribut att)
Retourne l'index de l'attribut de label label

Specified by:
find in interface Noeud

nbAtt

public int nbAtt()

setBgColor

public void setBgColor(java.awt.Color c)
Specified by:
setBgColor in interface Noeud
Overrides:
setBgColor in class Composant

setBgColorAtt

public void setBgColorAtt(java.awt.Color c)
Specified by:
setBgColorAtt in interface Noeud

setLabelColorAtt

public void setLabelColorAtt(java.awt.Color c)
Specified by:
setLabelColorAtt in interface Noeud

dansAttributs

public Attribut dansAttributs(int x,
                              int y)
Specified by:
dansAttributs in interface Noeud

selectAttributs

public Attribut selectAttributs(int x,
                                int y)

changeFormeRelation

public void changeFormeRelation(int forme)
* Les méthodes pour s'afficher **

Specified by:
changeFormeRelation in interface Noeud

showLabelRelations

public void showLabelRelations(boolean b)
Specified by:
showLabelRelations in interface Noeud

setPosLien

public void setPosLien(int pos)
Specified by:
setPosLien in interface Noeud

setShowArrow

public void setShowArrow(boolean b)
Specified by:
setShowArrow in interface Noeud

paintShadow

public void paintShadow(java.awt.Graphics g,
                        int xRel,
                        int yRel)
Specified by:
paintShadow in interface Noeud
Overrides:
paintShadow in class Composant

paint

public void paint(java.awt.Graphics g,
                  int xRel,
                  int yRel)
On dessine le noeud

Specified by:
paint in interface Noeud

paintAttShadow

public void paintAttShadow(java.awt.Graphics g,
                           int xRel,
                           int yRel)
Specified by:
paintAttShadow in interface Noeud

paintAtt

public void paintAtt(java.awt.Graphics g,
                     int xRel,
                     int yRel)
Specified by:
paintAtt in interface Noeud

paintLabel

protected void paintLabel(java.awt.Graphics g,
                          java.awt.FontMetrics fm,
                          int xRel,
                          int yRel)

paintRelations

public void paintRelations(java.awt.Graphics g,
                           int xRel,
                           int yRel)
Dessin des relations

Specified by:
paintRelations in interface Noeud

paintActive

public void paintActive(java.awt.Graphics g,
                        int xRel,
                        int yRel)
Dessin de la flêche pour développer/masquer les noeuds


paintArrow

public void paintArrow(java.awt.Graphics g,
                       int x1,
                       int y1,
                       int x2,
                       int y2)
Pour dessiner la flêche (x1, y1) : coordonnées du point d'origine (x2, y2) : coordonnées du point destination


clone

public java.lang.Object clone()
Retourne une copie profonde de this (sans les relations)

Specified by:
clone in interface Noeud
Overrides:
clone in class java.lang.Object