ilog.views.sdm.renderer
Class IlvSubGraphRenderer.CollapsedGraphic

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.graphic.IlvGraphicHandle
          extended by ilog.views.sdm.renderer.IlvSubGraphRenderer.CollapsedGraphic
All Implemented Interfaces:
IlvGraphicBag, IlvPersistentObject, Transferable, Serializable
Enclosing class:
IlvSubGraphRenderer

public static class IlvSubGraphRenderer.CollapsedGraphic
extends IlvGraphicHandle
implements IlvGraphicBag

This graphic object encapsulates the collapsed representation of a subgraph. Its purpose is to draw the "expand" icon on top of the collapsed graphic.

This class is public only to allow saving in an IVL file the contents of a grapher associated with an SDM engine and containing expandable nodes.

Since:
JViews 5.0
See Also:
Serialized Form

Constructor Summary
IlvSubGraphRenderer.CollapsedGraphic(IlvInputStream stream)
          Reads the collapsed graphic from an IVL stream.
 
Method Summary
 void addObject(IlvGraphic graphic, boolean redraw)
          Adds a graphic object in the bag.
 void applyToObject(IlvGraphic graphic, IlvApplyObject f, Object arg, boolean redraw)
          Applies a method to a graphic object of the bag.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of the object, or within the outline of the "expand" icon.
 void draw(Graphics dst, IlvTransformer t)
          Draws the "expand" icon on top of the collapsed graphic.
 IlvGraphic getObject(String name)
          Returns the graphic object with that name if it exists in the bag, otherwise returns null.
 IlvGraphicEnumeration getObjects()
          Implementation of the IlvGraphicBag interface.
 void moveObject(IlvGraphic graphic, float x, float y, boolean redraw)
          Changes the location of a graphic object.
 void reDrawObj(IlvGraphic graphic)
          Redraws a graphic object located in the bag.
 void reDrawRegion(IlvRegion region)
          Redraws a region of the bag.
 void removeObject(IlvGraphic graphic, boolean redraw)
          Removes a graphic object from the bag.
 void reshapeObject(IlvGraphic graphic, IlvRect newrect, boolean redraw)
          Changes the size of a graphic object.
 boolean setObjectName(IlvGraphic graphic, String name)
          Changes the name of a graphic object.
 void write(IlvOutputStream stream)
          Writes the collapsed graphic to an IVL stream.
 
Methods inherited from class ilog.views.graphic.IlvGraphicHandle
applyTransform, boundingBox, copy, getIntersectionWithOutline, getObject, getOriginalPopupMenu, getPopupMenu, getToolTipText, inside, intersects, isOwner, isPersistent, move, move, moveResize, resize, rotate, scale, setBackground, setDelegateMoveResize, setForeground, setObject, setOwner, translate, 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, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isSelectable, isVisible, makeSelection, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, setEditable, setFillOn, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipText, setVisible, toString
 
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
 

Constructor Detail

IlvSubGraphRenderer.CollapsedGraphic

public IlvSubGraphRenderer.CollapsedGraphic(IlvInputStream stream)
                                     throws IlvReadFileException,
                                            IOException
Reads the collapsed graphic from an IVL stream.

Parameters:
stream - The input stream.
Throws:
IlvReadFileException
IOException
Method Detail

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the collapsed graphic to an IVL stream.

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

draw

public void draw(Graphics dst,
                 IlvTransformer t)
Draws the "expand" icon on top of the collapsed graphic.

Overrides:
draw in class IlvGraphicHandle
Parameters:
dst - The Graphics used to draw the collapsed graphic.
t - The transformer used to draw the collapsed graphic.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

contains

public boolean contains(IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Tests if a point lies within the outline of the object, or within the outline of the "expand" icon.

Overrides:
contains in class IlvGraphicHandle
Parameters:
p - The point to be tested.
tp - The point p transformed by the transformer t.
t - The transformation used to draw the object.
Returns:
true if the point lies inside this graphic object.
See Also:
IlvGraphic

addObject

public void addObject(IlvGraphic graphic,
                      boolean redraw)
Adds a graphic object in the bag.

Specified by:
addObject in interface IlvGraphicBag
Parameters:
graphic - The graphic object.
redraw - If true the object is redrawn.
Since:
JViews 5.5

removeObject

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

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

getObjects

public IlvGraphicEnumeration getObjects()
Implementation of the IlvGraphicBag interface. Do not call this method directly.

Specified by:
getObjects in interface IlvGraphicBag
Since:
JViews 5.5

reDrawObj

public void reDrawObj(IlvGraphic graphic)
Redraws a graphic object located in the bag.

Specified by:
reDrawObj in interface IlvGraphicBag
Parameters:
graphic - The graphic object.
Since:
JViews 5.5

reDrawRegion

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

Specified by:
reDrawRegion in interface IlvGraphicBag
Parameters:
region - The region to redraw.
Since:
JViews 5.5

reshapeObject

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

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

moveObject

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

Specified by:
moveObject in interface IlvGraphicBag
Parameters:
graphic - The graphic object.
x - The new desired x position.
y - The new desired y position.
redraw - If true the object is redrawn.
Since:
JViews 5.5

applyToObject

public void applyToObject(IlvGraphic graphic,
                          IlvApplyObject f,
                          Object arg,
                          boolean redraw)
Applies a method to a graphic object of the bag.

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

setObjectName

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

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

getObject

public IlvGraphic getObject(String name)
Returns the graphic object with that name if it exists in the bag, otherwise returns null.

Specified by:
getObject in interface IlvGraphicBag
Parameters:
name - The graphic object name.
Since:
JViews 6.0


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