|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.jaret.util.ui.timebars.TimeBarViewerDelegate
public class TimeBarViewerDelegate
The delegate for supporting a TimeBarViewer. This may be the Swing or the SWT version of the time bar viewer. The delegate encapsulates most of the calculations. It communicates with the viewer for the specific toolkit via the TimeBarViewerInterface.
Field Summary | |
---|---|
protected boolean |
_adjustMinMaxDatesByModel
Flag controlling min/max setting behaviour. |
protected boolean |
_autoscroll
controls autoscroll behaviour: true -> enabled. |
protected int |
_autoscrollDelta
the amount of pixels that is assumed to scroll/drag when the cursor left the diagram area. |
protected de.jaret.util.date.Interval |
_changingInterval
interval currently changed by dragging. |
protected java.awt.Point |
_ctxCoordinate
coordinate a context menu has been requested to pop up. |
protected de.jaret.util.date.JaretDate |
_ctxDate
date for the ctx coordinate. |
protected TimeBarRow |
_ctxRow
row above that a context menu has been requested to pup up. |
protected java.awt.Rectangle |
_diagramRect
area in which the actual rows are painted. |
protected boolean |
_dragAllSelectedIntervals
flag indicating whether all selcted intervals should be dragged whe draggig a iterval. |
protected boolean |
_draggedInterval
true indicates dragging of an interval as a whole. |
protected boolean |
_draggedIntervalEdgeLeft
if not dragging the whole interval true means left bound. |
protected java.util.List<de.jaret.util.date.Interval> |
_draggedIntervals
list of draged intervals excluding the one on that the drag started. |
protected java.util.List<TimeBarRow> |
_draggedIntervalsRows
cache for the row information for the dragged intervals. |
protected TimeBarMarker |
_draggedMarker
marker currently involved in a drag operation. |
protected boolean |
_drawGrid
when true the grid/background will be painted. |
protected boolean |
_drawOverlapping
flag controlling the drawing behaviour for overlapping intervals. |
protected boolean |
_drawRowGrid
if true a row grid will be painted. |
protected de.jaret.util.date.JaretDate |
_endDate
Date marking the last painted date. |
protected int |
_firstRow
index of the first row displayed. |
protected int |
_firstRowPixelOffset
pixeloffset of the first row. |
protected de.jaret.util.date.Interval |
_focussedInterval
Currenty focussed interval or null if no interval has the focus. |
protected java.util.List<FocussedIntervalListener> |
_focussedIntervalListeners
List of FocussedInteralListeners. |
protected TimeBarRow |
_focussedRow
Row of the focussed interval or null if no interval is focussed. |
protected boolean |
_headerLineDragging
true if dragging of the header limiting line is ongoing. |
protected TimeBarRow |
_heightDraggedRow
row thats height is currently dragged or null when no row height is beeing dragged. |
protected boolean |
_hideRoot
if set to true and using a hierchical model the root will not be shown. |
protected HierarchicalTimeBarModel |
_hierarchicalModel
The hierarchical model when used. |
protected HierarchicalViewState |
_hierarchicalViewState
Viewstate holding state information for hierarchical operation. |
protected boolean |
_hierarchyLineDragging
true if dragging of the hierarchy limiting line is ongoing. |
protected java.awt.Rectangle |
_hierarchyRect
drawing area of the hierarchy elements. |
protected int |
_hierarchyWidth
width of the hierarchy header (in case of an hierachical model). |
protected TimeBarRow |
_highlightedRow
highlighted row if any. |
protected int |
_initialSecondsDisplayed
|
protected de.jaret.util.date.JaretDate |
_initialStartDate
|
protected TimeBarRow |
_intervalDraggedRow
the row of the dragged/resized interval. |
protected TimeBarIntervalFilter |
_intervalFilter
filter filtering intervals displayed. |
protected java.util.List<IntervalModificator> |
_intervalModificators
List of intervalmodificators that have been registered. |
protected IIntervalSelectionStrategy |
_intervalSelectionStrategy
insterval selection strategy. |
protected int |
_keyboardChangeDelta
Change delta for keyboard modification in seconds. |
protected de.jaret.util.date.JaretDate |
_lastDragDate
last date that has been used in a drag/resize. |
protected double |
_lastGridSnapDifference
last difference to a gridsnap position (used when dragging an interval). |
protected java.util.List<java.lang.Double> |
_lastGridSnapDifferences
list of lat grid snap differences, used when more than one interval is beeing dragged. |
protected int |
_lastPressedX
|
protected int |
_lastPressedY
|
protected TBRect |
_lastRegionSelection
region selection data: last selection. |
protected int |
_lastRowSelectionIndex
last selected row. |
protected java.awt.Rectangle |
_lastSelRect
the last selection rect if existing. |
protected de.jaret.util.date.JaretDate |
_lastStartDate
start date of the viewer for that the last paint completed. |
protected boolean |
_lineDraggingAllowed
true if dragging of the hierarchy and header delimiter is allowed. |
protected boolean |
_markerDraggingInDiagramArea
if true markers can be dragged in the diagram area. |
protected de.jaret.util.date.JaretDate |
_markerDragStart
start date of a marker drag. |
protected java.util.List<TimeBarMarker> |
_markers
markers added to the viewer. |
protected de.jaret.util.date.JaretDate |
_maxDate
Maximum date to be displayed by the viewer. |
protected boolean |
_milliAccuracy
If true the viewer is used with very short intervals and the scrolling is done using milliseconds. |
protected de.jaret.util.date.JaretDate |
_minDate
Minimum date to be displayed by the viewer. |
protected TimeBarModel |
_model
The model. |
protected int |
_offsetLeft
pixeloffset when rendering (left). |
protected int |
_offsetTop
pixeloffset when rendering (top). |
protected boolean |
_optimizeScrolling
if set to true scrolling optimizations will be used. |
protected TimeBarViewerInterface.Orientation |
_orientation
the orientation of the viewer. |
protected de.jaret.util.date.Interval |
_originalInterval
copy of a dragged or resized interval containing the original bounds. |
protected java.util.List<de.jaret.util.date.Interval> |
_originalIntervals
list of copies for all intervals selected when a drag started. |
protected IOverlapStrategy |
_overlapStrategy
overlap strategy to be used when drawing non-overlapped. |
protected double |
_pixelPerSeconds
scale. |
protected boolean |
_regionRectEnabled
true if selecting from regions is enabled. |
protected TBRect |
_regionSelection
region selection data: current selection. |
protected de.jaret.util.date.JaretDate |
_regionStartDate
start date when selecting a region. |
protected TimeBarRow |
_regionStartRow
start row when selecting a reion. |
protected TimeBarRowFilter |
_rowFilter
Filter filtering rows displayed. |
protected boolean |
_rowHeightDraggingAllowed
true if the dragginng of rows is allowed. |
protected java.util.List<TimeBarRow> |
_rowList
filtered and sorted list. |
protected TimeBarRowSorter |
_rowSorter
sorter for the rows in the model. |
protected int |
_scrolledlastDrag
number of pixels that the viewer has been scrolled during the las drag cycle. |
protected int |
_scrollLookBackMinutes
additional time to take into account (looking back) when determining what intervals have to be painted. |
protected int |
_scrollLookForwardMinutes
additional time to take into account (looking forward) when determining what intervals have to be painted. |
protected boolean |
_scrollOnFocus
if true the viewer will try to scroll to a newly focussed interval. |
protected TimeBarSelectionModel |
_selectionModel
selection model, default implementation as default. |
protected java.awt.Rectangle |
_selectionRect
the current selection rectangle. |
protected java.util.List<ISelectionRectListener> |
_selectionRectListeners
List of ISelectionRectListeners. |
protected de.jaret.util.date.JaretDate |
_startDate
Date marking the first painted date. |
protected de.jaret.util.date.JaretDate |
_startIntervalDragDate
date of drag/resize start. |
protected int |
_startIntervalDragX
x ccordinate of the start of an internal drag/resize. |
protected boolean |
_strictClipTimeCheck
If set to true, intervals are filtered strictly by their interval bounds, disallowing rendering beyond the bounding box calculated by the interval bounds. |
protected TimeBarViewerInterface |
_tbvi
the delegating time bar viewer. |
protected java.util.List<ITimeBarChangeListener> |
_timeBarChangeListeners
List of TimeBarChangeListenes. |
protected ITimeBarViewState |
_timeBarViewState
standard view state. |
protected double |
_timeFactor
factor used to scale the time scroll bar if integer is not enough. |
protected int |
_timeScalePosition
position of the timescale. |
protected java.lang.String |
_title
title of the viewer. |
protected java.awt.Rectangle |
_titleRect
Title area. |
protected boolean |
_variableXScale
flag indicating a variable xscale. |
protected int |
_xAxisHeight
height of the time scale. |
protected java.awt.Rectangle |
_xAxisRect
area in which the x axis (time scale) will be painted. |
protected TimeBarNode |
_xScalePPSIntervalRow
row holding intervals with pps values overriding the default for intervals. |
protected java.awt.Rectangle |
_yAxisRect
area in which the y axis will be painted. |
protected int |
_yAxisWidth
width of the y axis. |
protected static int |
DEFAULT_AUTOSCROLL_DELTA
default for the autoscroll delta. |
Constructor Summary | |
---|---|
TimeBarViewerDelegate(TimeBarViewerInterface tbvi)
Constructor will set the TimeBarViewerInterface for the delegate. |
Method Summary | |
---|---|
void |
addFocussedIntervalListener(FocussedIntervalListener listener)
Add a listener to be informed when the focus changes. |
void |
addIntervalModificator(IntervalModificator intervalModificator)
Add an interval modificator. |
void |
addMarker(TimeBarMarker marker)
Add a marker to be displayed within the diagram. |
void |
addMarkers(java.util.List<TimeBarMarker> markers)
Add a list of markers. |
void |
addSelectionRectListener(ISelectionRectListener listener)
Add a listener to be informed when the selection rect changes. |
void |
addTimeBarChangeListener(ITimeBarChangeListener listener)
Add a listener to be informed about interval changes. |
java.awt.Rectangle |
calcRect(TBRect tbrect)
Calculate the rectangle for screen representation for a tbrect (time and rows). |
void |
clearRegionRect()
Remove the selction of a region if existent. |
void |
componentResized()
Handle a component resize and scroll down if an empty space would be shown in the newly exposed screen estate. |
de.jaret.util.date.JaretDate |
dateForCoord(int coord)
Calculate the date for a given coordinate on the timescale. |
de.jaret.util.date.JaretDate |
dateForCoord(int x,
int y)
Calculate the date for a given point. |
de.jaret.util.date.JaretDate |
dateForCoordAbs(int coord)
Retrieve the date for an absolute coordinate along the timescale (referencing minDate). |
de.jaret.util.date.JaretDate |
dateForX(int x)
Deprecated. use dateForXY or dateForCoord instead |
de.jaret.util.date.JaretDate |
dateForXY(int x,
int y)
Retrieve the date for a position on the screen. |
void |
deHighlightRow()
Dehighlight a highlighted row. |
int |
dispIdxForRow(TimeBarRow row)
Calculate the display index of the row. |
void |
dispose()
Deregister from all models and free any ressources reserved. |
void |
elementAdded(TimeBarModel model,
TimeBarRow row,
de.jaret.util.date.Interval element)
A new element was added to a row. |
void |
elementAddedToSelection(TimeBarSelectionModel selectionModel,
java.lang.Object element)
An element (either a row or an interval) has been added to the selection. |
void |
elementChanged(TimeBarModel model,
TimeBarRow row,
de.jaret.util.date.Interval element)
An element in a row has changed. |
void |
elementRemoved(TimeBarModel model,
TimeBarRow row,
de.jaret.util.date.Interval element)
An element was removed from a row. |
void |
elementRemovedFromSelection(TimeBarSelectionModel selectionModel,
java.lang.Object element)
An element (either a row or an interval) has been removed from the selection. |
java.util.List<de.jaret.util.date.Interval> |
filterIntervals(java.util.List<de.jaret.util.date.Interval> intervals)
Applies the interval filter if set. |
protected void |
fireFocussedIntervalChange(TimeBarRow newFocussedRow,
de.jaret.util.date.Interval newFocussedInterval)
Inform listeners about a focus change. |
protected void |
fireIntervalChangeCancelled(TimeBarRow row,
de.jaret.util.date.Interval interval)
Inform time bar change listeners about a cancelled interval change. |
protected void |
fireIntervalChanged(TimeBarRow row,
de.jaret.util.date.Interval interval,
de.jaret.util.date.JaretDate oldBegin,
de.jaret.util.date.JaretDate oldEnd)
Inform time bar change listeners about a finished interval change. |
protected void |
fireIntervalChangeStarted(TimeBarRow row,
de.jaret.util.date.Interval interval)
Inform time bar change listeners about a beginning interval change. |
protected void |
fireIntervalIntermediateChange(TimeBarRow row,
de.jaret.util.date.Interval interval,
de.jaret.util.date.JaretDate oldBegin,
de.jaret.util.date.JaretDate oldEnd)
Inform time bar change listeners about an intermediate interval change. |
protected void |
fireMarkerDragStarted(TimeBarMarker marker)
Informa listener about a started marker drag. |
protected void |
fireMarkerDragStopped(TimeBarMarker marker)
Inform listeners about stopping of a marker drag. |
protected void |
fireRegionRectChanged()
Inform selection rect listeners about a change of the region rect. |
protected void |
fireRegionRectClosed()
Inform selectionRectListeners about the end of the region rect. |
protected void |
fireSelectionRectChanged()
Inform selection rect listeners about a change of the selection rect. |
protected void |
fireSelectionRectClosed()
Inform selectionRectListeners about the end of the selection rect. |
int |
getAbsPosForRow(int rowIdx)
Get the absolute position (x or y depeding on the orientation) for a row. |
boolean |
getAdjustMinMaxDatesByModel()
|
int |
getAutoScaleRows()
Get the number of rows (columns) that the viewer scales itself to. |
int |
getAutoscrollDelta()
Retrieve the currently set autoscroll delta. |
java.awt.Point |
getCtxCoordinate()
Retrieve the location of a context menu popup request. |
TimeBarRow |
getCtxRow()
Retrieve the row above that a popup menu request has occurred. |
java.awt.Rectangle |
getDiagramRect()
|
boolean |
getDragAllSelectedIntervals()
If true all selected intervals will be dragged together with the interval on that the drag happened. |
TimeBarMarker |
getDraggedMarker()
Retrieve the marker currently dragged. |
boolean |
getDrawRowGrid()
|
de.jaret.util.date.JaretDate |
getEndDate()
Retrieve the last date displayed. |
int |
getFirstRow()
|
int |
getFirstRowOffset()
Retrieve the pixel offset for the first row. |
de.jaret.util.date.Interval |
getFocussedInterval()
Retrieve the focusef interval. |
TimeBarRow |
getFocussedRow()
|
java.awt.Rectangle |
getHeaderRect(TimeBarRow row)
Calculate the rectangle for drawing the header of a given row. |
boolean |
getHideRoot()
Retrieve whether the root node is shown when using a hierachical model. |
HierarchicalTimeBarModel |
getHierarchicalModel()
Retrieve the hierarchical model displayed if present. |
HierarchicalViewState |
getHierarchicalViewState()
Retrieve the hierarchical viewstate. |
java.awt.Rectangle |
getHierarchyRect()
|
java.awt.Rectangle |
getHierarchyRect(TimeBarRow row)
Calculate the rectangle for drawing the hierachy marker of a given row. |
int |
getHierarchyWidth()
Retrieve the width used to draw the hierarchy area. |
TimeBarRow |
getHighlightedRow()
Retrieve the highlighted row if prsent. |
java.awt.Rectangle |
getIntervalBounds(de.jaret.util.date.Interval interval)
Retrieve the bounding rect of an interval. |
java.awt.Rectangle |
getIntervalBounds(int rowIdx,
de.jaret.util.date.Interval interval)
Calculate the bounds for an interval. |
java.awt.Rectangle |
getIntervalBounds(TimeBarRow row,
de.jaret.util.date.Interval interval)
Calculates the bounding rectangle for an interval. |
TimeBarIntervalFilter |
getIntervalFilter()
|
java.util.List<de.jaret.util.date.Interval> |
getIntervals(java.awt.Rectangle curSelRect)
Retrieve all intervals inside a selection rectangle. |
java.util.List<de.jaret.util.date.Interval> |
getIntervalsAt(int x,
int y)
Retrieves all intervals at a given point in the diagram pane. |
java.util.List<de.jaret.util.date.Interval> |
getIntervalsAt(TimeBarRow row,
int x)
Retrieve intervals in a given row for a given x coordinate. |
java.util.List<de.jaret.util.date.Interval> |
getIntervalsAt(TimeBarRow row,
int x,
int y)
Retrieves all intervals for a given row and a x coordinate in the diagram pane. |
IIntervalSelectionStrategy |
getIntervalSelectionStrategy()
Retrieve the interval selection strategy used. |
int |
getKeyboardChangeDelta()
Retrieve the keyboardChangeDelta currently used. |
java.awt.Rectangle |
getLastSelRect()
Retrieve the last selection rectangle. |
de.jaret.util.date.JaretDate |
getLastStartDate()
|
boolean |
getMarkerDraggingInDiagramArea()
Retrieve whether marker dragging in the diagram area is activated. |
protected TimeBarMarker |
getMarkerForCoord(int coord)
Find a marker for a given coordinate (depending on the orientation). |
TimeBarMarker |
getMarkerForXY(int x,
int y)
Retrive a marker for a coordinate pair (x or y will be used depending on the orientation). |
java.util.List<TimeBarMarker> |
getMarkers()
Retrieve all markers added. |
de.jaret.util.date.JaretDate |
getMaxDate()
|
int |
getMaxOverlapCount(TimeBarRow row)
Retrieve tha maximal count of overlapping intervals in a row. |
long |
getMilliSecondsDisplayed()
Get the milli seconds currently displayed by the diagram. |
de.jaret.util.date.JaretDate |
getMinDate()
|
TimeBarModel |
getModel()
Get the model the viewer displays. |
java.lang.String |
getName()
Get the name of the viewer/component. |
boolean |
getOptimizeScrolling()
Get whether optimzed scrollnig is used. |
TimeBarViewerInterface.Orientation |
getOrientation()
Retrieve the orientation of the viewer. |
IOverlapStrategy |
getOverlapStrategy()
Retrieve the used strategy for determing overlap information. |
protected double |
getPixelPerMilliSecond()
Retrieve the corrected pixel per second value for milliseconds. |
double |
getPixelPerSecond()
Return the pixel per second ratio. |
de.jaret.util.misc.Pair<TimeBarRow,de.jaret.util.date.JaretDate> |
getPopUpInformation()
Retrieve the row and date of the click leading to the activation of a context menu. |
PPSInterval |
getPPSInterval(de.jaret.util.date.JaretDate d)
Retrieve the appropriate pps interval for a given date. |
TimeBarNode |
getPpsRow()
Retrieve the row that hold intervals (PpsIntervals) defining the pps value for different intervals. |
TBRect |
getRegionRect()
Retrieve the selected region. |
boolean |
getRegionRectEnable()
Retrieve whether region selections are enabled. |
TimeBarRow |
getRow(int idx)
Get a timebar row from the filtered/sorted list by index. |
java.awt.Rectangle |
getRowBounds(TimeBarRow row)
Calculates the bounds of a row. |
int |
getRowCount()
Return the size of the row list. |
TimeBarRowFilter |
getRowFilter()
|
int |
getRowHeight()
Retrieve the current row height (col width). |
int |
getRowIdxForAbsoluteOffset(int value)
Calculate the row index for an absolute pixel position (referring to all rows stacked). |
int |
getRowIndex(TimeBarRow row)
Retrieve the index of a given row. |
int |
getRowPixOffsetForAbsoluteOffset(int rowIdx,
int value)
Calculate the pixel offset of the first row for an absolute value (referring to the total height of all rows). |
int |
getRowsDisplayed()
|
TimeBarRowSorter |
getRowSorter()
|
int |
getScrollLookBackMinutes()
Retrieve the time to be additionally considered (looking back) when deciding which intervals are to be painted. |
int |
getScrollLookForwardMinutes()
Retrieve the time to be additionally considered (looking forward) when deciding which intervals are to be painted. |
boolean |
getScrollOnFocus()
Retrieve the state of the scroll to focus flag. |
int |
getSecondsDisplayed()
Get the seconds currently displayed by the diagram. |
int |
getSelectionDelta()
Retrieve the selection delta used to determine whether a marker or interval edge is clicked/dragged. |
TimeBarSelectionModel |
getSelectionModel()
|
java.awt.Rectangle |
getSelectionRect()
Retrieve the selection rect. |
de.jaret.util.date.JaretDate |
getStartDate()
Get the starting date, that is the leftmost date displayed. |
boolean |
getStrictClipTimeCheck()
Retrieve the strategy for filtering when painting (see setStrictClipTimeCheck(boolean) ). |
ITimeBarViewState |
getTimeBarViewState()
Retrieve the timebarviewstate. |
int |
getTimeScalePosition()
|
java.lang.String |
getTitle()
Retrieve the title of the viewer. |
java.awt.Rectangle |
getTitleRect()
Retrieve area for drawing a title. |
java.lang.String |
getToolTipText(int x,
int y)
Retrieve the tooltip text for a given location. |
int |
getTotalHeight()
Calculate the total height/width of all rows. |
long |
getTotalMilliSeconds()
Calculates the number of milliseconds the complete model spans. |
long |
getTotalSeconds()
Calculates the number of seconds the complete model spans. |
boolean |
getUseUniformHeight()
Retrieve whether uniform height is use for all intervals in a row. |
int |
getXAxisHeight()
|
java.awt.Rectangle |
getXAxisRect()
|
java.awt.Rectangle |
getYAxisRect()
|
int |
getYAxisWidth()
|
void |
handleHorizontalScroll(int value,
boolean redirect)
Handle operation of the horizontal scroll bar. |
void |
handleKeyPressed(int keyCode,
int modifierMask)
Handle key events from the time bar viewers. |
void |
handleVerticalScroll(int value,
boolean redirect)
Handle change of the vertical scroll bar. |
boolean |
hasVariableXScale()
Retrieve the state of the variable xscale state. |
void |
headerChanged(TimeBarModel model,
TimeBarRow row,
java.lang.Object newHeader)
The header of a row changed. |
void |
highlightRow(int y)
Highlight a row by giving the display y coordinate. |
void |
highlightRow(TimeBarRow row)
Highlight a row. |
boolean |
isAutoscrollEnabled()
Get the autoscroll behaviour. |
boolean |
isDisplayed(de.jaret.util.date.JaretDate date)
Checks whether a given date is currently visible. |
boolean |
isDrawOverlapping()
|
boolean |
isFiltered(de.jaret.util.date.Interval interval)
Check whether an interval is filtered by an interval filter. |
boolean |
isFiltered(TimeBarRow row)
Check whether a row is filtered out. |
boolean |
isFocussed(de.jaret.util.date.Interval interval)
Check whether an interval is focussed. |
boolean |
isInDiagram(int x,
int y)
Check whether a given point is in the main diagram area. |
boolean |
isInRowAxis(int x,
int y)
Check whether a given point is in the row axis area (hierarchy or header). |
boolean |
isIntervalVisible(TimeBarRow row,
de.jaret.util.date.Interval interval)
Check whether any part of an interval is visible. |
boolean |
isLineDraggingAllowed()
Check whether it is allowed to drag the limiting lines of the hierarhy ara and the header (yaxis) area. |
boolean |
isMarkerDraggingInProgress()
Check whether a marker is beeing dragged. |
boolean |
isMilliAccuracy()
Check whether th delegate is setup for millisecond accuracy. |
boolean |
isRowDisplayed(TimeBarRow row)
Check whether a certain row is currently displayed. |
boolean |
isRowHeightDraggingAllowed()
Check whether row height dragging is allowed. |
void |
markerDescriptionChanged(TimeBarMarker marker,
java.lang.String oldValue,
java.lang.String newValue)
Callback method indicating the description of a marker changed. |
void |
markerMoved(TimeBarMarker marker,
de.jaret.util.date.JaretDate oldDate,
de.jaret.util.date.JaretDate currentDate)
Callback method indicating a move of a marker. |
void |
modelDataChanged(TimeBarModel model)
Unspecific or multiple changes occured in the model. |
void |
mouseDragged(int x,
int y,
int modifierMask)
Handle mouse dragging. |
void |
mouseMoved(int x,
int y)
Handle simple mouse movements. |
void |
mousePressed(int x,
int y,
boolean isPopupTrigger,
int modifierMask)
Handle press of a mouse button. |
void |
mouseReleased(int x,
int y,
boolean isPopupTrigger,
int modifierMask)
Handle release of mouse button. |
void |
moveFocusDown()
Move the focus down. |
void |
moveFocusLeft()
Move the focus to the left. |
void |
moveFocusRight()
Move the focus to the right. |
void |
moveFocusUp()
Move the focus up. |
PPSInterval |
nextPPSInterval(de.jaret.util.date.JaretDate d)
Get the next interval to a date from the pps row (variable x axis). |
void |
preparePaint(int cwidth,
int cheight)
Calculate the boundaries of the diagram elements. |
void |
preparePaintHorizontal(int cwidth,
int cheight)
Calculate the boundaries of the diagram elements for the horizontal orientation. |
void |
preparePaintVertical(int cwidth,
int cheight)
Calculate the boundaries of the diagram elements for the vertical orientation. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
remFocussedIntervalListener(FocussedIntervalListener listener)
Remove a focussedIntervalListener. |
void |
remIntervalModificator(IntervalModificator intervalModificator)
Remove an interval modificator. |
void |
remMarker(TimeBarMarker marker)
Removes a marker from the diagram. |
void |
removeTimeBarChangeListener(ITimeBarChangeListener listener)
Remove a timebar change listener. |
void |
remSelectionRectListener(ISelectionRectListener listener)
Remove a selection rect listener. |
void |
rowAdded(TimeBarModel model,
TimeBarRow row)
The model was enlarged by a new row. |
void |
rowDataChanged(TimeBarModel model,
TimeBarRow row)
Unspecific change in the data of a row. |
TimeBarRow |
rowForXY(int x,
int y)
Get the row located at x,y. |
TimeBarRow |
rowForY(int y)
Get the row for a given y coordinate in the diagram pane. |
boolean |
rowLineHit(int x,
int y)
Check whether a row delimiter line is hit by a coordinate. |
void |
rowRemoved(TimeBarModel model,
TimeBarRow row)
The model was reduced by a row. |
int |
scrollDateToVisible(de.jaret.util.date.JaretDate date)
Scroll a date into the visible area of the viewer. |
void |
scrollIntervalToVisible(de.jaret.util.date.Interval interval)
Make sure the specified interval is in the visibe area of the viewer. |
void |
scrollIntervalToVisible(de.jaret.util.date.Interval interval,
double horizontalRatio,
double verticalRatio)
Scroll an interval to specified position (by ration) in the vieable area of the chart. |
void |
scrollIntervalToVisible(TimeBarRow row,
de.jaret.util.date.Interval interval)
Make sure the specified interval is in the visibe area of the viewer. |
void |
scrollIntervalToVisible(TimeBarRow row,
de.jaret.util.date.Interval interval,
double horizontalRatio,
double verticalRatio)
Scroll an interval to specified position (by ration) in the vieable area of the chart. |
void |
scrollRowToVisible(TimeBarRow row)
Make sure the specified row is visible. |
protected void |
scrollTo(de.jaret.util.date.JaretDate startDate)
Handle a scrolling operation. |
void |
selectIntervals(java.awt.Rectangle curSelRect)
Ensures that all intervals in the given rectangle are selected. |
void |
selectionChanged(TimeBarSelectionModel selectionModel)
The selection did unspecific change. |
void |
setAdjustMinMaxDatesByModel(boolean adjustMinMaxDatesByModel)
|
void |
setAutoScaleRows(int rows)
Set a number of rows (columns) to be displayed by the viewer. |
void |
setAutoscrollDelta(int autoscrollDelta)
Set the autoscroll delta. |
void |
setAutoscrollEnabled(boolean enableAutoscroll)
Set the autoscroll behaviour. |
void |
setDragAllSelectedIntervals(boolean dragAllSelectedIntervals)
If set to true all selected intervals are dragged when an interval is dragged. |
void |
setDrawingOffset(int marginLeft,
int marginTop)
Set margins to the left and top to be included in geometry calculations. |
void |
setDrawOverlapping(boolean drawOverlapping)
Set the drawing mode concerning overlapping intervals. |
void |
setDrawRowGrid(boolean drawRowGrid)
|
void |
setFirstRow(int firstRow)
Sets the first row to be displayed with a pixel offset 0. |
void |
setFirstRow(int firstRow,
int pixOffset)
Set the first row to be displayed. |
void |
setFirstRow(TimeBarRow row)
Set the first row to be displayed. |
void |
setFirstRowOffset(int offset)
Set the pixel offset of the first row. |
void |
setFocussedInterval(de.jaret.util.date.Interval interval)
Set the new focussed interval. |
void |
setFocussedInterval(TimeBarRow row,
de.jaret.util.date.Interval interval)
Set the new focussed interval. |
void |
setHideRoot(boolean hideRoot)
Set whether the root node should be shown when using a hierachical model. |
void |
setHierarchicalViewState(HierarchicalViewState hvs)
Set the hierarchical viewstate. |
void |
setHierarchyWidth(int width)
Set the width fo rrendering the hierarchy area. |
void |
setInitialDisplayRange(de.jaret.util.date.JaretDate startDate,
int secondsDisplayed)
Set a date range and scaling that will be set as the initial display right after the viewer is displayed. |
void |
setIntervalFilter(TimeBarIntervalFilter intervalFilter)
Set a filter for displaying only a part of the intervals. |
void |
setIntervalSelectionStrategy(IIntervalSelectionStrategy intervalSelectionStrategy)
Set the interval selection strategy. |
void |
setKeyboardChangeDelta(int keyboardChangeDelta)
Set the delta for resizing and moving via keyboard. |
void |
setLastRow(int index)
Set the last row in the viewer. |
void |
setLastRow(TimeBarRow row)
Set the last row in the viewer. |
void |
setLastSelRect(java.awt.Rectangle rect)
Set the last selection rectangle. |
void |
setLastStartDate(de.jaret.util.date.JaretDate lastStartDate)
|
void |
setLineDraggingAllowed(boolean lineDraggingAllowed)
Set the allowance for line dragging of the limiting lines for hierarchy and header(yaxis) areas. |
void |
setMarkerDraggingInDiagramArea(boolean allowed)
Set whether marker dragging is allowed in the diagram area (If intervals are modificable the marker will only be grabbed when no other operation is applicable). |
void |
setMaxDate(de.jaret.util.date.JaretDate maxDate)
Set the maximum date for the diagram. |
void |
setMilliAccuracy(boolean milliAccuracy)
Set the delegates status concerning millisecond accuracy. |
void |
setMinDate(de.jaret.util.date.JaretDate minDate)
|
void |
setModel(HierarchicalTimeBarModel hModel)
Set a hierarchical model as the time bar model. |
void |
setModel(TimeBarModel model)
Set the model to be displayed. |
void |
setName(java.lang.String name)
Set the name of the viewer/component for display or debugging purposes. |
void |
setOptimizeScrolling(boolean optimizeScrolling)
Set whether optimized scrolling should be used (not allowed togeter with a variable xscale). |
void |
setOrientation(TimeBarViewerInterface.Orientation orientation)
Set the orientation of the viewer. |
void |
setOverlapStrategy(IOverlapStrategy overlapStrategy)
Set the strategy to be used for calculating overlap information. |
void |
setPixelPerSecond(double pixelPerSecond)
Sets the scale ox the x axis as pixel per second, thus a value of 1000.0 / (24.0 * 60 * 60) will result in displaying one day over 1000 pixel. |
protected void |
setPixelPerSecond(double pixelPerSecond,
boolean repaint)
Internal version of setPixelPerSecond that allows control of the repaint behaviour. |
void |
setRegionRectEnable(boolean enabled)
Enable/Disable region selections. |
void |
setRowFilter(TimeBarRowFilter rowFilter)
Set a filter to select a subset of rows in the model to be displayed. |
void |
setRowHeight(int rowHeight)
Set the height for the rows in pixel. |
void |
setRowHeightDraggingAllowed(boolean rowHeightDraggingAllowed)
Set whether row height dragging should be allowed. |
void |
setRowSorter(TimeBarRowSorter rowSorter)
Set a sorter for sorting the displayed rows. |
void |
setScrollLookBackMinutes(int scrollLookBackMinutes)
Set the additional time to be considered when deciding whether to draw an interval looking back. |
void |
setScrollLookForwardMinutes(int scrollLookForwardMinutes)
Set the additional time to be considered when deciding whether to draw an interval looking forward. |
void |
setScrollOnFocus(boolean scrollOnFocus)
If set to true the viewer will scroll to the begin of an interval if it's focussed. |
void |
setSecondsDisplayed(int seconds,
boolean center)
Set the scaling of the x axis by specifying the number of seconds that should be displayed. |
void |
setSecondsDisplayed(int seconds,
de.jaret.util.date.JaretDate centerDate)
Set the scaling of the x axis by specifying the number of seconds that should be displayed. |
void |
setSelectionDelta(int selectionDelta)
Set the selection delta used to determine whether a marker or interval edge is clicked/dragged. |
void |
setSelectionModel(TimeBarSelectionModel selectionModel)
|
void |
setStartDate(de.jaret.util.date.JaretDate startDate)
Sets the date to be displayed at the position of the yaxis. |
void |
setStrictClipTimeCheck(boolean strictClipTimeCheck)
Set the optimization strategy for interval filetering when painting. |
void |
setTimeScalePosition(int timeScalePosition)
|
void |
setTitle(java.lang.String title)
Set the title string to be displayed. |
void |
setUseUniformHeight(boolean useUniformHeight)
Set whether all intervals in a non overlapping drawn ro should use the same height/width. |
void |
setVariableXScale(boolean state)
Set the state for the variable xscale. |
void |
setXAxisHeight(int axisHeight)
Set the height of the y axis. |
void |
setYAxisWidth(int axisWidth)
|
java.lang.String |
toString()
Produce a simple string representation. |
void |
updateRowList()
Updates the shadow row list of the displayed rows. |
void |
updateScrollBars()
Update the scroll bar bounds to match the current display an data. |
int |
xForDate(de.jaret.util.date.JaretDate date)
Calculate the x coordinate for a given date. |
int |
xForDateAbs(de.jaret.util.date.JaretDate date)
Calculate the x coordinate for a given date as absolute xvalue beginning with minDate = 0. |
protected int |
xForDatePlain(de.jaret.util.date.JaretDate date,
boolean absolute)
No variable xscale calculation of x for for date. |
protected int |
xForDateVariable(de.jaret.util.date.JaretDate date,
boolean absolute)
Variable calculation of x for date. |
int |
yForRow(TimeBarRow row)
Calculate the y coordinate in the diagram pane for the given row. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final TimeBarViewerInterface _tbvi
protected double _pixelPerSeconds
protected boolean _variableXScale
protected TimeBarNode _xScalePPSIntervalRow
protected boolean _milliAccuracy
protected int _xAxisHeight
protected int _yAxisWidth
protected int _hierarchyWidth
protected boolean _lineDraggingAllowed
protected TimeBarViewerInterface.Orientation _orientation
protected TimeBarModel _model
protected HierarchicalTimeBarModel _hierarchicalModel
protected ITimeBarViewState _timeBarViewState
protected HierarchicalViewState _hierarchicalViewState
protected java.lang.String _title
protected int _firstRow
protected int _firstRowPixelOffset
protected java.util.List<TimeBarRow> _rowList
protected boolean _adjustMinMaxDatesByModel
protected boolean _optimizeScrolling
protected de.jaret.util.date.JaretDate _startDate
protected de.jaret.util.date.JaretDate _endDate
protected de.jaret.util.date.JaretDate _minDate
protected de.jaret.util.date.JaretDate _maxDate
protected de.jaret.util.date.JaretDate _lastStartDate
protected TimeBarRowFilter _rowFilter
protected TimeBarRowSorter _rowSorter
protected TimeBarIntervalFilter _intervalFilter
protected TimeBarSelectionModel _selectionModel
protected java.util.List<TimeBarMarker> _markers
protected boolean _drawGrid
protected boolean _drawRowGrid
protected int _timeScalePosition
protected java.awt.Rectangle _diagramRect
protected java.awt.Rectangle _xAxisRect
protected java.awt.Rectangle _yAxisRect
protected java.awt.Rectangle _titleRect
protected java.awt.Rectangle _hierarchyRect
protected int _offsetTop
protected int _offsetLeft
protected TimeBarMarker _draggedMarker
protected de.jaret.util.date.Interval _changingInterval
protected boolean _draggedInterval
protected boolean _draggedIntervalEdgeLeft
protected static final int DEFAULT_AUTOSCROLL_DELTA
protected int _autoscrollDelta
protected boolean _dragAllSelectedIntervals
protected boolean _hierarchyLineDragging
protected boolean _headerLineDragging
protected boolean _rowHeightDraggingAllowed
protected TimeBarRow _heightDraggedRow
null
when no row height is beeing dragged.
protected boolean _autoscroll
protected java.awt.Rectangle _selectionRect
protected java.awt.Rectangle _lastSelRect
protected TimeBarRow _highlightedRow
protected boolean _drawOverlapping
protected int _keyboardChangeDelta
protected boolean _scrollOnFocus
protected de.jaret.util.date.Interval _focussedInterval
null
if no interval has the focus.
protected TimeBarRow _focussedRow
null
if no interval is focussed.
protected java.util.List<FocussedIntervalListener> _focussedIntervalListeners
protected java.util.List<ITimeBarChangeListener> _timeBarChangeListeners
protected java.util.List<ISelectionRectListener> _selectionRectListeners
protected java.util.List<IntervalModificator> _intervalModificators
protected boolean _strictClipTimeCheck
protected int _scrollLookBackMinutes
protected int _scrollLookForwardMinutes
protected double _timeFactor
protected IOverlapStrategy _overlapStrategy
protected boolean _hideRoot
protected IIntervalSelectionStrategy _intervalSelectionStrategy
protected boolean _regionRectEnabled
protected TBRect _regionSelection
protected TBRect _lastRegionSelection
protected de.jaret.util.date.JaretDate _regionStartDate
protected TimeBarRow _regionStartRow
protected de.jaret.util.date.JaretDate _initialStartDate
protected int _initialSecondsDisplayed
protected int _lastRowSelectionIndex
protected java.awt.Point _ctxCoordinate
protected TimeBarRow _ctxRow
protected de.jaret.util.date.JaretDate _ctxDate
protected de.jaret.util.date.Interval _originalInterval
protected java.util.List<de.jaret.util.date.Interval> _originalIntervals
protected java.util.List<de.jaret.util.date.Interval> _draggedIntervals
protected java.util.List<TimeBarRow> _draggedIntervalsRows
protected int _startIntervalDragX
protected de.jaret.util.date.JaretDate _startIntervalDragDate
protected de.jaret.util.date.JaretDate _lastDragDate
protected de.jaret.util.date.JaretDate _markerDragStart
protected TimeBarRow _intervalDraggedRow
protected int _scrolledlastDrag
protected double _lastGridSnapDifference
protected java.util.List<java.lang.Double> _lastGridSnapDifferences
protected int _lastPressedX
protected int _lastPressedY
protected boolean _markerDraggingInDiagramArea
Constructor Detail |
---|
public TimeBarViewerDelegate(TimeBarViewerInterface tbvi)
tbvi
- the viewer as TimeBarViewerInterfaceMethod Detail |
---|
public void dispose()
public boolean isDisplayed(de.jaret.util.date.JaretDate date)
date
- the date to be checked
public void setRowFilter(TimeBarRowFilter rowFilter)
rowFilter
- TimeBarRowFilter to be used. null
is an allowed value indicating no row filteringpublic TimeBarRowFilter getRowFilter()
public boolean isFiltered(TimeBarRow row)
row
- row to check.
public void setRowSorter(TimeBarRowSorter rowSorter)
rowSorter
- TimeBarRowSorter to be used. null
is an allowed value indicating no special sortingpublic TimeBarRowSorter getRowSorter()
public void setIntervalFilter(TimeBarIntervalFilter intervalFilter)
intervalFilter
- TimeBarIntervalFilter to be used. null
is an allowed value indicating no
interval filteringpublic TimeBarIntervalFilter getIntervalFilter()
public boolean isFiltered(de.jaret.util.date.Interval interval)
interval
- interval to check.
public void updateRowList()
public TimeBarRow getRow(int idx)
idx
- index in the list
public int getRowIndex(TimeBarRow row)
row
- row in question
public int getRowCount()
public long getTotalSeconds()
public long getTotalMilliSeconds()
public int getSecondsDisplayed()
public long getMilliSecondsDisplayed()
public TimeBarSelectionModel getSelectionModel()
public void setSelectionModel(TimeBarSelectionModel selectionModel)
selectionModel
- The selectionModel to set.public boolean getAdjustMinMaxDatesByModel()
public void setAdjustMinMaxDatesByModel(boolean adjustMinMaxDatesByModel)
adjustMinMaxDatesByModel
- The adjustMinMaxDatesByModel to set.public de.jaret.util.date.JaretDate getMaxDate()
public void setMaxDate(de.jaret.util.date.JaretDate maxDate)
maxDate
- The maxDate to set.public de.jaret.util.date.JaretDate getMinDate()
public void setMinDate(de.jaret.util.date.JaretDate minDate)
minDate
- The minDate to set.public de.jaret.util.date.JaretDate getStartDate()
public void setStartDate(de.jaret.util.date.JaretDate startDate)
startDate
- The startDate to set.protected void scrollTo(de.jaret.util.date.JaretDate startDate)
startDate
- new start datepublic TimeBarModel getModel()
public void setModel(TimeBarModel model)
model
- TimeBarModel to be displayedpublic void setModel(HierarchicalTimeBarModel hModel)
hModel
- hierarchical model to be displayedpublic HierarchicalTimeBarModel getHierarchicalModel()
null
if a flat model is usedpublic void setPixelPerSecond(double pixelPerSecond)
pixelPerSecond
- pixel per second.protected void setPixelPerSecond(double pixelPerSecond, boolean repaint)
pixelPerSecond
- pixel per secondrepaint
- true
if a repaint should be triggeredpublic void setSecondsDisplayed(int seconds, boolean center)
seconds
- number of seconds that will be displayed on the x axiscenter
- if set to true
the center date will be fixed while scalingpublic void setSecondsDisplayed(int seconds, de.jaret.util.date.JaretDate centerDate)
seconds
- number of seconds that will be displayed on the x axiscenterDate
- date that will be fixed while scalingpublic double getPixelPerSecond()
protected double getPixelPerMilliSecond()
public void setInitialDisplayRange(de.jaret.util.date.JaretDate startDate, int secondsDisplayed)
startDate
- start datesecondsDisplayed
- seconds to be displayed in the viewerpublic void setRowHeight(int rowHeight)
rowHeight
- new row height or default row heightpublic int getRowHeight()
public de.jaret.util.date.JaretDate getEndDate()
public void addMarker(TimeBarMarker marker)
marker
- TimeBarMarkerImpl to be displayed in the diagrampublic void remMarker(TimeBarMarker marker)
marker
- TimeBarMarkerImpl to be removedpublic TimeBarMarker getMarkerForXY(int x, int y)
x
- coordinatey
- coordinate
null
protected TimeBarMarker getMarkerForCoord(int coord)
coord
- coordinate
public java.util.List<TimeBarMarker> getMarkers()
public void addMarkers(java.util.List<TimeBarMarker> markers)
markers
- list of markerspublic void updateScrollBars()
public void handleHorizontalScroll(int value, boolean redirect)
value
- new valueredirect
- if true allow redirecteion to the vertical scroll according to orientationpublic int getRowIdxForAbsoluteOffset(int value)
value
- absolute position in the imagined all rows display
public int getRowPixOffsetForAbsoluteOffset(int rowIdx, int value)
rowIdx
- index of the first rowvalue
- absolute value (height/width offset)
public int getTotalHeight()
public int getAbsPosForRow(int rowIdx)
rowIdx
- inde of the row
public void handleVerticalScroll(int value, boolean redirect)
value
- new value of the scroll barredirect
- allow redirection to the horizontal scroll handling according to orientationpublic de.jaret.util.date.JaretDate dateForXY(int x, int y)
x
- x coordinatey
- y coordinate
public de.jaret.util.date.JaretDate dateForX(int x)
x
- the x coordinate
null
if no start date has been setpublic de.jaret.util.date.JaretDate dateForCoord(int coord)
coord
- the coordinate
null
if no start date has been setpublic de.jaret.util.date.JaretDate dateForCoord(int x, int y)
x
- xy
- y
public de.jaret.util.date.JaretDate dateForCoordAbs(int coord)
coord
- xposition
public int xForDate(de.jaret.util.date.JaretDate date)
date
- JaretDate for which the coordinate is to be calculated
public int xForDateAbs(de.jaret.util.date.JaretDate date)
date
- JaretDate for which the coordinate is to be calculated
protected int xForDatePlain(de.jaret.util.date.JaretDate date, boolean absolute)
date
- dateabsolute
- if set to true absolute x value referencing minDate
protected int xForDateVariable(de.jaret.util.date.JaretDate date, boolean absolute)
date
- dateabsolute
- if set to true absolute x value referencing minDate
public PPSInterval getPPSInterval(de.jaret.util.date.JaretDate d)
d
- date
null
public PPSInterval nextPPSInterval(de.jaret.util.date.JaretDate d)
d
- date
public TimeBarRow rowForXY(int x, int y)
x
- x coordinatey
- y coordinate
null
if no row could be determinedpublic TimeBarRow rowForY(int y)
y
- y coordinate (or x coordinate when using vertical orientation)
public int yForRow(TimeBarRow row)
row
- row
public int dispIdxForRow(TimeBarRow row)
row
- row
public java.awt.Rectangle getRowBounds(TimeBarRow row)
row
- row to calculate the bounds for
public java.awt.Rectangle getIntervalBounds(int rowIdx, de.jaret.util.date.Interval interval)
rowIdx
- index of the rowinterval
- interval
public java.awt.Rectangle getIntervalBounds(de.jaret.util.date.Interval interval)
interval
- interval
public java.awt.Rectangle getIntervalBounds(TimeBarRow row, de.jaret.util.date.Interval interval)
row
- TimeBarRow - may be nullinterval
- Interval in question
public int getRowsDisplayed()
public boolean isRowDisplayed(TimeBarRow row)
row
- row to be checked
public java.util.List<de.jaret.util.date.Interval> getIntervalsAt(int x, int y)
x
- x coordinatey
- y coordinate
public java.util.List<de.jaret.util.date.Interval> getIntervalsAt(TimeBarRow row, int x, int y)
row
- row to search inx
- x coordinate, will be ignored if set to -1y
- y coordinate, will be ignored if set to -1
public java.util.List<de.jaret.util.date.Interval> getIntervalsAt(TimeBarRow row, int x)
row
- row to search inx
- x coordinate
public void markerMoved(TimeBarMarker marker, de.jaret.util.date.JaretDate oldDate, de.jaret.util.date.JaretDate currentDate)
markerMoved
in interface TimeBarMarkerListener
marker
- the marker movedoldDate
- date before movementcurrentDate
- new date of the markerpublic void markerDescriptionChanged(TimeBarMarker marker, java.lang.String oldValue, java.lang.String newValue)
markerDescriptionChanged
in interface TimeBarMarkerListener
marker
- the marker of which the description changedoldValue
- previous descriptionnewValue
- current descriptionpublic void selectionChanged(TimeBarSelectionModel selectionModel)
selectionChanged
in interface TimeBarSelectionListener
selectionModel
- the selection model the change took place inpublic void elementAddedToSelection(TimeBarSelectionModel selectionModel, java.lang.Object element)
elementAddedToSelection
in interface TimeBarSelectionListener
selectionModel
- the selection model that has been changedelement
- the interval aded to the selectionpublic void elementRemovedFromSelection(TimeBarSelectionModel selectionModel, java.lang.Object element)
elementRemovedFromSelection
in interface TimeBarSelectionListener
selectionModel
- the selection model that has been changedelement
- element that has been removedpublic void modelDataChanged(TimeBarModel model)
modelDataChanged
in interface TimeBarModelListener
model
- the model of which the data changedpublic void rowDataChanged(TimeBarModel model, TimeBarRow row)
rowDataChanged
in interface TimeBarModelListener
model
- the changed modelrow
- the row of which the data has changedpublic void rowAdded(TimeBarModel model, TimeBarRow row)
rowAdded
in interface TimeBarModelListener
model
- the changed modelrow
- the added rowpublic void rowRemoved(TimeBarModel model, TimeBarRow row)
rowRemoved
in interface TimeBarModelListener
model
- the changed modelrow
- the removed rowpublic void elementAdded(TimeBarModel model, TimeBarRow row, de.jaret.util.date.Interval element)
elementAdded
in interface TimeBarModelListener
model
- the changed modelrow
- the changed rowelement
- the added elementpublic void elementRemoved(TimeBarModel model, TimeBarRow row, de.jaret.util.date.Interval element)
elementRemoved
in interface TimeBarModelListener
model
- the changed modelrow
- the changed rowelement
- the removed elementpublic void elementChanged(TimeBarModel model, TimeBarRow row, de.jaret.util.date.Interval element)
elementChanged
in interface TimeBarModelListener
model
- the changed modelrow
- the changed rowelement
- the element that changedpublic void headerChanged(TimeBarModel model, TimeBarRow row, java.lang.Object newHeader)
headerChanged
in interface TimeBarModelListener
model
- the changed modelrow
- the changed rownewHeader
- the changed headerpublic int getFirstRow()
public void setFirstRow(int firstRow)
firstRow
- The row to be displayed at the topmost position in the viewer.public void setFirstRow(TimeBarRow row)
row
- row to be the first row with an offset of 0.public void setFirstRow(int firstRow, int pixOffset)
firstRow
- upmost row to be displayedpixOffset
- pixel offsetpublic int getFirstRowOffset()
public void setFirstRowOffset(int offset)
offset
- pixel offset for the first rowpublic void setLastRow(int index)
index
- index of the row to be displayed at the bottom of the viewer.public void setLastRow(TimeBarRow row)
row
- the row to be displayed at the bottom of the viewer.public int getTimeScalePosition()
public void setTimeScalePosition(int timeScalePosition)
timeScalePosition
- The timeScalePosition to set.public int getYAxisWidth()
public void setYAxisWidth(int axisWidth)
axisWidth
- The yAxisWidth to set.public int getXAxisHeight()
public void setXAxisHeight(int axisHeight)
axisHeight
- The xAxisHeight to set.public void setHierarchyWidth(int width)
width
- width to usepublic int getHierarchyWidth()
public void preparePaint(int cwidth, int cheight)
cwidth
- width of the component client areacheight
- width of the component client areapublic void preparePaintHorizontal(int cwidth, int cheight)
cwidth
- width of the component client areacheight
- width of the component client areapublic void preparePaintVertical(int cwidth, int cheight)
cwidth
- width of the component client areacheight
- width of the component client areapublic java.awt.Rectangle getDiagramRect()
public java.awt.Rectangle getXAxisRect()
public java.awt.Rectangle getYAxisRect()
public java.awt.Rectangle getHierarchyRect()
public java.awt.Rectangle getTitleRect()
public de.jaret.util.date.JaretDate getLastStartDate()
public void setLastStartDate(de.jaret.util.date.JaretDate lastStartDate)
lastStartDate
- The lastStartDate to set.public void mousePressed(int x, int y, boolean isPopupTrigger, int modifierMask)
x
- x coordinate (control)y
- y coordinate (control)isPopupTrigger
- true if the button is the system's popup triggermodifierMask
- modifier mask for keyboard diversification (AWT input event type)public void mouseReleased(int x, int y, boolean isPopupTrigger, int modifierMask)
x
- x coordinatey
- y coordinateisPopupTrigger
- true if the button is the systems popup triggermodifierMask
- modifier mask for keyboard diversification (AWT input event type)public java.awt.Point getCtxCoordinate()
public TimeBarRow getCtxRow()
null
if none could be determinedpublic de.jaret.util.misc.Pair<TimeBarRow,de.jaret.util.date.JaretDate> getPopUpInformation()
null
if no click has been
recorded.public void mouseDragged(int x, int y, int modifierMask)
x
- new x coordinatey
- new y coordinatemodifierMask
- modifiers (awt)public void mouseMoved(int x, int y)
x
- x coordinatey
- y coordinatepublic boolean rowLineHit(int x, int y)
x
- x coordy
- y coord
true
if a row line is hitpublic void selectIntervals(java.awt.Rectangle curSelRect)
curSelRect
- selction rectanglepublic java.util.List<de.jaret.util.date.Interval> getIntervals(java.awt.Rectangle curSelRect)
curSelRect
- the marking rectangle.
public boolean getDrawRowGrid()
public void setDrawRowGrid(boolean drawRowGrid)
drawRowGrid
- The drawRowGrid to set.public void highlightRow(int y)
y
- y coordinatepublic void highlightRow(TimeBarRow row)
row
- the row to be highlightedpublic void deHighlightRow()
public TimeBarRow getHighlightedRow()
null
if no row is highlightedpublic TimeBarMarker getDraggedMarker()
null
if no marker is beeing draggedpublic java.awt.Rectangle getSelectionRect()
null
if none is presentpublic void setLastSelRect(java.awt.Rectangle rect)
rect
- rectanglepublic java.awt.Rectangle getLastSelRect()
null
public java.lang.String getToolTipText(int x, int y)
x
- x coordinate in the componenty
- y coordinate in the component
public java.awt.Rectangle getHeaderRect(TimeBarRow row)
row
- row to calculae the header recct for
null
if the header is not visible.public java.awt.Rectangle getHierarchyRect(TimeBarRow row)
row
- row to calculate the hierarchy rect for
null
if the row is not visible.public java.lang.String toString()
toString
in class java.lang.Object
public void setName(java.lang.String name)
name
- namepublic java.lang.String getName()
null
public void setAutoscrollEnabled(boolean enableAutoscroll)
enableAutoscroll
- true for enabling autoscrollpublic boolean isAutoscrollEnabled()
public int scrollDateToVisible(de.jaret.util.date.JaretDate date)
date
- date to be shown.
public void scrollRowToVisible(TimeBarRow row)
row
- TimeBarRow to be in the visible area.public void scrollIntervalToVisible(TimeBarRow row, de.jaret.util.date.Interval interval)
row
- TimeBarRow of the intervalinterval
- inteval.public boolean isIntervalVisible(TimeBarRow row, de.jaret.util.date.Interval interval)
row
- rowinterval
- interval
public void scrollIntervalToVisible(de.jaret.util.date.Interval interval)
interval
- inteval.public void scrollIntervalToVisible(de.jaret.util.date.Interval interval, double horizontalRatio, double verticalRatio)
interval
- interval to scroll tohorizontalRatio
- horizontal ratio (0 to 1.0 = left to right)verticalRatio
- vertical ratio (0 to 1.0 = top to bottom)public void scrollIntervalToVisible(TimeBarRow row, de.jaret.util.date.Interval interval, double horizontalRatio, double verticalRatio)
interval
- interval to scroll torow
- row of the intervalhorizontalRatio
- horizontal ratio (0 to 1.0 = left to right)verticalRatio
- vertical ratio (0 to 1.0 = top to bottom)public void addIntervalModificator(IntervalModificator intervalModificator)
intervalModificator
- modificator to addpublic void remIntervalModificator(IntervalModificator intervalModificator)
intervalModificator
- modificator to removepublic ITimeBarViewState getTimeBarViewState()
public HierarchicalViewState getHierarchicalViewState()
null
if no hierarchical model is usedpublic void setHierarchicalViewState(HierarchicalViewState hvs)
hvs
- hierachical viewstate to usepublic void setTitle(java.lang.String title)
title
- title to be displayedpublic java.lang.String getTitle()
public boolean isDrawOverlapping()
public void setDrawOverlapping(boolean drawOverlapping)
drawOverlapping
- if set to true all intervals will be painted overlapping each other if they do overlap.
False will reduce the space for rendering, stacking the intervals (default).public int getMaxOverlapCount(TimeBarRow row)
row
- row to check
public java.util.List<de.jaret.util.date.Interval> filterIntervals(java.util.List<de.jaret.util.date.Interval> intervals)
intervals
- list of intervals to be filtered
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public de.jaret.util.date.Interval getFocussedInterval()
public TimeBarRow getFocussedRow()
public boolean isFocussed(de.jaret.util.date.Interval interval)
interval
- interval to check
public void setFocussedInterval(de.jaret.util.date.Interval interval)
interval
- new focussed intervalpublic void setFocussedInterval(TimeBarRow row, de.jaret.util.date.Interval interval)
row
- row of the interval. May be null
if the row of the interval is unknown.interval
- interval to be focussed.public void moveFocusRight()
public void moveFocusLeft()
public void moveFocusUp()
public void moveFocusDown()
public void addFocussedIntervalListener(FocussedIntervalListener listener)
listener
- listener to be added.public void remFocussedIntervalListener(FocussedIntervalListener listener)
listener
- listener to be removed from the listener list.protected void fireFocussedIntervalChange(TimeBarRow newFocussedRow, de.jaret.util.date.Interval newFocussedInterval)
newFocussedRow
- new (currently focussed row)newFocussedInterval
- new (currently) focussed intervalpublic void addSelectionRectListener(ISelectionRectListener listener)
listener
- listener to be added.public void remSelectionRectListener(ISelectionRectListener listener)
listener
- listener to be removed from the listener list.protected void fireSelectionRectChanged()
protected void fireSelectionRectClosed()
protected void fireRegionRectChanged()
protected void fireRegionRectClosed()
public void handleKeyPressed(int keyCode, int modifierMask)
keyCode
- keyCode (Swing)modifierMask
- (Swing)public int getKeyboardChangeDelta()
public void setKeyboardChangeDelta(int keyboardChangeDelta)
keyboardChangeDelta
- the keyboardChangeDelta in seconds to setpublic boolean hasVariableXScale()
public void setVariableXScale(boolean state)
state
- true if a variable scale should be used.public TimeBarNode getPpsRow()
null
if no variable xscale has been defined.public int getSelectionDelta()
public void setSelectionDelta(int selectionDelta)
selectionDelta
- max distance for detectionpublic boolean isLineDraggingAllowed()
public void setLineDraggingAllowed(boolean lineDraggingAllowed)
lineDraggingAllowed
- true for enabling the drag possibilitypublic boolean isMilliAccuracy()
public void setMilliAccuracy(boolean milliAccuracy)
milliAccuracy
- true to use ms accuracypublic void setDrawingOffset(int marginLeft, int marginTop)
marginLeft
- left margin (pixel)marginTop
- top margin (pixel)public boolean getOptimizeScrolling()
public void setOptimizeScrolling(boolean optimizeScrolling)
optimizeScrolling
- true for optimized scrollingpublic TimeBarViewerInterface.Orientation getOrientation()
public void setOrientation(TimeBarViewerInterface.Orientation orientation)
orientation
- the new orientation for the viewerpublic int getAutoScaleRows()
public void setAutoScaleRows(int rows)
rows
- the number of rows or -1 for no special scaling (default)public void addTimeBarChangeListener(ITimeBarChangeListener listener)
listener
- listenerpublic void removeTimeBarChangeListener(ITimeBarChangeListener listener)
listener
- listener to removeprotected void fireIntervalChangeStarted(TimeBarRow row, de.jaret.util.date.Interval interval)
row
- row involvedinterval
- interval to be changedprotected void fireIntervalIntermediateChange(TimeBarRow row, de.jaret.util.date.Interval interval, de.jaret.util.date.JaretDate oldBegin, de.jaret.util.date.JaretDate oldEnd)
row
- row involvedinterval
- interval changingoldBegin
- begin when then change startedoldEnd
- end when the change startedprotected void fireIntervalChanged(TimeBarRow row, de.jaret.util.date.Interval interval, de.jaret.util.date.JaretDate oldBegin, de.jaret.util.date.JaretDate oldEnd)
row
- row involvedinterval
- interval that has been changedoldBegin
- begin when then change startedoldEnd
- end when the change startedprotected void fireIntervalChangeCancelled(TimeBarRow row, de.jaret.util.date.Interval interval)
row
- row involvedinterval
- interval that's change has been cancelledprotected void fireMarkerDragStarted(TimeBarMarker marker)
marker
- marker that is beeing draggedprotected void fireMarkerDragStopped(TimeBarMarker marker)
marker
- marker that has been draggedpublic boolean isRowHeightDraggingAllowed()
public void setRowHeightDraggingAllowed(boolean rowHeightDraggingAllowed)
rowHeightDraggingAllowed
- true for allowancepublic boolean isInRowAxis(int x, int y)
x
- x coordinatey
- y coordinate
true
if the point is in either hierarchy or header areapublic boolean isInDiagram(int x, int y)
x
- x coordinatey
- y coordinate
true
if the point is in the diagram rectanglepublic boolean getStrictClipTimeCheck()
setStrictClipTimeCheck(boolean)
).
true
if strict checking is enabledpublic void setStrictClipTimeCheck(boolean strictClipTimeCheck)
strictClipTimeCheck
- If set to true, intervals are filtered strictly by their interval bounds, disallowing
rendering beyond the bounding box calculated by the interval bounds. Defaults to false resulting in filtering by
the preferred drawing area.public int getScrollLookBackMinutes()
public void setScrollLookBackMinutes(int scrollLookBackMinutes)
scrollLookBackMinutes
- time in minutespublic int getScrollLookForwardMinutes()
public void setScrollLookForwardMinutes(int scrollLookForwardMinutes)
scrollLookForwardMinutes
- time in minutespublic IOverlapStrategy getOverlapStrategy()
public void setOverlapStrategy(IOverlapStrategy overlapStrategy)
overlapStrategy
- the strytegy to be used. May not be null
.public int getAutoscrollDelta()
public void setAutoscrollDelta(int autoscrollDelta)
autoscrollDelta
- delta in pixelpublic boolean getDragAllSelectedIntervals()
true
all selected intervals will be dragged together with the interval on that the drag happened.
public void setDragAllSelectedIntervals(boolean dragAllSelectedIntervals)
true
all selected intervals are dragged when an interval is dragged. The default is false.
dragAllSelectedIntervals
- true
to drag all selcted intervalspublic boolean getScrollOnFocus()
true
if the viewer should scroll to the focussed intervalpublic void setScrollOnFocus(boolean scrollOnFocus)
scrollOnFocus
- true
for scrolling to the focussed intervalpublic boolean getHideRoot()
true
if the root is not shownpublic void setHideRoot(boolean hideRoot)
hideRoot
- true
if the root node should be hiddenpublic boolean getMarkerDraggingInDiagramArea()
true
if marker dragging in the diagram area is allowedpublic void setMarkerDraggingInDiagramArea(boolean allowed)
allowed
- true
for allowing marker drag in the diagram area.public boolean isMarkerDraggingInProgress()
true
if a marker drag is in progresspublic IIntervalSelectionStrategy getIntervalSelectionStrategy()
public void setIntervalSelectionStrategy(IIntervalSelectionStrategy intervalSelectionStrategy)
intervalSelectionStrategy
- the interval selection strategy to use.public java.awt.Rectangle calcRect(TBRect tbrect)
tbrect
- tbrect to be painted
public TBRect getRegionRect()
null
public void clearRegionRect()
public void setRegionRectEnable(boolean enabled)
enabled
- true
enablingpublic boolean getRegionRectEnable()
public void setUseUniformHeight(boolean useUniformHeight)
useUniformHeight
- true
for uniform heights/widthspublic boolean getUseUniformHeight()
true
if all intervals in a non overlapping drawn row should use the same height/widthpublic void componentResized()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |