|
From: <had...@us...> - 2009-02-16 17:11:17
|
Revision: 4476
http://fudaa.svn.sourceforge.net/fudaa/?rev=4476&view=rev
Author: hadouxad
Date: 2009-02-16 17:11:11 +0000 (Mon, 16 Feb 2009)
Log Message:
-----------
# Ajout de l'exportation ps
# Ajout des tickiterator unique numberiterator pour les graphe et gestion des modes manuels .
# gestion de la r?\195?\169cup?\195?\169ration des points des calque de la vue 2d pour l'assistant des ?\195?\169vol temporelles (cf visualisateur pour les profils spatiaux)
Modified Paths:
--------------
branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/image/CtuluPdfPsExport.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxe.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java
branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java
Added Paths:
-----------
branches/Prepro-0.92-SNAPSHOT/ctulu/lib/iText-2.1.4.jar
branches/Prepro-0.92-SNAPSHOT/ctulu/lib/iText-src-2.1.4.zip
branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrEvolutionBuilderFromTree.java
Added: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/iText-2.1.4.jar
===================================================================
(Binary files differ)
Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/iText-2.1.4.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/iText-src-2.1.4.zip
===================================================================
(Binary files differ)
Property changes on: branches/Prepro-0.92-SNAPSHOT/ctulu/lib/iText-src-2.1.4.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/image/CtuluPdfPsExport.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/image/CtuluPdfPsExport.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/image/CtuluPdfPsExport.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -6,6 +6,7 @@
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.awt.print.PageFormat;
+import java.awt.print.Paper;
import java.awt.print.Printable;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
@@ -109,56 +110,57 @@
}
+
+
public static class PrintableObject implements Printable{
- BufferedImage image_;
- public PrintableObject(BufferedImage img){
- image_=img;
- }
- public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
- throws PrinterException {
- graphics.drawImage(image_,0,0,null);
- return 0;
- }
+ BufferedImage image_;
+ public PrintableObject(BufferedImage img){
+ image_=img;
+ }
+ public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
+ throws PrinterException {
+ // graphics.drawImage(image_,0,0,image_.getWidth(),image_.getHeight(),null);
+
+ graphics.drawImage(image_,0,0,(int)pageFormat.getWidth(),(int)pageFormat.getHeight(),null);
+ return 0;
+ }
}
-
- /**
- *Un lecteur ps
- *@author Adrien Hadoux
- */
- public static void writePostScript(final RenderedImage _image, final File _targetFile, final String _format) throws Exception{
-
-// PrintableObject objectToPrint=new PrintableObject((BufferedImage) _image);
-//
-//
-// PrinterJob job = PrinterJob.getPrinterJob();
-// job.setPrintable(objectToPrint);
-//
-// String psMimeType = "application/postscript";
-// FileOutputStream outstream;
-// StreamPrintService psPrinter=null;
-// StreamPrintServiceFactory []spsFactories =
-// PrinterJob.lookupStreamPrintServices(psMimeType);
-// if (spsFactories.length > 0) {
-// try {
-// outstream = new FileOutputStream(_targetFile);
-// psPrinter = spsFactories[0].getPrintService(outstream);
-// // psPrinter can now be set as the service on a PrinterJob
-// } catch (FileNotFoundException e) {
-// throw e;
-// }
-// }
-//
-//
-//
-// job.setPrintService(psPrinter); // if app wants to specify this printer.
-// PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
-// aset.add(new Copies(1));
-//
-//
-//
-// job.print(aset);
+
+/**
+ *Un lecteur ps
+ *@author Adrien Hadoux
+ */
+public static void writePostScript(final RenderedImage _image, final File _targetFile, final String _format) throws Exception{
+ PrintableObject objectToPrint=new PrintableObject((BufferedImage) _image);
+ PrinterJob job = PrinterJob.getPrinterJob();
+ PageFormat format=new PageFormat();
+ Paper paper=new Paper();
+ paper.setSize(_image.getWidth(),_image.getHeight());
+ paper.setImageableArea(0,0, _image.getWidth(), _image.getHeight());
+ format.setPaper(paper);
+ job.setPrintable(objectToPrint,format);
+
+ String psMimeType = "application/postscript";
+ FileOutputStream outstream;
+ StreamPrintService psPrinter=null;
+ StreamPrintServiceFactory []spsFactories =
+ PrinterJob.lookupStreamPrintServices(psMimeType);
+ if (spsFactories.length > 0) {
+ try {
+ outstream = new FileOutputStream(_targetFile);
+ psPrinter = spsFactories[0].getPrintService(outstream);
+ // psPrinter can now be set as the service on a PrinterJob
+ } catch (FileNotFoundException e) {
+ throw e;
}
+ }
+ job.setPrintService(psPrinter); // if app wants to specify this printer.
+ PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
+ aset.add(new Copies(1));
+ job.print(aset);
+ }
+
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/CalqueGISTreeModel.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -167,9 +167,9 @@
if (_userObject instanceof ZCalqueMultiPoint) {
icon_ = EbliResource.EBLI.getIcon("draw-multipoint");
}
-// else if (_userObject instanceof ZCalquePoint) {
-// icon_ = EbliResource.EBLI.getIcon("draw-add-pt");
-// }
+ else if (_userObject instanceof ZCalquePoint) {
+ icon_ = EbliResource.EBLI.getIcon("draw-add-pt");
+ }
else {
if (((ZCalqueLigneBrisee)_userObject).getModele().isGeometryFermee(_idx)) {
icon_=EbliResource.EBLI.getIcon("draw-polygon");
@@ -273,7 +273,7 @@
}
void addGeometries(final LayerNode _parent, final ZCalqueAffichageDonneesAbstract _cq) {
- final GISZoneCollection collec = ((ZModeleGeom)_cq.modeleDonnees()).getGeomData();
+ final GISZoneCollection collec = ((ZModeleGeom)_cq.modeleDonnees()).getGeomData();
final GISAttributeModelObjectInterface nameAtt = (GISAttributeModelObjectInterface) collec.getModel(GISAttributeConstants.TITRE);
final int nb = collec.getNumGeometries();
for (int i = 0; i < nb; i++) {
@@ -286,10 +286,10 @@
badd=true;
name="Multipoint {0}";
}
-// else if (chooser_.isPt() && (finder_.getMask()&GISLib.MASK_POINT)!=0) {
-// badd=true;
-// name="Point {0}";
-// }
+ else if (chooser_.isPt() && (finder_.getMask()&GISLib.MASK_POINT)!=0) {
+ badd=true;
+ name="Point {0}";
+ }
else if (chooser_.isPolyligne() && (finder_.getMask()&GISLib.MASK_POLYLINE)!=0) {
badd=true;
name="Ligne ouverte {0}";
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/CalqueGeometryVisitor.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -55,9 +55,11 @@
if (_cq instanceof ZCalqueMultiPoint && (mask_&GISLib.MASK_MULTIPOINT)!=0) {
return ((ZCalqueMultiPoint)_cq).modeleDonnees().getNombre() > 0;
}
-// else if (_cq instanceof ZCalquePoint && (mask_&GISLib.MASK_POINT)!=0) {
-// return ((ZCalquePoint) _cq).modeleDonnees().getNombre() > 0;
-// }
+ //-- rajout du test si le modele implements ZModeleGeom car c'est automatiquement cast\xE9 dans addGeometry sans v\xE9rification pr\xE9alable --//
+ //-- or c'est pas bon pour le calque des Noeuds ...--//
+ else if (_cq instanceof ZCalquePoint && (mask_&GISLib.MASK_POINT)!=0 && ((ZCalquePoint) _cq).modeleDonnees() instanceof ZModeleGeom) {
+ return ((ZCalquePoint) _cq).modeleDonnees().getNombre() > 0;
+ }
else if (_cq instanceof ZCalqueLigneBrisee && (mask_&GISLib.MASK_POLYLINE)!=0) {
boolean bok=((ZCalqueLigneBrisee) _cq).modeleDonnees().getNombre() > 0;
return bok && ((ZCalqueLigneBrisee)_cq).getModele().getNbLigneBrisee()!=0;
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -405,6 +405,14 @@
}
return -1;
}
+
+ public GrPoint getPoint( int i){
+ if(i>= modeleDonnees().getNombre())
+ return null;
+ GrPoint p=new GrPoint();
+ modele().point(p, i, true);
+ return p;
+ }
protected CtuluListSelection selectionBasic(final GrPoint _pt, final int _tolerance) {
if (modele().getNombre() == 0 || (!isVisible())) {
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxe.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxe.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxe.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -17,13 +17,13 @@
import org.fudaa.ctulu.gui.CtuluValueEditorI;
import org.fudaa.ctulu.iterator.LogarithmicNumberIterator;
import org.fudaa.ctulu.iterator.NumberIterator;
-import org.fudaa.ctulu.iterator.NumberIteratorGraduationsFixe;
-import org.fudaa.ctulu.iterator.NumberIteratorPasFixe;
+
import org.fudaa.ctulu.iterator.TickIterator;
import org.fudaa.ebli.controle.BSelecteurCheckBox;
import org.fudaa.ebli.controle.BSelecteurColorChooser;
import org.fudaa.ebli.controle.BSelecteurReduitFonteNewVersion;
import org.fudaa.ebli.controle.BSelecteurTextField;
+import org.fudaa.ebli.geometrie.GrBoite;
import org.fudaa.ebli.trace.TraceLigne;
import org.fudaa.ebli.trace.TraceLigneModel;
@@ -79,10 +79,10 @@
Color lineColor_;
- public static int MANUEL_GRADUATIONS=999;
- public static int MANUEL_LONGUEURPAS=888;
- public static int AUTO_GRADUATIONS=0;
- public static int AUTO_LONGUEURPAS=1;
+ public static int MANUEL_GRADUATIONS=0;
+ public static int MANUEL_LONGUEURPAS=1;
+ public static int AUTO_GRADUATIONS=2;
+ public static int AUTO_LONGUEURPAS=3;
/**
@@ -192,27 +192,33 @@
return null;
}
+ /**
+ * nombre de sous graduations
+ */
+ int nbSousGraduations_=3;
+
final TickIterator buildUpToDateMainTickIterator() {
- // if (axisIterator_ == null) {
-
- /*if(modeGraduations_==MANUEL_GRADUATIONS ){
- axisIterator_ = new NumberIteratorGraduationsFixe();
- axisIterator_.init(getMinimum(), getMaximum(), nbPas_);
- }
- else
- if(modeGraduations_==MANUEL_LONGUEURPAS){
- axisIterator_ = new NumberIteratorPasFixe();
- axisIterator_.init(getMinimum(), getMaximum(), longueurPas_);
- }
- else if(modeGraduations_==AUTO_GRADUATIONS){
-
+
+ axisIterator_ = new NumberIterator();
+ ((NumberIterator)axisIterator_).setMaxFractionDigits(2);
- }else*/ if(modeGraduations_==AUTO_LONGUEURPAS){
- axisIterator_ = new NumberIterator();
+
+ double min=getMinimum();
+ double max=getMaximum();
+ int mode=modeGraduations_;
+
+ if(modeGraduations_==MANUEL_GRADUATIONS ){
+ axisIterator_.initExact(getMinimum(),getMaximum(), nbPas_, nbSousGraduations_+1);
+ }else
+ if(modeGraduations_==MANUEL_LONGUEURPAS ){
+ axisIterator_.initExactFromDist(getMinimum(),getMaximum(), longueurPas_, nbSousGraduations_+1);
+ }else
+ if(modeGraduations_==AUTO_LONGUEURPAS){
+
axisIterator_.init(getMinimum(), getMaximum(), (int)( (getMaximum()-getMinimum())/longueurPas_));
}
else{
- axisIterator_ = new NumberIterator();
+
axisIterator_.init(getMinimum(), getMaximum(), nbPas_);
}
if (FuLog.isDebug() && Fu.DEBUG) {
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontal.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -11,6 +11,7 @@
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
+import java.util.ArrayList;
import org.fudaa.ctulu.CtuluLibString;
import org.fudaa.ctulu.CtuluNumberFormatDefault;
@@ -84,10 +85,16 @@
final boolean grille = isGrille();
int idx = 0;
TickIterator iterator = buildUpToDateMainTickIterator();
+ ArrayList<Double> vals=new ArrayList<Double>();
+
for (final TickIterator it = iterator; it.hasNext() && idx < 300; it.next()) {
idx++;
_g.setColor(lightfg);
- final int xe = _f.getXEcran(it.currentValue());
+ double val=it.currentValue();
+ final int xe = _f.getXEcran(val);
+
+ vals.add(new Double(val));
+
if (graduations_) {
if (it.isMajorTick()) {
if (specificFormat_ == null) {
@@ -129,6 +136,9 @@
grille_.dessineTrait(_g, xe, y, xe, _f.getMinEcranY());
}
}
+
+ vals.trimToSize();
+
/*
* t = getStringAffiche(maximum); int xe = _f.getXEcran(maximum); double
* xLeft = xe - fm.stringWidth(t) / 2; if (xLeft > (lastMaxX + 2)) {
@@ -370,6 +380,17 @@
.getFont().getSize()));
duplic.setTitre(this.getTitre());
+ duplic.graduations_=graduations_;
+ duplic.longueurPas_=longueurPas_;
+ duplic.modeGraduations_=modeGraduations_;
+ duplic.nbPas_=nbPas_;
+ duplic.nbSousGraduations_=nbSousGraduations_;
+ //duplic.range_=new CtuluRange(range_);
+ duplic.traceGraduations_=new TraceLigneModel(traceGraduations_);
+ duplic.traceSousGraduations_=new TraceLigneModel(traceSousGraduations_);
+ duplic.traceGrille_=traceGrille_;
+ duplic.traceSousGrille_=traceSousGrille_;
+ duplic.nbSousGraduations_=nbSousGraduations_;
return duplic;
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeHorizontalPersist.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -48,7 +48,7 @@
* le mode de graduation
*/
int modeGraduations_;
-
+ int nbSousGraduations_;
public EGAxeHorizontalPersist(EGAxeHorizontal axeX) {
// TODO Auto-generated constructor stub
fillInfoWith(axeX);
@@ -73,7 +73,7 @@
nbPas_=axeX.nbPas_;
longueurPas_=axeX.longueurPas_;
modeGraduations_=axeX.modeGraduations_;
-
+ nbSousGraduations_=axeX.nbSousGraduations_;
}
public EGAxeHorizontal generateAxe(){
@@ -96,6 +96,7 @@
axeX.nbPas_=nbPas_;
axeX.longueurPas_=longueurPas_;
axeX.modeGraduations_=modeGraduations_;
+ axeX.nbSousGraduations_=nbSousGraduations_;
return axeX;
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeRepereConfigurator.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -81,12 +81,13 @@
private BuTextField tfHorPas_;
+ private BuTextField tfHorSousPas_;
+
-
private JComponent tfVertMax_;
private JComponent tfVertMin_;
private BuTextField tfVertPas_;
-
+ private BuTextField tfVertSousPas_;
EGObject[] targets_;
public EGAxeRepereConfigurator(final EGGraphe _m) {
@@ -171,12 +172,20 @@
tfVertMax_.setToolTipText(tooltipTxt);
tfVertMin_.setToolTipText(tooltipTxt);
if (tfVertPas_ == null) {
- tfVertPas_ = BuTextField.createIntegerField();
+ tfVertPas_ = BuTextField.createDoubleField();
tfVertPas_.setToolTipText(tooltipPas);
tfVertPas_.setValueValidator(tfHorPas_.getValueValidator());
tfVertPas_.setColumns(10);
tfVertPas_.addKeyListener(this);
}
+
+ if (tfVertSousPas_ == null) {
+ tfVertSousPas_ = BuTextField.createIntegerField();
+ tfVertSousPas_.setToolTipText(tooltipPas);
+ tfVertSousPas_.setValueValidator(BuValueValidator.INTEGER);
+ tfVertSousPas_.setColumns(10);
+ tfVertSousPas_.addKeyListener(this);
+ }
// vertical min
BuLabel lb = new BuLabel(minTxt);
lb.setToolTipText(EbliLib.getS("Borne inf\xE9rieure des axes verticaux"));
@@ -194,31 +203,42 @@
//-- selection du type de graduations
- final BuComboBox combo = new BuComboBox(new String[] { /*EbliLib.getS("Manuel: Nb graduations"),
- EbliLib.getS("Manuel: longueur des pas"),*/ EbliLib.getS(/*"Automatique:*/" Nb graduations"),
- EbliLib.getS(/*"Automatique:*/" Longueur des pas") });
+ comboVertical_ = new BuComboBox(new String[] { EbliLib.getS("Manuel: Nombre de graduations"),
+ EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nombre de graduations"),
+ EbliLib.getS("Automatique: Longueur des pas") });
- pnAxeV_.add(combo);
+ pnAxeV_.add(comboVertical_);
pnAxeV_.add(tfVertPas_);
+
+ pnAxeV_.add(new JLabel(EbliResource.EBLI.getString("Sous graduations:")));
+ pnAxeV_.add(tfVertSousPas_);
//-- listener de la combo --//
- combo.addActionListener(new ActionListener() {
+ comboVertical_.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- modeGraduationY_=combo.getSelectedIndex();
- graphe_.axeUpdated();
+ modeGraduationY_=comboVertical_.getSelectedIndex();
+ if(modeGraduationY_==EGAxe.AUTO_GRADUATIONS|| modeGraduationY_==EGAxe.AUTO_LONGUEURPAS)
+ tfVertSousPas_.setEnabled(false);
+ else
+ tfVertSousPas_.setEnabled(true);
+
EGAxe axeChoisi=null;
if(graphe_.getSelectedComponent()!=null)
axeChoisi=graphe_.getSelectedComponent().getAxeY();
if(axeChoisi==null && axes_!=null && axes_.length>0)
axeChoisi=axes_[0];
- if(axeChoisi!=null)
- if(axeChoisi.modeGraduations_==EGAxe.AUTO_GRADUATIONS)
+ if(axeChoisi!=null){
+ if(axeChoisi.modeGraduations_==EGAxe.AUTO_GRADUATIONS || axeChoisi.modeGraduations_==EGAxe.MANUEL_GRADUATIONS)
tfVertPas_.setText(""+axeChoisi.nbPas_);
else
- if(axeChoisi.modeGraduations_==EGAxe.AUTO_LONGUEURPAS)
+ if(axeChoisi.modeGraduations_==EGAxe.AUTO_LONGUEURPAS || axeChoisi.modeGraduations_==EGAxe.MANUEL_LONGUEURPAS)
tfVertPas_.setText(""+axeChoisi.longueurPas_);
+ axeChoisi.modeGraduations_=modeGraduationY_;
+
+ }
+ graphe_.axeUpdated();
}
});
@@ -231,10 +251,10 @@
axeChoisi=axes_[0];
if(axeChoisi!=null)
- if(axeChoisi.modeGraduations_==EGAxe.AUTO_GRADUATIONS)
+ if(axeChoisi.modeGraduations_==EGAxe.AUTO_GRADUATIONS || axeChoisi.modeGraduations_==EGAxe.MANUEL_GRADUATIONS)
tfVertPas_.setText(""+axeChoisi.nbPas_);
else
- if(axeChoisi.modeGraduations_==EGAxe.AUTO_LONGUEURPAS)
+ if(axeChoisi.modeGraduations_==EGAxe.AUTO_LONGUEURPAS || axeChoisi.modeGraduations_==EGAxe.MANUEL_LONGUEURPAS)
tfVertPas_.setText(""+axeChoisi.longueurPas_);
@@ -364,15 +384,22 @@
tfHorPas_.setToolTipText(tooltipPas);
tfHorPas_.addKeyListener(this);
- if(axeH_.modeGraduations_==EGAxe.AUTO_GRADUATIONS)
+ if(axeH_.modeGraduations_==EGAxe.AUTO_GRADUATIONS || modeGraduationX_==EGAxe.MANUEL_GRADUATIONS)
tfHorPas_.setText(""+axeH_.nbPas_);
else
- if(axeH_.modeGraduations_==EGAxe.AUTO_LONGUEURPAS)
+ if(axeH_.modeGraduations_==EGAxe.AUTO_LONGUEURPAS || modeGraduationX_==EGAxe.MANUEL_LONGUEURPAS)
tfHorPas_.setText(""+axeH_.longueurPas_);
}
-
+ if (tfHorSousPas_ == null) {
+ tfHorSousPas_ = BuTextField.createIntegerField();
+ tfHorSousPas_.setValueValidator(BuValueValidator.INTEGER);
+ tfHorSousPas_.setColumns(10);
+ tfHorSousPas_.setToolTipText(tooltipPas);
+ tfHorSousPas_.addKeyListener(this);
+
+ }
tfHorMax_.addKeyListener(this);
tfHorMin_.addKeyListener(this);
@@ -391,9 +418,9 @@
//-- selection du type de graduations
if(comboHorizontal_==null){
- comboHorizontal_= new BuComboBox(new String[] { /*EbliLib.getS("Manuel: Nb graduations"),
- EbliLib.getS("Manuel: longueur des pas"),*/ EbliLib.getS(/*"Automatique:*/" Nb graduations"),
- EbliLib.getS(/*"Automatique:*/" Longueur des pas") });
+ comboHorizontal_= new BuComboBox(new String[] { EbliLib.getS("Manuel: Nombre de graduations"),
+ EbliLib.getS("Manuel: longueur des pas"), EbliLib.getS("Automatique: Nombre de graduations"),
+ EbliLib.getS("Automatique: Longueur des pas") });
lb = new BuLabel(typePasTxt);
//pnAxeH_.add(lb);
//-- listener de la combo --//
@@ -401,11 +428,18 @@
public void actionPerformed(ActionEvent e) {
modeGraduationX_=comboHorizontal_.getSelectedIndex();
- if(modeGraduationX_==EGAxe.AUTO_GRADUATIONS)
+ if(modeGraduationX_==EGAxe.AUTO_GRADUATIONS ||modeGraduationX_==EGAxe.AUTO_LONGUEURPAS)
+ tfHorSousPas_.setEnabled(false);
+ else
+ tfHorSousPas_.setEnabled(true);
+
+ if(modeGraduationX_==EGAxe.AUTO_GRADUATIONS || modeGraduationX_==EGAxe.MANUEL_GRADUATIONS)
tfHorPas_.setText(""+axeH_.nbPas_);
else
- if(modeGraduationX_==EGAxe.AUTO_LONGUEURPAS)
+ if(modeGraduationX_==EGAxe.AUTO_LONGUEURPAS || modeGraduationX_==EGAxe.MANUEL_LONGUEURPAS)
tfHorPas_.setText(""+axeH_.longueurPas_);
+ int mode=modeGraduationX_;
+ axeH_.modeGraduations_=modeGraduationX_;
graphe_.axeUpdated();
}
@@ -419,7 +453,7 @@
boxAfficheGraduationsX_.setSelected(axeH_.traceGrille_);
boxAfficheGraduationsX_.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
-
+ modeGraduationX_=comboHorizontal_.getSelectedIndex();
apply();
}
});
@@ -432,6 +466,11 @@
});
// pnAxeH_.add(choixType);
pnAxeH_.add(tfHorPas_);
+
+
+ pnAxeH_.add(new JLabel(EbliResource.EBLI.getString("Sous graduations:")));
+ pnAxeH_.add(tfHorSousPas_);
+
//-- graduations --//
modelGraduationsX_ = new BSelecteurLineModel(GRILLE_AXE_X,axeH_.traceGraduations_);
@@ -470,16 +509,23 @@
private boolean applyHorizontal() {
final String pas = tfHorPas_.getText().trim();
+ final String Souspas = tfHorSousPas_.getText().trim();
+
final boolean maxEdited = editorH_.isValueValidFromComponent(tfHorMax_);
final boolean minEdited = editorH_.isValueValidFromComponent(tfHorMin_);
- final boolean pasEdited = pas.length() > 0;
+ boolean pasEdited = pas.length() > 0;
+ if(!pasEdited)
+ pasEdited=Souspas.length()>0;
+
final double maxVal = maxEdited ? Double.parseDouble(editorH_.getStringValue(tfHorMax_)) : axeH_.getMaximum();
final double minVal = minEdited ? Double.parseDouble(editorH_.getStringValue(tfHorMin_)) : axeH_.getMinimum();
final double pasVal = pasEdited ? Double.parseDouble(pas) : 0;
+ final int souspasVal = (Souspas.length()>0) ? Integer.parseInt(Souspas) : 0;
+
boolean r = false;
+ if(comboHorizontal_.getSelectedIndex()!=-1)
+ axeH_.modeGraduations_=comboHorizontal_.getSelectedIndex();
-
-
if (maxEdited || minEdited || pasEdited) {
if (pasEdited) {
if(modeGraduationX_==EGAxe.MANUEL_GRADUATIONS || modeGraduationX_==EGAxe.AUTO_GRADUATIONS)
@@ -491,6 +537,12 @@
r = axeH_.setBounds(minVal, maxVal,-1,modeGraduationX_);
}
+ if(Souspas.length()>0){
+ if(souspasVal!=axeH_.nbSousGraduations_)
+ r=true;
+ axeH_.nbSousGraduations_=souspasVal;
+
+ }
}
TraceLigneModel model=modelGraduationsX_.getNewData();
@@ -551,12 +603,24 @@
}
}
final String pas = tfVertPas_.getText().trim();
+ final String Souspas = tfVertSousPas_.getText().trim();
+
+ boolean pasModif = pas.length() > 0;
- final boolean pasModif = pas.length() > 0;
-
+ if(!pasModif)
+ pasModif=Souspas.length()>0;
+
if (maxEdited || minEdited || pasModif) {
final double pasVal = pasModif ? Double.parseDouble(pas) : 0;
for (int i = 0; i < axes_.length; i++) {
+
+ if(comboVertical_.getSelectedIndex()!=-1)
+ axes_[i].modeGraduations_=comboVertical_.getSelectedIndex();
+
+ final int pasSousVal = (Souspas.length()>0) ? Integer.parseInt(Souspas) : 0;
+
+
+
double min = minVal;
double max = maxVal;
if (!minEdited) {
@@ -595,7 +659,12 @@
r=true;
}
+ if((Souspas.length()>0)){
+ if(axes_[i].nbSousGraduations_!=pasSousVal)
+ r=true;
+ axes_[i].nbSousGraduations_=pasSousVal;
+ }
}
}
@@ -697,7 +766,13 @@
void updateAxeHorValue() {
editorH_.setValue(CtuluLib.getDouble(axeH_.getMaximum()), tfHorMax_);
editorH_.setValue(CtuluLib.getDouble(axeH_.getMinimum()), tfHorMin_);
- tfHorPas_.setText(CtuluLibString.getString(axeH_.getNbPas()));
+ if(axeH_.modeGraduations_==EGAxe.AUTO_GRADUATIONS|| axeH_.modeGraduations_==EGAxe.MANUEL_GRADUATIONS)
+ tfHorPas_.setText(CtuluLibString.getString(axeH_.getNbPas()));
+ else
+ tfHorPas_.setText(""+axeH_.longueurPas_);
+
+ tfHorSousPas_.setText(""+axeH_.nbSousGraduations_);
+
cbBlockHView_.setSelected(false);
cbUnblockBlockHView_.setSelected(false);
cbUnblockBlockHView_.setEnabled(graphe_.isUserXRangeSet());
@@ -709,13 +784,17 @@
String min = CtuluLibString.EMPTY_STRING;
String max = min;
String pas = min;
+ String longueurPas="";
if (axes_ != null && axes_.length > 0) {
boolean minIsCommon = true;
boolean maxIsCommon = true;
boolean pasIsCommon = true;
+
+
final double commonMin = axes_[0].getMinimum();
final double commonMax = axes_[0].getMaximum();
final int commonPas = axes_[0].getNbPas();
+ final double commonLongueurPas=axes_[0].longueurPas_;
for (int i = 1; i < axes_.length && (minIsCommon || maxIsCommon || pasIsCommon); i++) {
if (axes_[i].getMinimum() != commonMin) {
minIsCommon = false;
@@ -726,6 +805,9 @@
if (axes_[i].getNbPas() != commonPas) {
pasIsCommon = false;
}
+ if (axes_[i].getNbPas() != commonPas) {
+ pasIsCommon = false;
+ }
}
if (minIsCommon) {
min = Double.toString(commonMin);
@@ -734,14 +816,23 @@
max = Double.toString(commonMax);
}
if (pasIsCommon) {
+ longueurPas=""+commonLongueurPas;
pas = CtuluLibString.getString(commonPas);
}
+ if(axes_[0].modeGraduations_==EGAxe.AUTO_GRADUATIONS|| axes_[0].modeGraduations_==EGAxe.MANUEL_GRADUATIONS)
+ tfVertPas_.setText(pas);
+ else
+ tfVertPas_.setText(longueurPas);
+ tfVertSousPas_.setText(""+axes_[0].nbSousGraduations_);
}
if (editorV_ != null) {
editorV_.setValue(max, tfVertMax_);
editorV_.setValue(min, tfVertMin_);
}
- tfVertPas_.setText(pas);
+
+
+
+
updateAxeHorValue();
cbUseSameAxe_.setEnabled(axes_ != null && axes_.length > 1);
cbUseSameAxe_.setSelected(false);
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVertical.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -17,6 +17,7 @@
import org.fudaa.ctulu.CtuluRange;
import org.fudaa.ctulu.iterator.TickIterator;
import org.fudaa.ebli.trace.TraceLigne;
+import org.fudaa.ebli.trace.TraceLigneModel;
import com.memoire.fu.Fu;
import com.memoire.fu.FuLog;
@@ -378,6 +379,18 @@
duplic.setFont(new Font(this.getFont().getFamily(),this.getFont().getStyle(),this.getFont().getSize()));
duplic.setTitre(this.getTitre());
+
+ duplic.graduations_=graduations_;
+ duplic.longueurPas_=longueurPas_;
+ duplic.modeGraduations_=modeGraduations_;
+ duplic.nbPas_=nbPas_;
+ duplic.nbSousGraduations_=nbSousGraduations_;
+ //duplic.range_=new CtuluRange(range_);
+ duplic.traceGraduations_=new TraceLigneModel(traceGraduations_);
+ duplic.traceSousGraduations_=new TraceLigneModel(traceSousGraduations_);
+ duplic.traceGrille_=traceGrille_;
+ duplic.traceSousGrille_=traceSousGrille_;
+ duplic.nbSousGraduations_=nbSousGraduations_;
return duplic;
}
Modified: branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/ebli/src/org/fudaa/ebli/courbe/EGAxeVerticalPersist.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -52,6 +52,8 @@
*/
int modeGraduations_;
+ int nbSousGraduations_;
+
public EGAxeVerticalPersist(EGAxeVertical axeY) {
// TODO Auto-generated constructor stub
fillInfoWith(axeY);
@@ -79,6 +81,7 @@
nbPas_=axeY.nbPas_;
longueurPas_=axeY.longueurPas_;
modeGraduations_=axeY.modeGraduations_;
+ nbSousGraduations_=axeY.nbSousGraduations_;
}
@@ -106,7 +109,7 @@
axeY.nbPas_=nbPas_;
axeY.longueurPas_=longueurPas_;
axeY.modeGraduations_=modeGraduations_;
-
+ axeY.nbSousGraduations_=nbSousGraduations_;
return axeY;
}
Added: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrEvolutionBuilderFromTree.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrEvolutionBuilderFromTree.java (rev 0)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/TrEvolutionBuilderFromTree.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -0,0 +1,257 @@
+package org.fudaa.fudaa.tr.post;
+
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.swing.JTree;
+import javax.swing.tree.TreePath;
+
+import org.fudaa.ctulu.gis.GISLib;
+import org.fudaa.ctulu.gis.GISPrecision;
+import org.fudaa.ctulu.gis.GISZoneCollectionPoint;
+import org.fudaa.ebli.calque.BGroupeCalque;
+import org.fudaa.ebli.calque.CalqueGISTreeModel;
+import org.fudaa.ebli.calque.ZCalqueMultiPoint;
+import org.fudaa.ebli.calque.ZCalquePoint;
+import org.fudaa.ebli.calque.ZEbliCalquesPanel;
+import org.fudaa.ebli.calque.CalqueGISTreeModel.LayerNode;
+import org.fudaa.ebli.geometrie.GrPoint;
+import org.fudaa.fudaa.tr.TrPostImplementation;
+import org.fudaa.fudaa.tr.post.dialogSpec.TrPostWizardCourbeTemporelle.ModelListePoints;
+import org.jdesktop.swingx.treetable.MutableTreeTableNode;
+
+
+
+/**
+ * Construit un composant arbre g\xE9n\xE9rique qui permet de r\xE9cup\xE9rer les points des calques d'une vue 2d.
+ * Utiliser surtout pour l'assistant de cr\xE9ation d'\xE9volutions temporelles.
+ * @author Adrien Hadoux
+ *
+ */
+public abstract class TrEvolutionBuilderFromTree {
+
+
+
+ public static class PostEvolutionTemporelles extends TrEvolutionBuilderFromTree{
+ /**
+ * le modele du tableau a mettre a jour
+ */
+ ModelListePoints modeletableau_;
+ /**
+ * la liste des points. Peut etre des points reels mais aussi interpol\xE9s
+ */
+ @SuppressWarnings("unchecked")
+ List listePoints_;
+
+
+ public PostEvolutionTemporelles(TrPostVisuPanel panel, ModelListePoints modeletableau, List liste){
+ super(panel);
+ modeletableau_= modeletableau;
+ listePoints_=liste;
+
+ }
+
+ protected void apply(){
+
+ //-- mise a jour des donn\xE9es du tableau--//
+ modeletableau_.fireTableDataChanged();
+ }
+
+ public boolean ajouterSelection(ZCalqueMultiPoint cq){
+ boolean modifierStructure=false;
+
+ TrPostInterpolatePoint newPoint=null;
+ if(cq==null || cq.modeleDonnees()==null)
+ return false;
+
+ int nb=cq.modeleDonnees().getNombre();
+
+ for(int i=0;i<nb;i++){
+ GrPoint point=(GrPoint) cq.modeleDonnees().getObject(i);
+ if(point!=null){
+ final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
+ if (idxElt > -1){
+ newPoint= new TrPostInterpolatePoint(idxElt, point.x_, point.y_, new GISPrecision());
+ modifierStructure=true;
+ listePoints_.add(newPoint);
+ }
+ }
+ }
+ return modifierStructure;
+
+ }
+
+
+ public boolean ajouterSelection(ZCalquePoint cq){
+ boolean modifierStructure=false;
+ TrPostInterpolatePoint newPoint=null;
+ if(cq==null || cq.modeleDonnees()==null)
+ return false;
+
+ int nb=cq.modeleDonnees().getNombre();
+
+ for(int i=0;i<nb;i++){
+ GrPoint point=cq.getPoint(i);
+ if(point!=null){
+ final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
+ if (idxElt > -1){
+ newPoint= new TrPostInterpolatePoint(idxElt, point.x_, point.y_, new GISPrecision());
+ modifierStructure=true;
+ if(canAdd(newPoint))
+ listePoints_.add(newPoint);
+ }
+ }
+ }
+ return modifierStructure;
+ }
+
+ public boolean ajouterSelection(ZCalquePoint cq,int i){
+ boolean modifierStructure=false;
+ TrPostInterpolatePoint newPoint=null;
+ if(cq==null || cq.modeleDonnees()==null)
+ return false;
+ GrPoint point=cq.getPoint(i);
+ if(point!=null){
+ final int idxElt = TrIsoLayerDefault.sondeSelection(point, panel_.getIsoLayer().getIsoModel());
+ if (idxElt > -1){
+ newPoint= new TrPostInterpolatePoint(idxElt, point.x_, point.y_, new GISPrecision());
+ modifierStructure=true;
+ if(canAdd(newPoint))
+ listePoints_.add(newPoint);
+ }
+ }
+
+ return modifierStructure;
+ }
+
+
+ private boolean canAdd(TrPostInterpolatePoint pt){
+ for(Object ob:listePoints_){
+ if(ob instanceof TrPostInterpolatePoint){
+ TrPostInterpolatePoint tr=(TrPostInterpolatePoint) ob;
+ if(tr.equals(pt))
+ return false;
+ }
+ }
+ return true;
+
+ }
+ }
+
+ /**
+ * Liste des points selectionn\xE9s.
+ */
+ protected GISZoneCollectionPoint pointsSelectionnees_;
+
+ final TrPostVisuPanel panel_;
+
+ protected TrPostImplementation impl_;
+
+ /**
+ * l'arbre des donn\xE9es representant le calque
+ */
+ public JTree tree_;
+
+
+ /**
+ * le linetreemodel aui filtre uniquement les type d'objets g\xE9om\xE9triaues recherch\xE9s.
+ */
+ final CalqueGISTreeModel lineTreeModel_;
+
+ public TrEvolutionBuilderFromTree(TrPostVisuPanel panel) {
+ this(panel,null);
+ }
+
+ public TrEvolutionBuilderFromTree(TrPostVisuPanel panel, TrPostImplementation impl) {
+
+ this.panel_ = panel;
+ this.impl_ = impl;
+ pointsSelectionnees_=null;
+ lineTreeModel_ = new CalqueGISTreeModel(null, panel.getDonneesCalque());
+ lineTreeModel_.setMask(GISLib.MASK_POINT);
+ }
+
+ public GISZoneCollectionPoint getSelection(){
+
+ if(tree_==null)
+ return null;
+
+ return null;
+ }
+
+ public JTree buildTree() {
+ if(tree_==null){
+ tree_=lineTreeModel_.createView(false,false);
+ //-- gestion double click pour r\xE9cup\xE9rer l'information
+ tree_.addMouseListener(new MouseAdapter(){
+
+
+ public void mouseClicked(MouseEvent e) {
+ if(e.getClickCount()<2)
+ return;
+ final TreePath clickedElement = tree_.getPathForLocation(e.getX(), e.getY());
+ LayerNode treeNode = null;
+ if (clickedElement != null && clickedElement.getLastPathComponent() instanceof LayerNode)
+ treeNode=(LayerNode) clickedElement.getLastPathComponent();
+
+ if(treeNode==null)return;
+ boolean apply=false;
+ if(treeNode.getUserObject() instanceof ZCalquePoint && treeNode.isLeaf())
+
+ apply=ajouterSelection((ZCalquePoint) treeNode.getUserObject(),treeNode.getIdxGeom());
+ else
+ if(treeNode.getUserObject() instanceof ZCalquePoint )
+ apply=ajouterSelection((ZCalquePoint) treeNode.getUserObject());
+ else
+ if(treeNode.getUserObject() instanceof ZCalqueMultiPoint)
+ apply= ajouterSelection((ZCalqueMultiPoint) treeNode.getUserObject());
+ else if( treeNode.getUserObject() instanceof BGroupeCalque){
+
+ if(treeNode.getChildCount()>0 && treeNode.getChildAt(0) instanceof LayerNode){
+
+ LayerNode treeNodeFils =(LayerNode) treeNode.getChildAt(0);
+ if(treeNodeFils.getChildCount()>0 && treeNodeFils.getChildAt(0)instanceof LayerNode && !treeNodeFils.isLeaf())
+ treeNodeFils=(LayerNode) treeNodeFils.getChildAt(0);
+ if(treeNodeFils.getUserObject() instanceof ZCalquePoint){
+ //-- on recupere le calque global et on l'ajoute direct --//
+ ZCalquePoint zcq=(ZCalquePoint) treeNodeFils.getUserObject() ;
+ if(zcq!=null)
+ apply=ajouterSelection(zcq);
+ }
+
+ }
+
+
+
+ }
+ //-- on fait appel a pply qui met a jour les composants voulues --//
+ if(apply)
+ apply();
+ }
+ });
+ }
+ return tree_;
+ }
+
+ /**
+ * est appel\xE9e lors du double clic sur le tree.
+ * @param objectSelection
+ * @return
+ */
+ public abstract boolean ajouterSelection(ZCalqueMultiPoint cq);
+
+
+
+ public abstract boolean ajouterSelection(ZCalquePoint cq);
+
+ public abstract boolean ajouterSelection(ZCalquePoint cq,int indice);
+
+ /**
+ * applique les modifications (listener a appeler ou autre)...
+ */
+ protected abstract void apply();
+
+}
Modified: branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java
===================================================================
--- branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java 2009-02-16 09:52:22 UTC (rev 4475)
+++ branches/Prepro-0.92-SNAPSHOT/fudaa/src/org/fudaa/fudaa/tr/post/dialogSpec/TrPostWizardCourbeTemporelle.java 2009-02-16 17:11:11 UTC (rev 4476)
@@ -27,6 +27,7 @@
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
+import javax.swing.JSplitPane;
import javax.swing.JTextField;
import javax.swing.table.AbstractTableModel;
@@ -58,6 +59,7 @@
import org.fudaa.fudaa.sig.layer.FSigLayerGroup;
import org.fudaa.fudaa.tr.common.TrLib;
import org.fudaa.fudaa.tr.common.TrResource;
+import org.fudaa.fudaa.tr.post.TrEvolutionBuilderFromTree;
import org.fudaa.fudaa.tr.post.TrIsoLayerDefault;
import org.fudaa.fudaa.tr.post.TrPostCourbeBuilder;
import org.fudaa.fudaa.tr.post.TrPostCourbeTreeModel;
@@ -72,6 +74,7 @@
import com.memoire.bu.BuCharValidator;
import com.memoire.bu.BuCheckBox;
import com.memoire.bu.BuGridLayout;
+import com.memoire.bu.BuPanel;
import com.memoire.bu.BuScrollPane;
import com.memoire.bu.BuStringValidator;
import com.memoire.bu.BuTextField;
@@ -151,6 +154,17 @@
return true;
}
+
+ public void fireTableStructureChanged() {
+
+ super.fireTableStructureChanged();
+
+ if(indicateurPoints_!=null)
+ indicateurPoints_.setText("Nb points: " + listePoints_.size());
+ }
+
+
+
// @Override
// public void setValueAt(final Object _value, final int _rowIndex, final int _columnIndex) {
// if (_columnIndex == 0 || _columnIndex == 3) return;
@@ -307,6 +321,9 @@
BuTextField nomCalque_=new BuTextField(10);
+ TrEvolutionBuilderFromTree builderPointsCalque_;
+
+
/**
* Construit le panel qui s occupe de la gestion des points
*
@@ -314,6 +331,9 @@
*/
public JComponent constructSlectionPoint() {
// -- le table des points selectionnes --//
+ final JSplitPane splitpanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+
+
final JPanel content = new JPanel(new BorderLayout());
final ModelListePoints model = new ModelListePoints();
final JXTable tableau = new JXTable(model) {
@@ -380,7 +400,7 @@
}
model.fireTableDataChanged();
indicateurPoints_.setText("Nb points: " + listePoints_.size());
- if (listePoints_.size() == 0) pointsSaisis = false;
+ // if (listePoints_.size() == 0) pointsSaisis = false;
}
}
});
@@ -389,7 +409,25 @@
indicateurPoints_.setText("Nb points: " + listePoints_.size());
control.add(indicateurPoints_);
content.add(control, BorderLayout.SOUTH);
- return content;
+
+ content.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Points s\xE9lectionn\xE9s")));
+
+ //-- ajout du panel de selection des zcqlauePoints de la vue 2d --//
+
+
+ builderPointsCalque_=new TrEvolutionBuilderFromTree.PostEvolutionTemporelles(this.calque_,model,listePoints_);
+
+ splitpanel.setTopComponent(content);
+
+ BuPanel conteneurArbre=new BuPanel(new BorderLayout());
+ conteneurArbre.setBorder(BorderFactory.createTitledBorder(TrResource.getS("Points de la vue 2d")));
+ conteneurArbre.add(new BuScrollPane(builderPointsCalque_.buildTree()));
+
+ conteneurArbre.add(new JLabel(TrResource.getS("<html><body>Pour ajouter les points, double cliquez dessus. Pour ajouter directement tous les points d'un calque,<br /> double-cliquez sur le calque lui m\xEAme</body></html>")),BorderLayout.NORTH);
+
+ splitpanel.setBottomComponent(conteneurArbre);
+ splitpanel.setDividerLocation(150);
+ return splitpanel;
}
/**
@@ -691,8 +729,7 @@
public JComponent getStepComponent() {
switch (current_) {
case 0: {
- if (listePoints_.size() != 0) pointsSaisis = true;
- else pointsSaisis = false;
+
if (panelSelectionPoints == null) panelSelectionPoints = constructSlectionPoint();
return panelSelectionPoints;
}
@@ -716,8 +753,12 @@
return 3;
}
- private boolean pointsSaisis = false;
+ private boolean pointsSaisis(){
+ return listePoints_.size()>0;
+ }
+
+
/**
* MEthode utilisee pour disabler ou non les boutons suivants
*/
@@ -725,7 +766,7 @@
public int getStepDisabledButtons() {
int r = super.getStepDisabledButtons();
if (current_ == 1) {
- if (!pointsSaisis) r |= BuButtonPanel.SUIVANT;
+ if (!pointsSaisis()) r |= BuButtonPanel.SUIVANT;
} else if (current_ == 2) {
if ((listeGraphesChoisis_ == null || listeGraphesChoisis_.size() == 0) && !checkboxNewGraphe_.isSelected()) r |= BuButtonPanel.TERMINER;
// -- pour empecher d avancer, voir ci dessous
@@ -888,7 +929,7 @@
}
indicateurPoints_.setText("Nb points: " + listePoints_.size());
- if (listePoints_.size() > 0) pointsSaisis = true;
+ // if (listePoints_.size() > 0) pointsSaisis = true;
dialog.dispose();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|