public class IlvManagerMagViewInteractor extends IlvManagerViewInteractor
Modifier and Type | Field and Description |
---|---|
static int |
Filled
The Filled drawing style
|
static int |
Wire
The Wire drawing style
|
Constructor and Description |
---|
IlvManagerMagViewInteractor()
Creates the interactor.
|
IlvManagerMagViewInteractor(IlvManagerView target,
boolean boundedByView)
Creates the interactor.
|
Modifier and Type | Method and Description |
---|---|
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 independent 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 or resized 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.
|
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, isXORGhost, processEvent, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
public static final int Filled
setDrawingStyle(int)
,
Constant Field Valuespublic static final int Wire
setDrawingStyle(int)
,
Constant Field Valuespublic 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.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
,
Wire
public 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()
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 IlvManagerViewInteractor
event
- The MouseEvent
IlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)
protected void processMouseMotionEvent(MouseEvent event)
processMouseMotionEvent
in class IlvManagerViewInteractor
event
- The MouseEvent
IlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)
public void drawGhost(Graphics g)
drawGhost
in class IlvManagerViewInteractor
g
- 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 or resized outside of the view.set
- true
if the control rectangle cannot be moved
or resized 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.
public void setCenteringWhenKeepingAspectRatio(boolean enable)
public void adjustGhost()
public void adjustView(IlvRect rect)
rect
- The new desired control rectangle.protected void attach(IlvManagerView v)
attach
in class IlvManagerViewInteractor
v
- The manager view.IlvManagerViewInteractor.detach()
protected void detach()
detach
in class IlvManagerViewInteractor
IlvManagerViewInteractor.attach(ilog.views.IlvManagerView)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.