本文整理汇总了Java中tripleplay.ui.layout.AxisLayout类的典型用法代码示例。如果您正苦于以下问题:Java AxisLayout类的具体用法?Java AxisLayout怎么用?Java AxisLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AxisLayout类属于tripleplay.ui.layout包,在下文中一共展示了AxisLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createUI
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private void createUI() {
Root root = iface.createRoot(AxisLayout.vertical(), SimGameStyle.newSheet(game().plat.graphics()), layer)
.setSize(size())
.add(new Label("Your two weeks is up! Lets take a look.")
.setStyles(Style.COLOR.is(GameColors.HUNTER_GREEN)))
.setStyles(Style.BACKGROUND.is(Background.solid(Colors.WHITE)));
root.add(createEndGameTable());
root.add(new Label(determineOutcomeText())
.addStyles(Style.COLOR.is(GameColors.HUNTER_GREEN),
Style.TEXT_WRAP.on),
BossAtDeskLabelFactory.create(gameWorld.company.get().boss.image),
new Button("OK").onClick(new Slot<Button>() {
@Override
public void onEmit(Button button) {
if (!SimGame.game.config.skipIntro()) {
if (SimGame.game.consent.get()) {
screenStack.replace(new PostSurveyScreen(SimGame.game), screenStack.slide().right());
} else {
screenStack.remove(EndScreen.this, screenStack.slide().right());
}
} else {
screenStack.push(new StartingScreen(screenStack), screenStack.slide().right());
}
}
}));
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:27,代码来源:EndScreen.java
示例2: createEndGameTable
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private Element<?> createEndGameTable() {
Group wholeTable = new Group(AxisLayout.vertical())
.addStyles(Style.BACKGROUND.is(Background.solid(GameColors.HALF_BAKED).inset(5, 5)));
Group tableHeader = new Group(AxisLayout.horizontal());
tableHeader.add(new Label("Performance Review").addStyles(Style.COLOR.is(Colors.WHITE)));
Group summaryTable = new Group(new TableLayout(
new ExposedColumn(Style.HAlign.LEFT, true, 1, 0),
new ExposedColumn(Style.HAlign.CENTER, false, 1, HGAP_BETWEEN_COLUMNS),
new ExposedColumn(Style.HAlign.RIGHT, false, 1, 0)))
.addStyles(Style.BACKGROUND.is(Background.solid(Colors.WHITE).inset(TABLE_INSETS, TABLE_INSETS)));
Map<String, String> data = tabulateResults();
for (String key : data.keySet()) {
summaryTable.add(new Label(key).addStyles(Style.HALIGN.left),
new Shim(0, 0),
new Label(data.get(key)).addStyles(Style.HALIGN.left));
}
wholeTable.add(tableHeader, summaryTable, new Shim(1, 1));
return wholeTable;
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:20,代码来源:EndScreen.java
示例3: createTransparentClickableArea
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private Element<?> createTransparentClickableArea() {
return new TouchableLabel("")
.onClick(new Slot<TouchableLabel>() {
@Override
public void onEmit(TouchableLabel event) {
String name = gameWorld.profile.get(id).firstName;
if (focus.get() != EmployeeView.this) {
SimGame.game.event.emit(TrackedEvent.game().action("expand").label(name));
focus.update(EmployeeView.this);
} else {
SimGame.game.event.emit(TrackedEvent.game().action("collapse").label(name));
focus.update(null);
}
}
})
.setConstraint(AxisLayout.stretched(TRANSPARENT_AREA_WEIGHT));
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:18,代码来源:MainUIGroup.java
示例4: createControlsAndBioGroup
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private Group createControlsAndBioGroup(Root root) {
final EmployeeProfile profile = gameWorld.profile.get(id);
final float borderThickness = percentOfViewHeight(0.005f);
Group employeeDataGroup = new Group(AxisLayout.vertical().offStretch());
for (EmployeeProfile.Credential credential : profile.credentials) {
employeeDataGroup.add(wrappingLabel(credential.name + " (" + credential.provider + ")"));
}
employeeDataGroup.add(wrappingLabel(profile.bio))
.addStyles(Style.BACKGROUND.is(
Background.bordered(Palette.DIALOG_BACKGROUND, Palette.DIALOG_BORDER, borderThickness)
.inset(borderThickness * 2)));
final float spaceAroundNameAndTaskArea = percentOfViewHeight(0.03f);
final Font nameFont = FontCache.instance().REGULAR.derive(percentOfViewHeight(0.03f));
return new Group(AxisLayout.vertical())
.add(new Shim(0, spaceAroundNameAndTaskArea),
dialogStyledLabel(profile.firstName + " " + profile.lastName)
.addStyles(Style.FONT.is(nameFont),
Style.COLOR.is(Palette.NAME_COLOR)),
createSkillSummaryGroup(),
new TaskSelector(root, gameWorld.entity(id)),
new Shim(0, spaceAroundNameAndTaskArea),
employeeDataGroup,
new Shim(0, 0).setConstraint(AxisLayout.stretched()))
.setConstraint(AxisLayout.stretched(CONTROLS_AREA_WEIGHT));
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:26,代码来源:MainUIGroup.java
示例5: layoutUI
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private void layoutUI() {
Group summaryTable = new Group(new TableLayout(
new ExposedColumn(Style.HAlign.LEFT, true, 1, 0),
new ExposedColumn(Style.HAlign.RIGHT, false, 1, 0),
new ExposedColumn(Style.HAlign.CENTER, false, 1, HGAP_BETWEEN_COLUMNS),
new ExposedColumn(Style.HAlign.LEFT, true, 1, 0),
new ExposedColumn(Style.HAlign.RIGHT, false, 1, 0)))
.addStyles(Style.BACKGROUND.is(Background.blank().inset(TABLE_INSETS, TABLE_INSETS)));
summaryTable.add(
new Label("Users per hour").addStyles(Style.HALIGN.left),
usersPerHourLabel,
new Shim(0, 0),
new Label("Days remaining").addStyles(Style.HALIGN.left),
new DaysRemainingLabel(gameWorld),
new Label("Estimated exposure").addStyles(Style.HALIGN.left),
new EstimatedExposureLabel(gameWorld),
new Shim(0, 0),
new Label("Progress toward goal").addStyles(Style.HALIGN.left),
new ProgressTowardGoalLabel(gameWorld));
add(summaryTable,
new Group(AxisLayout.horizontal().offStretch())
.add(unitShim(),
new CompanyStatusGraph(gameWorld).setConstraint(AxisLayout.stretched(14f)),
unitShim())
.setConstraint(AxisLayout.stretched()));
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:27,代码来源:CompanyStatusGroup.java
示例6: EventsGroup
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
public EventsGroup(final GameWorld gameWorld) {
super(AxisLayout.horizontal().offStretch());
this.gameWorld = gameWorld;
gameWorld.onNarrativeEvent.connect(new Slot<NarrativeEvent>() {
@Override
public void onEmit(NarrativeEvent event) {
needsAttention.update(true);
((GameWorld.Systematized) gameWorld).gameTimeSystem.setEnabled(false);
currentEvent = checkNotNull(event);
if (content != null) {
updateContent();
}
invalidate();
}
});
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:17,代码来源:EventsGroup.java
示例7: createUI
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private void createUI() {
Root root = iface.createRoot(AxisLayout.vertical().offStretch(), SimGameStyle.newSheet(game.plat.graphics()), layer)
.setSize(game.bounds.size())
.addStyles(Style.BACKGROUND.is(Background.solid(Colors.WHITE)));
root.setLocation((game.plat.graphics().viewSize.width() - game.bounds.width()) / 2,
(game.plat.graphics().viewSize.height() - game.bounds.height()) / 2);
for (SurveyQuestion question : questions) {
SurveyQuestionView view = new SurveyQuestionView(question);
views.add(view);
root.add(view);
root.add(new Shim(0, game.bounds.percentOfHeight(0.01f)));
}
root.add(new Group(AxisLayout.horizontal())
.add(new Button("OK").onClick(new Slot<Button>() {
@Override
public void onEmit(Button button) {
logResponses();
game.screenStack.replace(new StartingScreen(game.screenStack), game.screenStack.slide());
}
}))
.setConstraint(AxisLayout.fixed())
);
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:24,代码来源:PreSurveyScreen.java
示例8: LikertTable
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private LikertTable() {
super(AxisLayout.vertical().offStretch());
for (Prompt prompt : PROMPTS) {
add(new Label(prompt.text).addStyles(Style.HALIGN.left));
Group responseGroup = new Group(AxisLayout.horizontal());
Selector selector = new Selector();
selectorMap.put(selector, prompt);
for (Level level : LEVELS) {
LevelButton toggle = new LevelButton(level);
selector.add(toggle);
responseGroup.add(toggle);
}
add(responseGroup);
add(new Shim(0, INTERNAL_SHIM_SIZE));
}
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:18,代码来源:PostSurveyScreen.java
示例9: SurveyQuestionView
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
public SurveyQuestionView(SurveyQuestion question) {
super(AxisLayout.vertical().offStretch());
this.question = checkNotNull(question);
add(new Label(question.text).addStyles(Style.HALIGN.left, Style.TEXT_WRAP.on));
Group optionsGroup = new Group(new TableLayout(
new ExposedColumn(Style.HAlign.CENTER, false, 1, 0),
new ExposedColumn(Style.HAlign.LEFT, true, 5, 0)));
for (SurveyQuestion.Option option : question.options) {
CheckBox checkBox = new OptionCheckBox(option.text);
selector.add(checkBox);
optionsGroup.add(checkBox);
optionsGroup.add(new Label(option.text).addStyles(Style.HALIGN.left));
}
add(optionsGroup);
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:17,代码来源:SurveyQuestionView.java
示例10: wasShown
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
@Override public void wasShown () {
// Create the root object that holds all the objects for the screen.
super.wasShown();
root = iface.createRoot(
AxisLayout.vertical().gap(15),
SimpleStyles.newSheet(),
layer);
root.addStyles(Style.BACKGROUND.is(
Background.bordered(0xFFCCCCCC, 0xFF99CCFF, 5).inset(5, 10)));
root.setSize(width(), height());
// Create a label at the top of the screen with a title.
root.add(new Label("Button Demo").addStyles(Style.FONT.is(TITLE_FONT)));
// Create the button and tell it to change its name when you click it.
final Button button = new Button("Click Me");
root.add(button.onClick(new UnitSlot() {
public void onEmit () {
button.text.update("Clicked");
}
}));
}
开发者ID:donkirkby,项目名称:playn-ui-tutorial,代码行数:23,代码来源:ButtonDemoScreen.java
示例11: createUI
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
@Override protected void createUI (Root root) {
root.add(new Shim(1, 10),
new Label("Pokeros").addStyles(
UI.titleStyles.add(Style.FONT.is(UI.defaultFont.derive(68f)))),
UI.stretchShim(),
new Button("Play").addStyles(UI.bigButtonStyles).onClick(
new UnitSlot() { public void onEmit () {
_game.screens.push(new GameScreen(_game));
}}),
new Button("Rules").addStyles(UI.medButtonStyles).onClick(
new UnitSlot() { public void onEmit () {
_game.screens.push(new RulesScreen(_game));
}}),
new Button("About").addStyles(UI.medButtonStyles).onClick(
new UnitSlot() { public void onEmit () {
_game.screens.push(new AboutScreen(_game));
}}),
UI.stretchShim(),
new Group(AxisLayout.horizontal()).add(
new Label("Wins:"), new Label(_game.history.wins), new Shim(10, 1),
new Label("Losses:"), new Label(_game.history.losses), new Shim(20, 1),
new Button("More...").onClick(
new UnitSlot() { public void onEmit () {
_game.screens.push(new HistoryScreen(_game));
}})));
}
开发者ID:samskivert,项目名称:mashups,代码行数:27,代码来源:MainMenuScreen.java
示例12: MainUIGroup
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
public MainUIGroup(final GameWorld gameWorld, final Interface iface, Root root) {
super(AxisLayout.vertical().offStretch().gap(0));
this.iface = checkNotNull(iface);
this.gameWorld = checkNotNull(gameWorld);
this.taskIconFactory = new TaskIconFactory();
employeeViewUpdateSystem = new EmployeeViewUpdateSystem(gameWorld);
gameInteractionArea = new GameInteractionArea(gameWorld, iface);
configureUI(root);
animateFocusChanges();
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:11,代码来源:MainUIGroup.java
示例13: configureUI
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private void configureUI(Root root) {
Iterator<Tile> backgroundIterator = BACKGROUNDS.iterator();
for (Entity e : gameWorld.workers) {
final int id = e.id;
EmployeeView employeeView = new EmployeeView(id, root, backgroundIterator.next());
developerViews.put(id, employeeView);
add(employeeView);
}
gameInteractionArea.setConstraint(AxisLayout.stretched(2));
add(gameInteractionArea);
new EmployeeAtWorkSystem(gameWorld);
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:13,代码来源:MainUIGroup.java
示例14: EmployeeView
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
EmployeeView(final int id, Root root, Tile background) {
super(AxisLayout.horizontal().offStretch());
this.id = id;
checkNotNull(root);
addStyles(Style.BACKGROUND.is(
ExpandableBackground.background(background)
.withWorkHours(((GameWorld.Systematized) gameWorld).workHoursSystem)))
.setConstraint(AxisLayout.stretched());
add(createTransparentClickableArea(),
createControlsAndBioGroup(root));
layer.add(gameWorld.sprite.get(id));
gameWorld.position.setX(id, WORKER_X);
animateBasedOnAtWorkStatus();
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:16,代码来源:MainUIGroup.java
示例15: createSkillSummaryGroup
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private Group createSkillSummaryGroup() {
final int color = Palette.NAME_COLOR;
return new Group(AxisLayout.horizontal())
.add(new Label(taskIconFactory.getIcon(gameWorld.developmentTaskId)).addStyles(Style.COLOR.is(color)),
createSkillLabel(developmentSkill),
new Shim(percentOfViewHeight(0.001f), 0),
new Label(taskIconFactory.getIcon(gameWorld.maintenanceTaskId)).addStyles(Style.COLOR.is(color)),
createSkillLabel(maintenanceSkill));
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:10,代码来源:MainUIGroup.java
示例16: GameInteractionArea
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
public GameInteractionArea(GameWorld gameWorld, Interface iface) {
super(AxisLayout.vertical().offStretch());
this.gameWorld = checkNotNull(gameWorld);
this.iface = checkNotNull(iface);
statusGroup = new CompanyStatusGroup(gameWorld);
add(shown);
add(new ButtonArea().setConstraint(AxisLayout.fixed()));
addStyles(Style.BACKGROUND.is(Background.solid(Palette.BACKGROUND)));
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:11,代码来源:GameInteractionArea.java
示例17: ButtonArea
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
ButtonArea() {
super(AxisLayout.horizontal());
returnToStatusButtonOnEventCompletion();
for (ChangeViewControl button : allButtons) {
add(button);
}
add(new MuteCheckBox());
setDefaultViewTo(statusButton);
configureTableValidationOnClockTick();
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:11,代码来源:GameInteractionArea.java
示例18: layoutUI
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private void layoutUI() {
final IDimension parentSize = _parent.size();
setConstraint(Constraints.fixedSize(parentSize.width(), parentSize.height()));
Group textBox = makeTextBox(parentSize);
add(textBox,
new Group(AxisLayout.vertical())
.add(new Shim(0, 0).setConstraint(AxisLayout.stretched()),
new Label(makeSpeakerIcon(parentSize)),
new Shim(0, percentOfScreenHeight(0.01f)))
.setConstraint(AxisLayout.stretched()));
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:12,代码来源:EventsGroup.java
示例19: makeTextBox
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private Group makeTextBox(IDimension parentSize) {
final float width = parentSize.width() * TEXTBOX_WIDTH_PERCENT;
content = new Group(AxisLayout.vertical());
updateContent();
scroller = new Scroller(content).setBehavior(Scroller.Behavior.VERTICAL)
.setConstraint(Constraints.fixedSize(width, parentSize.height()));
return new SizableGroup(AxisLayout.vertical().offStretch(), width, parentSize.height())
.add(scroller)
.addStyles(Style.BACKGROUND.is(CALLOUT_BACKGROUND));
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:11,代码来源:EventsGroup.java
示例20: createContentArea
import tripleplay.ui.layout.AxisLayout; //导入依赖的package包/类
private Group createContentArea() {
Group group = new Group(AxisLayout.vertical());
group.add(new Label(Icons.image(SimGame.game.assets.getImage(GameAssets.ImageKey.LOGO))));
for (String s : CREDITS) {
group.add(new Label(s)
.setStyles(
Style.COLOR.is(Colors.WHITE),
Style.TEXT_WRAP.on));
}
group.add(new Label(" "));
group.add(createBackButton());
return group;
}
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:14,代码来源:CreditScreen.java
注:本文中的tripleplay.ui.layout.AxisLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论