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); }
private void rebuildLayersTable() { deselectAll(); Array<Actor> actors = new Array<>(layersTable.getChildren()); layersTable.clearChildren(); for (Layer layer : scene.getLayers()) { LayerItem item = getItemForLayer(actors, layer); if (item == null) item = new LayerItem(layer); item.update(); layersTable.add(item).expandX().fillX().row(); if (layer == scene.getActiveLayer()) item.select(); } if (scene.getLayers().size() == 1) { layerDownButton.setDisabled(true); layerUpButton.setDisabled(true); layerRemoveButton.setDisabled(true); } else layerRemoveButton.setDisabled(false); }