com.swath
Class Swath

java.lang.Object
  extended bycom.swath.Swath

public final class Swath
extends java.lang.Object

This is the main SWATH class. When you need information from the SWATH database, this is your starting point.

Since:
SWATH 1.3

Field Summary
static int ALERT_ERROR
          User error alert.
static int ALERT_INFORMATION
          User information alert.
static int ALERT_WARNING
          User warning alert.
static int ALL_PROMPTS
          All prompts.
static int ALLIED
          The trader/corp is allied with you.
static int CARGO_HOLDS
          The index and identifier used for Cargo holds.
static int CITADEL_PROMPT
          The planet citadel prompt.
static int COLONISTS
          The index and identifier used for Colonists.
static int COMMAND_PROMPT
          The command prompt.
static int COMPUTER_PROMPT
          The computer command prompt.
static int CORP_PROMPT
          The corporate command prompt.
static int CORPORATE
          The corporate owner type.
static int DEFENSIVE_FTRS
          The defensive fighter type.
static int ENEMY
          The trader/corp is an enemy of yours.
static int EQUIPMENT
          The index and identifier used for Equipment.
static int FIGHTERS
          The index and identifier used for Fighters.
static int FRIENDLY
          The sector is friendly to you.
static int FUEL_ORE
          The index and indentifier used for Fuel Ore.
static java.lang.String FUNC_ABORT_COMMAND
           
static java.lang.String FUNC_ABORT_SCRIPT
           
static java.lang.String FUNC_ABOUT_SWATH
           
static java.lang.String FUNC_ADJACENT_SECTORS
           
static java.lang.String FUNC_BUBBLE_FINDER
           
static java.lang.String FUNC_BUST_LIST
           
static java.lang.String FUNC_COM_WINDOW
           
static java.lang.String FUNC_COMPILE_JAVA_CODE
           
static java.lang.String FUNC_CONNECT
           
static java.lang.String FUNC_COPY
           
static java.lang.String FUNC_DEBUG_LEVEL_1
           
static java.lang.String FUNC_DEBUG_LEVEL_2
           
static java.lang.String FUNC_DISCONNECT
           
static java.lang.String FUNC_EXIT
           
static java.lang.String FUNC_EXPORT
           
static java.lang.String FUNC_FIGHTER_LIST
           
static java.lang.String FUNC_FIND
           
static java.lang.String FUNC_FIND_NEAREST
           
static java.lang.String FUNC_FIND_ROUTE
           
static java.lang.String FUNC_GAME_INFO
           
static java.lang.String FUNC_GAME_NOTES
           
static java.lang.String FUNC_GAME_OPTIONS
           
static java.lang.String FUNC_GAME_SETTINGS
           
static java.lang.String FUNC_GENERATE_CRASH_REPORT
           
static java.lang.String FUNC_HELP_TOPICS
           
static java.lang.String FUNC_HELPER_MODE
           
static java.lang.String FUNC_IMPORT
           
static java.lang.String FUNC_INFO_BAR
           
static java.lang.String FUNC_JAWS_MODE
           
static java.lang.String FUNC_LICENSE_STATUS
           
static java.lang.String FUNC_MACRO_LIST
           
static java.lang.String FUNC_MINE_LIST
           
static java.lang.String FUNC_NEW
           
static java.lang.String FUNC_NO_DEBUG
           
static java.lang.String FUNC_OPEN
           
static java.lang.String FUNC_PARSE_INCOMING_TEXT
           
static java.lang.String FUNC_PASTE
           
static java.lang.String FUNC_PLANET_LIST
           
static java.lang.String FUNC_PLAY_QUICK_MACRO
           
static java.lang.String FUNC_PORT_FINDER
           
static java.lang.String FUNC_PREFERENCES
           
static java.lang.String FUNC_PROXY_MODE
           
static java.lang.String FUNC_RECORD_QUICK_MACRO
           
static java.lang.String FUNC_RELOAD_ALL_SCRIPTS
           
static java.lang.String FUNC_RESET
           
static java.lang.String FUNC_RUNNING_SCRIPT_HELP
           
static java.lang.String FUNC_SAVE
           
static java.lang.String FUNC_SAVE_AS
           
static java.lang.String FUNC_SCRIPT_DEBUG_MODE
           
static java.lang.String FUNC_SECTOR_FINDER
           
static java.lang.String FUNC_SECTOR_INFO
           
static java.lang.String FUNC_SECTOR_NOTE
           
static java.lang.String FUNC_SHIP_LIST
           
static java.lang.String FUNC_STATUS_BAR
           
static java.lang.String FUNC_SUPPRESS_TEXT_OUTPUT
           
static java.lang.String FUNC_SWATH_FORUMS
           
static java.lang.String FUNC_SWATH_HOMEPAGE
           
static java.lang.String FUNC_SWATH_WINDOWS
           
static java.lang.String FUNC_TIME_INDEX_LOG_MODE
           
static java.lang.String FUNC_TRADERS_AND_CORPS
           
static java.lang.String FUNC_TRIGGER_LIST
           
static java.lang.String FUNC_VISUAL_MAP
           
static int HOSTILE
          The sector is hostile to you.
static int ID_ALIEN
          This is the trader id for 'Alien'.
static int ID_FEDERAL
          This is the trader id for 'Federation'.
static int ID_FERRENGI
          This is the trader id for 'Ferrengi'.
static int ID_NOBODY
          This is the trader id for 'Nobody'.
static int ID_UNKNOWN
          This is the trader id for 'Unknown'.
static int ID_YOU
          This is your trader id.
static MainInfo main
          Get main game and SWATH information here.
static int MERCHENARY_FTRS
          The merchenary fighter type.
static int N_A
          Indicates 'N/A'.
static int NEUTRAL
          The trader/corp/sector is neutral to you.
static int NO
          Indicates 'No'.
static int NO_CHANGE
          Indicates 'No change'.
static int NO_PROMPT
          No prompt.
static int OFF
          Indicates 'Off'.
static int OFFENSIVE_FTRS
          The offensive fighter type.
static int ON
          Indicates 'On'.
static int ORGANICS
          The index and identifier used for Organics.
static int PERSONAL
          The personal owner type.
static int PLANET_PROMPT
          The planet prompt.
static Sector sector
          Get the current sector information here.
static int SHIELDS
          The index and identifier used for Shields.
static Ship ship
          Get your current ship information here.
static int STARDOCK_PROMPT
          The StarDock prompt.
static int TOLL_FTRS
          The toll fighter type.
static int UNKNOWN
          Indicates 'Unknown'.
static int WITH_YOU
          The trader/corp is playing together with you.
static int YES
          Indicates 'Yes'.
static Trader you
          Get your own trader information here.
 
Method Summary
static void clearConsole()
          Clear the SWATH console window.
static void clearErrorMsg()
          Clears the current error message.
static void delUserVariable(java.lang.String name, boolean global)
          Deletes a user variable.
static java.lang.Object execCommand(CommandIfc cmd)
          Executes a command.
static boolean execSwathFunction(java.lang.String function)
          Executes a SWATH menu function.
static Corporation[] getAllCorporations()
          Gets an array with all corporations.
static PlanetClass[] getAllPlanetClasses()
          Gets an array with all planet classes.
static Planet[] getAllPlanets()
          Gets an array with all planets.
static ShipCategory[] getAllShipCategories()
          Gets an array with all ship categories.
static Ship[] getAllShips()
          Gets an array with all ships.
static Trader[] getAllTraders()
          Gets an array with all traders.
static Bubble[] getBubbles(int type)
          Gets all bubbles of a specific type.
static Corporation getCorporation(int corp)
          Gets a corporation.
static Planet getPlanet(int planet)
          Gets a planet.
static PlanetClass getPlanetClass(java.lang.String name)
          Gets a planet class.
static java.lang.String getScriptName()
          Gets the name of the running script.
static Sector getSector(int sector)
          Gets a sector.
static Sector[] getSectors(int[] sectorNumbers)
          Gets an array of sectors.
static Ship getShip(int ship)
          Gets a ship.
static ShipCategory getShipCategory(java.lang.String type)
          Gets a ship category.
static Trader getTrader(java.lang.String name)
          Gets a trader.
static UserVariable getUserVariable(java.lang.String name, boolean global)
          Gets a user variable.
static void postEvent(UserDefinedEvent event)
          This method posts an event in the SWATH event queue.
static void printTrace(java.lang.Exception e)
          Print an exception and the complete stack trace in the SWATH console window.
static void printTrace(java.lang.String text)
          Print trace text in the SWATH console window.
static void setErrorMsg(java.lang.String message)
          Sets the current error message.
static void setErrorMsg(java.lang.Throwable t)
          Sets the current error message.
static void setUserVariable(java.lang.String name, UserVariable var, boolean global)
          Sets a user variable.
static void userAlert(java.lang.String text, int type)
          Display a user alert window to the user and print the text in the SWATH console window.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_PROMPT

public static final int NO_PROMPT
No prompt.

See Also:
Constant Field Values

COMMAND_PROMPT

public static final int COMMAND_PROMPT
The command prompt.

See Also:
Constant Field Values

COMPUTER_PROMPT

public static final int COMPUTER_PROMPT
The computer command prompt.

See Also:
Constant Field Values

PLANET_PROMPT

public static final int PLANET_PROMPT
The planet prompt.

See Also:
Constant Field Values

CITADEL_PROMPT

public static final int CITADEL_PROMPT
The planet citadel prompt.

See Also:
Constant Field Values

CORP_PROMPT

public static final int CORP_PROMPT
The corporate command prompt.

See Also:
Constant Field Values

STARDOCK_PROMPT

public static final int STARDOCK_PROMPT
The StarDock prompt.

See Also:
Constant Field Values

ALL_PROMPTS

public static final int ALL_PROMPTS
All prompts.

See Also:
Constant Field Values

FUEL_ORE

public static final int FUEL_ORE
The index and indentifier used for Fuel Ore.

See Also:
Constant Field Values

ORGANICS

public static final int ORGANICS
The index and identifier used for Organics.

See Also:
Constant Field Values

EQUIPMENT

public static final int EQUIPMENT
The index and identifier used for Equipment.

See Also:
Constant Field Values

COLONISTS

public static final int COLONISTS
The index and identifier used for Colonists.

See Also:
Constant Field Values

FIGHTERS

public static final int FIGHTERS
The index and identifier used for Fighters.

See Also:
Constant Field Values

SHIELDS

public static final int SHIELDS
The index and identifier used for Shields.

See Also:
Constant Field Values

CARGO_HOLDS

public static final int CARGO_HOLDS
The index and identifier used for Cargo holds.

See Also:
Constant Field Values

PERSONAL

public static final int PERSONAL
The personal owner type.

See Also:
Constant Field Values

CORPORATE

public static final int CORPORATE
The corporate owner type.

See Also:
Constant Field Values

TOLL_FTRS

public static final int TOLL_FTRS
The toll fighter type.

See Also:
Constant Field Values

DEFENSIVE_FTRS

public static final int DEFENSIVE_FTRS
The defensive fighter type.

See Also:
Constant Field Values

OFFENSIVE_FTRS

public static final int OFFENSIVE_FTRS
The offensive fighter type.

See Also:
Constant Field Values

MERCHENARY_FTRS

public static final int MERCHENARY_FTRS
The merchenary fighter type.

See Also:
Constant Field Values

ID_YOU

public static final int ID_YOU
This is your trader id.

See Also:
Constant Field Values

ID_NOBODY

public static final int ID_NOBODY
This is the trader id for 'Nobody'.

See Also:
Constant Field Values

ID_UNKNOWN

public static final int ID_UNKNOWN
This is the trader id for 'Unknown'.

See Also:
Constant Field Values

ID_FEDERAL

public static final int ID_FEDERAL
This is the trader id for 'Federation'.

See Also:
Constant Field Values

ID_FERRENGI

public static final int ID_FERRENGI
This is the trader id for 'Ferrengi'.

See Also:
Constant Field Values

ID_ALIEN

public static final int ID_ALIEN
This is the trader id for 'Alien'.

See Also:
Constant Field Values

WITH_YOU

public static final int WITH_YOU
The trader/corp is playing together with you.

See Also:
Constant Field Values

ALLIED

public static final int ALLIED
The trader/corp is allied with you.

See Also:
Constant Field Values

NEUTRAL

public static final int NEUTRAL
The trader/corp/sector is neutral to you.

See Also:
Constant Field Values

ENEMY

public static final int ENEMY
The trader/corp is an enemy of yours.

See Also:
Constant Field Values

FRIENDLY

public static final int FRIENDLY
The sector is friendly to you.

See Also:
Constant Field Values

HOSTILE

public static final int HOSTILE
The sector is hostile to you.

See Also:
Constant Field Values

YES

public static final int YES
Indicates 'Yes'.

See Also:
Constant Field Values

NO

public static final int NO
Indicates 'No'.

See Also:
Constant Field Values

ON

public static final int ON
Indicates 'On'.

See Also:
Constant Field Values

OFF

public static final int OFF
Indicates 'Off'.

See Also:
Constant Field Values

N_A

public static final int N_A
Indicates 'N/A'.

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
Indicates 'Unknown'.

See Also:
Constant Field Values

NO_CHANGE

public static final int NO_CHANGE
Indicates 'No change'.

See Also:
Constant Field Values

ALERT_INFORMATION

public static final int ALERT_INFORMATION
User information alert.

See Also:
Constant Field Values

ALERT_WARNING

public static final int ALERT_WARNING
User warning alert.

See Also:
Constant Field Values

ALERT_ERROR

public static final int ALERT_ERROR
User error alert.

See Also:
Constant Field Values

FUNC_NEW

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

FUNC_OPEN

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

FUNC_SAVE

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

FUNC_SAVE_AS

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

FUNC_CONNECT

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

FUNC_DISCONNECT

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

FUNC_RESET

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

FUNC_IMPORT

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

FUNC_EXPORT

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

FUNC_EXIT

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

FUNC_COPY

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

FUNC_PASTE

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

FUNC_FIND

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

FUNC_PREFERENCES

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

FUNC_GAME_OPTIONS

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

FUNC_TRIGGER_LIST

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

FUNC_HELPER_MODE

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

FUNC_PROXY_MODE

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

FUNC_PARSE_INCOMING_TEXT

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

FUNC_SUPPRESS_TEXT_OUTPUT

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

FUNC_INFO_BAR

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

FUNC_STATUS_BAR

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

FUNC_COM_WINDOW

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

FUNC_VISUAL_MAP

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

FUNC_GAME_INFO

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

FUNC_GAME_SETTINGS

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

FUNC_TRADERS_AND_CORPS

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

FUNC_SHIP_LIST

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

FUNC_PLANET_LIST

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

FUNC_FIGHTER_LIST

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

FUNC_MINE_LIST

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

FUNC_BUST_LIST

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

FUNC_ABORT_SCRIPT

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

FUNC_RELOAD_ALL_SCRIPTS

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

FUNC_COMPILE_JAVA_CODE

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

FUNC_ABORT_COMMAND

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

FUNC_MACRO_LIST

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

FUNC_RECORD_QUICK_MACRO

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

FUNC_PLAY_QUICK_MACRO

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

FUNC_FIND_NEAREST

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

FUNC_FIND_ROUTE

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

FUNC_SECTOR_INFO

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

FUNC_ADJACENT_SECTORS

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

FUNC_SECTOR_FINDER

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

FUNC_PORT_FINDER

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

FUNC_BUBBLE_FINDER

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

FUNC_GAME_NOTES

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

FUNC_SECTOR_NOTE

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

FUNC_SCRIPT_DEBUG_MODE

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

FUNC_TIME_INDEX_LOG_MODE

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

FUNC_GENERATE_CRASH_REPORT

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

FUNC_NO_DEBUG

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

FUNC_DEBUG_LEVEL_1

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

FUNC_DEBUG_LEVEL_2

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

FUNC_HELP_TOPICS

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

FUNC_RUNNING_SCRIPT_HELP

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

FUNC_SWATH_HOMEPAGE

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

FUNC_SWATH_WINDOWS

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

FUNC_SWATH_FORUMS

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

FUNC_LICENSE_STATUS

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

FUNC_JAWS_MODE

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

FUNC_ABOUT_SWATH

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

main

public static MainInfo main
Get main game and SWATH information here.

Since:
SWATH 1.3

you

public static Trader you
Get your own trader information here.

Since:
SWATH 1.3

ship

public static Ship ship
Get your current ship information here.

Since:
SWATH 1.3

sector

public static Sector sector
Get the current sector information here.

Since:
SWATH 1.4
Method Detail

setErrorMsg

public static void setErrorMsg(java.lang.String message)
Sets the current error message.

Parameters:
message - An error message.
Since:
SWATH 1.3

setErrorMsg

public static void setErrorMsg(java.lang.Throwable t)
Sets the current error message.

Parameters:
t - A throwable/exception.
Since:
SWATH 1.7

clearErrorMsg

public static void clearErrorMsg()
Clears the current error message.

Since:
SWATH 1.7

printTrace

public static void printTrace(java.lang.String text)
Print trace text in the SWATH console window.

Parameters:
text - The text to print.
Since:
SWATH 1.7

printTrace

public static void printTrace(java.lang.Exception e)
Print an exception and the complete stack trace in the SWATH console window.

Parameters:
e - The exception to print.
Since:
SWATH 1.7

clearConsole

public static void clearConsole()
Clear the SWATH console window.

Since:
SWATH 1.8

userAlert

public static void userAlert(java.lang.String text,
                             int type)
Display a user alert window to the user and print the text in the SWATH console window.

Parameters:
text - The text to display in the alert.
type - The type of user alert to display.
Since:
SWATH 1.7
See Also:
ALERT_INFORMATION, ALERT_WARNING, ALERT_ERROR

execSwathFunction

public static boolean execSwathFunction(java.lang.String function)
                                 throws java.lang.Exception
Executes a SWATH menu function.

Parameters:
function - The function to execute (see constants).
Returns:
true if successful, otherwise false.
Throws:
java.lang.Exception
Since:
SWATH 1.7
See Also:
FUNC_NEW, FUNC_OPEN, FUNC_SAVE, FUNC_SAVE_AS, FUNC_CONNECT, FUNC_DISCONNECT, FUNC_RESET, FUNC_IMPORT, FUNC_EXPORT, FUNC_EXIT, FUNC_COPY, FUNC_PASTE, FUNC_FIND, FUNC_PREFERENCES, FUNC_GAME_OPTIONS, FUNC_TRIGGER_LIST, FUNC_HELPER_MODE, FUNC_PROXY_MODE, FUNC_PARSE_INCOMING_TEXT, FUNC_SUPPRESS_TEXT_OUTPUT, FUNC_INFO_BAR, FUNC_STATUS_BAR, FUNC_COM_WINDOW, FUNC_VISUAL_MAP, FUNC_GAME_INFO, FUNC_GAME_SETTINGS, FUNC_TRADERS_AND_CORPS, FUNC_SHIP_LIST, FUNC_PLANET_LIST, FUNC_FIGHTER_LIST, FUNC_MINE_LIST, FUNC_BUST_LIST, FUNC_ABORT_SCRIPT, FUNC_RELOAD_ALL_SCRIPTS, FUNC_COMPILE_JAVA_CODE, FUNC_ABORT_COMMAND, FUNC_MACRO_LIST, FUNC_RECORD_QUICK_MACRO, FUNC_PLAY_QUICK_MACRO, FUNC_FIND_NEAREST, FUNC_FIND_ROUTE, FUNC_SECTOR_INFO, FUNC_ADJACENT_SECTORS, FUNC_SECTOR_FINDER, FUNC_PORT_FINDER, FUNC_BUBBLE_FINDER, FUNC_GAME_NOTES, FUNC_SECTOR_NOTE, FUNC_SCRIPT_DEBUG_MODE, FUNC_TIME_INDEX_LOG_MODE, FUNC_GENERATE_CRASH_REPORT, FUNC_NO_DEBUG, FUNC_DEBUG_LEVEL_1, FUNC_DEBUG_LEVEL_2, FUNC_HELP_TOPICS, FUNC_RUNNING_SCRIPT_HELP, FUNC_SWATH_HOMEPAGE, FUNC_SWATH_WINDOWS, FUNC_SWATH_FORUMS, FUNC_LICENSE_STATUS, FUNC_JAWS_MODE, FUNC_ABOUT_SWATH

getUserVariable

public static UserVariable getUserVariable(java.lang.String name,
                                           boolean global)
                                    throws java.lang.Exception
Gets a user variable.

Parameters:
name - The name of the user variable.
global - true to get the global variable or false to first look for the local game variable.
Returns:
The wanted user variable or null if not found.
Throws:
java.lang.Exception
Since:
SWATH 1.7
See Also:
setUserVariable(java.lang.String, com.swath.UserVariable, boolean), delUserVariable(java.lang.String, boolean), UserVariable

setUserVariable

public static void setUserVariable(java.lang.String name,
                                   UserVariable var,
                                   boolean global)
                            throws java.lang.Exception
Sets a user variable.

Parameters:
name - The name of the user variable.
var - The user variable to set.
global - true to set the variable on a global level or false to set it locally for the current game.
Throws:
java.lang.Exception
Since:
SWATH 1.7
See Also:
getUserVariable(java.lang.String, boolean), delUserVariable(java.lang.String, boolean), UserVariable

delUserVariable

public static void delUserVariable(java.lang.String name,
                                   boolean global)
                            throws java.lang.Exception
Deletes a user variable.

Parameters:
name - The name of the user variable.
global - true to delete the variable on all levels or false to only delete the local game variable.
Throws:
java.lang.Exception
Since:
SWATH 1.7
See Also:
getUserVariable(java.lang.String, boolean), setUserVariable(java.lang.String, com.swath.UserVariable, boolean), UserVariable

getSector

public static Sector getSector(int sector)
                        throws java.lang.IllegalArgumentException,
                               java.lang.Exception
Gets a sector.

Parameters:
sector - The sector number.
Returns:
The wanted sector.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.4

getSectors

public static Sector[] getSectors(int[] sectorNumbers)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.Exception
Gets an array of sectors.

Parameters:
sectorNumbers - The sector number array.
Returns:
The wanted sector array.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6

getTrader

public static Trader getTrader(java.lang.String name)
                        throws java.lang.IllegalArgumentException,
                               java.lang.Exception
Gets a trader.

Parameters:
name - The trader name.
Returns:
The wanted trader.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.4

getAllTraders

public static Trader[] getAllTraders()
                              throws java.lang.IllegalArgumentException,
                                     java.lang.Exception
Gets an array with all traders.

Returns:
The array of traders.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6.2

getShip

public static Ship getShip(int ship)
                    throws java.lang.IllegalArgumentException,
                           java.lang.Exception
Gets a ship.

Parameters:
ship - The ship id.
Returns:
The wanted ship.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.4

getAllShips

public static Ship[] getAllShips()
                          throws java.lang.IllegalArgumentException,
                                 java.lang.Exception
Gets an array with all ships.

Returns:
The array of ships.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6.2

getShipCategory

public static ShipCategory getShipCategory(java.lang.String type)
                                    throws java.lang.IllegalArgumentException,
                                           java.lang.Exception
Gets a ship category.

Parameters:
type - The ship type.
Returns:
The wanted ship category.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6

getAllShipCategories

public static ShipCategory[] getAllShipCategories()
                                           throws java.lang.IllegalArgumentException,
                                                  java.lang.Exception
Gets an array with all ship categories.

Returns:
The array of ship categories.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6.2

getPlanet

public static Planet getPlanet(int planet)
                        throws java.lang.IllegalArgumentException,
                               java.lang.Exception
Gets a planet.

Parameters:
planet - The planet id.
Returns:
The wanted planet.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.4

getAllPlanets

public static Planet[] getAllPlanets()
                              throws java.lang.IllegalArgumentException,
                                     java.lang.Exception
Gets an array with all planets.

Returns:
The array of planets.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6.2

getPlanetClass

public static PlanetClass getPlanetClass(java.lang.String name)
                                  throws java.lang.IllegalArgumentException,
                                         java.lang.Exception
Gets a planet class.

Parameters:
name - The planet class name.
Returns:
The wanted planet class.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6

getAllPlanetClasses

public static PlanetClass[] getAllPlanetClasses()
                                         throws java.lang.IllegalArgumentException,
                                                java.lang.Exception
Gets an array with all planet classes.

Returns:
The array of planet classes.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6.2

getCorporation

public static Corporation getCorporation(int corp)
                                  throws java.lang.IllegalArgumentException,
                                         java.lang.Exception
Gets a corporation.

Parameters:
corp - The corporation id.
Returns:
The wanted corporation or null if not found.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.5

getAllCorporations

public static Corporation[] getAllCorporations()
                                        throws java.lang.IllegalArgumentException,
                                               java.lang.Exception
Gets an array with all corporations.

Returns:
The array of corporations.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.6.2

getBubbles

public static Bubble[] getBubbles(int type)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.Exception
Gets all bubbles of a specific type.

Parameters:
type - The type of bubbles to get.
Returns:
An array with the wanted bubbles.
Throws:
java.lang.IllegalArgumentException
java.lang.Exception
Since:
SWATH 1.5
See Also:
Bubble.TYPE_NORMAL, Bubble.TYPE_DEAD_END, Bubble.TYPE_BLACK_HOLE

postEvent

public static void postEvent(UserDefinedEvent event)
This method posts an event in the SWATH event queue. Everyone that listens for this event will be notified.

Parameters:
event - The event to post.
Since:
SWATH 1.7

getScriptName

public static java.lang.String getScriptName()
Gets the name of the running script.

Returns:
The script name.

execCommand

public static java.lang.Object execCommand(CommandIfc cmd)
                                    throws CommandException,
                                           java.lang.Exception
Executes a command.
Used by SWATH only!

Parameters:
cmd - The command.
Returns:
The command return value.
Throws:
CommandException - If the command fails.
java.lang.Exception
Since:
SWATH 1.3