|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvManagerViewInteractor
ilog.views.interactor.IlvMagnifyInteractor
public class IlvMagnifyInteractor
An interactor designed to magnify a part of the view by dragging the mouse
over it. It acts as a magnifying glass moved over the view.
The area of magnification can be a rectangle when the mode is set to
RECTANGULAR or a circle when the mode is set to CIRCULAR
or LENS.
This interactor can be directly used on an IlvManagerView (waiting
for the user to press a mouse button) or
it can be used inside another interactor. For example, if you want to
show the magnifier when pressing the mouse down with the Alt key as modifier
during the work of the IlvSelectInteractor you can subclass this
interactor to do the following:
public MagSelectInteractor extends IlvSelectInteractor
{
IlvMagnifyInteractor inter = null;
protected void processMouseEvent(MouseEvent e)
{
if (e.getID() == MouseEvent.MOUSE_PRESSED && e.isAltDown()) {
if (!dispatchToSelection(e)) {
if (inter == null) {
inter = new IlvMagnifyInteractor() ;
inter.setFactor(2.5f);
}
getManagerView().pushInteractor(inter, e);
}
} else
super.processMouseEvent(e);
}
}
Notice that the LENS mode may consume a large amount of memory if the magnification factor is high and the size of the magnification area is large. In LENS mode, the amount of memory is quadratic proportional to the magnification factor and to the size. RECTANGULAR and CIRCULAR mode use less memory since the amount of memory is only proportional to the size but not influenced by the magnification factor.
setMode(short),
IlvManagerView.pushInteractor(ilog.views.IlvManagerViewInteractor, java.awt.AWTEvent),
Serialized Form| Field Summary | |
|---|---|
static short |
CIRCULAR
The area of magnification is a regular circle. |
static short |
LENS
The area of magnification is a circle which preserves the continuity between the magnification area and the view. |
static short |
RECTANGULAR
The area of magnification is a rectangle. |
| Constructor Summary | |
|---|---|
IlvMagnifyInteractor()
Constructs and initializes a new instance of the IlvMagnifyInteractor. |
|
| Method Summary | |
|---|---|
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 |
drawMagnifier(Graphics g)
Draws the magnifier. |
protected IlvRect |
getDrawingRect()
Returns a copy of the rectangle representing the area in which the magnifier is drawn. |
float |
getFactor()
Returns the magnification factor used by the interactor. |
short |
getMode()
Returns the mode used to draw the magnification area. |
int |
getSize()
Returns the size of the magnification area in manager view coordinates. |
protected void |
handleExpose(Graphics g)
Called by the view when the view is drawn,;it actually calls the method that draws the magnifier using drawMagnifier(java.awt.Graphics). |
boolean |
isPermanent()
Returns false if the interactor will be removed from the
view once the object was created. |
protected void |
processMouseEvent(MouseEvent e)
Processes the mouse events. |
protected void |
processMouseMotionEvent(MouseEvent e)
Processes the mouse motion events. |
void |
setFactor(float factor)
Sets the magnification factor used by the interactor. |
void |
setMode(short mode)
Sets the mode used to draw the magnification area. |
void |
setPermanent(boolean permanent)
Allows you to specify if the interactor will or will not be removed from the view once the object is created. |
void |
setSize(int size)
Sets the size of the magnification area. |
protected void |
update()
Called by handleExpose(Graphics) when it becomes necessary to update the magnified view. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final short RECTANGULAR

setMode(short),
Constant Field Valuespublic static final short CIRCULAR

setMode(short),
Constant Field Valuespublic static final short LENS

setMode(short),
Constant Field Values| Constructor Detail |
|---|
public IlvMagnifyInteractor()
IlvMagnifyInteractor.
| Method Detail |
|---|
protected void attach(IlvManagerView view)
attach in class IlvManagerViewInteractorview - The manager view.IlvManagerViewInteractor.detach()protected void detach()
detach in class IlvManagerViewInteractorIlvManagerViewInteractor.attach(ilog.views.IlvManagerView)public final void setSize(int size)
size - The size to be set, in manager view coordinate values.getSize()public final int getSize()
128.
setSize(int)public final void setMode(short mode)
Notice that the LENS mode may consume a large amount of memory if the magnification factor is high and the size is large. In LENS mode, the amount of memory is quadratic proportional to the magnification factor and to the size. RECTANGULAR and CIRCULAR mode use less memory since the amount of memory is only proportional to the size but not influenced by the magnification factor.
mode - The magnification mode: RECTANGULAR (the default),
CIRCULAR, or LENS.RECTANGULAR,
CIRCULAR,
LENS,
getMode()public final short getMode()
setMode(short)public final void setFactor(float factor)
1 and smaller or equal to
4.
factor - The magnification factor as a value from 1
through 4.getFactor()public final float getFactor()
setFactor(float)protected void processMouseEvent(MouseEvent e)
processMouseEvent in class IlvManagerViewInteractore - The mouse event.IlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)protected void processMouseMotionEvent(MouseEvent e)
processMouseMotionEvent in class IlvManagerViewInteractore - The mouse motion event.IlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)protected void handleExpose(Graphics g)
drawMagnifier(java.awt.Graphics).
handleExpose in class IlvManagerViewInteractorg - The view graphics.IlvManagerViewInteractor.drawGhost(java.awt.Graphics),
IlvManagerViewInteractor.isXORGhost(),
IlvManagerView.getDefaultXORColor()protected void update()
handleExpose(Graphics) when it becomes necessary to update the magnified view.
protected IlvRect getDrawingRect()
protected void drawMagnifier(Graphics g)
getDrawingRect() method to return a rectangle containing
the additional drawings.
g - The view graphics.public final boolean isPermanent()
false if the interactor will be removed from the
view once the object was created.
The default value is false.
isPermanent in interface IlvPermanentInteractorInterfacepublic final void setPermanent(boolean permanent)
false.
setPermanent in interface IlvPermanentInteractorInterfacepermanent - If true the interactor will be removed,
otherwise not.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||