public abstract class FileTransferConversationComponent extends ChatConversationComponent implements java.awt.event.ActionListener, FileTransferProgressListener, Skinnable
ChatConversationComponent.ChatConversationButton
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected ChatConversationComponent.ChatConversationButton |
acceptButton
The accept button.
|
protected ChatConversationComponent.ChatConversationButton |
cancelButton
The cancel button.
|
protected javax.swing.JLabel |
fileLabel
The file label.
|
protected static int |
IMAGE_HEIGHT
Image default height.
|
protected static int |
IMAGE_WIDTH
Image default width.
|
protected FileImageLabel |
imageLabel
The image label.
|
protected ChatConversationComponent.ChatConversationButton |
openFileButton
The open file button.
|
protected ChatConversationComponent.ChatConversationButton |
openFolderButton
The open folder button.
|
protected javax.swing.JProgressBar |
progressBar
The progress bar.
|
protected ChatConversationComponent.ChatConversationButton |
rejectButton
The reject button.
|
protected ChatConversationComponent.ChatConversationButton |
retryButton
The retry button.
|
protected javax.swing.JLabel |
titleLabel
The title label.
|
constraints, resources
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
FileTransferConversationComponent()
Creates a file conversation component.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
Handles buttons action events.
|
protected java.lang.String |
getFileLabel(java.io.File file)
Returns the string, showing information for the given file.
|
protected java.lang.String |
getFileLabel(java.lang.String fileName,
long fileSize)
Returns the string, showing information for the given file.
|
protected abstract java.lang.String |
getProgressLabel(java.lang.String bytesString)
Returns the label to show on the progress bar.
|
protected void |
hideProgressRelatedComponents()
Hides all progress related components.
|
void |
loadSkin()
Reload images and colors.
|
void |
progressChanged(FileTransferProgressEvent event)
Updates progress bar progress line every time a progress event has been
received.
|
protected void |
setCompletedDownloadFile(java.io.File file)
Sets the download file.
|
protected void |
setFileTransfer(FileTransfer fileTransfer,
long transferredFileSize)
Sets the file transfer.
|
protected void |
showErrorMessage(java.lang.String message)
Shows the given error message in the error area of this component.
|
getDate, getDateString, openFile, paintComponent, setWarningStyle
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected static final int IMAGE_WIDTH
protected static final int IMAGE_HEIGHT
protected final FileImageLabel imageLabel
protected final javax.swing.JLabel titleLabel
protected final javax.swing.JLabel fileLabel
protected final ChatConversationComponent.ChatConversationButton cancelButton
protected final ChatConversationComponent.ChatConversationButton retryButton
protected final ChatConversationComponent.ChatConversationButton acceptButton
protected final ChatConversationComponent.ChatConversationButton rejectButton
protected final ChatConversationComponent.ChatConversationButton openFileButton
protected final ChatConversationComponent.ChatConversationButton openFolderButton
protected final javax.swing.JProgressBar progressBar
public FileTransferConversationComponent()
protected void showErrorMessage(java.lang.String message)
showErrorMessage
in class ChatConversationComponent
message
- the message to showprotected void setCompletedDownloadFile(java.io.File file)
file
- the file that has been downloaded or sentprotected void setFileTransfer(FileTransfer fileTransfer, long transferredFileSize)
fileTransfer
- the file transfertransferredFileSize
- the size of the transferred filepublic void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
evt
- the ActionEvent that notified uspublic void progressChanged(FileTransferProgressEvent event)
progressChanged
in interface FileTransferProgressListener
event
- the FileTransferProgressEvent that notified usprotected java.lang.String getFileLabel(java.io.File file)
file
- the fileprotected java.lang.String getFileLabel(java.lang.String fileName, long fileSize)
fileName
- the name of the filefileSize
- the size of the fileprotected void hideProgressRelatedComponents()
protected abstract java.lang.String getProgressLabel(java.lang.String bytesString)
bytesString
- the bytes that have been transferedpublic void loadSkin()
loadSkin
in interface Skinnable
loadSkin
in class ChatConversationComponent
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.