com.swfm.mica.widgets
Class MiToolkit

java.lang.Object
  extended bycom.swfm.mica.widgets.MiToolkit
All Implemented Interfaces:
MiiAttributeTypes, MiiCommandNames, MiiLookProperties, MiiMessages, MiiToolkit, MiiTypes

public class MiToolkit
extends java.lang.Object
implements MiiTypes, MiiAttributeTypes, MiiCommandNames, MiiMessages, MiiLookProperties, MiiToolkit

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
static int acceleratorModifier
           
static java.lang.String Mi_DEFAULT_WIDGET_ATTRIBUTES_PROPERTY_NAME
           
static int radioButtonShape
           
             
Constructor Summary
MiToolkit()
           
 
Method Summary
static void applyStandardObjectAttributes(MiPart obj)
           
 void applyStandardWidgetAttributesToWidget(MiWidget widget)
           
static MiNativeMessageDialog createAboutDialog(MiEditor window, java.lang.String title, MiPart logo, java.lang.String text, boolean modal)
          Creates a standard 'About' dialog box.
static void generateColorSchemeFromBaseColor(java.awt.Color c)
           
static MiAttributes getAttributes(int attributeID)
           
static MiPart getCheckMarkIcon()
           
static java.lang.String getDefaultWidgetAttributeProperty(java.lang.String name)
           
static MiPart getIconizedWindowIcon()
           
static MiWidgetAttributes getStandardWidgetAttributes()
           
 java.awt.Color getTextFieldEditableBGColor()
           
 java.awt.Color getTextFieldInEditableBGColor()
           
 int getTextInSensitiveBorderLook()
           
 java.awt.Color getTextInSensitiveColor()
           
 int getTextSensitiveBorderLook()
           
 java.awt.Color getTextSensitiveColor()
           
static MiAttributes getToolkitAttributesForCategory(java.lang.String tookitAttributeCategory)
           
static java.lang.String getWidgetAttributeProperty(MiWidgetAttributes atts, java.lang.String key)
           
static void initLookAndFeel()
           
static void overrideAttributes(MiPart part, int attributeID)
           
static void postAboutDialog(MiEditor window, java.lang.String title, MiPart logo, java.lang.String text, boolean modal)
          Creates a standard 'About' dialog box.
static void postErrorDialog(MiEditor window, MiPart msg)
          Creates a dialog box which prompts the user with an error icon and the given error message.
static void postErrorDialog(MiPart window, java.lang.String msg)
          Creates a dialog box which prompts the user with an error icon and the given error message.
static void postInfoDialog(MiEditor window, java.lang.String title, MiPart msg, boolean modal)
          Creates a dialog box which prompts the user with an info icon and the given informative message.
static java.lang.String postQueryDialog(MiEditor window, java.lang.String title, MiPart body)
           
static java.lang.String postQueryDialog(MiEditor window, java.lang.String title, MiPart body, java.lang.String okStr, java.lang.String notOkStr)
           
static java.lang.String postQueryDialog(MiEditor window, java.lang.String title, java.lang.String msg, java.lang.String okStr, java.lang.String notOkStr)
          Creates a standard 'Query' dialog box.
static java.lang.String postSaveChangesAllViewsDialog(MiEditor window, java.lang.String nameOfAChanged)
           
static java.lang.String postSaveChangesDialog(MiEditor window, java.lang.String nameOfChanged)
          Displays a dialog box which prompts the user to 1) save the changes thay have made to the given nameOfChanged, 2) Loose their changes or 3) cancel the current operation.
static void postScrolledErrorDialog(MiPart window, java.lang.String msg)
          Creates a dialog box which prompts the user with an error icon and the given error message.
static void postWarningDialog(MiEditor window, java.lang.String msg)
           
static java.lang.String postWarningDialog(MiEditor window, java.lang.String title, java.lang.String msg, boolean cancelButtonIsDisplayed)
          Creates a dialog box which prompts the user with an warning icon and the given query message.
static void refreshLookAndFeel()
           
static void setAttributes(MiPart part, int attributeID)
           
static void setBackgroundAttributes(MiPart part, int attributeID)
           
 void setStandardObjectAttributes(MiPart obj)
           
static void setStandardWidgetAttributes(MiWidgetAttributes widgetAtts)
          public MiiDeviceRenderer getBackgroundRenderer() { return(backgroundRenderer); } public void setBackgroundRenderer(MiiDeviceRenderer r) { backgroundRenderer = r; if (widgetNormalAttributes.getBackgroundColor() != Mi_TRANSPARENT_COLOR) widgetNormalAttributes = widgetNormalAttributes.setBackgroundRenderer(r); }
static void setToolkitAttributesForCategory(java.lang.String tookitAttributeCategory, MiAttributes atts)
          Possible categories are defined in MiiToolkit.java and are specifyable from properties.mica and are currently: Mi_TOOLKIT_EDITABLE_BG_PROPERTY_NAME = "MiToolkit.editableBackground"; Mi_TOOLKIT_UNEDITABLE_BG_PROPERTY_NAME = "MiToolkit.uneditableBackground"; Mi_TOOLKIT_INDENTED_BG_PROPERTY_NAME = "MiToolkit.indentedBackground"; Mi_TOOLKIT_TEXT_INSENSITIVE_PROPERTY_NAME= "MiToolkit.textInsensitive"; Mi_TOOLKIT_TEXT_SELECTED_PROPERTY_NAME = "MiToolkit.textSelected"; Mi_TOOLKIT_TEXT_PROPERTY_NAME = "MiToolkit.text"; Mi_TOOLKIT_WINDOW_TEXT_PROPERTY_NAME = "MiToolkit.windowText"; Mi_TOOLKIT_WINDOW_PROPERTY_NAME = "MiToolkit.window"; Mi_TOOLKIT_MENU_TEXT_PROPERTY_NAME = "MiToolkit.menuText"; Mi_TOOLKIT_MENU_PROPERTY_NAME = "MiToolkit.menu"; Mi_TOOLKIT_CELL_FOCUS_PROPERTY_NAME = "MiToolkit.cellFocus"; Mi_TOOLKIT_CELL_SELECTED_PROPERTY_NAME = "MiToolkit.cellSelected";
static java.util.Properties setWidgetAttributeProperties(MiWidgetAttributes atts, java.util.Properties properties)
           
static boolean setWidgetAttributeProperty(MiWidgetAttributes atts, java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Mi_DEFAULT_WIDGET_ATTRIBUTES_PROPERTY_NAME

public static final java.lang.String Mi_DEFAULT_WIDGET_ATTRIBUTES_PROPERTY_NAME
See Also:
Constant Field Values

radioButtonShape

public static int radioButtonShape

acceleratorModifier

public static int acceleratorModifier
Constructor Detail

MiToolkit

public MiToolkit()
Method Detail

initLookAndFeel

public static void initLookAndFeel()

refreshLookAndFeel

public static void refreshLookAndFeel()

getAttributes

public static MiAttributes getAttributes(int attributeID)

overrideAttributes

public static void overrideAttributes(MiPart part,
                                      int attributeID)

setAttributes

public static void setAttributes(MiPart part,
                                 int attributeID)

setBackgroundAttributes

public static void setBackgroundAttributes(MiPart part,
                                           int attributeID)

setWidgetAttributeProperties

public static java.util.Properties setWidgetAttributeProperties(MiWidgetAttributes atts,
                                                                java.util.Properties properties)

setWidgetAttributeProperty

public static boolean setWidgetAttributeProperty(MiWidgetAttributes atts,
                                                 java.lang.String key,
                                                 java.lang.String value)

setToolkitAttributesForCategory

public static void setToolkitAttributesForCategory(java.lang.String tookitAttributeCategory,
                                                   MiAttributes atts)
Possible categories are defined in MiiToolkit.java and are specifyable from properties.mica and are currently: Mi_TOOLKIT_EDITABLE_BG_PROPERTY_NAME = "MiToolkit.editableBackground"; Mi_TOOLKIT_UNEDITABLE_BG_PROPERTY_NAME = "MiToolkit.uneditableBackground"; Mi_TOOLKIT_INDENTED_BG_PROPERTY_NAME = "MiToolkit.indentedBackground"; Mi_TOOLKIT_TEXT_INSENSITIVE_PROPERTY_NAME= "MiToolkit.textInsensitive"; Mi_TOOLKIT_TEXT_SELECTED_PROPERTY_NAME = "MiToolkit.textSelected"; Mi_TOOLKIT_TEXT_PROPERTY_NAME = "MiToolkit.text"; Mi_TOOLKIT_WINDOW_TEXT_PROPERTY_NAME = "MiToolkit.windowText"; Mi_TOOLKIT_WINDOW_PROPERTY_NAME = "MiToolkit.window"; Mi_TOOLKIT_MENU_TEXT_PROPERTY_NAME = "MiToolkit.menuText"; Mi_TOOLKIT_MENU_PROPERTY_NAME = "MiToolkit.menu"; Mi_TOOLKIT_CELL_FOCUS_PROPERTY_NAME = "MiToolkit.cellFocus"; Mi_TOOLKIT_CELL_SELECTED_PROPERTY_NAME = "MiToolkit.cellSelected";


getToolkitAttributesForCategory

public static MiAttributes getToolkitAttributesForCategory(java.lang.String tookitAttributeCategory)

getDefaultWidgetAttributeProperty

public static java.lang.String getDefaultWidgetAttributeProperty(java.lang.String name)

getWidgetAttributeProperty

public static java.lang.String getWidgetAttributeProperty(MiWidgetAttributes atts,
                                                          java.lang.String key)

generateColorSchemeFromBaseColor

public static void generateColorSchemeFromBaseColor(java.awt.Color c)

getTextFieldEditableBGColor

public java.awt.Color getTextFieldEditableBGColor()

getTextFieldInEditableBGColor

public java.awt.Color getTextFieldInEditableBGColor()

getTextSensitiveColor

public java.awt.Color getTextSensitiveColor()

getTextInSensitiveColor

public java.awt.Color getTextInSensitiveColor()

getTextInSensitiveBorderLook

public int getTextInSensitiveBorderLook()

getTextSensitiveBorderLook

public int getTextSensitiveBorderLook()

setStandardWidgetAttributes

public static void setStandardWidgetAttributes(MiWidgetAttributes widgetAtts)
public MiiDeviceRenderer getBackgroundRenderer() { return(backgroundRenderer); } public void setBackgroundRenderer(MiiDeviceRenderer r) { backgroundRenderer = r; if (widgetNormalAttributes.getBackgroundColor() != Mi_TRANSPARENT_COLOR) widgetNormalAttributes = widgetNormalAttributes.setBackgroundRenderer(r); }


getStandardWidgetAttributes

public static MiWidgetAttributes getStandardWidgetAttributes()

applyStandardWidgetAttributesToWidget

public void applyStandardWidgetAttributesToWidget(MiWidget widget)

applyStandardObjectAttributes

public static void applyStandardObjectAttributes(MiPart obj)

setStandardObjectAttributes

public void setStandardObjectAttributes(MiPart obj)

getIconizedWindowIcon

public static MiPart getIconizedWindowIcon()

getCheckMarkIcon

public static MiPart getCheckMarkIcon()

postSaveChangesDialog

public static java.lang.String postSaveChangesDialog(MiEditor window,
                                                     java.lang.String nameOfChanged)
Displays a dialog box which prompts the user to 1) save the changes thay have made to the given nameOfChanged, 2) Loose their changes or 3) cancel the current operation. The current thread will wait here until the user responds. Based on the user's response the following values are returned: Mi_SAVE_COMMAND_NAME Mi_CONTINUE_COMMAND_NAME Mi_CANCEL_COMMAND_NAME

Parameters:
window - the parent window the dialog box will be displayed in.
nameOfChanged - the name that will appear in the dialog box prompt or null
Returns:
the user's response

postSaveChangesAllViewsDialog

public static java.lang.String postSaveChangesAllViewsDialog(MiEditor window,
                                                             java.lang.String nameOfAChanged)

postScrolledErrorDialog

public static void postScrolledErrorDialog(MiPart window,
                                           java.lang.String msg)
Creates a dialog box which prompts the user with an error icon and the given error message. The current thread will wait here until the user responds (presses OK).

Parameters:
window - the parent window the dialog box will be displayed in.
msg - the error message

postErrorDialog

public static void postErrorDialog(MiPart window,
                                   java.lang.String msg)
Creates a dialog box which prompts the user with an error icon and the given error message. The current thread will wait here until the user responds (presses OK).

Parameters:
window - the parent window the dialog box will be displayed in.
msg - the error message

postErrorDialog

public static void postErrorDialog(MiEditor window,
                                   MiPart msg)
Creates a dialog box which prompts the user with an error icon and the given error message. The current thread will wait here until the user responds (presses OK).

Parameters:
window - the parent window the dialog box will be displayed in.
msg - the error message

postWarningDialog

public static java.lang.String postWarningDialog(MiEditor window,
                                                 java.lang.String title,
                                                 java.lang.String msg,
                                                 boolean cancelButtonIsDisplayed)
Creates a dialog box which prompts the user with an warning icon and the given query message. The current thread will wait here until the user responds (presses Yes, No or Cancel).

Parameters:
window - the parent window the dialog box will be displayed in.
title - the dialog box border msg
msg - the query message
cancelButtonIsDisplayed - true if "No" button is to be displayed
Returns:
Mi_OK_COMMAND_NAME Mi_NOT_OK_COMMAND_NAME (if cancelButtonIsDisplayed) Mi_CANCEL_COMMAND_NAME

postWarningDialog

public static void postWarningDialog(MiEditor window,
                                     java.lang.String msg)

postInfoDialog

public static void postInfoDialog(MiEditor window,
                                  java.lang.String title,
                                  MiPart msg,
                                  boolean modal)
Creates a dialog box which prompts the user with an info icon and the given informative message. The current thread will wait here until the user responds (presses OK) if this is modal.

Parameters:
window - the parent window the dialog box will be displayed in.
title - the dialog box border msg
msg - the info message
modal - true if this is to be a modal dialog

postAboutDialog

public static void postAboutDialog(MiEditor window,
                                   java.lang.String title,
                                   MiPart logo,
                                   java.lang.String text,
                                   boolean modal)
Creates a standard 'About' dialog box. The current thread will wait here until the user responds (presses OK) if this is modal.

Parameters:
window - the parent window the dialog box will be displayed in.
title - the dialog box border msg
logo - the comany logo
modal - true if this is to be a modal dialog

createAboutDialog

public static MiNativeMessageDialog createAboutDialog(MiEditor window,
                                                      java.lang.String title,
                                                      MiPart logo,
                                                      java.lang.String text,
                                                      boolean modal)
Creates a standard 'About' dialog box.

Parameters:
window - the parent window the dialog box will be displayed in.
title - the dialog box border msg
logo - the comany logo
modal - true if this is to be a modal dialog

postQueryDialog

public static java.lang.String postQueryDialog(MiEditor window,
                                               java.lang.String title,
                                               java.lang.String msg,
                                               java.lang.String okStr,
                                               java.lang.String notOkStr)
Creates a standard 'Query' dialog box. The current thread will wait here until the user responds (presses OK) because this is modal.

Parameters:
window - the parent window the dialog box will be displayed in.
title - the dialog box border msg
msg - the query message
Returns:
Mi_OK_COMMAND_NAME Mi_CANCEL_COMMAND_NAME

postQueryDialog

public static java.lang.String postQueryDialog(MiEditor window,
                                               java.lang.String title,
                                               MiPart body)

postQueryDialog

public static java.lang.String postQueryDialog(MiEditor window,
                                               java.lang.String title,
                                               MiPart body,
                                               java.lang.String okStr,
                                               java.lang.String notOkStr)