ilog.tgo.composite
Class IltcCompositeGraphic

java.lang.Object
  extended by ilog.tgo.composite.IltcCompositeGraphic
All Implemented Interfaces:
IlpAttachable, IlpGraphic, IlpGraphicContainment, ilog.cpl.graphic.internal.IlpGraphicModifier, ilog.tgo.composite.internal.IltcGraphicModifier, IltWithProperties, IlWithProperties
Direct Known Subclasses:
IltCompositeGraphic

public class IltcCompositeGraphic
extends Object
implements IlpGraphic, ilog.tgo.composite.internal.IltcGraphicModifier, IltWithProperties

This class describes a composite graphic object. These objects are managed by an IltcCompositeManager.

Since:
JTGO 1.0
See Also:
IltcCompositeManager

Field Summary
 
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
protected IltcCompositeGraphic()
          Default constructor.
 
Method Summary
 IltcCompositeManager _getManager()
          Returns the IltcCompositeManager containing this composite graphic object, or null if it is currently not in a manager.
 void addChild(IlpGraphic graphic)
          Adds a new child node.
 void addGraphicChangeListener(GraphicChangeListener l)
          Adds a new listener to this graphic.
 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.
 void applyTransform(IlvTransformer t)
          Deprecated. Please use the two-argument applyTransform method instead.
 void applyTransform(IlvTransformer t, IlpPositionSource reason)
          Applies a transform to this graphic object as a whole.
 void applyZoomTransform(IlvTransformer t)
          Applies a transform to this graphic object as a whole, but note it is a zoom transform; the logical position/shape of the object shouldn't change.
 IlvRect boundingBoxAllParts(IlvTransformer t)
          Returns the bounding box of all subobjects of the composite graphic object.
 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.
 void computeAttachmentCoordinates()
          Computes the values of all attachments, recursively traversing the tree.
 void computeFixedCoordinates()
          Prepares the attachment rectangle.
 boolean contains(Point p)
          Returns if the given point is contained in this graphic instance.
 boolean containsAllParts(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Tests if a point lies within any of the subobjects of the composite graphic object.
 ilog.tgo.composite.internal.IltcCompositePart createCompositePart(IltcLayer macroLayer)
          Returns a new per-layer part for this graphic object.
 ilog.tgo.composite.internal.IltcCompositeInteractiveProxy createLinkInteractiveProxy()
          Returns a new link interactive proxy for this graphic object.
 ilog.tgo.composite.internal.IltcCompositeLinkLayoutProxy createLinkLayoutProxy(IltcCompositeGraphic from, IltcCompositeGraphic to)
          Returns a new link layout proxy for this graphic object.
 ilog.tgo.composite.internal.IltcCompositeInteractiveProxy createNodeInteractiveProxy()
          Returns a new interactive proxy for this graphic object.
 ilog.tgo.composite.internal.IltcCompositeLayoutProxy createNodeLayoutProxy()
          Returns a new layout proxy for this graphic object.
 void dispose()
          Helps garbage collection when this object is not needed any more.
 void drawAllParts(Graphics g, IlvTransformer t)
          Draws all subobjects of the composite graphic object.
 void drawAllPartsCorrectly(Graphics g, IlvTransformer t)
          Draws all subobjects of the composite graphic object.
protected  void drawGhost(Graphics g, IlvTransformer t)
          Draws an outline of the composite graphic object.
 void drawGhostCorrectly(Graphics g, IlvTransformer t)
          Draws an outline of the composite graphic object.
protected  void dropResources()
           
 void fireEvent(GraphicChangeEvent ev)
          Fires a change event to the listeners.
 IlpRect getAttachmentBounds()
          Returns the "attachment rectangle".
 IlpAttachmentManager getAttachmentManager()
          Returns the instance responsible for calculating the attachment for this graphic.
 IlpAttribute getAttribute()
          Returns the attribute that this graphic is representing.
 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.
 IltcGraphicElementAggregate getHierarchyRoot()
          Returns the root of the hierarchy.
 ilog.tgo.composite.internal.IltcCompositeInteractiveProxy getInteractiveProxy()
          Returns the IlvGraphic that represents this composite graphic object, or null if it is currently not in a manager.
 IlvObjectInteractor getInteractor(ilog.tgo.composite.internal.IltcGraphicElement g)
          Returns the interactor to be positioned on a graphic element.
 IlvGraphic getLayoutProxy()
           
 Object getLayoutProxyShape()
          Returns the information about the layout proxy that is relevant for layout purposes.
 IlpGraphic getParent()
          Returns the parent node in the hierarchy, null if this is a root.
 Object getProperty(Object name)
          Returns the named property.
 IlvGraphic getProxy()
          Returns the IlvGraphic that represents this composite graphic object for layout purposes, or null if it is currently not in a manager or not considered by the layout.
 IlpRepresentationObject getRepresentationObject()
          Returns the object that this instance is representing.
 IlpGraphicView getView()
          Returns the view where this graphic is being used.
 void invalidateRegion(ilog.tgo.composite.internal.IltcGraphicElement g)
          Marks a graphic element for later redraw.
 boolean isInteractiveProxyPresent()
           
 boolean isLayoutProxyPresent()
           
 boolean isMovable()
          Returns if the given object can be moved or not through user interactions.
 boolean isSelectable()
          Returns true if the graphic object shall be treated as selectable by the IlvManager and IlvSelectInteractor.
protected  boolean isSelected()
          Returns if the composite graphic shall appear selected or not.
 void layoutProxyApplyTransform(IlvTransformer translation)
          Reacts to an applyTransform request from the layout proxy.
 IlvRect layoutProxyBoundingBox(IlvTransformer t, boolean topleftOnePixelCorrection)
          Returns the bounding box of the layout proxy.
 IlvRect linkConnectionRect()
          Returns the rectangle to which links can connect.
 IlvRect linkConnectionRect(float magnification, boolean topleftOnePixelCorrection)
          Returns the rectangle to which links can connect.
 IlvSelection makeSelection()
          Returns the graphic object which shall be displayed in the topmost layer while the composite graphic object is selected.
 void noteAddToCompositeManager(IltcCompositeManager manager)
          This function is called when the graphic object is being added to a manager.
 void noteRemoveFromCompositeManager(IltcCompositeManager manager)
          This function is called when the graphic object is is being removed from a manager.
 void reinitLayoutProxy()
           
 void reinitLayoutProxy(IlvGraphic newProxy)
           
 void removeChild(IlpGraphic graphic)
          Removes a child node.
 void removeChildren()
          Removes all children objects.
 void removeGraphicChangeListener(GraphicChangeListener l)
          Removes a listener from the list.
 void removeProperty(Object name)
          Removes the named property.
 void setAttribute(IlpAttribute attribute)
          Sets the attribute that this graphic is representing.
 void setHierarchyRoot(IltcGraphicElementAggregate elements)
          Sets the root of the hierarchy.
 void setInteractiveProxyPresent(boolean present)
           
 void setLayoutProxyPresent(boolean present)
           
 void setParent(IlpGraphic g)
          This operation is not supported because IltcCompositeGraphic instances are always the parent graphic.
 void setProperty(Object name, Object value)
          Sets the named property.
 void setRepresentationObject(IlpRepresentationObject ro)
          Sets the object that this instance is representing.
 void setSelected(boolean selected)
          Changes the composite graphic object so that is appears selected.
 void setView(IlpGraphicView view)
          Sets the graphic view for this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IltcCompositeGraphic

protected IltcCompositeGraphic()
Default constructor.

Since:
JTGO 1.0
Method Detail

getView

public IlpGraphicView getView()
Returns the view where this graphic is being used.

Specified by:
getView in interface IlpGraphic
Since:
JTGO 3.0

setView

public void setView(IlpGraphicView view)
Sets the graphic view for this instance.

Since:
JTGO 3.0
Internal method or field: do not use!

getRepresentationObject

public IlpRepresentationObject getRepresentationObject()
Returns the object that this instance is representing.

Specified by:
getRepresentationObject in interface IlpGraphic
Since:
JTGO 3.0

setRepresentationObject

public void setRepresentationObject(IlpRepresentationObject ro)
Sets the object that this instance is representing.

Since:
JTGO 3.0
Internal method or field: do not use!

setAttribute

public void setAttribute(IlpAttribute attribute)
Sets the attribute that this graphic is representing.

Since:
JTGO 3.0
Internal method or field: do not use!

getAttribute

public IlpAttribute getAttribute()
Returns the attribute that this graphic is representing.

Specified by:
getAttribute in interface IlpGraphic
Since:
JTGO 3.0

getComponent

public JComponent getComponent()
Returns the Java component responsible for the display of this graphic. This operation is not supported in IltcCompositeGraphic. The respective component can only be created using the IltComponentManager and IltObject API.

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

addGraphicChangeListener

public void addGraphicChangeListener(GraphicChangeListener l)
Adds a new listener to this graphic.

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

removeGraphicChangeListener

public void removeGraphicChangeListener(GraphicChangeListener l)
Removes a listener from the list.

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

fireEvent

public void fireEvent(GraphicChangeEvent ev)
Fires a change event to the listeners.

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

getParent

public IlpGraphic getParent()
Returns the parent node in the hierarchy, null if this is a root.

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

setParent

public void setParent(IlpGraphic g)
This operation is not supported because IltcCompositeGraphic instances are always the parent graphic.

Specified by:
setParent 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!

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!

getAttachmentManager

public IlpAttachmentManager getAttachmentManager()
Returns the instance responsible for calculating the attachment for this graphic.

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

computeFixedCoordinates

public void computeFixedCoordinates()
Prepares the attachment rectangle. This is called before computeAttachmentCoordinates. Its job is to set those parts of the attachment rectangle which will not be determined by attachments. This means, normally, to compute the size of the graphic object and its sub-objects, but may set the attachment rectangle's position too.

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.

Specified by:
computeAttachmentCoordinates in interface IlpAttachable
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!

addChild

public void addChild(IlpGraphic graphic)
Adds a new child node. The user is not allowed to add graphic instances directly in the IltcCompositeGraphic. This must be done through IltCompositeGraphic.computeVisible, when the whole aggregate hierarchy is rebuilt.

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

removeChild

public void removeChild(IlpGraphic graphic)
Removes a child node. The user is not allowed to add graphic instances directly in the IltcCompositeGraphic. This must be done through IltCompositeGraphic.computeVisible, when the whole aggregate hierarchy is rebuilt.

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

removeChildren

public void removeChildren()
Removes all children objects. The user is not allowed to add graphic instances directly in the IltcCompositeGraphic. This must be done through IltCompositeGraphic.computeVisible, when the whole aggregate hierarchy is rebuilt.

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!

getHierarchyRoot

public IltcGraphicElementAggregate getHierarchyRoot()
Returns the root of the hierarchy.

Internal method or field: do not use!

setHierarchyRoot

public void setHierarchyRoot(IltcGraphicElementAggregate elements)
Sets the root of the hierarchy. This must be called only once, when constructing the hierarchy of elements.

Internal method or field: do not use!

applyTransform

public void applyTransform(IlvTransformer t)
Deprecated. Please use the two-argument applyTransform method instead.

Applies a transform to this graphic object as a whole.

Deprecated Since:
JTGO 3.0

applyTransform

public void applyTransform(IlvTransformer t,
                           IlpPositionSource reason)
Applies a transform to this graphic object as a whole.

Parameters:
t - The transformer.
reason - The reason for the transform, or null if unknown

applyZoomTransform

public void applyZoomTransform(IlvTransformer t)
Applies a transform to this graphic object as a whole, but note it is a zoom transform; the logical position/shape of the object shouldn't change.

Internal method or field: do not use!

getInteractor

public IlvObjectInteractor getInteractor(ilog.tgo.composite.internal.IltcGraphicElement g)
Returns the interactor to be positioned on a graphic element. null means no interactor. This function is called by the manager.

The default implementation always returns null; subclasses may want to override it.

Note: If an application wishes to change the interactor of an existing graphic element, it is not sufficient to ensure that getInteractor returns the new value. Additionally, the application must position the new interactor through the manager.

Internal method or field: do not use!

linkConnectionRect

public IlvRect linkConnectionRect()
Returns the rectangle to which links can connect.

Internal method or field: do not use!

linkConnectionRect

public IlvRect linkConnectionRect(float magnification,
                                  boolean topleftOnePixelCorrection)
Returns the rectangle to which links can connect.

Parameters:
magnification - magnification factor, a hint for the computations, > 0
Internal method or field: do not use!

layoutProxyBoundingBox

public IlvRect layoutProxyBoundingBox(IlvTransformer t,
                                      boolean topleftOnePixelCorrection)
Returns the bounding box of the layout proxy.

Internal method or field: do not use!

layoutProxyApplyTransform

public void layoutProxyApplyTransform(IlvTransformer translation)
Reacts to an applyTransform request from the layout proxy. Usually called via IlvGrapherAdapter.moveNode.

Internal method or field: do not use!

createCompositePart

public ilog.tgo.composite.internal.IltcCompositePart createCompositePart(IltcLayer macroLayer)
Returns a new per-layer part for this graphic object.

Internal method or field: do not use!

createNodeLayoutProxy

public ilog.tgo.composite.internal.IltcCompositeLayoutProxy createNodeLayoutProxy()
Returns a new layout proxy for this graphic object.

Internal method or field: do not use!

createLinkLayoutProxy

public ilog.tgo.composite.internal.IltcCompositeLinkLayoutProxy createLinkLayoutProxy(IltcCompositeGraphic from,
                                                                                      IltcCompositeGraphic to)
Returns a new link layout proxy for this graphic object.

Internal method or field: do not use!

createNodeInteractiveProxy

public ilog.tgo.composite.internal.IltcCompositeInteractiveProxy createNodeInteractiveProxy()
Returns a new interactive proxy for this graphic object.

Returns:
not an instance of IlvPolyPointsInterface
Internal method or field: do not use!

createLinkInteractiveProxy

public ilog.tgo.composite.internal.IltcCompositeInteractiveProxy createLinkInteractiveProxy()
Returns a new link interactive proxy for this graphic object.

Returns:
an instance of IlvPolyPointsInterface
Internal method or field: do not use!

drawGhostCorrectly

public void drawGhostCorrectly(Graphics g,
                               IlvTransformer t)
Draws an outline of the composite graphic object.

Parameters:
g - a graphics context in XOR mode
t - a transformer, normally composed from the view's transformer and a translation

drawGhost

protected void drawGhost(Graphics g,
                         IlvTransformer t)
Draws an outline of the composite graphic object.

The default implementation draws all subobjects. Subclasses may want to override this in order to draw a simpler figure.

Parameters:
g - a graphics context in XOR mode
Internal method or field: do not use!

drawAllPartsCorrectly

public void drawAllPartsCorrectly(Graphics g,
                                  IlvTransformer t)
Draws all subobjects of the composite graphic object.

Parameters:
t - a transformer, normally composed from the view's transformer and a translation
Internal method or field: do not use!

drawAllParts

public void drawAllParts(Graphics g,
                         IlvTransformer t)
Draws all subobjects of the composite graphic object.

Internal method or field: do not use!

boundingBoxAllParts

public IlvRect boundingBoxAllParts(IlvTransformer t)
Returns the bounding box of all subobjects of the composite graphic object.

Internal method or field: do not use!

containsAllParts

public boolean containsAllParts(IlvPoint p,
                                IlvPoint tp,
                                IlvTransformer t)
Tests if a point lies within any of the subobjects of the composite graphic object.

Internal method or field: do not use!

invalidateRegion

public void invalidateRegion(ilog.tgo.composite.internal.IltcGraphicElement g)
Marks a graphic element for later redraw.

Internal method or field: do not use!

isSelectable

public boolean isSelectable()
Returns true if the graphic object shall be treated as selectable by the IlvManager and IlvSelectInteractor.

Internal method or field: do not use!

makeSelection

public IlvSelection makeSelection()
Returns the graphic object which shall be displayed in the topmost layer while the composite graphic object is selected.

The default implementation returns an invisible object.

Internal method or field: do not use!

setSelected

public void setSelected(boolean selected)
Changes the composite graphic object so that is appears selected.

Internal method or field: do not use!

isSelected

protected final boolean isSelected()
Returns if the composite graphic shall appear selected or not.

Returns:
Selected state
Since:
JViews 7.5

noteAddToCompositeManager

public void noteAddToCompositeManager(IltcCompositeManager manager)
This function is called when the graphic object is being added to a manager.

Internal method or field: do not use!

noteRemoveFromCompositeManager

public void noteRemoveFromCompositeManager(IltcCompositeManager manager)
This function is called when the graphic object is is being removed from a manager.

Internal method or field: do not use!

getProperty

public Object getProperty(Object name)
Returns the named property.

Specified by:
getProperty in interface IlWithProperties
Parameters:
name - Property identifier
Returns:
Returns the client property value.

setProperty

public void setProperty(Object name,
                        Object value)
Sets the named property.

Specified by:
setProperty in interface IlWithProperties
Parameters:
name - Property identifier
value - Property value

removeProperty

public void removeProperty(Object name)
Removes the named property.

Specified by:
removeProperty in interface IlWithProperties

_getManager

public final IltcCompositeManager _getManager()
Returns the IltcCompositeManager containing this composite graphic object, or null if it is currently not in a manager.

Internal method or field: do not use!

reinitLayoutProxy

public void reinitLayoutProxy(IlvGraphic newProxy)
Internal method or field: do not use!

reinitLayoutProxy

public void reinitLayoutProxy()
Internal method or field: do not use!

getLayoutProxy

public IlvGraphic getLayoutProxy()
Internal method or field: do not use!

isLayoutProxyPresent

public boolean isLayoutProxyPresent()
Internal method or field: do not use!

setLayoutProxyPresent

public void setLayoutProxyPresent(boolean present)
Internal method or field: do not use!

getProxy

public IlvGraphic getProxy()
Returns the IlvGraphic that represents this composite graphic object for layout purposes, or null if it is currently not in a manager or not considered by the layout. This returns a proxy with the right geometric properties, but no graphic properties at all.


dropResources

protected void dropResources()
Internal method or field: do not use!

getLayoutProxyShape

public Object getLayoutProxyShape()
Returns the information about the layout proxy that is relevant for layout purposes. The result must support equals.

Internal method or field: do not use!

getInteractiveProxy

public ilog.tgo.composite.internal.IltcCompositeInteractiveProxy getInteractiveProxy()
Returns the IlvGraphic that represents this composite graphic object, or null if it is currently not in a manager. This returns a proxy with the right geometric properties, but no graphic properties at all.

Internal method or field: do not use!

isInteractiveProxyPresent

public boolean isInteractiveProxyPresent()
Internal method or field: do not use!

setInteractiveProxyPresent

public void setInteractiveProxyPresent(boolean present)
Internal method or field: do not use!

isMovable

public boolean isMovable()
Returns if the given object can be moved or not through user interactions.

Since:
JTGO 4.0
Internal method or field: do not use!

dispose

public void dispose()
Helps garbage collection when this object is not needed any more.

Internal method or field: do not use!


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