gui
Class JAPDll

java.lang.Object
  extended by gui.JAPDll

public final class JAPDll
extends java.lang.Object


Nested Class Summary
private static class JAPDll.MyFileFilter
           
 
Field Summary
private static java.lang.String DLL_LIBRARY_NAME
           
private static java.lang.String DLL_LIBRARY_NAME_32bit
           
private static java.lang.String DLL_LIBRARY_NAME_64bit
           
private static java.lang.String JAP_DLL
           
private static java.lang.String JAP_DLL_NEW_32bit
           
private static java.lang.String JAP_DLL_NEW_64bit
           
private static java.lang.String JAP_DLL_OLD
           
static java.lang.String JAP_DLL_REQUIRED_VERSION
           
private static boolean m_bStartedAsAdmin
           
private static boolean m_sbHasOnTraffic
           
private static boolean ms_bInTaskbar
           
private static java.util.Hashtable ms_hashOnTop
           
private static SystrayPopupMenu ms_popupMenu
           
private static java.awt.Window ms_popupWindow
           
private static java.lang.String MSG_CONFIRM_OVERWRITE
           
private static java.lang.String MSG_COULD_NOT_SAVE
           
private static java.lang.String MSG_DLL_UPDATE
          Messages
private static java.lang.String MSG_DLL_UPDATE_FAILED
           
private static java.lang.String MSG_DLL_UPDATE_SUCCESS_ADMIN
           
static java.lang.String MSG_IGNORE_UPDATE
           
private static java.lang.String MSG_PERMISSION_PROBLEM
           
static java.lang.String START_PARAMETER_ADMIN
           
private static java.lang.String STR_HIDDEN_WINDOW
           
private static java.lang.Object SYNC_POPUP
           
private static java.lang.String UPDATE_PATH
           
 
Constructor Summary
JAPDll()
           
 
Method Summary
private static void askUserWhatToDo()
          This method should be invoked if there was no possibility to so a successfull dll update: Reasons can be: - japdll.dll cannot be written (e.g.
static void checkDllVersion(boolean a_bShowDialogAndCloseOnUpdate)
          This method should be invoked on every JAP-start: It will check if the existing japdll.dll has the right version to work proper with this JAP version.
static long closePopupMenu()
           
private static boolean extractDLL(java.io.File a_file)
          Extracts the japdll.dll from the jar-file to the given file
private static java.lang.String getDllFileName_dll()
           
static java.lang.String getDllFileName()
          Returns the file name of the JAPDll.
private static java.lang.String getDllVersion_dll()
           
static java.lang.String getDllVersion()
           
private static java.lang.String getUpdatePath()
          Returns the path where the dll should be stored into.
private static void hideSystray_dll()
           
private static boolean hideWindowInTaskbar_dll(java.lang.String caption)
           
static boolean hideWindowInTaskbar(java.lang.String caption)
           
private static void informUserAboutJapRestart()
          informs the user, that the JAP must be restarted, in order to finish the update
static void init(boolean a_bStartedAsAdmin, java.lang.String a_username, java.awt.Window a_window)
           
private static boolean isWindowOnTop(java.awt.Window a_window)
          Checks if the onTop method of the dll has been used for this window.
private static void loadDll()
           
private static void onTraffic_dll()
           
static boolean onTraffic()
           
private static void popupClosed_dll()
           
private static boolean renameDLL(java.lang.String a_oldName, java.lang.String a_newName)
          Renames the existing japdll.dll to japdll.old before the new DLL is extracted from jar-file
static void setSystrayTooltip(java.lang.String a_strTooltipText)
           
private static boolean setTooltipText_dll(java.lang.String a_strTooltipText)
           
private static boolean setWindowIcon_dll(java.lang.String caption)
           
static boolean setWindowIcon(java.lang.String caption)
           
private static void setWindowOnTop_dll(java.lang.String caption, boolean onTop)
           
private static boolean setWindowOnTop(java.awt.Window theWindow, boolean onTop)
           
private static boolean shellExecute_dll(java.lang.String a_command, java.lang.String a_parameters, boolean a_bAsAdmin)
           
static boolean shellExecute(java.lang.String a_command, java.lang.String a_parameters, boolean a_bAsAdmin)
           
static long showMainWindow()
           
static long showPopupMenu(long a_x, long a_y)
           
private static boolean showWindowFromTaskbar_dll()
           
static boolean showWindowFromTaskbar()
           
private static boolean update(java.awt.Component a_window)
           
static boolean xcopy(java.io.File a_file, java.io.File a_directory, boolean a_asAdmin)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_IGNORE_UPDATE

public static final java.lang.String MSG_IGNORE_UPDATE

JAP_DLL_REQUIRED_VERSION

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

START_PARAMETER_ADMIN

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

UPDATE_PATH

private static final java.lang.String UPDATE_PATH

DLL_LIBRARY_NAME

private static final java.lang.String DLL_LIBRARY_NAME
See Also:
Constant Field Values

DLL_LIBRARY_NAME_32bit

private static final java.lang.String DLL_LIBRARY_NAME_32bit
See Also:
Constant Field Values

DLL_LIBRARY_NAME_64bit

private static final java.lang.String DLL_LIBRARY_NAME_64bit
See Also:
Constant Field Values

JAP_DLL

private static final java.lang.String JAP_DLL
See Also:
Constant Field Values

JAP_DLL_NEW_32bit

private static final java.lang.String JAP_DLL_NEW_32bit
See Also:
Constant Field Values

JAP_DLL_NEW_64bit

private static final java.lang.String JAP_DLL_NEW_64bit
See Also:
Constant Field Values

JAP_DLL_OLD

private static final java.lang.String JAP_DLL_OLD
See Also:
Constant Field Values

MSG_DLL_UPDATE

private static final java.lang.String MSG_DLL_UPDATE
Messages


MSG_DLL_UPDATE_SUCCESS_ADMIN

private static final java.lang.String MSG_DLL_UPDATE_SUCCESS_ADMIN

MSG_DLL_UPDATE_FAILED

private static final java.lang.String MSG_DLL_UPDATE_FAILED

MSG_CONFIRM_OVERWRITE

private static final java.lang.String MSG_CONFIRM_OVERWRITE

MSG_PERMISSION_PROBLEM

private static final java.lang.String MSG_PERMISSION_PROBLEM

MSG_COULD_NOT_SAVE

private static final java.lang.String MSG_COULD_NOT_SAVE

ms_hashOnTop

private static java.util.Hashtable ms_hashOnTop

ms_bInTaskbar

private static boolean ms_bInTaskbar

SYNC_POPUP

private static final java.lang.Object SYNC_POPUP

ms_popupMenu

private static SystrayPopupMenu ms_popupMenu

ms_popupWindow

private static java.awt.Window ms_popupWindow

m_sbHasOnTraffic

private static boolean m_sbHasOnTraffic

m_bStartedAsAdmin

private static boolean m_bStartedAsAdmin

STR_HIDDEN_WINDOW

private static final java.lang.String STR_HIDDEN_WINDOW
Constructor Detail

JAPDll

public JAPDll()
Method Detail

loadDll

private static void loadDll()

init

public static void init(boolean a_bStartedAsAdmin,
                        java.lang.String a_username,
                        java.awt.Window a_window)

checkDllVersion

public static void checkDllVersion(boolean a_bShowDialogAndCloseOnUpdate)
This method should be invoked on every JAP-start: It will check if the existing japdll.dll has the right version to work proper with this JAP version. If no japdll.dll exists at all, nothing will happen. If the japdll.dll has the wrong version, a backup of the old file is created and the suitable japdll.dll is extracted from the JAP.jar. In this case the user must restart the JAP.

Parameters:
a_bShowDialogAndCloseOnUpdate - if, in case of a neccessary update, a dialog is shown and JAP is closed

update

private static boolean update(java.awt.Component a_window)

renameDLL

private static boolean renameDLL(java.lang.String a_oldName,
                                 java.lang.String a_newName)
Renames the existing japdll.dll to japdll.old before the new DLL is extracted from jar-file

Parameters:
a_oldName - old name of the file
a_newName - new name of the file

extractDLL

private static boolean extractDLL(java.io.File a_file)
Extracts the japdll.dll from the jar-file to the given file

Parameters:
a_file - File
Returns:
boolean

askUserWhatToDo

private static void askUserWhatToDo()
This method should be invoked if there was no possibility to so a successfull dll update: Reasons can be: - japdll.dll cannot be written (e.g. not enough user privileges) - a japdll.dll is loaded, but there is no japdll.dll in the jar-path (japdll.dll is e.g. in Windows-System-Directory) - japdll.dll update was successfull, but the version loaded is still the wrong (this can be happen, if there is a old japdll.dll in the Windows-System-Directory AND in the jar-path


informUserAboutJapRestart

private static void informUserAboutJapRestart()
informs the user, that the JAP must be restarted, in order to finish the update


isWindowOnTop

private static boolean isWindowOnTop(java.awt.Window a_window)
Checks if the onTop method of the dll has been used for this window.

Parameters:
a_window - Window
Returns:
if the onTop method of the dll has been used for this window

setWindowOnTop

private static boolean setWindowOnTop(java.awt.Window theWindow,
                                      boolean onTop)

showWindowFromTaskbar

public static boolean showWindowFromTaskbar()

hideWindowInTaskbar

public static boolean hideWindowInTaskbar(java.lang.String caption)

setWindowIcon

public static boolean setWindowIcon(java.lang.String caption)

onTraffic

public static boolean onTraffic()

xcopy

public static boolean xcopy(java.io.File a_file,
                            java.io.File a_directory,
                            boolean a_asAdmin)

getDllVersion

public static java.lang.String getDllVersion()

getUpdatePath

private static java.lang.String getUpdatePath()
Returns the path where the dll should be stored into.

Returns:

getDllFileName

public static java.lang.String getDllFileName()
Returns the file name of the JAPDll.


showMainWindow

public static long showMainWindow()

closePopupMenu

public static long closePopupMenu()

showPopupMenu

public static long showPopupMenu(long a_x,
                                 long a_y)

setSystrayTooltip

public static void setSystrayTooltip(java.lang.String a_strTooltipText)

shellExecute

public static boolean shellExecute(java.lang.String a_command,
                                   java.lang.String a_parameters,
                                   boolean a_bAsAdmin)

setWindowOnTop_dll

private static void setWindowOnTop_dll(java.lang.String caption,
                                       boolean onTop)

hideWindowInTaskbar_dll

private static boolean hideWindowInTaskbar_dll(java.lang.String caption)

showWindowFromTaskbar_dll

private static boolean showWindowFromTaskbar_dll()

setTooltipText_dll

private static boolean setTooltipText_dll(java.lang.String a_strTooltipText)

setWindowIcon_dll

private static boolean setWindowIcon_dll(java.lang.String caption)

onTraffic_dll

private static void onTraffic_dll()

popupClosed_dll

private static void popupClosed_dll()

hideSystray_dll

private static void hideSystray_dll()

getDllVersion_dll

private static java.lang.String getDllVersion_dll()

getDllFileName_dll

private static java.lang.String getDllFileName_dll()

shellExecute_dll

private static boolean shellExecute_dll(java.lang.String a_command,
                                        java.lang.String a_parameters,
                                        boolean a_bAsAdmin)