Module io.github.mmm.ui.fx.media
Package io.github.mmm.ui.fx.widget.media
Class FxMediaWidget<W extends javafx.scene.Node>
- java.lang.Object
 - 
- io.github.mmm.ui.api.widget.AbstractUiWidget
 - 
- io.github.mmm.ui.spi.widget.AbstractUiNativeWidget
 - 
- io.github.mmm.ui.spi.widget.AbstractUiNativeWidgetWrapper<W>
 - 
- io.github.mmm.ui.fx.widget.FxWidget<W>
 - 
- io.github.mmm.ui.fx.widget.FxWidgetStyleable<W>
 - 
- io.github.mmm.ui.fx.widget.FxWidgetNode<W>
 - 
- io.github.mmm.ui.fx.widget.media.FxMediaWidget<W>
 
 
 
 
 
 
 
 
- 
- Type Parameters:
 W- type ofJavaFx widget.
- All Implemented Interfaces:
 EventSource<UiEvent,UiEventListener>,AttributeFeatureMedia,AttributeFeaturePlayback,AttributeFeatureVolume,AttributeReadEnabled,AttributeReadId,AttributeReadValid,AttributeReadVisible,AttributeWriteEnabled,AttributeWriteId,AttributeWriteReadOnly,AttributeWriteTooltip,AttributeWriteValidationFailure,AttributeWriteVisible,UiMediaWidget,UiNativeWidget,UiRegularWidget,UiWidget,UiNativeWidgetWrapper<W>
- Direct Known Subclasses:
 FxMediaPlayer
public abstract class FxMediaWidget<W extends javafx.scene.Node> extends FxWidgetNode<W> implements UiMediaWidget
Implementation ofUiMediaWidgetfor JavaFx.- Since:
 - 1.0.0
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected io.github.mmm.ui.fx.widget.media.fx.MediaPlayerAdaptermediaPlayerAdapterTheMediaPlayerAdapter.- 
Fields inherited from class io.github.mmm.ui.fx.widget.FxWidget
CLASS_INVALID, CLASS_READ_ONLY, widget 
- 
Fields inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteValidationFailure
STYLE_INVALID 
 - 
 
- 
Constructor Summary
Constructors Constructor Description FxMediaWidget(W widget)The constructor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckMediaType(UiMediaType type)protected io.github.mmm.ui.fx.widget.media.fx.MediaPlayerAdaptercreateMediaPlayerAdapter()doublegetDuration()UiMediagetMedia()doublegetPosition()doublegetVolume()This method gets the volume of this object.booleanisMuted()booleanisPlaying()voidsetMedia(UiMedia media)voidsetMuted(boolean muted)voidsetPlaying(boolean playing)voidsetPosition(double position)voidsetVolume(double volume)- 
Methods inherited from class io.github.mmm.ui.fx.widget.FxWidgetNode
getTopWidget, setEnabledNative, setIdNative, setReadOnlyNative, setTooltipNative, setVisibleNative 
- 
Methods inherited from class io.github.mmm.ui.fx.widget.FxWidgetStyleable
createStyles 
- 
Methods inherited from class io.github.mmm.ui.fx.widget.FxWidget
getTopNode, getWidget, onAction, onClose, onFocusChange, onFocusChanged, onValueChange, onValueChanged, setTooltip, setWidget 
- 
Methods inherited from class io.github.mmm.ui.spi.widget.AbstractUiNativeWidgetWrapper
createDefaultStyles, getId, getStyles, getTooltip, onStylesChanged, setId, setTooltip 
- 
Methods inherited from class io.github.mmm.ui.spi.widget.AbstractUiNativeWidget
addListener, dispose, doDispose, doGetEnabledState, doGetVisibleState, doSetEnabledState, doSetEnabledState, doSetValidationFailure, doSetVisibleState, doSetVisibleState, ensureHandlers, fireEvent, getEventAdapter, getParent, getProgrammaticEventType, getReadOnlyFixed, getValidationFailure, hasListeners, isDisposed, isEnabled, isInitiallyVisible, isReadOnly, isValid, isVisible, isVisibleWithoutRoot, registerHandlers, removeListener, requireNotDisposed, setEnabled, setParent, setProgrammaticEventType, setReadOnly, setReadOnlyFixed, setValidationFailure, setVisible, unwrap, validateDown 
- 
Methods inherited from class io.github.mmm.ui.api.widget.AbstractUiWidget
isEmpty, setParent, unwrap 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeFeaturePlayback
pause, play 
- 
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeFeatureVolume
mute, unmute 
- 
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeReadId
getId 
- 
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteId
setId 
- 
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteTooltip
getTooltip, setTooltip 
- 
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteValidationFailure
setValidationFailure 
- 
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener 
- 
Methods inherited from interface io.github.mmm.ui.api.widget.UiWidget
cast, dispose, getModificationTimestamp, getParent, getReadOnlyFixed, getStyles, isDisposed, isEnabled, isEnabled, isFocused, isModified, isReadOnly, isValid, isVisible, isVisible, reset, setEnabled, setEnabled, setFocused, setReadOnly, setReadOnlyFixed, setVisible, setVisible, validate, validate, validate, validateDown, validateUp 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
FxMediaWidget
public FxMediaWidget(W widget)
The constructor.- Parameters:
 widget- theJavaFx widget.
 
 - 
 
- 
Method Detail
- 
createMediaPlayerAdapter
protected io.github.mmm.ui.fx.widget.media.fx.MediaPlayerAdapter createMediaPlayerAdapter()
- Returns:
 - the 
MediaPlayerAdapter. 
 
- 
getMedia
public UiMedia getMedia()
- Specified by:
 getMediain interfaceUiMediaWidget- Returns:
 - the 
UiMediaornullin notset. 
 
- 
setMedia
public void setMedia(UiMedia media)
- Specified by:
 setMediain interfaceUiMediaWidget- Parameters:
 media- theUiMediato set and load.
 
- 
checkMediaType
protected void checkMediaType(UiMediaType type)
- Parameters:
 type- theUiMediaTypeto verify.
 
- 
isPlaying
public boolean isPlaying()
- Specified by:
 isPlayingin interfaceAttributeFeaturePlayback- Returns:
 trueif the media is currently playing,falseotherwise (if paused or nothing to play).
 
- 
setPlaying
public void setPlaying(boolean playing)
- Specified by:
 setPlayingin interfaceAttributeFeaturePlayback- Parameters:
 playing- is the new value ofAttributeFeaturePlayback.isPlaying(). Usetrueto play or resume andfalseto pause. Please note that if no media is present or it is invalid, it will not get intoplayingstate even after providingtrue
 
- 
getVolume
public double getVolume()
Description copied from interface:AttributeFeatureVolumeThis method gets the volume of this object. Please note that the actual volume might be influenced by the mixer of the operating system. This is just a relative scale to the system volume.- Specified by:
 getVolumein interfaceAttributeFeatureVolume- Returns:
 - the volume in the range from 
0.0(mute) to1.0(maximum). - See Also:
 AttributeFeatureVolume.isMuted()
 
- 
setVolume
public void setVolume(double volume)
- Specified by:
 setVolumein interfaceAttributeFeatureVolume- Parameters:
 volume- is the new value ofAttributeFeatureVolume.getVolume(). If negative, set to0and if greater than1set to1.
 
- 
isMuted
public boolean isMuted()
- Specified by:
 isMutedin interfaceAttributeFeatureVolume- Returns:
 trueif muted (audio is suppressed withoutsetting volumeto0so thevolumeis not lost),falseotherwise.
 
- 
setMuted
public void setMuted(boolean muted)
- Specified by:
 setMutedin interfaceAttributeFeatureVolume- Parameters:
 muted- the new value ofAttributeFeatureVolume.isMuted().
 
- 
getPosition
public double getPosition()
- Specified by:
 getPositionin interfaceAttributeFeatureMedia- Returns:
 - the current position of the playback as factor in the range from 
0(0%, start) to1(100%, end). 
 
- 
setPosition
public void setPosition(double position)
- Specified by:
 setPositionin interfaceAttributeFeatureMedia- Parameters:
 position- is the new value ofAttributeFeatureMedia.getPosition(). If negative, set to0and if greater than1set to1.
 
- 
getDuration
public double getDuration()
- Specified by:
 getDurationin interfaceAttributeFeatureMedia- Returns:
 - the duration of the current media in seconds. Will be 
0if no media is present, media is invalid or empty. 
 
 - 
 
 -