public class IlvActivityGraphic extends IlvGraphic
IlvActivityGraphic class is used to represent activities in
an IlvGanttSheet. An IlvActivityGraphic is contained
inside an IlvGanttRow object, which in turn is contained inside
a special type of IlvManagerLayer.
An IlvActivityGraphic delegates its rendering,
bounding box, and makeSelection() operations to
an IlvActivityRenderer. In this Flyweight pattern, renderer instances
can be shared across multiple activity graphics, making global application
of formatting possible.| Modifier and Type | Method and Description |
|---|---|
void |
applyTransform(IlvTransformer t)
Overrides the
applyTransform method of the
IlvGraphic class so that it does nothing. |
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of this activity graphic.
|
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests whether a point lies within the boundaries of the activity graphic.
|
IlvGraphic |
copy()
Overrides the
copy method of the IlvGraphic
class. |
void |
draw(Graphics dst,
IlvTransformer t)
Draws the activity graphic.
|
IlvActivity |
getActivity()
Gets the activity represented by the graphic.
|
IlvActivityRenderer |
getActivityRenderer()
Returns the activity renderer used to render this activity.
|
double |
getDefinitionHeight()
Returns the height of the activity graphic's definition rectangle,
in world coordinates.
|
IlvRect |
getDefinitionRect()
Returns the activity graphic's definition rectangle, in world coordinates.
|
IlvRect |
getDefinitionRect(IlvTransformer t)
Returns the activity graphic's definition rectangle, transformed by the
specified
transformer. |
double |
getDefinitionWidth()
Returns the width of the activity graphic's definition rectangle,
in world coordinates.
|
double |
getDefinitionX()
Returns the x coordinate of the activity graphic's definition rectangle,
in world coordinates.
|
double |
getDefinitionY()
Returns the y coordinate of the activity graphic's definition rectangle,
in world coordinates.
|
IlvGanttRow |
getGanttRow()
Returns the Gantt row to which the activity graphic belongs.
|
IlvGanttSheet |
getGanttSheet()
Returns the Gantt sheet to which the activity graphic belongs.
|
JPopupMenu |
getPopupMenu(IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
Returns the Swing pop-up menu to display when the pop-up is triggered
while the mouse pointer is at a specified location inside the activity
graphic object.
|
String |
getToolTipText(IlvPoint p,
IlvTransformer t)
Returns the tooltip text to display when the mouse pointer is at a
specified location inside the activity graphic.
|
boolean |
isLeftToRight()
Returns whether time increases left-to-right in the Gantt sheet.
|
boolean |
isVisible()
Returns
true if the object is visible. |
IlvSelection |
makeSelection()
Creates and returns a selection object for this activity graphic.
|
void |
setActivityRenderer(IlvActivityRenderer renderer)
Sets the specified activity renderer used to render this activity graphic.
|
void |
setDefinitionRect(IlvRect rect)
Sets the definition rectangle of the activity graphic.
|
void |
setGraphicBag(IlvGraphicBag bag)
Changes the bag that contains this object.
|
boolean |
zoomable()
Returns
false to indicate that activity graphics are
not strictly zoomable. |
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getDefaultInteractor, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, localeChanged, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, 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, writepublic IlvActivity getActivity()
IlvActivity.public IlvGanttRow getGanttRow()
IlvGanttRow.public IlvGanttSheet getGanttSheet()
null if the graphic is not contained
in a sheet.public boolean isLeftToRight()
false, then time increases right-to-left in the Gantt sheet.false
indicates that time increases right-to-left.public IlvActivityRenderer getActivityRenderer()
public void setActivityRenderer(IlvActivityRenderer renderer)
renderer - The new renderer.public double getDefinitionX()
bounding box and
rendering area may be smaller or larger than the definition rectangle. This
adjustment can be made in the IlvActivityRenderer.getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer) method
and is usually due to margin insets, labels, or symbols that extend past
the activity end times, and so on.getDefinitionRect(),
getDefinitionRect(IlvTransformer)public double getDefinitionY()
bounding box and
rendering area may be smaller or larger than the definition rectangle. This
adjustment can be made in the IlvActivityRenderer.getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer) method
and is usually due to margin insets, labels, or symbols that extend past
the activity end times, and so on.getDefinitionRect(),
getDefinitionRect(IlvTransformer)public double getDefinitionWidth()
bounding box and
rendering area may be smaller or larger than the definition rectangle. This
adjustment can be made in the IlvActivityRenderer.getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer) method
and is usually due to margin insets, labels, or symbols that extend past
the activity end times, and so on.getDefinitionRect(),
getDefinitionRect(IlvTransformer)public double getDefinitionHeight()
bounding box and
rendering area may be smaller or larger than the definition rectangle. This
adjustment can be made in the IlvActivityRenderer.getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer) method
and is usually due to margin insets, labels, or symbols that extend past
the activity end times, and so on.getDefinitionRect(),
getDefinitionRect(IlvTransformer)public IlvRect getDefinitionRect()
bounding box and
rendering area may be smaller or larger than the definition rectangle. This
adjustment can be made in the IlvActivityRenderer.getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer) method
and is usually due to margin insets, labels, or symbols that extend past
the activity end times, and so on.
This method is typically used when you define a custom
activity render. The renderer's
getBounds method would look something
like:
public IlvRect getBounds(IlvActivityGraphic ag, IlvTransformer t) {
IlvRect box = ag.getDefinitionRect();
... make adjustments to box in world coordinates ...
if (t != null)
t.apply(box);
return box;
}
getDefinitionRect(IlvTransformer)public IlvRect getDefinitionRect(IlvTransformer t)
transformer.
The definition rectangle is the theoretical bounding box of the activity
graphic, in world coordinates, as determined by the row layout algorithm.
Technically, the x position and width of the definition rectangle are
determined by the activity start and end times and the y position and
height of the definition rectangle are determined by the layout algorithm.
The activity graphic's actual bounding box and
rendering area may be smaller or larger than the definition rectangle. This
adjustment can be made in the IlvActivityRenderer.getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer) method
and is usually due to margin insets, labels, or symbols that extend past
the activity end times, and so on.
This method is used by the renderer's
getDefinitionRect method.
t - the transformer.getDefinitionRect()public void setDefinitionRect(IlvRect rect)
bounding box and
rendering area may be smaller or larger than the definition rectangle. This
adjustment can be made in the IlvActivityRenderer.getBounds(ilog.views.gantt.graphic.IlvActivityGraphic, ilog.views.IlvTransformer) method
and is usually due to margin insets, labels, or symbols that extend past
the activity end times, and so on.
Note: This method should only be invoked by the row layout algorithm.
rect - the definition rectangle.public boolean zoomable()
false to indicate that activity graphics are
not strictly zoomable.zoomable in class IlvGraphicIlvGraphic,
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvManagerpublic void draw(Graphics dst, IlvTransformer t)
draw method of the
renderer associated with this activity
graphic.
If you need to change the way the activity is rendered, you should change the renderer. You should not subclass and override this method.
draw in class IlvGraphicdst - The destination where the presentation will be drawn.t - The transformer.IlvGraphic.callDraw(Graphics,IlvTransformer),
IlvGraphic.boundingBox(IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
contains in class IlvGraphicp - The point to be tested.tp - The point p transformed by the transformer
t.t - The transformation used to draw the object.true if the point lies inside this activity graphic.IlvGraphicpublic IlvRect boundingBox(IlvTransformer t)
getBounds method of
the renderer associated with this activity
graphic. Typically, the renderer will use this activity graphic's
definition rect and modify it as needed
(for example, margins, insets, and so on).
Note: Any change to a parameter that influences the result of this method
must be executed inside an
IlvManager.applyToObject(IlvGraphic, IlvApplyObject, Object, boolean)
call. Changes to the renderer through
setActivityRenderer(IlvActivityRenderer) and to the definition
rectangle through setDefinitionRect(IlvRect) are fine; they do the
applyToObject implicitly.
Note: The IlvRect object returned by this method may be
modified by internal methods of Rogue Wave JViews.
boundingBox in class IlvGraphict - The transformer used to draw the object. The value
null can be used for the identity transformer.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer),
IlvGraphic.zoomable(),
IlvGraphicpublic void setGraphicBag(IlvGraphicBag bag)
This method is overridden so that it invalidates internal caches in this object.
setGraphicBag in class IlvGraphicbag - The graphic bag to contain this graphic object.IlvGraphicpublic IlvSelection makeSelection()
makeSelection
method of the renderer associated with this
activity graphic.makeSelection in class IlvGraphicIlvSelection object.IlvDrawSelectionpublic boolean isVisible()
true if the object is visible. The activity is considered not
visible if the containing row is not visible. You do not need to overwrite this
method.isVisible in class IlvGraphicIlvGraphic.setVisible(boolean),
IlvGraphic.setSelectable(boolean),
IlvGraphic.setMovable(boolean),
IlvGraphic.setEditable(boolean)public IlvGraphic copy()
copy method of the IlvGraphic
class. This method always returns null. You
should not use it.copy in class IlvGraphicnull.IlvGraphicpublic void applyTransform(IlvTransformer t)
applyTransform method of the
IlvGraphic class so that it does nothing.
This means that all methods of IlvGraphic that
are using this method will do nothing.
You cannot directly change the shape of an IlvActivityGraphic.
Use instead the API of the data model to change the start or the end time
of the activity.applyTransform in class IlvGraphict - the transformer.IlvGraphicpublic String getToolTipText(IlvPoint p, IlvTransformer t)
getToolTipText
method of the renderer associated with this
activity graphic.getToolTipText in class IlvGraphicp - The location of the mouse (in view coordinates).t - The transformer of the manager view in which the tooltip
is about to be displayed.IlvGraphic,
IlvGraphic.getToolTipText(),
IlvGraphic.setToolTipText(String)public JPopupMenu getPopupMenu(IlvPoint p, IlvTransformer t, IlvManagerView view, IlvPopupMenuManager popupManager)
getPopupMenu
method of the renderer associated with
this activity graphic or else trying the registered pop-up menu with
the name obtained from the getPopupMenuName() method of the renderer
associated with this activity graphic.
This method can return null to turn off the pop-up menu
for this activity graphic object.
Note that you must enable the pop-up menu mechanism for the manager
view by calling the method
IlvGanttSheet.setPopupMenusEnabled(boolean)
getPopupMenu in class IlvGraphicp - The location of the mouse (in view coordinates).t - The transformer that converts the coordinate system of
this object (the manager coordinates) into the
coordinate system of the manager view in which the
tooltip is about to be displayed (the view
coordinates).view - The manager view that triggered the pop-up menu.popupManager - The pop-up menu manager.null.IlvGraphic.getPopupMenu()© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.