ilog.views.maps.grids
Class IlvDelayedDecoration

java.lang.Object
  extended by ilog.views.IlvIndexedSet
      extended by ilog.views.IlvManagerLayer
          extended by ilog.views.maps.grids.IlvDelayedDecoration
All Implemented Interfaces:
IlvManagerViewDecoration, IlvPersistentObject, ActionListener, Serializable, EventListener

public class IlvDelayedDecoration
extends IlvManagerLayer
implements IlvManagerViewDecoration, ActionListener

This decoration and layer class is used to delay the painting of another delegate decoration/layer (possibly one that takes a long time to paint). By default, painting the view triggers the painting of all decorations.
Using the IlvDelayedDecoration, painting is not done immediately, but after a short delay. During this delay, the user can still, for example, pan or scroll the view, which resets the delay.
However, if the delegate decoration is a subclass of IlvManagerLightViewDecoration, the "paintLight" will be called immediately. IlvDelayedDecoration delayed decoration can either be used as an IlvManagerLayer or an IlvManagerViewDecoration.

Since:
JViews 7.5
See Also:
Serialized Form

Constructor Summary
IlvDelayedDecoration(IlvInputStream stream)
          Constructs a decoration from serialized data.
IlvDelayedDecoration(int refreshDelay)
          Creates a delayed decoration.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Repaints the view when the timer has expired, indicating the delegate decoration to redraw.
 void draw(Graphics dst, IlvManagerView v)
          Draws the layer in a view of a manager.
 IlvManagerViewDecoration getDecoration()
          Returns the delegate decoration to repaint.
 int getRefreshDelay()
          Returns the timer refresh delay.
 void paint(Graphics dst, IlvManagerView view)
          Paints this decoration.
 void print(Graphics dst, IlvRect area, IlvTransformer t)
          Prints the layer with a specified transformer.
 void setDecoration(IlvManagerViewDecoration decoration)
          Sets the delegate decoration.
 void setRefreshDelay(int refreshDelay)
          Sets the timer refresh delay.
 void write(IlvOutputStream stream)
          Writes the layer to an output stream.
 
Methods inherited from class ilog.views.IlvManagerLayer
addVisibilityFilter, computeBBox, drawImpl, getAlpha, getIndex, getManager, getName, getNamedProperty, getProperty, getVisibilityFilters, isSelectable, isTemporarilyHidden, isVisible, isVisible, removeNamedProperty, removeVisibilityFilter, setAlpha, setManager, setName, setNamedProperty, setProperty, writeIt
 
Methods inherited from class ilog.views.IlvIndexedSet
addObject, afterUpdate, beforeUpdate, collectObjects, deleteAll, getCardinal, getElements, getIndex, getManagers, getManagersCount, getObject, getObject, getSubsequentRemoveThreshold, isQuadtreeEnabled, map, mapInside, mapInside, mapIntersects, mapIntersects, removeObject, setIndex, setQuadtreeEnabled, setSubsequentRemoveThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvDelayedDecoration

public IlvDelayedDecoration(int refreshDelay)
Creates a delayed decoration.

Parameters:
refreshDelay -

IlvDelayedDecoration

public IlvDelayedDecoration(IlvInputStream stream)
                     throws IlvReadFileException
Constructs a decoration from serialized data.

Parameters:
stream - stream to read from.
Throws:
IlvReadFileException
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the layer to an output stream.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvManagerLayer
Parameters:
stream - stream to write into.
Throws:
IOException

actionPerformed

public void actionPerformed(ActionEvent e)
Repaints the view when the timer has expired, indicating the delegate decoration to redraw.

Specified by:
actionPerformed in interface ActionListener
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

getDecoration

public IlvManagerViewDecoration getDecoration()
Returns the delegate decoration to repaint.

Returns:
The delegate decoration.

getRefreshDelay

public int getRefreshDelay()
Returns the timer refresh delay.

Returns:
The timer refresh delay.

paint

public void paint(Graphics dst,
                  IlvManagerView view)
Paints this decoration. This either resets/starts the timer or draws the decoration (if already in a timer trigger).

Specified by:
paint in interface IlvManagerViewDecoration
Parameters:
dst - The Graphics to paint to.
view - The manager view.
See Also:
IlvManagerViewDecoration.paint(java.awt.Graphics, ilog.views.IlvManagerView)

draw

public void draw(Graphics dst,
                 IlvManagerView v)
Draws the layer in a view of a manager.

Overrides:
draw in class IlvManagerLayer
Parameters:
dst - The Graphics to draw.
v - The view of the manager.
See Also:
IlvManagerView.setLayerCached(int, boolean)

print

public void print(Graphics dst,
                  IlvRect area,
                  IlvTransformer t)
Prints the layer with a specified transformer.

Overrides:
print in class IlvManagerLayer
Parameters:
dst - The graphics.
area - The rectangle of the layer to print in the manager coordinate system.
t - The transformer used to print the content.

setDecoration

public void setDecoration(IlvManagerViewDecoration decoration)
Sets the delegate decoration.

Parameters:
decoration - The decoration to be painted..

setRefreshDelay

public void setRefreshDelay(int refreshDelay)
Sets the timer refresh delay.

Parameters:
refreshDelay - The timer refresh delay.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.