|
JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Dialog | +--net.jxta.widget.OptionDialog
Field Summary | |
static int |
ABORT
Return value if the ABORT button was pressed |
static java.lang.String |
ABORT_TEXT
Default text for the abort button |
protected boolean |
abortPressed
Did the user press the abort button |
static int |
ALERT
Alert type message - only one okay button |
protected java.awt.Panel |
buttonPanel
Panel that contains the buttons to be displayed |
static int |
CANCEL
Return value if the cancel button was pressed |
static java.lang.String |
CANCEL_TEXT
Default text for the cancel button |
static int |
ERROR
Return value if an ERROR occured |
protected static java.awt.Frame |
frame
The parent frame of this dialog |
protected java.awt.GridBagConstraints |
gbc
The GridBagConstraint used to lay out the components |
protected java.awt.GridBagLayout |
gbl
The GridBagLayout used to lay out the components |
protected ImageLabel |
imageLabel
The ImageLabel displaying the alert image |
static int |
INFO
Info type message - only one okay button |
static int |
OKAY
Return value if the okay button was pressed |
static java.lang.String |
OKAY_TEXT
Default text for the okay button |
protected boolean |
okayPressed
Did the user press the okay button |
protected ProgressBar |
progressBar
The progress bar to display if any |
static int |
QUESTION
Alert type message - okay, cancel, abort button |
protected InfoLabel |
textLabel
The InfoLabel displayed in this dialog |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
OptionDialog(java.awt.Frame frame)
Creates a new dialog with a title of IP2P. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent evt)
Called if any of the buttons was pressed or if the window was otherwise closed. |
OptionDialog |
getInstance()
Gets an instance of an OptionDialog, if one was already created, i.e. |
void |
hideDialog()
Hides this label. |
void |
prepareToShow()
Call this method before calling any of the show methods if this dialog is to be shonw during a calculation and terminated by that calculation. |
void |
setText(java.lang.String[] strs)
Sets the text displayed in this dialog, a new line is added after each element of str. |
void |
setText(java.lang.String[] strs,
int imageType)
Sets the text displayed in this dialog, a new line is added after each element of str. |
int |
showDialog(int dialogType,
java.awt.Component panel)
Shows a dialog with the indicated panel and the buttons as indicated by the type: one okay button (ALERT, INFO) or cancel, abort and okay button (QUESTION). |
int |
showDialog(int dialogType,
java.awt.Component panel,
java.lang.String okayText,
java.lang.String cancelText,
java.lang.String abortText)
Shows a dialog with the indicated panel and the buttons as indicated by the type: one okay button (ALERT, INFO) or cancel, abort and okay button (QUESTION). |
static void |
showError(java.lang.String[] strs)
Shows an error dialog if the dialog was already initialized otherwise, we write the text to the screen |
int |
showImageDialog(int dialogType,
java.lang.String text)
Shows a dialog with no image. |
int |
showImageDialog(int dialogType,
java.lang.String text,
int imageType)
Shows a dialog with a image, depending on the type (no image if imageType is -1. |
int |
showImageDialog(int dialogType,
java.lang.String text,
int imageType,
java.lang.String okayText,
java.lang.String cancelText,
java.lang.String abortText)
Shows a dialog with a image, depending on the type (no image if imageType is -1. |
int |
showImageDialog(int dialogType,
java.lang.String text,
int imageType,
java.lang.String okayText,
java.lang.String cancelText,
java.lang.String abortText,
boolean showProgress)
Shows a dialog with a image, depending on the type (no image if imageType is -1. |
int |
showImageDialog(int dialogType,
java.lang.String text,
java.lang.String okayText,
java.lang.String cancelText,
java.lang.String abortText)
Shows a dialog with no image. |
void |
updateProgress(double percentage)
Updates the progress bar This method is thread safe - the current thread will block if other threads are currrently changing the text |
void |
updateText(java.lang.String text)
Updates the text shown in the label. |
Methods inherited from class java.awt.Dialog |
addNotify,
dispose,
getTitle,
hide,
isModal,
isResizable,
paramString,
setModal,
setResizable,
setTitle,
show |
Methods inherited from class java.awt.Window |
addWindowListener,
applyResourceBundle,
applyResourceBundle,
finalize,
getFocusOwner,
getInputContext,
getLocale,
getOwnedWindows,
getOwner,
getToolkit,
getWarningString,
isShowing,
pack,
postEvent,
processEvent,
processWindowEvent,
removeWindowListener,
setCursor,
toBack,
toFront |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paint,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setFont,
setLayout,
update,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputMethodRequests,
getLocation,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getSize,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
imageUpdate,
inside,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setEnabled,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
setVisible,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int CANCEL
public static final int OKAY
public static final int ABORT
public static final int ERROR
public static final int ALERT
public static final int INFO
public static final int QUESTION
public static final java.lang.String OKAY_TEXT
public static final java.lang.String ABORT_TEXT
public static final java.lang.String CANCEL_TEXT
protected boolean okayPressed
protected boolean abortPressed
protected static java.awt.Frame frame
protected InfoLabel textLabel
protected ImageLabel imageLabel
protected ProgressBar progressBar
protected java.awt.Panel buttonPanel
protected java.awt.GridBagLayout gbl
protected java.awt.GridBagConstraints gbc
Constructor Detail |
public OptionDialog(java.awt.Frame frame)
frame
- the parent frame of this dialogMethod Detail |
public OptionDialog getInstance()
public static void showError(java.lang.String[] strs)
public int showImageDialog(int dialogType, java.lang.String text)
dialogType
- what type of dialog is to be shown -
ALERT, INFO one okay button.
QUESTION cancel, abort and okay buttontext
- String array of the text to displaypublic int showImageDialog(int dialogType, java.lang.String text, java.lang.String okayText, java.lang.String cancelText, java.lang.String abortText)
dialogType
- what type of dialog is to be shown -
ALERT, INFO one okay button.
QUESTION cancel, abort and okay buttontext
- String array of the text to displayokayText
- the name to appear on okay button (if null,
button is not displayed)cancelText
- the name to appear on cancel button (if null,
button is not displayed)abortText
- the name to appear on okay abort (if null,
button is not displayed)public int showImageDialog(int dialogType, java.lang.String text, int imageType)
dialogType
- what type of dialog is to be shown -
ALERT, INFO one okay button.
QUESTION cancel, abort and okay buttontext
- String array of the text to displayimageType
- determines the image to be shown. If it is -1,
no image is shownpublic int showImageDialog(int dialogType, java.lang.String text, int imageType, java.lang.String okayText, java.lang.String cancelText, java.lang.String abortText)
dialogType
- what type of dialog is to be shown -
ALERT, INFO one okay button.
QUESTION cancel, abort and okay buttontext
- String array of the text to displayimageType
- determines the image to be shown. If it is -1,
no image is shownokayText
- the name to appear on okay button (if null,
button is not displayed)cancelText
- the name to appear on cancel button (if null,
button is not displayed)abortText
- the name to appear on okay abort (if null,
button is not displayed)public void prepareToShow()
public int showImageDialog(int dialogType, java.lang.String text, int imageType, java.lang.String okayText, java.lang.String cancelText, java.lang.String abortText, boolean showProgress)
dialogType
- what type of dialog is to be shown -
ALERT, INFO one okay button.
QUESTION cancel, abort and okay buttontext
- String array of the text to displayimageType
- determines the image to be shown. If it is -1,
no image is shownokayText
- the name to appear on okay button (if null,
button is not displayed)cancelText
- the name to appear on cancel button (if null,
button is not displayed)abortText
- the name to appear on okay abort (if null,
button is not displayed)showProgress
- if true, a progress bar is displayedpublic int showDialog(int dialogType, java.awt.Component panel)
dialogType
- what type of dialog is to be shown -
ALERT, INFO one okay button.
QUESTION cancel, abort and okay buttonpanel
- the panel to showpublic int showDialog(int dialogType, java.awt.Component panel, java.lang.String okayText, java.lang.String cancelText, java.lang.String abortText)
dialogType
- what type of dialog is to be shown -
ALERT, INFO one okay button.
QUESTION cancel, abort and okay buttonpanel
- the panel to showokayText
- the name to appear on okay button (if null,
button is not displayed)cancelText
- the name to appear on cancel button (if null,
button is not displayed)abortText
- the name to appear on okay abort (if null,
button is not displayed)public void setText(java.lang.String[] strs)
strs
- String array of the text to displaypublic void setText(java.lang.String[] strs, int imageType)
strs
- String array of the text to displayimageType
- the image type to displaypublic void updateText(java.lang.String text)
text
- the new text to displaypublic void updateProgress(double percentage)
percentage
- new progress to showpublic void hideDialog()
public void actionPerformed(java.awt.event.ActionEvent evt)
evt
- the triggering ActionEvent if any. If it is null, we assume.
cancel was pressed
|
JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |