Example usage for com.badlogic.gdx.utils ObjectSet first

List of usage examples for com.badlogic.gdx.utils ObjectSet first

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils ObjectSet first.

Prototype

public T first() 

Source Link

Usage

From source file:com.bladecoder.engineeditor.ui.components.CustomList.java

License:Apache License

/**
 * @return The index of the first selected item. The top item has an index
 *         of 0. Nothing selected has an index of -1.
 *//*from www  .  ja va2 s. c  o  m*/
public int getSelectedIndex() {
    ObjectSet<T> selected = selection.items();
    return selected.size == 0 ? -1 : items.indexOf(selected.first(), false);
}