private void readEvents() {

    frame
        .getGlassPane()
        .setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));

    // run event reader
    runEventReader(currentEventFile);

    // initialize map viewer
    if (this.jMapViewer == null) loadMapView();

    // get data from eventhandler (if not null)
    if (eventHandler != null) {
      eventHandler.setColorationMode(this.colorationMode);
      eventHandler.setTransparency(this.cellTransparency);
      eventHandler.setK(k);

      // get data
      EventData data = eventHandler.getData();

      // update data in both the map viewer and the graphs
      jMapViewer.updateEventData(data);
      graphPanel.updateData(data);
      keyPanel.updateData(data);
    }

    frame
        .getGlassPane()
        .setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
  }
  @Override
  public void setVisible(boolean b) {
    super.setVisible(b);
    if (owner == null) return;

    if (b) {
      owner.getGlassPane().addMouseListener(mouseListener);
    } else {
      owner.getGlassPane().removeMouseListener(mouseListener);
    }

    owner.getGlassPane().setVisible(b);
  }
Пример #3
0
  public void run() {
    final JFrame mainFrame = new JFrame("MapPanel with place marks");
    final MapPanel mapPanel = new MapPanel(new Point(3636598, 1535138), 14);
    mainFrame.add(mapPanel);

    final DemoGlassPane glassPane = new DemoGlassPane(mapPanel);
    glassPane.addPointToMark(new Point.Double(37.30957, -1.29628));
    glassPane.addPointToMark(new Point.Double(37.70957, -1.49628));
    glassPane.addPointToMark(new Point.Double(36.30957, -2.29628));
    glassPane.addPointToMark(new Point.Double(38.30957, -1.59628));
    mainFrame.setGlassPane(glassPane);

    mainFrame.getGlassPane().setVisible(true);

    mainFrame.pack();
    mainFrame.setVisible(true);
  }
Пример #4
0
  /**
   * Shows/hides the security panel.
   *
   * @param isVisible <tt>true</tt> to show the security panel, <tt>false</tt> to hide it
   */
  public void setSecurityPanelVisible(final boolean isVisible) {
    if (!SwingUtilities.isEventDispatchThread()) {
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              setSecurityPanelVisible(isVisible);
            }
          });
      return;
    }

    final JFrame callFrame = callRenderer.getCallContainer().getCallWindow().getFrame();

    final JPanel glassPane = (JPanel) callFrame.getGlassPane();

    if (!isVisible) {
      // Need to hide the security panel explicitly in order to keep the
      // fade effect.
      securityPanel.setVisible(false);
      glassPane.setVisible(false);
      glassPane.removeAll();
    } else {
      glassPane.setLayout(null);
      glassPane.addMouseListener(
          new MouseListener() {
            public void mouseClicked(MouseEvent e) {
              redispatchMouseEvent(glassPane, e);
            }

            public void mouseEntered(MouseEvent e) {
              redispatchMouseEvent(glassPane, e);
            }

            public void mouseExited(MouseEvent e) {
              redispatchMouseEvent(glassPane, e);
            }

            public void mousePressed(MouseEvent e) {
              redispatchMouseEvent(glassPane, e);
            }

            public void mouseReleased(MouseEvent e) {
              redispatchMouseEvent(glassPane, e);
            }
          });

      Point securityLabelPoint = securityStatusLabel.getLocation();

      Point newPoint =
          SwingUtilities.convertPoint(
              securityStatusLabel.getParent(),
              securityLabelPoint.x,
              securityLabelPoint.y,
              callFrame);

      securityPanel.setBeginPoint(new Point((int) newPoint.getX() + 15, 0));
      securityPanel.setBounds(0, (int) newPoint.getY() - 5, this.getWidth(), 130);

      glassPane.add(securityPanel);
      // Need to show the security panel explicitly in order to keep the
      // fade effect.
      securityPanel.setVisible(true);
      glassPane.setVisible(true);

      glassPane.addComponentListener(
          new ComponentAdapter() {
            /** Invoked when the component's size changes. */
            @Override
            public void componentResized(ComponentEvent e) {
              if (glassPane.isVisible()) {
                glassPane.setVisible(false);
                callFrame.removeComponentListener(this);
              }
            }
          });
    }
  }
Пример #5
0
 private void rootFound() {
   setGlassPane(true);
   MyMouseListener theListener = new MyMouseListener();
   myRootFrame.getGlassPane().addMouseListener(theListener);
   // myRootFrame.getGlassPane().addMouseMotionListener(theListener);
 }
Пример #6
0
 private void setGlassPane(boolean visible) {
   if (myRootFrame != null) {
     if (isEnabled) myRootFrame.getGlassPane().setVisible(visible);
     else myRootFrame.getGlassPane().setVisible(false);
   }
 }
 public Component getGlassPane() {
   return jFrame.getGlassPane();
 }