本文整理汇总了Java中jcurses.widgets.DefaultLayoutManager类的典型用法代码示例。如果您正苦于以下问题:Java DefaultLayoutManager类的具体用法?Java DefaultLayoutManager怎么用?Java DefaultLayoutManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultLayoutManager类属于jcurses.widgets包,在下文中一共展示了DefaultLayoutManager类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Message
import jcurses.widgets.DefaultLayoutManager; //导入依赖的package包/类
/**
* The constructor
*
* @param title the message's title
* @param text the message's text
* @param buttonLabel the label on the message's button
*
*/
@SuppressWarnings("LeakingThisInConstructor")
public Message(String title, String text, String buttonLabel)
{
super(getWidth(text, title) + 4, getHeight(text) + 7, true, title);
DefaultLayoutManager manager = (DefaultLayoutManager) getRootPanel().getLayoutManager();
_label = new Label(text);
_button = new Button(buttonLabel);
_title = title;
_button.addListener(this);
manager.addWidget(_label, 0, 0, getWidth(text, _title) + 2, getHeight(text) + 2, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
manager.addWidget(_button, 0, getHeight(text) + 2, getWidth(text, _title) + 2, 5, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
}
示例2: Message
import jcurses.widgets.DefaultLayoutManager; //导入依赖的package包/类
/**
* The constructor
*
* @param title the message's title
* @param text the message's text
* @param buttonLabel the label on the message's button
*
*/
public Message(String title, String text, String buttonLabel) {
super(getWidth(text, title)+4, getHeight(text)+7,true,title);
DefaultLayoutManager manager = (DefaultLayoutManager)getRootPanel().getLayoutManager();
_label = new Label(text);
_button = new Button(buttonLabel);
_title = title;
_button.addListener(this);
manager.addWidget(_label,0,0,getWidth(text, _title)+2, getHeight(text)+2, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
manager.addWidget(_button,0,getHeight(text)+2,getWidth(text, _title)+2, 5, WidgetsConstants.ALIGNMENT_CENTER,
WidgetsConstants.ALIGNMENT_CENTER);
}