Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes
rene.gui.SimplePanel Class Reference

A panel with two components side by side. More...

Inheritance diagram for rene.gui.SimplePanel:
Inheritance graph
[legend]
Collaboration diagram for rene.gui.SimplePanel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SimplePanel (Component c1, double w1, Component c2, double w2)
void doLayout ()
Dimension getPreferredSize ()
void setInsets (int x, int y)
void paint (Graphics g)

Package Attributes

Component C1
Component C2
double W
int IX = 0
int IY = 0

Detailed Description

A panel with two components side by side.

The size of the components is determined by the weights.

Definition at line 11 of file SimplePanel.java.


Constructor & Destructor Documentation

rene.gui.SimplePanel.SimplePanel ( Component  c1,
double  w1,
Component  c2,
double  w2 
) [inline]

Definition at line 15 of file SimplePanel.java.

       {      C1=c1; C2=c2; W=w1/(w1+w2);
              add(C1);
              add(C2);
       }

Member Function Documentation

void rene.gui.SimplePanel.doLayout ( ) [inline]

Definition at line 20 of file SimplePanel.java.

       {      int w=(int)(getSize().width*W-3*IX);
              C1.setSize(w,getSize().height-2*IY);
              C1.setLocation(IX,IY);
              C2.setSize(getSize().width-3*IX-w,getSize().height-2*IX);
              C2.setLocation(w+2*IX,IY);
              C1.doLayout();
              C2.doLayout();
       }
Dimension rene.gui.SimplePanel.getPreferredSize ( ) [inline]

Definition at line 29 of file SimplePanel.java.

       {      Dimension d1=C1.getPreferredSize(),d2=C2.getPreferredSize();
              return new Dimension(d1.width+d2.width,
                     Math.max(d1.height,d2.height));
       }
void rene.gui.MyPanel.paint ( Graphics  g) [inline, inherited]

Definition at line 12 of file MyPanel.java.

       {      super.paint(g);
              getToolkit().sync();
       }
void rene.gui.SimplePanel.setInsets ( int  x,
int  y 
) [inline]

Definition at line 34 of file SimplePanel.java.

       {      IX=x; IY=y;
       }

Member Data Documentation

Component rene.gui.SimplePanel.C1 [package]

Definition at line 12 of file SimplePanel.java.

Component rene.gui.SimplePanel.C2 [package]

Definition at line 12 of file SimplePanel.java.

int rene.gui.SimplePanel.IX = 0 [package]

Definition at line 14 of file SimplePanel.java.

int rene.gui.SimplePanel.IY = 0 [package]

Definition at line 14 of file SimplePanel.java.

double rene.gui.SimplePanel.W [package]

Definition at line 13 of file SimplePanel.java.


The documentation for this class was generated from the following file: