From: <had...@us...> - 2008-12-11 18:46:01
|
Revision: 4296 http://fudaa.svn.sourceforge.net/fudaa/?rev=4296&view=rev Author: hadouxad Date: 2008-12-11 18:45:55 +0000 (Thu, 11 Dec 2008) Log Message: ----------- Correction recette 9 d?\195?\169cembre Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/trace/TraceLigne.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java Added Paths: ----------- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFlecheSimple.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFlecheSimple.java branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorFlecheSimple.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/trace/TraceLigne.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/trace/TraceLigne.java 2008-12-11 18:44:43 UTC (rev 4295) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/trace/TraceLigne.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -376,7 +376,9 @@ _g.setColor(oldColor); _g.setStroke(oldStroke); } - + + + /** * Trace un polygone. Il est trace avec le type definit par <i>typeTrait </i>. * Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-12-11 18:44:43 UTC (rev 4295) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetBordureSingle.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -140,9 +140,27 @@ layout_ = new OverlayLayoutGap(insets_); setLayout(layout_); + + + + //-- on redimensionne la frame correctement --// + if(oldTraceligne_.getEpaisseur()!=l.getEpaisseur()){ + //-- on ajoute le delta d'epaisseur --// + float delta=l.getEpaisseur()-oldTraceligne_.getEpaisseur(); + System.out.println("\n***Delta: "+delta); + Rectangle sizeWidget=this.getPreferredBounds(); + //-- on rajoute le double de delta pour l'\xE9paisseur des 2 cot\xE9s --// + sizeWidget.height+=2*delta; + sizeWidget.width+=2*delta; + this.setPreferredBounds(sizeWidget); + oldTraceligne_=new TraceLigne(l) ; + } + + revalidate(); } + TraceLigne oldTraceligne_=new TraceLigne(getTraceLigneModel().buildCopy()); public Insets createInset(final int epaisseur) { Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFlecheSimple.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFlecheSimple.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetFlecheSimple.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -0,0 +1,100 @@ +package org.fudaa.ebli.visuallibrary; + +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.Rectangle; + +import org.fudaa.ebli.trace.TraceLigne; +import org.fudaa.ebli.visuallibrary.layout.OverlayLayoutGap; + +/** + * Legende Widget qui permet de construire une fleche simple sans contenu + * + * @author Adrien Hadoux + */ +public class EbliWidgetFlecheSimple extends EbliWidget { + + Insets inGaps_; + int largeurBorder = 15; + int espaceInterieur = 5; + public static int ORIENTATION_NORTH = 0; + public static int ORIENTATION_SOUTH = 1; + public static int ORIENTATION_EAST = 2; + public static int ORIENTATION_WEST = 3; + + public Color couleurContour = Color.black; + public Color couleurFond = Color.white; + + /** + * @param _scene + */ + public EbliWidgetFlecheSimple(final EbliScene _scene, final int orientation) { + super(_scene, true); + inGaps_ = new Insets(largeurBorder + espaceInterieur, largeurBorder + espaceInterieur, largeurBorder + + espaceInterieur, largeurBorder + espaceInterieur); + // Ce layout permet de placer le texte + + setLayout(new OverlayLayoutGap(inGaps_)); + + } + + /* + * protected Rectangle calculateClientArea() { Rectangle res = this.getPreferredBounds(); // TODO Auto-generated + * method stub return new Rectangle(0, 0, 2 (largeurBorder + espaceInterieur) + res.width, 2 (largeurBorder + + * espaceInterieur) + res.height); } + */ + + @Override + protected void paintWidget() { + final Graphics2D g = getGraphics(); + + final Rectangle rec = getClientArea(); + + // -- couleur de fond --// + g.setColor(couleurFond); + g.fillRect(0, 0, rec.width, rec.height); + + g.translate(rec.x, rec.y); + // la ligne + + final TraceLigne l = new TraceLigne(); + + l.setEpaisseur(largeurBorder); + + l.setCouleur(couleurContour); + + l.dessineFleche(g, (int) (l.getEpaisseur() / 2), (rec.height / 2), (int) (rec.width - l.getEpaisseur() / 2), + (rec.height / 2)); + + /* + * Shape shape; l.dessineShape(g, shape); + */ + + g.translate(-rec.x, -rec.y); + + } + + @Override + public void setColorContour(final Color newColor) { + couleurContour = newColor; + repaint(); + } + + @Override + public Color getColorContour() { + return couleurContour; + } + + @Override + public void setColorFond(final Color newColor) { + couleurFond = newColor; + repaint(); + } + + @Override + public Color getColorFond() { + return couleurFond; + } + +} Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java 2008-12-11 18:44:43 UTC (rev 4295) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/EbliWidgetWithBordure.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -4,6 +4,7 @@ */ package org.fudaa.ebli.visuallibrary; +import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.Rectangle; @@ -33,6 +34,9 @@ super(_scene, _controllerDefaut); } + + + @Override protected void paintWidget() { @@ -59,6 +63,7 @@ g.translate(-rec.x, -rec.y); // setBackground(getColorFond()); + } Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFlecheSimple.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFlecheSimple.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/EbliWidgetCreatorFlecheSimple.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -0,0 +1,83 @@ +package org.fudaa.ebli.visuallibrary.creator; + +import java.awt.Point; +import java.util.Map; + +import org.fudaa.ebli.visuallibrary.EbliNode; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidget; +import org.fudaa.ebli.visuallibrary.EbliWidgetFlecheSimple; + +import org.fudaa.ebli.visuallibrary.EbliWidgetWithBordure; + +/** + * Creator de fleche simple sans contenu. + * @author Adrien Hadoux + * + */ +public class EbliWidgetCreatorFlecheSimple implements EbliWidgetCreator { + + int orientation; + + EbliWidgetFlecheSimple res; + + public EbliWidgetCreatorFlecheSimple(final int orientation) { + super(); + this.orientation = orientation; + + } + + public EbliWidgetCreatorFlecheSimple() { + + } + + public int getG() { + return orientation; + } + + public void setG(final int orientation) { + this.orientation = orientation; + } + + public EbliWidget create(final EbliScene _scene) { + res = new EbliWidgetFlecheSimple(_scene, orientation); + + return res; + } + + public EbliWidget getWidget() { + // TODO Auto-generated method stub + return res; + } + + public EbliNode duplicate(final EbliNode _nodeAdupliquer) { + + final EbliNode duplique = new EbliNodeDefault(); + + duplique.setCreator(new EbliWidgetCreatorFlecheSimple(orientation)); + + duplique.setTitle(_nodeAdupliquer.getTitle()); + // recopie des tailles + duplique.setPreferedSize(_nodeAdupliquer.getPreferedSize()); + // -- calcul nouvelle position + final Point nouvellePosition = new Point(getWidget().getLocation().x, (getWidget().getLocation().y + getWidget() + .getClientArea().height)); + duplique.setPreferedLocation(nouvellePosition); + + return duplique; + } + + public EbliWidgetWithBordure getBordure() { + return null; + } + + public Object getPersistData(final Map parameters) { + return null; + } + + public void setPersistData(final Object data, final Map parameters) { + + } + +} Added: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorFlecheSimple.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorFlecheSimple.java (rev 0) +++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/visuallibrary/creator/ShapeCreatorFlecheSimple.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -0,0 +1,37 @@ +package org.fudaa.ebli.visuallibrary.creator; + + +import java.awt.Shape; +import java.awt.geom.GeneralPath; +import java.awt.geom.Rectangle2D; +import java.util.Map; + +/** + * Ctreator qui se charge de g\xE9n\xE9rer une fleche simple. + * @author Adrien Hadoux + * + */ +public class ShapeCreatorFlecheSimple implements ShapeCreator { + + public Shape createShapeFor(final Rectangle2D.Float rec, final Map options, final float largeurTrait) { + final Float ratioHeadW = (Float) options.get("arrow.ratioHeadW"); + final Float ratioBaseH = (Float) options.get("arrow.ratioBaseH"); + final float rb = ratioBaseH == null ? 0.3f : ratioBaseH.floatValue(); + final float rh = ratioHeadW == null ? 0.3f : ratioHeadW.floatValue(); + final float middleH = rec.y + rec.height / 2f; + final float hauteurBase = rec.height * rb; + final float largeurHead = rec.width * rh; + final GeneralPath path = new GeneralPath(); + path.moveTo(rec.x, middleH ); + path.lineTo(rec.x + rec.width - largeurTrait, middleH);//- + path.lineTo(rec.x + rec.width - largeurHead, rec.y + largeurTrait / 2);// \ + path.lineTo(rec.x + rec.width - largeurTrait , middleH);//- + path.lineTo(rec.x + rec.width - largeurHead, rec.y + rec.height - largeurTrait / 2);// / + path.lineTo(rec.x + rec.width - largeurTrait , middleH);//- + path.lineTo(rec.x, middleH ); + //path.lineTo(rec.x + rec.width - largeurHead, middleH + hauteurBase / 2); + //path.lineTo(rec.x, middleH + hauteurBase / 2); + path.closePath(); + return path; + } +} Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-12-11 18:44:43 UTC (rev 4295) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/commun/courbe/FudaaCourbeWizardImportScope.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -669,7 +669,7 @@ FudaaCourbeImporterScope.createGraphe(target_, tabEvol, null, prog); }else if(comBoChoixTypeGraphe_.getSelectedIndex()==1){ - //profil spatial + //evol temporelle int debSeparator=listSeparatorDebPlage_.getSelectedIndex(); int finSeparator=listSeparatorFinPlage_.getSelectedIndex(); int[] selectedVariables= listVariablesGENE2_.getSelectedIndices(); Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-12-11 18:44:43 UTC (rev 4295) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrPostLayoutPanelController.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -58,6 +58,7 @@ import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorDblFleche; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorEllipse; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFleche; +import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFlecheSimple; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorLine; import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorRectangle; import org.fudaa.fudaa.tr.common.TrResource; @@ -324,7 +325,21 @@ return nodeFleche; } + + public EbliNode addFlecheSimple() { + // -- ajout du rectangle --// + final EbliNodeDefault nodeFleche = new EbliNodeDefault(); + nodeFleche.setTitle("Fleche simple"); + nodeFleche.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorFlecheSimple())); + nodeFleche.setPreferedSize(new Dimension(100, 50)); + nodeFleche.setPreferedLocation(new Point(350, 125)); + // ajout du node au layout + addNode(nodeFleche); + + return nodeFleche; + } + public EbliNode addDblFleche() { // -- ajout du rectangle --// final EbliNodeDefault nodeFleche = new EbliNodeDefault(); @@ -411,6 +426,15 @@ } }); + // -- palette fleche simple--// + _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Fleche"), + EbliResource.EBLI.getToolIcon("crystal_bu_link"), "WIDGETFLECHESIMPLE") { + @Override + public void actionPerformed(final ActionEvent _evt) { + addFlecheSimple(); + } + }); + // -- palette fleche --// _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Fleche"), EbliResource.EBLI.getToolIcon("crystal_bu_link"), "WIDGETFLECHE") { @@ -419,7 +443,7 @@ addFleche(); } }); - + // -- palette double fleche --// // crystal_bu_scrollpane_corner.png _l.add(new EbliActionSimple(EbliResource.EBLI.getString("Double Fleche"), EbliResource.EBLI 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-12-11 18:44:43 UTC (rev 4295) +++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/persist/TrPostPersistenceManager.java 2008-12-11 18:45:55 UTC (rev 4296) @@ -595,7 +595,9 @@ * @throws IOException * @throws ClassNotFoundException */ - public void loadSource(final File file) { + public boolean loadSource(final File file) { + + boolean reussite=true; // -- outputstream du xstream --// ObjectInputStream in = null; try { @@ -646,6 +648,8 @@ } }else{ managerError.addMessageError("setup: path "+path+" invalide. Fichier r\xE9sultat non charg\xE9"); + messageError(true); + reussite= false; } } } @@ -665,11 +669,14 @@ } finally { try { in.close(); + } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); messageError(false); + } + return reussite; } } @@ -920,7 +927,11 @@ // -- etape 2 sauvegarde du fichier contenant tous les sources ouverts progression("Chargement du fichier descripteur de sources", 15); file = new File(projet_.getAbsolutePath() + File.separator + setupProject); - loadSource(file); + if(! loadSource(file)){ + managerError.addMessageError("Veuillez corriger les chemins des fichiers r\xE9sultats dans le fichier setup et r\xE9it\xE9rez l'op\xE9ration."); + managerError.showDialog(ui_); + return false; + } // -- etape 6; lecture des variables --// progression("Lecture variables", 20); loadVariables(pathVariables); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |