本文整理汇总了Java中de.lessvoid.nifty.Nifty.scheduleEndOfFrameElementAction方法的典型用法代码示例。如果您正苦于以下问题:Java Nifty.scheduleEndOfFrameElementAction方法的具体用法?Java Nifty.scheduleEndOfFrameElementAction怎么用?Java Nifty.scheduleEndOfFrameElementAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.lessvoid.nifty.Nifty
的用法示例。
在下文中一共展示了Nifty.scheduleEndOfFrameElementAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNewGui
import de.lessvoid.nifty.Nifty; //导入方法依赖的package包/类
/**
* Create a new gui from a file and current assetFolder as assets
* @param nifty a valid Nifty instace @see Nifty
* @throws ParserConfigurationException if controller failed to create
* a valid document instance
* @throws IOException
* @throws SAXException
* @throws Exception if nifty can't create the gui
* @return A string with the elements that weren't loaded
*
*/
public String createNewGui(Nifty nifty ,File filename) throws ParserConfigurationException, IOException, SAXException, NoProductException, Exception{
String assets= ".";
if(this.gui != null){
assets = this.gui.getAssetFolder().getPath();
}
GUIReader reader = new GUIReader(nifty);
String res = "";
this.gui = reader.readGUI(filename);
this.gui.setAssetFolder(new File(assets));
res = reader.getTagNotLoaded();
final GScreen screen =this.getGui().gettopScreen();
for(String sel : nifty.getAllScreensName()){
nifty.removeScreen(sel);
}
writer = new GUIWriter(gui);
nifty.scheduleEndOfFrameElementAction(new Reload(nifty, screen.getID()), new EndNotify() {
@Override
public void perform() {
setChanged();
notifyObservers(new ReloadGuiEvent(gui));
clearChanged();
}
});
currentL=gui.getTopLayer();
currentS=gui.gettopScreen();
currentlayers.addAll(gui.getLayers());
dragDropManager = new NiftyDDManager(nifty);
this.model.setCurentGUI(gui);
return res;
}
示例2: refresh
import de.lessvoid.nifty.Nifty; //导入方法依赖的package包/类
/**
* Refresh the current gui . It causes a call to nifty.fromXml method.
* @param nifty
* @throws Exception if nifty can't load the old gui
*/
public void refresh(Nifty nifty) throws Exception{
if(getGui() != null){
String screenID =this.currentS.getID();
nifty.scheduleEndOfFrameElementAction(new Reload(nifty, screenID), null);
}
}