Package java.awt

Examples of java.awt.Point


      else
        System.out.println("WARNING: '" + name
            + "' is not a recognized name for " + node.getAttribute(ATT_NAME) + "!");
    }
   
    result = new Point();
    ((Point) result).setLocation(x, y);

    return result;
  }
View Full Code Here


  // right click over empty canvas (not on a bean)
  private void rightClickCanvasPopup(final int x, final int y) {

    Vector closestConnections =
      BeanConnection.getClosestConnections(new Point(x, y),
          10, m_mainKFPerspective.getCurrentTabIndex());

    PopupMenu rightClickMenu = new PopupMenu();
    int menuItemCount = 0;
    if (m_mainKFPerspective.getSelectedBeans().size() > 0 ||
View Full Code Here

      if (source instanceof Visible) {       
        ((Visible)source).getVisual().setDisplayConnectors(true);


        m_editElement = bi;
        Point closest = ((Visible)source).getVisual().
        getClosestConnectorPoint(new Point(x, y));

        m_startX = (int)closest.getX();
        m_startY = (int)closest.getY();
        m_oldX = m_startX;
        m_oldY = m_startY;

        Graphics2D gx = (Graphics2D)m_beanLayout.getGraphics();
        gx.setXORMode(java.awt.Color.white);
View Full Code Here

          new Thread("Fullscreen border detection") {
            public void run() {
              setPriority(Thread.MIN_PRIORITY);

              while(isFullScreenMode()) {
                final Point p = MouseInfo.getPointerInfo().getLocation();
                SwingUtilities.convertPointFromScreen(p, MainFrame.this);

                if(isActive()) {

                  // mouse pointer is at top
View Full Code Here

                    int maxY = htmlPane.getHeight() - getHeight();
                    currentY = Math.max(0, Math.min(currentY + incY, maxY));
                    if (currentY <= 0 || currentY == maxY) {
                        pauseScrolling();
                    }
                    setViewPositionInternal(new Point((int)currentX, (int)currentY));
                }
            });
            reset();
        }
View Full Code Here

         */
        public final void reset() {
            currentX = 0;
            currentY = 0;
            timer.setInitialDelay(initalDelay);
            setViewPositionInternal(new Point((int)currentX, (int)currentY));
        }
View Full Code Here

        x = 0;
      }
      x += (icon.getIconWidth() - iconWidth) / 2;
    }
    int y = (this.getHeight() - iconHeight - 2) / 2;
    return new Point(x, y);
  }
View Full Code Here

    computeTitle();

    this.setSize(AppPreferences.WINDOW_WIDTH.get().intValue(),
        AppPreferences.WINDOW_HEIGHT.get().intValue());
    Point prefPoint = getInitialLocation();
    if (prefPoint != null) {
      this.setLocation(prefPoint);
    }
    this.setExtendedState(AppPreferences.WINDOW_STATE.get().intValue());
   
View Full Code Here

    int state = getExtendedState() & ~JFrame.ICONIFIED;
    AppPreferences.WINDOW_STATE.set(Integer.valueOf(state));
    Dimension dim = getSize();
    AppPreferences.WINDOW_WIDTH.set(Integer.valueOf(dim.width));
    AppPreferences.WINDOW_HEIGHT.set(Integer.valueOf(dim.height));
    Point loc;
    try {
      loc = getLocationOnScreen();
    } catch (IllegalComponentStateException e) {
      loc = Projects.getLocation(this);
    }
View Full Code Here

        y += 20;
      }
      Rectangle desired = new Rectangle(x, y, 50, 50);
   
      int gcBestSize = 0;
      Point gcBestPoint = null;
      GraphicsEnvironment ge;
      ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
      for (GraphicsDevice gd : ge.getScreenDevices()) {
        for (GraphicsConfiguration gc : gd.getConfigurations()) {
          Rectangle gcBounds = gc.getBounds();
          if (gcBounds.intersects(desired)) {
            Rectangle inter = gcBounds.intersection(desired);
            int size = inter.width * inter.height;
            if (size > gcBestSize) {
              gcBestSize = size;
              int x2 = Math.max(gcBounds.x, Math.min(inter.x,
                  inter.x + inter.width - 50));
              int y2 = Math.max(gcBounds.y, Math.min(inter.y,
                  inter.y + inter.height - 50));
              gcBestPoint = new Point(x2, y2);
            }
          }
        }
      }
      if (gcBestPoint != null) {
View Full Code Here

TOP

Related Classes of java.awt.Point

Copyright © 2015 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.