Package org.spoutcraft.api.gui

Examples of org.spoutcraft.api.gui.GenericButton


  }

  @Override
  protected void createInstances() {
    labels.clear();
    buttonDone = new GenericButton("Done");
    getScreen().attachWidget("Spoutcraft", buttonDone);

    buttonRefresh = new GenericButton();
    getScreen().attachWidget("Spoutcraft", buttonRefresh);

    buttonAddFavorite = new GenericButton("Add Favorite");
    getScreen().attachWidget("Spoutcraft", buttonAddFavorite);

    buttonJoin = new GenericButton("Join");
    getScreen().attachWidget("Spoutcraft", buttonJoin);

    content = new GenericScrollArea();
    content.setScrollBarPolicy(Orientation.HORIZONTAL, ScrollBarPolicy.SHOW_NEVER);

    getScreen().attachWidget("Spoutcraft", content);

    labelTitle = new GenericLabel(item.getTitle());
    getScreen().attachWidget("Spoutcraft", labelTitle);

    buttonOpenBrowser = new GenericButton("More Info...");
    getScreen().attachWidget("Spoutcraft", buttonOpenBrowser);

    labelCategoryLabel = new GenericLabel("Category");
    content.attachWidget("Spoutcraft", labelCategoryLabel);
    labels.add(labelCategoryLabel);
View Full Code Here


  public boolean hasGallery() {
    return gallery.size() != 0;
  }

  public void setupGallery() {
    buttonGalleryNext = new GenericButton("->");
    buttonGalleryPrev = new GenericButton("<-");
    labelGalleryImageTitle = new GenericLabel();
    labelGalleryImageDesc = new GenericLabel();
    textureGalleryImage = new GenericTexture("");
    textureGalleryImage.setFinishDelegate(new ImageUpdate());
    labelGalleryTitle = new GenericLabel("Gallery");
View Full Code Here

    textIp.setX(left).setY(top);
    getScreen().attachWidget("Spoutcraft", textIp);
    textIp.setText(item.getIp() + (item.getPort() != ServerItem.DEFAULT_PORT ? ":" + item.getPort() : ""));
    top+=25;

    buttonClear = new GenericButton("Clear");
    buttonClear.setWidth(100).setHeight(20).setX(textIp.getX()).setY(top);
    getScreen().attachWidget("Spoutcraft", buttonClear);

    buttonDone = new GenericButton("Done");
    buttonDone.setWidth(200).setHeight(20).setX(width - 205).setY(height - 25);
    getScreen().attachWidget("Spoutcraft", buttonDone);

    buttonCancel = new GenericButton("Cancel");
    buttonCancel.setWidth(200).setHeight(20).setX(width - 205 - 205).setY(height - 25);
    getScreen().attachWidget("Spoutcraft", buttonCancel);

    updateButtons();
  }
View Full Code Here

    notFull = new FilterButton("Not Full", "notfull", model);
    accessType = new AccessTypeFilter(model);
    search = new SearchField(model);
    buttonCountry = new CountryButton();
    view = new GenericListView(model);
    buttonJoin = new GenericButton("Join Server");
    buttonMainMenu = new GenericButton("Main Menu");
    buttonFavorites = new GenericButton("Favorites");
    buttonRefresh = new GenericButton("Refresh");
    buttonReset = new GenericButton("Reset Filters");
    buttonAddServer = new GenericButton("Add Your Server");
    buttonInfo = new GenericButton("More Info...");

    if (!model.getCurrentUrl().equals(model.getDefaultUrl())) {
      model.clear();
      model.refreshAPIData(model.getDefaultUrl(), 0, true);
    }
View Full Code Here

    labelTitle = new GenericLabel("Public Servers");
    labelTitle.setY(12).setX(width / 2 - mc.fontRenderer.getStringWidth(labelTitle.getText()) / 2);
    labelTitle.setHeight(15).setWidth(mc.fontRenderer.getStringWidth(labelTitle.getText()) / 2);
    getScreen().attachWidget("Spoutcraft", labelTitle);

    buttonMoveUp = new GenericButton("/\\");
    buttonMoveUp.setTooltip("Move Item Up");
    buttonMoveUp.setX(5).setY(5);
    buttonMoveUp.setHeight(20).setWidth(20);
    getScreen().attachWidget("Spoutcraft", buttonMoveUp);

    buttonMoveDown = new GenericButton("\\/");
    buttonMoveDown.setTooltip("Move Item Down");
    buttonMoveDown.setX(25).setY(5);
    buttonMoveDown.setHeight(20).setWidth(20);
    getScreen().attachWidget("Spoutcraft", buttonMoveDown);

    buttonRefresh = new GenericButton("Refresh");
    buttonRefresh.setHeight(20).setWidth(100).setX(width - 105).setY(5);
    getScreen().attachWidget("Spoutcraft", buttonRefresh);

    int viewheight = height - 110;
    view = new GenericListView(model);
    view.setX(5).setY(30).setWidth(width - 10).setHeight(viewheight);
    getScreen().attachWidget("Spoutcraft", view);

    int top = (int) (view.getY() + view.getHeight() + 5);

    int totalWidth = Math.min(width - 9, 200 * 3 + 10);
    int cellWidth = (totalWidth - 10) / 3;
    int left = width / 2 - totalWidth / 2;
    int center = left + cellWidth + 5;
    int right = center + cellWidth + 5;

    String text = SpoutClient.getHandle().gameSettings.lastServer.replace("_", ":");
    if (textQuickJoin != null) {
      text = textQuickJoin.getText();
    }
    textQuickJoin = new QuickJoin();
    textQuickJoin.setX(left + 2).setY(top + 2).setHeight(16).setWidth((cellWidth * 2 + 5 - 4) - (cellWidth/2));
    textQuickJoin.setMaximumCharacters(0);
    textQuickJoin.setText(text);
    getScreen().attachWidget("Spoutcraft", textQuickJoin);

    buttonClear = new GenericButton("Clear");
    buttonClear.setX(left + 10 + (cellWidth*2) - (cellWidth/2)).setY(top).setWidth((cellWidth/2) - 5).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonClear);
   
    buttonQuickJoin = new GenericButton("Quick Join");
    buttonQuickJoin.setX(right).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonQuickJoin);

    top += 25;

    buttonJoin = new GenericButton("Join Server");
    buttonJoin.setX(right).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonJoin);

    buttonAddtoFavorites = new GenericButton("Add this to Favorites");
    buttonAddtoFavorites.setX(center).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonAddtoFavorites);

    top += 25;
    buttonAddServer = new GenericButton("Add Your Server");
    buttonAddServer.setX(left).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonAddServer);
   
    buttonFavoritesList = new GenericButton("Favorites");
    buttonFavoritesList.setX(center).setY(top).setWidth(cellWidth)
        .setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonFavoritesList);

    buttonMainMenu = new GenericButton("Main Menu");
    buttonMainMenu.setX(right).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonMainMenu);
    refresh();
    updateButtons();
  }
View Full Code Here

    labelTitle = new GenericLabel("Favorite Servers");
    labelTitle.setY(12).setX(width / 2 - mc.fontRenderer.getStringWidth(labelTitle.getText()) / 2);
    labelTitle.setHeight(15).setWidth(mc.fontRenderer.getStringWidth(labelTitle.getText()) / 2);
    getScreen().attachWidget("Spoutcraft", labelTitle);

    buttonMoveUp = new GenericButton("/\\");
    buttonMoveUp.setTooltip("Move Item Up");
    buttonMoveUp.setX(5).setY(5);
    buttonMoveUp.setHeight(20).setWidth(20);
    getScreen().attachWidget("Spoutcraft", buttonMoveUp);

    buttonMoveDown = new GenericButton("\\/");
    buttonMoveDown.setTooltip("Move Item Down");
    buttonMoveDown.setX(25).setY(5);
    buttonMoveDown.setHeight(20).setWidth(20);
    getScreen().attachWidget("Spoutcraft", buttonMoveDown);

    buttonRefresh = new GenericButton("Refresh");
    buttonRefresh.setHeight(20).setWidth(100).setX(width - 105).setY(5);
    getScreen().attachWidget("Spoutcraft", buttonRefresh);

    int viewheight = height - 110;
    view = new GenericListView(model);
    view.setX(5).setY(30).setWidth(width - 10).setHeight(viewheight);
    getScreen().attachWidget("Spoutcraft", view);

    int top = (int) (view.getY() + view.getHeight() + 5);

    int totalWidth = Math.min(width - 9, 200 * 3 + 10);
    int cellWidth = (totalWidth - 10) / 3;
    int left = width / 2 - totalWidth / 2;
    int center = left + cellWidth + 5;
    int right = center + cellWidth + 5;

    String text = SpoutClient.getHandle().gameSettings.lastServer.replace("_", ":");
    if (textQuickJoin != null) {
      text = textQuickJoin.getText();
    }
    textQuickJoin = new QuickJoin();
    textQuickJoin.setX(left + 2).setY(top + 2).setHeight(16).setWidth((cellWidth * 2 + 5 - 4) - (cellWidth/2));
    textQuickJoin.setMaximumCharacters(0);
    textQuickJoin.setText(text);
    getScreen().attachWidget("Spoutcraft", textQuickJoin);

    buttonClear = new GenericButton("Clear");
    buttonClear.setX(left + 10 + (cellWidth*2) - (cellWidth/2)).setY(top).setWidth((cellWidth/2) - 5).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonClear);

    buttonQuickJoin = new GenericButton("Quick Join");
    buttonQuickJoin.setX(right).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonQuickJoin);

    top += 25;

    buttonJoin = new GenericButton("Join Server");
    buttonJoin.setX(right).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonJoin);

    buttonAdd = new GenericButton("Add Favorite");
    buttonAdd.setX(center).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonAdd);

    buttonEdit = new GenericButton("Edit");
    buttonEdit.setX(left).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonEdit);

    top += 25;

    buttonDelete = new DeleteFavoriteButton(this);
    buttonDelete.setX(left).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonDelete);

    buttonServerList = new GenericButton("Public Servers");
    buttonServerList.setX(center).setY(top).setWidth(cellWidth)
        .setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonServerList);

    buttonMainMenu = new GenericButton("Main Menu");
    buttonMainMenu.setX(right).setY(top).setWidth(cellWidth).setHeight(20);
    getScreen().attachWidget("Spoutcraft", buttonMainMenu);
    refresh();
    updateButtons();
    SpoutClient.getInstance().getServerManager().staticServers.load();
View Full Code Here

    switchToSimpleCheck.setAlign(WidgetAnchor.CENTER_CENTER);
    switchToSimpleCheck.setX(5).setY(3).setWidth(100).setHeight(20);
    switchToSimpleCheck.setPriority(RenderPriority.Low);
    getScreen().attachWidget("Spoutcraft", switchToSimpleCheck);

    doneButton = new GenericButton("Done");
    doneButton.setAlign(WidgetAnchor.CENTER_CENTER);
    doneButton.setX(right).setY(height - 25);
    doneButton.setHeight(20).setWidth(150);
    getScreen().attachWidget("Spoutcraft", doneButton);
View Full Code Here

    switchToAdvancedCheck.setChecked(false);
    switchToAdvancedCheck.setX(5).setY(3).setWidth(100).setHeight(20);
    switchToAdvancedCheck.setPriority(RenderPriority.Low);
    getScreen().attachWidget("Spoutcraft", switchToAdvancedCheck);

    doneButton = new GenericButton("Done");
    doneButton.setAlign(WidgetAnchor.CENTER_CENTER);
    doneButton.setX(right).setY(height - 25);
    doneButton.setHeight(20).setWidth(150);
    getScreen().attachWidget("Spoutcraft", doneButton);
View Full Code Here

  }

  @Override
  protected void createInstances() {
    title = new GenericLabel("About");
    buttonDone = new GenericButton("Main Menu");
    scroll = new GenericScrollArea();
   
    labelSpoutcraftVersion = new GenericLabel(SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild() + "\nLicensed under LGPLv3");
    labelMinecraftVersion = new GenericLabel("Copyright Mojang AB");
    labelSpoutcraftVersion.setAlign(WidgetAnchor.TOP_RIGHT);
View Full Code Here

    control = new ResetButton(this).setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(height - 25);
    getScreen().attachWidget("Spoutcraft", control);

    doneButton = new GenericButton("Done");
    doneButton.setAlign(WidgetAnchor.CENTER_CENTER);
    doneButton.setX(right).setY(height - 25);
    doneButton.setHeight(20).setWidth(150);
    getScreen().attachWidget("Spoutcraft", doneButton);

    int top = 5;
    final Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F);

    label = new GenericLabel("Minimap Position");
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(top);
    label.setTextColor(grey);
    screen.attachWidget("Spoutcraft", label);

    top += 11;

    Gradient linebreak = new GenericGradient();
    linebreak.setBottomColor(grey);
    linebreak.setTopColor(grey);
    linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318);
    screen.attachWidget("Spoutcraft", linebreak);

    top += 6;

    positionButton = new GenericButton("Move Minimap");
    positionButton.setGeometry(width / 2 - 75, top, 150, 20);
    screen.attachWidget("Spoutcraft", positionButton);

    top += 27;

    label = new GenericLabel("Minimap Configuration");
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(top);
    label.setTextColor(grey);
    screen.attachWidget("Spoutcraft", label);

    top += 11;

    linebreak = new GenericGradient();
    linebreak.setBottomColor(grey);
    linebreak.setTopColor(grey);
    linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318);
    screen.attachWidget("Spoutcraft", linebreak);

    top += 6;

    toggleCheckBox = new MinimapToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    toggleCheckBox.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", toggleCheckBox);

    control = new ColorToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    control.setEnabled(false);
    control.setTooltip("Feature broken.");

    top += 22;

    control = new CoordsToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    control = new SquareToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new ScaleToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    control = new DirectionsToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new MinimapModeButton().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    control.setEnabled(false);
    control.setTooltip("Feature broken.");

    control = new ZoomModeButton().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new DeathpointsCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    control = new BackgroundCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new HeightMapCheckBox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    control = new ScanRadiusSlider().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(right).setY(top);
    screen.attachWidget("Spoutcraft", control);

    top += 22;

    hideable.add(control);

    control = new ShowEntitiesCheckbox().setAlign(WidgetAnchor.TOP_CENTER);
    control.setWidth(150).setHeight(20).setX(left).setY(top);
    screen.attachWidget("Spoutcraft", control);

    hideable.add(control);

    advancedMobsButton = new GenericButton("Filter Mobs").setAlign(WidgetAnchor.TOP_CENTER);
    advancedMobsButton.setWidth(150).setHeight(20).setX(right).setY(top);
    advancedMobsButton.setTooltip("Select which mobs are shown on the minimap");
    screen.attachWidget("Spoutcraft", advancedMobsButton);

    hideable.add(advancedMobsButton);
View Full Code Here

TOP

Related Classes of org.spoutcraft.api.gui.GenericButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.