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

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

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

origin: libgdx/libgdx

public void clicked (InputEvent event, float x, float y) {
  selectBox.selection.choose(list.getSelected());
  hide();
}
origin: libgdx/libgdx

public void clicked (InputEvent event, float x, float y) {
  selectBox.selection.choose(list.getSelected());
  hide();
}
origin: libgdx/libgdx

  public boolean keyDown (InputEvent event, int keycode) {
    switch (keycode) {
    case Keys.ENTER:
      selectBox.selection.choose(list.getSelected());
      // Fall thru.
    case Keys.ESCAPE:
      hide();
      event.stop();
      return true;
    }
    return false;
  }
};
origin: libgdx/libgdx

  public boolean keyDown (InputEvent event, int keycode) {
    switch (keycode) {
    case Keys.ENTER:
      selectBox.selection.choose(list.getSelected());
      // Fall thru.
    case Keys.ESCAPE:
      hide();
      event.stop();
      return true;
    }
    return false;
  }
};
origin: libgdx/libgdx

public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
  if (pointer != 0 || button != 0) return true;
  if (selection.isDisabled()) return true;
  getStage().setKeyboardFocus(List.this);
  if (items.size == 0) return true;
  int index = getItemIndexAt(y);
  if (index == -1) return true;
  selection.choose(items.get(index));
  touchDown = index;
  return true;
}
origin: libgdx/libgdx

public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
  if (pointer != 0 || button != 0) return true;
  if (selection.isDisabled()) return true;
  getStage().setKeyboardFocus(List.this);
  if (items.size == 0) return true;
  int index = getItemIndexAt(y);
  if (index == -1) return true;
  selection.choose(items.get(index));
  touchDown = index;
  return true;
}
origin: com.badlogicgames.gdx/gdx

public void clicked (InputEvent event, float x, float y) {
  selectBox.selection.choose(list.getSelected());
  hide();
}
origin: bladecoder/bladecoder-adventure-engine

void touchDown(float y) {
  if (items.size == 0)
    return;
  float height = getHeight();
  if (style.background != null) {
    height -= style.background.getTopHeight() + style.background.getBottomHeight();
    y -= style.background.getBottomHeight();
  }
  int index = (int) ((height - y) / cellRenderer.getItemHeight());
  index = Math.max(0, index);
  index = Math.min(items.size - 1, index);
  selection.choose(items.get(index));
}
origin: com.badlogicgames.gdx/gdx

public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
  if (pointer != 0 || button != 0) return true;
  if (selection.isDisabled()) return true;
  getStage().setKeyboardFocus(List.this);
  if (items.size == 0) return true;
  int index = getItemIndexAt(y);
  if (index == -1) return true;
  selection.choose(items.get(index));
  touchDown = index;
  return true;
}
origin: bladecoder/bladecoder-adventure-engine

  @SuppressWarnings("unchecked")
  @Override
  public void changed(ChangeEvent event, Actor actor) {
    int pos = list.getSelectedIndex() + 1;
    Action e = ((EditModelDialog<Verb, Action>) actor).getElement();
    list.getItems().insert(pos, e);
    parent.getActions().add(pos, e);
    list.getSelection().choose(list.getItems().get(pos));
    if (isControlAction(e)) {
      insertEndAction(pos + 1, getOrCreateControlActionId((AbstractControlAction) e));
      if (e instanceof AbstractIfAction)
        insertEndAction(pos + 2, getOrCreateControlActionId((AbstractControlAction) e));
    }
    list.invalidateHierarchy();
  }
});
origin: bladecoder/bladecoder-adventure-engine

  list.getSelection().clear();
} else if (pos >= list.getItems().size) {
  list.getSelection().choose(list.getItems().get(list.getItems().size - 1));
} else {
  list.getSelection().choose(list.getItems().get(pos));
origin: bladecoder/bladecoder-adventure-engine

public void addElements(PARENT parent, List<T> elements) {
  this.parent = parent;
  list.getItems().clear();
  list.getSelection().clear();
  if (elements != null) {
    for (T e : elements) {
      addItem(e);
    }
  }
  toolbar.disableEdit(list.getSelectedIndex() < 0);
  if (sorted) {
    list.sortByTitle();
  }
  
  if (getItems().size > 0)
    list.getSelection().choose(list.getItems().get(0));
  toolbar.disableCreate(parent == null);
  // container.prefHeight(list.getItemHeight() * (list.getItems().size >
  // 3?list.getItems().size:3));
  list.invalidateHierarchy();
}
com.badlogic.gdx.scenes.scene2d.utilsArraySelectionchoose

Popular methods of ArraySelection

  • first
  • items
  • set
  • setRequired
  • addAll
  • clear
  • 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
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (Timer)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
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