下面我們來看看 Empty 組件,beside 和 above 組合子的實現方法,它們都很簡單。
public class Empty implements Component {
public Component at(int x,int y,int width,int height) {
return this;
}
public Component in(Container {
return this;
}
}
Empty 只是起到了一個布局空間占位的作用。beside 和 above 的實現如下:
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/