• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LayerBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中de.lessvoid.nifty.builder.LayerBuilder的典型用法代码示例。如果您正苦于以下问题:Java LayerBuilder类的具体用法?Java LayerBuilder怎么用?Java LayerBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LayerBuilder类属于de.lessvoid.nifty.builder包,在下文中一共展示了LayerBuilder类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: buildScreenNow

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
public void buildScreenNow(String uniqueScreenId) {

        new ScreenBuilder(uniqueScreenId) {
            {
                controller(screenController); // Screen properties

                // <layer>
                layer(new LayerBuilder("Layer_ID") {
                    {
                        childLayoutVertical(); // layer properties, add more...

                        text(new TextBuilder("text") {
                            {
                                text("Screen made " + ++counter + " times from Generator2 with name " + uniqueScreenId);
                                style("nifty-label");
                                alignCenter();
                                valignCenter();
                                height("20%");
                            }
                        });

                        panel(new PanelBuilder("Panel_ID") {
                            {
                                height("20%");
                                childLayoutHorizontal();

                                control(new ButtonBuilder("PreviousButton", "Back") {
                                    {
                                        alignCenter();
                                        valignCenter();
                                        interactOnClick("back()");
                                    }
                                });

                                control(new ButtonBuilder("NextButton", "Next") {
                                    {
                                        alignCenter();
                                        valignCenter();
                                        interactOnClick("next()");
                                    }
                                });



                            }
                        });

                    }
                });
                // </layer>
            }
        }.build(nifty);
    }
 
开发者ID:albertonavarro,项目名称:nifty-flow,代码行数:54,代码来源:Generator2.java


示例2: generateScreen

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
public void generateScreen(){
	
	nifty.addScreen("victory", new ScreenBuilder("victory") {{
		layer(new LayerBuilder("background") {{
			childLayoutCenter();
			image(new ImageBuilder() {{
				width("100%");
				height("100%");
				filename("Interface/victory.jpg");
			}});
		}});

	}}.build(nifty));
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:15,代码来源:VictoryScreen.java


示例3: generateScreen

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
/**Generates the StartScreen and binds elements**/

public void generateScreen(){
	
	nifty.addScreen("start", new ScreenBuilder("start") {{
		controller(screenController);
		layer(new LayerBuilder("background") {{
			childLayoutCenter();
			image(new ImageBuilder() {{
				filename("Interface/outPostStartScreen.png");
			}});

		}});

		//Sets up spacing elements, image, and image button to commence game
		layer(new LayerBuilder("foreground") {{
			childLayoutVertical();
			width("100%");
			height("100%");
			panel(new PanelBuilder(){{
				height("80%");
				alignCenter();
			}});
			image(new ImageBuilder("StartButton"){{
				height("10%");
				width("15%");
				filename("Interface/StartButton.png");
				alignCenter();
				visibleToMouse(true);
				interactOnClick("startGame(loading)");
				onHoverEffect(new HoverEffectBuilder("changeImage"){{
					effectParameter("active", "Interface/StartButtonGlow.png");
					effectParameter("inactive", "Interface/StartButton.png");
				}});
			}});
		}});
	}}.build(nifty));
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:39,代码来源:StartScreen.java


示例4: createDesktop

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
ScreenBuilder createDesktop(final String title, final String message) {
    final ScreenController controller = this;

    return new ScreenBuilder(SCREEN_ID) {
        {
            controller(controller);
            layer(new LayerBuilder("foreground") {
                {
                    childLayoutCenter();
                    panel(new PanelBuilder("panel") {
                        {
                            style("nifty-panel-simple");
                            childLayoutAbsolute();

                            width("400");
                            height("125");

                            control(new LabelBuilder("title", title) {
                                {
                                    x("0");
                                    y("0");
                                    width("400");
                                    height("30");
                                }
                            });

                            control(new TextFieldBuilder("message") {
                                {
                                    x("0");
                                    y("45");

                                    width("100%");
                                    height("30");
                                    text(message);
                                }
                            });
                        }
                    });
                }
            });
        }
    };
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:44,代码来源:TextDialog.java


示例5: createMobile

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
ScreenBuilder createMobile(final String title, final String message) {
    final ScreenController controller = this;

    return new ScreenBuilder(SCREEN_ID) {
        {
            controller(controller);
            layer(new LayerBuilder("foreground") {
                {
                    childLayoutCenter();
                    panel(new PanelBuilder("panel") {
                        {
                            style("nifty-panel-simple");
                            childLayoutAbsolute();

                            width("90%");
                            height("300");

                            control(new LabelBuilder("title", title) {
                                {
                                    x("0");
                                    y("0");
                                    width("100%");
                                    height("60");
                                }
                            });

                            control(new TextFieldBuilder("message") {
                                {
                                    x("0");
                                    y("150");

                                    width("100%");
                                    height("60");
                                    text(message);
                                }
                            });
                        }
                    });
                }
            });
        }
    };
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:44,代码来源:TextDialog.java


示例6: createAndroid

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
private ScreenBuilder createAndroid(final String message) {
    final ScreenController This = this;

    return new ScreenBuilder(SCREEN_ID) {
        {
            controller(This);
            layer(new LayerBuilder("foreground") {
                {
                    childLayoutCenter();
                    panel(new PanelBuilder("panel") {
                        {
                            style("nifty-panel-simple");
                            childLayoutAbsolute();
                            //x("100px");
                            //y("100px");
                            width("750px");
                            height("175px");

                            control(new LabelBuilder("title", message) {
                                {
                                    x("0");
                                    y("0");
                                    width("600px");
                                    height("60px");
                                }
                            });
                            control(new TextFieldBuilder("textField") {
                                {
                                    maxLength(20);
                                    x("10");
                                    y("75");
                                    width("450px");
                                    height("60px");
                                }
                            });
                            control(new ButtonBuilder("enter", "Enter") {
                                {
                                    x("500");
                                    y("75");
                                    height("60px");
                                    width("200px");
                                    interactOnClick("enter()");
                                }
                            });
                        }
                    });
                }
            });
        }
    };
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:52,代码来源:TextinputDialog.java


示例7: createDesktop

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
private ScreenBuilder createDesktop(final String message) {
    final ScreenController This = this;
    return new ScreenBuilder(SCREEN_ID) {
        {
            controller(This);
            layer(new LayerBuilder("foreground") {
                {
                    childLayoutCenter();
                    panel(new PanelBuilder("panel") {
                        {
                            style("nifty-panel-simple");
                            childLayoutAbsolute();
                            //x("100px");
                            // y("100px");
                            width("350px");
                            height("100px");

                            control(new LabelBuilder("title", message) {
                                {
                                    x("0");
                                    y("0");
                                    width("350px");
                                    height("40px");
                                }
                            });
                            control(new TextFieldBuilder("textField") {
                                {
                                    maxLength(20);
                                    x("10");
                                    y("45");
                                    width("200px");
                                    height("25px");
                                }
                            });
                            control(new ButtonBuilder("enter", "Enter") {
                                {
                                    x("225");
                                    y("45");
                                    height("25px");
                                    interactOnClick("enter()");
                                }
                            });
                        }
                    });
                }
            });
        }
    };
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:50,代码来源:TextinputDialog.java


示例8: bind

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
@Override
public void bind(Nifty nifty, Screen screen) {
    this.nifty = nifty;
    final ScreenController This = this;
    Screen dialog = new ScreenBuilder(SCREEN_ID) {
        {
            controller(This);
            layer(new LayerBuilder("foreground") {
                {
                    childLayoutCenter();

                    control(new ListBoxBuilder("moleculeList") {
                        {
                            childLayoutVertical();
                            set("horizontal", "false");
                            displayItems(10);
                            selectionModeSingle();
                            optionalVerticalScrollbar();
                            optionalHorizontalScrollbar();
                            width("85%");
                            height("85%");
                            x("8%");
                            y("10%");
                        }
                    });

                }
            });
        }
    }.build(nifty);

    //Element e = dialog.findElementByName("foreground");

    /*CreateListBoxControl clistBox = new CreateListBoxControl("listBoxDynamic");
     clistBox.set("horizontal", "false");
     clistBox.setWidth("85%");
     clistBox.setHeight("85%");
     //clistBox.setY("10%");
     //clistBox.setX("8%");
     clistBox.setChildLayout("vertical");
     clistBox.set("displayItems", "10");
     clistBox.set("vertical", "optional");
     clistBox.set("horizontal", "optional");


     listBox = clistBox.create(nifty, dialog, e);

     File dir = Constants.getMoleculeLocation();
     File[] fs = dir.listFiles();
     if (fs == null) {
     fs = new File[0];
     }
     for (File f : fs) {
     String name = FileTools.getFileName(f);
     listBox.addItem(name);
     }*/
    ListBox box = dialog.findNiftyControl("moleculeList", ListBox.class);
    // add items; box.addItem

    File dir = Constants.getMoleculeLocation();
    String[] fs = FileTools.listSubFiles(dir);

    for (String subF : fs) {
        box.addItem(subF);
    }

    nifty.addScreen(SCREEN_ID, dialog);
    nifty.gotoScreen(SCREEN_ID);
}
 
开发者ID:matthewseal,项目名称:MoleculeViewer,代码行数:70,代码来源:MoleculeDialog.java


示例9: buildScreenNow

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
public void buildScreenNow(String uniqueScreenId) {

        new ScreenBuilder(uniqueScreenId) {
            {
                controller(screenController); // Screen properties

                // <layer>
                layer(new LayerBuilder("Layer_ID") {
                    {
                        childLayoutVertical(); // layer properties, add more...

                        panel(new PanelBuilder("Panel_ID") {
                            {
                                height("20%");
                                childLayoutHorizontal();

                                text(new TextBuilder("text") {
                                    {
                                        text("Screen made one time only from Generator4 with name " + uniqueScreenId);
                                        style("nifty-label");
                                        alignCenter();
                                        valignCenter();
                                        height("20%");
                                    }});

                                control(new ButtonBuilder("PreviousButton", "Back") {
                                    {
                                        alignCenter();
                                        valignCenter();
                                        interactOnClick("back()");
                                    }
                                });



                            }
                        });

                    }
                });
                // </layer>
            }
        }.build(nifty);
    }
 
开发者ID:albertonavarro,项目名称:nifty-flow,代码行数:45,代码来源:Generator4.java


示例10: buildScreen

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
@Override
public void buildScreen(String uniqueScreenId, String controllerClassName) {

    final PanelBuilder panelModules = new PanelBuilder("Panel_Modules") {
        {
            childLayoutVertical();
            alignCenter();
            height("80%");
        }
    };

    for (final String moduleName : screenFlowManager.getChildren()) {
        panelModules.control(new ButtonBuilder(moduleName + "ButtonLabel", moduleName) {
            {
                alignCenter();
                valignCenter();
                height("11%");
                width("20%");
                interactOnClick("executeModule(" + moduleName + ")");
            }
        });
    }

    final PanelBuilder panelMessage = new PanelBuilder("Panel_Message") {
        {
            childLayoutVertical();
            alignCenter();
            height("10%");
        }
    };

    final PanelBuilder panelQuit = new PanelBuilder("Panel_Quit") {
        {
            childLayoutVertical();
            height("10%");
        }
    };

    panelQuit.control(new ButtonBuilder("QuitButton", "Quit") {
        {
            alignRight();
            valignCenter();
            height("100%");
            width("20%");
            interactOnClick("quit()");
        }
    });

    new ScreenBuilder(uniqueScreenId) {
        {
            controller(startScreenController);
            layer(new LayerBuilder("Layer_Main") {
                {
                    backgroundColor(Color.BLACK);
                    childLayoutVertical();
                    panel(panelModules);
                    panel(panelMessage);
                    panel(panelQuit);
                }
            });
        }
    }.build(nifty);

}
 
开发者ID:albertonavarro,项目名称:nifty-flow,代码行数:65,代码来源:RootScreenGenerator.java


示例11: GLayer

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
public GLayer(String id) throws IllegalArgumentException{
  super(id);
  builder= new LayerBuilder(id);
  
}
 
开发者ID:relu91,项目名称:niftyeditor,代码行数:6,代码来源:GLayer.java


示例12: generateScreen

import de.lessvoid.nifty.builder.LayerBuilder; //导入依赖的package包/类
public void generateScreen(){
	
	nifty.addScreen("loading", new ScreenBuilder("loading") {{
		controller(screenController);
		layer(new LayerBuilder("background") {{
			childLayoutCenter();
			image(new ImageBuilder() {{
				filename("Interface/LoadingScreen.png");
			}});
		}});
		layer(new LayerBuilder("foreground") {{
			childLayoutVertical();
			panel(new PanelBuilder("hintTextPadding"){{
				height("65%");
				alignCenter();
			}});
			
			//displays hints on the loading screen
			text(new TextBuilder("hintText"){{
				alignCenter();
				height("10%");
				width("10%");
				text("");
				font("Interface/Fonts/ItemText.fnt");
				onShowEffect(new EffectBuilder("fade"){{
					length(2000);
					startDelay(2000);
					onEndEffectCallback("loadWorld()");
				}});
			}});

			//fade with callback to help buffer loading
			image(new ImageBuilder("loadImage2") {{
				visible(false);
				onShowEffect(new EffectBuilder("fade"){{
					length(2000);
					startDelay(2000);
					onEndEffectCallback("startHud()");
				}});
			}});
			
		}});

	}}.build(nifty));
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:46,代码来源:LoadingScreen.java



注:本文中的de.lessvoid.nifty.builder.LayerBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java YAMLValue类代码示例发布时间:2022-05-23
下一篇:
Java FieldCacheSanityChecker类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap