public class IlvCompositeGraphic extends IlvGraphicSet implements IlvComposite, IlvAttachmentBounds, ManagerSelectionListener, IlvHotSpot, IlvDefinitionRectInterface
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:
addObject
addObjectAt
removeObject
removeObjectAt
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.
// Creates the composite graphic IlvCompositeGraphic composite = new IlvCompositeGraphic(); // Sets the layout style IlvAttachmentLayout layout = new IlvAttachmentLayout(); composite.setLayout(layout); // Adds 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");
// Adds the graphic object to the graphics tree
composite.setChildren(1, text);
// Sets 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: |
// Creates 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 shape = new RoundRectangle2D.Double(0, 0, 10, 10, 2.5, 2.5); 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, // a label and an icon IlvCompositeGraphic contents = new IlvCompositeGraphic(); // Adds 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); // Creates the icon IlvIcon icon = new IlvIcon("gears-still.gif", new IlvRect(0, 0, 33, 30)); contents.setChildren(1, icon); // Attaches 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: | > |
// Creates 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.Double shape = new Rectangle2D.Double(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(); // Adds 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); // Creates the icon IlvIcon icon = new IlvIcon("start.gif", new IlvRect(0, 0, 26, 32)); contents.setChildren(1, icon); // Attaches 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 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)); // Puts the alarm balloon above all the other objects (which are at 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.Double shape = new RoundRectangle2D.Double(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); // Creates the ad-hoc icon IlvIcon ad_hoc = new IlvIcon("ad-hoc-marker.gif", new IlvRect(0, 0, 16, 7)); icons.setChildren(1, ad_hoc); // Creates the loop icon IlvIcon loop = new IlvIcon("loop-marker.gif", new IlvRect(0, 0, 16, 16)); icons.setChildren(2, loop); // Creates the collapsed icon IlvIcon collapsed = new IlvIcon("collapsed-marker.gif", new IlvRect(0, 0, 16, 16)); icons.setChildren(3, collapsed); // Attaches 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
Rogue Wave JViews Prototypes and should not be used inside a prototype.
IlvAttachmentConstraint
,
IlvAttachmentLayout
,
IlvAttachmentLocation
,
IlvAttachmentConstraint
,
Serialized FormIlvGraphicSet.DelegateObjectInteractor
Modifier and Type | Field and Description |
---|---|
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 |
list
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
baseTextDirectionChanged(int oldBaseTextDirection,
int newBaseTextDirection)
Called when the object is base text direction sensitive and the
resolved base text direction has changed.
|
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of this composite graphic.
|
void |
componentOrientationChanged(ComponentOrientation oldOri,
ComponentOrientation newOri)
Called when the object is component orientation sensitive and the
component orientation has changed.
|
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 graphic.
|
void |
doLayout()
Lays out this composite graphic.
|
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 against the children.
|
boolean |
getLinkClippables(int index)
Returns whether the clipping link connector clips against 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 . |
void |
invalidate(boolean withParent)
Invalidates this
IlvCompositeGraphic . |
protected IlvRect |
invalidateAndApplyToObject(IlvGraphic obj,
IlvApplyObject f,
Object arg,
IlvRect objBBoxOld,
IlvRect objBBoxNew)
Invalidate the layout of this object when doing
IlvGraphicSet.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
to the input object. |
protected void |
invalidateBBoxCache()
Invalidate the bounding box cache.
|
boolean |
isBaseTextDirectionSensitive()
Returns
true because the bounding boxes of object's
children may depend on its text direction. |
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)
Moves and resizes the object.
|
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(double neww,
double 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 it.
|
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 against the child
with the given index.
|
void |
setResizingPolicy(int resizingPolicy)
Sets the resizing policy.
|
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.
|
addGraphicBagHierarchyListener, addManagerViewsHierarchyListener, addObject, addObjectAt, applyToObject, applyToObjectImpl, contains, draw, enableGraphicBagHierarchyEventForwarding, enableManagerViewsHierarchyEventForwarding, fireGraphicBagHierarchyEvent, fireManagerViewsHierarchyEvent, firstContains, getAlpha, getCardinal, getClip, getIndex, getObject, getObjectName, getObjects, getOriginalPopupMenu, getPopupMenu, getToolTipText, isComponentOrientationSensitive, isLocaleSensitive, isPersistent, moveObject, needsGraphicBagHierarchyEvent, needsManagerViewsHierarchyEvent, reDrawObj, reDrawRegion, removeAll, removeGraphicBagHierarchyListener, removeManagerViewsHierarchyListener, removeObject, removeObjectAt, setAlpha, setBaseTextDirection, setClip, setInsideApply, setObjectName, shouldElementBePartOfClip, shouldRestrictListOfElementsForClip
calcResolvedBaseTextDirection, getBaseTextDirection, getComponentOrientation, getResolvedBaseTextDirection, getULocale, invalidateBidiCache, setBaseTextDirection, setBaseTextDirectionDuringConstruction
addActionListener, addNamedPropertyListener, allViewsRemoved, blinkingStateOn, boundingBox, callDraw, getAndAssociateObjectInteractor, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getDefaultInteractor, getGraphicBag, GetGraphicObject, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenuName, getProperty, getToolTipBaseTextDirection, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getZOrderIndex, hasProperty, inside, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isSelectable, localeChanged, move, move, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, setBackground, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setForeground, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGraphicBag
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 compositesetResizingPolicy(int)
,
Constant Field Valuespublic static final int ResizingBase
moveResize(ilog.views.IlvRect)
specifies the new size of the basesetResizingPolicy(int)
,
Constant Field Valuespublic static final int TransformationModeAll
applyTransform(IlvTransformer)
will be
applied to all the childrensetTransformationMode(int)
,
Constant Field Valuespublic static final int TransformationModeBaseOnly
applyTransform(IlvTransformer)
will be
applied only to the first child (the base), depending on the layoutsetTransformationMode(int)
,
IlvLayoutManager.resizeFirstChildOnly()
,
Constant Field Valuespublic 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
,
IlvStackerLayout
public 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.public IlvGraphic copy()
copy
in class IlvGraphicSet
IlvGraphic
public boolean isValid()
true
when this object needs to be rebuilt.isValid
in interface IlvComposite
public void invalidate(boolean withParent)
IlvCompositeGraphic
.
This composite graphic and, optionally, all parents above it are marked
as needing to be laid out.
withParent
- Whether the parent gets invalidated as well.public void invalidate()
IlvCompositeGraphic
.
This composite graphic and all parents above it are marked as needing
to be laid out.
This method must be called whenever the bounding box is changed, even if this change does not require a new layout 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 when writing a subclass. 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 IlvComposite
protected void invalidateBBoxCache()
invalidateBBoxCache
in class IlvGraphicSet
public void validate()
protected IlvRect invalidateAndApplyToObject(IlvGraphic obj, IlvApplyObject f, Object arg, IlvRect objBBoxOld, IlvRect objBBoxNew)
IlvGraphicSet.applyToObject(ilog.views.IlvGraphic, ilog.views.IlvApplyObject, java.lang.Object, boolean)
to the input object.invalidateAndApplyToObject
in class IlvGraphicSet
obj
- The object that changes.f
- The method to apply.arg
- The arguments passed to f
.objBBoxOld
- The old bounding box of the input object, if it is
already calculated, or null
.objBBoxNew
- The new bounding box of the input object, if it is
already calculated, or null
.null
.public void setLayout(IlvLayoutManager layout)
layout
- the specified layout managergetLayout()
public IlvLayoutManager getLayout()
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 IlvComposite
index
- The position of the child to return.IlvGraphic
at the given position or null
if none.public IlvComposite getParent()
getParent
in interface IlvComposite
public IlvComposite getRoot()
getRoot
in interface IlvComposite
public IlvGraphic[] getChildren()
IlvCompositeGraphic
instance.getChildren
in interface IlvComposite
null
public 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
,
IlvAttachmentLayout
public Object[] getConstraints()
IlvAttachmentConstraint
,
IlvAttachmentLayout
public Object getConstraints(int index)
IlvAttachmentConstraint
,
IlvAttachmentLayout
public IlvAttachable[] getAttachables()
IlvAttachableGraphic
instances.IlvAttachableGraphic
,
IlvLayoutManager
public IlvRect boundingBox(IlvTransformer t)
boundingBox
in class IlvGraphicSet
t
- The transformer used to draw the object.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public boolean zoomable()
zoomable
in class IlvGraphicSet
IlvGraphic
,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvManager
public void moveResize(IlvRect size)
IlvCardLayout
and
IlvStackerLayout
),
or if the transformation mode is TransformationModeAll
,
it resizes all elements of the composite graphic uniformly so that the
attachment bounds of the composite graphic is the input size.
IlvAttachmentLayout
and
IlvCenteredLayout
),
and the transformation mode is TransformationModeBaseOnly
,
it resizes only the base element (child 0) and it respects the resizing
policy.
If the resizing policy is ResizingBase
, the input size
defines the new size of the base.
If the resizing policy is ResizingComposite
, the input size
defines the new size of the entire composite graphic.
applyTransform
method.moveResize
in class IlvGraphic
size
- The new bounding rectangle of this object.IlvLayoutManager.resizeFirstChildOnly()
,
setResizingPolicy(int)
,
setTransformationMode(int)
,
ResizingBase
,
ResizingComposite
public void resize(double neww, double newh)
IlvCardLayout
and
IlvStackerLayout
),
or if the transformation mode is TransformationModeAll
,
it resizes all elements of the composite graphic uniformly so that the
attachment bounds of the composite graphic are
(neww
, newh
).
IlvAttachmentLayout
and
IlvCenteredLayout
),
and the transformation mode is TransformationModeBaseOnly
,
it resizes only the base element (child 0) and it respects the resizing
policy.
If the resizing policy is ResizingBase
, the input size
(neww
, newh
) is the new size of the base.
If the resizing policy is ResizingComposite
, the input size
(neww
, newh
) is the new size of the entire
composite graphic.
applyTransform
method.resize
in class IlvGraphic
neww
- The new horizontal width.newh
- The new horizontal height.IlvLayoutManager.resizeFirstChildOnly()
,
setResizingPolicy(int)
,
setTransformationMode(int)
,
ResizingBase
,
ResizingComposite
public void scale(double scalex, double scaley)
scalex
, scaley
).
This method calls the applyTransform
method.scale
in class IlvGraphic
scalex
- The horizontal scaling factor.scaley
- The vertical scaling factor.IlvGraphic
,
IlvGraphic.applyTransform(IlvTransformer)
public void setResizingPolicy(int resizingPolicy)
TransformationModeBaseOnly
, that is, if resizing operation
should affect only the base element (child 0) of the composite graphic.
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.
ResizingComposite
: The rectangle parameter of moveResize(ilog.views.IlvRect)
specifies the new size of the entire composite.
resizingPolicy
- The resizing policy.IlvLayoutManager.resizeFirstChildOnly()
,
setTransformationMode(int)
,
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 IlvGraphicSet
dst
- 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 IlvGraphicSet
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.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 IlvGraphicSet
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.IlvClippingLinkConnector
public void applyTransform(IlvTransformer t)
Note that the method must never be called with a null
argument.
applyTransform
in class IlvGraphicSet
t
- The transformer to be applied.IlvGraphic
public void setLayoutEnabled(boolean layoutSelf, boolean layoutParent)
public void doLayout()
doLayout
in interface IlvComposite
public void setGraphicBag(IlvGraphicBag bag)
setGraphicBag
in class IlvGraphicSet
bag
- The graphic bag.IlvGraphic
protected void removeChild(int index)
index
- The position of the child to be removed.protected IlvGraphic getGraphicBag(int index)
protected int getLayers(int index)
-1
if the child at the specified position is in the same layer as this
IlvCompositeGraphic
.
-1
. If you wish to
distribute the children across different layers, use the SDM class
ilog.views.sdm.graphic.IlvSDMCompositeNode
.-1
if the child at the specified position is in the same layer as this
IlvCompositeGraphic
.public IlvRect getAttachmentBounds()
getAttachmentBounds
in interface IlvAttachmentBounds
public int addChild(IlvGraphic child)
child
- Child to be added.public IlvEventMap[] getEventMaps()
public void setEventMaps(IlvEventMap[] eventMaps)
IlvEventMap
public void setEventMaps(int index, IlvEventMap eventMap)
IlvEventMap
public IlvEventMap getEventMaps(int index)
public void setEventMap(IlvEventMap eventMap)
IlvEventMap
public IlvEventMap getEventMap()
public void selectionChanged(ManagerSelectionChangedEvent event)
selectionChanged
in interface ManagerSelectionListener
event
- the "selection changed" event.IlvManager.addManagerSelectionListener(ilog.views.event.ManagerSelectionListener)
,
IlvManager.removeManagerSelectionListener(ilog.views.event.ManagerSelectionListener)
,
IlvManager.addManagerTreeSelectionListener(ilog.views.event.ManagerSelectionListener)
,
IlvManager.removeManagerTreeSelectionListener(ilog.views.event.ManagerSelectionListener)
,
IlvManager.selectionChanged(ilog.views.IlvGraphic)
public IlvGraphic getObject(String name)
getObject
in interface IlvGraphicBag
getObject
in class IlvGraphicSet
name
- The name.IlvGraphicSet.getObjectName(ilog.views.IlvGraphic)
,
IlvGraphicSet.setObjectName(ilog.views.IlvGraphic, java.lang.String)
public void setSelectionType(int selectionType)
IlvSelection
class that is used
to show that this IlvCompositeGraphic
is selected.
There are four possible values for the selectionType
parameter:
BaseBorderSelection
: A white border of 2 pixels around the bounding rectangle
of the first child (the base) is drawn when this object is selected.
BaseHandleSelection
: Eight handles around the bounding
rectangle of the first child (the base) of an IlvCompositeGraphic
instance
is drawn when this object is selected.
InvisibleSelection
: No selection object is drawn when this object is selected.
CompositeHandleSelection
:Eight handles around the bounding
rectangle of this object is drawn when this object is selected.
public int getSelectionType()
IlvSelection
class that is used
to show the selection.BaseBorderSelection
,
BaseHandleSelection
,
InvisibleSelection
public IlvSelection makeSelection()
selectionType
.makeSelection
in class IlvGraphic
setSelectionType(int)
,
getSelectionType()
public Action getAction(int index, IlvMouseGesture gesture)
getAction
in interface IlvComposite
index
- The position of the childgesture
- The gesture whose action is required.Action
,
IlvMouseGesture
public boolean hasActions(int index)
true
if this objet has
at least one action for the child at the supplied
positionhasActions
in interface IlvComposite
public boolean isEmpty()
IlvCompositeGraphic
has no children.public IlvPoint getHotSpot()
null
getHotSpot
in interface IlvHotSpot
IlvHotSpot
public void reshapeObject(IlvGraphic obj, IlvRect newrect, boolean redraw)
IlvCompositeGraphic
.
Note that a call to this method can modify the bounding box of
this IlvComositeNode
.
For this reason, if this IlvCompositeGraphic
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.
Invalidates this object to redo the layout before the next rendering.
reshapeObject
in interface IlvGraphicBag
reshapeObject
in class IlvGraphicSet
obj
- The graphic object.newrect
- The new desired bounding rectangle.redraw
- If true
, the object is redrawn.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.
You should not
call this method directly; instead, you should use the write
methods of the manager.write
in interface IlvPersistentObject
write
in class IlvGraphicSet
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.public void setLinkClippables(boolean[] clippables)
null
, if all children are checked to calculate
the intersection for a link at the border of the composite graphic.
Otherwise, set to a boolean array of the size cooresponding to the
number of children.clippables
- array of boolean indicating which child is clippablegetLinkClippables()
,
setLinkClippables(int,boolean)
public boolean[] getLinkClippables()
null
, all children are checked to calculate
the intersection for a link at the border of the composite graphic.
Otherwise it returns a boolean array of the size corresponding to the
number of children.setLinkClippables(boolean[])
,
setLinkClippables(int,boolean)
public void setLinkClippables(int index, boolean clippable)
true
for a child,
the method getIntersectionWithOutline(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)
checks this child
to calculate the intersection for a link at the border of the composite
graphic.index
- The position of the child.clippable
- Whether the child is respected for link clipping.setLinkClippables(boolean[])
,
getLinkClippables(int)
public boolean getLinkClippables(int index)
true
,
the method getIntersectionWithOutline(ilog.views.IlvPoint, ilog.views.IlvPoint, ilog.views.IlvTransformer)
checks this child
to calculate the intersection for a link at the border of the composite
graphic.index
- The position of the child.setLinkClippables(boolean[])
,
setLinkClippables(int,boolean)
public void setVisibilityThresholds(double[] thresholds)
thresholds
- array of zoom factorssetVisibilityThresholds(int,double)
public double[] getVisibilityThresholds()
public void setVisibilityThresholds(int index, double threshold)
index
- The position of the child.threshold
- The zoom factor above which the child is visible. When 0
,
the child is always visible.public double getVisibilityThresholds(int index)
public IlvAttachableGraphic getAttachableGraphic(IlvGraphic element)
IlvAttachableGraphic
for the supplied IlvGraphic
getAttachableGraphic
in interface IlvComposite
public void setLabel(String label)
IlvLabelInterface
. It sets the label of this
child.
You should not call this method directly. It is intended to be used by
IlvEditLabelInteractor
setLabel
in interface IlvLabelInterface
IlvEditLabelInteractor
,
IlvLabelInterface
public String getLabel()
IlvLabelInterface
. It returns the label of this
child. It returns null
if there is no such child.
You should not call this method directly. It is intended to be used by
IlvEditLabelInteractor
getLabel
in interface IlvLabelInterface
IlvEditLabelInteractor
,
IlvLabelInterface
public boolean supportMultiline()
true
if the label can be a multiline label;
false
otherwise.
This method works only if the composite graphic has a child that
implements the IlvLabelInterface
. It returns whether this
child supports multilines.supportMultiline
in interface IlvLabelInterface
public IlvRect getLabelBBox(IlvTransformer t)
IlvLabelInterface
. It returns the area where this
child is displayed. It returns null
if there is no such child.getLabelBBox
in interface IlvLabelInterface
t
- The transformer used to draw the graphic object.public void setTransformationMode(int mode)
TransformationModeAll
The transformation passed as a
parameter to applyTransform(IlvTransformer)
will be applied to all the children
TransformationModeBaseOnly
The transformation passed as
a parameter to applyTransform(IlvTransformer)
will be applied to the first child only, depending on the layout.
This works only if the layout permits resizing the first child only.
IlvLayoutManager.resizeFirstChildOnly()
,
TransformationModeAll
,
TransformationModeBaseOnly
,
IlvLayoutManager.resizeFirstChildOnly()
public int getTransformationMode()
TransformationModeAll
,
TransformationModeBaseOnly
public void rotate(IlvPoint center, double angle)
angle
degrees around the point
center
.
The center must be given in untransformed coordinates.
The default implementation calls IlvGraphic.applyTransform(ilog.views.IlvTransformer)
to rotate
the graphic object.rotate
in class IlvGraphic
center
- The center of the rotation.angle
- The rotation angle in degrees.IlvGraphic
,
IlvGraphic.applyTransform(IlvTransformer)
public IlvRect getDefinitionRect()
getDefinitionRect
in interface IlvDefinitionRectInterface
public void setDefinitionRect(IlvRect rect)
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.setDefinitionRect
in interface IlvDefinitionRectInterface
rect
- The new definition rectangle.public IlvTransformer getDefinitionTransformer()
null
to indicate that there is no definition
transformation.getDefinitionTransformer
in interface IlvDefinitionRectInterface
null
.IlvDefinitionRectInterface
public boolean isVisible()
true
when this graphic set is visible and at least
one graphic object of this set is visible.
If the visible property of this graphic set IlvGraphic.setVisible(boolean)
is
true
but all the graphic objects of this set are invisible, this method returns false
.isVisible
in class IlvGraphic
true
if this graphic object is visible.IlvGraphic.setVisible(boolean)
,
IlvGraphic.setSelectable(boolean)
,
IlvGraphic.setMovable(boolean)
,
IlvGraphic.setEditable(boolean)
public static IlvRect getAttachmentBounds(IlvGraphic graphic)
IlvAttachmentLayout
,
IlvAttachmentLocation
public void setSensitive(boolean sensitive)
true
, the object interactor
IlvCompositeInteractor
dispatches the AWT events to the Swing actions defined in the event maps.IlvCompositeInteractor
,
setEventMap(IlvEventMap)
,
setEventMaps(int, IlvEventMap)
public boolean isSensitive()
true
, the AWT events are dispatched to the Swing
actions defined in the event maps.isSensitive
in interface IlvComposite
IlvCompositeInteractor
,
setEventMap(IlvEventMap)
,
setEventMaps(int, IlvEventMap)
,
getAction(int, IlvMouseGesture)
,
setSensitive(boolean)
public static void setJViews80BoundingBoxCompatibility(boolean enable)
Since JViews 8.1, the bounding box of the composite graphic object includes all visible children independent from their layer specification. Switching layers of children does not modify the bounding box anymore and hence the layer treatment is more easy.
By default, the compatibility is disabled (i.e. the new mode is enabled).
public static boolean isJViews80BoundingBoxCompatibility()
setJViews80BoundingBoxCompatibility(boolean)
public boolean isBaseTextDirectionSensitive()
true
because the bounding boxes of object's
children may depend on its text direction.
This method overrides the isBaseTextDirectionSensitive
method
of the class IlvGraphic
.isBaseTextDirectionSensitive
in class IlvGraphicSet
IlvGraphic
public void baseTextDirectionChanged(int oldBaseTextDirection, int newBaseTextDirection)
baseTextDirectionChanged
in class IlvGraphicSet
oldBaseTextDirection
- Resolved base text direction of this object before the change.newBaseTextDirection
- Resolved base text direction of this object after the change.isBaseTextDirectionSensitive()
public void componentOrientationChanged(ComponentOrientation oldOri, ComponentOrientation newOri)
componentOrientationChanged
in class IlvGraphicSet
oldOri
- Orientation of this object before the orientation change.newOri
- Orientation of this object after the orientation change.IlvGraphicSet.isComponentOrientationSensitive()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.