public BuMultiFormLayout(int _hgap, int _vgap,int _celastic,int _relastic, int[] _minw,int[] _minh) { super(_hgap,_vgap,_celastic,_relastic); containers_=new FuWeakCache(); minw_ =_minw; minh_ =_minh; nbcol_=(minw_==null) ? 0 : minw_.length; nbrow_=(minh_==null) ? 0 : minh_.length; cpyw_ =clone(minw_); cpyh_ =clone(minh_); }
public void addLayoutComponent(Component _comp, Object _cstr) { if(DEBUG) FuLog.debug("BML: add layout"); super.addLayoutComponent(_comp,_cstr); // Slow but no other solution found to avoid double pack. Container parent=_comp.getParent(); register(parent); }
public Dimension preferredLayoutSize(Container _parent) { if(DEBUG) FuLog.debug("BML: preferred layout"); if(shouldReset_) reset(); return super.preferredLayoutSize(_parent); }
BuMultiFormLayout l=new BuMultiFormLayout (5,5,2,2,new int[] { 200,0 },new int[] { 0,0 }); c1.add(new JButton("AAAA"),constraint(0,0)); c1.add(new JButton("BBBB"),constraint(1,0)); c1.add(new JButton("CCCCCCC"),constraint(0,1,2,false,1.f)); c2.add(new JButton("D"),constraint(0,0)); c2.add(new JButton("E"),constraint(1,0)); c2.add(new JTree(),constraint(1,1)); c3.add(new JButton("FFFFFF"),constraint(0,0,1,false,0.5f)); c3.add(new JLabel("_|"),constraint(1,1,1,1,false,false,1.f,1.f));
setBorder(EMPTY5555); final BuMultiFormLayout mflo = new BuMultiFormLayout(5, 5, BuFormLayout.LAST, BuFormLayout.NONE, new int[] { 0}, null);
public void layoutContainer(Container _parent) { if(DEBUG) FuLog.debug("BML: layout"); if(shouldReset_) { FuLog.warning("BML: strange call to reset"); minw_=clone(cpyw_); minh_=clone(cpyh_); shouldReset_ =false; shouldInvalidateAll_=true; } Container q=_parent.getParent(); if(containers_.get(_parent)!=q) { containers_.put(_parent,q); shouldInvalidateAll_=true; } super.layoutContainer(_parent); if(shouldInvalidateAll_) { shouldInvalidateAll_=false; invalidateContainers(_parent); } }
public void removeLayoutComponent(Component _comp) { super.removeLayoutComponent(_comp); // Slow but no other solution found to avoid errors. Container parent=_comp.getParent(); if(parent!=null) { if(DEBUG) FuLog.debug("BML: remove layout"); restore(parent,parent.getParent()); } }
BuMultiFormLayout mflo=new BuMultiFormLayout (5,5,2,BuFormLayout.NONE, new int[] { 0 },null);