示例#1
0
  private void selectedLayer(Layer layer) {
    scene.setActiveLayer(layer.id);

    layerUpButton.setDisabled(false);
    layerDownButton.setDisabled(false);

    ImmutableArray<Layer> layers = scene.getLayers();

    int index = layers.indexOf(layer, true);
    if (index == 0) layerUpButton.setDisabled(true);
    if (index == layers.size() - 1) layerDownButton.setDisabled(true);
  }
示例#2
0
 /** @param group if true group will be created, if false ungroup will be performed */
 public GroupAction(
     ImmutableArray<EntityProxy> entities, int groupId, int groupIdBefore, boolean group) {
   this.entities = new Array<>(entities.toArray());
   this.groupIdBefore = groupIdBefore;
   this.groupId = groupId;
   this.group = group;
 }
  @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));
  }
  @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);
  }