|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sshtools.ui.awt.Toaster
public class Toaster
UI component that display toaster style messages. When a request to display a message is made, the message will appear at a specified location on the users desktop. It will stay visible for a specified amount of time. If more messages are sent in the meantime, they will appear in a new window either just above or just below the last messages.
| Field Summary | |
|---|---|
static java.awt.Color |
BACKGROUND_COLOR
Default background color for new toasters |
static java.awt.Color |
BORDER_COLOR
Default border color for new toasters |
static int |
BOTTOM_LEFT
Toaster appears at the bottom left of the screen with messages flowing up from bottom to top |
static int |
BOTTOM_RIGHT
Toaster appears at the bottom right of the screen with messages flowing up from bottom to top |
static int |
DEFAULT_TIMEOUT
Default timeout |
static java.awt.Color |
FOREGROUND_COLOR
Default foreground color for new toasters |
static java.awt.Font |
TEXT_FONT
Default text font for new toasters |
static java.awt.Font |
TITLE_FONT
Default title font for new toasters |
static int |
TOP_LEFT
Toaster appears at the top left of the screen with messages flowing down from top to bottom |
static int |
TOP_RIGHT
Toaster appears at the top right of the screen with messages flowing down from top to bottom |
| Constructor Summary | |
|---|---|
Toaster(int position,
java.awt.Dimension popupSize)
Constructor. |
|
| Method Summary | |
|---|---|
java.awt.Color |
getBackgroundColor()
Get the background color |
java.awt.Color |
getBorderColor()
Get the border color |
java.awt.Color |
getForegroundColor()
Get the foreground color |
java.awt.Dimension |
getPopupSize()
Get the size of the popups. |
int |
getPosition()
Get the position of messages. |
java.awt.Font |
getTextFont()
Get the text text |
java.awt.Font |
getTitleFont()
Get the title font. |
static void |
main(java.lang.String[] args)
Test. |
void |
popup(java.awt.event.ActionListener callback,
java.lang.String message,
java.lang.String title)
Popup a new message for 10 seconds. |
void |
popup(java.awt.event.ActionListener callback,
java.lang.String message,
java.lang.String title,
java.awt.Image image)
Popup a new message for 10 seconds with an option image. |
void |
popup(java.awt.event.ActionListener callback,
java.lang.String message,
java.lang.String title,
java.awt.Image image,
int timeout)
Popup a new message. |
void |
setBackgroundColor(java.awt.Color backgroundColor)
Set the background color. |
void |
setBorderColor(java.awt.Color borderColor)
Set the border color. |
void |
setForegroundColor(java.awt.Color foregroundColor)
Set the foreground color. |
void |
setPopupSize(java.awt.Dimension popupSize)
Set the size of the popups. |
void |
setPosition(int position)
Set the position of messages. |
void |
setTextAlign(float textAlign)
Set the text alignment. |
void |
setTextFont(java.awt.Font textFont)
Set the text font. |
void |
setTitleFont(java.awt.Font titleFont)
Set the title font. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_TIMEOUT
public static final int BOTTOM_RIGHT
public static final int BOTTOM_LEFT
public static final int TOP_LEFT
public static final int TOP_RIGHT
public static java.awt.Color BACKGROUND_COLOR
public static java.awt.Color FOREGROUND_COLOR
public static java.awt.Color BORDER_COLOR
public static java.awt.Font TEXT_FONT
public static java.awt.Font TITLE_FONT
| Constructor Detail |
|---|
public Toaster(int position,
java.awt.Dimension popupSize)
position - popupSize - popup sizesetPosition(int)| Method Detail |
|---|
public void setTextAlign(float textAlign)
Component.LEFT_ALIGNMENT,
Component.CENTER_ALIGNMENT or
Component.RIGHT_ALIGNMENT.
textAlign - text alignmentpublic void setPopupSize(java.awt.Dimension popupSize)
popupSize - popup sizepublic java.awt.Dimension getPopupSize()
public void setPosition(int position)
TOP_LEFT,
TOP_RIGHT, BOTTOM_LEFT or BOTTOM_RIGHT.
position - positionpublic int getPosition()
TOP_LEFT,
TOP_RIGHT, BOTTOM_LEFT or BOTTOM_RIGHT.
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color backgroundColor)
backgroundColor - background colorpublic java.awt.Color getBorderColor()
public void setBorderColor(java.awt.Color borderColor)
borderColor - border colorpublic java.awt.Color getForegroundColor()
public void setForegroundColor(java.awt.Color foregroundColor)
foregroundColor - public java.awt.Font getTextFont()
public void setTextFont(java.awt.Font textFont)
textFont - text fontpublic java.awt.Font getTitleFont()
public void setTitleFont(java.awt.Font titleFont)
titleFont - title font
public void popup(java.awt.event.ActionListener callback,
java.lang.String message,
java.lang.String title)
callback - invoked when message is clickedmessage - message to displaytitle - title of message
public void popup(java.awt.event.ActionListener callback,
java.lang.String message,
java.lang.String title,
java.awt.Image image)
callback - invoked when message is clickedmessage - message to displaytitle - title of messageimage - image or null
public void popup(java.awt.event.ActionListener callback,
java.lang.String message,
java.lang.String title,
java.awt.Image image,
int timeout)
callback - invoked when message is clickedmessage - message to displaytitle - title of messagetimeout - time to display message forimage - image or null
public static void main(java.lang.String[] args)
throws java.lang.Exception
args -
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||