Class ActorGraphicalMessageHandler

  • All Implemented Interfaces:
    java.lang.Thread.UncaughtExceptionHandler
    Direct Known Subclasses:
    VergilGraphicalMessageHandler

    public class ActorGraphicalMessageHandler
    extends GraphicalMessageHandler
    A message handler that optionally includes a button that opens the model that contains the actor that caused the exception.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Constructor Detail

      • ActorGraphicalMessageHandler

        public ActorGraphicalMessageHandler()
    • Method Detail

      • _checkThrowableNameable

        protected java.lang.Object[] _checkThrowableNameable​(java.lang.Object[] options,
                                                             java.lang.Throwable throwable)
        Under certain circumstances, add a "Go To Actor" button to the options array. The button is added to the array if the throwable is a KernelException or a KernelRuntimeException with a non-null Nameable and the Nameable is not at the toplevel.
        Overrides:
        _checkThrowableNameable in class UndeferredGraphicalMessageHandler
        Parameters:
        options - An array of Strings, suitable for passing to JOptionPane.showOptionDialog().
        throwable - The throwable.
        Returns:
        An array of Strings. If the throwable is an instance of KernelException and non-null, then the String "Go To Actor" is added to the array as the last element. Otherwise, the options argument is returned.
      • _getNameable

        protected Nameable _getNameable​(java.lang.Throwable throwable)
        Given a throwable, return the first Nameable (if any).
        Parameters:
        throwable - The throwable that may or may not be an instance of KernelException or KernelRuntimeException.
        Returns:
        The first Nameable or null if the throwable is not a KernelException or KernelRuntimeException.
      • _showNameable

        protected void _showNameable​(java.lang.Throwable throwable)
        Open the level of hierarchy of the model that contains the Nameable referred to by the KernelException or KernelRuntimeException.
        Overrides:
        _showNameable in class UndeferredGraphicalMessageHandler
        Parameters:
        throwable - The throwable that may be a KernelException or KernelRuntimeException.