com.miginfocom.calendar.header
Class AbstractGridHeader

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.miginfocom.calendar.header.AbstractGridHeader
All Implemented Interfaces:
InteractionListener, GridContainer, Header, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.swing.Scrollable
Direct Known Subclasses:
DateGridHeader, SubRowGridHeader

public abstract class AbstractGridHeader
extends javax.swing.JComponent
implements Header, java.beans.PropertyChangeListener, GridContainer, InteractionListener, javax.swing.Scrollable

Boiler plate implementation for a Header that is a JComponent. Takes care of the action listener handling and returns a JScrollPane as the component to use.

This class is itself a JComponent which bounds is automatically laid out to match the tracked component in the tracked dimension. Subclasses is responsible for returning a size (fixed) to use in the other, secondary, dimension.

This component works much like a mini-dateArea.

Note that the actual paiting is done by Decorators.

All decorators will be notified of all events by a call to Decorator.processEvent(java.awt.AWTEvent) in the overridded processEvent(java.awt.AWTEvent).

By default mouse, mouse motion and key events are enabled and will be sent to the decorators. (and processEvent(java.awt.AWTEvent))

See Also:
addDecorator(com.miginfocom.calendar.decorators.GridDecorator), getComponent(), setCacheWithBackBuffer(boolean), 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.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  DecoratorSupport decoratorSupport
          A number of decorators, normally only one or two.
protected static int HOR
           
protected static int VER
           
 
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
protected AbstractGridHeader(GridContainer gridContainer, javax.swing.JComponent trackedComponent, int edge)
          Constructor.
 
Method Summary
 void addDecorator(GridDecorator decorator)
          Adds a decorator to the current contained grid and to any recreated grids in the tracked dateArea.
A manual repaint has to be issued to paint the decorator.
 void addDecorators(java.util.Collection decorators)
          Calls addDecorator(com.miginfocom.calendar.decorators.GridDecorator) for every element in the collection.
 void addGridListener(java.beans.PropertyChangeListener l)
          Adds a listener that gets notified when the grid is changed or any other "major" change occurs.
 void addGridListener(java.beans.PropertyChangeListener l, boolean asWeakRef)
          Adds a listener that gets notified when the grid is changed or any other "major" change occurs.
 void addInteractionListener(InteractionListener l)
          Adds a listener that listens to InteractionEvents.
 void addInteractionListener(InteractionListener l, boolean asWeakRef)
          Adds a listener that listens to InteractionEvents.
 void addNotify()
           
 void clearBackBuffer()
          If a back buffer is being used to cache the graphics contents of the header (for speed) it can be cleared with this method.
 void doLayout()
           
protected  void fireInteractionOccured(InteractionEvent e)
          Notifies all listeners of the the event.
protected  boolean fireStructureChanged(java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue)
          Fires a structurat change event to the listeners
 java.awt.Paint getBackgroundPaint()
           
 javax.swing.JComponent getComponent()
          Returns this
 Decorator getDecorator(java.lang.Class type, boolean inclSubClasses)
          Returnes the first decorator found with the class type type, including sub types id inclSubClasses == true.
 java.util.List getDecorators()
          Returns a cloned list with the decorators currently installed.
 int getEdge()
          Returns what edge (E.g.
 Grid getGrid()
          Returns the grid that this header uses for layout
abstract  HeaderGrid getHeaderGrid()
          Returns the grid that this header uses for layout
 java.awt.Dimension getMaximumSize()
           
 java.awt.Dimension getMinimumSize()
           
 java.awt.Dimension getPreferredScrollableViewportSize()
           
 int getPreferredSecondarySize()
          Returns the preferred size in the non-tracked dimension.
 java.awt.Dimension getPreferredSize()
           
 int getPrimaryDimension()
          Returns the primary dimension for this header.
 int getPrimaryInsets()
          Returns secondary dimension insests added (e.g.
 int getPrimDim()
          Deprecated. Use getPrimaryDimension() instead.
 int getScrollableBlockIncrement(java.awt.Rectangle vis, int ori, int dir)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(java.awt.Rectangle vis, int ori, int dir)
           
 javax.swing.JScrollPane getScrollPane()
          Returns the scroll pane that host the header.
 int getSecondaryInsets()
          Returns secondary dimension insests added (e.g.
 javax.swing.JComponent getTrackedComponent()
          returns the component that this header is a header for.
 java.lang.Boolean getUseStartDate()
          If the start or end date in the decorated cells' should be used.
 void interactionOccured(InteractionEvent e)
          Called when an interaction has occurred-
 boolean isBeforeGrid()
          Returns if the the header is visually "before" the tracked grid cells (TOP & LEFT) or after (BOTTOM & RIGHT)
 boolean isCacheWithBackBuffer()
          Return if a back buffered is being uesed to cache the contents of the header.
 void paint(java.awt.Graphics g)
           
protected  void paintComponent(java.awt.Graphics g)
          Paints the decorators
 void print(java.awt.Graphics g)
           
protected  void processEvent(java.awt.AWTEvent e)
           
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void removeDecorator(GridDecorator decorator)
          Removes a decorator from the current contained grid and to any recreated grids in the tracked dateArea.
A manual repaint has to be issued to paint the decorator.
 void removeDecorators()
          Removes all decorators
 void removeDecorators(java.util.Collection decorators)
          Removes all decorators
 void removeGridListener(java.beans.PropertyChangeListener l)
          Removes the listener, if it is in the list.
 void removeInteractionListener(InteractionListener l)
          Removes the listener.
 void removeNotify()
           
 void setBackground(java.awt.Color bg)
          Propagate the background to the mandatory scroll pane.
 void setBackgroundPaint(java.awt.Paint p)
           
 void setCacheWithBackBuffer(boolean cacheWithBackBuffer)
          Sets if a back buffered is being uesed to cache the contents of the header.
protected  void setGridBoundsAndLayout(HeaderGrid grid)
          Sets the size and grid offset for this header.
 void setPreferredSecondarySize(java.lang.Integer size)
          Set the secondary dimension's preferred size.
 void setUseStartDate(java.lang.Boolean b)
          If the start or end date in the decorated cells' should be used.
 boolean shouldUseStartDate()
          If the start date rather than the end date of the decorated cells should be used if decorating text.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, 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, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, 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
 
Methods inherited from interface com.miginfocom.calendar.header.Header
dispose
 

Field Detail

VER

protected static final int VER
See Also:
Constant Field Values

HOR

protected static final int HOR
See Also:
Constant Field Values

decoratorSupport

protected final DecoratorSupport decoratorSupport
A number of decorators, normally only one or two. Maintains insertion order.

Constructor Detail

AbstractGridHeader

protected AbstractGridHeader(GridContainer gridContainer,
                             javax.swing.JComponent trackedComponent,
                             int edge)
Constructor.

Parameters:
trackedComponent - The component that this header is a header for. When this component is added to the component herarchy it registers itself with the tracked component and when this is removed from the component hierarchy this header will unregister itself with that same component. This shuld make for an automatic disposal without memory leaks.
Method Detail

addNotify

public void addNotify()
Overrides:
addNotify in class javax.swing.JComponent

removeNotify

public void removeNotify()
Overrides:
removeNotify in class javax.swing.JComponent

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class javax.swing.JComponent

paintComponent

protected void paintComponent(java.awt.Graphics g)
Paints the decorators

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - The object to draw in

setBackground

public void setBackground(java.awt.Color bg)
Propagate the background to the mandatory scroll pane.

Overrides:
setBackground in class javax.swing.JComponent
Parameters:
bg - The new background.

setBackgroundPaint

public void setBackgroundPaint(java.awt.Paint p)

getBackgroundPaint

public java.awt.Paint getBackgroundPaint()

print

public void print(java.awt.Graphics g)
Overrides:
print in class javax.swing.JComponent

getPrimDim

public int getPrimDim()
Deprecated. Use getPrimaryDimension() instead.

Returns the primary dimension for this header. (long dimension). E.g. SwingConstants.HORIZONTAL

Returns:
The primary dimension for this header.

getPrimaryDimension

public int getPrimaryDimension()
Returns the primary dimension for this header. (long dimension). E.g. SwingConstants.HORIZONTAL

Returns:
The primary dimension for this header.

getEdge

public int getEdge()
Returns what edge (E.g. SwingConstants.(TOP | LEFT | BOTTOM | RIGHT) the header will reside. Note that the actual placement of this component is not done by this component, that is done by a layout manager of the parent. This value is for interpreting the date ranges in the cell rows.

Returns:
The edge.

shouldUseStartDate

public boolean shouldUseStartDate()
If the start date rather than the end date of the decorated cells should be used if decorating text.

Returns:
If the start date rather than the end date of the decorated cells should be used if decorating text.
See Also:
getUseStartDate()

getUseStartDate

public java.lang.Boolean getUseStartDate()
If the start or end date in the decorated cells' should be used. If null the start date is used if the header is top/left and end date if bottom/right. You can use this property to force either way.

Returns:
The current state. May be null.
See Also:
shouldUseStartDate()

setUseStartDate

public void setUseStartDate(java.lang.Boolean b)
If the start or end date in the decorated cells' should be used. If null the start date if used if the header is top/left and end date if bottom/right. You can use this property to force either way.

Parameters:
b - The new state. null is default.

isBeforeGrid

public boolean isBeforeGrid()
Returns if the the header is visually "before" the tracked grid cells (TOP & LEFT) or after (BOTTOM & RIGHT)

Returns:
If the the header is visually "before" the tracked grid cells (TOP & LEFT) or after (BOTTOM & RIGHT)

processEvent

protected void processEvent(java.awt.AWTEvent e)
Overrides:
processEvent in class java.awt.Container

clearBackBuffer

public void clearBackBuffer()
If a back buffer is being used to cache the graphics contents of the header (for speed) it can be cleared with this method. That will force it to be repainted next repaint cycle. This can for instance be done when mouse enteres or moves/drags on the header if mouse over effects for it is beeing used. The back buffer might be turned off all together for these kind of headers but that would make it repaint slower. Note that the back buffer will always be recreated when the header is changing size.


isCacheWithBackBuffer

public boolean isCacheWithBackBuffer()
Return if a back buffered is being uesed to cache the contents of the header.

Returns:
true if so. false is default.
See Also:
setCacheWithBackBuffer(boolean)

setCacheWithBackBuffer

public void setCacheWithBackBuffer(boolean cacheWithBackBuffer)
Sets if a back buffered is being uesed to cache the contents of the header. This can increase speed for re-redrawing the header by a factor of 100. Should be turned on for static (no changing) headers and might be used for dynamic headers (e.g. with mouse over effects). If to be used with dynamic headers see clearBackBuffer() which will probably have to be called for every mouse event or the effects will not appear.

Parameters:
cacheWithBackBuffer - true turns it on. false is default.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

getMaximumSize

public java.awt.Dimension getMaximumSize()
Overrides:
getMaximumSize in class javax.swing.JComponent

getTrackedComponent

public javax.swing.JComponent getTrackedComponent()
returns the component that this header is a header for.

Returns:
The component that this header is a header for.

getPreferredSecondarySize

public int getPreferredSecondarySize()
Returns the preferred size in the non-tracked dimension.

Returns:
The preferred size in the non-tracked dimension.

setPreferredSecondarySize

public void setPreferredSecondarySize(java.lang.Integer size)
Set the secondary dimension's preferred size. If null the grid's size will be used.

Parameters:
size - The size. May be null

getSecondaryInsets

public int getSecondaryInsets()
Returns secondary dimension insests added (e.g. top + bottom or left + right)

Returns:
Secondary dimension insests added (e.g. top + bottom or left + right)

getPrimaryInsets

public int getPrimaryInsets()
Returns secondary dimension insests added (e.g. top + bottom or left + right)

Returns:
Secondary dimension insests added (e.g. top + bottom or left + right)

getGrid

public Grid getGrid()
Returns the grid that this header uses for layout

Specified by:
getGrid in interface GridContainer
Returns:
The grid that this header uses for layout

getHeaderGrid

public abstract HeaderGrid getHeaderGrid()
Returns the grid that this header uses for layout

Returns:
The grid that this header uses for layout

getComponent

public javax.swing.JComponent getComponent()
Returns this

Specified by:
getComponent in interface Header
Returns:
this

getScrollPane

public javax.swing.JScrollPane getScrollPane()
Description copied from interface: Header
Returns the scroll pane that host the header.

Specified by:
getScrollPane in interface Header
Returns:
he scroll pane that host the header.

doLayout

public void doLayout()
Overrides:
doLayout in class java.awt.Container

setGridBoundsAndLayout

protected void setGridBoundsAndLayout(HeaderGrid grid)
Sets the size and grid offset for this header.


getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface javax.swing.Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface javax.swing.Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(java.awt.Rectangle vis,
                                       int ori,
                                       int dir)
Specified by:
getScrollableBlockIncrement in interface javax.swing.Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(java.awt.Rectangle vis,
                                      int ori,
                                      int dir)
Specified by:
getScrollableUnitIncrement in interface javax.swing.Scrollable

addDecorators

public void addDecorators(java.util.Collection decorators)
Calls addDecorator(com.miginfocom.calendar.decorators.GridDecorator) for every element in the collection.

Parameters:
decorators - The decorators. Not null.
See Also:
DecoratorSupport.addDecorators(java.util.Collection)

addDecorator

public void addDecorator(GridDecorator decorator)
Adds a decorator to the current contained grid and to any recreated grids in the tracked dateArea.
A manual repaint has to be issued to paint the decorator.

Parameters:
decorator - The decorator. Insertion order is maintained and decorations will be painted in this order.
See Also:
DecoratorSupport.addDecorator(com.miginfocom.calendar.decorators.Decorator)

removeDecorator

public void removeDecorator(GridDecorator decorator)
Removes a decorator from the current contained grid and to any recreated grids in the tracked dateArea.
A manual repaint has to be issued to paint the decorator.

Parameters:
decorator - The decorator to be removed.
See Also:
DecoratorSupport.removeDecorator(com.miginfocom.calendar.decorators.Decorator)

removeDecorators

public void removeDecorators()
Removes all decorators

See Also:
DecoratorSupport.removeDecorators(java.util.Collection)

removeDecorators

public void removeDecorators(java.util.Collection decorators)
Removes all decorators


getDecorators

public java.util.List getDecorators()
Returns a cloned list with the decorators currently installed.

Returns:
The decorators. Not null.

getDecorator

public Decorator getDecorator(java.lang.Class type,
                              boolean inclSubClasses)
Returnes the first decorator found with the class type type, including sub types id inclSubClasses == true.

Parameters:
type - The type. Not null.
inclSubClasses - If sub classes of type should be removed as well.
Returns:
If a decorator was removed.

addInteractionListener

public void addInteractionListener(InteractionListener l)
Adds a listener that listens to InteractionEvents. Interaction events are normally fired by the Interaction/Interactor/AbstractInteractionBroker framework, used for instance by the AShape framework.
This class is actually a re-dispatcher of these events. It is itself an InteractionListener and registers itself on the interaction observable objects it creates. For instance ActivityViews.

Parameters:
l - The listener to add

addInteractionListener

public void addInteractionListener(InteractionListener l,
                                   boolean asWeakRef)
Adds a listener that listens to InteractionEvents. Interaction events are normally fired by the Interaction/Interactor/AbstractInteractionBroker framework, used for instance by the AShape framework.

Parameters:
l - The listener to add
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.
Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.

removeInteractionListener

public void removeInteractionListener(InteractionListener l)
Removes the listener.

Parameters:
l - The listener to remove.

fireInteractionOccured

protected void fireInteractionOccured(InteractionEvent e)
Notifies all listeners of the the event.


interactionOccured

public void interactionOccured(InteractionEvent e)
Description copied from interface: InteractionListener
Called when an interaction has occurred-

Yes, embarrassing as it is, we are aware that occurred it is spelled wrong.

Specified by:
interactionOccured in interface InteractionListener
Parameters:
e - The event

addGridListener

public void addGridListener(java.beans.PropertyChangeListener l)
Description copied from interface: GridContainer
Adds a listener that gets notified when the grid is changed or any other "major" change occurs.

Specified by:
addGridListener in interface GridContainer
Parameters:
l - The listener. Not null

addGridListener

public void addGridListener(java.beans.PropertyChangeListener l,
                            boolean asWeakRef)
Description copied from interface: GridContainer
Adds a listener that gets notified when the grid is changed or any other "major" change occurs.

Specified by:
addGridListener in interface GridContainer
Parameters:
l - The listener. Not null
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.
Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.

removeGridListener

public void removeGridListener(java.beans.PropertyChangeListener l)
Description copied from interface: GridContainer
Removes the listener, if it is in the list.

Specified by:
removeGridListener in interface GridContainer
Parameters:
l - The listener to remove, not null.

fireStructureChanged

protected boolean fireStructureChanged(java.lang.String propName,
                                       java.lang.Object oldValue,
                                       java.lang.Object newValue)
Fires a structurat change event to the listeners

Returns:
If there was any listeners registered.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.