org.lyra.Widgets
Class RapidDialog

java.lang.Object
  extended by org.lyra.Widgets.RapidDialog

public class RapidDialog
extends java.lang.Object

While Java Swing provides static functions to create advanced dialogs for a myriad of purposes creating all the elements necessary may not always be consistent if not centrally controlled. This class generates language controlled dialogs for our use.

Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster

Field Summary
private  java.util.Map<java.lang.String,java.lang.String> Lang
           
(package private)  java.lang.String[] Options
           
 
Constructor Summary
RapidDialog(java.util.Map<java.lang.String,java.lang.String> lang)
          Basic constructor which will establish the elements necessary for the dialogs to be generated using less code.
 
Method Summary
private  java.lang.String createComplex(java.awt.Window parent, javax.swing.ImageIcon icon, java.lang.String title, java.lang.String message, java.lang.String... options)
          Creates more complex dialogs for use in the application.
private  void createDialog(java.awt.Window parent, javax.swing.ImageIcon icon, java.lang.String title, java.lang.String message)
          This method actually creates the dialogs.
 boolean noticeAlbumArt(java.awt.Window parent)
          This notice is used exclusively when the application has failed to connect to the host and cannot continue from that point forward.
 void noticeDialog(java.awt.Window parent, java.lang.String message)
          Generates a Notice Dialog used in various components of the site.
 void noticeFail(java.awt.Window parent, java.lang.String message)
          Generates a Failed Operation Dialog used in various components of the site.
 boolean noticeHostFail(java.awt.Window parent)
          This notice is used exclusively when the application has failed to connect to the host and cannot continue from that point forward.
 boolean noticeHostLost(java.awt.Window parent)
          This notice is used exclusively when the application has lost its connection with the host.
 void noticePass(java.awt.Window parent, java.lang.String message)
          Generates a Successful Operation Dialog used in various components of the site.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Lang

private java.util.Map<java.lang.String,java.lang.String> Lang

Options

java.lang.String[] Options
Constructor Detail

RapidDialog

public RapidDialog(java.util.Map<java.lang.String,java.lang.String> lang)
Basic constructor which will establish the elements necessary for the dialogs to be generated using less code.

Parameters:
lang - Map of Strings containing language elements.
Method Detail

createDialog

private void createDialog(java.awt.Window parent,
                          javax.swing.ImageIcon icon,
                          java.lang.String title,
                          java.lang.String message)
This method actually creates the dialogs. While the public methods form the required elements and pass on for the actual display.

Parameters:
parent - Parent window to block.
icon - Icon to display.
title - Title of the dialog.
message - Message to display.

noticeDialog

public void noticeDialog(java.awt.Window parent,
                         java.lang.String message)
Generates a Notice Dialog used in various components of the site.

Parameters:
parent - Parent Window component.
message - Message to Display.

noticePass

public void noticePass(java.awt.Window parent,
                       java.lang.String message)
Generates a Successful Operation Dialog used in various components of the site.

Parameters:
parent - Parent Window component.
message - Message to Display.

noticeFail

public void noticeFail(java.awt.Window parent,
                       java.lang.String message)
Generates a Failed Operation Dialog used in various components of the site.

Parameters:
parent - Parent Window component.
message - Message to Display.

createComplex

private java.lang.String createComplex(java.awt.Window parent,
                                       javax.swing.ImageIcon icon,
                                       java.lang.String title,
                                       java.lang.String message,
                                       java.lang.String... options)
Creates more complex dialogs for use in the application. This permits an array to be passed to the dialog and used to extract a reply from the user to determine flow.

Parameters:
parent - Parent window to block.
icon - Icon to display.
title - Title of the dialog.
message - Message to display.
options - Array of strings containing possible choices.
Returns:
String value that was accepted.

noticeHostFail

public boolean noticeHostFail(java.awt.Window parent)
This notice is used exclusively when the application has failed to connect to the host and cannot continue from that point forward. It will prompt the user to exit the application or create a new entry.

Parameters:
parent - Parent Window component.
Returns:
Boolean indicating true to create or false to exit.

noticeHostLost

public boolean noticeHostLost(java.awt.Window parent)
This notice is used exclusively when the application has lost its connection with the host.

Parameters:
parent - Parent Window component.
Returns:
Boolean indicating true to create or false to exit.

noticeAlbumArt

public boolean noticeAlbumArt(java.awt.Window parent)
This notice is used exclusively when the application has failed to connect to the host and cannot continue from that point forward. It will prompt the user to exit the application or create a new entry.

Parameters:
parent - Parent Window component.
Returns:
Boolean indicating true to create or false to exit.