|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.EventObject
ilog.views.graphlayout.labellayout.LabelingModelEvent
public final class LabelingModelEvent
Encapsulates information describing changes to a labeling model.
A LabelingModelEvent event is delivered to the
"labeling model-content-changed" listeners, that is, listeners
of modifications to the contents of a labeling model
(IlvLabelingModel).
The event corresponds to several operations, such as the addition
and removal of a label or obstacle, or the modification of
the geometry of the labels or obstacles.
In some situations it is inefficient to perform an action after
each modification in the labeling model. That is why this event has
a method () that indicates that
a series of modifications occurred (for example, all the obstacles are
removed).
The end of a series is notified by a new event that has the adjustment
end flag (isAdjusting) set.
isAdjustmentEnd
LabelingModelListener,
IlvLabelingModel,
Serialized Form| Field Summary | |
|---|---|
static int |
GEOMETRY_CHANGED
The bit mask of the type of the event when the geometry (position or size) of one or several labels or obstacles has changed. |
static int |
LABEL_ADDED
The bit mask of the type of the event when a label has been added. |
static int |
LABEL_GEOMETRY_CHANGED
The bit mask of the type of the event when a label has been moved or resized. |
static int |
LABEL_REMOVED
The bit mask of the type of the event when a label has been removed. |
static int |
OBSTACLE_ADDED
The bit mask of the type of the event when an obstacle has been added. |
static int |
OBSTACLE_GEOMETRY_CHANGED
The bit mask of the type of the event when an obstacle has been moved or resized. |
static int |
OBSTACLE_REMOVED
The bit mask of the type of the event when an obstacle has been removed. |
static int |
STRUCTURE_CHANGED
The bit mask of the type of the event when one or several labels or obstacles have been added or removed. |
| Fields inherited from class java.util.EventObject |
|---|
source |
| Constructor Summary | |
|---|---|
LabelingModelEvent(IlvLabelingModel labelingModel)
Creates the event. |
|
| Method Summary | |
|---|---|
IlvLabelingModel |
getLabelingModel()
Returns the labeling model source of the event. |
Object |
getObstacleOrLabel()
Returns the obstacle or label that causes the event. |
int |
getType()
Returns the type of the content modification. |
boolean |
isAdjusting()
Returns true if this event is part of a series of
modifications. |
boolean |
isAdjustmentEnd()
Returns true if this event is the end of a series of
modifications. |
void |
setAdjusting(boolean flag)
Changes the adjustment flag of the event. |
void |
setAdjustmentEnd(boolean flag)
Changes the adjustment end flag of the event. |
void |
setObstacleOrLabel(Object obj)
Sets the obstacle or label that causes the event. |
void |
setType(int type)
Sets the type of the event. |
| Methods inherited from class java.util.EventObject |
|---|
getSource, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int STRUCTURE_CHANGED
public static final int GEOMETRY_CHANGED
public static final int LABEL_ADDED
STRUCTURE_CHANGED.
public static final int LABEL_REMOVED
STRUCTURE_CHANGED.
public static final int OBSTACLE_ADDED
STRUCTURE_CHANGED.
public static final int OBSTACLE_REMOVED
STRUCTURE_CHANGED.
public static final int LABEL_GEOMETRY_CHANGED
GEOMETRY_CHANGED.
public static final int OBSTACLE_GEOMETRY_CHANGED
GEOMETRY_CHANGED.
| Constructor Detail |
|---|
public LabelingModelEvent(IlvLabelingModel labelingModel)
labelingModel - The labeling model responsible for generating
the event.| Method Detail |
|---|
public IlvLabelingModel getLabelingModel()
public void setObstacleOrLabel(Object obj)
obj - The object.public Object getObstacleOrLabel()
null if the event was not caused by a specific
object (for instance, a geometry event caused by changing the coordinates
mode).
IlvLabelLayout.setCoordinatesMode(int)public final int getType()
STRUCTURE_CHANGEDGEOMETRY_CHANGEDLABEL_ADDEDLABEL_REMOVEDOBSTACLE_ADDEDOBSTACLE_REMOVEDLABEL_GEOMETRY_CHANGEDOBSTACLE_GEOMETRY_CHANGEDTo detect a certain type, you should query the corresponding bit with the bit mask, for instance:
if ((event.getType() & LabelingModelEvent.STRUCTURE_CHANGED) != 0) {
...
}
if ((event.getType() & LabelingModelEvent.GEOMETRY_CHANGED) != 0) {
...
}
public void setType(int type)
public final void setAdjusting(boolean flag)
IlvLabelingModel).
public final void setAdjustmentEnd(boolean flag)
IlvLabelingModel).
public final boolean isAdjusting()
true if this event is part of a series of
modifications.
Note that this method always returns false for events
that have the adjustment end flag set.
The method will return true if the event is fired by the
labeling model while the labeling model is in adjustment mode.
If the method returns true, then another event with the
adjustment end flag will be fired by the labeling model.
Thus, if you only want to perform an action for each modification
of the labeling model, but not on every individual object addition
or removal, you can skip the events that have the adjusting flag set
and perform the action only when this method returns
false.
setAdjusting(boolean),
isAdjustmentEnd()public final boolean isAdjustmentEnd()
true if this event is the end of a series of
modifications.
setAdjustmentEnd(boolean),
isAdjusting()
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||