Package ca.phon.media
Class TimeUIModel
java.lang.Object
ca.phon.media.TimeUIModel
Time model for UI applications. Useful for time based media.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final float
static final float
static final float
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddInterval
(float startTime, float endTime) void
addInterval
(TimeUIModel.Interval interval) addInterval
(TimeUIModel.Marker startMarker, TimeUIModel.Marker endMarker) void
addMarker
(TimeUIModel.Marker marker) void
void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) void
addTimeUIModelListener
(TimeUIModelListener listener) void
void
void
fireIntervalAdded
(TimeUIModel.Interval interval) void
fireIntervalRemoved
(TimeUIModel.Interval interval) void
fireMarkerAdded
(TimeUIModel.Marker marker) void
fireMarkerRemoved
(TimeUIModel.Marker marker) float
float
float
float
int
Returns the preferred UI width of the component based on current time valuesfloat
void
removeInterval
(TimeUIModel.Interval interval) void
removeMarker
(TimeUIModel.Marker marker) void
void
removePropertyChangeListener
(String propertyName, PropertyChangeListener listener) void
removeTimeUIModelListener
(TimeUIModelListener listener) static double
roundTime
(double time) Utility method to round time to nearest millisecond.void
setCurrentTime
(float currentTime) void
setEndTime
(float endTime) void
setMediaEndTime
(float mediaEndTime) void
setPixelsPerSecond
(float pixelsPerSecond) void
setStartTime
(float startTime) void
setTimeInsets
(Insets timeInsets) float
timeAtX
(double x) double
xForTime
(float time)
-
Field Details
-
MIN_PIXELS_PER_SECOND
public static final float MIN_PIXELS_PER_SECOND- See Also:
-
MAX_PIXELS_PER_SECOND
public static final float MAX_PIXELS_PER_SECOND- See Also:
-
DEFAULT_PIXELS_PER_SECOND
public static final float DEFAULT_PIXELS_PER_SECOND- See Also:
-
-
Constructor Details
-
TimeUIModel
public TimeUIModel()
-
-
Method Details
-
roundTime
public static double roundTime(double time) Utility method to round time to nearest millisecond.- Parameters:
time
-- Returns:
- roundedTime
-
getTimeInsets
-
setTimeInsets
-
getStartTime
public float getStartTime() -
setStartTime
public void setStartTime(float startTime) -
getEndTime
public float getEndTime() -
setEndTime
public void setEndTime(float endTime) -
getMediaEndTime
public float getMediaEndTime() -
setMediaEndTime
public void setMediaEndTime(float mediaEndTime) -
getCurrentTime
public float getCurrentTime() -
setCurrentTime
public void setCurrentTime(float currentTime) -
getPixelsPerSecond
public float getPixelsPerSecond() -
setPixelsPerSecond
public void setPixelsPerSecond(float pixelsPerSecond) -
getPreferredWidth
public int getPreferredWidth()Returns the preferred UI width of the component based on current time values- Returns:
-
timeAtX
public float timeAtX(double x) -
xForTime
public double xForTime(float time) -
addMarker
-
addMarker
-
removeMarker
-
getMarkers
-
clearMarkers
public void clearMarkers() -
addInterval
-
addInterval
public TimeUIModel.Interval addInterval(TimeUIModel.Marker startMarker, TimeUIModel.Marker endMarker) -
addInterval
-
removeInterval
-
getIntervals
-
clearIntervals
public void clearIntervals() -
addTimeUIModelListener
-
removeTimeUIModelListener
-
getTimeUIModelListeners
-
fireIntervalAdded
-
fireIntervalRemoved
-
fireMarkerAdded
-
fireMarkerRemoved
-
addPropertyChangeListener
-
removePropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-