This commit is contained in:
pablo rodriguez 2022-06-02 17:48:14 +02:00
parent af42a93f7b
commit 6ae957d4a0
31 changed files with 373 additions and 91 deletions

View File

@ -5,7 +5,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/zip4j-1.2.7.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/git/analyseWriter/MEPTL/miglayout15-swing.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/cXML.jar"/>
<classpathentry kind="lib" path="jgoodies-forms-1.8.0.jar" sourcepath="jgoodies-forms-1.8.0-sources.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/cXML.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Binary file not shown.

1
bin/.gitignore vendored
View File

@ -1 +1,2 @@
/app/
/resources/

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.

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.

224
icons/poids.svg Normal file
View File

@ -0,0 +1,224 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
version="1.1"
id="svg2"
width="24"
height="24"
viewBox="0 0 24 24"
sodipodi:docname="poids.svg"
inkscape:export-filename="C:\Users\pabr6\git\analyseWriter\MEPTL\icons\poidsmini.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
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">
<defs
id="defs6">
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter14911"
x="-0.012400448"
y="-0.01406534"
width="1.0248009"
height="1.0281307">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="20.297016"
id="feGaussianBlur14913" />
</filter>
</defs>
<sodipodi:namedview
id="namedview4"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="false"
inkscape:guide-bbox="true"
inkscape:snap-global="false"
inkscape:zoom="32.666667"
inkscape:cx="11.387755"
inkscape:cy="12"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g5436">
<sodipodi:guide
position="3.2214765,22.260403"
orientation="0,-1"
id="guide856" />
<sodipodi:guide
position="1.9006711,20.456376"
orientation="1,0"
id="guide858" />
<sodipodi:guide
position="22.195973,20.456376"
orientation="1,0"
id="guide860" />
<sodipodi:guide
position="1.9006711,20.456376"
orientation="0,-1"
id="guide862" />
<sodipodi:guide
position="22.195973,3.3181208"
orientation="0,-1"
id="guide1026" />
<sodipodi:guide
position="22.195973,1.8684564"
orientation="0,-1"
id="guide1028" />
<sodipodi:guide
position="1.9006711,4.5422819"
orientation="0,-1"
id="guide1030" />
<sodipodi:guide
position="5.7342282,9.1167785"
orientation="0,-1"
id="guide1032" />
<sodipodi:guide
position="5.7342282,9.1167785"
orientation="1,0"
id="guide1034" />
<sodipodi:guide
position="17.84698,9.1167785"
orientation="1,0"
id="guide1036" />
<sodipodi:guide
position="7.8281879,7.9892617"
orientation="0,-1"
id="guide1038" />
<sodipodi:guide
position="8.1237963,13.205882"
orientation="1,0"
id="guide1040" />
<sodipodi:guide
position="11.01745,7.9892617"
orientation="1,0"
id="guide1042" />
<sodipodi:guide
position="4.7355705,11.146309"
orientation="1,0"
id="guide1044" />
<sodipodi:guide
position="4.7355705,11.146309"
orientation="0,-1"
id="guide1046" />
<sodipodi:guide
position="18.910067,11.146309"
orientation="1,0"
id="guide1048" />
<sodipodi:guide
position="4.7355705,19.683221"
orientation="0,-1"
id="guide1050" />
<sodipodi:guide
position="20.585235,1.868456"
orientation="1,0"
id="guide1247" />
</sodipodi:namedview>
<g
inkscape:groupmode="layer"
inkscape:label="Image"
id="g8">
<g
id="g5436">
<g
id="g15085"
transform="matrix(1.0229466,0,0,1.0229882,-0.10466327,-4.398651e-4)"
style="stroke-width:0.977548">
<g
id="g14742"
transform="matrix(0.00565232,0,0,0.00565232,11.601663,11.62492)"
style="opacity:0.652111;fill:#000000;fill-opacity:0.483092;stroke-width:172.946;filter:url(#filter14911)">
<path
id="path14726"
style="opacity:1;fill:#000000;fill-opacity:0.483092;stroke-width:34.5893;stroke-linecap:round;stroke-linejoin:round;paint-order:fill markers stroke;stop-color:#000000"
d="m 1377.5352,-1794.5957 c -11.9127,-0.3222 -24.5289,1.1404 -37.2676,4.6035 l -1129.21487,306.9883 v -116.916 c 0,-52.8043 -50.10052,-95.3145 -112.33398,-95.3145 H -78.292969 c -62.233461,0 -112.335941,42.5102 -112.335941,95.3145 v 226.1172 L -1392.7344,-1047 c -50.9549,13.8526 -84.0119,54.30672 -74.1172,90.70312 l 30.3633,111.6836 c 9.8947,36.39641 58.883,54.54592 109.8379,40.69336 l 1136.02149,-308.83788 v 2283.7637 h -701.24023 c -196.12966,0 -354.02536,157.8956 -354.02536,354.0253 v 143.6543 c 4.5552,-0.1721 9.0184,-0.6835 13.6172,-0.6835 h 2512.2128 v -142.9708 c 0,-196.1295 -157.8956,-354.0253 -354.02534,-354.0253 H 211.05273 V -1221.959 l 1195.29887,-324.9531 c 50.9549,-13.8526 84.0099,-54.3048 74.1152,-90.7012 l -30.3613,-111.6855 c -7.4211,-27.2973 -36.8323,-44.3305 -72.5703,-45.2969 z" />
<g
id="g14732"
style="fill:#000000;fill-opacity:0.483092;stroke-width:172.946">
<path
id="path14728"
style="opacity:1;fill:#000000;fill-opacity:0.483092;stroke-width:34589.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
d="m -1184.6211,-1028.0332 -74.8906,27.2324 -515.8184,1252.70314 h -116.123 a 656.98816,656.98816 0 0 0 -1.2168,17.01954 656.98816,656.98816 0 0 0 656.9883,656.98828 656.98816,656.98816 0 0 0 656.98824,-656.98828 656.98816,656.98816 0 0 0 -0.41797,-17.01954 H -682.9375 Z m -40.8496,231.47851 414.20508,1048.45703 h -840.14058 z" />
<path
id="path14730"
style="opacity:1;fill:#000000;fill-opacity:0.483092;stroke-width:34589.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
d="m -1772.2218,313.17585 a 537.53563,537.53563 0 0 0 -0.9956,13.92508 537.53563,537.53563 0 0 0 537.5358,537.53573 537.53563,537.53563 0 0 0 537.53569,-537.53573 537.53563,537.53563 0 0 0 -0.34198,-13.92508 z" />
</g>
<g
id="g14738"
transform="translate(2614.3364,-639.96777)"
style="fill:#000000;fill-opacity:0.483092;stroke-width:172.946">
<path
id="path14734"
style="opacity:1;fill:#000000;fill-opacity:0.483092;stroke-width:34589.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
d="m -1184.6211,-1028.0332 -74.8906,27.2324 -515.8184,1252.70314 h -116.123 a 656.98816,656.98816 0 0 0 -1.2168,17.01954 656.98816,656.98816 0 0 0 656.9883,656.98828 656.98816,656.98816 0 0 0 656.98824,-656.98828 656.98816,656.98816 0 0 0 -0.41797,-17.01954 H -682.9375 Z m -40.8496,231.47851 414.20508,1048.45703 h -840.14058 z" />
<path
id="path14736"
style="opacity:1;fill:#000000;fill-opacity:0.483092;stroke-width:34589.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
d="m -1772.2218,313.17585 a 537.53563,537.53563 0 0 0 -0.9956,13.92508 537.53563,537.53563 0 0 0 537.5358,537.53573 537.53563,537.53563 0 0 0 537.53569,-537.53573 537.53563,537.53563 0 0 0 -0.34198,-13.92508 z" />
</g>
<path
id="path14740"
style="opacity:1;fill:#000000;fill-opacity:0.483092;stroke-width:34.5893;stroke-linecap:round;stroke-linejoin:round;paint-order:fill markers stroke;stop-color:#000000"
sodipodi:type="inkscape:offset"
inkscape:radius="-69.882721"
inkscape:original="M 1377.5352 -1794.5957 C 1365.6225 -1794.9179 1353.0063 -1793.4553 1340.2676 -1789.9922 L 211.05273 -1483.0039 L 211.05273 -1599.9199 C 211.05273 -1652.7242 160.95221 -1695.2344 98.71875 -1695.2344 L -78.292969 -1695.2344 C -140.52643 -1695.2344 -190.62891 -1652.7242 -190.62891 -1599.9199 L -190.62891 -1373.8027 L -1392.7344 -1047 C -1443.6893 -1033.1474 -1476.7463 -992.69328 -1466.8516 -956.29688 L -1436.4883 -844.61328 C -1426.5936 -808.21687 -1377.6053 -790.06736 -1326.6504 -803.91992 L -190.62891 -1112.7578 L -190.62891 1171.0059 L -891.86914 1171.0059 C -1087.9988 1171.0059 -1245.8945 1328.9015 -1245.8945 1525.0312 L -1245.8945 1668.6855 C -1241.3393 1668.5134 -1236.8761 1668.002 -1232.2773 1668.002 L 1279.9355 1668.002 L 1279.9355 1525.0312 C 1279.9355 1328.9017 1122.0399 1171.0059 925.91016 1171.0059 L 211.05273 1171.0059 L 211.05273 -1221.959 L 1406.3516 -1546.9121 C 1457.3065 -1560.7647 1490.3615 -1601.2169 1480.4668 -1637.6133 L 1450.1055 -1749.2988 C 1442.6844 -1776.5961 1413.2732 -1793.6293 1377.5352 -1794.5957 z "
d="m 1375.6465,-1724.7383 c -4.866,-0.1316 -10.7729,0.476 -17.0469,2.1817 l -1129.21483,306.9882 a 69.889709,69.889709 0 0 1 -88.21485,-67.4355 v -116.916 c 0,-8.6013 -12.0412,-25.4317 -42.45117,-25.4317 H -78.292969 c -30.409971,0 -42.453121,16.8321 -42.453121,25.4317 v 226.1172 a 69.889709,69.889709 0 0 1 -51.55079,67.4355 l -1202.10542,326.80275 c -11.3993,3.099 -19.4755,8.99285 -22.9415,12.55859 l 26.2188,96.43555 c 4.7941,1.32005 14.7436,2.31375 26.1426,-0.78516 l 1136.02146,-308.83793 a 69.889709,69.889709 0 0 1 88.21485,67.4356 v 2283.7637 a 69.889709,69.889709 0 0 1 -69.88282,69.8828 h -701.24023 c -158.62326,0 -284.14256,125.5193 -284.14256,284.1425 v 73.0879 h 2386.0644 v -73.0879 c 0,-158.623 -125.5192,-284.1425 -284.14254,-284.1425 H 211.05273 a 69.889709,69.889709 0 0 1 -69.88281,-69.8828 V -1221.959 a 69.889709,69.889709 0 0 1 51.55078,-67.4355 l 1195.2988,-324.9532 c 11.3995,-3.099 19.4741,-8.9916 22.9395,-12.5566 l -26.3555,-96.9473 c -1.1147,-0.193 -3.3517,-0.7351 -8.957,-0.8867 z" />
</g>
<g
id="g14496"
transform="matrix(0.00565232,0,0,0.00565232,11.111867,11.869818)"
style="stroke-width:172.946">
<path
id="rect1086"
style="opacity:1;fill:#013668;fill-opacity:1;stroke-width:34.5893;stroke-linecap:round;stroke-linejoin:round;paint-order:fill markers stroke;stop-color:#000000"
d="m 1377.5352,-1794.5957 c -11.9127,-0.3222 -24.5289,1.1404 -37.2676,4.6035 l -1129.21487,306.9883 v -116.916 c 0,-52.8043 -50.10052,-95.3145 -112.33398,-95.3145 H -78.292969 c -62.233461,0 -112.335941,42.5102 -112.335941,95.3145 v 226.1172 L -1392.7344,-1047 c -50.9549,13.8526 -84.0119,54.30672 -74.1172,90.70312 l 30.3633,111.6836 c 9.8947,36.39641 58.883,54.54592 109.8379,40.69336 l 1136.02149,-308.83788 v 2283.7637 h -701.24023 c -196.12966,0 -354.02536,157.8956 -354.02536,354.0253 v 143.6543 c 4.5552,-0.1721 9.0184,-0.6835 13.6172,-0.6835 h 2512.2128 v -142.9708 c 0,-196.1295 -157.8956,-354.0253 -354.02534,-354.0253 H 211.05273 V -1221.959 l 1195.29887,-324.9531 c 50.9549,-13.8526 84.0099,-54.3048 74.1152,-90.7012 l -30.3613,-111.6855 c -7.4211,-27.2973 -36.8323,-44.3305 -72.5703,-45.2969 z" />
<g
id="g2313"
style="stroke-width:172.946">
<path
id="path1818"
style="opacity:1;fill:#013668;fill-opacity:1;stroke-width:34589.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
d="m -1184.6211,-1028.0332 -74.8906,27.2324 -515.8184,1252.70314 h -116.123 a 656.98816,656.98816 0 0 0 -1.2168,17.01954 656.98816,656.98816 0 0 0 656.9883,656.98828 656.98816,656.98816 0 0 0 656.98824,-656.98828 656.98816,656.98816 0 0 0 -0.41797,-17.01954 H -682.9375 Z m -40.8496,231.47851 414.20508,1048.45703 h -840.14058 z" />
<path
id="path2005"
style="opacity:1;fill:#ffff00;stroke-width:34589.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
d="m -1772.2218,313.17585 a 537.53563,537.53563 0 0 0 -0.9956,13.92508 537.53563,537.53563 0 0 0 537.5358,537.53573 537.53563,537.53563 0 0 0 537.53569,-537.53573 537.53563,537.53563 0 0 0 -0.34198,-13.92508 z" />
</g>
<g
id="g2319"
transform="translate(2614.3364,-639.96777)"
style="stroke-width:172.946">
<path
id="path2315"
style="opacity:1;fill:#013668;fill-opacity:1;stroke-width:34589.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
d="m -1184.6211,-1028.0332 -74.8906,27.2324 -515.8184,1252.70314 h -116.123 a 656.98816,656.98816 0 0 0 -1.2168,17.01954 656.98816,656.98816 0 0 0 656.9883,656.98828 656.98816,656.98816 0 0 0 656.98824,-656.98828 656.98816,656.98816 0 0 0 -0.41797,-17.01954 H -682.9375 Z m -40.8496,231.47851 414.20508,1048.45703 h -840.14058 z" />
<path
id="path2317"
style="opacity:1;fill:#ffcc00;stroke-width:34589.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
d="m -1772.2218,313.17585 a 537.53563,537.53563 0 0 0 -0.9956,13.92508 537.53563,537.53563 0 0 0 537.5358,537.53573 537.53563,537.53563 0 0 0 537.53569,-537.53573 537.53563,537.53563 0 0 0 -0.34198,-13.92508 z" />
</g>
<path
id="path14287"
style="opacity:1;fill:#008080;fill-opacity:1;stroke-width:34.5893;stroke-linecap:round;stroke-linejoin:round;paint-order:fill markers stroke;stop-color:#000000"
sodipodi:type="inkscape:offset"
inkscape:radius="-69.882721"
inkscape:original="M 1377.5352 -1794.5957 C 1365.6225 -1794.9179 1353.0063 -1793.4553 1340.2676 -1789.9922 L 211.05273 -1483.0039 L 211.05273 -1599.9199 C 211.05273 -1652.7242 160.95221 -1695.2344 98.71875 -1695.2344 L -78.292969 -1695.2344 C -140.52643 -1695.2344 -190.62891 -1652.7242 -190.62891 -1599.9199 L -190.62891 -1373.8027 L -1392.7344 -1047 C -1443.6893 -1033.1474 -1476.7463 -992.69328 -1466.8516 -956.29688 L -1436.4883 -844.61328 C -1426.5936 -808.21687 -1377.6053 -790.06736 -1326.6504 -803.91992 L -190.62891 -1112.7578 L -190.62891 1171.0059 L -891.86914 1171.0059 C -1087.9988 1171.0059 -1245.8945 1328.9015 -1245.8945 1525.0312 L -1245.8945 1668.6855 C -1241.3393 1668.5134 -1236.8761 1668.002 -1232.2773 1668.002 L 1279.9355 1668.002 L 1279.9355 1525.0312 C 1279.9355 1328.9017 1122.0399 1171.0059 925.91016 1171.0059 L 211.05273 1171.0059 L 211.05273 -1221.959 L 1406.3516 -1546.9121 C 1457.3065 -1560.7647 1490.3615 -1601.2169 1480.4668 -1637.6133 L 1450.1055 -1749.2988 C 1442.6844 -1776.5961 1413.2732 -1793.6293 1377.5352 -1794.5957 z "
d="m 1375.6465,-1724.7383 c -4.866,-0.1316 -10.7729,0.476 -17.0469,2.1817 l -1129.21483,306.9882 a 69.889709,69.889709 0 0 1 -88.21485,-67.4355 v -116.916 c 0,-8.6013 -12.0412,-25.4317 -42.45117,-25.4317 H -78.292969 c -30.409971,0 -42.453121,16.8321 -42.453121,25.4317 v 226.1172 a 69.889709,69.889709 0 0 1 -51.55079,67.4355 l -1202.10542,326.80275 c -11.3993,3.099 -19.4755,8.99285 -22.9415,12.55859 l 26.2188,96.43555 c 4.7941,1.32005 14.7436,2.31375 26.1426,-0.78516 l 1136.02146,-308.83793 a 69.889709,69.889709 0 0 1 88.21485,67.4356 v 2283.7637 a 69.889709,69.889709 0 0 1 -69.88282,69.8828 h -701.24023 c -158.62326,0 -284.14256,125.5193 -284.14256,284.1425 v 73.0879 h 2386.0644 v -73.0879 c 0,-158.623 -125.5192,-284.1425 -284.14254,-284.1425 H 211.05273 a 69.889709,69.889709 0 0 1 -69.88281,-69.8828 V -1221.959 a 69.889709,69.889709 0 0 1 51.55078,-67.4355 l 1195.2988,-324.9532 c 11.3995,-3.099 19.4741,-8.9916 22.9395,-12.5566 l -26.3555,-96.9473 c -1.1147,-0.193 -3.3517,-0.7351 -8.957,-0.8867 z" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

BIN
icons/poidsmini.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -170,12 +170,12 @@ public class create extends JFrame {
tree.setVisibleRowCount(30);
// Ajoute le menu contextuel de la tree
tree.setComponentPopupMenu(createPopupMenuTree());
tree.setComponentPopupMenu(null);
// Construction et injection de la barre d'outils
JPanel contentPane = (JPanel) getContentPane();
this.createToolBar();
this.createPopupMenuTree();
this.createPopupMenuTree(null);
getContentPane().setLayout(new BorderLayout(2, 2));
contentPane.add( toolBar, BorderLayout.NORTH );
@ -493,14 +493,10 @@ public class create extends JFrame {
StringBuilder sb = new StringBuilder();
sb.append(balisestyles());
sb.append("<p class=\"p1\">Parent = " + nodeParent.getNomElt() + "</p><br>");
sb.append("<hr>");
sb.append("<br><h1>Nom du node : " + nod.getNomElt() + "</h1><br>");
sb.append("<hr>");
@ -509,34 +505,39 @@ public class create extends JFrame {
sb.append("<ul>");
while(key.hasMoreElements()) {
String k = key.nextElement();
boolean ecrit =false;
// boolean ecrit =false;
if(nod.getAttributs().get("evaluer")!=null) {
if(nod.getAttributs().get("evaluer").equals("true")) {
switch(k) {
case ("evalContenu"):
sb.append("<li class=\"p2\"><b>" + k + "=\"" + nod.getAttributs().get(k)+"\"</b></li>");
ecrit=true;
break;
case("evaluer"):
sb.append("<li class=\"p2\"><b>" + k + "=\"" + nod.getAttributs().get(k)+"\"</b></li>");
ecrit=true;
break;
}
if(nod.getAttributs().get(k).contains("") && !ecrit) {
sb.append("<li class=\"p2\"><b>" + k + "=\"" + nod.getAttributs().get(k)+"\"</b></li>");
ecrit=true;
}else {
sb.append("<li class=\"p2\">" + k + "=\"" + nod.getAttributs().get(k)+"\"</li>");
ecrit=true;
}
sb.append("<li class=\"p2\"><b>" + k + "=\"" + nod.getAttributs().get(k)+"\"</b></li>");
// switch(k) {
// case ("evalContenu"):
// sb.append("<li class=\"p2\"><b>" + k + "=\"" + nod.getAttributs().get(k)+"\"</b></li>");
// ecrit=true;
// break;
// case("evaluer"):
// sb.append("<li class=\"p2\"><b>" + k + "=\"" + nod.getAttributs().get(k)+"\"</b></li>");
// ecrit=true;
// break;
// }
//
// if(nod.getAttributs().get(k).contains("") && !ecrit) {
// sb.append("<li class=\"p2\"><b>" + k + "=\"" + nod.getAttributs().get(k)+"\"</b></li>");
// ecrit=true;
// }else {
// sb.append("<li class=\"p2\">" + k + "=\"" + nod.getAttributs().get(k)+"\"</li>");
// ecrit=true;
// }
}else {
sb.append("<li class=\"p3\">" + k + "=\"" + nod.getAttributs().get(k)+"\"</li>");
if(nod.getAttributs().get(k).contains("")) sb.append("<li class=\"p3\"><b>" + k + "=\"" + nod.getAttributs().get(k)+"\"</b></li>");
}
}else {
}
if(nod.getAttributs().get("evaluer")==null) {
sb.append("<li class=\"p3\">" + k + "=\"" + nod.getAttributs().get(k)+"\"</li>");
}
@ -549,6 +550,8 @@ public class create extends JFrame {
}
textNodeSelect.setText("<html>"+sb.toString()+"</html>");
createPopupMenuTree(nod);
}
}
@ -558,37 +561,62 @@ public class create extends JFrame {
* Création du menu contextuel du tree
* @return
*/
private JPopupMenu createPopupMenuTree() {
private void createPopupMenuTree(node nod) {
if(nod!=null) {
JMenu mnEvaluer = new JMenu("Evaluer");
mnEvaluer.add(actEvalueTrue);
mnEvaluer.add(actEvalueFalse);
JMenu mnManageTree = new JMenu("Arbre");
mnManageTree.add(actExpandAll);
mnManageTree.add(actExpandNode);
mnManageTree.addSeparator();
mnManageTree.add(actCollapseAll);
mnManageTree.add(actCollapseNode);
JMenu mnNodePrincipal = new JMenu("Node niveau 1");
mnNodePrincipal.add(actCoefficient);
mnNodePrincipal.addSeparator();
mnNodePrincipal.add("Insère une ligne avant le titre");
mnNodePrincipal.addSeparator();
mnNodePrincipal.add("Ajoute un Titre principal");
mnNodePrincipal.add("Ajoute un Titre 1");
mnNodePrincipal.add("Ajoute un Titre 2");
mnNodePrincipal.add("Ajoute un Titre 3");
JPopupMenu mnPopupTree = new JPopupMenu();
mnPopupTree.add(mnEvaluer);
if(nod.getLevel()==1) {
mnPopupTree.addSeparator();
mnPopupTree.add(mnNodePrincipal);
}
mnPopupTree.addSeparator();
mnPopupTree.add(actNodeFichier);
mnPopupTree.addSeparator();
mnPopupTree.add(mnManageTree);
mnPopupTree.addSeparator();
mnPopupTree.add(actDelete);
JMenu mnEvaluer = new JMenu("Evaluer");
mnEvaluer.add(actEvalueTrue);
mnEvaluer.add(actEvalueFalse);
tree.setComponentPopupMenu(mnPopupTree);
}else {
JMenu mnManageTree = new JMenu("Arbre");
mnManageTree.add(actExpandAll);
mnManageTree.add(actExpandNode);
mnManageTree.addSeparator();
mnManageTree.add(actCollapseAll);
mnManageTree.add(actCollapseNode);
JPopupMenu mnPopupTree = new JPopupMenu();
mnPopupTree.add(mnManageTree);
tree.setComponentPopupMenu(mnPopupTree);
}
JMenu mnManageTree = new JMenu("Arbre");
mnManageTree.add(actExpandAll);
mnManageTree.add(actExpandNode);
mnManageTree.addSeparator();
mnManageTree.add(actCollapseAll);
mnManageTree.add(actCollapseNode);
JMenu mnNiveauPrincipal = new JMenu("Node niveau 1");
mnNiveauPrincipal.add("Ajoute une lien de menu");
mnNiveauPrincipal.add("Ajoute un titre de menu");
mnNiveauPrincipal.add("Coefficient");
JPopupMenu mnPopupTree = new JPopupMenu();
mnPopupTree.add(mnEvaluer);
mnPopupTree.addSeparator();
mnPopupTree.add(mnNiveauPrincipal);
mnPopupTree.addSeparator();
mnPopupTree.add(actNodeFichier);
mnPopupTree.addSeparator();
mnPopupTree.add(mnManageTree);
mnPopupTree.addSeparator();
mnPopupTree.add(actDelete);
return mnPopupTree;
}
@ -709,18 +737,7 @@ public class create extends JFrame {
// }
}
/*Mise à jour de la toolbar*/
private void MAJToolBar() {
// if(commandes.fichierAnalyseValide) {
// toolBar.getComponent(6).setEnabled(true);
// toolBar.getComponent(7).setEnabled(true);
// menuBar.getComponent(3).setEnabled(true);
// }else {
// toolBar.getComponent(6).setEnabled(false);
// toolBar.getComponent(7).setEnabled(false);
// menuBar.getComponent(3).setEnabled(false);
// }
}
@ -744,11 +761,9 @@ public class create extends JFrame {
if(commandes.fichierAnalyseValide) {
constructionTree();
textNodeSelect.setText("Le chargement de la nouvelle structure est réussi.");
MAJToolBar();
}else {
constructionTree();
textNodeSelect.setText(commandes.message.toString());
MAJToolBar();
}
System.out.println( "Open" );
}
@ -1035,6 +1050,53 @@ public class create extends JFrame {
System.out.println( "Cut" );
}
};
/**
*
*/
private AbstractAction actCoefficient = new AbstractAction() {
private static final long serialVersionUID = 1L;
{
putValue( Action.NAME, "Coefficient (poids)" );
putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/poidsmini.png")) );
putValue( Action.SHORT_DESCRIPTION, "Coefficient (poids)" );
}
@Override public void actionPerformed( ActionEvent e ) {
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
node nod = (node) selectNode.getUserObject();
int poids = 1;
if(nod.getAttributs().get("poids")!=null) {
poids = Integer.valueOf(nod.getAttributs().get("poids"));
}
String a = JOptionPane.showInputDialog(null,"Quel est le coefficient de cette partie de l'évaluation?",poids);
if(!a.isEmpty()) {
try {
poids = Integer.valueOf(a);
if(poids<=0) {
nod.poids(Integer.valueOf(1));
textNodeSelect.setText(balisestyles());
textNodeSelect.setText("<h2>Erreur la valeur doit être un nombre entier POSITIF supérieur à zéro.<br>Cependant,la valeur a été modifiée.<br>poids=1.</h2>");
}else {
nod.poids(Integer.valueOf(poids));
refeshNodeSelected();
}
} catch (Exception e2) {
textNodeSelect.setText(balisestyles());
textNodeSelect.setText("<h2>Erreur la valeur doit être un nombre entier.<br>La valeur n'a pas été modifiée.</h2>");
}
}
}
};
/**
*
@ -1129,33 +1191,27 @@ public class create extends JFrame {
}
@Override public void actionPerformed( ActionEvent e ) {
// TreePath p = tree.getSelectionPath();
// int level = p.getPathCount();
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
textNodeSelect.setContentType("text/html");
node nod = (node) selectNode.getUserObject();
nod.evaluerTrue();
refeshNodeSelected();
TreeNode[] chemin = selectNode.getPath();
boolean avertissement=false;
for(int i = 0 ; i < chemin.length; i++) {
if(chemin[i].toString().contains("setting")) avertissement = true;
System.out.println(chemin[i].toString());
}
// tree.setModel(commandes.tree.getModel()) ;
// constructionTree();
// try {
// expandOrCollapsePath(tree,p,level,1,true);
// }catch(Exception e1) {
// e1.printStackTrace();
// //do nothing
// }
// System.out.println(p.toString());
// System.out.println(tree.getExpandsSelectedPaths());
// tree.setSelectionPath(p);
// tree.expandPath(p);
if(!avertissement) {
nod.evaluerTrue();
if(nod.getLevel()==1) {
nod.addMenu(true);
}
refeshNodeSelected();
}else {
JOptionPane.showMessageDialog(null, "Ce node ne peut pas être évaluer." );
}
}
};
@ -1513,6 +1569,7 @@ public class create extends JFrame {
private static String balisestyles() {
return "<style type=\"text/css\">"
+ "h1 {margin-bottom: 0.25cm;font-size: 18pt;font-family:\"Arial\";text-align:center;font-weight: bold;}"
+ "h2 {color:red;margin-bottom: 0.25cm;font-size: 18pt;font-family:\"Arial\";text-align:center;font-weight: bold;}"
+ "h4 {text-align:left;font-family: \"Arial\"; font-size: 16pt; font-weight: bold; line-height: 110%;}"
+ "hr { display: block; margin-top: 0.5em; margin-bottom: 8em; margin-left: 2em; margin-right: 2em; border-style: inset; border-width: 4px;}"
+ "spanpablo { float: right; width: 8em; font-size: 250%; font-family: algerian, courier; line-height: 80%; margin-right: 1%; color: red; text-align: center}"

BIN
src/resources/poidsmini.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB