|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.gantt.graphic.renderer.IlvActivityGraphicRenderer
public class IlvActivityGraphicRenderer
An IlvActivityGraphicRenderer is an IlvActivityRenderer
implementation that renders activities by delegating to an
IlvGraphic.
| Constructor Summary | |
|---|---|
IlvActivityGraphicRenderer(IlvGraphic graphic)
Creates an IlvActivityGraphicRenderer by using a given
IlvGraphic. |
|
| Method Summary | |
|---|---|
boolean |
contains(IlvActivityGraphic ag,
IlvPoint p,
IlvPoint tp,
IlvTransformer t)
This method is called by an activity graphic to
test whether a point lies within its boundaries. |
void |
draw(Graphics dst,
IlvActivityGraphic ag,
IlvTransformer t)
This method is called by an activity
graphic to render itself. |
float |
getBottomMargin()
Gets the bottom margin of the renderer with respect to the definition rectangle of the activity graphic. |
IlvRect |
getBounds(IlvActivityGraphic ag,
IlvTransformer t)
Returns the rectangle in which the activity graphic should be drawn. |
IlvGraphic |
getGraphic()
Returns the IlvGraphic used to render activities. |
JPopupMenu |
getPopupMenu(IlvActivityGraphic ag,
IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
This method is called by an activity graphic to return the Swing popup menu to display when the popup
is triggered while the mouse pointer is at a specified location inside the
activity graphic object. |
String |
getPopupMenuName()
This method is called by an activity graphic to return
the name of the Swing popup menu. |
String |
getToolTipText()
Returns the tooltip text for the renderer that was set by calling the setToolTipText(java.lang.String) method. |
String |
getToolTipText(IlvActivityGraphic ag,
IlvPoint p,
IlvTransformer t)
This method is called by an activity graphic
to return tooltip text for itself. |
float |
getTopMargin()
Gets the top margin of the renderer with respect to the definition rectangle of the activity graphic. |
boolean |
isRedrawNeeded(ActivityEvent evt)
This method is called by an activity graphic to
determine if it should redraw itself as a result of the specified activity
event. |
IlvSelection |
makeSelection(IlvActivityGraphic g)
This method is called by an activity graphic to create and return a
selection object for itself. |
protected IlvGraphic |
prepareGraphic(IlvActivityGraphic ag,
IlvTransformer t)
Prepares the underlying graphic for drawing by resizing and positioning it according to the renderer's bounds. |
void |
setBackground(Color bg)
Sets the background color of the underlying graphic object. |
void |
setBottomMargin(float margin)
Sets the bottom margin of the renderer with respect to the definition rectangle of the activity graphic. |
void |
setForeground(Color fg)
Sets the foreground color of the underlying graphic object. |
void |
setGraphic(IlvGraphic graphic)
Sets the IlvGraphic used to render activities. |
void |
setPopupMenu(JPopupMenu popup)
Sets the Swing popup menu of this renderer. |
void |
setPopupMenuName(String popupName)
Sets the Swing popup menu of this activity graphic renderer by name. |
void |
setToolTipText(String text)
Sets the tooltip text for the activity renderer. |
void |
setTopMargin(float margin)
Sets the top margin of the renderer with respect to the definition rectangle of the activity graphic. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IlvActivityGraphicRenderer(IlvGraphic graphic)
IlvActivityGraphicRenderer by using a given
IlvGraphic.
graphic - The IlvGraphic used to render activities.| Method Detail |
|---|
public IlvGraphic getGraphic()
IlvGraphic used to render activities.
setGraphic(ilog.views.IlvGraphic)public void setGraphic(IlvGraphic graphic)
IlvGraphic used to render activities. Note that the
foreground and background colors of the old graphic are not copied to the
new one.
graphic - The new IlvGraphic.getGraphic()public void setForeground(Color fg)
fg - The new color.public void setBackground(Color bg)
bg - The new color.public float getTopMargin()
setTopMargin(float),
getBottomMargin(),
getBottomMargin()public void setTopMargin(float margin)
margin - The new proportional top margin. The value is
proportional to the height of the activity graphic. Therefore, it must be
enclosed in the [0.0 1.0] range.getTopMargin(),
getBottomMargin(),
setBottomMargin(float)public float getBottomMargin()
getTopMargin(),
setTopMargin(float),
setBottomMargin(float)public void setBottomMargin(float margin)
margin - The new proportional bottom margin. The value is
proportional to the height of the activity graphic, so the value must
be enclosed in the [0.0 1.0] range.getBottomMargin(),
getTopMargin(),
setTopMargin(float)public String getToolTipText()
setToolTipText(java.lang.String) method. If the text is not null,
this will be the text displayed in the activity graphic's tooltip.
setToolTipText(java.lang.String),
getToolTipText(IlvActivityGraphic,IlvPoint,IlvTransformer)public void setToolTipText(String text)
text - The tooltip text. If null, the activity
graphic will display the
tooltip text
of the renderer's underlying graphic.getToolTipText(),
getToolTipText(IlvActivityGraphic,IlvPoint,IlvTransformer)
public IlvRect getBounds(IlvActivityGraphic ag,
IlvTransformer t)
definitionRect of the activity graphic, while taking
the top and
bottom margins of the renderer into account.
getBounds in interface IlvActivityRendererag - The activity graphic.t - The transformer.
public boolean contains(IlvActivityGraphic ag,
IlvPoint p,
IlvPoint tp,
IlvTransformer t)
activity graphic to
test whether a point lies within its boundaries.
contains in interface IlvActivityRendererag - The activity graphic.p - 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.
protected IlvGraphic prepareGraphic(IlvActivityGraphic ag,
IlvTransformer t)
bounds.
ag - The activity graphic holding the position where the presentation
should be drawn.t - The transformer.
public void draw(Graphics dst,
IlvActivityGraphic ag,
IlvTransformer t)
activity
graphic to render itself.
draw in interface IlvActivityRendererdst - The destination into which the presentation will be drawn.ag - The activity graphic holding the position where the presentation
should be drawn.t - The transformer.public boolean isRedrawNeeded(ActivityEvent evt)
activity graphic to
determine if it should redraw itself as a result of the specified activity
event. This default implementation always returns false.
Subclasses should override this method as needed.
isRedrawNeeded in interface IlvActivityRendererevt - The activity event.
public IlvSelection makeSelection(IlvActivityGraphic g)
activity graphic to create and return a
selection object for itself. This default implementation returns an IlvActivityGraphicSelection instance.
Note, that the selection object must be compatible with all activity renderer implementations in use, not just the
specific renderer implementation that this method is invoked on. This is because the renderer assigned to an
activity graphic may change while the activity graphic remains selected. The IlvActivityGraphicSelection
returned by this implementation is generic and is compatible with all renderer implementations.
makeSelection in interface IlvActivityRendererg - The activity graphic.
public String getToolTipText(IlvActivityGraphic ag,
IlvPoint p,
IlvTransformer t)
activity graphic
to return tooltip text for itself. If you have set a tooltip by calling the
setToolTipText(java.lang.String) method, then that text is returned. Otherwise,
this default implementation returns the
tooltip text
from the renderer's underlying graphic.
getToolTipText in interface IlvActivityRendererag - The activity graphic.p - The location of the mouse (in view coordinates).t - The transformer.
public void setPopupMenu(JPopupMenu popup)
Popup menus for ILOG JViews activity graphic renderers will work only
if you enable the popup menu mechanism for the Gantt sheet view by
calling the method
IlvGanttSheet.setPopupMenusEnabled(boolean).
For performance reasons, it is strongly recommended that activity graphic renderers share the same popup menu whenever possible.
popup - The Swing popup menu to be used for this activity graphic
renderer. If popup is null, the
popup menu is turned off for this activity graphic renderer.IlvPopupMenuManager,
setPopupMenuName(String),
getPopupMenu(IlvActivityGraphic, IlvPoint, IlvTransformer,
IlvManagerView, IlvPopupMenuManager)
public JPopupMenu getPopupMenu(IlvActivityGraphic ag,
IlvPoint p,
IlvTransformer t,
IlvManagerView view,
IlvPopupMenuManager popupManager)
activity graphic to return the Swing popup menu to display when the popup
is triggered while the mouse pointer is at a specified location inside the
activity graphic object. If you have set a popup menu by calling the
setPopupMenu(javax.swing.JPopupMenu) method, then that popup menu is returned. Otherwise,
this default implementation returns the
popup menu
from the underlying graphic of the renderer.
This method can return null to turn off the popup menu for
this activity graphic object.
Note that you must enable the popup menu mechanism for the manager view by
calling the method
IlvGanttSheet.setPopupMenusEnabled(boolean)
getPopupMenu in interface IlvActivityRendererag - The activity graphic.p - 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
tool tip is about to be displayed (the view coordinates).view - The manager view that triggered the popup menu.popupManager - The popup menu manager.
null.IlvGraphic.getPopupMenu()public void setPopupMenuName(String popupName)
This is an alternative way of setting the popup menu of this renderer.
You need to register a Swing popup menu for the name through
IlvPopupMenuManager.registerMenu(String, JPopupMenu) and use
the name to specify the popup menu of this activity graphic renderer.
Popup menus for ILOG JViews activity graphic renderers will work only
if your manager view is contained in a hierarchy of Swing components.
In addition, you must enable the popup menu mechanism for the Gantt
sheet view by calling the method
IlvGanttSheet.setPopupMenusEnabled(boolean).
popupName - The name of the registered Swing popup menu to be used
for this activity graphic renderer.
If popupName is null, the
popup menu is turned off for this activity graphic renderer.IlvPopupMenuManager,
getPopupMenuName()public String getPopupMenuName()
activity graphic to return
the name of the Swing popup menu. If you have set a popup menu name
by calling the setPopupMenuName(java.lang.String) method, then that popup menu
name is returned. Otherwise, this default implementation returns the
popup menu name
from ther underlying graphic of the renderer.
This method can return null.
getPopupMenuName in interface IlvActivityRenderernull.IlvActivityGraphic.getPopupMenu(IlvPoint, IlvTransformer,
IlvManagerView, IlvPopupMenuManager),
setPopupMenuName(String)
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||