Package java.awt

Examples of java.awt.Point


        }

        public void popupMenuWillBecomeVisible(PopupMenuEvent e) {}
      });

      Point p = new Point(0, 0);
      p.y = btn.getHeight() + 1;

      popup.show(btn, p.x, p.y);
    }
  }
View Full Code Here


  public void scrollToChannel(Channel channel) {
    Channel[] shownChannelArr = mProgramTable.getModel().getShownChannels();
    for (int col = 0; col < shownChannelArr.length; col++) {
      if (channel.equals(shownChannelArr[col])) {
        Point scrollPos = getViewport().getViewPosition();
        if (scrollPos != null) {
          int visibleColumns = getViewport().getWidth() / mProgramTable.getColumnWidth();
          scrollPos.x = (col - visibleColumns / 2) * mProgramTable.getColumnWidth();
          if (scrollPos.x < 0) {
            scrollPos.x = 0;
View Full Code Here

      }
    }
  }

  public void scrollToTime(int minutesAfterMidnight) {
    Point scrollPos = getViewport().getViewPosition();

    scrollPos.y = mProgramTable.getTimeY(minutesAfterMidnight) - (int)(Math.round(getViewport().getHeight() * SCROLL_OFFSET_FROM_TOP));

    if (scrollPos.y < 0) {
      scrollPos.y = 0;
View Full Code Here

    mProgramTable.deSelectItem();
  }

  public void stateChanged(ChangeEvent e) {
    if (e.getSource()==viewport) {
      Point viewPos = viewport.getViewPosition();
      if (viewPos != null) {
        Channel[] shownChannels = MainFrame.getInstance().getProgramTableModel().getShownChannels();
        // no channels visible -> dont sync channel list selection
        if (shownChannels.length == 0) {
          return;
View Full Code Here

        saveSettings();
      } else if (target.equals(MainFrame.getInstance().getToolbar())
          || ((DropTarget) e.getSource()).getComponent().equals(
              MainFrame.getInstance().getToolBarPanel())) {

        Point location = e.getLocation();

        if (mWest) {
          location.setLocation(10, location.y);
        } else {
          location.setLocation(location.x, MainFrame.getInstance().getToolbar()
              .getHeight() / 2);
        }

        JComponent c = (JComponent) MainFrame.getInstance().getToolbar()
            .getComponentAt(location);

        if ((c == null || c instanceof JToolBar) && MainFrame.getInstance().getToolbar().getComponentCount() > 0) {
          c = (JComponent) MainFrame.getInstance().getToolbar().getComponent(
              MainFrame.getInstance().getToolbar().getComponentCount() - 1);

          if (c != null) {
            location.setLocation(c.getLocation().x + c.getWidth() - 1, c
                .getLocation().y
                + c.getHeight() - 1);
          }
        }

        int n = 0;

        if (c != null) {
          Point p = SwingUtilities.convertPoint(MainFrame.getInstance().getToolBarPanel(), location, c);

          n = MainFrame.getInstance().getToolbar().getComponentIndex(c);

          if (!((mWest && (p.y < c.getHeight() / 2)) || (!mWest && (p.x < c
              .getWidth() / 2)))) {
View Full Code Here

     */
    JComponent target = (JComponent) ((DropTarget) e.getSource())
        .getComponent();

    if (!target.equals(mButtonPanel)) {
      Point location = e.getLocation();

      if (mWest) {
        location.setLocation(10,
            location.y);
      } else {
        location.setLocation(location.x, MainFrame.getInstance().getToolbar()
            .getHeight() / 2);
      }

      JComponent c = (JComponent) MainFrame.getInstance().getToolbar()
          .getComponentAt(location);

      if ((c == null || c instanceof JToolBar) && MainFrame.getInstance().getToolbar().getComponentCount()>0) {
        c = (JComponent) MainFrame.getInstance().getToolbar().getComponent(
            MainFrame.getInstance().getToolbar().getComponentCount() - 1);

        if (c != null) {
          location.setLocation(c.getLocation().x + c.getWidth() - 1, c
              .getLocation().y
              + c.getHeight() - 1);
        }
      }

      if (c != null) {
        JPanel toolBarPanel = MainFrame.getInstance().getToolBarPanel();

        Point p = SwingUtilities.convertPoint(toolBarPanel, location, c);

        Rectangle oldCueLineBounds = mCueLine.getBounds();

        if (mWest) {
          mCueLine.setRect(1,
View Full Code Here

      }

      private void handleEvent(MouseEvent e, boolean popupEvent) {
        JEditorPane editor = (JEditorPane) e.getSource();

        Point pt = new Point(e.getX(), e.getY());
        int pos = editor.viewToModel(pt);
        if (pos >= 0) {
          String link = getLink(pos, editor);

          if (link != null
View Full Code Here

          }
          else {
            Plugin.getPluginManager().handleProgramMiddleDoubleClick(mProgram);
          }
        } else if (SwingUtilities.isRightMouseButton(e)) {
          Point point = e.getPoint();
          SwingUtilities.convertPointToScreen(point,e.getComponent());
          showPopup(point,PluginProxyManager.createPluginContextMenu(mProgram));
          e.consume();
        }
      }
View Full Code Here

  JViewport vp = (JViewport)e.getSource();
  int h = vp.getViewSize().height;
  if (h != lastHeight) { // i.e. an addition not just a user scrolling
    lastHeight = h;
    int x = h - vp.getExtentSize().height;
    vp.setViewPosition(new Point(0, x));
  }
      }
    });
   
    JPanel mondo = new JPanel();
View Full Code Here

   */
  public Element writePoint(Element parent, Object o, String name)
      throws Exception {
   
    Element     node;
    Point       p;

    // for debugging only
    if (DEBUG)
       trace(new Throwable(), name);
   
    m_CurrentNode = parent;
   
    p    = (Point) o;
    node = addElement(parent, name, p.getClass().getName(), false);

    writeDoubleToXML(node, p.getX(), VAL_X);
    writeDoubleToXML(node, p.getY(), VAL_Y);
   
    return node;
  }
View Full Code Here

TOP

Related Classes of java.awt.Point

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.