ilog.cpl.graphic
Class IlpLeafGraphic

java.lang.Object
  extended by ilog.cpl.graphic.IlpAbstractGraphic
      extended by ilog.cpl.graphic.IlpLeafGraphic
All Implemented Interfaces:
IlpAttachable, IlpGraphic, IlpGraphicContainment, ilog.cpl.graphic.internal.IlpHotSpot

public class IlpLeafGraphic
extends IlpAbstractGraphic
implements ilog.cpl.graphic.internal.IlpHotSpot

This class models an individual graphic, which is drawn by a Java component.

Since:
JTGO 3.0

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 IlpLeafGraphic(IlpGraphicView graphicView, IlpRepresentationObject object)
          Creates a graphic to represent the given object inside the given view.
protected IlpLeafGraphic(IlpGraphicView graphicView, IlpRepresentationObject object, IlpAttribute attribute)
          Creates a graphic to represent an attribute in the given object inside the given view.
  IlpLeafGraphic(IlpGraphicView graphicView, IlpRepresentationObject object, IlpAttribute attribute, JComponent c)
          Creates a graphic to represent an attribute in the given object inside the given view.
  IlpLeafGraphic(IlpGraphicView graphicView, IlpRepresentationObject object, JComponent c)
          Creates a graphic to represent the given object inside the given view.
 
Method Summary
 void addChild(IlpGraphic child)
          Adds a child to this graphic, creating a composite representation.
 void computeAttachmentCoordinates()
          Computes the values of all attachments, recursively traversing the tree.
 void computeFixedCoordinates()
          Prepares the attachment rectangle.
 IlpRect getAttachmentBounds()
          Returns the "attachment rectangle".
 int getChildCount()
          Returns the number of child graphics.
 Collection getChildren()
          Returns a collection with all graphics present in this composite.
 JComponent getComponent()
          Returns the Java component responsible for drawing this object.
 IlpPoint getHotSpot()
          Returns the hotspot.
 void removeChild(IlpGraphic child)
          Removes the given child from this composite graphic.
 void removeChildren()
          Removes all the children.
 void setComponent(JComponent c)
          Sets the component responsible for the drawing of this graphic.
 
Methods inherited from class ilog.cpl.graphic.IlpAbstractGraphic
addGraphicChangeListener, contains, fireEvent, getAttachmentManager, getAttachmentRect, getAttribute, getParent, getRepresentationObject, getRoot, getView, invalidateAttachmentRect, removeGraphicChangeListener, setAttachmentManager, setAttachmentRect, setAttribute, setComponentNoInvalidate, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpLeafGraphic

protected IlpLeafGraphic(IlpGraphicView graphicView,
                         IlpRepresentationObject object)
Creates a graphic to represent the given object inside the given view.

Parameters:
graphicView - View in which the object is being represented.
object - The object that is being represented by this graphic.

IlpLeafGraphic

protected IlpLeafGraphic(IlpGraphicView graphicView,
                         IlpRepresentationObject object,
                         IlpAttribute attribute)
Creates a graphic to represent an attribute in the given object inside the given view.

Parameters:
graphicView - View in which the object is being represented.
object - The object that is being represented.
attribute - The attribute that is being represented by this graphic.

IlpLeafGraphic

public IlpLeafGraphic(IlpGraphicView graphicView,
                      IlpRepresentationObject object,
                      JComponent c)
Creates a graphic to represent the given object inside the given view.

Parameters:
graphicView - View in which the object is being represented.
object - The object that is being represented by this graphic.
c - The Java component being displayed.

IlpLeafGraphic

public IlpLeafGraphic(IlpGraphicView graphicView,
                      IlpRepresentationObject object,
                      IlpAttribute attribute,
                      JComponent c)
Creates a graphic to represent an attribute in the given object inside the given view.

Parameters:
graphicView - View in which the object is being represented.
object - The object that is being represented.
attribute - The attribute that is being represented by this graphic.
c - The Java component being displayed
Method Detail

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()
Prepares the attachment rectangle. This method is called before computeCoordinates. Its job is to set those parts of the attachment rectangle which will not be determined by attachments. This means, normally, computing the size of the graphic object and its subobjects, but it may also mean setting the position of the attachment rectangle.

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!

getComponent

public JComponent getComponent()
Returns the Java component responsible for drawing this object.

Specified by:
getComponent in interface IlpGraphic

setComponent

public void setComponent(JComponent c)
Sets the component responsible for the drawing of this graphic.

Overrides:
setComponent in class IlpAbstractGraphic

addChild

public void addChild(IlpGraphic child)
Adds a child to this graphic, creating a composite representation.

Specified by:
addChild in interface IlpGraphicContainment

removeChild

public void removeChild(IlpGraphic child)
Removes the given child from this composite graphic.

Specified by:
removeChild in interface IlpGraphicContainment

removeChildren

public void removeChildren()
Removes all the children.

Specified by:
removeChildren in interface IlpGraphicContainment

getChildren

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

Specified by:
getChildren in interface IlpGraphicContainment

getChildCount

public int getChildCount()
Returns the number of child graphics.

Specified by:
getChildCount in interface IlpGraphicContainment

getHotSpot

public IlpPoint getHotSpot()
Returns the hotspot. This is a particular point (for example,; the apex of an info-window). It is given in coordinates relative to the upper left corner of getAttachmentBounds().

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


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