コード例 #1
0
  public boolean build() {
    scrollPaneTable.clearChildren();

    if (properties.getProxies().first() instanceof GroupEntityProxy) {
      return false;
    }

    boolean atLeastOneComponentAdded = false;

    for (Class<? extends Component> clazz : componentClasses) {
      if (EntityUtils.isComponentCommon(clazz, properties.getProxies()) == false) {
        VisTextButton button = new VisTextButton(clazz.getSimpleName(), buttonStyle);
        button.setFocusBorderEnabled(false);
        scrollPaneTable.add(button).expandX().fillX().row();

        button.addListener(
            new VisChangeListener(
                (event, actor) -> {
                  listener.selected(clazz);
                  remove();
                }));

        atLeastOneComponentAdded = true;
      }
    }

    invalidateHierarchy();

    return atLeastOneComponentAdded;
  }
コード例 #2
0
  @Override
  public void updateUIFromEntities(
      ImmutableArray<EntityProxy> proxies, Field field, Class<?> fieldType)
      throws ReflectiveOperationException {
    StringStringMapView view = views.get(field);

    if (proxies.size() > 1) view.multipleSelected();
    else view.setMap(EntityUtils.getFirstEntityComponent(proxies, Variables.class));
  }
コード例 #3
0
  @Override
  public void updateUIFromEntities(
      ImmutableArray<EntityProxy> proxies, Field field, Class<?> fieldType)
      throws ReflectiveOperationException {
    Vector2ArrayView view = views.get(field);

    if (proxies.size() > 1) view.setMultipleSelected(true);
    else view.setVectors(EntityUtils.getFirstEntityComponent(proxies, VisPolygon.class).vertices);
  }