ilog.views.maps.interactor
Class IlvSeeThroughInteractor

java.lang.Object
  extended by ilog.views.IlvManagerViewInteractor
      extended by ilog.views.maps.interactor.IlvSeeThroughInteractor
All Implemented Interfaces:
IlvPermanentInteractorInterface, Serializable

public class IlvSeeThroughInteractor
extends IlvManagerViewInteractor
implements IlvPermanentInteractorInterface

An interactor designed to show a part of a map independently from current layer visibility states. This way, user can interactively reveals layers beneath an opaque layer. With this interactor, the user drags a square on the the map that shows the layers registered for this interactor. You can configure the interactor by setting the list of layers to be shown and by setting the size of the area to be drawn. A IlvSeeThroughConfigurationPanel is provided as a default configuration tool to interactively select layers in a Swing GUI. Example of use :

 IlvManagerView view = getManagerView();
 IlvSeeThroughInteractor interactor = new IlvSeeThroughInteractor();
 interactor.addLayer(view.getManager().getManagerLayer(0));
 view.setInteractor(interactor);
 

Since:
JViews 8.1
See Also:
IlvSeeThroughConfigurationPanel, Serialized Form

Constructor Summary
IlvSeeThroughInteractor()
          Constructs and initializes a new instance of the IlvSeeThroughInteractor.
 
Method Summary
 void addLayer(IlvManagerLayer layer)
          Add a layer to the list of registered layers.
protected  void attach(IlvManagerView view)
          Called when the interactor is attached to the manager view.
protected  void detach()
          Called when the interactor is detached from the view.
protected  void drawSeeThrough(Graphics g)
          Draws the see through tool.
protected  IlvRect getDrawingRect()
          Returns the rectangle representing the area in which the layers are drawn.
 ArrayList getLayers()
          Retrieves the list of registered layers.
 int getSize()
          Retrieves the size of the revealed area.
protected  void handleExpose(Graphics g)
          Called by the view when the view is drawn, it actually calls the method that draws the see through tool using drawSeeThrough(java.awt.Graphics).
 boolean isIncludeRegisteredLayers()
          Tells if the registered layer list is included in the drawing or not.
 boolean isPermanent()
          Returns true if the interactor operates in permanent mode; false otherwise.
protected  void processMouseEvent(MouseEvent e)
          Processes the mouse events.
protected  void processMouseMotionEvent(MouseEvent e)
          Processes the mouse motion events.
 void removeLayer(IlvManagerLayer layer)
          Remove a layer from the list of registered layers.
 void setIncludeRegisteredLayers(boolean set)
          Tells the interactor if the list of registered layers are to be drawn or excluded from the drawing.
 void setLayers(ArrayList layers)
          Register a layer list for this interactor.
 void setPermanent(boolean set)
          Changes the mode of the interactor.
 void setSize(int size)
          Sets the size of the magnification area.
 
Methods inherited from class ilog.views.IlvManagerViewInteractor
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, isXORGhost, processEvent, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvSeeThroughInteractor

public IlvSeeThroughInteractor()
Constructs and initializes a new instance of the IlvSeeThroughInteractor. The size of the revealed area is set to 128 pixels.

Method Detail

attach

protected void attach(IlvManagerView view)
Called when the interactor is attached to the manager view.

Overrides:
attach in class IlvManagerViewInteractor
Parameters:
view - The manager view.
See Also:
IlvManagerViewInteractor.detach()

detach

protected void detach()
Called when the interactor is detached from the view.

Overrides:
detach in class IlvManagerViewInteractor
See Also:
IlvManagerViewInteractor.attach(ilog.views.IlvManagerView)

processMouseEvent

protected void processMouseEvent(MouseEvent e)
Processes the mouse events. The see through tool appears when a mouse button is pressed. It is removed when a mouse button is released.

Overrides:
processMouseEvent in class IlvManagerViewInteractor
Parameters:
e - The mouse event.
See Also:
IlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent e)
Processes the mouse motion events. When the mouse is dragged, the see through tool is moved over the view.

Overrides:
processMouseMotionEvent in class IlvManagerViewInteractor
Parameters:
e - The mouse motion event.
See Also:
IlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)

setSize

public final void setSize(int size)
Sets the size of the magnification area.

Parameters:
size - The size to be set, in view coordinate values.
See Also:
getSize()

drawSeeThrough

protected void drawSeeThrough(Graphics g)
Draws the see through tool. If you redefine this method to add additional drawings, you must also redefine the getDrawingRect() method to return a rectangle containing the additional drawings.

Parameters:
g - The view graphics.

handleExpose

protected void handleExpose(Graphics g)
Called by the view when the view is drawn, it actually calls the method that draws the see through tool using drawSeeThrough(java.awt.Graphics).

Overrides:
handleExpose in class IlvManagerViewInteractor
Parameters:
g - The view graphics.
See Also:
IlvManagerViewInteractor.drawGhost(java.awt.Graphics), IlvManagerViewInteractor.isXORGhost(), IlvManagerView.getDefaultXORColor()

getDrawingRect

protected IlvRect getDrawingRect()
Returns the rectangle representing the area in which the layers are drawn.

Returns:
the layers area.

isPermanent

public boolean isPermanent()
Returns true if the interactor operates in permanent mode; false otherwise.

Specified by:
isPermanent in interface IlvPermanentInteractorInterface

setPermanent

public void setPermanent(boolean set)
Changes the mode of the interactor.

Specified by:
setPermanent in interface IlvPermanentInteractorInterface
Parameters:
set - the new mode.

setLayers

public void setLayers(ArrayList layers)
Register a layer list for this interactor. This layer list can be included or excluded for drawing, following the value returned by isIncludeRegisteredLayers

Parameters:
layers - The list of IlvManagerLayers to register.
See Also:
isIncludeRegisteredLayers(), setIncludeRegisteredLayers(boolean)

addLayer

public void addLayer(IlvManagerLayer layer)
Add a layer to the list of registered layers.

Parameters:
layer - The IlvManagerLayer to add.

removeLayer

public void removeLayer(IlvManagerLayer layer)
Remove a layer from the list of registered layers.

Parameters:
layer - The IlvManagerLayer to remove.

getLayers

public ArrayList getLayers()
Retrieves the list of registered layers.

Returns:
An ArrayList containing registered IlvManagerLayer

getSize

public int getSize()
Retrieves the size of the revealed area.

Returns:
The size, in pixels, of the revealed area.

isIncludeRegisteredLayers

public boolean isIncludeRegisteredLayers()
Tells if the registered layer list is included in the drawing or not.

Returns:
true if the layers are included, false otherwise.

setIncludeRegisteredLayers

public void setIncludeRegisteredLayers(boolean set)
Tells the interactor if the list of registered layers are to be drawn or excluded from the drawing.

Parameters:
set - pass true to include the layers, false to exclude them.


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