congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SelectAreaAction
Code IndexAdd Tabnine to your IDE (free)

How to use
SelectAreaAction
in
jsettlers.common.action

Best Java code snippets using jsettlers.common.action.SelectAreaAction (Showing top 2 results out of 315)

origin: jsettlers/settlers-remake

private void updateSelectionArea(UIPoint mousePosition, boolean finished) {
  if (finished && currentSelectionAreaStart != null) {
    int x1 = (int) mousePosition.getX();
    int x2 = (int) this.currentSelectionAreaStart.getX();
    int y1 = (int) mousePosition.getY();
    int y2 = (int) this.currentSelectionAreaStart.getY();
    if (x1 > x2) {
      int temp = x1;
      x1 = x2;
      x2 = temp;
    }
    if (y1 > y2) {
      int temp = y1;
      y1 = y2;
      y2 = temp;
    }
    IMapArea area = this.context.getRectangleOnScreen(x1, y1, x2, y2);
    getInterfaceConnector().fireAction(new SelectAreaAction(area));
    this.currentSelectionAreaStart = null;
    this.currentSelectionAreaEnd = null;
  } else {
    this.currentSelectionAreaEnd = mousePosition;
    updateSelectionArea = true;
  }
}
origin: jsettlers/settlers-remake

private void selectArea(SelectAreaAction action) {
  final SelectionSet selectionSet = new SelectionSet();
  action.getArea().stream().filterBounds(grid.getWidth(), grid.getHeight()).forEach((x, y) -> {
    final IGuiMovable movable = grid.getMovable(x, y);
    if (movable != null && canSelectPlayer(movable.getPlayer().getPlayerId())) {
      selectionSet.add(movable);
    }
    final IBuilding building = grid.getBuildingAt(x, y);
    if (building != null && canSelectPlayer(building.getPlayer().getPlayerId())) {
      selectionSet.add(building);
    }
  });
  setSelection(selectionSet);
}
jsettlers.common.actionSelectAreaAction

Javadoc

This class hold special information for the action type EActionType#SELECT_AREA.

Most used methods

  • <init>
    Creates a new select area action.
  • getArea
    Gets the selected area.

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Reference (javax.naming)
  • Runner (org.openjdk.jmh.runner)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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