1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
/**
* @author deyine
*/
public abstract class Composant extends CustomNode{
/**
* ToolTip
*/
public var toolTip : String = null;
var B : Bulle;
//Contenu du composant
public var CONTENU : Group = Group{};
//Méthode d'initialisation du composant : à redéfinir
protected abstract function init () : Void;
override protected function create () : Node {
init();
if(toolTip != null and not(toolTip.equals("") ) ){
B = Bulle{
node : bind this;
text : toolTip;
}
return(B.node.CONTENU);
}
return(CONTENU);
}
public function ajoute (noeud : Node) : Node {
insert noeud into CONTENU.content;
return CONTENU;
}
public function ajouteArrierePlan (noeud : Node) : Node {
insert noeud before CONTENU.content[0];
return CONTENU;
}
public function ajouteAvantPlan (noeud : Node) : Node {
insert noeud after CONTENU.content[sizeof(CONTENU.content)-1];
return CONTENU;
}
public function supprime (noeud : Node) : Node {
delete noeud from CONTENU.content;
return CONTENU;
}
} |