Search in sources :

Example 1 with ElementWidget

use of com.playshogi.website.gwt.client.util.ElementWidget in project playshogi by Tellmarch.

the class MainPageViewBeta method getPracticePanel.

private Widget getPracticePanel() {
    DecoratorPanel decoratorPanel = new DecoratorPanel();
    FlowPanel panel = new FlowPanel();
    panel.add(new HTML("<b>Practice</b>"));
    panel.add(new HTML("Practice your playing skills against a computer."));
    panel.add(new HTML("<br>"));
    Grid grid = new Grid(1, 2);
    grid.setWidget(0, 0, new Image(resources.practiceBackground()));
    ElementWidget button = new ElementWidget(Button.createPrimary("Play").addClickListener(evt -> placeController.goTo(new PlayPlace())).element());
    button.getElement().getStyle().setMarginLeft(1, Style.Unit.EM);
    grid.setWidget(0, 1, button);
    panel.add(grid);
    decoratorPanel.setWidget(panel);
    panel.setWidth("450px");
    panel.setHeight("200px");
    return decoratorPanel;
}
Also used : ElementWidget(com.playshogi.website.gwt.client.util.ElementWidget)

Example 2 with ElementWidget

use of com.playshogi.website.gwt.client.util.ElementWidget in project playshogi by Tellmarch.

the class TsumeView method createLowerLeftPanel.

private FlowPanel createLowerLeftPanel() {
    FlowPanel panel = new FlowPanel();
    panel.add(BoardButtons.createSettingsWidget(shogiBoard));
    panel.add(BoardButtons.createClearArrowsWidget(shogiBoard));
    panel.add(new ElementWidget(org.dominokit.domino.ui.button.Button.createPrimary(Icons.ALL.help_outline()).setBackground(Theme.DEEP_PURPLE.color()).circle().addClickListener(e -> getHelpDialog().open()).setTooltip("What is TsumeShogi?").style().setMarginLeft("1em").element()));
    return panel;
}
Also used : ElementWidget(com.playshogi.website.gwt.client.util.ElementWidget) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 3 with ElementWidget

use of com.playshogi.website.gwt.client.util.ElementWidget in project playshogi by Tellmarch.

the class MainPageViewBeta method getLearnPanel.

private Widget getLearnPanel() {
    DecoratorPanel decoratorPanel = new DecoratorPanel();
    FlowPanel panel = new FlowPanel();
    panel.add(new HTML("<b>Learn</b>"));
    panel.add(new HTML("Learn how to play Shogi with an interactive tutorial!"));
    panel.add(new HTML("<br>"));
    Grid grid = new Grid(1, 2);
    grid.setWidget(0, 0, new Image(resources.learnBackground()));
    ElementWidget button = new ElementWidget(Button.createPrimary("Tutorial").addClickListener(evt -> placeController.goTo(new TutorialPlace())).element());
    button.getElement().getStyle().setMarginLeft(1, Style.Unit.EM);
    grid.setWidget(0, 1, button);
    panel.add(grid);
    decoratorPanel.setWidget(panel);
    panel.setWidth("450px");
    panel.setHeight("200px");
    return decoratorPanel;
}
Also used : ElementWidget(com.playshogi.website.gwt.client.util.ElementWidget)

Example 4 with ElementWidget

use of com.playshogi.website.gwt.client.util.ElementWidget in project playshogi by Tellmarch.

the class MainPageViewBeta method getCollectionsPanel.

private Widget getCollectionsPanel() {
    DecoratorPanel decoratorPanel = new DecoratorPanel();
    FlowPanel panel = new FlowPanel();
    panel.add(new HTML("<b>Collections</b>"));
    panel.add(new HTML("Browse or Create collections of Shogi games."));
    panel.add(new HTML("<br>"));
    Grid grid = new Grid(1, 2);
    grid.setWidget(0, 0, new Image(resources.collectionsBackground()));
    ElementWidget button = new ElementWidget(Button.createPrimary("Collections").addClickListener(evt -> placeController.goTo(new PublicCollectionsPlace())).element());
    button.getElement().getStyle().setMarginLeft(1, Style.Unit.EM);
    grid.setWidget(0, 1, button);
    panel.add(grid);
    decoratorPanel.setWidget(panel);
    panel.setWidth("450px");
    panel.setHeight("200px");
    return decoratorPanel;
}
Also used : ElementWidget(com.playshogi.website.gwt.client.util.ElementWidget)

Example 5 with ElementWidget

use of com.playshogi.website.gwt.client.util.ElementWidget in project playshogi by Tellmarch.

the class MainPageViewBeta method getPuzzlesPanel.

private Widget getPuzzlesPanel() {
    DecoratorPanel decoratorPanel = new DecoratorPanel();
    FlowPanel panel = new FlowPanel();
    panel.add(new HTML("<b>Puzzles</b>"));
    panel.add(new HTML("Improve your shogi skills by solving puzzles."));
    panel.add(new HTML("<br>"));
    panel.add(new Image(resources.puzzleBlue()));
    panel.add(new ElementWidget(Button.createPrimary("TsumeShogi Problems").addClickListener(evt -> placeController.goTo(new TsumePlace())).element()));
    panel.add(new Image(resources.alarmClockRed()));
    panel.add(new ElementWidget(Button.createPrimary("ByoYomi Survival").addClickListener(evt -> placeController.goTo(new ByoYomiLandingPlace())).element()));
    decoratorPanel.setWidget(panel);
    panel.setWidth("450px");
    panel.setHeight("200px");
    return decoratorPanel;
}
Also used : ElementWidget(com.playshogi.website.gwt.client.util.ElementWidget) PlaceController(com.google.gwt.place.shared.PlaceController) ClientBundle(com.google.gwt.resources.client.ClientBundle) com.playshogi.website.gwt.client.place(com.playshogi.website.gwt.client.place) Style(com.google.gwt.dom.client.Style) ImageResource(com.google.gwt.resources.client.ImageResource) Inject(com.google.inject.Inject) EventBus(com.google.web.bindery.event.shared.EventBus) GWT(com.google.gwt.core.client.GWT) com.google.gwt.user.client.ui(com.google.gwt.user.client.ui) Button(org.dominokit.domino.ui.button.Button) Singleton(com.google.inject.Singleton) ElementWidget(com.playshogi.website.gwt.client.util.ElementWidget)

Aggregations

ElementWidget (com.playshogi.website.gwt.client.util.ElementWidget)5 GWT (com.google.gwt.core.client.GWT)1 Style (com.google.gwt.dom.client.Style)1 PlaceController (com.google.gwt.place.shared.PlaceController)1 ClientBundle (com.google.gwt.resources.client.ClientBundle)1 ImageResource (com.google.gwt.resources.client.ImageResource)1 com.google.gwt.user.client.ui (com.google.gwt.user.client.ui)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 Inject (com.google.inject.Inject)1 Singleton (com.google.inject.Singleton)1 EventBus (com.google.web.bindery.event.shared.EventBus)1 com.playshogi.website.gwt.client.place (com.playshogi.website.gwt.client.place)1 Button (org.dominokit.domino.ui.button.Button)1