Apply region selection.
540435
def do_region(self, x, y, w, h):
        """"""
        if (x is None):
            self.logger.debug("region: full (nop)")
        else:
            self.logger.debug("region: (%d,%d,%d,%d)" % (x, y, w, h))
            self.image = self.image.crop((x, y, x + w, y + h))
            self.width = w
            self.height = h
1053774
public void setRegion(int left, int top, int width, int height) {
    if (top < 0 || left < 0) {
      throw new IllegalArgumentException("Left and top must be nonnegative");
    }
    if (height < 1 || width < 1) {
      throw new IllegalArgumentException("Height and width must be at least 1");
    }
    int right = left + width;
    int bottom = top + height;
    if (bottom > this.height || right > this.width) {
      throw new IllegalArgumentException("The region must fit inside the matrix");
    }
    for (int y = top; y < bottom; y++) {
      int offset = y * rowSize;
      for (int x = left; x < right; x++) {
        bits[offset + (x / 32)] |= 1 << (x & 0x1f);
      }
    }
  }
1352362
public void handleSelection(String itemId) {

        Collection<?> selection = (Collection<?>)m_fileTable.getValue();
        if (selection == null) {
            m_fileTable.select(itemId);
        } else if (!selection.contains(itemId)) {
            m_fileTable.setValue(null);
            m_fileTable.select(itemId);
        }
    }
1122410
def region(self, rect):
        
        box = (int(rect[0]), int(rect[1]), int(rect[0]) + int(rect[2]),
               int(rect[1]) + int(rect[3]))
        if box[2] > self.img.size[0] or box[3] > self.img.size[1]:
            raise errors.RectangleError("Region out-of-bounds")
        self.img = self.img.crop(box)
        return self
746536
def init_region_config(self, region):
        
        self.regions[region] = self.region_config_class(region_name = region, resource_types = self.resource_types)
361883
function selectItem(editor, model, getItemRange) {
	editor.transact(() => {
		const selections = editor.getSelectedBufferRanges()
		.map(anchor => getItemRange(model, anchor) || anchor);

		editor.setSelectedBufferRanges(selections);
	});
}
97036
private void updateSelection() {
        Dateitem selectedItem = getSelectedItem();
        
        if (selectedItem == null) {
            addStyle("color", "gray");
        } else {
            addStyle("color", "inherit");
        }
        
        setFocus(false);
    }
905100
function(name){
    var
      area = this.selection.getArea();
    name = name || 'select';
    area.selection = this.selection.selection;
    E.fire(this.el, 'flotr:'+name, [area, this]);
  }
950855
private void updateRegion() {
		actMessagePanel.setVisible(false);

		if (rbtACT.isSelected()) {
			actMessagePanel.setVisible(true);
			regionFields.setVisible(true);
			regionSelector.setOptions(new String[]{null, "Belconnen", "City", "Woden"});
			regionSelector.setVisible(true);
		} else if (rbtNSW.isSelected()) {
			regionFields.setVisible(true);
			regionSelector.setOptions(
					new String[]{null, "Hunter", "Riverina", "Southern Tablelands"});
			regionSelector.setVisible(true);
		} else if (rbtVIC.isSelected()) {
			regionFields.setVisible(true);
			regionSelector.setOptions(
					new String[]{null, "Gippsland", "Melbourne", "Mornington Peninsula"});
			regionSelector.setVisible(true);
		} else {
			regionSelector.setOptions(new Object[]{null});
			regionSelector.setVisible(false);
			regionFields.setVisible(false);
		}
	}
1243839
def start_selection(self, selection_type=SelectionType.CHARACTERS):
        
        self.selection_state = SelectionState(self.cursor_position, selection_type)
456804
def click_field(self, move_x, move_y):
        """"""
        field_status = self.info_map[move_y, move_x]

        # can only click blank region
        if field_status == 11:
            if self.mine_map[move_y, move_x] == 1:
                self.info_map[move_y, move_x] = 12
            else:
                # discover the region.
                self.discover_region(move_x, move_y)
797537
def _finish_selecting(self, event):
        """"""
        self._selecting = False
        canvas = self._canvas
        x = canvas.canvasx(event.x)
        y = canvas.canvasy(event.y)
        
        canvas.coords(self._sobject, -1, -1, -1, -1)
        canvas.itemconfigure(self._sobject, state=tk.HIDDEN)

        sel_region = self._sstart[0], self._sstart[1], x, y
        canvas.region_selected = sel_region
        canvas.event_generate('<<RegionSelected>>')
164518
def select_point(action, action_space, select_point_act, screen):
  """"""
  select = spatial(action, action_space).unit_selection_point
  screen.assign_to(select.selection_screen_coord)
  select.type = select_point_act
504355
def select(self, selection_specs=None, **kwargs):
        
        return super(Element2D, self).select(selection_specs, **kwargs)
1268789
def __restore_selection(self, start_pos, end_pos):
        """"""
        cursor = self.textCursor()
        cursor.setPosition(start_pos)
        cursor.setPosition(end_pos, QTextCursor.KeepAnchor)
        self.setTextCursor(cursor)
966047
@Override
    public void areaSelected(Area area)
    {
        //show the separator list
        if (area instanceof AreaImpl)
        {
            SeparatorSet sset = Config.createSeparators((AreaImpl) area);
            DefaultListModel<Separator> ml = new DefaultListModel<Separator>();
            for (Separator sep : sset.getHorizontal())
                ml.addElement(sep);
            for (Separator sep : sset.getVertical())
                ml.addElement(sep);
            for (Separator sep : sset.getBoxsep())
                ml.addElement(sep);
            sepList.setModel(ml);
        }
        else
        {
            //not a grouping area -- no separators
            sepList.setModel(new DefaultListModel<Separator>());
        }
    }
1301854
def do_region(self, x, y, w, h):
        """"""
        if (x is not None):
            raise IIIFError(code=501, parameter="region",
                            text="Null manipulator supports only region=/full/.")