ilog.views.graphic
Class IlvGraphicSet

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.graphic.IlvGraphicSet
All Implemented Interfaces:
GraphicBagHierarchyEventReceiver, ManagerViewsHierarchyEventReceiver, IlvGraphicBag, IlvPersistentObject, Transferable, Serializable
Direct Known Subclasses:
IlvAssociation, IlvCompositeGraphic, IlvGraphicGroup, IlvSVGGraphicSet

public class IlvGraphicSet
extends IlvGraphic
implements IlvGraphicBag, GraphicBagHierarchyEventReceiver, ManagerViewsHierarchyEventReceiver

An IlvGraphicSet instance is used to group several graphic objects together.

For an IlvGraphicSet object contained inside an IlvGraphicBag instance (for instance inside IlvManager, the following methods must be called from the applyToObject method of the IlvGraphicBag instance holding this IlvGraphicSet object.

Example

The following code example shows how to use IlvGraphicSet in a simple Java application:

  IlvManager manager = new IlvManager();
      
  IlvGraphicSet graphicSet = new IlvGraphicSet();
  // Set an object interactor that makes the graphic objects sensitive to events.
  graphicSet.setObjectInteractor(new IlvGraphicSet.DelegateObjectInteractor());

  // Create the graphic objects and add them to the graphic set.
  IlvReliefRectangle border = new IlvReliefRectangle(new IlvRect(10,10,60,90));
  border.setBackground(new Color(228,225,224));
  graphicSet.addObject(border, false);
  
  IlvText label1 = new IlvText(new IlvPoint(27,40), "ILOG");
  Font font = new Font(label1.getFont().getName(), Font.BOLD,
                       label1.getFont().getSize());
  label1.setFont(font);
  graphicSet.addObject(label1, false);
  
  IlvText label2 = new IlvText(new IlvPoint(20,60), "JViews");
  label2.setFont(font);
  graphicSet.addObject(label2, false);
  
  // Add the graphic set containing all the graphic objects to the manager.
  manager.addObject(graphicSet, true);
 

The following image shows the graphic objects created in the code example:

IlvGraphicSet

The following code example shows how to remove an object from the graphic set, even when the graphic set is already inside a manager:

 graphicSet.removeObject(label2, false);
 

About Graphic Objects

IlvGraphicSet is a custom graphic object, that is, a subclass of IlvGraphic. Graphic objects are controlled using an instance of IlvManager or one of its subclasses, and displayed using one or more IlvManagerView instances in a Java Swing application. For information about generic features for graphic objects, see IlvGraphic.

See Also:
IlvManager, IlvManagerView, IlvRect, Serialized Form

Nested Class Summary
static class IlvGraphicSet.DelegateObjectInteractor
          A delegating interactor for IlvGraphicSet objects.
 
Field Summary
protected  IlvGraphicVector list
          The internal IlvGraphicVector storing the IlvGraphic instances for this IlvGraphicSet.
 
Constructor Summary
IlvGraphicSet()
          Creates a new empty graphic set.
IlvGraphicSet(IlvGraphicSet source)
          Creates a new IlvGraphicSet by copying an existing one.
IlvGraphicSet(IlvInputStream stream)
          Reads the object from an IlvInputStream.
 
Method Summary
 void addGraphicBagHierarchyListener(GraphicBagHierarchyListener listener)
          Adds the specified listener to receive events from the ancestor managers and ancestor graphic sets and from this graphic set when the hierarchy of graphic bags has changed.
 void addManagerViewsHierarchyListener(ManagerViewsChangedListener listener)
          Adds the specified listener to receive events from the owning manager of this object and from its ancestors when a manager view was added or removed.
 void addObject(IlvGraphic obj, boolean redraw)
          Adds a graphic object at the end of the set.
 void addObjectAt(IlvGraphic obj, int index, boolean redraw)
          Adds a graphic object at the specified index in the set.
 void applyToObject(IlvGraphic obj, IlvApplyObject f, Object arg, boolean redraw)
          Applies a method to an object of the bag.
 void applyTransform(IlvTransformer t)
          Applies a transformation to the shape of contained objects.
 IlvRect boundingBox(IlvTransformer t)
          Returns the bounding rectangle of the object.
 boolean contains(IlvGraphic obj)
          Returns true if the object is in the graphic set.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of the object.
 IlvGraphic copy()
          Copies the object.
 void draw(Graphics dst, IlvTransformer t)
          Draws the object.
protected  void drawCore(Graphics2D dst, IlvTransformer t)
          Draws the object.
 void enableGraphicBagHierarchyEventForwarding()
          Enables forwarding of GraphicBagHierarchyEvent events, since the objects contained in this graphic set need to receive the events.
 void enableManagerViewsHierarchyEventForwarding()
          Enables forwarding of ManagerViewsChangedEvent events through the nesting hierarchy, since the objects contained in this graphic set need to receive the events.
 void fireGraphicBagHierarchyEvent(GraphicBagHierarchyEvent event)
          Fires a graphic bag hierarchy event to this graphic set and all contained objects.
 void fireManagerViewsHierarchyEvent(ManagerViewsChangedEvent event)
          Fires a ManagerViewsChangedEvent event to all listeners installed via addManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener) on this graphic set or contained objects.
 IlvGraphic firstContains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Searches for the first graphic object in the set that contains the specified point.
 float getAlpha()
          Returns the alpha value of this graphic object.
 int getCardinal()
          Returns the number of objects.
 Shape getClip()
          Returns the shape that will clip the object.
 int getIndex(IlvGraphic obj)
          Searches for the specified graphic object in the set and returns an index to it.
 IlvPoint getIntersectionWithOutline(IlvPoint innerPoint, IlvPoint outerPoint, IlvTransformer t)
          Returns the intersection of the line segment from inner point to outer point with the shape of the graphic object.
 IlvGraphic getObject(int index)
          Returns the graphic object at the specified index.
 IlvGraphic getObject(String name)
          Returns the object with the specified name.
 String getObjectName(IlvGraphic obj)
          Returns the name of the object.
 IlvGraphicEnumeration getObjects()
          Returns an enumeration of all the objects in the graphic set.
protected  JPopupMenu getOriginalPopupMenu(IlvPoint p, IlvTransformer t, IlvManagerView view, IlvPopupMenuManager popupManager)
          This is the original implementation of getPopupMenu from the super class to retrieve the popup menu.
 JPopupMenu getPopupMenu(IlvPoint p, IlvTransformer t, IlvManagerView view, IlvPopupMenuManager popupManager)
          Returns the Swing popup menu to display when the popup is triggered while the mouse pointer is at a specified location inside the graphic object.
 String getToolTipText(IlvPoint p, IlvTransformer t)
          Returns the tooltip text to display when the mouse pointer is at a specified location inside the graphic object.
 boolean isPersistent()
          If this method returns true the IlvGraphic instance will be saved in IVL files.
 void moveObject(IlvGraphic obj, float x, float y, boolean redraw)
          Changes the location of a graphic object.
 boolean needsGraphicBagHierarchyEvent()
          Returns whether this object needs to receive GraphicBagHierarchyEvent events, either from itself or from its ancestors.
 boolean needsManagerViewsHierarchyEvent()
          Returns whether the graphic set needs to receive ManagerViewsChangedEvent events, either from its owning manager or from its ancestors.
 void reDrawObj(IlvGraphic obj)
          Redraws a graphic object contained in the set.
 void reDrawRegion(IlvRegion region)
          Redraws a region of the set.
 void removeAll(boolean redraw)
          Removes all the graphic objects from this bag.
 void removeGraphicBagHierarchyListener(GraphicBagHierarchyListener listener)
          Removes the specified listener so that it no longer receives events from ancestor manager and ancestor graphic sets and from this graphic set when the hierarchy of graphic bags has changed.
 void removeManagerViewsHierarchyListener(ManagerViewsChangedListener listener)
          Removes the specified listener so that it no longer receives events from the owning manager of this object and from its ancestors when a manager view was added or removed.
 void removeObject(IlvGraphic obj, boolean redraw)
          Removes a graphic object from this bag.
 void removeObjectAt(int index, boolean redraw)
          Removes the graphic object located at the specified index from this bag.
 void reshapeObject(IlvGraphic obj, IlvRect newrect, boolean redraw)
          Changes the size of a graphic object located in the set.
 void setAlpha(float alpha)
          Changes the alpha value of this graphic object.
 void setClip(Shape clip)
          Changes the shape that will clip the object.
 void setGraphicBag(IlvGraphicBag bag)
          Changes the bag that contains the object.
 boolean setObjectName(IlvGraphic obj, String name)
          Changes the name of a graphic object.
 void write(IlvOutputStream stream)
          Writes the object to an IlvOutputStream.
 boolean zoomable()
          Tests if the graphic set is zoomable.
 
Methods inherited from class ilog.views.IlvGraphic
addActionListener, addNamedPropertyListener, boundingBox, getAndAssociateObjectInteractor, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenuName, getProperty, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, hasProperty, inside, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isSelectable, isVisible, makeSelection, move, move, moveResize, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setEditable, setFillOn, setForeground, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipText, setVisible, toString, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ilog.views.IlvGraphicBag
getGraphicBag
 

Field Detail

list

protected IlvGraphicVector list
The internal IlvGraphicVector storing the IlvGraphic instances for this IlvGraphicSet. Warning:: This field is protected for implementation reasons and should not be modified by third-party.

Since:
JViews 6.0
Constructor Detail

IlvGraphicSet

public IlvGraphicSet()
Creates a new empty graphic set.


IlvGraphicSet

public IlvGraphicSet(IlvGraphicSet source)
Creates a new IlvGraphicSet by copying an existing one. Note that objects in the graphic set are copied too.

Parameters:
source - The origin object for the copy.

IlvGraphicSet

public IlvGraphicSet(IlvInputStream stream)
              throws IlvReadFileException
Reads the object from an IlvInputStream.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException - if the format is not correct.
Method Detail

setGraphicBag

public void setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains the object.

Note: do not call this method directly unless you are creating a custom graphics bag.

Overrides:
setGraphicBag in class IlvGraphic
Parameters:
bag - The graphic bag to contain this graphic object.
See Also:
IlvGraphic

addObject

public void addObject(IlvGraphic obj,
                      boolean redraw)
Adds a graphic object at the end of the set. Note that an object can be contained in only one bag, and the object cannot be contained by a manager and an IlvGraphicSet at the same time.

Specified by:
addObject in interface IlvGraphicBag
Parameters:
obj - The graphic object.
redraw - If true, the object is redrawn.

addObjectAt

public void addObjectAt(IlvGraphic obj,
                        int index,
                        boolean redraw)
Adds a graphic object at the specified index in the set. Note that an object can be contained in only one bag, and the object cannot be contained by a manager and a IlvGraphicSet at the same time.

Parameters:
obj - The graphic object.
index - The desired index or -1 to add the object to the end.
redraw - If true, the object is redrawn.
Throws:
ArrayIndexOutOfBoundsException - if the index was not valid.

removeObject

public void removeObject(IlvGraphic obj,
                         boolean redraw)
Removes a graphic object from this bag.

Specified by:
removeObject in interface IlvGraphicBag
Parameters:
obj - The graphic object.
redraw - If true the object is redrawn.

removeObjectAt

public void removeObjectAt(int index,
                           boolean redraw)
Removes the graphic object located at the specified index from this bag.

Parameters:
index - The desired index.
redraw - If true, the object is redrawn.
Throws:
ArrayIndexOutOfBoundsException - if the index supplied was not valid.

removeAll

public void removeAll(boolean redraw)
Removes all the graphic objects from this bag.

Parameters:
redraw - If true, the object is redrawn.
Since:
JViews 7.5

getObject

public final IlvGraphic getObject(int index)
Returns the graphic object at the specified index.

Parameters:
index - The desired index.
Throws:
ArrayIndexOutOfBoundsException - if the index supplied was not valid.

getIndex

public final int getIndex(IlvGraphic obj)
Searches for the specified graphic object in the set and returns an index to it.

Parameters:
obj - The desired graphic object.
Returns:
The index of the object in the set or -1 if it is not found.

contains

public final boolean contains(IlvGraphic obj)
Returns true if the object is in the graphic set.


getObjects

public final IlvGraphicEnumeration getObjects()
Returns an enumeration of all the objects in the graphic set.

Specified by:
getObjects in interface IlvGraphicBag

getCardinal

public final int getCardinal()
Returns the number of objects.


reDrawObj

public void reDrawObj(IlvGraphic obj)
Redraws a graphic object contained in the set.

Specified by:
reDrawObj in interface IlvGraphicBag
Parameters:
obj - The graphic object.

reDrawRegion

public void reDrawRegion(IlvRegion region)
Redraws a region of the set.

Specified by:
reDrawRegion in interface IlvGraphicBag
Parameters:
region - The region to redraw in the IlvGraphicSet coordinate system.

reshapeObject

public void reshapeObject(IlvGraphic obj,
                          IlvRect newrect,
                          boolean redraw)
Changes the size of a graphic object located in the set.

Specified by:
reshapeObject in interface IlvGraphicBag
Parameters:
obj - The graphic object.
newrect - The new desired bounding rectangle.
redraw - If true, the object is redrawn.

moveObject

public void moveObject(IlvGraphic obj,
                       float x,
                       float y,
                       boolean redraw)
Changes the location of a graphic object.

Specified by:
moveObject in interface IlvGraphicBag
Parameters:
obj - The graphic object.
x - The new desired x.
y - The new desired y.
redraw - If true, the object is redrawn.

applyToObject

public void applyToObject(IlvGraphic obj,
                          IlvApplyObject f,
                          Object arg,
                          boolean redraw)
Applies a method to an object of the bag. Any operation that changes the bounding box of obj must be encapsulated into applyToObject.

Specified by:
applyToObject in interface IlvGraphicBag
Parameters:
obj - The graphic object.
f - The method to apply.
arg - The arguments passed to f.
redraw - If true, the object is redrawn.

copy

public IlvGraphic copy()
Copies the object. This method copies the object by calling the copy constructor.

Specified by:
copy in class IlvGraphic
Returns:
A copy of the object.
See Also:
IlvGraphic

getObject

public IlvGraphic getObject(String name)
Returns the object with the specified name.

Specified by:
getObject in interface IlvGraphicBag
Parameters:
name - The name.
See Also:
getObjectName(ilog.views.IlvGraphic), setObjectName(ilog.views.IlvGraphic, java.lang.String)

getObjectName

public String getObjectName(IlvGraphic obj)
Returns the name of the object.

Parameters:
obj - The graphic object.
See Also:
setObjectName(ilog.views.IlvGraphic, java.lang.String), getObject(int)

setObjectName

public boolean setObjectName(IlvGraphic obj,
                             String name)
Changes the name of a graphic object.

Specified by:
setObjectName in interface IlvGraphicBag
Parameters:
obj - The graphic object.
name - The new name.
Returns:
true if the name can be changed.

setClip

public void setClip(Shape clip)
Changes the shape that will clip the object. The value may be null if no clip is applied.

Parameters:
clip - The new clip.
Since:
JViews 3.5

getClip

public Shape getClip()
Returns the shape that will clip the object. The value may be null if no clip is applied. The shape is modified when a transformation is applied to the object.

Since:
JViews 3.5

setAlpha

public void setAlpha(float alpha)
Changes the alpha value of this graphic object. The alpha composition value is used to render the graphic object in a transparent way. The value must be in the range of [0.0, 1.0], the value of 1 meaning that the graphic object is not transparent.

If the containers of the graphic object (manager layer, graphic set) have their own alpha value, the object draws with a composed alpha value.

The default value is 1.

Parameters:
alpha - The new transparency level in the range [0.0, 1.0].
Since:
JViews 8.0
See Also:
getAlpha(), IlvManagerLayer.setAlpha(float)

getAlpha

public float getAlpha()
Returns the alpha value of this graphic object. The alpha composition value is used to render this graphic object in a transparent way. The value is in the range of [0.0, 1.0], the value of 1 meaning that the graphic object is not transparent.

Since:
JViews 8.0
See Also:
setAlpha(float), IlvManagerLayer.getAlpha()

draw

public void draw(Graphics dst,
                 IlvTransformer t)
Draws the object. This method simply calls the draw methods of contained objects. Objects not in the clip area are not drawn.

Specified by:
draw in class IlvGraphic
Parameters:
dst - The destination Graphics.
t - The transformation used to draw the object.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

drawCore

protected void drawCore(Graphics2D dst,
                        IlvTransformer t)
Draws the object. This method is called from draw(java.awt.Graphics, ilog.views.IlvTransformer) after processing the alpha transparency. It can be overridden in subclasses.

Parameters:
dst - The destination Graphics.
t - The transformation used to draw the object.
Since:
JViews 8.1
See Also:
setAlpha(float)

applyTransform

public void applyTransform(IlvTransformer t)
Applies a transformation to the shape of contained objects.

Note that a call to this method can modify the bounding box of the graphic set. For this reason, if the graphic set is contained inside an IlvManager, this method can be called only using the method IlvManager.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean) of the manager.

Specified by:
applyTransform in class IlvGraphic
Parameters:
t - The transformer to be applied.
See Also:
IlvGraphic

boundingBox

public IlvRect boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object. The bounding rectangle is the smallest rectangle enclosing all contained objects. Only visible objects are taken into account (see IlvGraphic.setVisible(boolean)).

Specified by:
boundingBox in class IlvGraphic
Parameters:
t - The transformer used to draw the object.
See Also:
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

zoomable

public boolean zoomable()
Tests if the graphic set is zoomable. This object is zoomable if all contained objects are zoomable.

Overrides:
zoomable in class IlvGraphic
See Also:
IlvGraphic, IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.boundingBox(IlvTransformer), IlvManager

contains

public boolean contains(IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Tests if a point lies within the outline of the object. Calls firstContains to find the first object that contains the point.

Overrides:
contains in class IlvGraphic
Parameters:
p - The point to be tested.
tp - The point p transformed by the transformer t.
t - The transformation that was applied to the object when it was drawn.
Returns:
true if the point lies inside this graphic object.
See Also:
firstContains(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)

firstContains

public IlvGraphic firstContains(IlvPoint p,
                                IlvPoint tp,
                                IlvTransformer t)
Searches for the first graphic object in the set that contains the specified point.

Parameters:
p - The point.
tp - The transformed point.
t - The transformer used to draw the set.

getIntersectionWithOutline

public IlvPoint getIntersectionWithOutline(IlvPoint innerPoint,
                                           IlvPoint outerPoint,
                                           IlvTransformer t)
Returns the intersection of the line segment from inner point to outer point with the shape of the graphic object. This method is used the clip links against the shape of the node. The implementation of this method must be robust with respect to the input points: Even if innerPoint is not inside the graphic object, or if outerPoint is not outside the graphic object, it must return a valid point. For instance, if there is no intersection, it can return the start point.

This implementation works well if no clip is set on this object, by choosing the best intersection with a subobject contained in the graphic set. If a clip is set on the object, it checks whether this intersection is inside the clip area. If it is outside the clip area, it returns the intersection with the clip area. This works well only if subobjects are not entirely outside the clip area.

Overrides:
getIntersectionWithOutline in class IlvGraphic
Parameters:
innerPoint - A point usually inside the graphic object, given in manager view coordinates.
outerPoint - A point usually outside of the graphic object, given in manager view coordinates.
t - The transformation used to draw the object.
Since:
JViews 8.1
See Also:
IlvClippingLinkConnector

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the object to an IlvOutputStream. You should not call this method directly; instead, you should use the write methods of the manager.

Specified by:
write in interface IlvPersistentObject
Overrides:
write in class IlvGraphic
Parameters:
stream - The output stream.
Throws:
IOException - thrown when an exception occurs during the write operation for this object.

isPersistent

public boolean isPersistent()
If this method returns true the IlvGraphic instance will be saved in IVL files. The method returns true if all subobjects are persistent.

Overrides:
isPersistent in class IlvGraphic
Since:
JViews 8.0

getToolTipText

public String getToolTipText(IlvPoint p,
                             IlvTransformer t)
Returns the tooltip text to display when the mouse pointer is at a specified location inside the graphic object. It tries to retrieve the tooltip from one of the elements in this graphic set. If this fails, it tries to retrieve the tooltip of the entire graphic set.

Note that you must enable the tooltip mechanism for the manager view by calling the static method IlvToolTipManager.registerView(ilog.views.IlvManagerView).

Overrides:
getToolTipText in class IlvGraphic
Parameters:
p - The location of the mouse (in view coordinates).
t - The transformer that converts the coordinate system of this object (the manager coordinates) into the coordinate system of the manager view in which the tooltip is about to be displayed (the view coordinates).
Returns:
The tool tip at point p for transformation t, or null if no tool tip should be displayed.
Since:
JViews 8.0
See Also:
IlvGraphic, IlvGraphic.getToolTipText(), IlvGraphic.setToolTipText(String)

getPopupMenu

public JPopupMenu getPopupMenu(IlvPoint p,
                               IlvTransformer t,
                               IlvManagerView view,
                               IlvPopupMenuManager popupManager)
Returns the Swing popup menu to display when the popup is triggered while the mouse pointer is at a specified location inside the graphic object. It tries to retrieve the popup menu from one of the elements in this graphic set. If this fails, it tries to retrieve the popup menu of the entire graphic set.

Note that you must enable the popup menu mechanism for the manager view by calling the static method IlvPopupMenuManager.registerView(ilog.views.IlvManagerView).

Overrides:
getPopupMenu in class IlvGraphic
Parameters:
p - The location of the mouse (in view coordinates).
t - The transformer that converts the coordinate system of this object (the manager coordinates) into the coordinate system of the manager view in which the tooltip is about to be displayed (the view coordinates).
view - The manager view that triggered the popup menu.
popupManager - The popup menu manager.
Returns:
The Swing popup menu, which can be null.
Since:
JViews 8.0
See Also:
IlvGraphic, IlvPopupMenuManager.registerView(ilog.views.IlvManagerView), IlvGraphic.getPopupMenu()

getOriginalPopupMenu

protected JPopupMenu getOriginalPopupMenu(IlvPoint p,
                                          IlvTransformer t,
                                          IlvManagerView view,
                                          IlvPopupMenuManager popupManager)
This is the original implementation of getPopupMenu from the super class to retrieve the popup menu. Subclasses of this class might need access to the original implementation.

Parameters:
p - The location of the mouse (in view coordinates).
t - The transformer that converts the coordinate system of this object (the manager coordinates) into the coordinate system of the manager view in which the tooltip is about to be displayed (the view coordinates).
view - The manager view that triggered the popup menu.
popupManager - The popup menu manager.
Returns:
The Swing popup menu as retrieved by the super class.
Since:
JViews 8.0

addGraphicBagHierarchyListener

public void addGraphicBagHierarchyListener(GraphicBagHierarchyListener listener)
Adds the specified listener to receive events from the ancestor managers and ancestor graphic sets and from this graphic set when the hierarchy of graphic bags has changed. The hierarchy event is generated by a manager or graphic set when it is added to or removed from another manager or graphic set, and passed down the hierarchy. The event is dispatched to every graphic set that is contained in the manager or graphic set whose graphic bag has changed.

Specified by:
addGraphicBagHierarchyListener in interface GraphicBagHierarchyEventReceiver
Parameters:
listener - The listener.
Since:
JViews 8.1
See Also:
removeGraphicBagHierarchyListener(ilog.views.event.GraphicBagHierarchyListener)

removeGraphicBagHierarchyListener

public void removeGraphicBagHierarchyListener(GraphicBagHierarchyListener listener)
Removes the specified listener so that it no longer receives events from ancestor manager and ancestor graphic sets and from this graphic set when the hierarchy of graphic bags has changed.

Specified by:
removeGraphicBagHierarchyListener in interface GraphicBagHierarchyEventReceiver
Parameters:
listener - The listener.
Since:
JViews 8.1
See Also:
addGraphicBagHierarchyListener(ilog.views.event.GraphicBagHierarchyListener)

enableGraphicBagHierarchyEventForwarding

public void enableGraphicBagHierarchyEventForwarding()
Enables forwarding of GraphicBagHierarchyEvent events, since the objects contained in this graphic set need to receive the events.

Specified by:
enableGraphicBagHierarchyEventForwarding in interface GraphicBagHierarchyEventReceiver
Since:
JViews 8.1

needsGraphicBagHierarchyEvent

public boolean needsGraphicBagHierarchyEvent()
Returns whether this object needs to receive GraphicBagHierarchyEvent events, either from itself or from its ancestors.

Specified by:
needsGraphicBagHierarchyEvent in interface GraphicBagHierarchyEventReceiver
Since:
JViews 8.1

fireGraphicBagHierarchyEvent

public void fireGraphicBagHierarchyEvent(GraphicBagHierarchyEvent event)
Fires a graphic bag hierarchy event to this graphic set and all contained objects.

Specified by:
fireGraphicBagHierarchyEvent in interface GraphicBagHierarchyEventReceiver
Since:
JViews 8.1

addManagerViewsHierarchyListener

public void addManagerViewsHierarchyListener(ManagerViewsChangedListener listener)
Adds the specified listener to receive events from the owning manager of this object and from its ancestors when a manager view was added or removed.

The hierarchy event mechanism is comparable to java.awt.event.HierarchyEvent on swing components. The view changed event is generated by a manager when a view is added or removed, and passed down the nesting hierarchy. The event is dispatched to every graphic set that is contained in the manager whose view has changed.

Specified by:
addManagerViewsHierarchyListener in interface ManagerViewsHierarchyEventReceiver
Parameters:
listener - The listener.
Since:
JViews 8.1
See Also:
removeManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener)

removeManagerViewsHierarchyListener

public void removeManagerViewsHierarchyListener(ManagerViewsChangedListener listener)
Removes the specified listener so that it no longer receives events from the owning manager of this object and from its ancestors when a manager view was added or removed.

Specified by:
removeManagerViewsHierarchyListener in interface ManagerViewsHierarchyEventReceiver
Parameters:
listener - The listener.
Since:
JViews 8.1
See Also:
addManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener)

enableManagerViewsHierarchyEventForwarding

public void enableManagerViewsHierarchyEventForwarding()
Enables forwarding of ManagerViewsChangedEvent events through the nesting hierarchy, since the objects contained in this graphic set need to receive the events.

Specified by:
enableManagerViewsHierarchyEventForwarding in interface ManagerViewsHierarchyEventReceiver
Since:
JViews 8.1

needsManagerViewsHierarchyEvent

public boolean needsManagerViewsHierarchyEvent()
Returns whether the graphic set needs to receive ManagerViewsChangedEvent events, either from its owning manager or from its ancestors. It returns true, if a listener was installed through addManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener) on this graphic set or on any object contained in this graphic set.

Specified by:
needsManagerViewsHierarchyEvent in interface ManagerViewsHierarchyEventReceiver
Since:
JViews 8.1

fireManagerViewsHierarchyEvent

public void fireManagerViewsHierarchyEvent(ManagerViewsChangedEvent event)
Fires a ManagerViewsChangedEvent event to all listeners installed via addManagerViewsHierarchyListener(ilog.views.event.ManagerViewsChangedListener) on this graphic set or contained objects.

Specified by:
fireManagerViewsHierarchyEvent in interface ManagerViewsHierarchyEventReceiver
Since:
JViews 8.1


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.