Package xal.smf.data

Class OpticsSwitcher

java.lang.Object
xal.smf.data.OpticsSwitcher

public class OpticsSwitcher extends Object
OpticsSwitcher is a provides a view that allows the user to select an optics file as the default optics.
Since:
May 28, 2004
Author:
tap
  • Constructor Details

    • OpticsSwitcher

      protected OpticsSwitcher(boolean includeDisposeButtons, Runnable disposalHandler)
      Primary Constructor
      Parameters:
      includeDisposeButtons - indicates whether to show cancel and close buttons which are appropriate for a hosting dialog
      disposalHandler - callback for cancel and close events
    • OpticsSwitcher

      protected OpticsSwitcher(boolean includeDisposeButtons)
      Constructor
      Parameters:
      includeDisposeButtons - indicates whether to show cancel and close buttons which are appropriate for a hosting dialog
    • OpticsSwitcher

      protected OpticsSwitcher()
      Constructor which defaults to showing dispose buttons
  • Method Details

    • getInstance

      public static OpticsSwitcher getInstance()
      Create an instance with an automatically configured hosting dialog
    • getInstanceForHostedFrame

      public static OpticsSwitcher getInstanceForHostedFrame()
      Create an instance appropriate for a hosted custom frame
    • getInstanceForHostedDialog

      public static OpticsSwitcher getInstanceForHostedDialog(Runnable disposalHandler)
      Create an instance appropriate for a hosted custom dialog
    • getView

      public Component getView()
      Get the view which may optionally be hosted in a custom window
    • setDisposalHandler

      public void setDisposalHandler(Runnable handler)
      Set the callback to capture the user cancel and close events. Call this method if the view will be hosted in a custom dialog
    • reset

      public void reset()
      reset editor to the default settings
    • showDialogNearOwner

      public void showDialogNearOwner(Frame owner)
      Show the dialog near the dialog's owner
      Parameters:
      owner - window which owns the dialog
    • showDialogWithOwnerNear

      public void showDialogWithOwnerNear(Frame owner, Component view)
      Show the dialog near the specified view
      Parameters:
      owner - window which owns the dialog
      view - the view near which to show this dialog
    • showDialogNearOwner

      public void showDialogNearOwner(Dialog owner)
      Show the dialog near the dialog's owner
      Parameters:
      owner - window which owns the dialog
    • showDialogWithOwnerNear

      public void showDialogWithOwnerNear(Dialog owner, Component view)
      Show the dialog near the specified view
      Parameters:
      owner - window which owns the dialog
      view - the view near which to show this dialog
    • getDefaultOpticsPath

      public String getDefaultOpticsPath()
      Get the path to the default optics file
      Returns:
      the path to the default optics file
    • isCanceled

      public boolean isCanceled()
      determine whether the dialog was canceled