ilog.tgo.composite
Class IltcGraphicElementAggregate

java.lang.Object
  extended by ilog.tgo.composite.internal.IltcGraphicChild
      extended by ilog.tgo.composite.IltcGraphicElementAggregate
All Implemented Interfaces:
IlpAttachable, IlpAttachmentManager, IlpGraphic, IlpGraphicContainment, ilog.cpl.graphic.internal.IlpGraphicModifier, ilog.tgo.composite.internal.IltcGraphicModifier
Direct Known Subclasses:
IltGraphicElementAggregate

public abstract class IltcGraphicElementAggregate
extends ilog.tgo.composite.internal.IltcGraphicChild
implements IlpAttachmentManager, IlpGraphic

This class implements a composite graphic which contains a list of children decorations.

Since:
JTGO 1.0

Field Summary
protected  List _children
          The child nodes.
 
Fields inherited from class ilog.tgo.composite.internal.IltcGraphicChild
_attachmanager, _attachrect, _attribute, _component, _listenerSupport
 
Fields inherited from interface ilog.cpl.graphic.IlpGraphic
AlarmBalloonBorderColor, AlarmBalloonColor, AlarmBalloonOrientation, AlarmBalloonPointerDepth, AlarmBalloonPointerDistance, AlarmBalloonRadius, AlarmBalloonShadowColor, AlarmBalloonShadowThickness, AlarmCountLabelBackgroundColor, AlarmCountOuterBorderColor, CenteredInsets, InfoBalloonBorderColor, InfoBalloonColor, InfoBalloonOrientation, InfoBalloonPointerDepth, InfoBalloonShadowColor, InfoBalloonShadowThickness, StackerAlignment, StackerOrientation, StackerSpacing
 
Constructor Summary
IltcGraphicElementAggregate(IlpAttribute attr, IlpAttachmentManager attachmanager)
          Constructs a new instance, associated with a distinguished graphic object.
 
Method Summary
 void addChild(IlpGraphic graphic)
          Adds a new child node.
 void addChild(IlpGraphic graphic, IlpAttachment attachment)
          Adds a new child graphic with the given attachment rule.
 void apply(ilog.cpl.graphic.internal.IlpApplyToGraphic f)
          Applies the given function to the graphic.
 void apply(ilog.cpl.graphic.internal.IlpApplyToGraphic f, boolean postOrder)
          Applies the given function to the graphic in the given order.
 void apply(ilog.tgo.composite.internal.IltcApplyToElement f)
          Recursively applies a function to all leaves.
 void apply(IlvApplyObject f, Object arg)
          Recursively applies a function to all leaves.
 Object call(ilog.cpl.graphic.views.internal.IlpCallObject f)
          Recursively applies a function to all leaves, and returns the first non-null value produced.
 Object call(ilog.cpl.graphic.internal.IlpCallOnGraphic f)
          Recursively applies a function to all leaves, and returns the first non-null value produced.
 Object call(ilog.tgo.composite.internal.IltcCallOnElement f)
          Recursively applies a function to all leaves, and returns the first non-null value produced.
 ilog.tgo.composite.internal.IltcGraphicChild childAt(int n)
          Returns the n-th child in the hierarchy, in the order of the collection getChildren().
 void computeAttachmentBounds()
          Computes the composite attachment bounds based on the children bounds.
 void computeAttachmentCoordinates()
          Computes the values of all attachments, recursively traversing the tree.
 void computeAttachmentCoordinates(IlpGraphic graphic)
          Computes the attachment coordinates of this composite graphic.
protected  void computeChildrenAttachmentCoordinates()
          Compute the attachment coordinates of the children graphics.
 void computeFixedCoordinates()
          This methods prepares the attachment rectangle.
 boolean contains(Point p)
          Returns if the given point is contained in this graphic instance.
 IlpAttachment getAttachment(IlpGraphic graphic)
          Returns the attachment of the given graphic object.
 IlpRect getAttachmentBounds()
          Returns the "attachment rectangle".
 IlpGraphic getBase()
          Get the base element.
 IlvRect getBoundingBox()
          Returns the bounding box of the set of IlvGraphic objects associated with this object.
 int getChildCount()
          Returns the number of all children in the hierarchy.
 Collection getChildren()
          Returns a collection with all graphics present in this composite.
 JComponent getComponent()
          Returns the Java component responsible for the display of this graphic.
 void removeChild(IlpGraphic graphic)
          Removes a child node.
 void removeChildren()
          Removes all children objects.
 void setAttachment(IlpGraphic graphic, IlpAttachment attachment)
          Attaches the corresponding graphic object to another one.
 
Methods inherited from class ilog.tgo.composite.internal.IltcGraphicChild
addGraphicChangeListener, fireEvent, getAttachmentManager, getAttribute, getParent, getRepresentationObject, getRootGraphic, getView, isVisible, removeGraphicChangeListener, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.cpl.graphic.IlpGraphic
addGraphicChangeListener, fireEvent, getAttribute, getParent, getRepresentationObject, getView, removeGraphicChangeListener, setParent
 
Methods inherited from interface ilog.cpl.graphic.attachment.IlpAttachable
getAttachmentManager
 

Field Detail

_children

protected List _children
The child nodes. List of all graphics present in this composite

Internal method or field: do not use!
Constructor Detail

IltcGraphicElementAggregate

public IltcGraphicElementAggregate(IlpAttribute attr,
                                   IlpAttachmentManager attachmanager)
Constructs a new instance, associated with a distinguished graphic object.

Internal method or field: do not use!
Method Detail

getBase

public IlpGraphic getBase()
Get the base element.

Internal method or field: do not use!

addChild

public void addChild(IlpGraphic graphic,
                     IlpAttachment attachment)
Adds a new child graphic with the given attachment rule.

Internal method or field: do not use!

getAttachmentBounds

public IlpRect getAttachmentBounds()
Returns the "attachment rectangle". All attachments are relative to this rectangle. Attachment constraints modify the attachment rectangle to exert their effects.

Specified by:
getAttachmentBounds in interface IlpAttachable
Returns:
bound rectangle
Internal method or field: do not use!

computeFixedCoordinates

public void computeFixedCoordinates()
This methods prepares the attachment rectangle. All children graphics are verified and their attachment rectangle is set to its preferred size. The attachment rectangle has always the (x, y) position set to (0,0). Later on, the method computeAttachmentCoordinates will calculate the appropriate (x,y) position based on the attachment rules.

Specified by:
computeFixedCoordinates in interface IlpAttachable
Internal method or field: do not use!

computeAttachmentCoordinates

public void computeAttachmentCoordinates()
Computes the values of all attachments, recursively traversing the tree. After calculating the attachment coordinates for the children graphics, we can calculate the attachment rectangle for this composite graphic and then attach it to the appropriate position. The composite graphic attachment rectangle will only be correct after calling this method.

Specified by:
computeAttachmentCoordinates in interface IlpAttachable
Internal method or field: do not use!

computeChildrenAttachmentCoordinates

protected void computeChildrenAttachmentCoordinates()
Compute the attachment coordinates of the children graphics.

Internal method or field: do not use!

computeAttachmentBounds

public void computeAttachmentBounds()
Computes the composite attachment bounds based on the children bounds. This method can only be called after computing the attachment coordinates of the children graphics.

Internal method or field: do not use!

getAttachment

public IlpAttachment getAttachment(IlpGraphic graphic)
Returns the attachment of the given graphic object.

Specified by:
getAttachment in interface IlpAttachmentManager

setAttachment

public void setAttachment(IlpGraphic graphic,
                          IlpAttachment attachment)
Attaches the corresponding graphic object to another one.

Specified by:
setAttachment in interface IlpAttachmentManager

computeAttachmentCoordinates

public void computeAttachmentCoordinates(IlpGraphic graphic)
Computes the attachment coordinates of this composite graphic.

Specified by:
computeAttachmentCoordinates in interface IlpAttachmentManager
Internal method or field: do not use!

getComponent

public JComponent getComponent()
Returns the Java component responsible for the display of this graphic.

Specified by:
getComponent in interface IlpGraphic
Internal method or field: do not use!

contains

public boolean contains(Point p)
Returns if the given point is contained in this graphic instance.

Specified by:
contains in interface IlpGraphic
Internal method or field: do not use!

getChildren

public Collection getChildren()
Returns a collection with all graphics present in this composite.

Specified by:
getChildren in interface IlpGraphicContainment
Internal method or field: do not use!

getChildCount

public int getChildCount()
Returns the number of all children in the hierarchy.

Specified by:
getChildCount in interface IlpGraphicContainment
Internal method or field: do not use!

childAt

public ilog.tgo.composite.internal.IltcGraphicChild childAt(int n)
Returns the n-th child in the hierarchy, in the order of the collection getChildren().

Internal method or field: do not use!

addChild

public void addChild(IlpGraphic graphic)
Adds a new child node.

Specified by:
addChild in interface IlpGraphicContainment
Internal method or field: do not use!

removeChild

public void removeChild(IlpGraphic graphic)
Removes a child node.

Specified by:
removeChild in interface IlpGraphicContainment
Internal method or field: do not use!

removeChildren

public void removeChildren()
Removes all children objects.

Specified by:
removeChildren in interface IlpGraphicContainment
Internal method or field: do not use!

apply

public void apply(ilog.tgo.composite.internal.IltcApplyToElement f)
Recursively applies a function to all leaves.

Specified by:
apply in interface ilog.tgo.composite.internal.IltcGraphicModifier
Internal method or field: do not use!

apply

public void apply(IlvApplyObject f,
                  Object arg)
Recursively applies a function to all leaves.

Specified by:
apply in interface ilog.tgo.composite.internal.IltcGraphicModifier
Internal method or field: do not use!

call

public Object call(ilog.tgo.composite.internal.IltcCallOnElement f)
Recursively applies a function to all leaves, and returns the first non-null value produced.

Specified by:
call in interface ilog.tgo.composite.internal.IltcGraphicModifier
Internal method or field: do not use!

call

public Object call(ilog.cpl.graphic.views.internal.IlpCallObject f)
Recursively applies a function to all leaves, and returns the first non-null value produced.

Specified by:
call in interface ilog.tgo.composite.internal.IltcGraphicModifier
Internal method or field: do not use!

apply

public void apply(ilog.cpl.graphic.internal.IlpApplyToGraphic f)
Applies the given function to the graphic. In case of composite graphic instances, the function is applied just to the leaves of the composite tree hierarchy.

Specified by:
apply in interface ilog.cpl.graphic.internal.IlpGraphicModifier
Internal method or field: do not use!

apply

public void apply(ilog.cpl.graphic.internal.IlpApplyToGraphic f,
                  boolean postOrder)
Applies the given function to the graphic in the given order. In case of composite graphic instances, the function is applied to all nodes that are part of the composite tree hierarchy, leave nodes and intermediary nodes. The order defined if the intermediary nodes will have the function applied before or after their children.

Specified by:
apply in interface ilog.cpl.graphic.internal.IlpGraphicModifier
Internal method or field: do not use!

call

public Object call(ilog.cpl.graphic.internal.IlpCallOnGraphic f)
Recursively applies a function to all leaves, and returns the first non-null value produced.

Specified by:
call in interface ilog.cpl.graphic.internal.IlpGraphicModifier
Internal method or field: do not use!

getBoundingBox

public IlvRect getBoundingBox()
Returns the bounding box of the set of IlvGraphic objects associated with this object.

Specified by:
getBoundingBox in class ilog.tgo.composite.internal.IltcGraphicChild
Internal method or field: do not use!


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