|
SageTV Platform V7.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsage.api.Utility
public class Utility
Contains miscellaneous methods useful for a variety of purposes
| Method Summary | |
|---|---|
boolean |
AddElement(java.util.Collection Data,
java.lang.Object Value)
Add the element with the specified value to this data. |
boolean |
AddToGrouping(java.util.Map Grouping,
java.lang.Object Key,
java.lang.Object Value)
Adds the specified value into the grouping using the specified key. |
boolean |
Animate(java.lang.String WidgetName,
java.lang.String LayerName,
java.lang.String AnimationName,
long Duration)
Starts an animation for the specified Widget in the specified Layer. |
boolean |
AnimateDelayed(java.lang.String WidgetName,
java.lang.String LayerName,
java.lang.String AnimationName,
long Duration,
long StartDelay,
boolean Interruptable)
This is the same as the Animate API call; but it allows specifiying a delay that should occur before the animation actually starts. |
boolean |
AnimateTransition(java.lang.String SourceWidgetName,
java.lang.String TargetWidgetName,
java.lang.String LayerName,
java.lang.String AnimationName,
long Duration,
long StartDelay,
boolean Interruptable)
Performs an Animation between two different Widgets. |
boolean |
AnimateVariable(java.lang.String WidgetName,
java.lang.String LayerName,
java.lang.String VarName,
java.lang.Object VarValue,
java.lang.String AnimationName,
long Duration,
long StartDelay,
boolean Interruptable)
For more details on Animations see here: Animate()
In addition to what's specified in the Animate API call; this also offers restricting of an
Animation by a variable name and value. |
boolean |
AreCoreAnimationsEnabled()
Returns whether or not animation support is enabled (either layered or Effect based animations; depending upon the STV configuration) |
boolean |
AreCoreAnimationsSupported()
Returns whether or not animation support is possible in the current UI environment. |
java.lang.String |
CalculateMD5Sum(java.io.File FilePath)
Calculates the MD5 Sum of a given file |
void |
ClearMenuCache()
Clears the cache that links Widgets to the in memory-menu representations for this UI. |
java.lang.Object[] |
CreateArray(java.lang.Object Value)
Creates a java.lang.Object array and initializes each element to the passed in argument. |
java.io.File |
CreateFilePath(java.lang.String Directory,
java.lang.String File)
Creates a new file object for the specified directory and file name or relative path |
boolean |
CreateNewDirectory(java.io.File DirectoryPath)
Creates a new directory and any parent directories for the specified directory path. |
boolean |
CreateNewLocalDirectory(java.io.File DirectoryPath)
Creates a new local directory and any parent directories for the specified directory path. |
java.lang.Long[] |
CreateTimeSpan(long StartTime,
long EndTime)
Returns a length 2 Long object array which can be used for specifying a time span in a table. |
java.lang.String |
DateFormat(java.lang.String Format,
java.lang.Object Date)
Returns a formatted date string for the specified Date. |
boolean |
DeleteFilePath(java.io.File FilePath)
Deletes the file/directory at the corresponding file path (directories must be empty first) |
boolean |
DeleteLocalFilePath(java.io.File FilePath)
Deletes the file/directory at the corresponding local file path (directories must be empty first) |
boolean |
DidImageLoadFail(java.lang.Object Image)
Checks whether the passed in MetaImage (from an API call that returns MetaImage), MediaFile, File, URL or Album failed to load successfully. |
java.io.File[] |
DirectoryListing(java.io.File DirectoryPath)
Returns a list of the files in the specified directory |
java.io.File[] |
DirectoryListing(java.io.File DirectoryPath,
java.lang.String MediaMask)
Returns a list of the files in the specified directory. |
java.lang.String |
DurFormat(java.lang.String Format,
long Duration)
Returns a formatted duration String for a period of time in milliseconds. |
java.lang.Process |
ExecuteProcess(java.lang.String CommandString,
java.lang.Object Arguments,
java.io.File WorkingDirectory,
boolean ConsoleApp)
Executes a new process on the system |
java.lang.String |
ExecuteProcessReturnOutput(java.lang.String CommandString,
java.lang.Object Arguments,
java.io.File WorkingDirectory,
boolean ReturnStdout,
boolean ReturnStderr)
Executes a new process on the system and returns as a String the output of the process |
java.lang.Object |
FindComparativeElement(java.lang.Object Data,
java.lang.Comparable Criteria,
java.lang.String Method)
Searches a sorted list of data to find the index that the specified criteria exists at; or if it doesn't exist in the data it will use the index that would be the appropriate insertion point for the criteria in the data in order to maintain sort order. |
int |
FindElementIndex(java.lang.Object Data,
java.lang.Object Element)
Returns the index in the data that the specified element is found at. |
java.lang.String |
GetAbsoluteFilePath(java.io.File FilePath)
Returns the full path name from the specified file path.. |
long |
GetDiskFreeSpace(java.lang.String DrivePath)
Returns the amount of disk free space in bytes at the specified path |
long |
GetDiskTotalSpace(java.lang.String DrivePath)
Returns the amount of total disk space in bytes at the specified path |
java.lang.Object |
GetElement(java.lang.Object Data,
int Index)
Returns the element at the specified index in this data; works for arrays and java.util.List implementations (i.e. |
java.lang.String |
GetFileAsString(java.io.File FilePath)
Opens the file at the specified path and reads the entire contents of it and returns it as a String. |
java.lang.String |
GetFileExtensionFromPath(java.lang.String FilePath)
Returns the file name extension from the specified file path (not including the '.') |
java.lang.String |
GetFileNameFromPath(java.io.File FilePath)
Returns the file name from the specified file path; this just returns the filename without any path information. |
long |
GetFilePathSize(java.io.File FilePath)
Returns the size in bytes of the specified file path |
java.io.File[] |
GetFileSystemRoots()
Returns the root directories of the file systems (on Linux this'll just be / and on Windows it'll be the drive letters) |
java.lang.String |
GetFileSystemType(java.lang.String DrivePath)
Gets the name of the filesystem type at the specified path |
java.awt.image.BufferedImage |
GetImageAsBufferedImage(java.lang.Object Resource)
Returns a java.awt.image.BufferedImage object. |
long |
GetLocalFilePathSize(java.io.File FilePath)
Returns the size in bytes of the specified local file path |
java.io.File[] |
GetLocalFileSystemRoots()
Returns the root directories of the local file systems (on Linux this'll just be / and on Windows it'll be the drive letters) |
java.lang.String |
GetLocalIPAddress()
Returns the IP address of the machine |
long |
GetLocalPathLastModifiedTime(java.io.File FilePath)
Returns the last modified time of the specified local file path |
long |
GetPathLastModifiedTime(java.io.File FilePath)
Returns the last modified time of the specified file path |
java.io.File |
GetPathParentDirectory(java.io.File FilePath)
Returns the parent directory for the specified file path |
java.awt.image.BufferedImage |
GetScaledImageAsBufferedImage(java.lang.Object Resource,
int Width,
int Height)
Returns a java.awt.image.BufferedImage object. |
java.lang.Object |
GetSubgroup(java.util.Map Grouping,
java.lang.Object Key)
Gets the value for the specified key out of a map. |
long |
GetTimeSinceLastInput()
Returns the amount of time in milliseconds since the last user input occurred for this UI (used for doing things while the user is idle) |
boolean |
GetUIRefreshLock()
Acquires the lock for this user interface system to prevent other updates from occuring. |
int |
GetWindowsRegistryDWORDValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name)
Returns a DWORD value from the Windows registry for the specified root, key and name(Windows only) Acceptable values for the Root are: "HKCR", "HKEY_CLASSES_ROOT", "HKCC", "HKEY_CURRENT_CONFIG", "HKCU", "HKEY_CURRENT_USER", "HKU", "HKEY_USERS", "HKLM" or "HKEY_LOCAL_MACHINE" (HKLM is the default if nothing matches) |
java.lang.String[] |
GetWindowsRegistryNames(java.lang.String Root,
java.lang.String Key)
Returns a list of the Windows registry names which exist under the specified root & key (Windows only) Acceptable values for the Root are: "HKCR", "HKEY_CLASSES_ROOT", "HKCC", "HKEY_CURRENT_CONFIG", "HKCU", "HKEY_CURRENT_USER", "HKU", "HKEY_USERS", "HKLM" or "HKEY_LOCAL_MACHINE" (HKLM is the default if nothing matches) |
int |
GetWindowsRegistryStringValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name)
Returns a string value from the Windows registry for the specified root, key and name(Windows only) Acceptable values for the Root are: "HKCR", "HKEY_CLASSES_ROOT", "HKCC", "HKEY_CURRENT_CONFIG", "HKCU", "HKEY_CURRENT_USER", "HKU", "HKEY_USERS", "HKLM" or "HKEY_LOCAL_MACHINE" (HKLM is the default if nothing matches) |
java.lang.String |
GetWorkingDirectory()
Returns the current working directory for the application (if this is a client; it'll be the working directory of the server) |
java.lang.String |
GuessMajorFileType(java.lang.String Filename)
Guesses what media type the specified filename corresponds to. |
boolean |
HasLocalFilesystem()
Returns true if this client has a local file system that can be accessed. |
java.lang.Object |
If(boolean Condition,
java.lang.Object True,
java.lang.Object False)
Returns the second argument if the first argument is true, otherwise the third argument is returned. |
boolean |
IsDirectoryPath(java.lang.String FilePath)
Returns true if the specified path denotes a directory that exists |
boolean |
IsEmpty(java.lang.Object Data)
Returns true if the argument is null, zero, an empty string or a failed image load |
boolean |
IsFilePath(java.lang.String FilePath)
Returns true if the specified file path denotes a file that exists and is not a directory |
boolean |
IsFilePathHidden(java.lang.String FilePath)
Returns true if the specified file path is marked as a hidden file |
boolean |
IsImageLoaded(java.lang.Object Image)
Checks whether the passed in MetaImage (from an API call that returns MetaImage), MediaFile, File, URL or Album is loaded into system memory or into the VRAM cache of the corresponding UI making the call. |
boolean |
IsImportableFileType(java.lang.String Filename)
Returns true if the specified file path has a file extension which would be imported by SageTV into its library. |
boolean |
IsLocalDirectoryPath(java.lang.String FilePath)
Returns true if the specified local path denotes a directory that exists |
boolean |
IsLocalFilePath(java.lang.String FilePath)
Returns true if the specified local file path denotes a file that exists and is not a directory |
boolean |
IsLocalFilePathHidden(java.lang.String FilePath)
Returns true if the specified local file path is marked as a hidden file |
boolean |
IsLocalRestartNeeded()
Returns true if the local instance of SageTV needs to be restarted due to a plugin install/uninstall |
boolean |
IsServerRestartNeeded()
Returns true if the server instance of SageTV needs to be restarted due to a plugin install/uninstall |
void |
Keystroke(java.lang.String Character,
boolean System)
Executes the specified keystroke in either the SageTV event system or by emulation in the operating system |
sage.MetaImage |
LoadImage(java.lang.Object Resource)
Returns a MetaImage object that refers to a specified image resource. |
sage.MetaImage |
LoadImageFile(java.io.File FilePath)
Returns a MetaImage object that refers to the specified image file. |
java.io.File[] |
LocalDirectoryListing(java.io.File DirectoryPath)
Returns a list of the files in the specified directory on the local filesystem |
java.lang.String |
LocalizeString(java.lang.String EnglishText)
Returns a localized version of the specified string. |
java.lang.Number |
Max(java.lang.Number Value1,
java.lang.Number Value2)
Returns the maximum of the two arguments; the type of the returned argument will be the same as the highest precision argument |
java.lang.Number |
Min(java.lang.Number Value1,
java.lang.Number Value2)
Returns the minimum of the two arguments; the type of the returned argument will be the same as the highest precision argument |
java.lang.String |
NumberFormat(java.lang.String Format,
float Number)
Returns a formatted numeric string for the specified number. |
void |
PlaySound(java.lang.String SoundFile)
Plays the specified sound file (used for sound effects, don't use for music playback) |
java.lang.String |
PrintCurrentTime()
Returns a string that represents the current time. |
java.lang.String |
PrintDate(long Date)
Returns a formatted date string using the java.text.DateFormat.MEDIUM formatting technique |
java.lang.String |
PrintDateFull(long Date)
Returns a formatted date string using the java.text.DateFormat.FULL formatting technique |
java.lang.String |
PrintDateLong(long Date)
Returns a formatted date string using SageTV's default detailed date formatting |
java.lang.String |
PrintDateShort(long Date)
Returns a formatted date string using the java.text.DateFormat.SHORT formatting technique |
java.lang.String |
PrintDuration(long Duration)
Returns a formatted duration string according to SageTV's verbose duration formating, minutes is the most detailed resolution of this format |
java.lang.String |
PrintDurationShort(long Duration)
Returns a formatted duration string according to SageTV's concise duration formating, minutes is the most detailed resolution of this format |
java.lang.String |
PrintDurationWithSeconds(long Duration)
Returns a formatted duration string according to SageTV's default duration formating, seconds is the most detailed resolution of this format |
java.lang.String |
PrintTime(long Time)
Returns a formatted time string using the java.text.DateFormat.MEDIUM formatting technique |
java.lang.String |
PrintTimeFull(long Time)
Returns a formatted time string using the java.text.DateFormat.FULL formatting technique |
java.lang.String |
PrintTimeLong(long Time)
Returns a formatted time string using the java.text.DateFormat.LONG formatting technique |
java.lang.String |
PrintTimeShort(long Time)
Returns a formatted time string using the java.text.DateFormat.SHORT formatting technique |
java.lang.String |
QueryServerMacAddress(java.lang.String Hostname)
Gets the MAC address of the SageTV server at the specified hostname. |
boolean |
ReleaseUIRefreshLock()
Releases the lock for this user interface system to allow other updates to occur. |
java.lang.Object |
RemoveElement(java.lang.Object Data,
java.lang.Object Value)
Removes the element at with the specified value from this data. |
java.lang.Object |
RemoveElementAtIndex(java.util.List Data,
int Index)
Removes the element at the specified index in this data; works java.util.List implementations (i.e. |
boolean |
RemoveWindowsRegistryValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name)
Removes a value from the Windows registry for the specified root, key and name(Windows only) Acceptable values for the Root are: "HKCR", "HKEY_CLASSES_ROOT", "HKCC", "HKEY_CURRENT_CONFIG", "HKCU", "HKEY_CURRENT_USER", "HKU", "HKEY_USERS", "HKLM" or "HKEY_LOCAL_MACHINE" (HKLM is the default if nothing matches) |
boolean |
RenameFilePath(java.io.File OriginalFilePath,
java.io.File NewFilePath)
Renames a file/directory |
boolean |
Restart()
Restarts the local instance of SageTV. |
java.lang.Object |
Round(java.lang.Object Number)
Rounds a floating point number to an integral value. |
java.awt.image.BufferedImage |
ScaleBufferedImage(java.awt.image.BufferedImage JavaBufferedImage,
int Width,
int Height,
boolean Alpha)
Scales a java.awt.image.BufferedImage object using optimized techniques |
boolean |
SendNetworkCommand(java.lang.String Hostname,
int Port,
java.lang.Object Command)
Opens a TCP/IP socket connection to the specified hostname on the specified port and then sends the specified command. |
boolean |
ServerRestart()
Restarts the server instance of SageTV. |
void |
SetCoreAnimationsEnabled(boolean Enabled)
Sets whether or not animation support is enabled (either layered or Effect based animations; depending upon the STV configuration) |
java.lang.Object |
SetElement(java.lang.Object Data,
int Index,
java.lang.Object Value)
Sets the element at the specified index in this data; works for arrays and java.util.List implementations (i.e. |
void |
SetScrollPosition(float RelativeX,
float RelativeY)
Scrolls the closest pageable UI parent component (or sibling of a parent) to the specified position. |
boolean |
SetWindowsRegistryDWORDValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name,
int Value)
Sets a DWORD value in the Windows registry for the specified root, key and name(Windows only) The name will be created if it doesn't already exist. |
boolean |
SetWindowsRegistryStringValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name,
java.lang.String Value)
Sets a string value in the Windows registry for the specified root, key and name(Windows only) The name will be created if it doesn't already exist. |
int |
Size(java.lang.Object Data)
Returns the size of the specified data. |
boolean |
StringEndsWith(java.lang.String FullString,
java.lang.String MatchString)
Returns true if the first string ends with the second, uses java.lang.String.endsWith |
int |
StringIndexOf(java.lang.String FullString,
java.lang.String MatchString)
Returns the index of the second string within the first string, -1 if it is not found. |
int |
StringLastIndexOf(java.lang.String FullString,
java.lang.String MatchString)
Returns the last index of the second string within the first string, -1 if it is not found. |
boolean |
StringStartsWith(java.lang.String FullString,
java.lang.String MatchString)
Returns true if the first string starts with the second, uses java.lang.String.startsWith |
java.lang.String |
Substring(java.lang.String String,
int StartIndex,
int EndIndex)
Returns the substring from a specified string. |
java.lang.String |
SubstringBegin(java.lang.String String,
int EndOffset)
Returns the substring from a specified string. |
int |
TestPlaceshifterConnectivity(java.lang.String LocatorID)
Connects to the SageTV Locator server and submits the specified Locator ID for a 'ping'. |
long |
Time()
Returns the current time; see java.lang.System.currentTimeMillis() for the explanation of the units. |
void |
UnloadImage(java.lang.String ResPath)
Unloads the specified image resource from memory. |
void |
Wait(long Time)
Causes the currently executing thread to sleep for the specified amount of time in milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public java.lang.Object GetSubgroup(java.util.Map Grouping,
java.lang.Object Key)
GroupByMethod () call.
Grouping - the map to get the value fromKey - the key to use for retrieving the value
public void Keystroke(java.lang.String Character,
boolean System)
Character - the keystroke to perform, can contain Ctrl, Shift, Alt and combinations thereof with the specified key nameSystem - if true then an operating system keystroke should be emulated, if false then keep the keystroke within SageTVpublic int Size(java.lang.Object Data)
Data - the object to get the data size of
public boolean IsEmpty(java.lang.Object Data)
Data - the object to test
public java.lang.String DateFormat(java.lang.String Format,
java.lang.Object Date)
Format - null if SageTV's default date format should be used, otherwise use a formatting string as specified in java.text.SimpleDateFormatDate - either a java.util.Date object or a long which corresponds to the date
public java.lang.String NumberFormat(java.lang.String Format,
float Number)
Format - a formatting string as specified in java.text.DecimalFormatNumber - the floating point number to format
public java.lang.String DurFormat(java.lang.String Format,
long Duration)
For example, the format string %rh:%m for 20 minutes would return 0:20 and for the string $h:%m it would return 20 If there's characters before a field value then that value will be zero padded, i.e. 65 minutes for %h:%m would be 1:05
Format - the duration format string, or null to use SageTV's default duration formattingDuration - the duration to print out in milliseconds
public java.lang.Long[] CreateTimeSpan(long StartTime,
long EndTime)
StartTime - the long value which specifies the start value of the time spanEndTime - the long value which specifies the end value of the time span
public java.lang.Object GetElement(java.lang.Object Data,
int Index)
Data - the java.util.List or array object to get the element fromIndex - the 0-based index of the element to retrieve
public java.lang.Object SetElement(java.lang.Object Data,
int Index,
java.lang.Object Value)
Data - the java.util.List or array object to set the element forIndex - the 0-based index of the element to setValue - the value to set
public java.lang.Object RemoveElementAtIndex(java.util.List Data,
int Index)
Data - the java.util.List object to remove the element fromIndex - the 0-based index of the element to remove
public java.lang.Object RemoveElement(java.lang.Object Data,
java.lang.Object Value)
Data - the java.util.Collection or java.util.Map object to remove the element from; for maps it removes based on keyValue - the value to remove from the data
public boolean AddElement(java.util.Collection Data,
java.lang.Object Value)
Data - the java.util.Collection object to add the element toValue - the value to add to the data
public int FindElementIndex(java.lang.Object Data,
java.lang.Object Element)
Data - the java.util.List or array to look inElement - the value to search the data for
public java.lang.Object FindComparativeElement(java.lang.Object Data,
java.lang.Comparable Criteria,
java.lang.String Method)
Data - the data to sort, this must be a java.util.Collection, a java.util.Map, or an arrayCriteria - the object to compare the elements to; this must implement java.lang.ComparableMethod - the method name to execute on each element to get the value to compare; use null to compare the elements themselves
public java.lang.String Substring(java.lang.String String,
int StartIndex,
int EndIndex)
String - the string to get the substring ofStartIndex - the 0-based index that the substring starts atEndIndex - the 0-based index that the substring ends at or -1 if the substring goes to the end of the string
public java.lang.String SubstringBegin(java.lang.String String,
int EndOffset)
String - the string to get the substring ofEndOffset - the number of characters from the end of the string to terminate the substring (0 implies return the entire string)
public java.lang.Object Round(java.lang.Object Number)
Number - the number to round
public long Time()
public java.lang.String PrintCurrentTime()
public java.lang.String PrintDate(long Date)
Date - the date value to format
public java.lang.String PrintDateLong(long Date)
Date - the date value to format
public java.lang.String PrintDateShort(long Date)
Date - the date value to format
public java.lang.String PrintDateFull(long Date)
Date - the date value to format
public java.lang.String PrintTime(long Time)
Time - the time value to format
public java.lang.String PrintTimeLong(long Time)
Time - the time value to format
public java.lang.String PrintTimeShort(long Time)
Time - the time value to format
public java.lang.String PrintTimeFull(long Time)
Time - the time value to format
public java.lang.String PrintDuration(long Duration)
Duration - the duration in milliseconds to print
public java.lang.String PrintDurationWithSeconds(long Duration)
Duration - the duration in milliseconds to print
public java.lang.String PrintDurationShort(long Duration)
Duration - the duration in milliseconds to print
public long GetDiskFreeSpace(java.lang.String DrivePath)
DrivePath - the path string of a disk to get the free space of
public long GetDiskTotalSpace(java.lang.String DrivePath)
DrivePath - the path string of a disk to get the total space of
public java.lang.String GetFileSystemType(java.lang.String DrivePath)
DrivePath - the path string of a disk to get the filesystem type for
public java.lang.String[] GetWindowsRegistryNames(java.lang.String Root,
java.lang.String Key)
Root - the registry hive to look inKey - the key path in the registry hive
public int GetWindowsRegistryDWORDValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name)
Root - the registry hive to look inKey - the key path in the registry hiveName - the name of the registry value to retrieve
public int GetWindowsRegistryStringValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name)
Root - the registry hive to look inKey - the key path in the registry hiveName - the name of the registry value to retrieve
public boolean RemoveWindowsRegistryValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name)
Root - the registry hive to look inKey - the key path in the registry hiveName - the name of the registry value to remove
public boolean SetWindowsRegistryDWORDValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name,
int Value)
Root - the registry hive to useKey - the key path in the registry hiveName - the name of the registry value to setValue - the value of the specified registry setting as a DWORD
public boolean SetWindowsRegistryStringValue(java.lang.String Root,
java.lang.String Key,
java.lang.String Name,
java.lang.String Value)
Root - the registry hive to useKey - the key path in the registry hiveName - the name of the registry value to setValue - the value of the specified registry setting as a string
public void PlaySound(java.lang.String SoundFile)
SoundFile - the path of the sound resource to play back
public java.lang.Object If(boolean Condition,
java.lang.Object True,
java.lang.Object False)
Condition - the value to test to see if it is trueTrue - the value to return if the Condition is trueFalse - the value to return if the Condition is not true
public java.lang.String GetFileNameFromPath(java.io.File FilePath)
FilePath - the filepath to get the filename for
public java.lang.String GetAbsoluteFilePath(java.io.File FilePath)
FilePath - the filepath to get the full path from
public java.lang.String GetFileExtensionFromPath(java.lang.String FilePath)
FilePath - the file path to get the extension of
public void Wait(long Time)
Time - the amount of time to sleep this thread for in milliseconds
public java.lang.Number Max(java.lang.Number Value1,
java.lang.Number Value2)
Value1 - one of the valuesValue2 - the other value
public java.lang.Number Min(java.lang.Number Value1,
java.lang.Number Value2)
Value1 - one of the valuesValue2 - the other value
public java.lang.Process ExecuteProcess(java.lang.String CommandString,
java.lang.Object Arguments,
java.io.File WorkingDirectory,
boolean ConsoleApp)
CommandString - the command to execute (i.e. C:\windows\notepad.exe or ifconfig)Arguments - the arguments to pass to the command that is executed, if it's a java.util.Collection or array then each element is an argument, otherwise it is considered a single argument; use null for no argumentsWorkingDirectory - the directory to execute the process from or null to execute it from the current working directoryConsoleApp - if true then SageTV will consume the stdout and stderr output from the process that is launched; if false it will not
public java.lang.String ExecuteProcessReturnOutput(java.lang.String CommandString,
java.lang.Object Arguments,
java.io.File WorkingDirectory,
boolean ReturnStdout,
boolean ReturnStderr)
CommandString - the command to execute (i.e. C:\windows\notepad.exe or ifconfig)Arguments - the arguments to pass to the command that is executed, if it's a java.util.Collection or array then each element is an argument, otherwise it is considered a single argument; use null for no argumentsWorkingDirectory - the directory to execute the process from or null to execute it from the current working directoryReturnStdout - if true then SageTV will return the data from stdout as part of the return valueReturnStderr - if true then SageTV will return the data from stderr as part of the return value
public sage.MetaImage LoadImageFile(java.io.File FilePath)
FilePath - the file path of the image to load
public sage.MetaImage LoadImage(java.lang.Object Resource)
It also has a secondary purpose where you can pass it a MetaImage and then it will load that image into the current image cache so it will render as fast as possible in the next drawing cycle. Good for preloading the next image in a slideshow. If a MetaImage is passed in; this call will not return until that image is loaded into the cache.
Resource - if this is a MetaImage then the image is loaded into the cache, otherwise its converted to a string and then a MetaImage is returned for that resource
public java.awt.image.BufferedImage GetImageAsBufferedImage(java.lang.Object Resource)
Resource - if this is a MetaImage then the buffered image is taken from that, otherwise its converted to a string and then the image is loaded from that path
public java.awt.image.BufferedImage GetScaledImageAsBufferedImage(java.lang.Object Resource,
int Width,
int Height)
Resource - if this is a MetaImage then the buffered image is taken from that, otherwise its converted to a string and then the image is loaded from that pathWidth - the desired width of the returned imageHeight - the desired height of the returned image
public void UnloadImage(java.lang.String ResPath)
ResPath - the path to the image resource, can be a url, JAR resource path or a file pathpublic boolean IsImageLoaded(java.lang.Object Image)
Image - the MetaImage to check, or a MediaFile or an Album or a java.io.File or a java.net.URL
public boolean DidImageLoadFail(java.lang.Object Image)
Image - the MetaImage to check, or a MediaFile or an Album or a java.io.File or a java.net.URL
public java.io.File[] DirectoryListing(java.io.File DirectoryPath)
DirectoryPath - the directory to list the files in
public java.io.File[] DirectoryListing(java.io.File DirectoryPath,
java.lang.String MediaMask)
DirectoryPath - the directory to list the files inMediaMask - the types of content allowed, any combination of 'M'=Music, 'P'=Pictures or 'V'=Videos
public java.io.File[] LocalDirectoryListing(java.io.File DirectoryPath)
DirectoryPath - the directory to list the files in
public java.io.File[] GetFileSystemRoots()
public java.io.File[] GetLocalFileSystemRoots()
public boolean StringEndsWith(java.lang.String FullString,
java.lang.String MatchString)
FullString - the string to search inMatchString - the string to search for
public boolean StringStartsWith(java.lang.String FullString,
java.lang.String MatchString)
FullString - the string to search inMatchString - the string to search for
public int StringIndexOf(java.lang.String FullString,
java.lang.String MatchString)
FullString - the string to search inMatchString - the string to search for
public int StringLastIndexOf(java.lang.String FullString,
java.lang.String MatchString)
FullString - the string to search inMatchString - the string to search for
public java.lang.String GetWorkingDirectory()
public boolean HasLocalFilesystem()
public java.io.File CreateFilePath(java.lang.String Directory,
java.lang.String File)
Directory - the directory nameFile - the file within the directory or relative file path
public boolean IsFilePathHidden(java.lang.String FilePath)
FilePath - the file path to test
public boolean IsLocalFilePathHidden(java.lang.String FilePath)
FilePath - the file path to test
public boolean IsFilePath(java.lang.String FilePath)
FilePath - the file path to test
public boolean IsLocalFilePath(java.lang.String FilePath)
FilePath - the file path to test
public boolean IsDirectoryPath(java.lang.String FilePath)
FilePath - the file path to test
public boolean IsLocalDirectoryPath(java.lang.String FilePath)
FilePath - the file path to test
public boolean CreateNewDirectory(java.io.File DirectoryPath)
DirectoryPath - the directory to create
public boolean CreateNewLocalDirectory(java.io.File DirectoryPath)
DirectoryPath - the directory to create
public java.io.File GetPathParentDirectory(java.io.File FilePath)
FilePath - the file path to get the parent directory for
public long GetPathLastModifiedTime(java.io.File FilePath)
FilePath - the file path
public long GetLocalPathLastModifiedTime(java.io.File FilePath)
FilePath - the file path
public long GetFilePathSize(java.io.File FilePath)
FilePath - the file path
public long GetLocalFilePathSize(java.io.File FilePath)
FilePath - the file path
public boolean DeleteFilePath(java.io.File FilePath)
FilePath - the file path
public boolean DeleteLocalFilePath(java.io.File FilePath)
FilePath - the file path
public boolean RenameFilePath(java.io.File OriginalFilePath,
java.io.File NewFilePath)
OriginalFilePath - the file path to renameNewFilePath - the new name for the file path
public boolean AddToGrouping(java.util.Map Grouping,
java.lang.Object Key,
java.lang.Object Value)
GroupByMethod()
This works using a Map implementation that has Collections as the values and objects as the keys. So if two objects have the same key
they will both still exist in the map by being in the Collection that corresponds to their key.
Grouping - the grouping (Map) to add the new key/value pair toKey - the key to use to store the value in the mapValue - the value to store
public boolean SendNetworkCommand(java.lang.String Hostname,
int Port,
java.lang.Object Command)
Hostname - the hostname to connect toPort - the port to connect onCommand - either a byte[] or a String to send across the socket
public java.awt.image.BufferedImage ScaleBufferedImage(java.awt.image.BufferedImage JavaBufferedImage,
int Width,
int Height,
boolean Alpha)
JavaBufferedImage - the BufferedImage object that is the source for the scalingWidth - the width of the target imageHeight - the height of the target imageAlpha - true if the scaling should be done in ARGB, false if it should be done in RGB
public java.lang.String LocalizeString(java.lang.String EnglishText)
EnglishText - the English string to translate from
public java.lang.String GetLocalIPAddress()
public boolean IsImportableFileType(java.lang.String Filename)
Filename - the file path to test
public java.lang.String GuessMajorFileType(java.lang.String Filename)
Filename - the file path to test
public int TestPlaceshifterConnectivity(java.lang.String LocatorID)
LocatorID - the GUID that should be used for the 'ping'
public java.lang.Object[] CreateArray(java.lang.Object Value)
Value - a value for an element of the array (multiple arguments allowed)
public void SetScrollPosition(float RelativeX,
float RelativeY)
RelativeX - the X position to scroll to between 0.0 and 1.0 (use a negative number to not change the X position)RelativeY - the Y position to scroll to between 0.0 and 1.0 (use a negative number to not change the Y position)public void ClearMenuCache()
public boolean Animate(java.lang.String WidgetName,
java.lang.String LayerName,
java.lang.String AnimationName,
long Duration)
Valid strings for the AnimationName are:
Timeline modifications for animations affect how the timescale progresses. For out animations, they are eased out if non-linear. For in animations, they are eased in if non-linear. For animations that are neither; the timescale modification occurs at both ends. Bounce only works properly for 'in' animations.
Valid suffixes for any of the animations are (default is Quadratic):
Additional options for the animation may also be specified by combining additional suffixes to the
AnimationName. The following is a list of valid option suffixes.
You may combine the directional suffixes to get an additional four directions (i.e. ZoomOutNorthEast). And this
can also be combined with the timeline suffixes as well, or even Fade (i.e. ZoomInQuadraticSouthWestFade)
For delaying the start of an animation; see here AnimateDelayed()
WidgetName - the name of the Widget that should be animatedLayerName - the name of the Layer the animated Widget must be inAnimationName - the name of the animation to performDuration - the time in milliseconds that it should take for the animation to complete
public boolean AnimateVariable(java.lang.String WidgetName,
java.lang.String LayerName,
java.lang.String VarName,
java.lang.Object VarValue,
java.lang.String AnimationName,
long Duration,
long StartDelay,
boolean Interruptable)
Animate()
In addition to what's specified in the Animate API call; this also offers restricting of an
Animation by a variable name and value. Usage of the '*' suffix on the WidgetName is allowed.
WidgetName - the name of the Widget that should be animatedLayerName - the name of the Layer the animated Widget must be inVarName - the name of the variable that must match for the Widget to be animatedVarValue - the value of the variable to matchAnimationName - the name of the animation to performDuration - the time in milliseconds that it should take for the animation to completeStartDelay - the delay in milliseconds before this animation should startInterruptable - true if the animation can be interrupted to render the next UI update; false if it must complete (this parameter is optional and defaults to false)
public boolean AnimateTransition(java.lang.String SourceWidgetName,
java.lang.String TargetWidgetName,
java.lang.String LayerName,
java.lang.String AnimationName,
long Duration,
long StartDelay,
boolean Interruptable)
Animate()
SourceWidgetName - the name of the Widget to use as the source for this animationTargetWidgetName - the name of the Widget to use as the target (destination) for this animationLayerName - the name of the Layer the animated Widget must be inAnimationName - the name of the animation to performDuration - the time in milliseconds that it should take for the animation to completeStartDelay - the delay in milliseconds before this animation should startInterruptable - true if the animation can be interrupted to render the next UI update; false if it must complete (this parameter is optional and defaults to false)
public boolean AnimateDelayed(java.lang.String WidgetName,
java.lang.String LayerName,
java.lang.String AnimationName,
long Duration,
long StartDelay,
boolean Interruptable)
Animate()
WidgetName - the name of the Widget that should be animatedLayerName - the name of the Layer the animated Widget must be inAnimationName - the name of the animation to performDuration - the time in milliseconds that it should take for the animation to completeStartDelay - the delay in milliseconds before this animation should startInterruptable - true if the animation can be interrupted to render the next UI update; false if it must complete (this parameter is optional and defaults to false)
public void SetCoreAnimationsEnabled(boolean Enabled)
Enabled - true to enable core animations; false otherwisepublic boolean AreCoreAnimationsEnabled()
public boolean AreCoreAnimationsSupported()
public boolean GetUIRefreshLock()
public boolean ReleaseUIRefreshLock()
public java.lang.String CalculateMD5Sum(java.io.File FilePath)
FilePath - the path to the file who's MD sum should be calculated
public long GetTimeSinceLastInput()
public java.lang.String GetFileAsString(java.io.File FilePath)
FilePath - the file path
public boolean IsLocalRestartNeeded()
public boolean IsServerRestartNeeded()
public boolean Restart()
public boolean ServerRestart()
public java.lang.String QueryServerMacAddress(java.lang.String Hostname)
Hostname - the hostname/IP of the SageTV server
|
SageTV Platform V7.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||