예제 #1
0
 @Override
 public Rectangle getCurrentItemBounds() {
   int index = myList.getSelectedIndex();
   if (index < 0) {
     LOG.error("No selected element, size=" + getListModel().getSize() + "; items" + getItems());
   }
   Rectangle itmBounds = myList.getCellBounds(index, index);
   if (itmBounds == null) {
     LOG.error("No bounds for " + index + "; size=" + getListModel().getSize());
     return null;
   }
   Point layeredPanePoint =
       SwingUtilities.convertPoint(myList, itmBounds.x, itmBounds.y, getComponent());
   itmBounds.x = layeredPanePoint.x;
   itmBounds.y = layeredPanePoint.y;
   return itmBounds;
 }
예제 #2
0
    private void doExecute(PsiFile file, int offset) {
      final Info info;
      try {
        info = getInfoAt(myEditor, file, offset, myBrowseMode);
      } catch (IndexNotReadyException e) {
        showDumbModeNotification(myProject);
        return;
      }
      if (info == null) return;

      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              if (myDisposed || myEditor.isDisposed() || !myEditor.getComponent().isShowing())
                return;
              showHint(info);
            }
          });
    }
예제 #3
0
  private void updateComplete() {
    synchronized (this) {
      updatePending = false;
    }

    if (dirty) {
      SwingUtilities.invokeLater(
          new Runnable() {
            @Override
            public void run() {
              updateImage();
              dirty = false;
            }
          });
    }

    activeBuffer = nextBuffer;

    repaint();
  }