Esempio n. 1
0
 /**
  * Update the dimensions of the arrow head, creating a new arrow head if necessary. The return
  * value is also set as the member variable <code>m_arrowHead</code>
  *
  * @param w the width of the untransformed arrow head base, in pixels
  * @param h the height of the untransformed arrow head, in pixels
  * @return the untransformed arrow head shape
  */
 private Polygon updateArrowHead(int w, int h) {
   if (m_arrowHead == null) {
     m_arrowHead = new Polygon();
   } else {
     m_arrowHead.reset();
   }
   m_arrowHead.addPoint(0, 0);
   m_arrowHead.addPoint(-w / 2, -h);
   m_arrowHead.addPoint(w / 2, -h);
   m_arrowHead.addPoint(0, 0);
   return m_arrowHead;
 }
Esempio n. 2
0
  /** If the correct button, from the "drawing rectangle" mode */
  @Override
  public void mousePressed(MouseEvent e) {
    if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1) {
      SelectByInternalPointAction.performSelection(
          Main.map.mapView.getEastNorth(e.getX(), e.getY()),
          (e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) > 0,
          (e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) > 0);
    } else if (e.getButton() == MouseEvent.BUTTON1) {
      mousePosStart = mousePos = e.getPoint();

      lasso.reset();
      lasso.addPoint(mousePosStart.x, mousePosStart.y);
    }
  }