?? layoutadapter.java
字號:
/*
* LayoutAdapter.java
*
* Created on 2007年5月2日, 下午11:30
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package dyno.swing.designer.beans;
import java.awt.Component;
/**
* 該接口是LayoutManager的BeanInfo類。標準Java平臺沒有提供布局管理器的BeanInfo類,
* 對于界面設計工具來說還需一些特殊的行為。
*
* @author William Chen
*/
public interface LayoutAdapter {
/**
* 在添加組件狀態時,當鼠標移動到某個容器上方時,如果該容器有布局管理器,則會調用該布局
* 管理適配器的accept來決定當前位置是否可以放置,并提供特殊的標識,比如紅色區域標識。比
* 如在BorderLayout中,如果某個方位已經放置了組件,則此時應該返回false標識該區域不可以
* 放置。
*
* @param container 正在添加新組件的container
* @param bean 被添加的新組件
* @param x 添加的位置x,該位置是相對于container的
* @param y 添加的位置y,該位置是相對于container的
* @return 是否可以放置。
*/
boolean accept(Component bean, int x, int y);
/**
* 組件的ComponentAdapter在添加組件時,如果發現布局管理器不為空,會繼而調用該布局管理器的
* addBean方法來完成組件的具體添加。在該方法內,布局管理器可以提供額外的功能。
* @param container 正在添加新組件的container
* @param bean 被添加的新組件
* @param x 添加的位置x,該位置是相對于container的
* @param y 添加的位置y,該位置是相對于container的
* @return 是否添加成功,成功返回true,否則false
*/
boolean addBean(Component bean, int x, int y);
/**
* 返回該布局管理適配器的Painter,為容器提供放置位置的標識。
*
*/
HoverPainter getPainter();
Painter getAnchorPainter();
/**
* 顯示parent的字組件child,解決CardLayout中顯示某個非顯示組件的特殊情況
*/
void showComponent(Component child);
void addNextComponent(Component dragged);
void addBefore(Component target, Component added);
void addAfter(Component target, Component added);
boolean canAcceptMoreComponent();
ConstraintsGroupModel getLayoutConstraints(Component bean);
GroupModel getLayoutProperties();
String getLayoutCode();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -