public class ImageDataField extends DataField implements DataComponent, OpenDialog, Freeable, ITemplateField
BytesBlock,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
protected class |
ImageDataField.ExtensionFileFilter
Class to filter files by extension.
|
static class |
ImageDataField.ImageDataFieldTransferHandler |
protected class |
ImageDataField.ZoomWindow
The main class to create a zoom window in a new dialog.
|
DataField.AuxPanel, DataField.CopyActionListener, DataField.ELabel, DataField.FieldButton, DataField.FieldFocusListener, DataField.InfoMouseListener, DataField.ToggleButtonJPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowZoom |
protected byte[] |
bytesImage
The reference for the bytes of image.
|
protected static String |
CLIPBOARD_ERROR_MESSAGE
The clipboard error message.
|
protected static String |
CLIPBOARD_PASTE_BUTTON_TIP
The tip message over paste from clipboard button.
|
protected static Cursor |
cursorZoom
The reference to a cursor.
|
protected static String |
DELETE_DATA_FIELD_BUTTON_TIP
The tip message over delete data field button.
|
protected JButton |
deleteBt
An instance of a delete button.
|
protected ActionListener |
deleteBtListener
A reference for a delete button listener.
|
protected static String |
DOUBLE_CLICK_TO_VIEW_TIP
The tip message showed over image.
|
protected ImageIcon |
emptyImage
A reference for an empty image icon.
|
protected int |
iHigh
The image high.
|
protected ImageIcon |
image
The reference to image icon.
|
protected int |
imageWidth
The image width.
|
protected boolean |
keepAspectRatio |
protected File |
lastPath
The last path for file.
|
protected ActionListener |
loadBtListener
A reference for a load button listener.
|
protected JButton |
loadButton
An instance of a load button.
|
protected int |
locationButtons
The location buttons.
|
static int |
MAX_SIZE
The max size value.
|
protected static String |
OPEN_IMAGE_BUTTON_TIP
The tip message shows over open image button.
|
protected Frame |
parentFrame
The parent frame.
|
protected JButton |
pasteBt
An instance of a paste button.
|
protected JButton |
previewTwainBt
A reference for a preview twain button.
|
protected static int |
RIGHT
The right value.
|
protected static int |
TOP
The top value.
|
protected static String |
TWAIN_PREVIEW_BUTTON_TIP
The tip message over preview button.
|
protected static String |
TWAIN_SCAN_BUTTON_TIP
The tip message over scan button.
|
protected JButton |
twainBt
A reference for a twain button.
|
protected boolean |
zoomListenerEnabled
The zoom listener enabled condition.
|
advancedQueryMode, ALIGN, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, alignment, ASTERISK_REQUIRED_STYLE, ATTR, attribute, backgroundColor, BGCOLOR, bold, BOLD, BORDER, BORDER_REQUIRED_STYLE, borderText, BOTTOM, CENTER, CLIPBOARD_COPY, CLIPBOARD_COPY_es_ES, CLIPBOARD_CUT, CLIPBOARD_CUT_es_ES, CLIPBOARD_PASTE, CLIPBOARD_PASTE_es_ES, conditions, dataField, DEFAULT_BORDER, DEFAULT_BOTTOM_MARGIN, DEFAULT_FIELD_LEFT_MARGIN, DEFAULT_FIELD_RIGHT_MARGIN, DEFAULT_LABEL_LEFT_MARGIN, DEFAULT_LABEL_RIGHT_MARGIN, DEFAULT_PARENT_MARGIN, DEFAULT_PARENT_MARGIN_FOR_SCROLL, DEFAULT_TOP_MARGIN, defaultAsteriskColor, DEFAULTBORDER, defaultDisableBackgroundColor, defaultFieldButtonHigh, defaultPreferenceTextNotRetrievedFromPreferences, DEFINE_HELP_FIELD_PREFERENCE, dim, DIM, disabledbgcolor, DISABLEDBGCOLOR, empty, enabled, ENABLED, EXPAND, FIELD_HELP_TIP, fieldlistenerFocus, fieldSize, fireValueEvents, FOCUS_BACKGROUNDCOLOR, FONT, fontColor, FONTCOLOR, fontSize, FONTSIZE, height, HEIGHT, incrementalFont, initPreferenceHelpText, INSETS, isEnabled, LABELALIGN, labelComponent, LABELFONT, LABELFONTCOLOR, labelPosition, LABELPOSITION, LABELSIZE, labelText, LABELVISIBLE, LEFT, locale, LOWERED, menuCopy, menuCut, menuDefineHelpPreference, menuHelpPreferences, menuPaste, modifiable, NO_STR, NONE, noRequiredBorder, OPAQUE, originalSize, OUTBORDER, panel, parentForm, permissionActivate, permissionVisible, popupMenu, PREF_WIDTH, prefWidth, RAISED, redimensionPanel, redimensJTextField, required, REQUIRED, requiredBorder, REQUIREDBORDER, requiredFieldBackgroundColor, requiredFieldForegroundColor, resources, restricted, show, showLabel, SIZE, TEXT_STR, TEXTALIGN, textAlignment, textHelpPreference, TIP, tipKey, validData, VALIGN, Valignment, valueListener, valueSave, VISIBLE, VISUALIZE_HELP_FIELD_PREFERENCE, weightDataFieldH, weightPanelH, width, WIDTH, x, X, y, Y, YES_STRaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCOMP_FOCUS_YELLOW, GREEN_VERY_LIGHT, LIGHT_GRAY_BLUE, LIGHT_GREYISH_BLUE, VERY_LIGHT_BLUE, VERY_LIGHT_GRAY, VERY_LIGHT_PINK, VERY_LIGHT_RED, VERY_LIGHT_SKYBLUE, VERY_LIGHT_YELLOW, VERY_LIGHT_YELLOW_2DEBUG_LANGUAGEDESACTIVATE_COMPONENT_BY_PERMISSION_TIPDATA_TYPE_FIELD, DATA_TYPE_FIELD_ATTR, DATA_TYPE_IMAGE, DATA_TYPE_IMAGE_ATTR, DATA_TYPE_TABLE, DATA_TYPE_TABLE_ATTR, TEMPLATE_DATA_TYPEABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS| Constructor and Description |
|---|
ImageDataField(Hashtable param)
The class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
debugImage(Image im,
String title) |
void |
deleteData()
The method to delete data for component.
|
protected void |
finalize() |
void |
free()
Makes the object to release the resources.
|
JButton |
getDeleteButton()
Gets the delete button listener.
|
ImageIcon |
getEmptyImage()
Gets the empty image.
|
ImageIcon |
getImage()
Gets the image for icon.
|
static Image |
getImage(byte[] imageData,
int width,
int height,
boolean allowZoom) |
JButton |
getLoadButton()
Gets the load button listener.
|
int |
getSQLDataType()
Returns the
sql data type according to
java.sql.Types
|
int |
getTemplateDataType()
Returns the data type.
|
Object |
getTemplateDataValue()
Gets the value to show in the template
|
Object |
getValue()
Gets the value of a component.
|
protected void |
importImage(Image image) |
void |
init(Hashtable parameters)
Initializes parameters.
|
boolean |
isEmpty()
Checks the data existence in component.
|
boolean |
isModifiable()
Returns always true.
|
boolean |
isRequired()
Returns true when field is required.
|
protected void |
setButtonTips()
Sets tips for all buttons.
|
void |
setEnabled(boolean enabled)
Enables the field to insert data.
|
void |
setParentForm(Form f)
Method declaration to set the form that contains the component.
|
void |
setParentFrame(Frame frame)
This method is called from Form for each component that implements this
interface.
|
void |
setResourceBundle(ResourceBundle res)
Sets the language resource bundle.
|
void |
setValue(Object value)
Sets the value for component.
|
void |
setVisibleButtons(boolean visible)
Sets visible buttons according to the condition.
|
void |
setZoomListenerEnabled(boolean enabled)
Sets a zoom listener enabled.
|
void |
uninstallDeleteButtonListener()
Uninstalls the delete button listener.
|
void |
uninstallLoadButtonListener()
Uninstalls the load button listener.
|
protected void |
update() |
addFocusListener, addHelpMenuPopup, addValueChangeListener, changeButton, changeOpacity, checkDefineHelpPermission, checkEnabledPermission, checkVisiblePermission, configurePopupMenuHelp, createFocusListener, createInstanceConditionCombo, createPopupMenu, defineHelpField, fireValueChanged, getAttribute, getBorder, getConstraints, getDataField, getDisabledbgcolor, getFontColor, getHelpIdString, getHelpPreferenceKey, getLabelComponent, getLabelComponentText, getLabelFontColor, getLabelText, getParentForm, getPreferenceHelpText, getPreferredSize, getText, getTextsToTranslate, getValueChangeListeners, hasHelpInPreferences, initPermissions, initPreferences, installFocusListener, installHelpId, installPopupMenuListener, installPreferenceHelpListener, isAdvancedQueryMode, isEnabled, isHidden, isLabelVisible, isModified, isRestricted, parseBoolean, preferenceChanged, removeFocusListener, removeValueChangeListener, requestFocus, seeHelpField, setBold, setComponentLocale, setDisabledbgcolor, setFont, setFontColor, setFontSize, setLabelFontColor, setModifiable, setRequired, setRequiredFieldBackground, setVisible, showPopupMenu, updateBackgroundColor, updateBackgroundColor, updateFont, updateTip, updateUI, validateComponentPositionsgetAccessibleContext, getUI, getUIClassID, paramString, setUIaddAncestorListener, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, 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, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, 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, validateTreeaction, add, addComponentListener, 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, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, 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, 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, transferFocusUpCycleclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetLabelComponentText, isHidden, isModified, setModifiable, setRequiredgetConstraints, isEnabled, setVisiblegetTextsToTranslate, setComponentLocalegetAttributeinitPermissions, isRestrictedprotected static final int TOP
protected static final int RIGHT
public static final int MAX_SIZE
protected int locationButtons
protected static Cursor cursorZoom
protected static String DOUBLE_CLICK_TO_VIEW_TIP
protected static String OPEN_IMAGE_BUTTON_TIP
protected static String DELETE_DATA_FIELD_BUTTON_TIP
protected static String TWAIN_SCAN_BUTTON_TIP
protected static String TWAIN_PREVIEW_BUTTON_TIP
protected static String CLIPBOARD_PASTE_BUTTON_TIP
protected static String CLIPBOARD_ERROR_MESSAGE
protected Frame parentFrame
protected ImageIcon image
protected JButton loadButton
protected JButton deleteBt
protected JButton twainBt
protected JButton pasteBt
protected JButton previewTwainBt
protected File lastPath
protected byte[] bytesImage
protected int iHigh
protected int imageWidth
protected boolean keepAspectRatio
protected boolean allowZoom
protected ImageIcon emptyImage
protected ActionListener deleteBtListener
protected ActionListener loadBtListener
protected boolean zoomListenerEnabled
public ImageDataField(Hashtable param)
param - the Hashtable parametersprotected void importImage(Image image)
protected void setButtonTips()
public void setResourceBundle(ResourceBundle res)
InternationalizationsetResourceBundle in interface InternationalizationsetResourceBundle in class DataFieldres - the new language bundle.public void init(Hashtable parameters)
init in interface FormComponentinit in class DataFieldparameters - the Hashtable with parameters. Adds the next
parameters:
| attribute | values | default | required | meaning |
| height | no | The preferred field height in pixels. Useful for specifying empty columns. | ||
| width | no | The preferred column width in pixels. Useful for specifying empty columns. | ||
| buttons | top/right/no | top | no | The position of buttons. With 'no' buttons will not be showed. |
| emptyimage | no | The relative path from classpath to load the empty image. | ||
| keepaspectratio | true/false | false | no | The image keeps its aspect ratio |
public Object getValue()
DataComponentgetValue in interface DataComponentBytesBlock instancepublic void setValue(Object value)
DataComponentsetValue in interface DataComponentvalue - the object with value to setprotected void update()
public boolean isEmpty()
DataComponentisEmpty in interface DataComponenttrue when component is emptypublic boolean isModifiable()
isModifiable in interface DataComponentisModifiable in class DataFieldtrue when component is modifiablepublic boolean isRequired()
DataFieldisRequired in interface DataComponentisRequired in class DataFieldpublic void setParentFrame(Frame frame)
OpenDialogsetParentFrame in interface OpenDialogframe - the framepublic void setEnabled(boolean enabled)
DataFieldsetEnabled in interface FormComponentsetEnabled in class DataFieldenabled - the condition to set enablepublic void deleteData()
DataComponentdeleteData in interface DataComponentprotected void finalize()
throws Throwable
public void free()
Freeablepublic int getSQLDataType()
DataComponentsql data type according to
java.sql.Types
getSQLDataType in interface DataComponentInteger typepublic ImageIcon getImage()
public ImageIcon getEmptyImage()
public void setZoomListenerEnabled(boolean enabled)
enabled - the enabled conditionpublic void uninstallDeleteButtonListener()
public void uninstallLoadButtonListener()
public JButton getDeleteButton()
public JButton getLoadButton()
public void setParentForm(Form f)
AccessFormsetParentForm in interface AccessFormsetParentForm in class DataFieldf - the form referencepublic void setVisibleButtons(boolean visible)
visible - the visibility conditionpublic static Image getImage(byte[] imageData, int width, int height, boolean allowZoom) throws IOException
IOExceptionpublic int getTemplateDataType()
ITemplateFieldITemplateField.DATA_TYPE_FIELD ITemplateField.DATA_TYPE_IMAGE
ITemplateField.DATA_TYPE_TABLEgetTemplateDataType in interface ITemplateFieldint with the data type.public Object getTemplateDataValue()
ITemplateFieldgetTemplateDataValue in interface ITemplateFieldCopyright © 2016 Imatia Innovation S.L.. All rights reserved.