Ejemplo n.º 1
0
 public static void main(String[] args) {
   try {
     AppFrame frame = new AppFrame();
     frame.setTitle(APP_NAME);
     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     frame.setVisible(true);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  public void selected(SelectEvent event) {
    try {
      if (event.isRollover()) {
        if (this.lastSelectedObject == event.getTopObject()) return; // same thing selected

        if (this.lastSelectedObject != null) {
          this.hideAnnotationPanel();
          this.lastSelectedObject = null;
        }

        if (event.getTopObject() != null && event.getTopObject() instanceof AVList) {
          String annoText =
              ((AVList) event.getTopObject()).getStringValue(Constants.INFO_PANEL_TEXT);
          if (!WWUtil.isEmpty(annoText)) {
            this.lastSelectedObject = (AVList) event.getTopObject();
            this.showAnnotationPanel(annoText);
          }
        }
      }
    } catch (Exception e) {
      // Wrap the handler in a try/catch to keep exceptions from bubbling up
      Util.getLogger().warning(e.getMessage() != null ? e.getMessage() : e.toString());
    }
  }