|
From: <de...@us...> - 2003-12-11 12:41:55
|
Update of /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque
In directory sc8-pr-cvs1:/tmp/cvs-serv22991/calque
Modified Files:
BArbreCalque.java BCalqueAffichage.java
EbliAdapteurSuiviSouris.java ZCalqueAffichageDonnees.java
ZCalqueAffichageDonneesAbstract.java
ZCalqueAffichageDonneesInterface.java ZCalquePoint.java
ZEbliFilleCalques.java
Log Message:
Modification du paquetage graphe pour prendre en compte les modeles
Index: BArbreCalque.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BArbreCalque.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** BArbreCalque.java 25 Nov 2003 10:06:36 -0000 1.7
--- BArbreCalque.java 11 Dec 2003 12:41:51 -0000 1.8
***************
*** 372,375 ****
--- 372,376 ----
class ZBArbreNormalMenu extends BuDynamicMenu {
BArbreCalqueModel arbre_;
+ boolean noLayer_;
/**
* Constructeur.
***************
*** 385,390 ****
protected void build() {
BCalque c= arbre_.getSelectedCalque();
! setEnabled(c != null);
! if ((getMenuComponentCount() == 0) && (c != null)) {
arbre_.fillMenu(this);
}
--- 386,397 ----
protected void build() {
BCalque c= arbre_.getSelectedCalque();
! if((c==null) && (!noLayer_)){
! noLayer_=true;
! removeAll();
! addMenuItem(EbliResource.getS("Pas de calques sélectionnés"),"NO_LAYER", false);
! }
! if ((noLayer_ || (getMenuComponentCount() == 0)) && (c != null)) {
! removeAll();
! noLayer_=false;
arbre_.fillMenu(this);
}
Index: BCalqueAffichage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/BCalqueAffichage.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** BCalqueAffichage.java 25 Nov 2003 10:06:36 -0000 1.5
--- BCalqueAffichage.java 11 Dec 2003 12:41:51 -0000 1.6
***************
*** 9,12 ****
--- 9,13 ----
package org.fudaa.ebli.calque;
import org.fudaa.ebli.geometrie.*;
+ import org.fudaa.ebli.palette.BPaletteCouleur;
import org.fudaa.ebli.trace.*;
import com.memoire.bu.*;
***************
*** 37,40 ****
--- 38,45 ----
r.ajuste(q);
return r;
+ }
+
+ public BPaletteCouleur getPaletteCouleur(){
+ return null;
}
protected GrBoite getClipReel(Graphics _g) {
Index: EbliAdapteurSuiviSouris.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/EbliAdapteurSuiviSouris.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** EbliAdapteurSuiviSouris.java 25 Nov 2003 10:06:37 -0000 1.6
--- EbliAdapteurSuiviSouris.java 11 Dec 2003 12:41:51 -0000 1.7
***************
*** 57,61 ****
r.append(format_.format(c[i]));
else
! r.append((int)c[i]);
}
// System.out.println(c[0]+", "+c[1]);
--- 57,61 ----
r.append(format_.format(c[i]));
else
! r.append(c[i]);
}
// System.out.println(c[0]+", "+c[1]);
Index: ZCalqueAffichageDonnees.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonnees.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ZCalqueAffichageDonnees.java 25 Nov 2003 10:06:38 -0000 1.8
--- ZCalqueAffichageDonnees.java 11 Dec 2003 12:41:51 -0000 1.9
***************
*** 40,47 ****
}
public void clearSelection() {
! if ((selection_ != null) || (!selection_.isEmpty())) {
selection_.clear();
fireSelectionEvent();
}
}
public int[] getSelectedIndex() {
--- 40,56 ----
}
public void clearSelection() {
! if ((selection_ != null) && (!selection_.isEmpty())) {
selection_.clear();
fireSelectionEvent();
}
+ }
+
+ public void setSelection(int[] _idx){
+ if(selection_==null) selection_=creeSelection();
+ else selection_.clear();
+ for(int i=_idx.length-1;i>=0;i--){
+ selection_.add(_idx[i]);
+ }
+ fireSelectionEvent();
}
public int[] getSelectedIndex() {
Index: ZCalqueAffichageDonneesAbstract.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesAbstract.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ZCalqueAffichageDonneesAbstract.java 25 Nov 2003 10:06:38 -0000 1.2
--- ZCalqueAffichageDonneesAbstract.java 11 Dec 2003 12:41:51 -0000 1.3
***************
*** 158,160 ****
--- 158,168 ----
return paletteIcone_;
}
+ /**
+ *
+ */
+ public void setForeground(Color _v) {
+ super.setForeground(_v);
+ paletteCouleur_=null;
+ }
+
}
Index: ZCalqueAffichageDonneesInterface.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalqueAffichageDonneesInterface.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ZCalqueAffichageDonneesInterface.java 25 Nov 2003 10:06:38 -0000 1.3
--- ZCalqueAffichageDonneesInterface.java 11 Dec 2003 12:41:51 -0000 1.4
***************
*** 19,23 ****
public boolean changeSelection(GrPolygone _p, int _action);
public boolean isSelectionEmpty();
! public abstract ZModeleDonnees modeleDonnees();
public String getName();
}
--- 19,25 ----
public boolean changeSelection(GrPolygone _p, int _action);
public boolean isSelectionEmpty();
! public ZModeleDonnees modeleDonnees();
! public void addSelectionListener(ZSelectionListener _l) ;
! public void removeSelectionListener(ZSelectionListener _l);
public String getName();
}
Index: ZCalquePoint.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZCalquePoint.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ZCalquePoint.java 25 Nov 2003 10:06:38 -0000 1.9
--- ZCalquePoint.java 11 Dec 2003 12:41:51 -0000 1.10
***************
*** 123,127 ****
_g.setColor(cs);
int nb= selection_.getMaxIndex();
! for (int i= nb; i >= 0; i--) {
if (selection_.isSelected(i)) {
modele_.point(p, i);
--- 123,129 ----
_g.setColor(cs);
int nb= selection_.getMaxIndex();
! int max=modele_.getNombre();
! if(nb>=max) nb=max-1;
! for (int i= selection_.getMinIndex(); i <=nb; i++) {
if (selection_.isSelected(i)) {
modele_.point(p, i);
Index: ZEbliFilleCalques.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/ebli/src/org/fudaa/ebli/calque/ZEbliFilleCalques.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** ZEbliFilleCalques.java 25 Nov 2003 10:06:38 -0000 1.17
--- ZEbliFilleCalques.java 11 Dec 2003 12:41:51 -0000 1.18
***************
*** 19,22 ****
--- 19,23 ----
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+ import java.awt.event.KeyEvent;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
***************
*** 28,34 ****
--- 29,37 ----
import javax.swing.AbstractButton;
import javax.swing.Action;
+ import javax.swing.ActionMap;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.Icon;
+ import javax.swing.InputMap;
import javax.swing.JColorChooser;
import javax.swing.JComponent;
***************
*** 38,41 ****
--- 41,45 ----
import javax.swing.JTable;
import javax.swing.JViewport;
+ import javax.swing.KeyStroke;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.TableModelListener;
***************
*** 71,74 ****
--- 75,79 ----
import org.fudaa.ebli.impression.EbliPrinter;
import org.fudaa.ebli.palette.BSelecteurReduitFonte;
+ import org.fudaa.ebli.palette.BSelecteurReduitFonteNewVersion;
import org.fudaa.ebli.palette.BSelecteurReduitPaletteCouleur;
import org.fudaa.ebli.repere.BControleNavigation;
***************
*** 270,283 ****
setTitle(EbliResource.EBLI.getString("Calques"));
setFrameIcon(EbliResource.EBLI.getIcon("calque"));
! if (_groupSelection)
buildButtonGroupSelection();
! if (_groupNavigation)
buildButtonGroupNavigation();
! if (_groupStandard)
buildButtonGroupStandard();
pack();
modelArbre_.refresh();
}
/**
* Methode a utiliser pour ajouter un calque et pour mettre a jour
* le model de l'arbre.
--- 275,309 ----
setTitle(EbliResource.EBLI.getString("Calques"));
setFrameIcon(EbliResource.EBLI.getIcon("calque"));
! if (_groupSelection) {
buildButtonGroupSelection();
! }
! if (_groupNavigation) {
buildButtonGroupNavigation();
! }
! if (_groupStandard) {
buildButtonGroupStandard();
+ }
pack();
modelArbre_.refresh();
}
/**
+ * Update the InputMap,ActionMap for the action _ac.
+ */
+ private void updateMapKeyStroke(Action[] _ac) {
+ if (_ac != null) {
+ InputMap thisMap=
+ getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+ ActionMap m= getActionMap();
+ for (int i= _ac.length - 1; i >= 0; i--) {
+ KeyStroke k= (KeyStroke)_ac[i].getValue(Action.ACCELERATOR_KEY);
+ if (k != null) {
+ Object o= _ac[i].getValue(Action.ACTION_COMMAND_KEY);
+ thisMap.put(k, o);
+ m.put(o, _ac[i]);
+ }
+ }
+ }
+ }
+ /**
* Methode a utiliser pour ajouter un calque et pour mettre a jour
* le model de l'arbre.
***************
*** 402,407 ****
EbliResource.EBLI.getString("Couleur du tracé"),
fg);
! if ((cqActif_ != null) && (fg != null))
cqActif_.setForeground(fg);
}
};
--- 428,434 ----
EbliResource.EBLI.getString("Couleur du tracé"),
fg);
! if ((cqActif_ != null) && (fg != null)) {
cqActif_.setForeground(fg);
+ }
}
};
***************
*** 436,440 ****
l.add(action);
//FONT
! BSelecteurReduitFonte srcft= new BSelecteurReduitFonte();
srcft.addPropertyChangeListener(modelArbre_);
EbliPaletteAction plAction=
--- 463,468 ----
l.add(action);
//FONT
! BSelecteurReduitFonteNewVersion srcft=
! new BSelecteurReduitFonteNewVersion();
srcft.addPropertyChangeListener(modelArbre_);
EbliPaletteAction plAction=
***************
*** 443,447 ****
EbliResource.EBLI.getIcon("fonte"),
srcft,
! "CHOOSE_FOOT");
plAction.putValue(
Action.SHORT_DESCRIPTION,
--- 471,482 ----
EbliResource.EBLI.getIcon("fonte"),
srcft,
! "CHOOSE_FOOT") {
! public void updateBeforeShow() {
! BCalque cq= getCalqueActif();
! if (cq != null)
! ((BSelecteurReduitFonteNewVersion)getPaletteContent()).setSelectedFont(
! cq.getFont());
! }
! };
plAction.putValue(
Action.SHORT_DESCRIPTION,
***************
*** 456,460 ****
EbliResource.EBLI.getIcon("palettecouleur"),
srcpl,
! "CHOOSE_COLOR_PALET");
plAction.putValue(
Action.SHORT_DESCRIPTION,
--- 491,509 ----
EbliResource.EBLI.getIcon("palettecouleur"),
srcpl,
! "CHOOSE_COLOR_PALET") {
! public void updateBeforeShow() {
! BCalque cq= getCalqueActif();
! if (cq instanceof BCalqueAffichage) {
! (
! (BSelecteurReduitPaletteCouleur)getPaletteContent())
! .setSelectedPalette(
! ((BCalqueAffichage)cq).getPaletteCouleur());
! } else
! (
! (BSelecteurReduitPaletteCouleur)getPaletteContent())
! .setSelectedPalette(
! null);
! }
! };
plAction.putValue(
Action.SHORT_DESCRIPTION,
***************
*** 463,466 ****
--- 512,516 ----
standardActionGroup_= new EbliActionInterface[l.size()];
l.toArray(standardActionGroup_);
+ this.updateMapKeyStroke(standardActionGroup_);
}
/**
***************
*** 482,485 ****
--- 532,536 ----
Action.SHORT_DESCRIPTION,
EbliResource.EBLI.getString("Restaurer la vue globale"));
+ restore.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('r'));
int i= 0;
navigationActionGroup_[i++]= restore;
***************
*** 492,495 ****
--- 543,547 ----
cqDepVueI_);
navigationActionGroup_[i++]= action;
+ action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('m'));
//ZOOM ACTION
action=
***************
*** 502,505 ****
--- 554,558 ----
Action.SHORT_DESCRIPTION,
EbliResource.EBLI.getString("Zoom"));
+ action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('z'));
navigationActionGroup_[i++]= action;
//REFERENCE
***************
*** 530,533 ****
--- 583,587 ----
addVetoableChangeListener(plAction);
navigationActionGroup_[i++]= plAction;
+ updateMapKeyStroke(navigationActionGroup_);
}
/**
***************
*** 544,547 ****
--- 598,602 ----
"POINT_SELECTION",
ZCalqueSelectionInteraction.PONCTUEL);
+ action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('s'));
selectedActionGroup_[i++]= action;
action=
***************
*** 550,553 ****
--- 605,609 ----
"RECTANGLE_SELECTION",
ZCalqueSelectionInteraction.RECTANGLE);
+ action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('r'));
selectedActionGroup_[i++]= action;
action=
***************
*** 556,560 ****
--- 612,618 ----
"POLYGON_SELECTION",
ZCalqueSelectionInteraction.POLYGONE);
+ action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('p'));
selectedActionGroup_[i++]= action;
+ updateMapKeyStroke(selectedActionGroup_);
}
/**
***************
*** 583,591 ****
}
void setCalqueInteractionActif(BCalqueInteraction _b) {
- if (_b == null)
- System.err.println("layer interactif is null");
- if (EbliLib.DEBUG)
- System.out.println(
- "interactif layer " + (_b == null ? "null" : _b.getName()));
if (cqInteractionActif_ == _b) {
if (_b == cqSelectionI_)
--- 641,644 ----
***************
*** 612,616 ****
vc_.setDefaultCursor();
} else {
! System.err.println(getClass().getName() + " unknown layer " + _b);
}
}
--- 665,669 ----
vc_.setDefaultCursor();
} else {
! EbliLib.error(getClass().getName() + " unknown layer " + _b);
}
}
***************
*** 626,629 ****
--- 679,689 ----
}
}
+
+ /**
+ * Permet de changer le calque actif.
+ */
+ public final void setCalqueActif(BCalque c){
+ modelArbre_.setSelectionCalque(c);
+ }
/**
* @return ArbreCalque
***************
*** 661,665 ****
true)
.addActionListener(this);
! fillMenuWithToolsActions(_m);
}
protected JMenu buildLayerMenu() {
--- 721,727 ----
true)
.addActionListener(this);
! BuMenu m= new BuMenu(EbliResource.getS("Outils"), "TOOLS");
! fillMenuWithToolsActions(m);
! _m.add(m);
}
protected JMenu buildLayerMenu() {
***************
*** 798,801 ****
--- 860,864 ----
setCalqueInteractionActif(cqSelectionI_);
}
+
/** Methode pour vider la selection. */
public void clearSelections() {
|