com.nqadmin.swingSet
Class SSImage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.nqadmin.swingSet.SSImage
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class SSImage
extends javax.swing.JPanel

SSImage.java

SwingSet - Open Toolkit For Making Swing Controls Database-Aware

 Used to load, store, & display images stored in a database.

Version:
$Revision: 1.13 $
Author:
$Author: prasanth $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JButton btnUpdateImage
          Button to update the image.
protected  java.lang.String columnName
          SSRowSet column to which the component will be bound.
protected  javax.swing.ImageIcon img
          ImageIcon to store the image.
protected  javax.swing.JLabel lblImage
          Label to display the image
protected  java.awt.Dimension preferredSize
          The preferred size of the image component.
protected  SSRowSet sSRowSet
          SSRowSet from which component will get/set values.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SSImage()
          Construct a default SSImage Object.
SSImage(SSRowSet _sSRowSet, java.lang.String _columnName)
          Constructs a SSImage Object bound to the specified column in the specified sSRowSet.
 
Method Summary
protected  void addComponents()
          Adds the label and button to the panel
protected  void bind()
          Method for handling binding of component to a SSRowSet column.
 void bind(SSRowSet _sSRowSet, java.lang.String _columnName)
          Sets the SSRowSet and column name to which the component is to be bound.
 void clearImage()
          Removes the current image.
 java.lang.String getColumnName()
          Returns the SSRowSet column name to which the component is bound.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size of the image component.
 SSRowSet getSSRowSet()
          Returns the SSRowSet to which the component is bound.
protected  void init()
          Initialization code.
 void setColumnName(java.lang.String _columnName)
          Sets the SSRowSet column name to which the component is bound.
 void setPreferredSize(java.awt.Dimension _preferredSize)
          Sets the preferred size of the image component.
 void setSSRowSet(SSRowSet _sSRowSet)
          Sets the SSRowSet to which the component is bound.
protected  void updateDisplay()
          Updates the value displayed in the component based on the SSRowSet column binding.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, 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, 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, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

img

protected javax.swing.ImageIcon img
ImageIcon to store the image.


lblImage

protected javax.swing.JLabel lblImage
Label to display the image


btnUpdateImage

protected javax.swing.JButton btnUpdateImage
Button to update the image.


sSRowSet

protected SSRowSet sSRowSet
SSRowSet from which component will get/set values.


columnName

protected java.lang.String columnName
SSRowSet column to which the component will be bound.


preferredSize

protected java.awt.Dimension preferredSize
The preferred size of the image component.

Constructor Detail

SSImage

public SSImage()
Construct a default SSImage Object.


SSImage

public SSImage(SSRowSet _sSRowSet,
               java.lang.String _columnName)
Constructs a SSImage Object bound to the specified column in the specified sSRowSet.

Parameters:
_sSRowSet - - sSRowSet from/to which data has to be read/written
_columnName - - column in the sSRowSet to which the component should be bound.
Method Detail

setSSRowSet

public void setSSRowSet(SSRowSet _sSRowSet)
Sets the SSRowSet to which the component is bound.

Parameters:
_sSRowSet - SSRowSet to which the component is bound

getSSRowSet

public SSRowSet getSSRowSet()
Returns the SSRowSet to which the component is bound.

Returns:
SSRowSet to which the component is bound

setColumnName

public void setColumnName(java.lang.String _columnName)
Sets the SSRowSet column name to which the component is bound.

Parameters:
_columnName - column name in the SSRowSet to which the component is bound

getColumnName

public java.lang.String getColumnName()
Returns the SSRowSet column name to which the component is bound.

Returns:
column name to which the component is bound

setPreferredSize

public void setPreferredSize(java.awt.Dimension _preferredSize)
Sets the preferred size of the image component.

Overrides:
setPreferredSize in class javax.swing.JComponent
Parameters:
_preferredSize - - preferred size of the image component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size of the image component.

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
returns preferred size of the image component

clearImage

public void clearImage()
Removes the current image. The image is not removed from the underlying sSRowSet.


bind

public void bind(SSRowSet _sSRowSet,
                 java.lang.String _columnName)
Sets the SSRowSet and column name to which the component is to be bound.

Parameters:
_sSRowSet - datasource to be used.
_columnName - Name of the column to which this check box should be bound

init

protected void init()
Initialization code.


addComponents

protected void addComponents()
Adds the label and button to the panel


bind

protected void bind()
Method for handling binding of component to a SSRowSet column.


updateDisplay

protected void updateDisplay()
Updates the value displayed in the component based on the SSRowSet column binding.