|
From: <de...@us...> - 2003-08-19 07:44:24
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico
In directory sc8-pr-cvs1:/tmp/cvs-serv9684/dico
Modified Files:
DicoAnalyzer.java DicoCasFileFormat.java DicoManager.java
Log Message:
Maj des import
Index: DicoAnalyzer.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoAnalyzer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DicoAnalyzer.java 4 Jul 2003 12:08:47 -0000 1.2
--- DicoAnalyzer.java 19 Aug 2003 07:44:21 -0000 1.3
***************
*** 573,576 ****
--- 573,582 ----
}
+ /**
+ * Recupere a partir du nom de fichier dico <code>_s</code> le nom et la version
+ * du code correspondant. Il est suppose que la version est codee sur 4 caractere.
+ * Par exemple pour le fichier Telemac2dv2p5, la methode renvoie
+ * [telemac2d,v5p3] (nom en minuscule et version telle quelle).
+ */
public final static String[] getNameAndVersion(String _s,int _endIndex)
{
***************
*** 580,584 ****
String[] r=new String[2];
r[1]=_s.substring(_endIndex - versionLength, _endIndex - versionLength + 4);
! r[0] = _s.substring(0, _endIndex - versionLength);
return r;
}
--- 586,590 ----
String[] r=new String[2];
r[1]=_s.substring(_endIndex - versionLength, _endIndex - versionLength + 4);
! r[0] = _s.substring(0, _endIndex - versionLength).toLowerCase();
return r;
}
Index: DicoCasFileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoCasFileFormat.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DicoCasFileFormat.java 18 Aug 2003 11:05:19 -0000 1.2
--- DicoCasFileFormat.java 19 Aug 2003 07:44:21 -0000 1.3
***************
*** 10,13 ****
--- 10,14 ----
import java.io.File;
+ import java.util.Comparator;
import org.fudaa.dodico.commun.ProgressionInterface;
***************
*** 68,70 ****
--- 69,77 ----
}
+ public DicoCasFileFormatVersion getVersionImpl(
+ String _version,
+ int _language) {
+ return getDicoManager().createVersionImpl(this, _version, _language);
+ }
+
}
Index: DicoManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DicoManager.java 18 Aug 2003 11:05:19 -0000 1.2
--- DicoManager.java 19 Aug 2003 07:44:21 -0000 1.3
***************
*** 13,20 ****
--- 13,24 ----
import java.io.FileFilter;
import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+ import java.util.Set;
+ import java.util.TreeMap;
import javax.swing.AbstractListModel;
***************
*** 27,30 ****
--- 31,35 ----
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
+ import org.fudaa.dodico.fichiers.FileFormat;
/**
***************
*** 36,40 ****
String packageName_;
Map formatVersions_;
! DodicoPermanentList formats_;
protected DicoManager(String _packageName) {
--- 41,45 ----
String packageName_;
Map formatVersions_;
! public DodicoPermanentList formats_;
protected DicoManager(String _packageName) {
***************
*** 43,136 ****
public void init(Map _init) {
! formatVersions_= new HashMap(_init);
formats_= new DodicoPermanentList(formatVersions_.keySet());
}
- public ComboBoxModel createDicoDescComboBoxModel() {
- return new FormatComboBoxModel();
- }
-
- public class FormatComboBoxModel
- extends AbstractListModel
- implements ComboBoxModel {
-
- Object selected_;
-
- public FormatComboBoxModel() {
- selected_= formats_.get(0);
- }
-
- /**
- *
- */
- public Object getSelectedItem() {
- return selected_;
- }
-
- /**
- *
- */
- public void setSelectedItem(Object anItem) {
- if (((anItem != null)
- && (!anItem.equals(selected_))
- || ((anItem == null) && selected_ != null))) {
- selected_= anItem;
- fireContentsChanged(this, -1, -1);
- }
-
- }
-
- /**
- * Renvoie un objet du type DicoFileFormat
- */
- public Object getElementAt(int arg0) {
- return formats_.get(arg0);
- }
-
- /**
- *
- */
- public int getSize() {
- return formats_.size();
- }
-
- }
-
- private class DicoDescCellRenderer extends DefaultListCellRenderer {
-
- /**
- *
- */
- public Component getListCellRendererComponent(
- JList list,
- Object value,
- int index,
- boolean isSelected,
- boolean cellHasFocus) {
- setComponentOrientation(list.getComponentOrientation());
- if (isSelected) {
- setBackground(list.getSelectionBackground());
- setForeground(list.getSelectionForeground());
- } else {
- setBackground(list.getBackground());
- setForeground(list.getForeground());
- }
- setEnabled(list.isEnabled());
- setFont(list.getFont());
- setBorder(
- (cellHasFocus)
- ? UIManager.getBorder("List.focusCellHighlightBorder")
- : noFocusBorder);
- DicoCasFileFormatVersion d= (DicoCasFileFormatVersion)value;
- setText(d.getFormatName() + " " + d.getVersionName());
- return this;
- }
-
- }
-
- public ListCellRenderer getDicoDescCellRenderer() {
- return new DicoDescCellRenderer();
- }
-
public DicoCasFileFormat getFileFormat(String _nom) {
for (Iterator it= formats_.iterator(); it.hasNext();) {
--- 48,56 ----
public void init(Map _init) {
! formatVersions_= new TreeMap(new FileFormat.FileFormatNameComparator());
! formatVersions_.putAll(_init);
formats_= new DodicoPermanentList(formatVersions_.keySet());
}
public DicoCasFileFormat getFileFormat(String _nom) {
for (Iterator it= formats_.iterator(); it.hasNext();) {
***************
*** 142,146 ****
}
! private DicoModelAbstract createDico(
String _name,
String _version,
--- 62,66 ----
}
! protected DicoModelAbstract createDico(
String _name,
String _version,
***************
*** 216,228 ****
if (format == null) {
formatAjoute= true;
! formatVersions_.put(
! createFormat(formatName),
! DodicoLib.enTableau((List)formatNameList.get(formatName)));
} else {
! formatVersions_.put(
! format,
DodicoLib.mergeAndSort(
getVersions(format),
! ((List)formatNameList.get(formatName))));
}
--- 136,150 ----
if (format == null) {
formatAjoute= true;
! String[] version=
! DodicoLib.enTableau((List)formatNameList.get(formatName));
! Arrays.sort(version);
! formatVersions_.put(createFormat(formatName), version);
} else {
! String[] version=
DodicoLib.mergeAndSort(
getVersions(format),
! ((List)formatNameList.get(formatName)));
! Arrays.sort(version);
! formatVersions_.put(format, version);
}
|