|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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 |
public void alert(AlertEvent event)
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
event - Information about the alert.
|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||