MAJ (4.3.1)

This commit is contained in:
pablo rodriguez 2022-11-24 12:33:03 +01:00
parent f250c4ec7f
commit 86a0973c99
25 changed files with 161 additions and 20 deletions

Binary file not shown.

Binary file not shown.

6
bin/.gitignore vendored
View File

@ -1,7 +1 @@
/list/
/fenetres/
/evaluer/
/ou.png
/oumini.png
/resources/
/OU.svg

116
bin/OU.svg Normal file
View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="ou.png"
sodipodi:docname="OU.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
id="svg8"
version="1.1"
viewBox="0 0 11.90625 11.90625"
height="45"
width="45"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs2">
<pattern
id="EMFhbasepattern"
patternUnits="userSpaceOnUse"
width="6"
height="6"
x="0"
y="0" />
</defs>
<sodipodi:namedview
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="-8"
inkscape:window-height="1009"
inkscape:window-width="1920"
units="px"
inkscape:guide-bbox="true"
showguides="true"
showgrid="false"
inkscape:document-rotation="0"
inkscape:current-layer="layer1"
inkscape:document-units="mm"
inkscape:cy="32.065537"
inkscape:cx="13.349994"
inkscape:zoom="7.8277187"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:pagecheckerboard="0"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1">
<sodipodi:guide
id="guide25"
orientation="0,-1"
position="94.049365,180.07197"
inkscape:locked="false" />
<sodipodi:guide
position="8.9572181,11.534441"
orientation="0,-1"
id="guide4043"
inkscape:locked="false" />
<sodipodi:guide
position="-4.2589037,4.1320607"
orientation="0,-1"
id="guide315"
inkscape:locked="false" />
<sodipodi:guide
position="1.0787715,2.8911402"
orientation="0,-1"
id="guide373"
inkscape:locked="false" />
<sodipodi:guide
position="11.558135,1.7718565"
orientation="1,0"
id="guide428"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Calque 1">
<ellipse
style="fill:#800000;stroke:#00ff02;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
id="path485"
cx="5.953125"
cy="5.953125"
rx="5.1546254"
ry="4.9349198" />
<text
xml:space="preserve"
style="font-size:8.24782px;line-height:1.2;font-family:arial;-inkscape-font-specification:arial;fill:#ffffff;stroke:#000000;stroke-width:0.25"
x="0.73846942"
y="8.1826782"
id="text327"
transform="scale(0.87864777,1.1381125)"><tspan
sodipodi:role="line"
id="tspan325"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:arial;-inkscape-font-specification:'arial Bold';fill:#ffffff;stroke:#000000;stroke-width:0.25"
x="0.73846942"
y="8.1826782">OU</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/ou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
bin/oumini.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
bin/resources/ou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
bin/resources/oumini.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -25,6 +25,7 @@ import javax.swing.JTree;
import javax.swing.KeyStroke;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
@ -971,6 +972,9 @@ public final class create extends JFrame {
}
public static void setTree(TreeModel newModel) {
tree.setModel(newModel);
}
public static DefaultMutableTreeNode getSelectNode() {

View File

@ -10,6 +10,7 @@ import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import cXML.node;
@ -34,6 +35,12 @@ public class actUpNode extends AbstractAction{
node nod = (node) fenetres.create.getSelectNode().getUserObject();
DefaultMutableTreeNode selectNode = fenetres.create.getSelectNode();
DefaultMutableTreeNode selectParentNode = (DefaultMutableTreeNode) selectNode.getParent();
int selectedNodeIndex = selectNode.getParent().getIndex(selectNode);
int a = JOptionPane.showConfirmDialog(null,"Voulez-vous monter le node " + selectNode.toString()+ "?", "Sélectionner un choix", JOptionPane.YES_NO_OPTION);
@ -42,22 +49,37 @@ public class actUpNode extends AbstractAction{
if(!nod.chemin().contains("setting")) {
TreePath path = fenetres.create.getTree().getSelectionPath().getParentPath();
// TreePath path = fenetres.create.getTree().getSelectionPath();
nod.getParent().upNodeEnfant(nod);
if(selectedNodeIndex>0) {
nod.getParent().upNodeEnfant(nod);
// int index = nod.getParent().getNodes().indexOf(nod);
//
// DefaultTreeModel treeModel = (DefaultTreeModel) fenetres.create.getTree().getModel();
// treeModel.insertNodeInto(selectNode, selectParentNode, selectedNodeIndex-1);
// treeModel.reload();
// DefaultMutableTreeNode root = (DefaultMutableTreeNode) treeModel.getRoot();
// path = (TreePath) selectParentNode.getChildAt(selectedNodeIndex-1);
// System.out.println(path.toString());
// fenetres.create.setTree(treeModel);
// treeModel.reload(root);
DefaultMutableTreeNode SelectParentNode = (DefaultMutableTreeNode) selectNode.getParent();
SelectParentNode.removeAllChildren();
SelectParentNode = addNodeMutable(nod.getParent(),SelectParentNode);
DefaultTreeModel model = (DefaultTreeModel) fenetres.create.getTree().getModel();
DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot();
model.reload(root);
// path= (TreePath) SelectParentNode.getFirstChild();
model.reload(root);
fenetres.create.getTree().setSelectionPath(path);
fenetres.create.getTree().expandPath(path);
}
DefaultMutableTreeNode SelectParentNode = (DefaultMutableTreeNode) selectNode.getParent();
SelectParentNode.removeAllChildren();
SelectParentNode = addNodeMutable(nod.getParent(),SelectParentNode);
DefaultTreeModel model = (DefaultTreeModel) fenetres.create.getTree().getModel();
DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot();
model.reload(root);
fenetres.create.getTree().setSelectionPath(path);
fenetres.create.getTree().expandPath(path);
// fenetres.create.constructionTree();
}else {
JOptionPane.showMessageDialog(null,"Vous ne devez pas déplacer ce node !", "Oh non!!!", JOptionPane.INFORMATION_MESSAGE);
}
@ -65,6 +87,11 @@ public class actUpNode extends AbstractAction{
}
}
private TreePath TreePath(TreeNode childAt) {
// TODO Auto-generated method stub
return null;
}
private static DefaultMutableTreeNode addNodeMutable(node nod, DefaultMutableTreeNode parent) {
if(nod!=null) {
DefaultMutableTreeNode node1 = null;