public class ManagerContentChangedEvent extends ManagerEvent
ManagerContentChangedEvent
event is the base
class for events fired by the
manager when its contents change. The manager sends such an event when
an object is added or removed, or when the bounding box, the layer, or the
visibility of an object changes.
The manager fires subclasses of this event depending on the
type of event.
In some situations, it is not efficient to perform an action after
each modification in the manager. This is why this event has a method
(isAdjusting
)
that indicates that the manager is doing a series of modifications.
Reading a file, for example, means a series of
ObjectInsertedEvent
events. The end of a series is notified
by a new event of type ADJUSTMENT_END
.
ManagerContentChangedListener
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
ADJUSTMENT_END
The type of the event when a series of modification
is finished.
|
static int |
OBJECT_ADDED
The type of the event when an
object is added to a manager.
|
static int |
OBJECT_BBOX_CHANGED
The type of the event when the bounding rectangle of an
object has changed.
|
static int |
OBJECT_LAYER_CHANGED
The type of the event when the layer of an
object has changed.
|
static int |
OBJECT_REMOVED
The type of the event when an
object is removed from a manager.
|
static int |
OBJECT_VISIBILITY_CHANGED
The type of the event when the visibility of an
object has changed.
|
source
Constructor and Description |
---|
ManagerContentChangedEvent(IlvManager manager)
Creates the event.
|
Modifier and Type | Method and Description |
---|---|
int |
getType()
Returns the type of the manager-contents modification.
|
boolean |
isAdjusting()
Returns
true if this
event is part of a series of modifications. |
void |
setAdjusting(boolean set)
Changes the adjustment flag of the event.
|
void |
setType(int type)
Changes the type of the event.
|
getManager
getSource, toString
public static final int OBJECT_ADDED
ObjectInsertedEvent
public static final int OBJECT_REMOVED
ObjectRemovedEvent
.public static final int OBJECT_BBOX_CHANGED
ObjectBBoxChangedEvent
.public static final int OBJECT_VISIBILITY_CHANGED
ObjectVisibilityChangedEvent
.public static final int OBJECT_LAYER_CHANGED
ObjectLayerChangedEvent
.public static final int ADJUSTMENT_END
isAdjusting
returns false
.isAdjusting()
,
Constant Field Valuespublic ManagerContentChangedEvent(IlvManager manager)
manager
- The manager source of the event.public final int getType()
public final boolean isAdjusting()
true
if this
event is part of a series of modifications.
Note that if the type of the object is ADJUSTMENT_END
,
this method always returns false
.
The method will return true
if the event is
fired by the manager while the manager is in adjustment mode.
If the method returns true
, another event of type
ADJUSTMENT_END
will be fired by the manager.
For this reason, if you only want to perform an action for each modification
of the manager, but not on every individual object addition or removal,
you can carry out your action when this method returns false
.IlvManager.setContentsAdjusting(boolean)
public final void setType(int type)
public final void setAdjusting(boolean set)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.