public class Tool4Dialog
extends java.lang.Object
Tool4Dialog
class provides common functions.Constructor and Description |
---|
Tool4Dialog(MainDialog call)
The constructor
Tool4Dialog creates a new instance(object) of the class. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
changeCharacterCodeToHTML(java.lang.String chr)
The method
changeCharacterCodeToHTML changes the unicode char to a html char. |
java.lang.String |
changeCharacterCodeToString(java.lang.String chr)
The method
changeCharacterCodeToString changes the unicode char to a string. |
java.lang.String |
changeCharacterCodeToXML(java.lang.String chr)
The method
changeCharacterCodeToXML changes the unicode char to a xml unicode. |
java.util.Hashtable |
createColumnWidthTable(int[] column_width)
The method
createColumnWidthTable creates a hash table with
the column width. |
java.util.Hashtable |
createColumnWidthTable(java.lang.String column_width)
The method
createColumnWidthTable creates a hash table with
the column width. |
java.applet.AudioClip |
getClip(java.lang.String clipname)
The method
getImage gets an image from the picture folder. |
static java.lang.String |
getCopyright(java.lang.String year)
The method
getCopyright creates the copyright string. |
java.lang.String |
getDayName(int number)
The method
getDayhName gets the name from a day. |
static java.lang.String |
getEngineerCity()
The method
getEngineerCity gets the city of the software engineer. |
static java.lang.String |
getEngineerName()
The method
getEngineerName gets the name of the software engineer. |
javax.swing.ImageIcon |
getImage(java.lang.String picname)
The method
getImage gets an image from the picture folder. |
java.awt.Image |
getImagePure(java.lang.String picname)
The method
getImage gets an image from the picture folder. |
static java.lang.String |
getMail()
The method
getWeb gets the mail adress of the software engineer. |
java.lang.String |
getMonthName(int number)
The method
getMonthName gets the name from a month. |
static java.lang.String |
getWeb()
The method
getWeb gets the web of the software engineer. |
int |
performDatabaseStatement(java.lang.String sql_statement,
java.lang.String databasename)
The method
performDatabaseStatement performs database statements. |
void |
putTheFile(java.lang.String full_path,
java.lang.String content)
The method
putTheFile puts the current file to file system. |
byte[] |
resizeImage(byte[] xpic,
int max_width,
int max_height)
The method
resizeImage calculates show data for given image. |
java.awt.image.BufferedImage |
resizeImage(java.awt.Image the_image,
int max_width,
int max_height)
The method
resizeImage calculates show data for given image. |
java.lang.String |
save_Path(MainDialog dialog,
java.lang.String curr_path,
boolean path_only,
java.lang.String[] extension)
The method
save_Path gets the path to a fits folder. |
int |
showDialog(java.lang.String message)
The method
showDialog shows a window with a question. |
int |
showErrorDialog(java.lang.String message)
The method
showErrorDialog shows a window with an error message. |
void |
showException(java.lang.String ex)
The method
showException shows the text of an exception. |
void |
showException(java.lang.String ex,
boolean with_hint)
The method
showException shows the text of an exception. |
int |
showInfoDialog(java.lang.String message)
The method
showInfoDialog shows a window with an information. |
int |
showQuestionDialog(java.lang.String message)
The method
showDialog shows a window with a question. |
java.lang.String |
translateWordToGreekHTML(java.lang.String word)
The method
changeCharacterCodeToHTML changes the unicode char to a html unicode. |
java.lang.String |
translateWordToGreekXML(java.lang.String word)
The method
changeCharacterCodeToHTML changes the unicode char to a html unicode. |
public Tool4Dialog(MainDialog call)
Tool4Dialog
creates a new instance(object) of the class.call
- the calling dialogpublic static java.lang.String getEngineerName()
getEngineerName
gets the name of the software engineer.public static java.lang.String getEngineerCity()
getEngineerCity
gets the city of the software engineer.public static java.lang.String getWeb()
getWeb
gets the web of the software engineer.public static java.lang.String getMail()
getWeb
gets the mail adress of the software engineer.public javax.swing.ImageIcon getImage(java.lang.String picname) throws java.lang.Exception
getImage
gets an image from the picture folder.picname
- name of the picture to get.java.lang.Exception
- if errorpublic java.awt.Image getImagePure(java.lang.String picname) throws java.lang.Exception
getImage
gets an image from the picture folder.picname
- name of the picture to get.java.lang.Exception
- if errorpublic java.applet.AudioClip getClip(java.lang.String clipname) throws java.lang.Exception
getImage
gets an image from the picture folder.clipname
- name of the clip to get.java.lang.Exception
- if errorpublic void showException(java.lang.String ex)
showException
shows the text of an exception.ex
- the Exception.public void showException(java.lang.String ex, boolean with_hint)
showException
shows the text of an exception.ex
- the Exception.with_hint
- print the hint on the window.public static java.lang.String getCopyright(java.lang.String year)
getCopyright
creates the copyright string.year
- the year of copyrightpublic byte[] resizeImage(byte[] xpic, int max_width, int max_height) throws java.lang.Exception
resizeImage
calculates show data for given image.xpic
- the image.max_height
- the maximum hight of the image.max_width
- the maximum width of the image.java.lang.Exception
- if error.public java.awt.image.BufferedImage resizeImage(java.awt.Image the_image, int max_width, int max_height) throws java.lang.Exception
resizeImage
calculates show data for given image.the_image
- a buffered.max_height
- the maximum hight of the image.max_width
- the maximum width of the image.java.lang.Exception
- if error.public java.lang.String save_Path(MainDialog dialog, java.lang.String curr_path, boolean path_only, java.lang.String[] extension) throws java.lang.Exception
save_Path
gets the path to a fits folder.dialog
- the main dialog.curr_path
- the current path.path_only
- get only the path without the file nameextension
- the extensionsjava.lang.Exception
- if error.public void putTheFile(java.lang.String full_path, java.lang.String content) throws java.lang.Exception
putTheFile
puts the current file to file system.full_path
- of file.content
- the file content.java.lang.Exception
- if errorpublic java.lang.String changeCharacterCodeToString(java.lang.String chr)
changeCharacterCodeToString
changes the unicode char to a string.chr
- the unicode character.public java.lang.String translateWordToGreekXML(java.lang.String word)
changeCharacterCodeToHTML
changes the unicode char to a html unicode.word
- the unicode word.public java.lang.String changeCharacterCodeToXML(java.lang.String chr)
changeCharacterCodeToXML
changes the unicode char to a xml unicode.chr
- the unicode character.public java.lang.String translateWordToGreekHTML(java.lang.String word)
changeCharacterCodeToHTML
changes the unicode char to a html unicode.word
- the unicode word.public java.lang.String changeCharacterCodeToHTML(java.lang.String chr)
changeCharacterCodeToHTML
changes the unicode char to a html char.chr
- the unicode character.public java.util.Hashtable createColumnWidthTable(int[] column_width) throws java.lang.Exception
createColumnWidthTable
creates a hash table with
the column width. A -1 indicates: no width.column_width
- the width values as an array.java.lang.Exception
- if errorpublic java.util.Hashtable createColumnWidthTable(java.lang.String column_width) throws java.lang.Exception
createColumnWidthTable
creates a hash table with
the column width. A -1 indicates: no width.column_width
- the width values separated by comma.java.lang.Exception
- if errorpublic java.lang.String getMonthName(int number)
getMonthName
gets the name from a month.number
- the month index.public java.lang.String getDayName(int number)
getDayhName
gets the name from a day.number
- the day index.public int showDialog(java.lang.String message)
showDialog
shows a window with a question.message
- the message, if null: standard message.public int showErrorDialog(java.lang.String message)
showErrorDialog
shows a window with an error message.message
- the message, if null: standard message.public int showQuestionDialog(java.lang.String message)
showDialog
shows a window with a question.message
- the message, if null: standard message.public int showInfoDialog(java.lang.String message)
showInfoDialog
shows a window with an information.message
- the message, if null: standard message.public int performDatabaseStatement(java.lang.String sql_statement, java.lang.String databasename)
performDatabaseStatement
performs database statements.sql_statement
- the sql listing.databasename
- the database name