Search in sources :

Example 16 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange in project opentheso by miledrousset.

the class NewTreeBean method fromConceptToConcept.

/**
 * fromConceptToConcept déplace un concept vers un autre concept dans le
 * même domaine
 */
public void fromConceptToConcept() {
    for (String idBT : idsBTRemoveNode) {
        TreeChange tc = new TreeChange();
        tc.moveConceptTermToConceptTermSameDomain(connect, draggedNode.getIdConcept(), idBT, droppedNode.getIdConcept(), idThesoSelected, this.selectedTerme.getUser().getUser().getId());
    }
// System.out.println("from concept to concept domain");
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange)

Example 17 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange in project opentheso by miledrousset.

the class NewTreeBean method fromSubGroupToGroupOtherDomain.

/*Fonction qui doivent gérer les déplacement des noeuds vis à vis de la bdd**/
/**
 * déplacement d'un groupe: ce déplacement n'est pas prévu pour le moment *
 */
/**
 * ****************déplacement d'un sous groupe********************
 */
/**
 * fromSubGroupToGroupOtherDomain déplace un sous groupe vers un groupe d'un
 * autre domaine
 */
public void fromSubGroupToGroupOtherDomain() {
    for (String idBT : idsBTRemoveNode) {
        TreeChange tc = new TreeChange();
        tc.moveSubGroupToSubGroupDomain(connect, draggedNode.getIdConcept(), idBT, draggedNode.getIdCurrentGroup(), draggedNode.getType(), droppedNode.getIdConcept(), idThesoSelected, this.selectedTerme.getUser().getUser().getId());
    }
// System.out.println("from subgroup to group other domain");
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange)

Example 18 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange in project opentheso by miledrousset.

the class NewTreeBean method reExpand.

public void reExpand() {
    TreeChange tc = new TreeChange();
    tc.saveExpandedNodes(root);
    this.reInit();
    this.initTree(selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
    ArrayList<String> ids = new ArrayList<>();
    for (TreeNode tn : tc.getExpandedNodes()) {
        ids.add(((MyTreeNode) tn).getIdConcept());
    }
    ids.addAll(tc.getPathFromSelectedConcept(connect, (MyTreeNode) selectedNode));
    ids.add(selectedTerme.getIdC());
    // code pour forcer le depliment de l'arbre
    reExpandNodes(root, ids, selectedTerme.getIdC());
    if (selectedNode == null) {
    // selectedNode = new MyTreeNode(0, "", "", "", "", "", "domaine", "", root);
    }
    // selectedNode.setSelected(false);
    for (TreeNode tn : selectedNodes) {
        tn.setSelected(false);
    }
    selectedNodes = new ArrayList<>();
    ArrayList<String> first = new ArrayList<>();
    first.add(selectedTerme.getIdC());
    ArrayList<ArrayList<String>> paths = new ArrayList<>();
    paths = new ConceptHelper().getPathOfConcept(connect.getPoolConnexion(), selectedTerme.getIdC(), selectedTerme.getIdTheso(), first, paths);
    if (paths != null) {
    // reExpandTree(paths, selectedTerme.getIdTheso(), selectedTerme.getIdlangue(),tc);
    }
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) MyTreeNode(mom.trd.opentheso.bdd.helper.nodes.MyTreeNode) TreeNode(org.primefaces.model.TreeNode) DefaultTreeNode(org.primefaces.model.DefaultTreeNode) ArrayList(java.util.ArrayList) MyTreeNode(mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)

Example 19 with TreeChange

use of mom.trd.opentheso.dragdrop.TreeChange in project opentheso by miledrousset.

the class NewTreeBean method fromConceptToGroupOtherDomain.

/**
 * *****************déplacement d'un concept************************** **
 */
/**
 * formConceptToGroupOtherDomain
 *
 * déplacement d'un concept vers un goupe d'un autre domaine
 */
public void fromConceptToGroupOtherDomain() {
    for (String idBT : idsBTRemoveNode) {
        TreeChange tc = new TreeChange();
        tc.moveConceptToGroupOtherDomain(connect, draggedNode.getIdConcept(), idBT, draggedNode.getIdCurrentGroup(), droppedNode.getIdConcept(), droppedNode.getIdCurrentGroup(), idThesoSelected, this.selectedTerme.getUser().getUser().getId());
    }
// System.out.println(" from concept to group other domain");
}
Also used : TreeChange(mom.trd.opentheso.dragdrop.TreeChange)

Aggregations

TreeChange (mom.trd.opentheso.dragdrop.TreeChange)19 ArrayList (java.util.ArrayList)2 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)2 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)2 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)1 RelationsHelper (mom.trd.opentheso.bdd.helper.RelationsHelper)1 StructIdBroaderTerm (mom.trd.opentheso.dragdrop.StructIdBroaderTerm)1 DefaultTreeNode (org.primefaces.model.DefaultTreeNode)1 TreeNode (org.primefaces.model.TreeNode)1