ilog.views.graphic.composite.decoration
Class IlvDefaultGraphicManagerFrame

java.lang.Object
  extended by ilog.views.graphic.composite.decoration.IlvDefaultGraphicManagerFrame
All Implemented Interfaces:
IlvGraphicBag, IlvManagerFrame, ilog.views.internal.IlvGraphicManagerFrame, IlvPersistentObject

public class IlvDefaultGraphicManagerFrame
extends Object
implements ilog.views.internal.IlvGraphicManagerFrame, IlvPersistentObject, IlvGraphicBag

This class draws the graphic border of IlvGrapher objects that represent subgraphs. The graphic border takes a graphic object and draws it around the manager.

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 6.0

Constructor Summary
IlvDefaultGraphicManagerFrame(IlvGraphic frameGraphic, IlvGraphic minusGraphic, int minusGraphicPosition, float left, float top, float right, float bottom, boolean zoomable)
          Creates a new instance of IlvDefaultGraphicManagerFrame.
IlvDefaultGraphicManagerFrame(IlvInputStream stream)
          Reads the border 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(IlvManager manager, IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within the outline of the border.
 IlvManagerFrame copy()
          Creates a new border by copying this one.
 void draw(IlvManager manager, IlvRect bbox, Graphics g, IlvTransformer t)
          Draws the border.
 float getBottomMargin(IlvManager manager, IlvTransformer t)
          Returns the margin on the bottom of the specified manager.
 IlvGraphic getFrameGraphic()
          Returns the graphic object that this frame delegates to.
 IlvGraphicBag getGraphicBag()
          Returns the parent grapher.
 float getLeftMargin(IlvManager manager, IlvTransformer t)
          Returns the margin on the left of the specified manager.
 IlvGraphic getObject(String name)
          Returns the graphic object with that name if exists in the bag, otherwise returns null.
 IlvGraphicEnumeration getObjects()
          Implementation of the IlvGraphicBag interface.
 float getRightMargin(IlvManager manager, IlvTransformer t)
          Returns the margin on the right of the specified manager.
 float getTopMargin(IlvManager manager, IlvTransformer t)
          Returns the margin on top of the specified manager.
 boolean isOpaque(IlvManager manager)
          Returns true.
 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.
 void resizeGraphic(IlvTransformer t, IlvRect bbox)
          Resizes the graphic objects drawn by the frame according to the bounding box of the manager.
 boolean setObjectName(IlvGraphic graphic, String name)
          Changes the name of a graphic object.
 void write(IlvOutputStream stream)
          Writes the border to an IVL stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvDefaultGraphicManagerFrame

public IlvDefaultGraphicManagerFrame(IlvGraphic frameGraphic,
                                     IlvGraphic minusGraphic,
                                     int minusGraphicPosition,
                                     float left,
                                     float top,
                                     float right,
                                     float bottom,
                                     boolean zoomable)
Creates a new instance of IlvDefaultGraphicManagerFrame.


IlvDefaultGraphicManagerFrame

public IlvDefaultGraphicManagerFrame(IlvInputStream stream)
                              throws IlvReadFileException,
                                     IOException
Reads the border from an IVL stream.

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

write

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

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

getFrameGraphic

public IlvGraphic getFrameGraphic()
Returns the graphic object that this frame delegates to.

Specified by:
getFrameGraphic in interface ilog.views.internal.IlvGraphicManagerFrame

copy

public IlvManagerFrame copy()
Creates a new border by copying this one.

Specified by:
copy in interface IlvManagerFrame

getTopMargin

public float getTopMargin(IlvManager manager,
                          IlvTransformer t)
Returns the margin on top of the specified manager.

Specified by:
getTopMargin in interface IlvManagerFrame
Parameters:
manager - The manager.
t - The transformer used to draw the manager and the border.

getBottomMargin

public float getBottomMargin(IlvManager manager,
                             IlvTransformer t)
Returns the margin on the bottom of the specified manager.

Specified by:
getBottomMargin in interface IlvManagerFrame
Parameters:
manager - The manager.
t - The transformer used to draw the manager and the border.

getRightMargin

public float getRightMargin(IlvManager manager,
                            IlvTransformer t)
Returns the margin on the right of the specified manager.

Specified by:
getRightMargin in interface IlvManagerFrame
Parameters:
manager - The manager.
t - The transformer used to draw the manager and the border.

getLeftMargin

public float getLeftMargin(IlvManager manager,
                           IlvTransformer t)
Returns the margin on the left of the specified manager.

Specified by:
getLeftMargin in interface IlvManagerFrame
Parameters:
manager - The manager.
t - The transformer used to draw the manager and the border.

isOpaque

public boolean isOpaque(IlvManager manager)
Returns true.

Specified by:
isOpaque in interface IlvManagerFrame
Parameters:
manager - The manager.

draw

public void draw(IlvManager manager,
                 IlvRect bbox,
                 Graphics g,
                 IlvTransformer t)
Draws the border.

Specified by:
draw in interface IlvManagerFrame
Parameters:
manager - The manager.
bbox - The bounding box of the manager.
g - The Graphics used to draw the border.
t - The transformer used to draw the border.

resizeGraphic

public void resizeGraphic(IlvTransformer t,
                          IlvRect bbox)
Resizes the graphic objects drawn by the frame according to the bounding box of the manager.

This method is normally called by the draw(ilog.views.IlvManager, ilog.views.IlvRect, java.awt.Graphics, ilog.views.IlvTransformer) method, it can be called directly to ensure that the frame graphic has the correct size before it is drawn.

Specified by:
resizeGraphic in interface ilog.views.internal.IlvGraphicManagerFrame
Parameters:
t - The current transformer.
bbox - The bounding box of the manager.

contains

public boolean contains(IlvManager manager,
                        IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Tests if a point lies within the outline of the border.

Specified by:
contains in interface IlvManagerFrame
Parameters:
manager - The manager.
p - The point to be tested.
tp - The point p transformed by the transformer t.
t - The transformation that is used to draw the border.

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.

getObjects

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

Specified by:
getObjects in interface IlvGraphicBag

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.

reDrawRegion

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

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

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.

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.

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.

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.

getObject

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

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

getGraphicBag

public IlvGraphicBag getGraphicBag()
Returns the parent grapher.

Specified by:
getGraphicBag in interface IlvGraphicBag


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