Exemple #1
0
  /**
   * Creates and returns the inspector tab component.
   *
   * @return the inspector tab component
   */
  private JComponent createInspectorTab() {
    final XTabbedPane tp = new XTabbedPane();

    tp.addTab("Raw Text Data", Icons.F_DOCUMENT_TEXT, new RawTextDataComp(repProc), false);
    tp.addTab(
        "Raw Data Tree",
        Icons.F_DOCUMENT_TREE,
        new Producer<JComponent>() {
          @Override
          public JComponent produce() {
            return new RawDataTreeComp(repProc);
          }
        },
        false);
    tp.addTab(
        "Binary Data",
        Icons.F_DOCUMENT_BINARY,
        new Producer<JComponent>() {
          @Override
          public JComponent produce() {
            return new BinaryDataComp(repProc);
          }
        },
        false);

    return tp;
  }
Exemple #2
0
  /** Builds the GUI of the page. */
  private void buildGui() {
    final XTabbedPane tp = new XTabbedPane();

    tp.addTab("Charts", Icons.F_CHART, new ChartsComp(repProc), true);
    tp.addTab(
        "Game Info",
        Icons.F_INFORMATION_BALLOON,
        new Producer<JComponent>() {
          @Override
          public JComponent produce() {
            return new GameInfoComp(repProc);
          }
        },
        true);
    tp.addTab(
        "Users (" + repProc.users.length + ")",
        Icons.F_USERS,
        new Producer<JComponent>() {
          @Override
          public JComponent produce() {
            return new UsersComp(repProc);
          }
        },
        true);
    tp.addTab(
        "Build Orders",
        Icons.F_BLOCK,
        new Producer<JComponent>() {
          @Override
          public JComponent produce() {
            return new BuildOrdersComp(repProc);
          }
        },
        true);
    tp.addTab(
        "Map info",
        Icons.F_MAP,
        new Producer<JComponent>() {
          @Override
          public JComponent produce() {
            return new MapInfoComp(repProc);
          }
        },
        true);
    tp.addTab(
        "Chat (" + repProc.getChatMessagesCount() + ")",
        Icons.F_BALLOONS,
        new Producer<JComponent>() {
          @Override
          public JComponent produce() {
            return new ChatComp(repProc);
          }
        },
        true);
    final int inspectorTabIdx = tp.getTabCount();
    tp.addTab(
        "Inspector",
        Icons.F_USER_DETECTIVE,
        new Producer<JComponent>() {
          @Override
          public JComponent produce() {
            return createInspectorTab();
          }
        },
        true);

    final ISettingChangeListener scl =
        new ISettingChangeListener() {
          @Override
          public void valuesChanged(final ISettingChangeEvent event) {
            if (event.affected(LSettings.SKILL_LEVEL))
              if (SkillLevel.DEVELOPER.isAtLeast()) {
                // Developer, show all tabs
                if (tp.getHiddenTabCount() > 0) tp.unhideTab(0, inspectorTabIdx);
              } else {
                // Below Developer, hide Inspector tab
                if (tp.getHiddenTabCount() == 0) tp.hideTab(inspectorTabIdx);
              }
          }
        };
    SettingsGui.addBindExecuteScl(scl, LEnv.LAUNCHER_SETTINGS, LSettings.SKILL_LEVEL.SELF_SET, tp);

    addCenter(tp);
  }