|
From: <jm_...@us...> - 2003-09-24 12:55:51
|
Update of /cvsroot/fudaa//fudaa_devel/ebli/src/org/fudaa/ebli/calque
In directory sc8-pr-cvs1:/tmp/cvs-serv10317/src/org/fudaa/ebli/calque
Modified Files:
ZCalqueLongPolygone.java
Log Message:
suppression de l'import dodico
Index: ZCalqueLongPolygone.java
===================================================================
RCS file: /cvsroot/fudaa//fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueLongPolygone.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ZCalqueLongPolygone.java 23 Sep 2003 20:35:03 -0000 1.3
--- ZCalqueLongPolygone.java 24 Sep 2003 12:55:44 -0000 1.4
***************
*** 1,350 ****
! /*
! * @file ZcalqueLongPolygone.java
! * @creation 1 juil. 2003
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.ebli.calque;
!
! import java.awt.Color;
! import java.awt.Graphics;
! import java.awt.Graphics2D;
!
! import javax.swing.Icon;
!
! import org.fudaa.dodico.commun.DodicoLib;
!
! import org.fudaa.ebli.commun.EbliListeSelection;
! import org.fudaa.ebli.geometrie.GrBoite;
! import org.fudaa.ebli.geometrie.GrMorphisme;
! import org.fudaa.ebli.geometrie.GrPoint;
! import org.fudaa.ebli.geometrie.GrPolygone;
! import org.fudaa.ebli.trace.TraceLigne;
!
! /**
! * @author deniger
! * @version $Id$
! */
! public class ZCalqueLongPolygone extends ZCalqueAffichageDonnees {
!
! /** Propriete modele*/
! protected ZModeleLongPolygone modele_= null;
! protected TraceLigne tl_= null;
! protected TraceLigne tlSelection_= null;
!
! public ZCalqueLongPolygone() {
! super();
! }
!
! public ZCalqueLongPolygone(ZModeleLongPolygone _modele) {
! this();
! modele(_modele);
! }
!
! /**
! * @param _modele Modele
! */
! public void modele(ZModeleLongPolygone _modele) {
! if (modele_ != _modele) {
! ZModeleLongPolygone vp= modele_;
! modele_= _modele;
! firePropertyChange("modele", vp, modele_);
! }
! }
!
! /**
! * @return Modele
! */
! public ZModeleLongPolygone modele() {
! return modele_;
! }
! public ZModeleDonnees modeleDonnees() {
! return modele();
! }
!
! /**
! * @param _g
! */
! public void paintComponent(Graphics _g) {
! super.paintComponent(_g);
! if ((modele_ == null) || (modele_.getNombre() <= 0))
! return;
! GrBoite clip= getClipReel(_g);
! GrBoite domaine= modele_.getDomaine();
!
! if (!domaine.intersectXY(clip)) {
! return;
! }
! GrMorphisme versEcran= getVersEcran();
! boolean attenue= isAttenue();
!
! // BPaletteCouleur paletteCouleur = getPaletteCouleur();
! // BPaletteIcone paletteIcone = getPaletteIcone();
! int nombre= modele_.getNombre();
! Color foreground= getForeground();
! if (attenue)
! foreground= attenueCouleur(foreground);
! boolean rapide= isRapide();
!
! Icon icone= getIcone();
! if (attenue)
! icone= attenueIcone(icone);
!
! GrBoite bPoly;
! if (tl_ == null)
! tl_= new TraceLigne((Graphics2D)_g);
! else
! tl_.graphics((Graphics2D)_g);
!
! for (int i= 0; i < nombre; i++) {
! bPoly= modele_.getDomaineForPolygoneIdx(i);
! //Si la boite du polygone n'est pas dans la boite d'affichage on passe
! if (bPoly.intersectionXY(clip) == null)
! continue;
! int nbPoints= modele_.getNbPointForPolygoneIdx(i);
! if (nbPoints <= 0)
! continue;
! //QUESTION: a rajouter
! /* double z = 0.;
! if(domaine.e.z > domaine.o.z)
! z = (p.z - domaine.o.z) / (domaine.e.z - domaine.o.z);*/
! // p.autoApplique(versEcran);
! Color c= foreground;
! Icon s= icone;
! /*if(paletteCouleur != null)
! {
! c = paletteCouleur.couleur(z);
! if(attenue)
! c = attenueCouleur(c);
! }
! if(paletteIcone != null)
! {
! s = paletteIcone.icone(z);
! if(attenue)
! s = attenueIcone(s);
! } */
! if (c == null)
! return;
! _g.setColor(c);
! tl_.setCouleur(c);
! GrPoint ptOri= new GrPoint();
! modele_.point(ptOri, i, nbPoints-1);
! ptOri.autoApplique(versEcran);
! if (s != null)
! s.paintIcon(this, _g, (int)ptOri.x, (int)ptOri.y);
! GrPoint ptDest= new GrPoint();
! for (int j= 0; j < nbPoints; j++) {
! //le point de dest est initialise
! modele_.point(ptDest, i, j);
! ptDest.autoApplique(versEcran);
! if (s != null)
! s.paintIcon(this, _g, (int)ptDest.x, (int)ptDest.y);
! tl_.dessineTrait(ptOri.x, ptOri.y, ptDest.x, ptDest.y);
! ptOri.initialise(ptDest);
! // indexGlobal++;
! // tl_.dessineTexte(
! // DodicoLib.getString(indexGlobal),
! // (int)ptOri.x,
! // (int)ptOri.y);
! }
! }
!
! if ((!rapide) && (!isSelectionEmpty())) {
! if (tlSelection_ == null)
! tlSelection_= new TraceLigne((Graphics2D)_g);
! else
! tlSelection_.graphics((Graphics2D)_g);
! initIconeSelection();
! initCouleurSelection();
! Color cs= couleurSelection();
! Icon ic= iconeSelection();
! if (attenue) {
! cs= attenueCouleur(cs);
! ic= attenueIcone(ic);
! }
! _g.setColor(cs);
! tlSelection_.setCouleur(cs);
! //tlSelection_.setEpaisseur(2f);
! int nb= selection_.getMaxIndex();
! for (int i= nb; i >= 0; i--) {
! if (!selection_.isSelected(i))
! continue;
! bPoly= modele_.getDomaineForPolygoneIdx(i);
! //Si la boite du polygone n'est pas dans la boite d'affichage on passe
! if (bPoly.intersectionXY(clip) == null)
! continue;
! int nbPoints= modele_.getNbPointForPolygoneIdx(i);
! GrPoint ptOri= new GrPoint();
! modele_.point(ptOri, i, 0);
! ptOri.autoApplique(versEcran);
! GrPoint ptDest= new GrPoint();
! for (int j= nbPoints - 1; j >= 0; j--) {
! //le point de dest est initialise
! modele_.point(ptDest, i, j);
! ptDest.autoApplique(versEcran);
! ic.paintIcon(this, _g, (int)ptDest.x, (int)ptDest.y);
! tlSelection_.dessineTrait(ptOri.x, ptOri.y, ptDest.x, ptDest.y);
! ptOri.initialise(ptDest);
! }
! }
! /* if(!selection_.isSelectionPartielleVide())
! {
! int[] s=entitePartielleSelection();
! int nb=s.length-1;
! initIconeSelectionPartielle();
! initCouleurSelection();
! Color cs=couleurSelection();
! Icon ic=iconeSelectionPartielle();
! if(attenue)
! {
! cs=attenueCouleur(cs);
! ic=attenueIcone(ic);
! }
! _g.setColor(cs);
! int t;
! for(int i = nb; i >=0; i--)
! {
! t=s[i];
! modele_.polygone(p,t);
! if(clip.intersectXY(p.boite()))
! {
! int[] atomes=partielleSelection(t);
! int nbAtomes=atomes.length-1;
! GrPoint pt=new GrPoint();
! for(int j=nbAtomes;j>=0;j--)
! {
! p.sommets.renvoie(pt,atomes[j]);
! if(clip.contientXY(pt))
! {
! p.autoApplique(versEcran);
! ic.paintIcon(this, _g, (int)pt.x, (int)pt.y);
! }
! }
! }
! }
! } */
! }
! }
!
! public EbliListeSelection selection(
! GrPolygone _polySelection,
! boolean _partiel) {
! GrBoite boitePolySelection= _polySelection.boite();
! GrMorphisme versEcran= getVersEcran();
! GrBoite bClip= getDomaine();
! bClip.autoApplique(versEcran);
! if (!boitePolySelection.intersectXY(bClip))
! return null;
! int nb= modele().getNombre() - 1;
! bClip= getClipReel(getGraphics());
! // GrPolygone poly = new GrPolygone();
! EbliListeSelection r= creeSelection();
! if (_partiel) {
! /* for(int i=nb;i>=0;i--)
! {
! modele().polygone(poly,i);
! if(bClip.intersectXY(poly.boite()))
! {
! poly.autoApplique(versEcran);
! if(boitePolySelection.intersectXY(poly.boite()))
! {
! DefaultListSelectionModel l=GrPolygone.pointsSelectionnes(poly,_polySelection);
! if(l!=null)
! {
! if(EbliListeSelection.estTotal(l,poly.nombre()))
! r.add(i);
! else
! r.setSelectionPartielle(i,l);
! }
! }
! }
! } */
! } else {
!
! for (int i= nb; i >= 0; i--) {
! //modele().polygone(poly, i);
! if (bClip.contientXY(modele_.getDomaineForPolygoneIdx(i))) {
! int nbPoint= modele_.getNbPointForPolygoneIdx(i) - 1;
! GrPoint p= new GrPoint();
! boolean selected= true;
! for (int j= nbPoint;(j >= 0) && selected; j--) {
! modele_.point(p, i, j);
! p.autoApplique(versEcran);
! if ((!boitePolySelection.contient(p))
! || (!_polySelection.contientXY(p))) {
! selected= false;
! }
! }
! if (selected)
! r.add(i);
! }
! }
! }
! if (r.isEmpty())
! return null;
! else
! return r;
!
! }
!
! public EbliListeSelection selection(
! GrPoint _pt,
! int _tolerance,
! boolean _partiel) {
!
! GrMorphisme versEcran= getVersEcran();
! GrBoite bClip= getDomaine();
! bClip.autoApplique(versEcran);
! if ((!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > _tolerance))
! return null;
! int nb= modele().getNombre() - 1;
! bClip= getClipReel(getGraphics());
! GrPolygone poly= new GrPolygone();
! GrPoint pt1= new GrPoint();
! GrPoint pt2= new GrPoint();
! poly.sommets.ajoute(pt1);
! poly.sommets.ajoute(pt2);
! if (_partiel) {
! /* GrPoint p=new GrPoint();
! for(int i=nb;i>=0;i--)
! {
! modele().polygone(poly,i);
! if(bClip.intersectXY(poly.boite()))
! {
! poly.autoApplique(versEcran);
! int nbPt=poly.sommets.nombre()-1;
! for(int j=nbPt;j>=0;j--)
! {
! poly.sommets.renvoie(p,j);
! if(GrPoint.estSelectionne(p, _tolerance, _pt))
! {
! EbliListeSelection r=creeSelection();
! r.setSelectionPartielle(i,j);
! return r;
! }
! }
! }
! } */
! } else {
! for (int i= nb; i >= 0; i--) {
! if (bClip.intersectXY(modele_.getDomaineForPolygoneIdx(i))) {
! int nbPt= modele_.getNbPointForPolygoneIdx(i) - 1;
! for (int j= nbPt; j >= 1; j--) {
! modele_.point(pt1, i, j);
! modele_.point(pt2, i, j - 1);
! poly.autoApplique(versEcran);
! if (GrPolygone.estSelectionne(poly, _tolerance, _pt)) {
! EbliListeSelection r= creeSelection();
! r.add(i);
! return r;
! }
! }
! }
! }
! }
! return null;
!
! }
}
--- 1,348 ----
! /*
! * @file ZcalqueLongPolygone.java
! * @creation 1 juil. 2003
! * @modification $Date$
! * @license GNU General Public License 2
! * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
! * @mail de...@fu...
! */
! package org.fudaa.ebli.calque;
!
! import java.awt.Color;
! import java.awt.Graphics;
! import java.awt.Graphics2D;
!
! import javax.swing.Icon;
!
! import org.fudaa.ebli.commun.EbliListeSelection;
! import org.fudaa.ebli.geometrie.GrBoite;
! import org.fudaa.ebli.geometrie.GrMorphisme;
! import org.fudaa.ebli.geometrie.GrPoint;
! import org.fudaa.ebli.geometrie.GrPolygone;
! import org.fudaa.ebli.trace.TraceLigne;
!
! /**
! * @author deniger
! * @version $Id$
! */
! public class ZCalqueLongPolygone extends ZCalqueAffichageDonnees {
!
! /** Propriete modele*/
! protected ZModeleLongPolygone modele_= null;
! protected TraceLigne tl_= null;
! protected TraceLigne tlSelection_= null;
!
! public ZCalqueLongPolygone() {
! super();
! }
!
! public ZCalqueLongPolygone(ZModeleLongPolygone _modele) {
! this();
! modele(_modele);
! }
!
! /**
! * @param _modele Modele
! */
! public void modele(ZModeleLongPolygone _modele) {
! if (modele_ != _modele) {
! ZModeleLongPolygone vp= modele_;
! modele_= _modele;
! firePropertyChange("modele", vp, modele_);
! }
! }
!
! /**
! * @return Modele
! */
! public ZModeleLongPolygone modele() {
! return modele_;
! }
! public ZModeleDonnees modeleDonnees() {
! return modele();
! }
!
! /**
! * @param _g
! */
! public void paintComponent(Graphics _g) {
! super.paintComponent(_g);
! if ((modele_ == null) || (modele_.getNombre() <= 0))
! return;
! GrBoite clip= getClipReel(_g);
! GrBoite domaine= modele_.getDomaine();
!
! if (!domaine.intersectXY(clip)) {
! return;
! }
! GrMorphisme versEcran= getVersEcran();
! boolean attenue= isAttenue();
!
! // BPaletteCouleur paletteCouleur = getPaletteCouleur();
! // BPaletteIcone paletteIcone = getPaletteIcone();
! int nombre= modele_.getNombre();
! Color foreground= getForeground();
! if (attenue)
! foreground= attenueCouleur(foreground);
! boolean rapide= isRapide();
!
! Icon icone= getIcone();
! if (attenue)
! icone= attenueIcone(icone);
!
! GrBoite bPoly;
! if (tl_ == null)
! tl_= new TraceLigne((Graphics2D)_g);
! else
! tl_.graphics((Graphics2D)_g);
!
! for (int i= 0; i < nombre; i++) {
! bPoly= modele_.getDomaineForPolygoneIdx(i);
! //Si la boite du polygone n'est pas dans la boite d'affichage on passe
! if (bPoly.intersectionXY(clip) == null)
! continue;
! int nbPoints= modele_.getNbPointForPolygoneIdx(i);
! if (nbPoints <= 0)
! continue;
! //QUESTION: a rajouter
! /* double z = 0.;
! if(domaine.e.z > domaine.o.z)
! z = (p.z - domaine.o.z) / (domaine.e.z - domaine.o.z);*/
! // p.autoApplique(versEcran);
! Color c= foreground;
! Icon s= icone;
! /*if(paletteCouleur != null)
! {
! c = paletteCouleur.couleur(z);
! if(attenue)
! c = attenueCouleur(c);
! }
! if(paletteIcone != null)
! {
! s = paletteIcone.icone(z);
! if(attenue)
! s = attenueIcone(s);
! } */
! if (c == null)
! return;
! _g.setColor(c);
! tl_.setCouleur(c);
! GrPoint ptOri= new GrPoint();
! modele_.point(ptOri, i, nbPoints-1);
! ptOri.autoApplique(versEcran);
! if (s != null)
! s.paintIcon(this, _g, (int)ptOri.x, (int)ptOri.y);
! GrPoint ptDest= new GrPoint();
! for (int j= 0; j < nbPoints; j++) {
! //le point de dest est initialise
! modele_.point(ptDest, i, j);
! ptDest.autoApplique(versEcran);
! if (s != null)
! s.paintIcon(this, _g, (int)ptDest.x, (int)ptDest.y);
! tl_.dessineTrait(ptOri.x, ptOri.y, ptDest.x, ptDest.y);
! ptOri.initialise(ptDest);
! // indexGlobal++;
! // tl_.dessineTexte(
! // DodicoLib.getString(indexGlobal),
! // (int)ptOri.x,
! // (int)ptOri.y);
! }
! }
!
! if ((!rapide) && (!isSelectionEmpty())) {
! if (tlSelection_ == null)
! tlSelection_= new TraceLigne((Graphics2D)_g);
! else
! tlSelection_.graphics((Graphics2D)_g);
! initIconeSelection();
! initCouleurSelection();
! Color cs= couleurSelection();
! Icon ic= iconeSelection();
! if (attenue) {
! cs= attenueCouleur(cs);
! ic= attenueIcone(ic);
! }
! _g.setColor(cs);
! tlSelection_.setCouleur(cs);
! //tlSelection_.setEpaisseur(2f);
! int nb= selection_.getMaxIndex();
! for (int i= nb; i >= 0; i--) {
! if (!selection_.isSelected(i))
! continue;
! bPoly= modele_.getDomaineForPolygoneIdx(i);
! //Si la boite du polygone n'est pas dans la boite d'affichage on passe
! if (bPoly.intersectionXY(clip) == null)
! continue;
! int nbPoints= modele_.getNbPointForPolygoneIdx(i);
! GrPoint ptOri= new GrPoint();
! modele_.point(ptOri, i, 0);
! ptOri.autoApplique(versEcran);
! GrPoint ptDest= new GrPoint();
! for (int j= nbPoints - 1; j >= 0; j--) {
! //le point de dest est initialise
! modele_.point(ptDest, i, j);
! ptDest.autoApplique(versEcran);
! ic.paintIcon(this, _g, (int)ptDest.x, (int)ptDest.y);
! tlSelection_.dessineTrait(ptOri.x, ptOri.y, ptDest.x, ptDest.y);
! ptOri.initialise(ptDest);
! }
! }
! /* if(!selection_.isSelectionPartielleVide())
! {
! int[] s=entitePartielleSelection();
! int nb=s.length-1;
! initIconeSelectionPartielle();
! initCouleurSelection();
! Color cs=couleurSelection();
! Icon ic=iconeSelectionPartielle();
! if(attenue)
! {
! cs=attenueCouleur(cs);
! ic=attenueIcone(ic);
! }
! _g.setColor(cs);
! int t;
! for(int i = nb; i >=0; i--)
! {
! t=s[i];
! modele_.polygone(p,t);
! if(clip.intersectXY(p.boite()))
! {
! int[] atomes=partielleSelection(t);
! int nbAtomes=atomes.length-1;
! GrPoint pt=new GrPoint();
! for(int j=nbAtomes;j>=0;j--)
! {
! p.sommets.renvoie(pt,atomes[j]);
! if(clip.contientXY(pt))
! {
! p.autoApplique(versEcran);
! ic.paintIcon(this, _g, (int)pt.x, (int)pt.y);
! }
! }
! }
! }
! } */
! }
! }
!
! public EbliListeSelection selection(
! GrPolygone _polySelection,
! boolean _partiel) {
! GrBoite boitePolySelection= _polySelection.boite();
! GrMorphisme versEcran= getVersEcran();
! GrBoite bClip= getDomaine();
! bClip.autoApplique(versEcran);
! if (!boitePolySelection.intersectXY(bClip))
! return null;
! int nb= modele().getNombre() - 1;
! bClip= getClipReel(getGraphics());
! // GrPolygone poly = new GrPolygone();
! EbliListeSelection r= creeSelection();
! if (_partiel) {
! /* for(int i=nb;i>=0;i--)
! {
! modele().polygone(poly,i);
! if(bClip.intersectXY(poly.boite()))
! {
! poly.autoApplique(versEcran);
! if(boitePolySelection.intersectXY(poly.boite()))
! {
! DefaultListSelectionModel l=GrPolygone.pointsSelectionnes(poly,_polySelection);
! if(l!=null)
! {
! if(EbliListeSelection.estTotal(l,poly.nombre()))
! r.add(i);
! else
! r.setSelectionPartielle(i,l);
! }
! }
! }
! } */
! } else {
!
! for (int i= nb; i >= 0; i--) {
! //modele().polygone(poly, i);
! if (bClip.contientXY(modele_.getDomaineForPolygoneIdx(i))) {
! int nbPoint= modele_.getNbPointForPolygoneIdx(i) - 1;
! GrPoint p= new GrPoint();
! boolean selected= true;
! for (int j= nbPoint;(j >= 0) && selected; j--) {
! modele_.point(p, i, j);
! p.autoApplique(versEcran);
! if ((!boitePolySelection.contient(p))
! || (!_polySelection.contientXY(p))) {
! selected= false;
! }
! }
! if (selected)
! r.add(i);
! }
! }
! }
! if (r.isEmpty())
! return null;
! else
! return r;
!
! }
!
! public EbliListeSelection selection(
! GrPoint _pt,
! int _tolerance,
! boolean _partiel) {
!
! GrMorphisme versEcran= getVersEcran();
! GrBoite bClip= getDomaine();
! bClip.autoApplique(versEcran);
! if ((!bClip.contientXY(_pt)) && (bClip.distanceXY(_pt) > _tolerance))
! return null;
! int nb= modele().getNombre() - 1;
! bClip= getClipReel(getGraphics());
! GrPolygone poly= new GrPolygone();
! GrPoint pt1= new GrPoint();
! GrPoint pt2= new GrPoint();
! poly.sommets.ajoute(pt1);
! poly.sommets.ajoute(pt2);
! if (_partiel) {
! /* GrPoint p=new GrPoint();
! for(int i=nb;i>=0;i--)
! {
! modele().polygone(poly,i);
! if(bClip.intersectXY(poly.boite()))
! {
! poly.autoApplique(versEcran);
! int nbPt=poly.sommets.nombre()-1;
! for(int j=nbPt;j>=0;j--)
! {
! poly.sommets.renvoie(p,j);
! if(GrPoint.estSelectionne(p, _tolerance, _pt))
! {
! EbliListeSelection r=creeSelection();
! r.setSelectionPartielle(i,j);
! return r;
! }
! }
! }
! } */
! } else {
! for (int i= nb; i >= 0; i--) {
! if (bClip.intersectXY(modele_.getDomaineForPolygoneIdx(i))) {
! int nbPt= modele_.getNbPointForPolygoneIdx(i) - 1;
! for (int j= nbPt; j >= 1; j--) {
! modele_.point(pt1, i, j);
! modele_.point(pt2, i, j - 1);
! poly.autoApplique(versEcran);
! if (GrPolygone.estSelectionne(poly, _tolerance, _pt)) {
! EbliListeSelection r= creeSelection();
! r.add(i);
! return r;
! }
! }
! }
! }
! }
! return null;
!
! }
}
|