Ontimize 5.2071EN

com.ontimize.gui.preferences
Class BasicApplicationPreferences

java.lang.Object
  extended bycom.ontimize.gui.preferences.AbstractApplicationPreferences
      extended bycom.ontimize.gui.preferences.BasicApplicationPreferences
All Implemented Interfaces:
ApplicationPreferences

public class BasicApplicationPreferences
extends AbstractApplicationPreferences

Basic implementation of the application preferences

Version:
1.0

Field Summary
static java.lang.String ADJUST_TREE_SPACE
          Name of the preference to adjust automatically the available space for the trees
static boolean ADJUST_TREE_SPACE_VALUE
           
static java.lang.String APP_CONNECT_TO
           
static java.lang.String APP_FONTSIZE
          Name of the preference to set the application font size
static java.lang.String APP_LAST_LOGIN
          Name of the preference to store the last login used in the application
static java.lang.String APP_LAST_PASSWORD
           
static java.lang.String APP_LOCALE
           
static java.lang.String APP_REMEMBER_LAST_LOGIN
          Name of the preference to remember or not the last login used
static java.lang.String APP_REMEMBER_LAST_PASSWORD
           
static java.lang.String APP_STATUS_BAR_VISIBLE
          Name of the preference to show/hide the application status bar
static java.lang.String APP_TOOL_BAR_VISIBLE
          Name of the preference to show/hide the application buttons bar
static java.lang.String APP_TOOLBAR_LOCATION
           
static java.lang.String APP_USER_DIR
           
static java.lang.String APP_WINDOW_POSITION
          Name of the preference to set the application window position
static java.lang.String APP_WINDOW_SIZE
          Name of the preference to set the application window size
static java.lang.String APP_WINDOW_STATE
          Name of the preference to set the application window state
protected  javax.swing.JLabel backgroundColorFieldLabel
           
protected  java.lang.String basePath
           
protected  javax.swing.JButton cancelButton
           
static boolean checkOldPreferences
           
static java.lang.String COLLAPSIBLE_PANEL_VISIBLE
           
protected  javax.swing.JDialog colorDialog
           
static boolean DEBUG
           
static java.lang.String DETAIL_DIALOG_SIZE_POSITION
           
static java.lang.String DIALOG_SIZE_POSITION
           
 boolean dirtyMode
           
protected  javax.swing.JDialog dPreferences
           
protected  java.lang.String file
           
static java.lang.String FOCUSED_FIELD_BG_COLOR
           
static java.lang.String FORM_TABLEVIEW_COLUMNS
           
protected static java.lang.String L_EVEN_COLOR_TABLE_ROW
           
protected static java.lang.String L_FOCUS_COLOR_FIELD
           
protected static java.lang.String L_REQUIRED_BACKGROUND_COLOR_FIELD
           
protected  javax.swing.JLabel labelRequiredBackgroungColor
           
protected  javax.swing.JLabel labelTableColor
           
protected  boolean loadDeaults
           
static java.lang.String LOOK_AND_FEEL_CLASS_NAME
          Name of the preference to store the application look and feel
static java.lang.String MENU_ACCELERATOR
           
protected  javax.swing.JButton okButton
           
protected  javax.swing.JPanel panelFieldBackgroundColor
           
protected  javax.swing.JPanel panelRequiredBackgroundColor
           
protected  javax.swing.JPanel panelTableColor
           
static boolean remoteUserPreferences
           
static java.lang.String REQUIRED_FIELDS_BG_COLOR
          Name of the preference to set the required fields background color
protected  javax.swing.JButton restoreButton
           
protected  RemoteApplicationPreferences rprefs
           
static java.lang.String SHOW_TABLE_CONTROLS
          Name of the preference to show/hide the table controls
static java.lang.String SHOW_TABLE_NUM_ROW
          Name of the preference to show/hide the column with the rows number in a table
static java.lang.String SHOW_TIPS
           
static java.lang.String SPLIT_POSITION
           
protected static java.lang.String T_COLORS
           
static java.lang.String TABLE_CALCULATED_COLUMNS_CONFIGURATION
           
static java.lang.String TABLE_COLS_POSITION_SIZE
           
static java.lang.String TABLE_CONF_CHART_CONFIGURATIONS
           
static java.lang.String TABLE_CONF_PIVOT_TABLE_CONFIGURATIONS
           
static java.lang.String TABLE_CONF_REPORT_CONFIGURATIONS
           
static java.lang.String TABLE_CONF_SORT_FILTER
           
static java.lang.String TABLE_CONF_SORT_FILTER_CONFIGURATIONS
           
static java.lang.String TABLE_EVEN_ROWS_COLOR
          Name of the preference to set the even table rows background color
static java.lang.String TABLE_VISIBLE_COLS
           
 
Fields inherited from class com.ontimize.gui.preferences.AbstractApplicationPreferences
defaultUserProps, listeners, props, separator, userProps
 
Constructor Summary
BasicApplicationPreferences(java.lang.String file)
          Creates new BasicApplicationPreferences object with the preferences stored in the file file.
BasicApplicationPreferences(java.lang.String file, RemoteApplicationPreferences rp)
          Creates a BasicApplicationPreferences object with the preferences stored in the file file.
BasicApplicationPreferences(java.lang.String file, java.lang.String basePath)
          Creates a BasicApplicationPreferences object with the preferences stored in the file file.
BasicApplicationPreferences(java.lang.String file, java.lang.String basePath, RemoteApplicationPreferences rp)
          Creates a BasicApplicationPreferences object with the preferences stored in the file file.
 
Method Summary
protected  java.util.Properties checkOldPreferences(java.lang.String user)
          This method extract the user preferences of old preferences file.
protected  void createColorDialog(java.awt.Window parent)
           
 java.util.Properties getAllPreferences()
           
 java.lang.String getBasePath()
           
protected  java.lang.String getDefault(java.lang.String preferenceName)
          Gets the default value for the specified preference
 java.lang.String getFile()
           
 java.lang.String getPreference(java.lang.String user, java.lang.String preferenceName)
          Get the value of the preference with name preferenceName for the user user
 RemoteApplicationPreferences getRemoteApplicationPreferences()
           
static java.util.Properties getUserLocalPreferences(java.lang.String user, java.util.Properties properties)
           
 java.util.Properties getUserPreferences()
           
 boolean isDirtyMode()
           
protected  void loadDefaults()
          Initializes the default preference values
 void loadPreferences()
          Load the preference values
static java.lang.String parserPropertiesToStringBase64(java.util.Properties properties)
           
static java.util.Properties parserStringBase64ToProperties(java.lang.String properties)
           
 void savePreferences()
          Save the current preference values
 void setBasePath(java.lang.String basePath)
           
 void setDirtyMode(boolean dirtyMode)
           
 void setFile(java.lang.String file)
           
 void setLoadDefaults(boolean value)
           
 void setPreference(java.lang.String user, java.lang.String preferenceName, java.lang.String value)
          Sets the value of the preference with name preferenceName for the user user
 void setRemoteApplicationPreferences(RemoteApplicationPreferences rp)
           
protected  void setResourceBundleColorChooser()
           
protected  void setUserPreferences(java.util.Properties current)
           
 void showColorChooserDialog(java.awt.Window parent)
           
 void showPreferencesDialog(java.lang.String user, java.lang.String gf, java.lang.String form, Application a)
          Show a dialog to configure the user preferences
 
Methods inherited from class com.ontimize.gui.preferences.AbstractApplicationPreferences
addApplicationPreferencesListener, fireApplicationPreferencesChanged, getKeyPreference, getProperties, removeApplicationPreferencesListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

remoteUserPreferences

public static boolean remoteUserPreferences

checkOldPreferences

public static boolean checkOldPreferences

dirtyMode

public boolean dirtyMode

DEBUG

public static boolean DEBUG

APP_LOCALE

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

APP_CONNECT_TO

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

TABLE_EVEN_ROWS_COLOR

public static final java.lang.String TABLE_EVEN_ROWS_COLOR
Name of the preference to set the even table rows background color

See Also:
Constant Field Values

TABLE_VISIBLE_COLS

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

TABLE_CONF_SORT_FILTER

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

TABLE_CONF_SORT_FILTER_CONFIGURATIONS

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

TABLE_CONF_REPORT_CONFIGURATIONS

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

TABLE_CONF_CHART_CONFIGURATIONS

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

TABLE_COLS_POSITION_SIZE

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

TABLE_CONF_PIVOT_TABLE_CONFIGURATIONS

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

TABLE_CALCULATED_COLUMNS_CONFIGURATION

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

REQUIRED_FIELDS_BG_COLOR

public static final java.lang.String REQUIRED_FIELDS_BG_COLOR
Name of the preference to set the required fields background color

See Also:
Constant Field Values

FOCUSED_FIELD_BG_COLOR

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

SHOW_TIPS

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

SHOW_TABLE_CONTROLS

public static final java.lang.String SHOW_TABLE_CONTROLS
Name of the preference to show/hide the table controls

See Also:
Constant Field Values

SHOW_TABLE_NUM_ROW

public static final java.lang.String SHOW_TABLE_NUM_ROW
Name of the preference to show/hide the column with the rows number in a table

See Also:
Constant Field Values

APP_WINDOW_POSITION

public static final java.lang.String APP_WINDOW_POSITION
Name of the preference to set the application window position

See Also:
Constant Field Values

APP_WINDOW_STATE

public static final java.lang.String APP_WINDOW_STATE
Name of the preference to set the application window state

See Also:
Constant Field Values

APP_WINDOW_SIZE

public static final java.lang.String APP_WINDOW_SIZE
Name of the preference to set the application window size

See Also:
Constant Field Values

APP_STATUS_BAR_VISIBLE

public static final java.lang.String APP_STATUS_BAR_VISIBLE
Name of the preference to show/hide the application status bar

See Also:
Constant Field Values

APP_TOOL_BAR_VISIBLE

public static final java.lang.String APP_TOOL_BAR_VISIBLE
Name of the preference to show/hide the application buttons bar

See Also:
Constant Field Values

APP_FONTSIZE

public static final java.lang.String APP_FONTSIZE
Name of the preference to set the application font size

See Also:
Constant Field Values

ADJUST_TREE_SPACE

public static final java.lang.String ADJUST_TREE_SPACE
Name of the preference to adjust automatically the available space for the trees

See Also:
Constant Field Values

ADJUST_TREE_SPACE_VALUE

public static boolean ADJUST_TREE_SPACE_VALUE

APP_REMEMBER_LAST_LOGIN

public static final java.lang.String APP_REMEMBER_LAST_LOGIN
Name of the preference to remember or not the last login used

See Also:
Constant Field Values

APP_LAST_LOGIN

public static final java.lang.String APP_LAST_LOGIN
Name of the preference to store the last login used in the application

See Also:
Constant Field Values

APP_REMEMBER_LAST_PASSWORD

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

APP_LAST_PASSWORD

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

APP_USER_DIR

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

LOOK_AND_FEEL_CLASS_NAME

public static final java.lang.String LOOK_AND_FEEL_CLASS_NAME
Name of the preference to store the application look and feel

See Also:
Constant Field Values

SPLIT_POSITION

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

COLLAPSIBLE_PANEL_VISIBLE

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

DETAIL_DIALOG_SIZE_POSITION

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

DIALOG_SIZE_POSITION

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

APP_TOOLBAR_LOCATION

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

MENU_ACCELERATOR

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

FORM_TABLEVIEW_COLUMNS

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

dPreferences

protected javax.swing.JDialog dPreferences

file

protected java.lang.String file

basePath

protected java.lang.String basePath

colorDialog

protected javax.swing.JDialog colorDialog

panelTableColor

protected javax.swing.JPanel panelTableColor

panelRequiredBackgroundColor

protected javax.swing.JPanel panelRequiredBackgroundColor

panelFieldBackgroundColor

protected javax.swing.JPanel panelFieldBackgroundColor

T_COLORS

protected static java.lang.String T_COLORS

L_EVEN_COLOR_TABLE_ROW

protected static java.lang.String L_EVEN_COLOR_TABLE_ROW

L_REQUIRED_BACKGROUND_COLOR_FIELD

protected static java.lang.String L_REQUIRED_BACKGROUND_COLOR_FIELD

L_FOCUS_COLOR_FIELD

protected static java.lang.String L_FOCUS_COLOR_FIELD

labelTableColor

protected javax.swing.JLabel labelTableColor

labelRequiredBackgroungColor

protected javax.swing.JLabel labelRequiredBackgroungColor

backgroundColorFieldLabel

protected javax.swing.JLabel backgroundColorFieldLabel

okButton

protected javax.swing.JButton okButton

cancelButton

protected javax.swing.JButton cancelButton

restoreButton

protected javax.swing.JButton restoreButton

rprefs

protected RemoteApplicationPreferences rprefs

loadDeaults

protected boolean loadDeaults
Constructor Detail

BasicApplicationPreferences

public BasicApplicationPreferences(java.lang.String file)
Creates new BasicApplicationPreferences object with the preferences stored in the file file.

Parameters:
file - Name of the file (without path) that contains the application preferences. This file must be in the user directory

BasicApplicationPreferences

public BasicApplicationPreferences(java.lang.String file,
                                   java.lang.String basePath)
Creates a BasicApplicationPreferences object with the preferences stored in the file file.

Parameters:
file - Name of the preferences file
basePath - Path where the file is

BasicApplicationPreferences

public BasicApplicationPreferences(java.lang.String file,
                                   RemoteApplicationPreferences rp)
Creates a BasicApplicationPreferences object with the preferences stored in the file file.

Parameters:
file - Name of the file (without path). This file must be in the user directory
rp - Remote preferences

BasicApplicationPreferences

public BasicApplicationPreferences(java.lang.String file,
                                   java.lang.String basePath,
                                   RemoteApplicationPreferences rp)
Creates a BasicApplicationPreferences object with the preferences stored in the file file.

Parameters:
file - Name of the file
basePath - Path where the file is
rp - Remote preferences
Method Detail

getFile

public java.lang.String getFile()

setFile

public void setFile(java.lang.String file)

getBasePath

public java.lang.String getBasePath()

setBasePath

public void setBasePath(java.lang.String basePath)

setLoadDefaults

public void setLoadDefaults(boolean value)

loadPreferences

public void loadPreferences()
Description copied from interface: ApplicationPreferences
Load the preference values


loadDefaults

protected void loadDefaults()
Initializes the default preference values


getPreference

public java.lang.String getPreference(java.lang.String user,
                                      java.lang.String preferenceName)
Description copied from interface: ApplicationPreferences
Get the value of the preference with name preferenceName for the user user

Parameters:
user - Name of the user or null if the preference is for all users
preferenceName - Name of the preference
Returns:
Preference value

getDefault

protected java.lang.String getDefault(java.lang.String preferenceName)
Gets the default value for the specified preference

Parameters:
preferenceName -
Returns:

setPreference

public void setPreference(java.lang.String user,
                          java.lang.String preferenceName,
                          java.lang.String value)
Description copied from interface: ApplicationPreferences
Sets the value of the preference with name preferenceName for the user user

Parameters:
user - Name of the user or null if the preference is for all users
preferenceName - Name of the preference
value - The value for the preference

savePreferences

public void savePreferences()
Description copied from interface: ApplicationPreferences
Save the current preference values


showPreferencesDialog

public void showPreferencesDialog(java.lang.String user,
                                  java.lang.String gf,
                                  java.lang.String form,
                                  Application a)
Description copied from interface: ApplicationPreferences
Show a dialog to configure the user preferences

Parameters:
user -
gf -
form -
a -

showColorChooserDialog

public void showColorChooserDialog(java.awt.Window parent)

setResourceBundleColorChooser

protected void setResourceBundleColorChooser()

createColorDialog

protected void createColorDialog(java.awt.Window parent)

setRemoteApplicationPreferences

public void setRemoteApplicationPreferences(RemoteApplicationPreferences rp)

getRemoteApplicationPreferences

public RemoteApplicationPreferences getRemoteApplicationPreferences()

parserPropertiesToStringBase64

public static java.lang.String parserPropertiesToStringBase64(java.util.Properties properties)

parserStringBase64ToProperties

public static java.util.Properties parserStringBase64ToProperties(java.lang.String properties)

getUserLocalPreferences

public static java.util.Properties getUserLocalPreferences(java.lang.String user,
                                                           java.util.Properties properties)

getUserPreferences

public java.util.Properties getUserPreferences()

setUserPreferences

protected void setUserPreferences(java.util.Properties current)

checkOldPreferences

protected java.util.Properties checkOldPreferences(java.lang.String user)
This method extract the user preferences of old preferences file.

Parameters:
user -
Returns:

getAllPreferences

public java.util.Properties getAllPreferences()

isDirtyMode

public boolean isDirtyMode()

setDirtyMode

public void setDirtyMode(boolean dirtyMode)

Ontimize