public class IlvActivityGraphicSelection extends IlvHandlesSelection implements IlvActivitySelection
IlvActivityGraphicSelection
object is the default selection
object for IlvActivityGraphic
. This class draws a number of handles.
The user can drag the handles horizontally and thus modify the specific time
points of the activity.
In the simplest case, it draws two handles, respectively on the right and on the left side of the definition rectangle of the activity graphic. By dragging the handles, the user can edit the start and end time of the activity.
The interactor that allows you to move the handles is the class
IlvActivityGraphicReshapeInteractor
.
CIRCLE_SHAPE, defaultHandleBackgroundColor, defaultHandleColor, defaultHandleShape, defaultHandleSize, FILLED_CIRCLE_SHAPE, FILLED_SQUARE_SHAPE, SQUARE_SHAPE
Constructor and Description |
---|
IlvActivityGraphicSelection(IlvActivityGraphic obj)
Creates a new selection object for the specified activity graphic.
|
IlvActivityGraphicSelection(IlvActivityGraphic obj,
String[] properties)
Creates a new selection object for the specified activity graphic whose
activity is a instance of
IlvPropertyHolderActivity , specifiying Date
values properties as positions for displaying the handles. |
Modifier and Type | Method and Description |
---|---|
protected int |
direction(IlvPoint tp,
IlvTransformer t)
Returns the direction corresponding to a specified point.
|
IlvActivity |
getActivity()
Returns the activity that is selected.
|
IlvActivityGraphic |
getActivityGraphic()
Returns the activity graphic that is selected.
|
IlvActivityRenderer |
getActivityRenderer()
Returns the renderer of the selected activity graphic.
|
String |
getDefaultInteractor()
Gets the name of the edition interactor for this class.
|
IlvRect |
getDefinitionRect(IlvTransformer t)
Returns the (cached) definition rectangle of the activity graphic
for this renderer, transformed by the specified
transformer . |
Date |
getEndTime()
Returns the (cached) end time of the selected activity.
|
IlvPoint |
getHandle(int i,
IlvTransformer t)
Returns the position of the handle at the specified index.
|
int |
getHandleCardinal()
Returns the number of handles.
|
String[] |
getHandleProperties()
Returns the list of Date valued properties that specify where to display
handles.
|
Date |
getHandleTime(int i)
Returns the position of the handle at the specified index, as a time.
|
Date |
getPropertyValue(int i)
Returns the (cached) time property value for getHandleProperties()[i].
|
Date |
getStartTime()
Returns the (cached) start time of the selected activity.
|
void |
invalidateCache()
Invalidates the cache of the time properties used by this object.
|
void |
setBothHandleTimes(Date startTime,
Date endTime)
Sets the times that correspond to the two handles.
|
void |
setHandleTime(int i,
Date time)
Sets the time that corresponds to the handle at the specified index.
|
afterLoopAllHandles, beforeLoopAllHandles, boundingBox, contains, draw, drawWithoutHandles, getActiveHandlesColor, getHandle, getHandlesColor, getHandlesShape, getHandlesSize, isActive, onEnter, onExit, setActiveHandlesColor, setHandlesColor, setHandlesShape, setHandlesSize, zoomable
applyTransform, copy, getObject, isOptimizedDrawingEnabled, isVisible, SetDefaultInteractor
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, localeChanged, makeSelection, 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, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved, write
public IlvActivityGraphicSelection(IlvActivityGraphic obj)
obj
- the selected activity graphic.public IlvActivityGraphicSelection(IlvActivityGraphic obj, String[] properties)
IlvPropertyHolderActivity
, specifiying Date
values properties as positions for displaying the handles.obj
- The selected activity graphic. An instance of
IlvPropertyHolderActivity
, such as an
IlvGeneralActivity
or IlvTableActivity
.properties
- A list of Date valued properties of the activity, or
null
.public IlvActivityGraphic getActivityGraphic()
public IlvActivityRenderer getActivityRenderer()
public IlvActivity getActivity()
public String[] getHandleProperties()
null
when the handles are to be set at the
start and end time of the activity.IlvUserPropertyHolder.getProperty(String)
public Date getPropertyValue(int i)
i
- The handle index.invalidateCache()
was not called
since the last invocation.IlvUserPropertyHolder.getProperty(String)
public Date getStartTime()
invalidateCache()
was not called since the last
invocation.IlvActivityGraphicRenderer.getStartTime(IlvActivityGraphic)
,
IlvActivity.getStartTime()
public Date getEndTime()
invalidateCache()
was not called since the last
invocation.IlvActivityGraphicRenderer.getEndTime(IlvActivityGraphic)
,
IlvActivity.getEndTime()
public IlvRect getDefinitionRect(IlvTransformer t)
transformer
.t
- The transformer.IlvActivityGraphicRenderer.getDefinitionRect(IlvActivityGraphic, IlvTransformer)
,
IlvActivityGraphic.getDefinitionRect()
public void invalidateCache()
invalidateCache
in interface IlvActivitySelection
public String getDefaultInteractor()
IlvActivityGraphicReshapeInteractor
class name.getDefaultInteractor
in class IlvSelection
String
representing the interactor class name.IlvReshapeSelection
,
IlvSelection.SetDefaultInteractor(java.lang.String)
public int getHandleCardinal()
If getHandleProperties()
is non-null, the result is the
length of this array of properties. Otherwise it is 2.
getHandleCardinal
in class IlvHandlesSelection
public IlvPoint getHandle(int i, IlvTransformer t)
getHandle
in class IlvHandlesSelection
i
- the handle index.t
- the transformer used to draw the object.IlvPoint
, position of the handle.public Date getHandleTime(int i)
i
- The handle index.Date
that corresponds to the current position
of the handle.public void setHandleTime(int i, Date time)
i
- The handle index.time
- The new value for the corresponding property of the activity.public void setBothHandleTimes(Date startTime, Date endTime)
This method is only applicable if
getHandleProperties() == null
.
startTime
- The new value corresponding to handle 0.endTime
- The new value corresponding to handle 1.protected int direction(IlvPoint tp, IlvTransformer t)
IlvDirection.BadPosition
.tp
- the point.t
- the transformer used to draw the object.IlvDirection
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.