LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.table
Class LyJTableStatusColumn

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 leon.view.win.swing.table.LyJTableStatusColumn
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.LayoutManager, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.TableModelListener

public class LyJTableStatusColumn
extends javax.swing.JPanel
implements java.awt.LayoutManager, javax.swing.event.TableModelListener, java.awt.event.ActionListener

This class implements a column of cells that can display an image. There is a cell for each row of its associated LyTableComp. This column is displayed at the left side of the parent table. It doesn't move with the horizontal scrollbar.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static java.lang.String __version
           
static int HEIGHT
          The minimum height of a cell.
static int TIP_MAX_CHARS
          The maximum width of a line in a tooltip.
static int WIDTH
          The width of a cell.
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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, PROPERTIES, SOMEBITS
 
Constructor Summary
LyJTableStatusColumn(javax.swing.JTable table, java.awt.Font font, java.awt.Color color)
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Retrieves the id of cell that emits the action listener and send event to controller.
 void addLayoutComponent(java.lang.String constraint, java.awt.Component comp)
          Called when a component has been added to this container.
 java.awt.Component createStatusColumnCell(java.awt.Image image, java.lang.String tooltip)
          Creates a component to display in a cell.
 java.awt.Component getFooter()
          Gets the component used as footer for this column.
 LyJTableStatusHeader getHeader()
          Gets the component used as header for this column.
 void layoutContainer(java.awt.Container parent)
          Called when an update of the layout is needed.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Calculates the minimum size dimensions for the specified container, given the components it contains.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Calculates the preferred size dimensions for the specified container, given the components it contains.
 void removeLayoutComponent(java.awt.Component comp)
          Called when a component has been removed from this container.
 void setEnabled(boolean enabled)
           
 void setHasImage()
          Indicates that the status column has at least one image.
 void tableChanged(javax.swing.event.TableModelEvent e)
          Called when the model of the parent table has changed.
 void update(int row)
          Update the image to display in the row.
 void updateContent()
          ReFill columns.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__version

public static final java.lang.String __version
See Also:
Constant Field Values

WIDTH

public static final int WIDTH
The width of a cell.

See Also:
Constant Field Values

HEIGHT

public static final int HEIGHT
The minimum height of a cell.

See Also:
Constant Field Values

TIP_MAX_CHARS

public static int TIP_MAX_CHARS
The maximum width of a line in a tooltip.

Constructor Detail

LyJTableStatusColumn

public LyJTableStatusColumn(javax.swing.JTable table,
                            java.awt.Font font,
                            java.awt.Color color)
Constructor. Calls the super implementation and initializes table font, background color table component, model, layout. Then it updates the content and add a mouse listener on the table.

Parameters:
table - the parent table of this column
font - the table font
color - the table background color
Method Detail

updateContent

public void updateContent()
ReFill columns.


setHasImage

public void setHasImage()
Indicates that the status column has at least one image.


update

public void update(int row)
Update the image to display in the row.

Parameters:
row - the number of the row to update

createStatusColumnCell

public java.awt.Component createStatusColumnCell(java.awt.Image image,
                                                 java.lang.String tooltip)
Creates a component to display in a cell.

Parameters:
image - the image to display in this cell
tooltip - the tooltip to display in the cell
Returns:
the created component

getHeader

public LyJTableStatusHeader getHeader()
Gets the component used as header for this column.

Returns:
the header

getFooter

public java.awt.Component getFooter()
Gets the component used as footer for this column.

Returns:
the footer

layoutContainer

public void layoutContainer(java.awt.Container parent)
Called when an update of the layout is needed. Calculates the minimum size dimensions for the specified container, given the components it contains.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
preferredLayoutSize(Container)

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Calculates the minimum size dimensions for the specified container, given the components it contains.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
Returns:
the minimum size of this container.
See Also:
preferredLayoutSize(Container)

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Calculates the preferred size dimensions for the specified container, given the components it contains.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the container to be laid out
Returns:
the preferred size of this container.
See Also:
minimumLayoutSize(java.awt.Container)

addLayoutComponent

public void addLayoutComponent(java.lang.String constraint,
                               java.awt.Component comp)
Called when a component has been added to this container.
This method does nothing.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Called when a component has been removed from this container.
This method does nothing.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class javax.swing.JComponent

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
Called when the model of the parent table has changed.
This fine grain notification tells listeners the exact range of cells, rows, or columns that changed.

Specified by:
tableChanged in interface javax.swing.event.TableModelListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Retrieves the id of cell that emits the action listener and send event to controller.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com