Bonjour,

Avant que je n'ai plus de chaveux pour cause d'arrachage psychotique (oué a ce point là), j'appel à l'aide ... je ne comprend pas .. j'ai un panel dans un boxLayout verticla qui s'amuse a prendre toute sorte de taille plus ou moins aléatoirement .... oscouuur...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
 
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.util.ArrayList;
 
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;
 
 
public class BestAlignement extends JPanel{
 
 
 
	private ArrayList _paramSetList;
	private ArrayList _geneList;
	private int _selectedParam;
	BAGraph _baGraph;
	BAParamTabPan _baParamTabPan;
	GenesInfoZone _baInfo;
	private static final long serialVersionUID = 39L;
 
	BestAlignement(BestAlignementParamSet param, BAMain baMain)
	{
		super();
 
		_geneList = baMain.getGeneList();
		this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		_paramSetList = new ArrayList();
		_selectedParam = 0;
		_paramSetList.add(param);
		this.setBorder(BorderFactory.createLineBorder(Color.black));
		_baGraph = new BAGraph(param, this);
		this.add(_baGraph);
		_baParamTabPan = new BAParamTabPan(this);
		this.add(_baParamTabPan);
		_baInfo = new GenesInfoZone(this);
		this.add(_baInfo);
	}
 
 
	public void addParamSet(BestAlignementParamSet newSet)
	{
		_paramSetList.add(newSet);
		_baParamTabPan.newParamSet(newSet);
 
	}
 
	public void ParamModificationNotification(BestAlignementParamSet param)
	{
		_baParamTabPan.paramModification(param);
	}
 
 
	BestAlignementParamSet getSelectedParam()
	{
		return (BestAlignementParamSet)(_paramSetList.get(_selectedParam));
	}
 
	ArrayList getParamList()
	{
		return _paramSetList;
	}
 
	ArrayList getGeneList()
	{
		return _geneList;
	}
 
	public void changeSelectedParam(BestAlignementParamSet param)
	{
		for (int i = 0 ; i< _paramSetList.size(); i++)
		{
			if(((BestAlignementParamSet)_paramSetList.get(i)).equals(param))
			{
				_selectedParam = i;
				Dimension dim = _baGraph.getSize();
				this.remove(_baGraph);
				_baGraph = new BAGraph(param, this);
 
				_baGraph.setSize(dim);
				this.add(_baGraph,0);
				this.revalidate();
				return;
			}
		}
	}
 
}
celui qui s'amuse c'est BAGraph ... le _baParamTabPan est un tabbedPane dont j'ai fixé la hauteur a 100 pixel et lui ca marche.
Le _bagraph je voudrais le "fixé) a une tierre de la hauteur de ce panel.

J'ai tout essayer et le pire c'est que ca marchais sous window hier mais ca marche plus sous linux T T ....

le code du BAGraph

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
 
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
 
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
 
 
public class BAGraph extends JPanel{
 
	JComponent _parent;
	PositionScrollPanel _positions;
	PhaseScrollPanel _phases;
	BAGraphPan _graph;
	private static final long serialVersionUID = 34L;
	BestAlignementParamSet _param;
 
	BAGraph( BestAlignementParamSet param,  BestAlignement parent)
	//BAGraph(ArrayList list, boolean circular , BestAlignement parent, float phase, float error)
	{
		super();
		this.setLayout(null);
		this.setBackground(Color.BLACK);
		_param = param;
		_parent = parent;
		_positions = new PositionScrollPanel(_param, this);
		this.add(_positions);
		_phases = new PhaseScrollPanel(_param, this);
		this.add(_phases);
		_graph= new BAGraphPan(_param, parent, _positions, _phases);
		this.add(_graph);
this.setBorder(BorderFactory.createLineBorder(Color.pink));
 
		//this.setBounds(0,0 , _parent.getWidth(), _parent.getHeight());
		this.setPreferredSize(new Dimension(_parent.getWidth(),_parent.getHeight()/3));
		//this.setSize(new Dimension(_parent.getWidth(),_parent.getHeight()/3));
		//_phases.setBounds(0, 0, 30, this.getHeight()-30);
		//_graph.setBounds(30, 0, this.getWidth()-30, this.getHeight()-30);
		//_positions.setBounds(30, this.getHeight()-30, this.getWidth()-30, 30);
	}
 
	/**BAGraph( ParamSet param,  BestAlignement parent)
        {
                super();
                _parent = parent;
                _positions = new PositionScrollPanel(parent.getParam().getStartPos(), parent.getParam().getEndPos(), parent.getParam().getPeriod(), this);
                this.add(_positions);
                _phases = new PhaseScrollPanel(phase, this);
                this.add(_phases);
                _graph= new BAGraphPan(_positions, _phases, list, parent, phase, error);
                this.add(_graph);
 
                
                //this.setBounds(0,0 , _parent.getWidth(), _parent.getHeight());
                //this.setPreferredSize(new Dimension(_parent.getWidth(),200));
                _phases.setBounds(0, 0, 30, this.getHeight()-30);
                _graph.setBounds(30, 0, this.getWidth()-30, this.getHeight()-30);
                _positions.setBounds(30, this.getHeight()-30, this.getWidth()-30, 30);
        }*/
 
	public void updateDrawGraph()
	{
		_graph.repaint();
	}
 
	public void paintComponent(Graphics g)
	{
 
		super.paintComponent(g);
		this.setPreferredSize(new Dimension(_parent.getWidth(),_parent.getHeight()/3));
		this.setMaximumSize(new Dimension(_parent.getWidth(),_parent.getHeight()/3));
		///this.setSize(new Dimension(_parent.getWidth(),_parent.getHeight()/3));
		System.out.println("MEEEE "+this.getSize()+ " "+ _parent.getHeight()/3);
		g.clearRect(0, 0, this.getWidth(),this.getHeight());
	//	_phases.setBounds(0, 0, 30, this.getHeight()-30);
	//	_graph.setBounds(30, 0, this.getWidth()-30, this.getHeight()-30);
	//	_positions.setBounds(30, this.getHeight()-30, this.getWidth()-30, 30);
 
		System.out.println("MEEEE "+this.getSize());
	}
}
Plein de truc en commentaire j'ai essayé plein de chose mais ca veux vraiment pas marcher ....