Package org.spoutcraft.api.gui

Examples of org.spoutcraft.api.gui.Color


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

    labelCategory = new GenericLabel("...");
    labelCategory.setTextColor(new Color(0xffaaaaaa));
    content.attachWidget("Spoutcraft", labelCategory);

    labelMCVersionLabel = new GenericLabel("Minecraft Version");
    content.attachWidget("Spoutcraft", labelMCVersionLabel);
    labels.add(labelMCVersionLabel);

    labelMCVersion = new GenericLabel("...");
    labelMCVersion.setTextColor(new Color(0xffaaaaaa));
    content.attachWidget("Spoutcraft", labelMCVersion);

    labelAccessLabel = new GenericLabel("Access Type");
    content.attachWidget("Spoutcraft", labelAccessLabel);
    labels.add(labelAccessLabel);

    String access = "Open";
    switch(item.accessType) {
      case ServerItem.WHITELIST:
        access = "Whitelist";
        break;
      case ServerItem.GRAYLIST:
        access = "Graylist";
        break;
      case ServerItem.BLACKLIST:
        access = "Blacklist";
        break;
    }
    labelAccess = new GenericLabel(access);
    labelAccess.setTextColor(new Color(0xffaaaaaa));
    content.attachWidget("Spoutcraft", labelAccess);

    labelAddress = new GenericLabel(item.getIp() + (item.getPort() != ServerItem.DEFAULT_PORT ? item.getPort() : ""));
    labelAddress.setTextColor(new Color(0xffaaaaaa));
    content.attachWidget("Spoutcraft", labelAddress);

    labelAddressLabel = new GenericLabel("Address");
    content.attachWidget("Spoutcraft", labelAddressLabel);
    labels.add(labelAddressLabel);

    labelMotd = new GenericLabel(item.getMotd());
    content.attachWidget("Spoutcraft", labelMotd);
    labelMotd.setTextColor(new Color(0xffaaaaaa));

    labelMotdLabel = new GenericLabel("MOTD");
    content.attachWidget("Spoutcraft", labelMotdLabel);
    labels.add(labelMotdLabel);

    labelDescription = new GenericLabel("...");
    content.attachWidget("Spoutcraft", labelDescription);
    labelDescription.setTextColor(new Color(0xffaaaaaa));
    labelDescription.setWrapLines(true);

    labelPlayersLabel = new GenericLabel("Players");
    content.attachWidget("Spoutcraft", labelPlayersLabel);
    labels.add(labelPlayersLabel);

    labelPlayers = new GenericLabel();
    labelPlayers.setTextColor(new Color(0xffaaaaaa));
    content.attachWidget("Spoutcraft", labelPlayers);

    linkForum = new LinkButton("Go to Forum", "");
    getScreen().attachWidget("Spoutcraft", linkForum);
    linkSite = new LinkButton("Go to Website", "");
    getScreen().attachWidget("Spoutcraft", linkSite);

    labelSpoutcraftLabel = new GenericLabel("Spoutcraft");
    content.attachWidget("Spoutcraft", labelSpoutcraftLabel);
    labels.add(labelSpoutcraftLabel);

    labelSpoutcraft = new GenericLabel("...");
    labelSpoutcraft.setTextColor(new Color(0xffaaaaaa));
    content.attachWidget("Spoutcraft", labelSpoutcraft);
    textureIcon = new GenericTexture("http://cdn.spout.org/server/thumb/" + item.getDatabaseId() + ".png");
    textureIcon.setFinishDelegate(new ImageUpdate());
    textureIcon.setWidth(48).setHeight(48);
    content.attachWidget("Spoutcraft", textureIcon);
View Full Code Here


  }

  @Override
  public void updateScreen() {
    if (loadThread != null) {
      Color color = new Color(0, 1f, 0);
      double darkness = 0;
      long t = System.currentTimeMillis() % 1000;
      darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2;
      color.setGreen(1f - (float)darkness);
      buttonRefresh.setDisabledColor(color);
    }
    super.updateScreen();
  }
View Full Code Here

    buttonInfo.setEnabled(b);

    if (model.isLoading()) {
      buttonRefresh.setEnabled(false);
      buttonRefresh.setText("Loading...");
      buttonRefresh.setDisabledColor(new Color(0f,1f,0f));
    } else {
      buttonRefresh.setEnabled(true);
      buttonRefresh.setText("Refresh");
    }
  }
View Full Code Here

  }

  @Override
  public void updateScreen() {
    if (model.isLoading()) {
      Color color = new Color(0, 1f, 0);
      double darkness = 0;
      long t = System.currentTimeMillis() % 1000;
      darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2;
      color.setGreen(1f - (float)darkness);
      buttonRefresh.setDisabledColor(color);
    }
    super.updateScreen();
  }
View Full Code Here

    buttonAddtoFavorites.setEnabled(enable);

    if (model.isPolling()) {
      buttonRefresh.setEnabled(false);
      buttonRefresh.setText("Polling...");
      buttonRefresh.setDisabledColor(new Color(0f, 0f, 1f));
    } else {
      buttonRefresh.setEnabled(true);
      buttonRefresh.setText("Refresh");
    }
   
View Full Code Here

  }

  @Override
  public void updateScreen() {
    if (model.isPolling()) {
      Color color = new Color(0, 0f, 0);
      double darkness = 0;
      long t = System.currentTimeMillis() % 1000;
      darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2;
      color.setBlue(1f - (float) darkness);
      if (model.isPolling()) {
        buttonRefresh.setDisabledColor(color);
      }

      // If polling locks up and takes > 15s, unlock the button
View Full Code Here

      }
    }

    int color = 0xffffff;
    if ((getPing() == PollResult.PING_POLLING || isPolling()) && !showPingWhilePolling) {
      Color c1 = new Color(0, 0, 0);
      double darkness = 0;
      long t = System.currentTimeMillis() % 1000;
      darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2;
      c1.setBlue(1f - (float)darkness);
      color = c1.toInt();
    }

    font.drawStringWithShadow(r.getFittingText(sMotd, width - 10 - margin2 - marginleft), x + marginleft, y + 11, color);

    GL11.glColor4f(1f, 1f, 1f, 1f);
View Full Code Here

    label.setX((int) (width / 2 - size / 2)).setY(16);
    label.setFixed(true).setPriority(RenderPriority.Lowest);
    getScreen().attachWidget("Spoutcraft", label);

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

    hastebinLink = new GenericLabel("Generating hastie...");
    hastebinLink.setX(95).setY(top);
    hastebinLink.setTextColor(grey);
    screen.attachWidget("Spoutcraft", hastebinLink);
View Full Code Here

    label.setX((int) (width / 2 - size / 2)).setY(16);
    label.setFixed(true).setPriority(RenderPriority.Lowest);
    getScreen().attachWidget("Spoutcraft", label);

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

    label = new GenericLabel(message);
    size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText());
    label.setX((int) (width / 2 - size / 2)).setY(top);
    label.setTextColor(grey);
View Full Code Here

    buttonAdd.setEnabled(true);

    if (model.isPolling()) {
      buttonRefresh.setEnabled(false);
      buttonRefresh.setText("Polling...");
      buttonRefresh.setDisabledColor(new Color(0f, 0f, 1f));
    } else {
      buttonRefresh.setEnabled(true);
      buttonRefresh.setText("Refresh");
    }
   
View Full Code Here

TOP

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

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.