public class PhantomHostData extends Object implements IReloadable
| Modifier and Type | Class and Description |
|---|---|
class |
PhantomHostData.ScreenGroup
This class is used by the PhantomHostData class to
maintain screen groups when screen are using the
binary match method.
|
| Modifier and Type | Field and Description |
|---|---|
boolean |
areScreensAnalyzed
Flag indicating if the screens are analyzed so that "binary"
search algorithm can be used.
|
static String |
BROKEN_MACRO_SCREEN_NAME
The name of the dummy screen used "__BROKEN_MACRO__".
|
static PhantomHostScreen |
dummyScreen
A dummy host screen when a Phantom Macro is broken.
|
Hashtable<String,PhantomHostScreen> |
fastSearch
The hash table for the screen groups instead of the binary search
algorithm.
|
String |
fileComments
The file comments.
|
int |
macroCount
Count of Phantom macros.
|
Hashtable<String,PhantomMacro> |
macros
The table of macros.
|
static int |
MATCHFLAG_POPWIN
Match flag: Use pop-up window recognition.
|
static int |
MATCHFLAG_STOPWHENFOUND
Match flag: Stop at first match.
|
int |
matchFlags
Flags used for matching screens.
|
PhantomRuntime |
runtime
The runtime file associated with the host data, null for none.
|
int |
screenCount
Count of host screens.
|
PhantomHostData.ScreenGroup[] |
screenGroups
The screen group array.
|
Vector<PhantomHostScreen> |
screens
The host screen array.
|
Hashtable<String,PhantomHostScreen> |
screensByName
Table to find a screen by the name.
|
boolean |
useBinaryMatchMethod
Flag for searching the screens using binary search algorithm.
|
FAILURE, NOTHING_DONE, SUCCESS| Constructor and Description |
|---|
PhantomHostData()
Creates an empty host data instance.
|
PhantomHostData(PhantomFile file)
Constructor - loads the indicated file.
|
PhantomHostData(PhantomFile file,
PhantomRuntime runtime)
Constructor - loads the indicated file (if non-null), an associated runtime (that may
be null).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(PhantomHostScreen newScreen)
Add a new screen.
|
PhantomHostScreen |
addBrokenMacroScreen()
Adds the broken dummy screen to the application once only.
|
PhantomHostScreen[] |
getAllMatchingScreens(HostScreen screen)
Find all the screens that match.
|
String |
getFileName()
Gets file name.
|
PhantomMacro |
getMacro(String name)
Gets a macro by the name.
|
Hashtable<String,PhantomMacro> |
getMacros()
Gets macros for this host data
|
PhantomHostScreen |
getMatchingScreen(HostScreen screen)
Checks which screens match.
|
int[] |
getMatchingScreens(HostScreen screen)
Gets the matching screens for this runtime file host data with the
current settings.
|
PhantomHostScreen |
getScreen(int index)
Gets a host screen from index.
|
PhantomHostScreen |
getScreen(String name)
Gets a host screen by the name.
|
PhantomHostScreen[] |
getScreens()
Gets screens for this host data.
|
void |
maybeThrowIOException(String msg)
Throws an IOException with the message specified if the runtime file is loaded
normally and doesn't have the flag doIgnoreNonFatalErrors set.
|
boolean |
needsReload()
Check if this file needs to be reloaded.
|
int |
reload(boolean force)
Reload internal state from external sources.
|
boolean |
remove(String screenName)
Delete a screen.
|
void |
removeAllMacros()
Removes all macros.
|
boolean |
rename(String oldName,
String newName)
Renames a host screen, the reference of the PhantomHostScreen gets the name
changed and the hash table containing String names to PhantomHostScreen is updated.
|
void |
save(PhantomOutputFile file)
Save the host data to file.
|
void |
save(String fileName)
Save the host data to file.
|
public static final int MATCHFLAG_STOPWHENFOUND
public static final int MATCHFLAG_POPWIN
public int screenCount
public boolean areScreensAnalyzed
public int matchFlags
public boolean useBinaryMatchMethod
public PhantomHostData.ScreenGroup[] screenGroups
public Hashtable<String,PhantomHostScreen> fastSearch
public Vector<PhantomHostScreen> screens
public Hashtable<String,PhantomHostScreen> screensByName
public int macroCount
public Hashtable<String,PhantomMacro> macros
public static final String BROKEN_MACRO_SCREEN_NAME
public static final PhantomHostScreen dummyScreen
public PhantomRuntime runtime
public String fileComments
public PhantomHostData()
public PhantomHostData(PhantomFile file) throws IOException
IOExceptionpublic PhantomHostData(PhantomFile file, PhantomRuntime runtime) throws IOException
IOExceptionpublic void maybeThrowIOException(String msg) throws IOException
IOExceptionpublic PhantomHostScreen addBrokenMacroScreen()
public boolean add(PhantomHostScreen newScreen)
PhantomHostScreen - public boolean remove(String screenName)
String - screen namepublic boolean rename(String oldName, String newName)
public Hashtable<String,PhantomMacro> getMacros()
public PhantomHostScreen[] getScreens()
public PhantomHostScreen getScreen(String name)
public String getFileName()
public PhantomHostScreen getScreen(int index)
public PhantomMacro getMacro(String name)
public int[] getMatchingScreens(HostScreen screen)
A maximum of 256 screens is quite OK, if more, there is a big error in the application.
public PhantomHostScreen[] getAllMatchingScreens(HostScreen screen)
public PhantomHostScreen getMatchingScreen(HostScreen screen)
public void save(String fileName) throws IOException
fileName - IOExceptionpublic void save(PhantomOutputFile file) throws IOException
fileName - IOExceptionpublic boolean needsReload()
needsReload in interface IReloadablepublic int reload(boolean force)
throws IOException
reload in interface IReloadableforce - - force the reload.IOExceptionpublic void removeAllMacros()
Phantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2011. All rights reserved.