Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


oracle.dss.dataView
Interface AlertListener

All Superinterfaces:
java.util.EventListener

public interface AlertListener
extends java.util.EventListener

Methods for listening for display problems at runtime. You should implement this interface if you want to respond to any alerts at runtime.


Method Summary
 void alert(AlertEvent event)
          Notifies listeners about abnormal conditions in a Dataview.

 

Method Detail

alert

public void alert(AlertEvent event)
Notifies listeners about abnormal conditions in a Dataview. This method is called as soon as any abnormal condition is noticed. For example, if you call Graph.exportToGIF and any legend text has been truncated, the exportToGIF method calls this method.

Multiple notifications can occur as a graph reads data, so you should save the information that you get from the AlertEvent and wait to respond to the information until the graph completes its data read. One way to do this is to call the invokeLater method of the javax.swing.SwingUtilities class, as shown in the following example:

 class AlertMe implements AlertListener{
   public void alert(AlertEvent event){
   String message;
   switch (event.getID()){
     case AlertEvent.DATA_ALL_DATA_NULL_NEG_ZERO:
       message = "DATA_ALL_DATA_NULL_NEG_ZERO";
       break;
     case AlertEvent.DATA_ALL_AXIS_DATA_NULL_NEG_ZERO:
       message = "DATA_ALL_AXIS_DATA_NULL_NEG_ZERO";
       break;
     default:
       message = "Some other constant";
   } // switch
   final String finalMessage = message;
   // Runnable is defined in java.lang
   Runnable showMessage = new Runnable(){
     public void run(){
      JOptionPane.showMessageDialog(null, finalMessage);
     } // run
   }; // showMessage

   // the message dialog will appear after the graph is painted
   SwingUtilities.invokeLater(showMessage);
   } // alert
 } // AlertMe
Parameters:
event - Information about the alert.

Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


Copyright © 2003, Oracle. All Rights Reserved.