|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvGraphic
ilog.views.graphic.IlvGraphicSet
ilog.views.graphic.composite.IlvCompositeGraphic
public class IlvCompositeGraphic
IlvCompositeGraphic stores and controls the layout of
multiple IlvGraphic objects thus building complex graphic
objects.
An IlvCompositeGraphic instance holds a collection of
IlvGraphic objects organized into a tree structure. The first
child, returned by calling getChildren(0), is called the base
of the composite graphic object. Call setChildren to
add or remove children.
Note: the following methods inherited from
IlvGraphicSet should not be called directly:
addObjectaddObjectAtremoveObjectremoveObjectAt
A composite graphic object is made of child graphics and a layout manager
object. Unlike graphic sets, composite graphics have
the capability to control the layout and attachment of the child objects.
Graphic objects in a composite graphic instance can be distributed across
several layers. Their layout is controlled by an
IlvLayoutManager
instance. Possible layout styles are as follows:
The following code example shows how to set the layout style for the composite graphic object and how to add the base of the composite graphic.
// Create the composite graphic IlvCompositeGraphic composite = new IlvCompositeGraphic(); // Set the layout style IlvAttachmentLayout layout = new IlvAttachmentLayout(); composite.setLayout(layout); // Add the base graphic object to the composite graphic IlvRectangle rectangle = new IlvRectangle(new IlvRect(100, 100, 40, 40), true, true); composite.setChildren(0, rectangle);
You use
attachment rules
to set the position of child graphic objects in comparison to the base
object.
IlvText text = new IlvText();
text.setLabel("Composite Graphic");
// Add the graphic object to the graphics tree
composite.setChildren(1, text);
// Set the position of the object at place 1 in the graphics
// tree relative to the base object. In this case, the top center point of
// the IlvText object is aligned with the bottom center of the base
// IlvRectangle object.
composite.setConstraints(1,
new IlvAttachmentConstraint(
IlvAttachmentLocation.TopCenter,
IlvAttachmentLocation.BottomCenter));
The code examples in this section show you how to do the following:
| The following code example shows how to build the composite graphic displayed on the right: |
> |
// We create here a composite graphic with an icon and a label which
// will be centered in round rectangle. The icon is at the top of
// the label.
//
IlvCompositeGraphic node = new IlvCompositeGraphic();
// Creates a CenteredLayout
IlvCenteredLayout centered = new IlvCenteredLayout(new Insets(4, 10, 4, 10));
node.setLayout(centered);
// Creates the first child : it is a round rectangle
RoundRectangle2D.Float shape = new RoundRectangle2D.Float(0, 0, 10, 10, 2.5f, 2.5f);
IlvGeneralPath path = new IlvGeneralPath(shape);
path.setFillOn(true);
path.setFillPaint(new IlvLinearGradientPaint(
new IlvPoint(0, 0),
new IlvPoint(10, 10),
new float[]{0, 1},
new Color[]{ new Color(205, 201, 165),
new Color(255, 255, 204)},
IlvMultipleGradientPaint.SPREAD_REFLECT, false));
path.setStrokeOn(true);
path.setStroke(new BasicStroke(2));
node.setChildren(0, path);
// Creates the second child : it is a composite node with 2 children
// itself, a label and an icon
IlvCompositeGraphic contents = new IlvCompositeGraphic();
// Add it to its parent
node.setChildren(1, contents);
// Sets the layout
IlvAttachmentLayout layout = new IlvAttachmentLayout();
contents.setLayout(layout);
// Creates the label
IlvZoomableLabel label = new IlvZoomableLabel(new IlvPoint(), "Activity", false);
contents.setChildren(0, label);
// Create the icon
IlvIcon icon = new IlvIcon("gears-still.gif", new IlvRect(0, 0, 33, 30));
contents.setChildren(1, icon);
// Attach the BottomCenter (hotspot) of the icon to the
// TopCenter (anchor) of the label
contents.setConstraints(1,
new IlvAttachmentConstraint(
IlvAttachmentLocation.BottomCenter,
IlvAttachmentLocation.TopCenter));
IlvGrapher grapher = new IlvGrapher();
grapher.addNode(node, 10, false);
| The following code example shows how to build the composite graphic displayed on the right: |
> |
// We create here a composite graphic with an icon and a label which
// will be centered in round rectangle. The icon is at the left of
// the label.
IlvCompositeGraphic node = new IlvCompositeGraphic();
// Creates a CenteredLayout
IlvCenteredLayout centered = new IlvCenteredLayout(new Insets(4, 10, 4, 10));
node.setLayout(centered);
// Creates the first child : it is a rectangle
Rectangle2D.Float shape = new Rectangle2D.Float(0, 0, 1, 1);
IlvGeneralPath path = new IlvGeneralPath(shape);
path.setFillOn(true);
path.setBackground(new Color(198, 226, 255));
path.setStrokeOn(true);
path.setStroke(new BasicStroke(2));
node.setChildren(0, path);
// Creates the second child : it a composite node with 2 children
// itself, a label and an icon
IlvCompositeGraphic contents = new IlvCompositeGraphic();
// Add it to its parent
node.setChildren(1, contents);
// Sets the layout
IlvAttachmentLayout layout = new IlvAttachmentLayout();
contents.setLayout(layout);
// Creates the label
IlvZoomableLabel label = new IlvZoomableLabel(new IlvPoint(), "Hotline", false);
contents.setChildren(0, label);
// Create the icon
IlvIcon icon = new IlvIcon("start.gif", new IlvRect(0, 0, 26, 32));
contents.setChildren(1, icon);
// Attach the RightCenter (hotspot) of the icon to the
// TopCenter (anchor) of the label
contents.setConstraints(1,
new IlvAttachmentConstraint(
IlvAttachmentLocation.RightCenter,
IlvAttachmentLocation.LeftCenter));
// Adds the composite graphic to the grapher
IlvGrapher grapher = new IlvGrapher();
grapher.addNode(node, 10, false);
| The following code example shows how to build the composite graphic displayed on the right: |
> |
// Creates the composite graphic
IlvSDMCompositeNode node = new IlvSDMCompositeNode();
// When selected a white border of 2 pixels around the first
// child will be drawn around the first child.
node.setSelectionType(IlvCompositeGraphic.BaseBorderSelection);
// Sets the layout
IlvAttachmentLayout layout = new IlvAttachmentLayout();
node.setLayout(layout);
// Creates the icon
IlvIcon icon = new IlvIcon("system.gif", new IlvRect(0, 0, 32, 32));
node.setChildren(0, icon);
// Creates the name label
IlvText name = new IlvText(new IlvPoint(), "Paris");
node.setChildren(3, name);
node.setConstraints(3,
new IlvAttachmentConstraint(
IlvAttachmentLocation.TopCenter,
IlvAttachmentLocation.BottomCenter, 0, 3));
// Creates the alarm balloon
IlvCompositeGraphic alarmBalloon = new IlvCompositeGraphic();
// Adds it to the node
node.setChildren(5, alarmBalloon);
node.setConstraints(5,
new IlvAttachmentConstraint(
IlvAttachmentLocation.HotSpot,
IlvAttachmentLocation.TopRight, -4, 4));
// Put the alarm balloon above all the other objects (which are at the level 10)
node.setLayers(5, 20);
// Sets a centered layout
alarmBalloon.setLayout(new IlvCenteredLayout(new Insets(6, 10, 6, 10)));
// Creates a balloon
IlvRoundRectBalloon balloon = new IlvRoundRectBalloon();
balloon.setOrientation(SwingConstants.NORTH_EAST);
balloon.setPointerDepth(10);
balloon.setShadowThickness(2);
balloon.setRadius(15);
balloon.setShadowColor(Color.black);
balloon.setBorderColor(Color.black);
balloon.setBalloonColor(Color.gray);
// Adds it to the alarm balloon
alarmBalloon.setChildren(0, balloon);
// Creates the text within the balloon
IlvText alarmSource = new IlvText(new IlvPoint(), "Kernel Panic");
alarmSource.setFont(Font.decode("sansserif-10"));
alarmBalloon.setChildren(1, alarmSource);
| The following code example shows how to build the composite graphic displayed on the right: |
> |
// Creates the composite graphic
IlvCompositeGraphic node = new IlvCompositeGraphic();
// Sets the layout
IlvAttachmentLayout layout = new IlvAttachmentLayout();
node.setLayout(layout);
// Creates a white rectangle
RoundRectangle2D.Float shape = new RoundRectangle2D.Float(0, 0, 100, 50, 10, 10);
IlvGeneralPath path = new IlvGeneralPath(shape);
path.setFillOn(true);
path.setStroke(new BasicStroke(2));
path.setForeground(Color.black);
path.setBackground(Color.white);
node.setChildren(0, path);
// Creates the container for stacking the icons horizontally to the right
IlvCompositeGraphic icons = new IlvCompositeGraphic();
IlvStackerLayout stacker = new IlvStackerLayout(
SwingConstants.RIGHT,
SwingConstants.CENTER, 3);
icons.setLayout(stacker);
// Create the ad-hoc icon
IlvIcon ad_hoc = new IlvIcon("ad-hoc-marker.gif", new IlvRect(0, 0, 16, 7));
icons.setChildren(1, ad_hoc);
// Create the loop icon
IlvIcon loop = new IlvIcon("loop-marker.gif", new IlvRect(0, 0, 16, 16));
icons.setChildren(2, loop);
// Create the collapsed icon
IlvIcon collapsed = new IlvIcon("collapsed-marker.gif", new IlvRect(0, 0, 16, 16));
icons.setChildren(3, collapsed);
// Attach the BottomCenter (hotspot) of the stacker to the
// BottomCenter (anchor) of the rectangle
node.setChildren(1, icons);
node.setConstraints(1,
new IlvAttachmentConstraint(
IlvAttachmentLocation.BottomCenter,
IlvAttachmentLocation.BottomCenter, 0, -1));
// Creates the label
IlvZoomableLabel name = new IlvZoomableLabel(new IlvPoint(), "Name", false);
name.setFont(Font.decode("sansserif-BOLD-12"));
node.setChildren(2, name);
node.setConstraints(2,
new IlvAttachmentConstraint(
IlvAttachmentLocation.Center,
IlvAttachmentLocation.Center));
| The following code example shows how to build the composite graphic displayed on the right: |
> |
// Creates the composite graphic
IlvCompositeGraphic node = new IlvCompositeGraphic();
// Sets the layout
node.setLayout(new IlvAttachmentLayout());
// Creates the fax icon
IlvIcon fax = new IlvIcon("fax4a.gif", new IlvRect(0, 0, 32, 32));
node.setChildren(0, fax);
// Creates the alarm symbol
IlvIcon critical = new IlvIcon("critical.gif", new IlvRect(0, 0, 16, 16));
node.setChildren(1, critical);
// Attaches the symbol
node.setConstraints(1,
new IlvAttachmentConstraint(
IlvAttachmentLocation.BottomRight,
IlvAttachmentLocation.BottomRight, 7, 4));
// Tooltips can be on the entire node, or on any of its children.
// Creates the tooltip on the alarm symbol
String tp = "<HTML>" +
"<TABLE>" +
"<CAPTION><b>Fax Alarms</b></CAPTION>" +
"<TR><TD>Critical:</TD><TD>1</TD></TR>" +
"<TR><TD>Major:</TD><TD>3</TD></TR>" +
"<TR><TD>Minor:</TD><TD>6</TD></TR>" +
"</TABLE>" +
"</HTML>";
critical.setToolTipText(tp);
IlvCompositeGraphic 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.
Limitation: IlvCompositeGraphic is not compatible with
ILOG JViews Prototypes and should not be used inside a prototype.
IlvAttachmentConstraint,
IlvAttachmentLayout,
IlvAttachmentLocation,
IlvAttachmentConstraint,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ilog.views.graphic.IlvGraphicSet |
|---|
IlvGraphicSet.DelegateObjectInteractor |
| Field Summary | |
|---|---|
static int |
BaseBorderSelection
The IlvBaseBorderSelection class draws a white border of 2 pixels around
the first child (the base) of an IlvCompositeGraphic instance to show that
it is selected. |
static int |
BaseHandleSelection
Selection type that draws eight handles around the bounding rectangle of the first child (the base) of an IlvCompositeGraphic instance
to show that it is selected. |
static int |
CompositeHandleSelection
Selection type that draws eight handles around the bounding rectangle of the IlvCompositeGraphic instance
to show that it is selected. |
static int |
InvisibleSelection
With the IlvInvisibleSelection class, nothing is drawn around
the bounding box of an selected IlvGraphic instance. |
static int |
ResizingBase
The rectangle parameter of moveResize(ilog.views.IlvRect) specifies the new size of the base |
static int |
ResizingComposite
The rectangle parameter of moveResize(ilog.views.IlvRect) specifies the new size of the composite |
static int |
TransformationModeAll
The transformation passed as a parameter to applyTransform(IlvTransformer) will be
applied to all the children |
static int |
TransformationModeBaseOnly
The transformation passed as a parameter to applyTransform(IlvTransformer) will be
applied only to the first child (the base), depending on the layout |
| Fields inherited from class ilog.views.graphic.IlvGraphicSet |
|---|
list |
| Constructor Summary | |
|---|---|
IlvCompositeGraphic()
Creates an IlvCompositeGraphic instance. |
|
IlvCompositeGraphic(IlvCompositeGraphic source)
Creates a new IlvCompositeGraphic by copying an existing one. |
|
IlvCompositeGraphic(IlvInputStream stream)
Reads the object from an IlvInputStream. |
|
IlvCompositeGraphic(IlvLayoutManager layout)
Creates an IlvCompositeGraphic instance with the
given layout. |
|
| Method Summary | |
|---|---|
int |
addChild(IlvGraphic child)
Adds a child at the first available slot in the children array. |
void |
applyTransform(IlvTransformer t)
Applies a transformation to the shape of the object. |
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of this composite node. |
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within the outline of the object. |
IlvGraphic |
copy()
Returns a copy of this composite node. |
void |
doLayout()
Lays out this Composite Node. |
protected void |
drawCore(Graphics2D dst,
IlvTransformer t)
Draws the object. |
Action |
getAction(int index,
IlvMouseGesture gesture)
Returns the action associated with the child and the given gesture if any. |
IlvAttachableGraphic |
getAttachableGraphic(IlvGraphic element)
Returns an IlvAttachableGraphic for the supplied IlvGraphic |
IlvAttachable[] |
getAttachables()
Returns the children of this object wrapped into IlvAttachableGraphic instances. |
IlvRect |
getAttachmentBounds()
Returns the "attachment rectangle". |
static IlvRect |
getAttachmentBounds(IlvGraphic graphic)
Returns the bounding box used to attach the graphics within a composite graphic. |
IlvGraphic[] |
getChildren()
Returns all the children of this IlvCompositeGraphic instance. |
IlvGraphic |
getChildren(int index)
Returns the child at the supplied position. |
Object[] |
getConstraints()
Returns the constraints of the children of this object. |
Object |
getConstraints(int index)
Returns the constraints of the child at the given position of this object. |
IlvRect |
getDefinitionRect()
Returns the rectangle that contains the ellipse defining the arc. |
IlvTransformer |
getDefinitionTransformer()
This function returns null to indicate that there is no definition
transformation. |
IlvEventMap |
getEventMap()
Returns the event map of this object. |
IlvEventMap[] |
getEventMaps()
Returns the event maps of the children of this object. |
IlvEventMap |
getEventMaps(int index)
Returns the event map of the child of this object at the supplied position. |
protected IlvGraphic |
getGraphicBag(int index)
Returns the graphic of the child at the given position |
IlvPoint |
getHotSpot()
Returns the hotspot of the base (first child of this object) if any, otherwise null |
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. |
String |
getLabel()
Returns the label of the object. |
IlvRect |
getLabelBBox(IlvTransformer t)
Returns the area where the label is displayed. |
protected int |
getLayers(int index)
Returns the layer of the child at the specified position, or -1
if the child at the specified position is in the same layer as this
IlvCompositeGraphic. |
IlvLayoutManager |
getLayout()
Returns the layout manager for this composite graphic. |
boolean[] |
getLinkClippables()
Returns whether the clipping link connector clips agains the children. |
boolean |
getLinkClippables(int index)
Returns whether the clipping link connector clips agains the child with the given index. |
IlvGraphic |
getObject(String name)
Returns the object with the specified name. |
IlvComposite |
getParent()
Returns the parent of this object. |
int |
getResizingPolicy()
Returns the resizing policy |
IlvComposite |
getRoot()
Returns the root of the hierarchy to this object belongs to. |
int |
getSelectionType()
Return the type of the IlvSelection class that is used
to show the selection. |
int |
getTransformationMode()
Returns the transformation mode. |
double[] |
getVisibilityThresholds()
Returns the zoom level above which the children are visible. |
double |
getVisibilityThresholds(int index)
Returns the zoom level above which the child at the supplied position is visible. |
boolean |
hasActions(int index)
Returns true if this objet has
at least one action for the child at the supplied
position |
void |
invalidate()
Invalidates this IlvCompositeGraphic. |
boolean |
isEmpty()
Returns true if this IlvCompositeGraphic has no children. |
static boolean |
isJViews80BoundingBoxCompatibility()
Returns whether the compatibility mode how the bounding box of composite graphic objects are treated. |
boolean |
isSensitive()
When returns true, the AWT events are dispatched to the Swing
actions defined in the event maps. |
boolean |
isValid()
Returns true when this object needs to be rebuilt. |
boolean |
isVisible()
Returns true when this graphic set is visible and at least
one graphic object of this set is visible. |
IlvSelection |
makeSelection()
Creates an selection object around the bounding box of the first child. |
void |
moveResize(IlvRect size)
Resizes this object depending on the resizingPolicy. |
protected void |
removeChild(int index)
Remove the child at the supplied position. |
void |
reshapeObject(IlvGraphic obj,
IlvRect newrect,
boolean redraw)
Changes the size of a graphic child in this IlvCompositeGraphic. |
void |
resize(float neww,
float newh)
Resizes this object. |
void |
rotate(IlvPoint center,
double angle)
Rotates the object. |
void |
scale(double scalex,
double scaley)
Resizes the object. |
void |
selectionChanged(ManagerSelectionChangedEvent event)
This method is called when the selection changes in a manager. |
void |
setChildren(IlvGraphic[] children)
Sets a new collection of children for this object. |
void |
setChildren(int index,
IlvGraphic child)
Removes the current child at the supplied position if any, and adds the given child to this object at the supplied position. |
void |
setConstraints(int index,
Object constraint)
Sets the attachments for the child at the given position of this object. |
void |
setConstraints(Object[] attachments)
Sets the attachments for each child of this object. |
void |
setDefinitionRect(IlvRect rect)
Note that, if this composite graphic 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. |
void |
setEventMap(IlvEventMap eventMap)
Sets the event map of this object. |
void |
setEventMaps(IlvEventMap[] eventMaps)
Sets the event maps of all the children of this object. |
void |
setEventMaps(int index,
IlvEventMap eventMap)
Sets the event map of the child at the supplied position. |
void |
setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains the object. |
static void |
setJViews80BoundingBoxCompatibility(boolean enable)
Enables or disables the compatibility mode how the bounding box of composite graphic objects are treated. |
void |
setLabel(String label)
Changes the label of the object. |
void |
setLayout(IlvLayoutManager layout)
Sets the layout manager for this composite graphic. |
void |
setLayoutEnabled(boolean layoutSelf,
boolean layoutParent)
This method is for internal purposes, do not use. |
void |
setLinkClippables(boolean[] clippables)
Sets whether the clipping link connector clips agains the children. |
void |
setLinkClippables(int index,
boolean clippable)
Sets whether the clipping link connector clips agains the child with the given index. |
void |
setResizingPolicy(int resizingPolicy)
There are two possible values for the resizingPolicy
parameter:
ResizingBase: The rectangle parameter of moveResize(ilog.views.IlvRect) specifies the new size
of the base. |
void |
setSelectionType(int selectionType)
Sets the IlvSelection class that is used
to show that this IlvCompositeGraphic is selected. |
void |
setSensitive(boolean sensitive)
When this property is set to true, the object interactor
IlvCompositeInteractor
dispatches the AWT events to the Swing actions defined in the event maps. |
void |
setTransformationMode(int mode)
Sets the transformation mode. |
void |
setVisibilityThresholds(double[] thresholds)
Sets the zoom thresholds for each child above which the children are visible |
void |
setVisibilityThresholds(int index,
double threshold)
This property defines above which zoom level the child at the supplied index will be visible. |
boolean |
supportMultiline()
Returns true if the label can be a multiline label;
false otherwise. |
void |
validate()
Ensures that this component has a valid layout. |
void |
write(IlvOutputStream stream)
Writes the object to an IlvOutputStream. |
boolean |
zoomable()
Tests if the graphic set is zoomable. |
| 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 |
|---|
public static final int BaseHandleSelection
IlvCompositeGraphic instance
to show that it is selected.
public static final int BaseBorderSelection
IlvBaseBorderSelection class draws a white border of 2 pixels around
the first child (the base) of an IlvCompositeGraphic instance to show that
it is selected.
public static final int InvisibleSelection
IlvInvisibleSelection class, nothing is drawn around
the bounding box of an selected IlvGraphic instance.
public static final int CompositeHandleSelection
IlvCompositeGraphic instance
to show that it is selected.
public static final int ResizingComposite
moveResize(ilog.views.IlvRect) specifies the new size of the composite
setResizingPolicy(int),
Constant Field Valuespublic static final int ResizingBase
moveResize(ilog.views.IlvRect) specifies the new size of the base
setResizingPolicy(int),
Constant Field Valuespublic static final int TransformationModeAll
applyTransform(IlvTransformer) will be
applied to all the children
setTransformationMode(int),
Constant Field Valuespublic static final int TransformationModeBaseOnly
applyTransform(IlvTransformer) will be
applied only to the first child (the base), depending on the layout
setTransformationMode(int),
IlvLayoutManager.resizeFirstChildOnly(),
Constant Field Values| Constructor Detail |
|---|
public IlvCompositeGraphic()
IlvCompositeGraphic instance.
public IlvCompositeGraphic(IlvLayoutManager layout)
IlvCompositeGraphic instance with the
given layout.
layout - The layout to be used to position the children of this object.setLayout(ilog.views.graphic.composite.layout.IlvLayoutManager),
getLayout(),
IlvAttachmentLayout,
IlvCenteredLayout,
IlvStackerLayoutpublic IlvCompositeGraphic(IlvCompositeGraphic source)
IlvCompositeGraphic by copying an existing one.
public IlvCompositeGraphic(IlvInputStream stream)
throws IlvReadFileException
IlvInputStream.
stream - The input stream.
IlvReadFileException - if the format is not correct.| Method Detail |
|---|
public IlvGraphic copy()
copy in class IlvGraphicSetIlvGraphicpublic boolean isValid()
true when this object needs to be rebuilt.
isValid in interface IlvCompositepublic void invalidate()
IlvCompositeGraphic.
This composite graphic and all parents above it are marked as needing
to be laid out.
This method must also be called whenever bounding box is changed, even if this change does not require a relayout of the decorations.
Note that this method is automatically called when a change occurs
for this composite graphic. It only needs to be called directly in
special cases such as writing subclassing. For instance, the default
implementation of moveResize(IlvRect) performs the invalidation.
Hence, if this method is overridden without calling
super.moveResize, invalidate must be
called explicitly.
invalidate in interface IlvCompositepublic void validate()
public void setLayout(IlvLayoutManager layout)
layout - the specified layout managergetLayout()public IlvLayoutManager getLayout()
setLayout(ilog.views.graphic.composite.layout.IlvLayoutManager)public void setChildren(IlvGraphic[] children)
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.
children - Array of children to be added. The value null removes
all the children.
public void setChildren(int index,
IlvGraphic child)
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.
index - The position of the child to be set.child - The child to be added. The value null removes the current
child at the supplied position.public IlvGraphic getChildren(int index)
getChildren in interface IlvCompositeindex - The position of the child to return.
IlvGraphic at the given position or null if none.public IlvComposite getParent()
getParent in interface IlvCompositepublic IlvComposite getRoot()
getRoot in interface IlvCompositepublic IlvGraphic[] getChildren()
IlvCompositeGraphic instance.
getChildren in interface IlvCompositenullpublic void setConstraints(Object[] attachments)
attachments - Array of constraints for the layoutsetLayout(ilog.views.graphic.composite.layout.IlvLayoutManager),
IlvAttachmentConstraint,
IlvAttachmentLayout
public void setConstraints(int index,
Object constraint)
index - The position of the child that the supplied constraint applies to.constraint - The constraint used by the layout for the childsetLayout(ilog.views.graphic.composite.layout.IlvLayoutManager),
IlvAttachmentConstraint,
IlvAttachmentLayoutpublic Object[] getConstraints()
IlvAttachmentConstraint,
IlvAttachmentLayoutpublic Object getConstraints(int index)
IlvAttachmentConstraint,
IlvAttachmentLayoutpublic IlvAttachable[] getAttachables()
IlvAttachableGraphic instances.
IlvAttachableGraphic,
IlvLayoutManagerpublic IlvRect boundingBox(IlvTransformer t)
boundingBox in class IlvGraphicSett - The transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic boolean zoomable()
zoomable in class IlvGraphicSetIlvGraphic,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvManagerpublic void moveResize(IlvRect size)
resizingPolicy.
resizingPolicy is resizingComposite
the supplied size defines the new size of this object.
resizingPolicy is resizingBase
the supplied size defines the new size of the base.
moveResize in class IlvGraphicsize - The new bounding rectangle of this object.setResizingPolicy(int),
ResizingBase,
ResizingComposite
public void resize(float neww,
float newh)
resizingPolicy.
resizingPolicy is ResizingComposite,
it sets its new size as (neww, newh).
resizingPolicy is ResizingBase,
it sets the size of the base as (neww, newh).
This method calls the applyTransform method.
resize in class IlvGraphicneww - The new horizontal width.newh - The new horizontal height.setResizingPolicy(int),
ResizingBase,
ResizingComposite
public void scale(double scalex,
double scaley)
scalex, scaley).
This method calls the applyTransform method.
scale in class IlvGraphicscalex - The horizontal scaling factor.scaley - The vertical scaling factor.IlvGraphic,
IlvGraphic.applyTransform(IlvTransformer)public void setResizingPolicy(int resizingPolicy)
resizingPolicy
parameter:
ResizingBase: The rectangle parameter of moveResize(ilog.views.IlvRect) specifies the new size
of the base.
ResizingComposite: The rectangle parameter of moveResize(ilog.views.IlvRect) specifies the new size
of the composite.
resizingPolicy - ResizingBase,
ResizingComposite,
moveResize(ilog.views.IlvRect)public int getResizingPolicy()
setResizingPolicy(int)
protected void drawCore(Graphics2D dst,
IlvTransformer t)
IlvGraphicSet.draw(java.awt.Graphics, ilog.views.IlvTransformer) after processing the
alpha transparency. It can be overridden in subclasses.
drawCore in class IlvGraphicSetdst - The destination Graphics.t - The transformation used to draw the object.IlvGraphicSet.setAlpha(float)
public boolean contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
firstContains to find the first object
that contains the point.
contains in class IlvGraphicSetp - 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.
true if the point lies inside this graphic object.IlvGraphicSet.firstContains(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)
public IlvPoint getIntersectionWithOutline(IlvPoint innerPoint,
IlvPoint outerPoint,
IlvTransformer t)
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.
getIntersectionWithOutline in class IlvGraphicSetinnerPoint - 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.IlvClippingLinkConnectorpublic void applyTransform(IlvTransformer t)
Note that the method must never be called with a null
argument.
applyTransform in class IlvGraphicSett - The transformer to be applied.IlvGraphic
public void setLayoutEnabled(boolean layoutSelf,
boolean layoutParent)
public void doLayout()
doLayout in interface IlvCompositepublic void setGraphicBag(IlvGraphicBag bag)
setGraphicBag in class IlvGraphicSetbag - The graphic bag.IlvGraphicprotected void removeChild(int index)