Package org.locationtech.udig.image.georeferencing.internal.process

Examples of org.locationtech.udig.image.georeferencing.internal.process.MarkModel


    Set<Entry<String, MarkModel>> entrySet = marks.entrySet();
    Iterator<Entry<String, MarkModel>> iter = entrySet.iterator();
    while (iter.hasNext()) {

      Entry<String, MarkModel> entry = iter.next();
      MarkModel markModel = entry.getValue();
     
      Point position = new Point(markModel.getXImage(), markModel.getYImage());
     
      MarkImagePresenter markPresenter = MarkImagePresenterFactory.createMarkPresenter(markModel, position,  hScroll, vScroll, getCanvas(), getScale());
     
      addMarkPresenter(markPresenter);
View Full Code Here


   * @param hScroll
   * @param vScroll
   */
  private void addMark(int x, int y, int hScroll, int vScroll) {

    MarkModel markModel = MarkModelFactory.getInstance().create();
   
    Point position = ImagePanelUtil.createMarkPosition(hScroll, vScroll, x, y, this.imgComposite.getScale());

    MarkImagePresenter markPresenter = MarkImagePresenterFactory.createMarkPresenter(
                                    markModel, position, hScroll, vScroll,
View Full Code Here

        // Identify the selected row
        final TableItem item = (TableItem) e.item;
        if (item == null)
          return;
        // get the mark associated to this row.
        final MarkModel mark = (MarkModel) item.getData();

        createEditorColumnX(mark, item);

        createEditorColumnY(mark, item);
        // show feedback using listeners
View Full Code Here

    if (obs instanceof GeoReferencingCommand) {

      setCertainItemsEnabled(cmd.canEnableMapTools());

      GeoreferencingCommandEventChange cmdEvent = (GeoreferencingCommandEventChange) arg;
      MarkModel mark = cmdEvent.getMark();

      switch (cmdEvent.getEvent()) {
      case MARK_ADDED:
        addMarkOnTable(mark);
        break;
      case MARK_DELETED:
        deleteMarkOnTable(mark);
        break;
      case ALL_MARKS_DELETED:
        deleteAllMarksOnTable();
        break;
      default:
        break;
      }

    } else if (obs instanceof MarkModel) {

      MarkModel mark = (MarkModel) obs;
      MarkModelChange event = (MarkModelChange) arg;
      switch (event) {
      case MODIFY:
        modifyCoordinateOnTable(mark);
        break;
View Full Code Here

    }
    // find the row.
    TableItem[] items = coordinatesTable.getItems();
    for (TableItem item : items) {

      MarkModel compareMark = (MarkModel) item.getData();
      if (mark.equals(compareMark)) {

        Coordinate newCoord = new Coordinate(mark.getXCoord(), mark.getYCoord());
        if (selection && selectedItems[0].equals(item)) {
          // the selected item is the one to update
View Full Code Here

    int index = -1;
    // find this mark on the table
    TableItem[] items = coordinatesTable.getItems();
    for (TableItem item : items) {
      index++;
      MarkModel itemMark = (MarkModel) item.getData();

      if (mark.equals(itemMark)) {
        break;
      }
    }
View Full Code Here

   *            Coordinate to be added.
   * @return True when the coordinate was added into the table.
   */
  private boolean addCoordinateOnTable(TableItem item, Coordinate newCoord, boolean existSelection) {

    MarkModel mark = (MarkModel) item.getData();

    if (existSelection) {

      createEditorsAndSetText(mark, item, newCoord);

      setRowData(item, mark, newCoord);

    } else if (mark.getXCoord().equals(Double.NaN) && mark.getYCoord().equals(Double.NaN)) {
      // if marks are empty.

      setRowData(item, mark, newCoord);
      return true;
    }
View Full Code Here

    if (InputEvent.MOUSE_DOWN.equals(event)) {
      // get the presenters
      Map<String, MarkMapPresenter> presenters = getMainComposite().getMapMarkGraphic().getPresenters();

      // iterate the presenters and see if the point belongs to any mark
      MarkModel mark = null;
      Set<Entry<String, MarkMapPresenter>> entrySet = presenters.entrySet();
      Iterator<Entry<String, MarkMapPresenter>> iter = entrySet.iterator();
      while (iter.hasNext()) {

        Entry<String, MarkMapPresenter> entry = iter.next();
        MarkMapPresenter mapPresenter = entry.getValue();

        if (mapPresenter.eventHandler(InputEvent.DELETE, point.x, point.y)) {
          mark = mapPresenter.getMarkModel();
          break;
        }
      }

      if (mark != null) {

        deleteOldEditors();

        int index = getMarkIndexWithinTheTable(mark);
        TableItem item = coordinatesTable.getItem(index);

        item.setText(1, ""); //$NON-NLS-1$
        item.setText(2, ""); //$NON-NLS-1$

        mark.setXCoord(Double.NaN);
        mark.setYCoord(Double.NaN);

        this.cmd.evalPrecondition();
        getMainComposite().refreshMapGraphicLayer();

      }
View Full Code Here

  private void deleteAllGCP() {

    Coordinate emptyCoord = new Coordinate(Double.NaN, Double.NaN);
    TableItem[] items = this.coordinatesTable.getItems();
    for (TableItem item : items) {
      MarkModel itemMark = (MarkModel) item.getData();
      itemMark.updateCoordinatePosition(emptyCoord);
     
    }
    getMainComposite().refreshMapGraphicLayer();
  }
View Full Code Here

                // load like a mark.
        }

        String markValues = (String) entry.getValue();
        // load the marks
        MarkModel mark = parseMarkData(markValues);
        unsortedMarkMap.put(index, mark);
      }

      return sortMap(unsortedMarkMap);
    } finally {
View Full Code Here

TOP

Related Classes of org.locationtech.udig.image.georeferencing.internal.process.MarkModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.