This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit 50855f21b23f0313bdc3ab5c73fa024a3d80e408 Author: Kevin Morin <morin@codelutin.com> Date: Fri Jan 30 14:35:37 2015 +0100 refs #6575 ajout des poids tremie et carrousel + ratio vrac trié / vrac total --- .../operation/catches/EditCatchesUIHandler.java | 58 ++++++++++- tutti-ui-swing/src/main/resources/EcranResume.svg | 112 +++++++++++++-------- 2 files changed, 124 insertions(+), 46 deletions(-) diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java index a2b9da1..aaa009e 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/content/operation/catches/EditCatchesUIHandler.java @@ -122,7 +122,9 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi n("tutti.editCatchBatch.field.benthosTotalSampleSortedComputedWeight"); n("tutti.editCatchBatch.field.speciesDistinctSortedSpeciesCount"); - n("tutti.editCatchBatch.field.benthosDistinctSortedSpeciesCount"); + + n("tutti.editCatchBatch.field.catchTotalSortedTremisWeight"); + n("tutti.editCatchBatch.field.catchTotalSortedCarousselWeight"); } /** Logger. */ @@ -333,10 +335,18 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi CatchBatch.PROPERTY_BENTHOS_TOTAL_SORTED_COMPUTED_WEIGHT, canvas, svgDocument)); + model.addPropertyChangeListener(new RatioPropertyChangeListener("ratioSortedSortedOverSortedWeightLabel", + CatchBatch.PROPERTY_CATCH_TOTAL_SORTED_SORTED_COMPUTED_WEIGHT, + CatchBatch.PROPERTY_CATCH_TOTAL_SORTED_COMPUTED_WEIGHT, + CatchBatch.PROPERTY_CATCH_TOTAL_SORTED_COMPUTED_WEIGHT, + canvas, + svgDocument)); initSpeciesCount(CatchBatch.PROPERTY_SPECIES_DISTINCT_SORTED_SPECIES_COUNT); initSpeciesCount(CatchBatch.PROPERTY_BENTHOS_DISTINCT_SORTED_SPECIES_COUNT); + initTremieCarrouselField(CatchBatch.PROPERTY_CATCH_TOTAL_SORTED_CAROUSSEL_WEIGHT, catchWeightUnit); + initTremieCarrouselField(CatchBatch.PROPERTY_CATCH_TOTAL_SORTED_TREMIS_WEIGHT, catchWeightUnit); } }); @@ -368,6 +378,50 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi }); } + protected void initTremieCarrouselField(final String property, final WeightUnit weightUnit) { + if (log.isDebugEnabled()) { + log.debug("init " + property + " field"); + } + + canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new Runnable() { + @Override + public void run() { + Element labelElement = svgDocument.getElementById(property + "Label"); + labelElement.setTextContent(weightUnit.decorateLabel(t("tutti.editCatchBatch.field." + property))); + } + }); + + getModel().addPropertyChangeListener(property, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + Float value = (Float) evt.getNewValue(); + Element valueElement = svgDocument.getElementById(property + "Value"); + String text; + if (value == null) { + text = ""; + } else { + text = Weights.getWeightStringValue(value) + " " + weightUnit.getShortLabel(); + } + valueElement.setTextContent(text); + } + }); + + getModel().addPropertyChangeListener(EditCatchesUIModel.PROPERTY_FISHING_OPERATION, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + EditCatchesUIModel model = (EditCatchesUIModel) evt.getSource(); + boolean tremieCarrouselFieldsVisisble = model.getFishingOperation().getVessel() != null + && model.getFishingOperation().getVessel().getId().equals(getConfig().getTremieCarousselVesselId()); + + Element labelElement = svgDocument.getElementById(property + "Label"); + labelElement.setAttribute("visibility", tremieCarrouselFieldsVisisble ? "visible" : "hidden"); + + Element valueElement = svgDocument.getElementById(property + "Value"); + valueElement.setAttribute("visibility", tremieCarrouselFieldsVisisble ? "visible" : "hidden"); + } + }); + } + protected void initSvgField(String property, WeightUnit weightUnit, String... idsInGroup) { initSvgField(property, null, weightUnit, idsInGroup); } @@ -1177,7 +1231,7 @@ public class EditCatchesUIHandler extends AbstractTuttiTabContainerUIHandler<Edi public void propertyChange(PropertyChangeEvent evt) { String propertyName = evt.getPropertyName(); - if (numeratorProperty.equals(propertyName) || denominatorProperty.equals(propertyName)) { + if (propertyName.equals(numeratorProperty) || propertyName.equals(denominatorProperty)) { EditCatchesUIModel model = (EditCatchesUIModel) evt.getSource(); try { diff --git a/tutti-ui-swing/src/main/resources/EcranResume.svg b/tutti-ui-swing/src/main/resources/EcranResume.svg index 8d85766..7e76b12 100644 --- a/tutti-ui-swing/src/main/resources/EcranResume.svg +++ b/tutti-ui-swing/src/main/resources/EcranResume.svg @@ -10,7 +10,7 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:version="0.48.3.1 r9886" - sodipodi:docname="EcranResume2.svg" + sodipodi:docname="EcranResume.svg" version="1.1" x="0px" y="0px" @@ -29,14 +29,14 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="4.0000002" - inkscape:cx="281.61972" - inkscape:cy="101.44429" + inkscape:zoom="2.8284273" + inkscape:cx="394.18449" + inkscape:cy="179.07834" inkscape:current-layer="layer2" id="namedview2989" showgrid="true" inkscape:window-width="1920" - inkscape:window-height="1048" + inkscape:window-height="1049" inkscape:window-x="1280" inkscape:window-y="0" inkscape:window-maximized="1" @@ -97,8 +97,8 @@ id="rect4276" width="1.2082677" height="54.04163" - x="432.35135" - y="105.75418" /> + x="432.60135" + y="139.5844" /> <path style="fill:none;stroke:#006bba;stroke-width:1.77165353;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m 471.64546,-163.00283 -0.0122,-26.66861 122.31709,0.38377 -0.42569,-51.87718 0.482,51.8849 137.75486,0.29303 -0.071,26.06381" @@ -108,7 +108,7 @@ transform="matrix(1.4580208,0,0,0.99343887,-241.52824,52.133138)" /> <g id="catchTotalWeight" - transform="translate(-12.727921,-11.667261)"> + transform="translate(-12.727921,10.253048)"> <rect y="-206.33543" x="480.88577" @@ -242,7 +242,7 @@ sodipodi:type="star" /> <g id="g4803" - transform="translate(171.93502,88.162948)"> + transform="translate(171.93502,106.19417)"> <g id="g3094" transform="matrix(0.84647606,0,0,0.84647606,135.37037,23.780278)"> @@ -276,7 +276,7 @@ </g> <g id="g4588" - transform="translate(42.426405,66.620054)"> + transform="translate(42.426405,84.651271)"> <g transform="matrix(0.84647606,0,0,0.84647606,135.37037,23.780278)" id="g4154"> @@ -312,12 +312,12 @@ sodipodi:nodetypes="ccccccc" inkscape:connector-curvature="0" id="path4120" - d="m 599.60276,-96.90552 0,-29.5 131.3125,0 -0.1875,-15 0.1875,14.98614 130.1875,-0.48614 0,67.581749" + d="m 600.09977,-84.857782 -0.49701,-41.547738 131.3125,0 -0.1875,-15 0.1875,14.98614 130.1875,-0.48614 0,83.17294" style="fill:none;stroke:#006bba;stroke-width:1.77165353;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" transform="matrix(0.71136481,0,0,0.99776526,305.68075,64.079044)" /> <path inkscape:transform-center-y="1.576596" - transform="matrix(1.045689,0,0,0.98527645,267.46628,-118.28673)" + transform="matrix(1.045689,0,0,0.98527645,267.46628,-100.25551)" d="m 444.23984,89.309863 c 0.14753,0 -5.47151,-9.732452 -5.54527,-9.604687 -0.0738,0.127765 11.1643,0.127765 11.09054,0 -0.0738,-0.127765 -5.6928,9.604687 -5.54527,9.604687 z" inkscape:randomized="0" inkscape:rounded="-0.013302361" @@ -348,12 +348,12 @@ inkscape:rounded="-0.013302361" inkscape:randomized="0" d="m 444.23984,89.309863 c 0.14753,0 -5.47151,-9.732452 -5.54527,-9.604687 -0.0738,0.127765 11.1643,0.127765 11.09054,0 -0.0738,-0.127765 -5.6928,9.604687 -5.54527,9.604687 z" - transform="matrix(1.045689,0,0,0.98527645,454.00609,-77.829632)" + transform="matrix(1.045689,0,0,0.98527645,454.00609,-59.79841)" inkscape:transform-center-y="1.576596" inkscape:transform-center-x="1.1708959e-05" /> <g id="g4738" - transform="translate(31.259144,27.882252)"> + transform="translate(31.259144,45.913474)"> <g transform="matrix(0.84647606,0,0,0.84647606,-86.984873,84.726553)" id="catchTotalRejectedWeight"> @@ -387,7 +387,7 @@ </g> <g id="g4717" - transform="translate(51.618793,66.468036)"> + transform="translate(51.618793,84.499261)"> <g id="catchTotalSortedSortedComputedWeight" transform="matrix(0.84647606,0,0,0.84647606,-245.9198,23.780278)"> @@ -421,7 +421,7 @@ </g> <path style="fill:none;stroke:#006bba;stroke-width:1.84971476;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" - d="m 368.29586,-29.885424 0,-18.445454 78.27538,0 -0.11177,-27.429891 0.11177,27.404546 99.77508,-0.01767 -0.16421,53.7386949" + d="m 368.64941,-17.511056 -0.10355,-18.069823 78.02538,-0.5 -0.11177,-41.42989 -0.13823,41.404545 99.77508,0.23233 0.0858,57.502151" id="path4200" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccccc" /> @@ -441,12 +441,12 @@ inkscape:rounded="-0.013302361" inkscape:randomized="0" d="m 444.23984,89.309863 c 0.14753,0 -5.47151,-9.732452 -5.54527,-9.604687 -0.0738,0.127765 11.1643,0.127765 11.09054,0 -0.0738,-0.127765 -5.6928,9.604687 -5.54527,9.604687 z" - transform="matrix(1.045689,0,0,0.98527645,-95.89623,-116.25677)" + transform="matrix(1.045689,0,0,0.98527645,-95.89623,-98.225548)" inkscape:transform-center-y="1.576596" /> <path inkscape:transform-center-x="1.1708959e-05" inkscape:transform-center-y="1.576596" - transform="matrix(1.045689,0,0,0.98527645,81.408316,-77.71388)" + transform="matrix(1.045689,0,0,0.98527645,81.408316,-59.682658)" d="m 444.23984,89.309863 c 0.14753,0 -5.47151,-9.732452 -5.54527,-9.604687 -0.0738,0.127765 11.1643,0.127765 11.09054,0 -0.0738,-0.127765 -5.6928,9.604687 -5.54527,9.604687 z" inkscape:randomized="0" inkscape:rounded="-0.013302361" @@ -463,7 +463,7 @@ sodipodi:type="star" /> <g id="g4695" - transform="translate(17.67767,74.599764)"> + transform="translate(17.92767,108.42997)"> <g id="g4206" transform="matrix(0.84647606,0,0,0.84647606,-8.9848728,152.72655)"> @@ -499,15 +499,15 @@ </g> </g> <rect - y="105.81484" - x="656.83038" + y="139.64505" + x="657.08038" height="53.334522" width="1.2082677" id="rect4338" style="fill:#006bba;fill-opacity:1;fill-rule:nonzero;stroke:none" /> <g id="g4652" - transform="translate(84.297725,74.367531)"> + transform="translate(84.547725,108.19774)"> <g transform="matrix(0.84647606,0,0,0.84647606,-167.9198,91.780282)" id="benthosTotalSortedWeight"> @@ -543,11 +543,11 @@ sodipodi:nodetypes="ccccccc" inkscape:connector-curvature="0" id="path4236" - d="m 433.03409,78.367492 0,-31.14047 112.89255,0 -0.16119,-15.834137 0.16119,15.819506 111.92537,-0.513174 0,32.723884" + d="m 433.03409,116.1977 0,-26.236661 112.89255,0.207107 -0.16119,-41.097592 0.16119,41.082961 111.92537,-0.513174 0,27.612969" style="fill:none;stroke:#006bba;stroke-width:1.68775713;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> <path inkscape:transform-center-y="1.576596" - transform="matrix(1.045689,0,0,0.98527645,-30.874143,-1.5821532)" + transform="matrix(1.045689,0,0,0.98527645,-30.624143,32.248058)" d="m 444.23984,89.309863 c 0.14753,0 -5.47151,-9.732452 -5.54527,-9.604687 -0.0738,0.127765 11.1643,0.127765 11.09054,0 -0.0738,-0.127765 -5.6928,9.604687 -5.54527,9.604687 z" inkscape:randomized="0" inkscape:rounded="-0.013302361" @@ -578,12 +578,12 @@ inkscape:rounded="-0.013302361" inkscape:randomized="0" d="m 444.23984,89.309863 c 0.14753,0 -5.47151,-9.732452 -5.54527,-9.604687 -0.0738,0.127765 11.1643,0.127765 11.09054,0 -0.0738,-0.127765 -5.6928,9.604687 -5.54527,9.604687 z" - transform="matrix(1.045689,0,0,0.98527645,192.54436,-0.46084621)" + transform="matrix(1.045689,0,0,0.98527645,192.79436,33.369365)" inkscape:transform-center-y="1.576596" inkscape:transform-center-x="1.1708959e-05" /> <g id="g4631" - transform="translate(84.797725,97.391394)"> + transform="translate(84.340618,127.33251)"> <g id="g4242" transform="matrix(0.84647606,0,0,0.84647606,-167.9198,151.78028)"> @@ -618,7 +618,7 @@ <path inkscape:transform-center-x="1.1708959e-05" inkscape:transform-center-y="1.576596" - transform="matrix(1.045689,0,0,0.98527645,193.25146,80.752362)" + transform="matrix(1.045689,0,0,0.98527645,192.79435,110.69348)" d="m 444.23984,89.309863 c 0.14753,0 -5.47151,-9.732452 -5.54527,-9.604687 -0.0738,0.127765 11.1643,0.127765 11.09054,0 -0.0738,-0.127765 -5.6928,9.604687 -5.54527,9.604687 z" inkscape:randomized="0" inkscape:rounded="-0.013302361" @@ -635,7 +635,7 @@ sodipodi:type="star" /> <g id="g4673" - transform="translate(18.384777,96.873626)"> + transform="translate(17.92767,126.81475)"> <g transform="matrix(0.84647606,0,0,0.84647606,-8.9848728,212.72655)" id="g4258"> @@ -683,7 +683,7 @@ inkscape:rounded="-0.013302361" inkscape:randomized="0" d="m 444.23984,89.309863 c 0.14753,0 -5.47151,-9.732452 -5.54527,-9.604687 -0.0738,0.127765 11.1643,0.127765 11.09054,0 -0.0738,-0.127765 -5.6928,9.604687 -5.54527,9.604687 z" - transform="matrix(1.045689,0,0,0.98527645,-30.874143,79.631042)" + transform="matrix(1.045689,0,0,0.98527645,-31.33125,109.57216)" inkscape:transform-center-y="1.576596" /> <g id="marineLitterTotalWeight" @@ -778,37 +778,37 @@ <text xml:space="preserve" style="font-size:10px;font-style:italic;font-weight:normal;text-align:end;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#0000ff;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Italic" - x="429.8772" - y="138.49066" + x="429.52365" + y="169.2132" id="ratioSpeciesSampleSortedOverSpeciesSortedWeightLabel" sodipodi:linespacing="125%" - inkscape:label="#text3186" /> + inkscape:label="#text3186">123%</text> <text xml:space="preserve" style="font-size:10px;font-style:italic;font-weight:normal;text-align:end;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#0000ff;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Italic" x="653.52368" - y="140.25211" + y="169.2132" id="ratioBenthosSampleSortedOverBenthosSortedWeightLabel" sodipodi:linespacing="125%" /> <text xml:space="preserve" style="font-size:10px;font-style:italic;font-weight:normal;text-align:end;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#0000ff;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Italic" - x="536.52875" - y="-18.190062" + x="539.77875" + y="-7.440062" id="ratioSortedSortedOverSortedWeightLabel" - sodipodi:linespacing="125%" /> + sodipodi:linespacing="125%"/> <text xml:space="preserve" style="font-size:9px;font-style:italic;font-weight:normal;text-align:end;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" - x="434.4368" - y="208.85081" + x="433.97971" + y="239.08372" id="speciesDistinctSortedSpeciesCountLabel" sodipodi:linespacing="125%">Nombre d'espèces :</text> <text xml:space="preserve" style="font-size:9px;font-style:italic;font-weight:normal;text-align:end;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" - x="658.59515" - y="209.14259" + x="658.13806" + y="239.08372" id="benthosDistinctSortedSpeciesCountLabel" sodipodi:linespacing="125%" inkscape:transform-center-x="79.903062" @@ -817,15 +817,39 @@ xml:space="preserve" style="font-size:10px;font-style:italic;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#0000ff;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Italic" x="438.71716" - y="209.19144" + y="239.08372" id="speciesDistinctSortedSpeciesCountValue" - sodipodi:linespacing="125%"></text> + sodipodi:linespacing="125%" /> <text xml:space="preserve" style="font-size:10px;font-style:italic;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#0000ff;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Italic" x="663.29871" - y="208.83646" + y="239.08372" id="benthosDistinctSortedSpeciesCountValue" - sodipodi:linespacing="125%"></text> + sodipodi:linespacing="125%" /> + <text + xml:space="preserve" + x="454.94089" + y="-63.274731" + id="catchTotalSortedTremisWeightLabel" + style="font-size:10px;font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;text-anchor:start;fill:#0000ff;fill-opacity:1;font-family:Arial;-inkscape-font-specification:Arial">Trémie</text> + <text + id="catchTotalSortedTremisWeightValue" + y="-47.188046" + x="455.08459" + xml:space="preserve" + style="font-size:11px;font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;text-anchor:start;fill:#0000ff;fill-opacity:1;font-family:Arial;-inkscape-font-specification:Arial">00.00kg</text> + <text + xml:space="preserve" + x="554.6106" + y="61.749084" + id="catchTotalSortedCarousselWeightLabel" + style="font-size:10px;font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;text-anchor:start;fill:#0000ff;fill-opacity:1;font-family:Arial;-inkscape-font-specification:Arial">Carrousel</text> + <text + id="catchTotalSortedCarousselWeightValue" + y="76.741081" + x="553.41431" + xml:space="preserve" + style="font-size:11px;font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;text-anchor:start;fill:#0000ff;fill-opacity:1;font-family:Arial;-inkscape-font-specification:Arial">00.00kg</text> </g> </svg> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.