Revision 8

SRC/src/fr/triangle/hyperalign/kernel/DataManager.java (revision 8)
3422 3422
		private ParallelTextElement findTextElement(String localisation, ParallelTextElement root){
3423 3423

  
3424 3424
			String stringOfElement = root.computeName();
3425
			System.out.println("TextManager.findTextElement() = ROOT name ["+stringOfElement+"] // loc ["+localisation+"]");
3425
			//System.out.println("TextManager.findTextElement() = ROOT name ["+stringOfElement+"] // loc ["+localisation+"]");
3426 3426
			stringOfElement = stringOfElement.trim();
3427 3427
			boolean find = false;
3428 3428
			ParallelTextElement findElement = null;
SRC/src/fr/triangle/hyperalign/gui/DesktopPane.java (revision 8)
1 1
package fr.triangle.hyperalign.gui;
2 2

  
3
import java.awt.BorderLayout;
4 3
import java.net.URL;
5 4
import java.util.Observable;
6 5
import java.util.Observer;
7 6
import java.util.ResourceBundle;
8 7

  
9 8
import javax.swing.JPanel;
10
import javax.swing.JSplitPane;
11 9
import javax.swing.JTabbedPane;
12
import javax.swing.JTextField;
13 10

  
14 11
import fr.triangle.hyperalign.gui.annot.AnnotEquiPane;
15 12
import fr.triangle.hyperalign.gui.concord.ResultPane;
......
20 17
import fr.triangle.hyperalign.gui.search.DoublSearchPane;
21 18
import fr.triangle.hyperalign.gui.search.SimpleSearchPane;
22 19
import fr.triangle.hyperalign.gui.text.AlignTextPane;
23
import fr.triangle.hyperalign.gui.text.InfoTextPane;
20
import fr.triangle.hyperalign.gui.text.VocabularyPane;
24 21
import fr.triangle.hyperalign.kernel.DataManager.EquivalenceManager;
25 22
import fr.triangle.hyperalign.kernel.DataManager.NeighbourManager;
26 23
import fr.triangle.hyperalign.kernel.HyperalignData;
27 24
import fr.triangle.hyperalign.kernel.cooc.NeighbourElement;
25
import fr.triangle.hyperalign.kernel.dico.Dictionary;
28 26

  
29 27

  
30
public class DesktopPane extends JPanel implements Observer {
28
public class DesktopPane extends JTabbedPane implements Observer {
31 29

  
32
	private JTabbedPane tabbedPane;
33
	private JTextField statusField;
34 30
	private ResourceBundle res;
35 31

  
36 32
	private ResultPane resultPane;
37
	//private NeighbourTreePane coocPane;
38 33
	private CooccurrencePane coocPane;
39
	//private NotePane notePane;
40 34
	private AlignTextPane newTextPane;
41
	private CorpusConfigPane corpusConfigPane;
42 35
	private AnnotEquiPane equivalencePane;
43 36
	private SimpleSearchPane searchPane;
44 37
	private DoublSearchPane doubleSearchPane;
45
	private InfoTextPane infoPane;
38
	private CorpusConfigPane infoPane;
46 39
	private EquivalenceGraph graphPane;
47
	private NeighbourGraph neighbourGraphPane;
40
	private VocabularyPane vocabPane;
41
	//private NeighbourGraph neighbourGraphPane;
48 42
	
49
	private JSplitPane splitVerticalPane;
43
	//private JSplitPane splitVerticalPane;
50 44
	private HMManager manager;
51 45
	
52 46
	public DesktopPane(HMManager manager) {
53 47
		this.res = HyperalignData.getInstance().getResourceBundle();
54 48
		this.manager = manager;
55 49
		HyperalignData.getInstance().addObserver(this);
56
		initGui();
57 50
	}
58 51

  
59
	private void initGui(){
60
		this.setLayout(new BorderLayout());
61
		tabbedPane = new JTabbedPane();
62
		this.add(tabbedPane, BorderLayout.CENTER);
63
	}
52
	
64 53

  
65 54
	/**
66 55
	 * 
......
68 57
	 * @param component
69 58
	 */
70 59
	private void reinit(String tabMessage, JPanel component){
71
		tabbedPane.addTab(tabMessage, component);
72
		tabbedPane.setSelectedIndex(tabbedPane.indexOfComponent(component));
73
		tabbedPane.requestFocus();
74
		splitVerticalPane.setDividerLocation(splitVerticalPane.getDividerLocation());
60
		/*splitVerticalPane.setDividerLocation(splitVerticalPane.getDividerLocation());*/
61
		this.addTab(tabMessage, component);
62
		this.setSelectedIndex(this.indexOfComponent(component));
63
		this.requestFocus();
75 64
	}
76 65

  
77
	public void setSplitPane(JSplitPane splitPane){
66
	/*public void setSplitPane(JSplitPane splitPane){
78 67
		this.splitVerticalPane = splitPane;
79
	}
68
	}*/
80 69

  
81 70

  
82 71
	//////////////RESULT PANE ////////////////
......
104 93
	}
105 94
	////////////////////////////////////////////
106 95

  
96
	//////////////VOCABULARY PANE ////////////////
97
	public VocabularyPane getVocabularyPane() {
98
		return vocabPane;
99
	}
107 100

  
101
	/**
102
	 * Method to reinitialize the tab corresponding to result table (when searching information)
103
	 */
104
	protected void reinitVocabularyPane(){
105
		Dictionary dico = manager.getDataManager().getDictionaryManager().getCurrentDictionary();
106
		//INIT
107
		if(vocabPane==null){
108
			vocabPane =  new VocabularyPane(manager, dico);
109
		}
110
		//REINIT
111
		else {
112
			vocabPane.reinit(dico);
113
		}
114
		reinit(res.getString("I18N_DESKTOPPANE_VOCAB_TABTITLE"), vocabPane);
115
	}
116
	////////////////////////////////////////////
108 117

  
118
	
109 119
	//////////////EQUIVALENCE PANE ////////////////
110 120
	public AnnotEquiPane getEquivalencePane(){
111 121
		return equivalencePane;
......
234 244
			else {
235 245
				searchPane.reinit(!isToSearchWithDoubleEntry, isToSearchWithDoubleEntry, isToSearchWithTerminoEntry);
236 246
			}
237
			tabbedPane.addTab(res.getString("I18N_DESKTOPPANE_SEARCH_TABTITLE"), searchPane);
238
			tabbedPane.setSelectedIndex(tabbedPane.indexOfComponent(searchPane));
247
			this.addTab(res.getString("I18N_DESKTOPPANE_SEARCH_TABTITLE"), searchPane);
248
			this.setSelectedIndex(this.indexOfComponent(searchPane));
239 249
		}
240 250
		else {
241 251
			//INIT
......
246 256
			else {
247 257
				doubleSearchPane.reinit(isToSearchWithTerminoEntry);
248 258
			}
249
			tabbedPane.addTab(res.getString("I18N_DESKTOPPANE_BILINGUALSEARCH_TABTITLE"), doubleSearchPane);
250
			tabbedPane.setSelectedIndex(tabbedPane.indexOfComponent(doubleSearchPane));
259
			this.addTab(res.getString("I18N_DESKTOPPANE_BILINGUALSEARCH_TABTITLE"), doubleSearchPane);
260
			this.setSelectedIndex(this.indexOfComponent(doubleSearchPane));
251 261
		}
252 262

  
253
		tabbedPane.requestFocus();
254
		splitVerticalPane.setDividerLocation(splitVerticalPane.getDividerLocation());
263
		/*splitVerticalPane.setDividerLocation(splitVerticalPane.getDividerLocation());*/
264
		this.requestFocus();
255 265
	}
256 266

  
257 267

  
......
259 269

  
260 270

  
261 271
	//////////////INFO PANE ////////////////
262
	public InfoTextPane getInfoPane() {
272
	/*public InfoTextPane getInfoPane() {
263 273
		return infoPane;
274
	}*/
275
	public CorpusConfigPane getInfoPane() {
276
		return infoPane;
264 277
	}
265 278

  
266 279

  
......
271 284
	protected void reinitInfoTextPane(boolean toShow){
272 285
		//INIT
273 286
		if(infoPane==null){ 
274
			infoPane = new InfoTextPane(manager);
275
			splitVerticalPane.setDividerLocation(200);
287
			infoPane = new CorpusConfigPane(manager);
288
			//splitVerticalPane.setDividerLocation(200);
276 289
		}
277 290
		//REINIT
278 291
		else { 
279 292
			infoPane.initGui(true);
280 293
		}
281 294
		////////////// ADD TO TAB ////////////
282
		String titleTabName = res.getString("I18N_DESKTOPPANE_VOCAB_TABTITLE");
283
		if(!manager.getInitParams(HMManager.SHOWDICOINFO_INIT)){
284
			titleTabName = res.getString("I18N_DESKTOPPANE_CORPUSCONFIG_TABTITLE");
285
		}
286

  
287
		tabbedPane.addTab(titleTabName, infoPane);
288
		//This tab has to be put forward
295
		this.addTab(res.getString("I18N_DESKTOPPANE_CORPUSCONFIG_TABTITLE"), infoPane);
289 296
		if(toShow){
290
			tabbedPane.setSelectedIndex(tabbedPane.indexOfComponent(infoPane));
291
			tabbedPane.requestFocus();
297
			//This tab has to be put forward
298
			this.setSelectedIndex(this.indexOfComponent(infoPane));
299
			this.requestFocus();
292 300
		}
293 301
	}
294 302

  
SRC/src/fr/triangle/hyperalign/gui/search/SearchTextSelectionPane.java (revision 8)
23 23
import javax.swing.JPanel;
24 24

  
25 25
import fr.triangle.hyperalign.gui.HMManager;
26
import fr.triangle.hyperalign.gui.Hypermachiavel;
27
import fr.triangle.hyperalign.gui.concord.ResultPane;
28
import fr.triangle.hyperalign.gui.text.InfoTextPane;
29 26
import fr.triangle.hyperalign.gui.text.VocabularyPane;
30 27
import fr.triangle.hyperalign.kernel.HyperalignData;
31 28
import fr.triangle.hyperalign.kernel.corpus.text.HyperalignText;
32 29
import fr.triangle.hyperalign.kernel.dico.Dictionary;
33 30
import fr.triangle.hyperalign.kernel.dico.DictionaryElement;
34
import fr.triangle.hyperalign.kernel.termino.TerminologyElement;
35 31

  
36 32
public class SearchTextSelectionPane extends JDialog implements ActionListener, ItemListener, PropertyChangeListener, Observer{
37 33
		/**
SRC/src/fr/triangle/hyperalign/gui/HMManager.java (revision 8)
160 160
	 * This static value corresponds to the tag for 
161 161
	 */
162 162
	public final static String SHOWTERMINOINFO_INIT = "showterminoinfo";
163

  
164 163
	public final static String SHOWDICOINFO_INIT = "showdicoinfo";
165 164

  
166 165
	private HashMap<String, Boolean> params;
......
722 721
	}
723 722

  
724 723
	public void openCorpus(boolean newCorpus){
725
		System.out.println("HMManager.openCorpus() - IS NEW ? "+newCorpus);
724
		//System.out.println("HMManager.openCorpus() - IS NEW ? "+newCorpus);
726 725
		setInitParams(HMManager.NEWCORPUS_INIT, newCorpus);
727 726
		mainFrame.reinitCenterPane(Hypermachiavel.INFORMATION_TAB, true);
728 727
	}
......
2056 2055
		}else if(type.equals(Dictionary.DICO)){
2057 2056
			Dictionary dicoData = (Dictionary) modelData;
2058 2057
			showInfoDictionary(true, dicoData);
2058
			mainFrame.reinitCenterPane(Hypermachiavel.VOCAB_TAB, true); //0
2059 2059
		}else {
2060 2060
			showInfoTerminology(false, null);
2061
			mainFrame.reinitCenterPane(Hypermachiavel.INFORMATION_TAB, true); //0
2061 2062
		}
2062
		mainFrame.reinitCenterPane(Hypermachiavel.INFORMATION_TAB, true); //0
2063
		
2063 2064
	}
2064 2065

  
2065 2066
	/**
2066
	 * Method that proceeds to show information about the terminology entry
2067
	 * @param element is the Terminology entry for which we will show information
2067
	 * Method that proceeds to show information about an entry
2068
	 * @param element is the entry for which we will show information
2068 2069
	 */
2069 2070
	public void showEntryInfo(TreeElement element){
2070 2071
		System.out.println("HMManager.showEntryInfo() "+element);
......
2121 2122
		setInitParams(HMManager.SHOWDICOINFO_INIT, showTerminoMetadata);
2122 2123
	}
2123 2124

  
2125
	
2124 2126
	public void showWarningMessage(String message){
2125 2127
		mainFrame.showWarningPane(message, res.getString("I18N_HYPERMACHIAVEL_WARNING_MESSAGE_TITLE"), JOptionPane.INFORMATION_MESSAGE);
2126 2128
	}
SRC/src/fr/triangle/hyperalign/gui/Hypermachiavel.java (revision 8)
68 68
	public final static int SEARCH_TAB = 4;
69 69
	public final static int EQUIGRAPH_TAB = 5;
70 70
	public final static int COOCGRAPH_TAB = 6;
71
	public final static int VOCAB_TAB = 7;
71 72
	
72 73
	private ResourceBundle res;
73 74

  
......
157 158
			splitVerticalPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, indexingPane, splitHorizontalPane);
158 159
			splitVerticalPane.setOneTouchExpandable(true);
159 160
			splitVerticalPane.setDividerLocation(300);
160
			desktopPane.setSplitPane(splitVerticalPane);
161
			//desktopPane.setSplitPane(splitVerticalPane);
161 162

  
162 163
			//Provide minimum sizes for the two components in the split pane
163 164
			Dimension minimumSize = new Dimension(100, 50);
......
181 182
			splitVerticalPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, indexingPane, splitHorizontalPane);
182 183
			splitVerticalPane.setOneTouchExpandable(true);
183 184
			splitVerticalPane.setDividerLocation(300);
184
			desktopPane.setSplitPane(splitVerticalPane);
185
			//desktopPane.setSplitPane(splitVerticalPane);
185 186
			this.add(splitVerticalPane,BorderLayout.CENTER);
186 187
			splitVerticalPane.repaint();
187 188
			splitHorizontalPane.repaint();
......
272 273
		case  Hypermachiavel.COOCGRAPH_TAB : //REINIT [COOCPANE]
273 274
			desktopPane.reinitCoocPane();
274 275
			break;
276
		case  Hypermachiavel.VOCAB_TAB : //REINIT [COOCPANE]
277
			desktopPane.reinitVocabularyPane();
278
			break;
275 279
			/*case 9 : //REINIT [GRAPH-PANE]
276 280
			desktopPane.reinitNeighbourGraphPane(manager.getCurrentNeighbourGraphUrl());
277 281
			break; */
SRC/src/fr/triangle/hyperalign/gui/text/InfoTextPane.java (revision 8)
1
package fr.triangle.hyperalign.gui.text;
2

  
3
import java.awt.BorderLayout;
4
import java.awt.GridLayout;
5
import java.util.Observable;
6
import java.util.Observer;
7
import java.util.ResourceBundle;
8

  
9
import javax.swing.JPanel;
10

  
11
import fr.triangle.hyperalign.gui.HMManager;
12
import fr.triangle.hyperalign.gui.config.CorpusConfigPane;
13
import fr.triangle.hyperalign.kernel.HyperalignData;
14
import fr.triangle.hyperalign.kernel.corpus.ParallelCorpus;
15
import fr.triangle.hyperalign.kernel.dico.Dictionary;
16
import fr.triangle.hyperalign.kernel.termino.Terminology;
17

  
18
public class InfoTextPane extends JPanel implements Observer {
19
	
20
	private static final long serialVersionUID = 1L;
21
	GridLayout layout = new GridLayout();
22
	private ResourceBundle res;
23
	private HMManager manager;
24
	
25
	public InfoTextPane(HMManager manager){
26
		this.res = HyperalignData.getInstance().getResourceBundle();
27
		HyperalignData.getInstance().addObserver(this);
28
		this.manager = manager;
29
		initGui(false);
30
	}
31
	
32
	public void initGui(boolean reinit){
33
		if(reinit){
34
			this.removeAll();
35
		}
36
		if(manager.getInitParams(HMManager.SHOWDICOINFO_INIT)){
37
			Dictionary dico = null;
38
			if(manager.getDataManager()!=null){
39
				dico = manager.getDataManager().getDictionaryManager().getCurrentDictionary();
40
			}
41
			VocabularyPane vocPane = new VocabularyPane(manager, dico);
42
			//TITRE => res.getString("I18N_INFOTEXTPANE_VOCABULARY_TITLE")
43
			this.add(vocPane, BorderLayout.CENTER);
44
		}
45
		else {
46
			CorpusConfigPane infoPane = new CorpusConfigPane(manager);
47
			this.add(infoPane, BorderLayout.CENTER);
48
		}
49
		if(reinit){
50
			this.repaint();
51
			this.validate();
52
		}
53
	}
54
	
55
	
56
	
57
	public void update(Observable observable, Object obj) {
58
		// TODO Auto-generated method stub
59
		Integer changeType = (Integer) obj;
60
		if(changeType.intValue() == HyperalignData.LOCALE_CHANGE) {
61
			this.res = HyperalignData.getInstance().getResourceBundle();
62
			this.updateLabelsI18N();
63
		}
64
	}
65
		
66
	private void updateLabelsI18N() {
67
		// TODO Auto-generated method stub
68
		this.res = HyperalignData.getInstance().getResourceBundle();
69
	}
70
	
71
}
SRC/src/fr/triangle/hyperalign/gui/text/VocabularyPane.java (revision 8)
62 62

  
63 63
	private static final long serialVersionUID = 1L;
64 64
	private String iconPath = "fr/triangle/hyperalign/gui/icons";
65
	private HashMap<HyperalignText, JButton> detailTextButtons ;
65
	//private HashMap<HyperalignText, JButton> detailTextButtons ;
66 66

  
67
	private String textFilter = "";
67 68
	private ResourceBundle res;
68 69
	private String letterAll ;
69 70
	private String newLetter;
......
107 108
		this.dicoManager = manager.getDataManager().getDictionaryManager();
108 109
		letterAll = res.getString("I18N_VOCABULARYPANE_LETTERALL");
109 110
		newLetter = letterAll;
110
		initGui(true, "");
111
		initGui(/*true,*/);
111 112
	}
112 113

  
113
	private void initGui(boolean reinitOccs, String textFilter){
114
	private void initGui(/*boolean reinitOccs,*/){
114 115
		if(dico!=null){
115
			initDicoTable(reinitOccs, textFilter);
116
			initDicoTable(/*reinitOccs,*/);
116 117
		}
117 118
	}
118 119

  
119
	public void reinitDico(Dictionary dico, boolean reinitOccs, String textFilter){
120
	public void reinit(Dictionary dico /*boolean reinitOccs, */){
120 121
		this.dico = dico;
121 122
		this.removeAll();
122
		initGui(reinitOccs, textFilter);
123
		initGui(/*reinitOccs,*/);
123 124
		this.repaint();
124 125
		this.validate();
125 126
	}
126 127

  
127 128

  
128
	private void initDicoTable(boolean reinitOccs, String textFilter){
129
		if(reinitOccs){
129
	private void initDicoTable(/*boolean reinitOccs, */){
130
		//if(reinitOccs){
130 131
			terminoOccs = dico.getVocabularyInAlphabeticalOrder();
131 132

  
132 133
			if(terminoOccs!=null){
......
208 209
			this.add(functionsPanel, BorderLayout.PAGE_START);
209 210
			this.add(scrollOcc, BorderLayout.CENTER);
210 211
			//this.add(vocabularyPane, BorderLayout.PAGE_END);
211
		}else {
212
		/*}else {
212 213
			//no occs, since no corpus text
213 214
			JLabel label = new JLabel(res.getString("I18N_VOCABULARYPANE_NOOCC_LABEL"));
214 215
			this.add(label);
215 216
			//paneToReturn.add(label);
216
		}
217
		}*/
217 218
		//return paneToReturn;
218 219
	}
219 220

  
220 221

  
221 222

  
222
	public void reinitTable(boolean reinitOccs, String textFilter){
223
	public void reinitTable(/*boolean reinitOccs,*/){
223 224
		System.out.println("VocabularyPane.reinitTable() - with FILTER ? "+textFilter);
224 225
		this.removeAll();
225
		initGui(reinitOccs, textFilter);
226
		initGui(/*reinitOccs,*/);
226 227
		this.repaint();
227 228
		this.validate();
228 229
	}
......
422 423
		quickSearchField.addKeyListener(new KeyAdapter() {
423 424
			public void keyPressed(KeyEvent e) {
424 425
				if (e.getKeyCode()==KeyEvent.VK_ENTER) {
425
					String text = quickSearchField.getText();
426
					System.out.println("====== KEY PRESSED is ENTER with text "+text);
427
					reinitTable(true, text);
426
					textFilter = quickSearchField.getText();
427
					System.out.println("====== KEY PRESSED is ENTER with text "+textFilter);
428
					reinitTable(/*true,*/);
428 429
				}
429 430
			}
430 431
		});
......
947 948
			}
948 949
		}
949 950

  
950
		if(detailTextButtons!=null){
951
		/*if(detailTextButtons!=null){
951 952
			Set keys = detailTextButtons.keySet();
952 953
			Iterator<HyperalignText> it = keys.iterator();
953 954
			while(it.hasNext()){
......
959 960
					manager.showMetadataInfo(null, "text");
960 961
				}
961 962
			}
962
		}
963
		}*/
963 964
	}
964 965

  
965 966
	@Override
SRC/src/fr/triangle/hyperalign/gui/text/CenterPane.java (revision 8)
40 40
	private ResourceBundle res;
41 41
	private HashMap<HyperalignText, CenterTextPane> textPanels; //CenterTextPane
42 42
	private boolean isHorizontalDisplay ;
43
	private JPanel panels;
44 43
	private boolean corpusInit = false;
45 44
	private HMManager manager;
46 45

  
......
52 51
	}
53 52

  
54 53
	public void initGui(boolean reinit){
55
		//this.setPreferredSize(new Dimension(1200,500));//1000,300
56 54
		this.corpusInit = manager.getInitParams(HMManager.CORPUS_INIT);
57 55
		this.isHorizontalDisplay = manager.getInitParams(HMManager.VERTICALDISPLAY_INIT);
58
		if(reinit){
59
			//navigationPanel.initGui(reinit);
60
			this.remove(panels);
61
			initTextInDisplay(isHorizontalDisplay, reinit);
62 56

  
63
			this.add(panels);
64
		}else {
65
			//NAVIGATION PANEL
66
			//navigationPanel = new TextNavigationPane(manager);
67
			//this.add(navigationPanel, BorderLayout.NORTH);
68

  
69
			//TEXT PANELS			
70
			initTextInDisplay(isHorizontalDisplay, reinit);
71
			this.add(panels);
72
			//if(reinit){
73
			panels.repaint();
74
			panels.validate();
75
			//}
57
		initTextInDisplay(isHorizontalDisplay, reinit);
58
		if(!reinit){
59
			this.repaint();
60
			this.revalidate();
76 61
		}
77 62
		updateLabelsI18N();
78 63
		this.setVisible(true);
......
80 65

  
81 66
	private void initTextInDisplay(boolean isHorizontalDisplay, boolean reinit){
82 67
		if(reinit){
83
			panels.removeAll();
84
		}else {
85
			panels = new JPanel();
68
			this.removeAll();
86 69
		}
87 70
		HashMap<HyperalignText, Division> contents = null;
88 71
		ParallelTextElement currentDivision = manager.getCurrentData().getCurrentParallelElement();
......
102 85
	 * To change the text menu with a different flag (green = no edition, red = no annotation)
103 86
	 */
104 87
	public void reinitAll(){
105
		Component[] components = panels.getComponents();
88
		Component[] components = this.getComponents();
106 89
		for(int i = 0 ; i < components.length ; ++i){
107
			Component component = panels.getComponent(i);
90
			Component component = this.getComponent(i);
108 91
			CenterTextPane textPane = (CenterTextPane) component;
109 92
			textPane.setTextEditable(manager.getInitParams(HMManager.EDITIONSTATE_INIT));
110 93
			textPane.repaint();
......
115 98
	private void initPanels(boolean reinit){
116 99
		int nbTextsInCorpus = manager.getNbParallelTexts();
117 100
		int nbTextsInDisplay = manager.getNbParallelTextsInDisplay();
118
		//System.out.println("IS HORIZONTAL Display ? "+isHorizontalDisplay);
119 101
		if(nbTextsInDisplay>1){
120 102
			if(isHorizontalDisplay){
121
				//System.out.println("SET LAYOUT ? "+nbTextsInDisplay+","+1);
122
				panels.setLayout(new GridLayout(nbTextsInDisplay,1));
103
				this.setLayout(new GridLayout(nbTextsInDisplay,1));
123 104
			}else {
124
				//System.out.println("SET LAYOUT ? "+1+","+nbTextsInDisplay);
125
				panels.setLayout(new GridLayout(1,nbTextsInDisplay));
105
				this.setLayout(new GridLayout(1,nbTextsInDisplay));
126 106
			}
127 107
		}
128 108
		//System.out.println("-> NB Texts in display = "+nbTextsInDisplay+
......
141 121
					textPanels.put(text, textPanel);
142 122
					//System.out.println("INIT PANEL ["+j+"]--------------------------------PUT "+text.getId());
143 123
					if(j<=nbTextsInDisplay){
144
						panels.add(textPanel);
124
						this.add(textPanel);
145 125
						//System.out.println("addToPanels ["+text.getXmlId()+"]");
146 126
					}
147 127
				}	
148 128
			}else {
149 129
				//REINIT PANELS
150
				Component[] components = panels.getComponents();
130
				Component[] components = this.getComponents();
151 131
				for(int i = 0 ; i < nbTextsInDisplay; ++i){					
152 132
					HyperalignText text = manager.getTextFromDisplayOrder(i+"");
153 133
					//System.out.println("addToPanels ["+text.getXmlId()+"] @ "+i);
154 134
					CenterTextPane newTextPane = new CenterTextPane(this,manager, text);
155 135
					textPanels.put(text, newTextPane);
156
					panels.add(newTextPane,i);
136
					this.add(newTextPane,i);
157 137
				}
158
				//System.out.println("REINIT with "+panels.getComponentCount()+" PANELS");
138
				//System.out.println("REINIT with "+this.getComponentCount()+" PANELS");
159 139
			}
160 140
		}		
161 141
	}
162 142

  
163
	private void addToPanels(int nbTextsToDisplay){
164
		Component[] components = panels.getComponents();
165
		//System.out.println("addToPanels [from "+components.length+" to "+nbTextsToDisplay+"]");
166 143

  
167
		for(int i = components.length ; i < nbTextsToDisplay; ++i){
168
			HyperalignText text = manager.getTextFromDisplayOrder(i+"");
169
			CenterTextPane newTextPane = null;
170
			if(text==null){
171
				System.out.println("CenterPane.addToPanels() => PROBLEM to find text with display order "+i);
172
			}
173
			else {
174
				newTextPane = textPanels.get(text);
175
				if(newTextPane!=null){
176
					newTextPane.reinit();
177
				}else {
178
					newTextPane = new CenterTextPane(this, manager, text);
179
					textPanels.put(text, newTextPane);
180
				}
181
				//System.out.println("CenterPane.addToPanels() T "+text.getOrderInCorpus()+" in corpus @ "+i);
182
				panels.add(newTextPane,i);
183
			}
184

  
185
		}
186
	}
187

  
188
	private void removeFromPanels(int nbTextsToDisplay){
189
		Component[] components = panels.getComponents();
190
		System.out.println("removeFromPanels [from "+components.length+" to "+nbTextsToDisplay+"]");
191

  
192
		for(int i = 0 ; i < components.length ; ++i){
193

  
194
			Component component = panels.getComponent(i);
195
			//System.out.println("Comp["+i+"] = "+textPane.getTitle());
196

  
197
			if(i<nbTextsToDisplay){
198
				HyperalignText text  = manager.getTextFromDisplayOrder(i+"");
199
				CenterTextPane newTextPane = null;
200
				if(text==null){
201
					System.out.println("CenterPane.removeFromPanels() => PROBLEM to find text with display order "+i);
202
				}
203
				else {
204
					newTextPane = textPanels.get(text);
205
					newTextPane.reinit();
206
				}
207

  
208
			}else {
209
				System.out.println("CenterPane.removeFromPanels() AT "+i);
210
				panels.remove(component);
211
				components = panels.getComponents();
212
				--i;
213
			}
214
		}
215
	}
216

  
217

  
218 144
	/**
219 145
	 * Method called whenever we must advance or go back a division for instance
220 146
	 * @param divisionToDisplay
......
233 159
				Collections.sort(mpKeys);
234 160

  
235 161
				for(int i = 0; i < mpKeys.size(); ++i){
236
					if(i < panels.getComponentCount()){ //textPanels.size();
162
					if(i < this.getComponentCount()){ 
237 163
						String displayOrder = mpKeys.get(i);
238
						//System.out.println("displayOrder["+displayOrder+"]");
239

  
240 164
						String textOrder = orders.get(displayOrder);
241 165
						HyperalignText text = null;
242 166
						if(displayOrder!=null){
......
253 177
					}
254 178
				}
255 179
				//System.out.println("-------------END------------------");
256
				panels.repaint();
257
				panels.validate();
180
				this.repaint();
181
				this.validate();
258 182
			}
259 183
		}
260 184
	}
SRC/src/fr/triangle/hyperalign/io/input/HyperalignBuilder.java (revision 8)
117 117
				Element currentElement = children.get(i);
118 118
				date = currentElement.getAttributeValue("date");
119 119
				manager.getDebug().addToFileForDebug("HyperalignBuilder.buildProject() - PROJECT DATE ["+date+"]");
120
				
120 121
			}
121 122

  
122 123
			//GET FILES for terminologies
SRC/src/fr/triangle/hyperalign/io/output/ProjectWriter.java (revision 8)
344 344
			equivalences = manager.getEquivalenceManager().getEquivalenceElementsByLocalization();
345 345
		}
346 346
		String lang = "";
347
		for(int i = 0 ; i < languagesOfCorpus.length ; ++i){
348
			lang += languagesOfCorpus[i].getName()+"_";
347
		if(languagesOfCorpus.length!=0){
348
			for(int i = 0 ; i < languagesOfCorpus.length ; ++i){
349
				lang += languagesOfCorpus[i].getName()+"_";
350
			}
351
			lang = lang.substring(0,lang.length()-1);
349 352
		}
350
		lang = lang.substring(0,lang.length()-1);
351

  
353
		System.out.println("ProjectWriter.saveCorpus() - LANG => "+lang);
354
		
352 355
		String corpusName = corpus.getParameters().getName();
353
		System.out.println("ProjectWriter.saveCorpus() => "+lang);
354

  
355 356
		String fileName = name+"_"+"ParallelCorpus.xml";
356 357
		File file = new File(dir, fileName);
357 358
		try {

Also available in: Unified diff