Back to index

wims  3.65+svn20090927
IconBarPanel.java
Go to the documentation of this file.
00001 /*
00002  * Created on 01.10.2004
00003  *
00004  */
00005 package rene.gui;
00006 
00007 import java.awt.*;
00008 
00014 public class IconBarPanel
00015        extends MyPanel
00016 {      Component C1,C2;
00017        int IX=0,IY=0;
00018 
00019        public IconBarPanel (Component c1, Component c2)
00020        {      C1=c1; C2=c2;
00021               add(C1);
00022               add(C2);
00023        }
00024 
00025        public void doLayout ()
00026        {      int w=C1.getPreferredSize().width;
00027               C1.setSize(w,getSize().height-2*IY);
00028               C1.setLocation(IX,IY);
00029               C2.setSize(getSize().width-3*IX-w,getSize().height-2*IX);
00030               C2.setLocation(w+2*IX,IY);
00031               C1.doLayout();
00032               C2.doLayout();
00033        }
00034 
00035        public Dimension getPreferredSize ()
00036        {      Dimension d1=C1.getPreferredSize(),d2=C2.getPreferredSize();
00037               return new Dimension(d1.width+d2.width,
00038                      Math.max(d1.height,d2.height));
00039        }
00040 
00041        public void setInsets (int x, int y)
00042        {      IX=x; IY=y;
00043        }
00044 
00045        public static void main(String[] args)
00046        {}
00047 }