|
||||||||||
| 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.IlvManagerMagViewInteractor
public class IlvManagerMagViewInteractor
An interactor that controls the visible area of a view by using a movable rectangle in another view. This interactor is used when you want to create an overview window. The overview window shows the entire contents of a manager while the main window shows only a part of the manager. When the interactor is set on the overview window, the rectangle drawn by the interactor shows the visible area of the manager in the main window. It changes the visible area of the main window when the rectangle in the overview window is moved. The view controlled by the interactor is called the target view. The rectangle drawn on the overview window can be drawn in several ways. It can be a filled rectangle or an empty rectangle. The autozoom and autotranslate modes will allow the overview to be automatically zoomed or translated to follow the display in the main window.
| Field Summary | |
|---|---|
static int |
Filled
The Filled drawing style |
static int |
Wire
The Wire drawing style |
| Constructor Summary | |
|---|---|
IlvManagerMagViewInteractor()
Creates the interactor. |
|
IlvManagerMagViewInteractor(IlvManagerView target,
boolean boundedByView)
Creates the interactor. |
|
| Method Summary | |
|---|---|
void |
adjustGhost()
Adjusts the ghost rectangle. |
void |
adjustView(IlvRect rect)
Adjusts the visible area of the target view according to the specified control rectangle. |
protected void |
attach(IlvManagerView v)
This method is called when the interactor is attached to the manager view. |
protected void |
detach()
This method is called when the interactor is detached from the view. |
void |
drawGhost(Graphics g)
Draws the rectangle showing the visible area of the target view. |
void |
fitOverview()
Changes the transformer of the overview so that the rectangle representing the visible area of the manager view fits the size of the overview. |
protected void |
fitTransformerToContent(boolean redraw)
Modifies the transformer of the manager view to which the interactor is attached so that all the objects are visible in the view. |
int |
getDrawingStyle()
Returns the way the control rectangle is drawn. |
int |
getLineWidth()
Returns the width of the line when the style is Wire. |
IlvRect |
getRectangle()
Returns the control rectangle. |
int |
getResizeHandleSize()
Returns the size of the resizing handles. |
IlvManagerView |
getTarget()
Returns the target view of the interactor. |
boolean |
isAutoKeepingAspectRatio()
Returns true if the control rectangle keeps the aspect
ratio during interactive resize exactly when the target manager view
has the keeping aspect ratio mode enabled. |
boolean |
isAutoTranslating()
Returns true if the AutoTranslating mode is
activated. |
boolean |
isAutoZoomConstrained()
Returns true if the AutoZoom mode is constrained. |
boolean |
isAutoZooming()
Returns true if the AutoZooming mode is activated. |
boolean |
isBoundedByView()
Returns true if the control rectangle cannot be moved
outside of the view. |
boolean |
isCenteringWhenKeepingAspectRatio()
Returns true if resizing the control rectangle while
keeping the aspect ratio preserves the center of the view. |
boolean |
isKeepingAspectRatio()
Returns true if the control rectangle keeps the aspect
ratio when being interactively resized. |
boolean |
isResizingAllowed()
Returns true if the user can resize the control rectangle. |
protected void |
processMouseEvent(MouseEvent event)
Processes mouse events. |
protected void |
processMouseMotionEvent(MouseEvent event)
Processes mouse motion events. |
void |
resetOverview()
Resets the internal flags of the overview that are used to manage the AutoZoom mode and the AutoZoom constrained mode. |
void |
setAutoKeepingAspectRatio(boolean enable)
Sets whether keeping the aspect ratio of the control rectangle can be specified independently from keeping the aspect ratio of the target view. |
void |
setAutoTranslating(boolean set)
Enables or disables the AutoTranslating mode. |
void |
setAutoZoomConstrained(boolean set)
Constrains the AutoZoom mode so that the overview is never less zoomed than its content. |
void |
setAutoZooming(boolean set)
Enables or disables the AutoZooming mode. |
void |
setBoundedByView(boolean set)
When set to true, specifies that the control rectangle
cannot be moved outside of the view. |
void |
setCenteringWhenKeepingAspectRatio(boolean enable)
Sets whether resizing the control rectangle while keeping the aspect ratio preserves the center of the view. |
void |
setDrawingStyle(int style)
Changes the way the control rectangle is drawn. |
void |
setKeepingAspectRatio(boolean enable)
Sets whether the control rectangle keeps the aspect ratio when being interactively resized. |
void |
setLineWidth(int width)
Changes the width of the line when the style is Wire. |
void |
setRectangle(IlvRect rect,
boolean adjust)
Changes the control rectangle. |
void |
setResizeHandleSize(int size)
Changes the size of the resizing handles. |
void |
setResizingAllowed(boolean allow)
Specifies whether the control rectangle can be resized. |
void |
setTarget(IlvManagerView view)
Changes the target view of the interactor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int Filled
setDrawingStyle(int),
Constant Field Valuespublic static final int Wire
setDrawingStyle(int),
Constant Field Values| Constructor Detail |
|---|
public IlvManagerMagViewInteractor()
setTarget to specify the target view.
public IlvManagerMagViewInteractor(IlvManagerView target,
boolean boundedByView)
target - The target view.boundedByView - If true, the control rectangle cannot be moved
outside of the view.| Method Detail |
|---|
public void fitOverview()
public void setResizingAllowed(boolean allow)
allow - true for allowing rectangle resize, false otherwise.isResizingAllowed()public boolean isResizingAllowed()
true if the user can resize the control rectangle.
true if allowing rectangle resizing,
false otherwise.setResizingAllowed(boolean)public void setDrawingStyle(int style)
style - The drawing style. Valid values for style are
Filled and Wire. When the value is
Filled, the control rectangle is drawn as a filled
rectangle. When the value is Wire, the control
rectangle is drawn as an empty rectangle with the line thickness
defined by getLineWidth. The drawing can be in XOR
mode or not depending on the value of
IlvManagerViewInteractor.isXORGhost(). Of course when
using a non XOR filled rectangle, it is advised to use a
semi-transparent ghost color (
IlvManagerView.setDefaultGhostColor(Color)).Filled,
Wirepublic int getDrawingStyle()
Filled
or Wire. When the value is Filled,
the control rectangle is drawn as an filled rectangle. When the
value is Wire, the control rectangle is drawn as an
empty rectangle with the line thickness defined by
getLineWidth.public void setLineWidth(int width)
Wire.
width - The line width.getDrawingStyle()public int getLineWidth()
Wire.
getDrawingStyle()public void setResizeHandleSize(int size)
size - The handle size.public int getResizeHandleSize()
public final IlvRect getRectangle()
public void setRectangle(IlvRect rect,
boolean adjust)
rect - The new rectangle in the control view coordinate system.adjust - If true, the visible
area of the target view is adjusted according to the new rectangle.public void setAutoZooming(boolean set)
autoFitToContents mode.
set - true if enable autozooming, false otherwise.IlvManagerView.setAutoFitToContents(boolean),
isAutoZooming(),
setAutoZoomConstrained(boolean)public final boolean isAutoZooming()
true if the AutoZooming mode is activated.
true if autozooming is enabled , false otherwise.setAutoZooming(boolean)public void setAutoTranslating(boolean set)
set - true for enabling auto translating,
false otherwise.isAutoTranslating()public final boolean isAutoTranslating()
true if the AutoTranslating mode is
activated.
true if auto translating is enabled,
false otherwise.setAutoTranslating(boolean)public void setAutoZoomConstrained(boolean set)
set - true to enable this mode, false otherwise.setAutoZooming(boolean),
isAutoZoomConstrained()public final boolean isAutoZoomConstrained()
true if the AutoZoom mode is constrained.
true if this mode is enabled, false otherwise.setAutoZoomConstrained(boolean)public void resetOverview()
setAutoZooming(boolean),
setAutoZoomConstrained(boolean)protected void fitTransformerToContent(boolean redraw)
The default implementation calls the method
IlvManagerView.fitTransformerToContent(). If redraw
is true, the manager view is repainted using
IlvManagerView.repaint().
redraw - If true, the manager view is repainted after the
modification of the transformer.public void setTarget(IlvManagerView view)
view - The new target view.public IlvManagerView getTarget()
protected void processMouseEvent(MouseEvent event)
processMouseEvent in class IlvManagerViewInteractorevent - The MouseEventIlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)protected void processMouseMotionEvent(MouseEvent event)
processMouseMotionEvent in class IlvManagerViewInteractorevent - The MouseEventIlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)public void drawGhost(Graphics g)
drawGhost in class IlvManagerViewInteractorg - The Graphic used to draw the ghost.IlvManagerViewInteractor.handleExpose(java.awt.Graphics),
IlvManagerViewInteractor.setXORGhost(boolean)public boolean isBoundedByView()
true if the control rectangle cannot be moved
outside of the view.
true if the control rectangle cannot be moved
outside of the view.setBoundedByView(boolean)public void setBoundedByView(boolean set)
true, specifies that the control rectangle
cannot be moved outside of the view.
set - true if the control rectangle cannot be moved
outside of the view.isBoundedByView()public boolean isAutoKeepingAspectRatio()
true if the control rectangle keeps the aspect
ratio during interactive resize exactly when the target manager view
has the keeping aspect ratio mode enabled.
Return true if keeping the aspect ratio of the control
rectangle depends on the flag
IlvManagerView.setKeepingAspectRatio(boolean) of the target view.
This mode has only an effect if resizing the control rectangle is
allowed.
setAutoKeepingAspectRatio(boolean),
setResizingAllowed(boolean)public void setAutoKeepingAspectRatio(boolean enable)
If the automatic mode is on, the flag setKeepingAspectRatio(boolean)
of this interactor has no effect, since the control rectangle of the
interactor preserves the aspect ratio whenever the flag
IlvManagerView.setKeepingAspectRatio(boolean) returns true
for the target view.
If the automatic mode is off, it can be specified by
setKeepingAspectRatio(boolean) whether the control rectangle of the
interactor preserves the aspect ratio independent from the target view.
The automatic mode is disabled by default.
isAutoKeepingAspectRatio(),
setKeepingAspectRatio(boolean),
setResizingAllowed(boolean),
getTarget(),
IlvManagerView.setKeepingAspectRatio(boolean)public boolean isKeepingAspectRatio()
true if the control rectangle keeps the aspect
ratio when being interactively resized.
This mode has only an effect if resizing the control rectangle is
allowed, and the automatic keeping aspect ratio mode is disabled.
setKeepingAspectRatio(boolean),
setResizingAllowed(boolean),
setAutoKeepingAspectRatio(boolean)public void setKeepingAspectRatio(boolean enable)
The keeping aspect ratio of the control rectangle is independent from the keeping aspect ratio feature that can be set at the manager view. If keeping aspect ratio is enabled at the target view but disabled for the control rectangle, it is possible to freely resize the control rectangle, but the target view dominates, that is, at the end of the resize operation, the control rectangle snaps into size that corresponds to the aspect ratio of the target view. If keeping aspect ratio is disabled at the target view but enabled for the control rectangle, resizing the control rectangle preserves the aspect ratio on the control rectangle and also approximately on the target view, while all operations directly on the target view don't preserve the aspect ratio.
The most common case is to set keeping aspect ratio of the manager view and of the control rectangle to the same value. This most common case is supported by enabling the automatic keeping aspect ratio mode.
isKeepingAspectRatio(),
setResizingAllowed(boolean),
setAutoKeepingAspectRatio(boolean),
getTarget(),
IlvManagerView.setKeepingAspectRatio(boolean)public boolean isCenteringWhenKeepingAspectRatio()
true if resizing the control rectangle while
keeping the aspect ratio preserves the center of the view.
This mode has only an effect if resizing the control rectangle is
allowed and should keep the aspect ratio. This means, either keeping
aspect ratio is enabled or the automatic keeping aspect ratio mode is
switched on and the view preserves the aspect ratio.
setCenteringWhenKeepingAspectRatio(boolean),
setResizingAllowed(boolean),
setKeepingAspectRatio(boolean),
setAutoKeepingAspectRatio(boolean),
IlvManagerView.setKeepingAspectRatio(boolean)public void setCenteringWhenKeepingAspectRatio(boolean enable)
isCenteringWhenKeepingAspectRatio(),
setResizingAllowed(boolean),
setKeepingAspectRatio(boolean),
setAutoKeepingAspectRatio(boolean),
IlvManagerView.setKeepingAspectRatio(boolean)public void adjustGhost()
public void adjustView(IlvRect rect)
rect - The new desired control rectangle.protected void attach(IlvManagerView v)
attach in class IlvManagerViewInteractorv - The manager view.IlvManagerViewInteractor.detach()protected void detach()
detach in class IlvManagerViewInteractorIlvManagerViewInteractor.attach(ilog.views.IlvManagerView)
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||