plugins
Interface IHelper

All Known Implementing Classes:
HelperWrapper

public interface IHelper

Interface to several Helper funcs, that make life/programming much easier

Author:
thomas.werth

Method Summary
 void addTempSpieler(ISpieler spieler)
          Add a player to HO! temporary
 java.lang.String[] convertTimeMillisToFormatString(double[] timewerte)
          :)
 void copyArray2Vector(java.lang.Object[] src, java.util.Vector dest)
          Copy the values for a arry to an vector
 void copyVector2Array(java.util.Vector src, java.lang.Object[] dest)
          Copy the values for a vector to an array
 javax.swing.DefaultComboBoxModel createListModel(java.util.Vector vector)
          Puts the vectorelements in a ComboBoxModel
 ISpieler createSpielerFromText(java.lang.String text)
          Parse a text ( from HT-playerpage ) and create an ISpieler from it.
 java.lang.String decodeStringFromDatabase(java.lang.String text)
          Decode the string from the database Use this methode for all strings you receive directly from the database # are replaced by '
 java.lang.String deleteEscapeSequences(java.lang.String text)
          undo replacing, after reading from DB
 boolean downloadMatchData(int matchID)
          downloads all match related data and stores it in Database
 java.lang.String encodeString4Database(java.lang.String text)
          Encode the string to put it in the database Use this methode on all strings you want to store in the database via sql ' and " are replaced by #
 boolean existsMatchInDB(int matchID)
          checkes wheater matchdata is already stored in db or not
 int[] generateIntArray(java.lang.String text)
          Like generateStringArray, but returns an int[] and has a fix seperator ','
 java.lang.String[] generateStringArray(java.lang.String werte, char trenner)
          Generate a Stringarray by seperate the string werte by the seperator trenner
 java.awt.Color getColor4SpielHighlight(int typ, int subtyp)
          Returns a (Text)Color for a Highlight
 java.util.Date getHattrickDate(java.lang.String string)
          TODO Missing Method Documentation
 javax.swing.ImageIcon getImage4Position(int posid, byte taktik)
          Returns an Image represent the Position of a player
 javax.swing.ImageIcon getImageIcon4Country(int country)
          Returns the Flag-Image for a player ( ISpieler.getNationalitaet() )
 javax.swing.ImageIcon getImageIcon4Spezialitaet(int wert)
          Returns an Image represent the special ablility of a player
 javax.swing.ImageIcon getImageIcon4SpielHighlight(int typ, int subtyp)
          Returns an Image represent the Matchhighlight
 javax.swing.ImageIcon getImageIcon4Spieltyp(int spieltyp)
          Returns an Image für the Matchtyp
 javax.swing.ImageIcon getImageIcon4Veraenderung(int wert)
          Returns an ArrowImage, green up für pos values, red down für neg values and a - for 0 values
 javax.swing.ImageIcon getImageIcon4Wetter(int wert)
          Returns an Image for the weather
 javax.swing.ImageIcon getImageIcon4WetterEffekt(int wert)
          Returns an Image for the Effect of the weather for a player
 int getLanguageID()
          ID of the actual used Language
 java.lang.String getLanguageName()
          Name of the actual used Language.
 java.util.Calendar getLastTrainingDate(java.util.Date skillupDate, java.util.Date refTrainingDate)
          TODO Missing Method Documentation
 IMatchHelper getMatchHelper()
          Returns a match helper instance
 IMP3Player getMP3Player()
          Returns an IMP3Player.
 java.lang.String getNameForAggressivness(int value)
          fiery, temperamental, ...
 java.lang.String getNameForBewertung(int value, boolean showNumber, boolean isMatch)
          like the methode above, but if isMatch is set the values goes from 1 to 80 instead of 1 to 20 and the numbers shows sublevels.
 java.lang.String getNameForCharacter(int value)
          righteous, dishonest, ...
 java.lang.String getNameForConfidence(int value)
          wonderful, decent, ...
 java.lang.String getNameForGentleness(int value)
          popular, controversial, ...
 java.lang.String getNameForMatchTyp(int typ)
          leaguematch, ...
 java.lang.String getNameForPosition(byte value)
          Positionnames use Const from ISpielerPosition
 java.lang.String getNameForSkill(int value, boolean showNumber)
          inadequate, divine, ...
 java.lang.String getNameForSpeciality(int value)
          Quick, Powerful, ...
 java.lang.String getNameForTaktik(int typ)
          pressing, ..
 java.lang.String getNameForTeamorder(int typ)
          pic, normal, mots Use static from IMatchConst
 java.lang.String getNameForTeamspirit(int value)
          Like the cold War, delirious, ...
 java.lang.String getNameForTraining(int value)
          Name of Training
 java.util.Vector getPlugins()
          Deprecated.  
 int getPosition(int hoposcode)
          Utility Method that returns the field position from the HO Position Code (hoposcode) It is impossible to make difference between left and right so always the left position is returned
 java.lang.String getTooltiptext4SpielHighlight(int typ, int subtyp)
          Returns a short Text for a Highlight
 void importHRF()
          Download the actual HRF
 java.lang.String insertEscapeSequences(java.lang.String text)
          DB String Parser ' and other tokens are replaced to be db conform, before storing in DB
 boolean isDevVersion()
          Returns true if a development version
 boolean isUserMatch(java.lang.String matchID)
          checks if given matchID is a match from UserTeam
 java.awt.image.BufferedImage loadImage(java.lang.String datei)
          Load an image and cache it.
 java.awt.Image makeColorTransparent(java.awt.Image im, java.awt.Color color)
          Returns an Image with transparent pixels, where color-pixels are found in im
 java.awt.Image makeColorTransparent(java.awt.Image im, int minr, int ming, int minb, int maxr, int maxg, int maxb)
          Returns an Image with transparent pixels, where the pixels has colorvalues between the specified values
 void openUrlInUserBRowser(java.lang.String url)
          opens given url in default System Browser
 java.sql.Timestamp parseDate(java.lang.String date)
          Parse a String an return a Timestamp for it
 float round(double wert, int nachkommastellen)
          Round a value wert
 void showMessage(java.awt.Component parent, java.lang.String message, java.lang.String titel, int typ)
          Shows an MessageDialog JOptionPane only, if there is not still an other MessageDialog shown (can be a Deadlock!)
 int[][] sortintArray(int[][] toSort, int spaltenindex)
          Sort an multiintarray
 

Method Detail

getMatchHelper

IMatchHelper getMatchHelper()
Returns a match helper instance

Returns:
an instance of the match helper class

getColor4SpielHighlight

java.awt.Color getColor4SpielHighlight(int typ,
                                       int subtyp)
Returns a (Text)Color for a Highlight

Parameters:
typ - Use constant values from IMatchHighlight
subtyp - Use constant values from IMatchHighlight
Returns:
TODO Missing Return Method Documentation

getHattrickDate

java.util.Date getHattrickDate(java.lang.String string)
                               throws java.text.ParseException
TODO Missing Method Documentation

Parameters:
string - TODO Missing Method Parameter Documentation
Returns:
TODO Missing Return Method Documentation
Throws:
java.text.ParseException - TODO Missing Method Exception Documentation

getImage4Position

javax.swing.ImageIcon getImage4Position(int posid,
                                        byte taktik)
Returns an Image represent the Position of a player

Parameters:
posid - PositionID from Hattrick, 1-16 are valid values, all others will result in an empty Image
taktik - TakticID, is unused but for additional Players
Returns:
TODO Missing Return Method Documentation

getImageIcon4Country

javax.swing.ImageIcon getImageIcon4Country(int country)
Returns the Flag-Image for a player ( ISpieler.getNationalitaet() )

Parameters:
country - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getImageIcon4Spezialitaet

javax.swing.ImageIcon getImageIcon4Spezialitaet(int wert)
Returns an Image represent the special ablility of a player

Parameters:
wert - the hattrickvalue of the ability
Returns:
TODO Missing Return Method Documentation

getImageIcon4SpielHighlight

javax.swing.ImageIcon getImageIcon4SpielHighlight(int typ,
                                                  int subtyp)
Returns an Image represent the Matchhighlight

Parameters:
typ - Use constant values from IMatchHighlight
subtyp - Use constant values from IMatchHighlight
Returns:
TODO Missing Return Method Documentation

getImageIcon4Spieltyp

javax.swing.ImageIcon getImageIcon4Spieltyp(int spieltyp)
Returns an Image für the Matchtyp

Parameters:
spieltyp - hattrickvalue for that Matchtyp Use static from IMatchConst
Returns:
TODO Missing Return Method Documentation

getImageIcon4Veraenderung

javax.swing.ImageIcon getImageIcon4Veraenderung(int wert)
Returns an ArrowImage, green up für pos values, red down für neg values and a - for 0 values

Parameters:
wert - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getImageIcon4Wetter

javax.swing.ImageIcon getImageIcon4Wetter(int wert)
Returns an Image for the weather

Parameters:
wert - 0 for Rain to 3 for Sun
Returns:
TODO Missing Return Method Documentation

getImageIcon4WetterEffekt

javax.swing.ImageIcon getImageIcon4WetterEffekt(int wert)
Returns an Image for the Effect of the weather for a player

Parameters:
wert - <0 Bad Weathereffect, >0 good Weathereffect, =0 no Effect (return null)
Returns:
TODO Missing Return Method Documentation

getLanguageID

int getLanguageID()
ID of the actual used Language

Returns:
TODO Missing Return Method Documentation

getLanguageName

java.lang.String getLanguageName()
Name of the actual used Language. Use this methode to find your own languagefiles.

Returns:
TODO Missing Return Method Documentation

getLastTrainingDate

java.util.Calendar getLastTrainingDate(java.util.Date skillupDate,
                                       java.util.Date refTrainingDate)
TODO Missing Method Documentation

Parameters:
skillupDate - TODO Missing Method Parameter Documentation
refTrainingDate - TODO Missing Method Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForAggressivness

java.lang.String getNameForAggressivness(int value)
fiery, temperamental, ...

Parameters:
value - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForBewertung

java.lang.String getNameForBewertung(int value,
                                     boolean showNumber,
                                     boolean isMatch)
like the methode above, but if isMatch is set the values goes from 1 to 80 instead of 1 to 20 and the numbers shows sublevels. Use this to display the skills of a lineup (right defence, left attack, ...
isMatch = false : 1 = disastrous (1) isMatch = true : 1 = disastrous (very low) (1.125)

Parameters:
value - the value of the skill
showNumber - true, adds the value to the String in () : passable (6), Defaultvalue is IHOMiniModel.getUserSettings().zahlenFuerSkill
isMatch - use values from 1-80 for lineupskills instead of the 1-20 for playerskills
Returns:
TODO Missing Return Method Documentation

getNameForCharacter

java.lang.String getNameForCharacter(int value)
righteous, dishonest, ...

Parameters:
value - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForConfidence

java.lang.String getNameForConfidence(int value)
wonderful, decent, ...

Parameters:
value - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForGentleness

java.lang.String getNameForGentleness(int value)
popular, controversial, ...

Parameters:
value - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForMatchTyp

java.lang.String getNameForMatchTyp(int typ)
leaguematch, ...

Parameters:
typ - hattrickvalue for that Matchtyp Use static from IMatchConst
Returns:
TODO Missing Return Method Documentation

getNameForPosition

java.lang.String getNameForPosition(byte value)
Positionnames use Const from ISpielerPosition

Parameters:
value - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForSkill

java.lang.String getNameForSkill(int value,
                                 boolean showNumber)
inadequate, divine, ...

Parameters:
value - TODO Missing Constructuor Parameter Documentation
showNumber - true, adds the value to the String in () : passable (6)
Returns:
TODO Missing Return Method Documentation

getNameForSpeciality

java.lang.String getNameForSpeciality(int value)
Quick, Powerful, ...

Parameters:
value - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForTaktik

java.lang.String getNameForTaktik(int typ)
pressing, .. Use static from IMatchConst

Parameters:
typ - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForTeamorder

java.lang.String getNameForTeamorder(int typ)
pic, normal, mots Use static from IMatchConst

Parameters:
typ - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForTeamspirit

java.lang.String getNameForTeamspirit(int value)
Like the cold War, delirious, ...

Parameters:
value - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getNameForTraining

java.lang.String getNameForTraining(int value)
Name of Training

Parameters:
value - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

getPlugins

java.util.Vector getPlugins()
Deprecated. 

Get a list of all started Plugins ( vector with IPlugins ) This method should not be use by any plugin but the PluginUpdate-Plugin

Returns:
TODO Missing Return Method Documentation

getPosition

int getPosition(int hoposcode)
Utility Method that returns the field position from the HO Position Code (hoposcode) It is impossible to make difference between left and right so always the left position is returned

Parameters:
hoposcode -
Returns:
the field position

getTooltiptext4SpielHighlight

java.lang.String getTooltiptext4SpielHighlight(int typ,
                                               int subtyp)
Returns a short Text for a Highlight

Parameters:
typ - Use constant values from IMatchHighlight
subtyp - Use constant values from IMatchHighlight
Returns:
TODO Missing Return Method Documentation

isUserMatch

boolean isUserMatch(java.lang.String matchID)
checks if given matchID is a match from UserTeam

Parameters:
matchID - matchID Id of match to check
Returns:
true is usermatch else false

addTempSpieler

void addTempSpieler(ISpieler spieler)
Add a player to HO! temporary

Parameters:
spieler - TODO Missing Constructuor Parameter Documentation

convertTimeMillisToFormatString

java.lang.String[] convertTimeMillisToFormatString(double[] timewerte)
:)

Parameters:
timewerte - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

copyArray2Vector

void copyArray2Vector(java.lang.Object[] src,
                      java.util.Vector dest)
Copy the values for a arry to an vector

Parameters:
src - TODO Missing Constructuor Parameter Documentation
dest - TODO Missing Constructuor Parameter Documentation

copyVector2Array

void copyVector2Array(java.util.Vector src,
                      java.lang.Object[] dest)
Copy the values for a vector to an array

Parameters:
src - TODO Missing Constructuor Parameter Documentation
dest - TODO Missing Constructuor Parameter Documentation

createListModel

javax.swing.DefaultComboBoxModel createListModel(java.util.Vector vector)
Puts the vectorelements in a ComboBoxModel

Parameters:
vector - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

createSpielerFromText

ISpieler createSpielerFromText(java.lang.String text)
                               throws java.lang.Exception
Parse a text ( from HT-playerpage ) and create an ISpieler from it. If the text cannot be parsed it throws an exception

Parameters:
text - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation
Throws:
java.lang.Exception - TODO Missing Constructuor Exception Documentation

decodeStringFromDatabase

java.lang.String decodeStringFromDatabase(java.lang.String text)
Decode the string from the database Use this methode for all strings you receive directly from the database # are replaced by '

Parameters:
text - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

deleteEscapeSequences

java.lang.String deleteEscapeSequences(java.lang.String text)
undo replacing, after reading from DB

Parameters:
text - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

downloadMatchData

boolean downloadMatchData(int matchID)
downloads all match related data and stores it in Database

Parameters:
matchID - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

encodeString4Database

java.lang.String encodeString4Database(java.lang.String text)
Encode the string to put it in the database Use this methode on all strings you want to store in the database via sql ' and " are replaced by #

Parameters:
text - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

existsMatchInDB

boolean existsMatchInDB(int matchID)
checkes wheater matchdata is already stored in db or not

Parameters:
matchID - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

generateIntArray

int[] generateIntArray(java.lang.String text)
Like generateStringArray, but returns an int[] and has a fix seperator ','

Parameters:
text - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

generateStringArray

java.lang.String[] generateStringArray(java.lang.String werte,
                                       char trenner)
Generate a Stringarray by seperate the string werte by the seperator trenner

Parameters:
werte - TODO Missing Constructuor Parameter Documentation
trenner - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

importHRF

void importHRF()
Download the actual HRF


insertEscapeSequences

java.lang.String insertEscapeSequences(java.lang.String text)
DB String Parser ' and other tokens are replaced to be db conform, before storing in DB

Parameters:
text - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

loadImage

java.awt.image.BufferedImage loadImage(java.lang.String datei)
Load an image and cache it. The filepath datei should be like "hoplugin/myplugin/image/imagename.png" Make sure, that the image is can be loaded by java!

Parameters:
datei - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

makeColorTransparent

java.awt.Image makeColorTransparent(java.awt.Image im,
                                    java.awt.Color color)
Returns an Image with transparent pixels, where color-pixels are found in im

Parameters:
im - TODO Missing Constructuor Parameter Documentation
color - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

makeColorTransparent

java.awt.Image makeColorTransparent(java.awt.Image im,
                                    int minr,
                                    int ming,
                                    int minb,
                                    int maxr,
                                    int maxg,
                                    int maxb)
Returns an Image with transparent pixels, where the pixels has colorvalues between the specified values

Parameters:
im - TODO Missing Constructuor Parameter Documentation
minr - TODO Missing Constructuor Parameter Documentation
ming - TODO Missing Constructuor Parameter Documentation
minb - TODO Missing Constructuor Parameter Documentation
maxr - TODO Missing Constructuor Parameter Documentation
maxg - TODO Missing Constructuor Parameter Documentation
maxb - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

openUrlInUserBRowser

void openUrlInUserBRowser(java.lang.String url)
opens given url in default System Browser

Parameters:
url - TODO Missing Constructuor Parameter Documentation

parseDate

java.sql.Timestamp parseDate(java.lang.String date)
Parse a String an return a Timestamp for it

Parameters:
date - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

round

float round(double wert,
            int nachkommastellen)
Round a value wert

Parameters:
wert - TODO Missing Constructuor Parameter Documentation
nachkommastellen - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

showMessage

void showMessage(java.awt.Component parent,
                 java.lang.String message,
                 java.lang.String titel,
                 int typ)
Shows an MessageDialog JOptionPane only, if there is not still an other MessageDialog shown (can be a Deadlock!)

Parameters:
parent - TODO Missing Constructuor Parameter Documentation
message - TODO Missing Constructuor Parameter Documentation
titel - TODO Missing Constructuor Parameter Documentation
typ - TODO Missing Constructuor Parameter Documentation

getMP3Player

IMP3Player getMP3Player()
Returns an IMP3Player. Set the mp3-filename and path with setMP3File( String ) and start the playback with run(). You can end the playback with close()


sortintArray

int[][] sortintArray(int[][] toSort,
                     int spaltenindex)
Sort an multiintarray

Parameters:
toSort - TODO Missing Constructuor Parameter Documentation
spaltenindex - TODO Missing Constructuor Parameter Documentation
Returns:
TODO Missing Return Method Documentation

isDevVersion

boolean isDevVersion()
Returns true if a development version

Returns:
version type