From: <had...@us...> - 2008-10-26 13:58:30
|
Revision: 4097 http://fudaa.svn.sourceforge.net/fudaa/?rev=4097&view=rev Author: hadouxad Date: 2008-10-26 13:58:25 +0000 (Sun, 26 Oct 2008) Log Message: ----------- - Mise en place du bool?\195?\169en pour les resizes - Changement de tous les noms des fichier avec ceux de Didier (?\195?\169limination des doublons des titres des trpostlayoutfille auto) - Mise en place du lecteur du projet plus souple: si il ne peut pas lire certains fichiers il continue - Mise en place d'un rapport d erreurs lors du chargement du projet, ce rapport est affich?\195?\169 a la fin du chargement -Mise en place de la doc dans le projet aide - Les documents html ont ?\195?\169t?\195?\169 convertis en doc openoffice 3.0 AUTOPORTANT (pratique pour les modifier et les commiter), il faut donc penser ?\195?\160 passer les images sous la moulinette gimp pour les optimiser... Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionResize.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/resizestrategy/AlignWithResizeProportionalStrategy.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/ branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/README.txt branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/post/ branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/post/post_en.odt branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/post/post_fr.odt branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/reflux/ branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/reflux/reflux_en.odt branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/reflux/reflux_fr.odt branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/rubar/ branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/rubar/rubar_en.odt branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/rubar/rubar_fr.odt branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/telemac/ branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/telemac/telemac_en.odt branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/telemac/telemac_fr.odt branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistanceErrorManager.java Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/README.txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/README.txt (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/README.txt 2008-10-26 13:58:25 UTC (rev 4097) @@ -0,0 +1,30 @@ +Doc r\xE9alis\xE9e \xE0 l'a\xE9ide d'openoffice 3.0 + + +****TIPS**** + + +Proc\xE9dure conversion: +- ouvrir fichier html avec opeenoffice +- exporter au format openoffice (choix 1 document ...) +- ouvrir l'export +- mettre l'affichage classique: decocher web pour avoir les pages +- retirer les liens des images poru avoir tout en un fichier autoportant +- enregistrer au format odt + + +Pour enregistrer les images \xE0 l'int\xE9rieur du doc et ne pas conserver les liens comme par d\xE9fautlt; +Edition / Liens... / Rompre les liens +=> Force \xE0 rompre tous les liens et enregistre les images dans le doc +WARNING: si on utilise ce proc\xE9d\xE9, penser \xE0 optimiser les tailles images avec gimp ou autre logiciel dessin vectoriel + + +** TODO ** + +Doc pre: +- Mettre des sommaires visualisable par le cutuluPdfviewer +- Refondre graphiquement (tableaux, titree, mise en page...) + +Doc post: +- Mettre a jour avec la doc actuelle +- garder la meme presentation visuelle \ No newline at end of file Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/post/post_en.odt =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/post/post_en.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/post/post_fr.odt =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/post/post_fr.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/reflux/reflux_en.odt =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/reflux/reflux_en.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/reflux/reflux_fr.odt =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/reflux/reflux_fr.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/rubar/rubar_en.odt =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/rubar/rubar_en.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/rubar/rubar_fr.odt =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/rubar/rubar_fr.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/telemac/telemac_en.odt =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/telemac/telemac_en.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/telemac/telemac_fr.odt =================================================================== (Binary files differ) Property changes on: branches/Prepro-0.92-SNAPSHOT/aide/src/prepro/doc_pdf/telemac/telemac_fr.odt ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java 2008-10-24 20:42:43 UTC (rev 4096) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliSceneController.java 2008-10-26 13:58:25 UTC (rev 4097) @@ -26,7 +26,7 @@ final private WidgetAction alignWithResizeAction; - final private WidgetAction alignWithResizeActionProportionnal; + // final private WidgetAction alignWithResizeActionProportionnal; Set<EbliWidgetEditModeListener> listeners_ = new HashSet<EbliWidgetEditModeListener>(); BuMenuBar menuCalque_ = null; @@ -57,12 +57,11 @@ // scene_.getInteractionLayer(), ActionFactory // .createDefaultAlignWithMoveDecorator(), false); - alignWithResizeActionProportionnal = EbliWidgetActionFactory.createAlignWithProportionnalResizeAction(scene_ + alignWithResizeAction = EbliWidgetActionFactory.createAlignWithProportionnalResizeAction(scene_ .getVisu(), scene_ .getInteractionLayer(), ActionFactory.createDefaultAlignWithMoveDecorator(), false); - alignWithResizeAction = alignWithResizeActionProportionnal; - + rectangularSelection_ = ActionFactory.createRectangularSelectAction(scene_, scene_.getInteractionLayer()); // -- ajoute l'action du zoom ( ctrl + clic) scene_.getActions().addAction(ActionFactory.createCenteredZoomAction(1.1)); @@ -73,9 +72,9 @@ } - public WidgetAction getAlignWithResizeActionProportionnal() { - return alignWithResizeActionProportionnal; - } +// public WidgetAction getAlignWithResizeActionProportionnal() { +// return alignWithResizeActionProportionnal; +// } public boolean isEditable() { return false; @@ -171,9 +170,9 @@ return alignWithResizeAction; } - public WidgetAction getProportionnalResizeAction() { - return alignWithResizeActionProportionnal; - } +// public WidgetAction getProportionnalResizeAction() { +// return alignWithResizeActionProportionnal; +// } public BuToolBar getToolbarComponent() { return null; Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-10-24 20:42:43 UTC (rev 4096) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetController.java 2008-10-26 13:58:25 UTC (rev 4097) @@ -353,7 +353,7 @@ if (canMove_) widget_.getActions().addAction(actionMove_); // -- action mis de cote poru le debut \xE9ais reference indispensable --// - actionResizeProportionel_ = widget_.getEbliScene().getController().getProportionnalResizeAction(); + // actionResizeProportionel_ = widget_.getEbliScene().getController().getProportionnalResizeAction(); } @@ -468,14 +468,14 @@ /** * Passe du resize classique au resize proportionnel */ - public void switchToResizeProportionnal() { - if (!canResize_) - return; - if (actionResize_ != null && actionResizeProportionel_ != null) - widget_.getActions().removeAction(actionResize_); - - widget_.getActions().addAction(actionResizeProportionel_); - } +// public void switchToResizeProportionnal() { +// if (!canResize_) +// return; +// if (actionResize_ != null && actionResizeProportionel_ != null) +// widget_.getActions().removeAction(actionResize_); +// +// widget_.getActions().addAction(actionResizeProportionel_); +// } public void switchToResizeClassical() { if (!canResize_) Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionResize.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionResize.java 2008-10-24 20:42:43 UTC (rev 4096) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/actions/EbliWidgetActionResize.java 2008-10-26 13:58:25 UTC (rev 4097) @@ -75,7 +75,7 @@ final EbliWidgetController controller = controll; if (resizeProportionnel_) { - controller.switchToResizeProportionnal(); + //controller.switchToResizeProportionnal(); widget_.getController().boutonProportion.setAction(new EbliWidgetActionResize.Classical(widget_)); widget_.getController().isProportional = true; // -- enregistrement de la commande undoRedo --// @@ -83,13 +83,13 @@ cmd_.addCmd(new CtuluCommand(){ public void redo() { - controller.switchToResizeProportionnal(); + // controller.switchToResizeProportionnal(); widget_.getController().boutonProportion.setAction(new EbliWidgetActionResize.Classical(widget_)); widget_.getController().isProportional = true; } public void undo() { - controller.switchToResizeClassical(); + // controller.switchToResizeClassical(); widget_.getController().boutonProportion.setAction(new EbliWidgetActionResize.Proportional(widget_)); widget_.getController().isProportional = false; } @@ -98,7 +98,7 @@ } } else { - controller.switchToResizeClassical(); + //controller.switchToResizeClassical(); widget_.getController().boutonProportion.setAction(new EbliWidgetActionResize.Proportional(widget_)); widget_.getController().isProportional = false; // -- enregistrement de la commande undoRedo --// @@ -106,13 +106,13 @@ cmd_.addCmd(new CtuluCommand(){ public void redo() { - controller.switchToResizeClassical(); + // controller.switchToResizeClassical(); widget_.getController().boutonProportion.setAction(new EbliWidgetActionResize.Proportional(widget_)); widget_.getController().isProportional = false; } public void undo() { - controller.switchToResizeProportionnal(); + // controller.switchToResizeProportionnal(); widget_.getController().boutonProportion.setAction(new EbliWidgetActionResize.Classical(widget_)); widget_.getController().isProportional = true; } Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/resizestrategy/AlignWithResizeProportionalStrategy.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/resizestrategy/AlignWithResizeProportionalStrategy.java 2008-10-24 20:42:43 UTC (rev 4096) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/resizestrategy/AlignWithResizeProportionalStrategy.java 2008-10-26 13:58:25 UTC (rev 4097) @@ -5,6 +5,7 @@ import java.awt.Rectangle; import org.fudaa.ctulu.image.CtuluLibImage; +import org.fudaa.ebli.visuallibrary.EbliWidget; import org.netbeans.api.visual.action.AlignWithMoveDecorator; import org.netbeans.api.visual.action.AlignWithWidgetCollector; import org.netbeans.api.visual.action.ResizeProvider; @@ -22,199 +23,202 @@ public class AlignWithResizeProportionalStrategy extends AlignWithSupport implements ResizeStrategy, ResizeProvider { - private boolean outerBounds; + private boolean outerBounds; - public AlignWithResizeProportionalStrategy(AlignWithWidgetCollector collector, LayerWidget interractionLayer, - AlignWithMoveDecorator decorator, boolean outerBounds) { - super(collector, interractionLayer, decorator); - this.outerBounds = outerBounds; - } + public AlignWithResizeProportionalStrategy(AlignWithWidgetCollector collector, LayerWidget interractionLayer, + AlignWithMoveDecorator decorator, boolean outerBounds) { + super(collector, interractionLayer, decorator); + this.outerBounds = outerBounds; + } - public Rectangle boundsSuggested(Widget widget, Rectangle originalBounds, Rectangle suggestedBounds, - ControlPoint controlPoint) { - final double wDivParH = CtuluLibImage.getRatio(originalBounds.width, originalBounds.height); - final double hDivParW = CtuluLibImage.getRatio(originalBounds.height, originalBounds.width); - Insets insets = widget.getBorder().getInsets(); - int minx = insets.left + insets.right; - int miny = insets.top + insets.bottom; + public Rectangle boundsSuggested(Widget widget, Rectangle originalBounds, Rectangle suggestedBounds, + ControlPoint controlPoint) { + final double wDivParH = CtuluLibImage.getRatio(originalBounds.width, originalBounds.height); + final double hDivParW = CtuluLibImage.getRatio(originalBounds.height, originalBounds.width); + Insets insets = widget.getBorder().getInsets(); + int minx = insets.left + insets.right; + int miny = insets.top + insets.bottom; - // double coefficientProportionnalite = (suggestedBounds.width * 1.0) / - // (suggestedBounds.height * 1.0); - // if (coefficientProportionnalite == 0) - // coefficientProportionnalite = 1; - int oldWidht = suggestedBounds.width; - int oldHeight = suggestedBounds.height; + // double coefficientProportionnalite = (suggestedBounds.width * 1.0) / + // (suggestedBounds.height * 1.0); + // if (coefficientProportionnalite == 0) + // coefficientProportionnalite = 1; - suggestedBounds = widget.convertLocalToScene(suggestedBounds); + suggestedBounds = widget.convertLocalToScene(suggestedBounds); - Point suggestedLocation, point; - int tempx, tempy; + Point suggestedLocation, point; + int tempx, tempy; - switch (controlPoint) { - case BOTTOM_CENTER: - suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width / 2, suggestedBounds.y - + suggestedBounds.height); - if (!outerBounds) - suggestedLocation.y -= insets.bottom; + switch (controlPoint) { + case BOTTOM_CENTER: + suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width / 2, suggestedBounds.y + + suggestedBounds.height); + if (!outerBounds) + suggestedLocation.y -= insets.bottom; - point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, false, true, false, - false); + point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, false, true, false, + false); - if (!outerBounds) - point.y += insets.bottom; + if (!outerBounds) + point.y += insets.bottom; - suggestedBounds.height = Math.max(miny, point.y - suggestedBounds.y); + suggestedBounds.height = Math.max(miny, point.y - suggestedBounds.y); - break; - case BOTTOM_LEFT: - suggestedLocation = new Point(suggestedBounds.x, suggestedBounds.y + suggestedBounds.height); - if (!outerBounds) { - suggestedLocation.y -= insets.bottom; - suggestedLocation.x += insets.left; - } + break; + case BOTTOM_LEFT: + suggestedLocation = new Point(suggestedBounds.x, suggestedBounds.y + suggestedBounds.height); + if (!outerBounds) { + suggestedLocation.y -= insets.bottom; + suggestedLocation.x += insets.left; + } - point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, true, false, - false); + point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, true, false, + false); - if (!outerBounds) { - point.y += insets.bottom; - point.x -= insets.left; - } + if (!outerBounds) { + point.y += insets.bottom; + point.x -= insets.left; + } - suggestedBounds.height = Math.max(miny, point.y - suggestedBounds.y); + suggestedBounds.height = Math.max(miny, point.y - suggestedBounds.y); - tempx = Math.min(point.x, suggestedBounds.x + suggestedBounds.width - minx); - suggestedBounds.width = suggestedBounds.x + suggestedBounds.width - tempx; - suggestedBounds.x = tempx; - break; - case BOTTOM_RIGHT: - suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width, suggestedBounds.y - + suggestedBounds.height); - if (!outerBounds) { - suggestedLocation.y -= insets.bottom; - suggestedLocation.x -= insets.right; - } + tempx = Math.min(point.x, suggestedBounds.x + suggestedBounds.width - minx); + suggestedBounds.width = suggestedBounds.x + suggestedBounds.width - tempx; + suggestedBounds.x = tempx; + break; + case BOTTOM_RIGHT: + suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width, suggestedBounds.y + + suggestedBounds.height); + if (!outerBounds) { + suggestedLocation.y -= insets.bottom; + suggestedLocation.x -= insets.right; + } - point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, true, false, - false); + point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, true, false, + false); - if (!outerBounds) { - point.y += insets.bottom; - point.x += insets.right; - } + if (!outerBounds) { + point.y += insets.bottom; + point.x += insets.right; + } - suggestedBounds.height = Math.max(miny, point.y - suggestedBounds.y); + suggestedBounds.height = Math.max(miny, point.y - suggestedBounds.y); - suggestedBounds.width = Math.max(minx, point.x - suggestedBounds.x); - break; - case CENTER_LEFT: - suggestedLocation = new Point(suggestedBounds.x, suggestedBounds.y + suggestedBounds.height / 2); - if (!outerBounds) - suggestedLocation.x += insets.left; + suggestedBounds.width = Math.max(minx, point.x - suggestedBounds.x); + break; + case CENTER_LEFT: + suggestedLocation = new Point(suggestedBounds.x, suggestedBounds.y + suggestedBounds.height / 2); + if (!outerBounds) + suggestedLocation.x += insets.left; - point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, false, false, - false); + point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, false, false, + false); - if (!outerBounds) - point.x -= insets.left; + if (!outerBounds) + point.x -= insets.left; - tempx = Math.min(point.x, suggestedBounds.x + suggestedBounds.width - minx); - suggestedBounds.width = suggestedBounds.x + suggestedBounds.width - tempx; - suggestedBounds.x = tempx; - break; - case CENTER_RIGHT: - suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width, suggestedBounds.y - + suggestedBounds.height / 2); - if (!outerBounds) - suggestedLocation.x -= insets.right; + tempx = Math.min(point.x, suggestedBounds.x + suggestedBounds.width - minx); + suggestedBounds.width = suggestedBounds.x + suggestedBounds.width - tempx; + suggestedBounds.x = tempx; + break; + case CENTER_RIGHT: + suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width, suggestedBounds.y + + suggestedBounds.height / 2); + if (!outerBounds) + suggestedLocation.x -= insets.right; - point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, false, false, - false); + point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, false, false, + false); - if (!outerBounds) - point.x += insets.right; + if (!outerBounds) + point.x += insets.right; - suggestedBounds.width = Math.max(minx, point.x - suggestedBounds.x); - break; - case TOP_CENTER: - suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width / 2, suggestedBounds.y); - if (!outerBounds) - suggestedLocation.y += insets.top; + suggestedBounds.width = Math.max(minx, point.x - suggestedBounds.x); + break; + case TOP_CENTER: + suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width / 2, suggestedBounds.y); + if (!outerBounds) + suggestedLocation.y += insets.top; - point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, false, true, false, - false); + point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, false, true, false, + false); - if (!outerBounds) - point.y -= insets.top; + if (!outerBounds) + point.y -= insets.top; - tempy = Math.min(point.y, suggestedBounds.y + suggestedBounds.height - miny); - suggestedBounds.height = suggestedBounds.y + suggestedBounds.height - tempy; - suggestedBounds.y = tempy; - break; - case TOP_LEFT: - suggestedLocation = new Point(suggestedBounds.x, suggestedBounds.y); - if (!outerBounds) { - suggestedLocation.y += insets.top; - suggestedLocation.x += insets.left; - } + tempy = Math.min(point.y, suggestedBounds.y + suggestedBounds.height - miny); + suggestedBounds.height = suggestedBounds.y + suggestedBounds.height - tempy; + suggestedBounds.y = tempy; + break; + case TOP_LEFT: + suggestedLocation = new Point(suggestedBounds.x, suggestedBounds.y); + if (!outerBounds) { + suggestedLocation.y += insets.top; + suggestedLocation.x += insets.left; + } - point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, true, false, - false); + point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, true, false, + false); - if (!outerBounds) { - point.y -= insets.top; - point.x -= insets.left; - } + if (!outerBounds) { + point.y -= insets.top; + point.x -= insets.left; + } - tempy = Math.min(point.y, suggestedBounds.y + suggestedBounds.height - miny); - suggestedBounds.height = suggestedBounds.y + suggestedBounds.height - tempy; - suggestedBounds.y = tempy; + tempy = Math.min(point.y, suggestedBounds.y + suggestedBounds.height - miny); + suggestedBounds.height = suggestedBounds.y + suggestedBounds.height - tempy; + suggestedBounds.y = tempy; - tempx = Math.min(point.x, suggestedBounds.x + suggestedBounds.width - minx); - suggestedBounds.width = suggestedBounds.x + suggestedBounds.width - tempx; - suggestedBounds.x = tempx; - break; - case TOP_RIGHT: - suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width, suggestedBounds.y); - if (!outerBounds) { - suggestedLocation.y += insets.top; - suggestedLocation.x -= insets.right; - } + tempx = Math.min(point.x, suggestedBounds.x + suggestedBounds.width - minx); + suggestedBounds.width = suggestedBounds.x + suggestedBounds.width - tempx; + suggestedBounds.x = tempx; + break; + case TOP_RIGHT: + suggestedLocation = new Point(suggestedBounds.x + suggestedBounds.width, suggestedBounds.y); + if (!outerBounds) { + suggestedLocation.y += insets.top; + suggestedLocation.x -= insets.right; + } - point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, true, false, - false); + point = super.locationSuggested(widget, new Rectangle(suggestedLocation), suggestedLocation, true, true, false, + false); - if (!outerBounds) { - point.y -= insets.top; - point.x += insets.right; - } + if (!outerBounds) { + point.y -= insets.top; + point.x += insets.right; + } - tempy = Math.min(point.y, suggestedBounds.y + suggestedBounds.height - miny); - suggestedBounds.height = suggestedBounds.y + suggestedBounds.height - tempy; - suggestedBounds.y = tempy; + tempy = Math.min(point.y, suggestedBounds.y + suggestedBounds.height - miny); + suggestedBounds.height = suggestedBounds.y + suggestedBounds.height - tempy; + suggestedBounds.y = tempy; - suggestedBounds.width = Math.max(minx, point.x - suggestedBounds.x); - break; - } + suggestedBounds.width = Math.max(minx, point.x - suggestedBounds.x); + break; + } - // -- proportions respectees --// - // double coeff = ((double) suggestedBounds.height) / ((double) oldHeight); - if (suggestedBounds.height != originalBounds.height) { - suggestedBounds.width = (int) (wDivParH * suggestedBounds.height); - } - if (suggestedBounds.width != originalBounds.width) { - suggestedBounds.height = (int) (hDivParW * suggestedBounds.width); - } + if(widget instanceof EbliWidget){ + boolean isProportionnal= ((EbliWidget)widget).getController().isProportional; + if(isProportionnal){ + // -- proportions respectees --// + // double coeff = ((double) suggestedBounds.height) / ((double) oldHeight); + if (suggestedBounds.height != originalBounds.height) { + suggestedBounds.width = (int) (wDivParH * suggestedBounds.height); + } + if (suggestedBounds.width != originalBounds.width) { + suggestedBounds.height = (int) (hDivParW * suggestedBounds.width); + } + } - return widget.convertSceneToLocal(suggestedBounds); - } + } + return widget.convertSceneToLocal(suggestedBounds); + } - public void resizingStarted(Widget widget) { - show(); - } + public void resizingStarted(Widget widget) { + show(); + } - public void resizingFinished(Widget widget) { - hide(); - } + public void resizingFinished(Widget widget) { + hide(); + } } Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-24 20:42:43 UTC (rev 4096) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostCommonImplementation.java 2008-10-26 13:58:25 UTC (rev 4097) @@ -56,6 +56,23 @@ return res; } + + public void elimineDoublonNomsLayout(){ + List<TrPostLayoutFille> liste=getAllLayoutFille(); + + for(int i=0;i<liste.size();i++){ + int cpt=1; + for(int j=i; j<liste.size();j++){ + if(liste.get(j).previousTitleFrame.equals(liste.get(i).previousTitleFrame)){ + + liste.get(j).previousTitleFrame+="_"+(cpt++); + } + } + + } + + } + /** * @return la fenetre layout active. */ Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistanceErrorManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistanceErrorManager.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistanceErrorManager.java 2008-10-26 13:58:25 UTC (rev 4097) @@ -0,0 +1,101 @@ +package org.fudaa.fudaa.tr.post.persist; + +import java.awt.BorderLayout; +import java.awt.Frame; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.table.DefaultTableModel; + +import org.fudaa.ctulu.CtuluUI; +import org.fudaa.ctulu.gui.CtuluLibSwing; +import org.fudaa.fudaa.tr.common.TrResource; + + +/** + * Manager qui indique toutes les erreurs qui se sont produites pendant le chargement. + * @author Adrien Hadoux + * + */ +public class TrPostPersistanceErrorManager { + + + java.util.List<String> listeMessageError=new ArrayList<String>(); + + public void addMessageError(String message){ + listeMessageError.add(message); + } + + public void clear(){ + + listeMessageError.clear(); + } + + private class ModeleTableError extends DefaultTableModel{ + + + java.util.List<String> listeMessageError_; + + public ModeleTableError(List<String> listeMessage) { + + + listeMessageError_ = listeMessage; + } + + @Override + public int getColumnCount() { + // TODO Auto-generated method stub + return 1; + } + + @Override + public String getColumnName(int column) { + // TODO Auto-generated method stub + return "Messages"; + } + + @Override + public int getRowCount() { + // TODO Auto-generated method stub + return listeMessageError_.size(); + } + + @Override + public Object getValueAt(int row, int column) { + // TODO Auto-generated method stub + return listeMessageError_.get(row); + } + + + } + + public void showDialog(CtuluUI ui){ + if(listeMessageError.size()==0){ + ui.message(TrResource.getS("Chargement termin\xE9"), TrResource.getS("Chargement termin\xE9 avec succ\xE8s"), false); + + return; + } + + JTable table=new JTable(new DefaultTableModel(listeMessageError.toArray(),listeMessageError.size())); + final Frame f = CtuluLibSwing.getFrameAncestorHelper(ui.getParentComponent()); + JDialog dialog_ = new JDialog(f); + dialog_.setModal(true); + dialog_.setTitle("Chargement termin\xE9"); + final JPanel container = new JPanel(new BorderLayout()); + container.add(new JScrollPane(table), BorderLayout.CENTER); + + container.add(new JLabel( TrResource.getS("Chargement termin\xE9 avec erreur(s)")),BorderLayout.NORTH); + dialog_.setContentPane(container); + dialog_.setLocationRelativeTo(ui.getParentComponent()); + dialog_.setSize(300,200); + dialog_.setVisible(true); + + } + + +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-24 20:42:43 UTC (rev 4096) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-10-26 13:58:25 UTC (rev 4097) @@ -50,6 +50,7 @@ import org.fudaa.fudaa.tr.post.actions.TrPostActionFusionCalques; import org.netbeans.api.visual.widget.Widget; +import com.memoire.fu.FuLib; import com.memoire.fu.FuLog; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; @@ -73,18 +74,19 @@ * Point d'entr\xE9e poru charger un projet repertoire. Continet le path du directory. Cela permet de placer ce fichier * n'importe ou sur le ddur et de pouvoir charger le projet. Peut etre g\xE9r\xE9 comem un raccourcis. */ - public static final String setupProject = "setup" + EXTENSION; + public static final String setupProject = "setup";// + EXTENSION; /** * Fichier qui d\xE9crit tous les contenu layout sauvegard\xE9s Et noms des balises importantes */ - public final static String INFOSCENE = "InfoLayout" + EXTENSION; + public final static String INFOSCENE = "info_layout";//"InfoLayout" + EXTENSION; public final static String BALISESCENES = "LayoutList"; /** * Fichier qui d\xE9crit int\xE9gralement le contenu d'une scene */ - public final static String DESCRIPTORSCENE = "layout"; + public final static String EXTENSION_REPLAYOUT=".LAY"; + public final static String DESCRIPTORSCENE = "desc_frame"; public static String ATTRIBUTESCENE = "LAYOUT"; /** @@ -93,7 +95,13 @@ //public final static String DESCRIPTORSOURCE = "sources" + EXTENSION; public final static String BALISESOURCES = "SourcesList"; public static String ATTRIBUTESOURCE = "FICHIER"; - public final static String FileWidgetNames = "FramesNames"+ EXTENSION; + public final static String FileWidgetNames = "nom_frame";//"FramesNames"+ EXTENSION; + + + public final static String REP_VAR="VARIABLES"; + public final static String REP_CALQUES="CALQUES"; + public final static String REP_GRAPHES="GRAPHES"; + public final static String REP_TEXTES="TEXTES"; /** * Le projet a persiter */ @@ -108,10 +116,9 @@ TrPostCommonImplementation ui_; - //-- elements de base tagg\xE9s par xstream pour etre plus explicites dans les fichiers --// + TrPostPersistanceErrorManager managerError=new TrPostPersistanceErrorManager(); - public TrPostPersistenceManager(final TrPostProjet projet) { super(); trprojet_ = projet; @@ -335,16 +342,14 @@ out.writeObject(XmlCommentaire.getCommentaireLayout()); // -- g\xE9n\xE9ration du xml pour la scene --// - final int nbFichiersToGenrate = trprojet_.impl_.getAllLayoutFille().size(); + List<TrPostLayoutFille> listeFilles=trprojet_.impl_.getAllLayoutFille(); + final int nbFichiersToGenrate = listeFilles.size(); out.writeInt(nbFichiersToGenrate); for (int i = 0; i < nbFichiersToGenrate; i++) { // creation du fichier de desciption des scenes dans le repertoire de meme nom. - String nomFichierLayout = /* - * projet_.getAbsolutePath() + File.separator - * + - */DESCRIPTORSCENE + (i + 1) + EXTENSION + File.separator + DESCRIPTORSCENE + (i + 1) - + EXTENSION; + String nomLayout=FuLib.clean(listeFilles.get(i).previousTitleFrame); + String nomFichierLayout = nomLayout + EXTENSION_REPLAYOUT + File.separator + DESCRIPTORSCENE ; out.writeObject(new LayoutDescriptor(nomFichierLayout)); @@ -376,6 +381,11 @@ * @throws ClassNotFoundException */ public List<String> loadDescriptorScenes(final File file) { + + if(!file.canRead()){ + managerError.addMessageError("FilePath "+file.getPath()+" du descriptor introuvable"); + return new ArrayList<String>(); + } // -- outputstream du xstream --// final List<String> listeFiles = new ArrayList<String>(); ObjectInputStream in = null; @@ -407,6 +417,7 @@ } catch (final FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); + managerError.addMessageError("infolayout: path "+file.getPath()+" invalide. Impossible de charger des layouts"); } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -615,6 +626,8 @@ // -- tentative de chargement du source dans le multi-projet --// multiProjectActivator.active(f, trprojet_.impl_, listeCouplesIdSources.get(i).IdSource); } + }else{ + managerError.addMessageError("setup: path "+path+" invalide. Fichier r\xE9sultat non charg\xE9"); } } } @@ -714,7 +727,7 @@ if (savePersistDirectory(saveAs)) { // -- etape 1: creation du repertoire des graphe et calques --// - final String pathVariables = projet_.getAbsolutePath() + File.separator + "Variables"; + final String pathVariables = projet_.getAbsolutePath() + File.separator + REP_VAR; try { File fileVar = new File(pathVariables); @@ -756,12 +769,13 @@ final String title = fille.previousTitleFrame; final EbliScene scene = fille.getScene(); if (listFilles.size() != 0) progression("Cr\xE9ation du fichier du layout " + title, 20 + 70 / listFilles.size()); - file = new File(projet_.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); + String nomLayout=FuLib.clean(fille.previousTitleFrame)+ EXTENSION_REPLAYOUT ; + file = new File(projet_.getAbsolutePath() + File.separator + nomLayout); // -- sauvegarde du persitant --// parametres.put("dimensions", fille.getSize()); parametres.put("location", fille.getLocation()); parametres.put("scene", scene); - savePersitSceneXml(scene, title, file, parametres, listeNomsComposants,cpt); + savePersitSceneXml(scene, title, file, parametres, listeNomsComposants,cpt,nomLayout); cpt++; } @@ -860,13 +874,16 @@ * @return */ public boolean loadProject(final boolean executeByExplorer, final File explorerFile) { - + managerError.clear(); + //-- on elimine les doublons potentiels des frames layouts --// + ui_.elimineDoublonNomsLayout(); + progression("Lecture du r\xE9pertoire", 10); // -- etape 1 lecture du repertoire global ou du fichier param --// if (loadPersistDirectory(executeByExplorer, explorerFile)) { File file; - final String pathVariables = projet_.getAbsolutePath() + File.separator + "Variables"; + final String pathVariables = projet_.getAbsolutePath() + File.separator + REP_VAR; try { new File(pathVariables).mkdir(); } catch (final Exception e) { @@ -898,8 +915,6 @@ file = new File(projet_.getAbsolutePath() + File.separator + FileWidgetNames); final List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms = loadNomsFrames(file); - int cpt = 1; - for (final String fichier : listeFichiers) { file = new File(fichier); if (listeFichiers.size() != 0) progression("chargement du fichier " + fichier, 30 + 70 / listeFichiers.size()); @@ -909,8 +924,8 @@ // -- sauvegarde du persitant --// trprojet_.getImpl().addInternalFrame(postFrame); - String nomRepertoireLayout=DESCRIPTORSCENE + (cpt++) + EXTENSION; - loadPersitSceneXml(file, postFrame, parametres, listeCouplesNoms,nomRepertoireLayout); + + loadPersitSceneXml(file, postFrame, parametres, listeCouplesNoms); } // -- etape 6; lecture des variables --// @@ -918,7 +933,8 @@ loadVariables(pathVariables); progression("", 100); - ui_.message(TrResource.getS("Chargement termin\xE9"), TrResource.getS("Chargement termin\xE9 avec succ\xE8s"), false); + managerError.showDialog(ui_); + //ui_.message(TrResource.getS("Chargement termin\xE9"), TrResource.getS("Chargement termin\xE9 avec succ\xE8s"), false); return true; @@ -959,7 +975,7 @@ private void fillMapWithDataPath(final Map parametres,String repertoireLayout){ final String pathGraphes = projet_.getAbsolutePath() + File.separator + repertoireLayout + File.separator - + "Graphes"; + + REP_GRAPHES; try { File fichierGraphes = new File(pathGraphes); if (fichierGraphes.isDirectory()) { @@ -973,7 +989,7 @@ FuLog.debug("Le repertoire des graphes existe deja"); } final String pathCalques = projet_.getAbsolutePath() + File.separator + repertoireLayout + File.separator - + "Calques"; + + REP_CALQUES; try { File fichierCalques = new File(pathCalques); if (fichierCalques.isDirectory()) { @@ -987,7 +1003,7 @@ FuLog.debug("Le repertoire des calques existe deja"); } - final String pathText = projet_.getAbsolutePath() + File.separator + repertoireLayout + File.separator + "Textes"; + final String pathText = projet_.getAbsolutePath() + File.separator + repertoireLayout + File.separator + REP_TEXTES; try { File fichierText = new File(pathText); if (fichierText.isDirectory()) { @@ -1016,17 +1032,17 @@ * @throws IOException */ private void savePersitSceneXml(final EbliScene scene, final String title, File file, final Map parametres, - final List<EbliWidgetSerializeXml.CoupleNomId> listeNomsComposants,int cpt) { + final List<EbliWidgetSerializeXml.CoupleNomId> listeNomsComposants,int cpt,String titreRepertoireLayout) { // -- creation du repertoire du layout layoutN.POST--// file.mkdir(); // -- remplissage de la map avec les r\xE9pertoires calques/graphes/textes --// - fillMapWithDataPath(parametres, DESCRIPTORSCENE + cpt + EXTENSION); + fillMapWithDataPath(parametres, titreRepertoireLayout); // -- mise en place du fichier decrivant le contenu du layout --// - file = new File(file.getAbsolutePath() + File.separator + DESCRIPTORSCENE + cpt + EXTENSION); + file = new File(file.getAbsolutePath() + File.separator + DESCRIPTORSCENE);//DESCRIPTORSCENE + cpt + EXTENSION); // -- outputstream du xstream --// ObjectOutputStream out = null; @@ -1119,11 +1135,17 @@ * @throws InstantiationException */ private void loadPersitSceneXml(final File file, final TrPostLayoutFille fille, final Map parametres, - final List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms,String repertoireLayout) { - + final List<EbliWidgetSerializeXml.CoupleNomId> listeCouplesNoms) { + + if(!file.canRead()){ + managerError.addMessageError("Repertoire layout introuvable, "+file.getPath()+" incorrect"); + return; + } + + String nomRepertoireLayout=file.getPath().substring(0,file.getPath().lastIndexOf(DESCRIPTORSCENE) ); final EbliScene scenToUpdate = fille.getScene(); parametres.put("scene", scenToUpdate); - parametres.put("pathLayout", projet_.getAbsolutePath()+ File.separator +repertoireLayout); + parametres.put("pathLayout", nomRepertoireLayout); // -- inputstream du xstream --// ObjectInputStream in = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |