Tabnine Logo
ArraySelection.clear
Code IndexAdd Tabnine to your IDE (free)

How to use
clear
method
in
com.badlogic.gdx.scenes.scene2d.utils.ArraySelection

Best Java code snippets using com.badlogic.gdx.scenes.scene2d.utils.ArraySelection.clear (Showing top 20 results out of 315)

origin: libgdx/libgdx

/** Sets the selection to only the selected index.
 * @param index -1 to clear the selection. */
public void setSelectedIndex (int index) {
  if (index < -1 || index >= items.size)
    throw new IllegalArgumentException("index must be >= -1 and < " + items.size + ": " + index);
  if (index == -1) {
    selection.clear();
  } else {
    selection.set(items.get(index));
  }
}
origin: libgdx/libgdx

/** Sets the selection to only the selected index.
 * @param index -1 to clear the selection. */
public void setSelectedIndex (int index) {
  if (index < -1 || index >= items.size)
    throw new IllegalArgumentException("index must be >= -1 and < " + items.size + ": " + index);
  if (index == -1) {
    selection.clear();
  } else {
    selection.set(items.get(index));
  }
}
origin: libgdx/libgdx

public void clearItems () {
  if (items.size == 0) return;
  items.clear();
  selection.clear();
  invalidateHierarchy();
}
origin: libgdx/libgdx

public void clearItems () {
  if (items.size == 0) return;
  items.clear();
  selection.clear();
  invalidateHierarchy();
}
origin: libgdx/libgdx

public void clearItems () {
  if (items.size == 0) return;
  items.clear();
  selection.clear();
  invalidateHierarchy();
}
origin: libgdx/libgdx

public void clearItems () {
  if (items.size == 0) return;
  items.clear();
  selection.clear();
  invalidateHierarchy();
}
origin: libgdx/libgdx

  /** Removes objects from the selection that are no longer in the items array. If {@link #getRequired()} is true and there is no
   * selected item, the first item is selected. */
  public void validate () {
    Array<T> array = this.array;
    if (array.size == 0) {
      clear();
      return;
    }
    for (Iterator<T> iter = items().iterator(); iter.hasNext();) {
      T selected = iter.next();
      if (!array.contains(selected, false)) iter.remove();
    }
    if (required && selected.size == 0) set(array.first());
  }
}
origin: libgdx/libgdx

  /** Removes objects from the selection that are no longer in the items array. If {@link #getRequired()} is true and there is no
   * selected item, the first item is selected. */
  public void validate () {
    Array<T> array = this.array;
    if (array.size == 0) {
      clear();
      return;
    }
    for (Iterator<T> iter = items().iterator(); iter.hasNext();) {
      T selected = iter.next();
      if (!array.contains(selected, false)) iter.remove();
    }
    if (required && selected.size == 0) set(array.first());
  }
}
origin: libgdx/libgdx

/** Sets the selection to only the passed item, if it is a possible choice, else selects the first item. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
origin: libgdx/libgdx

/** Sets the selection to only the passed item, if it is a possible choice, else selects the first item. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
origin: libgdx/libgdx

/** Sets the selection to only the passed item, if it is a possible choice.
 * @param item May be null. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (selection.getRequired() && items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
origin: libgdx/libgdx

/** Sets the selection to only the passed item, if it is a possible choice.
 * @param item May be null. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (selection.getRequired() && items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
origin: libgdx/libgdx

case Keys.A:
  if (UIUtils.ctrl() && selection.getMultiple()) {
    selection.clear();
    selection.addAll(items);
    return true;
origin: libgdx/libgdx

case Keys.A:
  if (UIUtils.ctrl() && selection.getMultiple()) {
    selection.clear();
    selection.addAll(items);
    return true;
origin: com.badlogicgames.gdx/gdx

/** Sets the selection to only the selected index.
 * @param index -1 to clear the selection. */
public void setSelectedIndex (int index) {
  if (index < -1 || index >= items.size)
    throw new IllegalArgumentException("index must be >= -1 and < " + items.size + ": " + index);
  if (index == -1) {
    selection.clear();
  } else {
    selection.set(items.get(index));
  }
}
origin: com.badlogicgames.gdx/gdx

public void clearItems () {
  if (items.size == 0) return;
  items.clear();
  selection.clear();
  invalidateHierarchy();
}
origin: bladecoder/bladecoder-adventure-engine

public void clearItems () {
  if (items.size == 0) return;
  items.clear();
  selection.clear();
  invalidateHierarchy();
}
origin: com.badlogicgames.gdx/gdx

public boolean keyDown (InputEvent event, int keycode) {
  if (keycode == Keys.A && UIUtils.ctrl() && selection.getMultiple()) {
    selection.clear();
    selection.addAll(items);
    return true;
  }
  return false;
}
origin: com.badlogicgames.gdx/gdx

/** Sets the selection to only the passed item, if it is a possible choice, else selects the first item. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
origin: com.badlogicgames.gdx/gdx

/** Sets the selection to only the passed item, if it is a possible choice.
 * @param item May be null. */
public void setSelected (T item) {
  if (items.contains(item, false))
    selection.set(item);
  else if (selection.getRequired() && items.size > 0)
    selection.set(items.first());
  else
    selection.clear();
}
com.badlogic.gdx.scenes.scene2d.utilsArraySelectionclear

Popular methods of ArraySelection

  • first
  • items
  • set
  • setRequired
  • addAll
  • choose
  • contains
  • getRequired
  • isDisabled
  • setActor
  • setProgrammaticChangeEvents
  • validate
    Removes objects from the selection that are no longer in the items array. If #getRequired() is true
  • setProgrammaticChangeEvents,
  • validate,
  • changed,
  • cleanup,
  • fireChangeEvent,
  • getMultiple,
  • revert,
  • setMultiple,
  • snapshot

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JCheckBox (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now