public class DataImageViewerForFile extends ImageViewer implements DataComponent, java.awt.dnd.DropTargetListener
javax.swing.JLabel.AccessibleJLabel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected DataObject |
assignedDataObject |
image
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
DataImageViewerForFile(javax.swing.JFrame parent,
DataObject dO,
java.lang.String imageDirectory,
java.lang.String prefix)
Constructs a new image viewer.
|
Modifier and Type | Method and Description |
---|---|
void |
addComponentModificationListener(ComponentModificationListener l)
Adds a component modification listener to this component.
|
void |
dragEnter(java.awt.dnd.DropTargetDragEvent dtde) |
void |
dragExit(java.awt.dnd.DropTargetEvent dte) |
void |
dragOver(java.awt.dnd.DropTargetDragEvent dtde) |
void |
drop(java.awt.dnd.DropTargetDropEvent dtde) |
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde) |
void |
free()
Releases external resources.
|
DataObject |
getAssignedDataObject()
Returns the assigned data object.
|
protected java.lang.String |
getTranslation(java.lang.String resourceKey)
Returns a text in the corresponding language according to the locale
specific resource bundle of the package.
|
boolean |
isContentValid()
Indicates whether the component's value is valid.
|
boolean |
isModified()
Indicates whether the component's value differs from its initial value.
|
boolean |
isRequirementUnfulfilled()
Indicates whether the component's value is mandatory but not filled.
|
boolean |
isToSave()
Indicates whether the component's value differs from its value at load time.
|
void |
loadImageByCompletePathAsNew(java.lang.String path)
Loads the image from the specified path and signs it as newly assigned.
|
void |
loadValue()
Loads the component's database stored value.
|
void |
removeComponentModificationListener(ComponentModificationListener l)
Removes a component modification listener to this component.
|
boolean |
requestFocusInWindow()
Set focus on the receiving component if isRequestFocusEnabled returns true.
|
void |
saveValue()
Stores the component's value.
|
void |
selectAll()
Selects all input of the component, if it is supported - e.g. in JTextField.
|
void |
setEditable(boolean editable)
Sets the flag that determines whether or not this component is editable.
|
void |
setRequired(boolean required)
Determines whether input is required (mandatory).
|
void |
setToolTipText(java.lang.String toolTipText)
Sets the component's tool tip text.
|
void |
setUseWinCopyIfPossible(boolean useWinCopyIfPossible) |
protected void |
validateDragEvent(java.awt.dnd.DropTargetDragEvent e) |
getHelpTarget, getHelpTopic, initialize, isFilled, loadImageByCompletePath, setHelpContext, setHelpContext, setImage
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, 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, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, 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, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isFilled
protected DataObject assignedDataObject
public DataImageViewerForFile(javax.swing.JFrame parent, DataObject dO, java.lang.String imageDirectory, java.lang.String prefix)
dO
- the data object to assign toimageDirectory
- the directory to file the imageprefix
- the prefix for the file name. This character(s) will be combined
with the internal identifier to produce the file name.protected java.lang.String getTranslation(java.lang.String resourceKey)
resourceKey
- the key of the resource to retrievepublic void setUseWinCopyIfPossible(boolean useWinCopyIfPossible)
public DataObject getAssignedDataObject()
getAssignedDataObject
in interface DataComponent
public void setRequired(boolean required)
setRequired
in interface DataComponent
required
- if true, input is mandatory; otherwise, input is not mandatorypublic void loadValue()
loadValue
in interface DataComponent
public void loadImageByCompletePathAsNew(java.lang.String path)
path
- the path of the image to loadpublic boolean isModified()
ModifiedInformer
isModified
in interface ModifiedInformer
public boolean isToSave()
DataComponent
isToSave
in interface DataComponent
public boolean isContentValid()
isContentValid
in interface DataComponent
public boolean isRequirementUnfulfilled()
isRequirementUnfulfilled
in interface DataComponent
public void selectAll()
selectAll
in interface DataComponent
public boolean requestFocusInWindow()
requestFocusInWindow
in interface DataComponent
requestFocusInWindow
in class javax.swing.JComponent
public void saveValue()
saveValue
in interface DataComponent
public void setEditable(boolean editable)
DataComponent
setEditable
in interface DataComponent
editable
- a flag indicating whether this component should be user editablepublic void setToolTipText(java.lang.String toolTipText)
setToolTipText
in interface DataComponent
setToolTipText
in class javax.swing.JComponent
toolTipText
- the component's tool tip textpublic void addComponentModificationListener(ComponentModificationListener l)
DataComponent
addComponentModificationListener
in interface DataComponent
l
- component modification listener to addpublic void removeComponentModificationListener(ComponentModificationListener l)
DataComponent
removeComponentModificationListener
in interface DataComponent
l
- component modification listener to addDataList
public void free()
Exemptible
free
in interface Exemptible
public void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
dragEnter
in interface java.awt.dnd.DropTargetListener
public void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
dragOver
in interface java.awt.dnd.DropTargetListener
public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
dropActionChanged
in interface java.awt.dnd.DropTargetListener
public void dragExit(java.awt.dnd.DropTargetEvent dte)
dragExit
in interface java.awt.dnd.DropTargetListener
public void drop(java.awt.dnd.DropTargetDropEvent dtde)
drop
in interface java.awt.dnd.DropTargetListener
protected void validateDragEvent(java.awt.dnd.DropTargetDragEvent e)
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de