public class MediaComponent extends Component
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
Constructor and Description |
---|
MediaComponent(Object player)
Creates a new instance of MediaComponent
|
Modifier and Type | Method and Description |
---|---|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content.
|
protected void |
deinitialize()
Invoked to indicate that the component initialization is being reversed
since the component was detached from the container hierarchy.
|
long |
getMediaTime()
Return the duration of the media
|
Object |
getVideoControl()
Returns the native video control if such a control exists, this is required
for some platforms.
|
protected void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and
"ready for action" component state
|
boolean |
isFullScreen()
Indicates the fullscreen mode
|
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden
by subclasses to perform custom drawing or invoke the UI API's to let
the PLAF perform the rendering.
|
protected void |
paintBackground(Graphics g)
Paints the background of the component, invoked with the clipping region
and appropriate scroll translation.
|
void |
paintBackgrounds(Graphics g)
This method paints all the parents Components Background.
|
void |
setFullScreen(boolean fullscreen)
Toggles the fullscreen mode
|
void |
setLoopCount(int count)
Set the number of times the media should loop
|
long |
setMediaTime(long now)
"Jump" to a point in time within the media
|
void |
setVisible(boolean visible)
Display the embedded media component
|
void |
start()
Start media playback implicitly setting the component to visible
|
void |
stop()
Stope media playback
|
addFocusListener, animate, calcScrollSize, contains, deinitializeCustomStyle, dragInitiated, fireClicked, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBaseline, getBaselineResizeBehavior, getBorder, getBottomGap, getBounds, getClientProperty, getComponentForm, getDirtyRegion, getHeight, getLabelForComponent, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getScrollAnimationSpeed, getScrollDimension, getScrollX, getScrollY, getSelectCommandText, getSelectedStyle, getSideGap, getStyle, getUIID, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, handlesInput, hasFocus, initCustomStyle, isBorderPainted, isDragActivated, isEnabled, isFocusable, isFocusPainted, isInitialized, isRTL, isScrollable, isScrollableX, isScrollableY, isScrollVisible, isSelectableInteraction, isSmoothScrolling, isTactileTouch, isTactileTouch, isTensileDragEnabled, isVisible, keyPressed, keyReleased, keyRepeated, laidOut, longKeyPress, longPointerPress, paintBorder, paintComponent, paintComponent, paintScrollbars, paintScrollbarX, paintScrollbarY, paramString, pointerDragged, pointerDragged, pointerHover, pointerHoverReleased, pointerPressed, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, removeFocusListener, repaint, repaint, requestFocus, scrollRectToVisible, scrollRectToVisible, setBorderPainted, setCellRenderer, setDirtyRegion, setEnabled, setFocus, setFocusable, setFocusPainted, setHandlesInput, setHeight, setInitialized, setIsScrollVisible, setLabelForComponent, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setRTL, setScrollAnimationSpeed, setScrollSize, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setStyle, setTactileTouch, setTensileDragEnabled, setUIID, setUnselectedStyle, setUnSelectedStyle, setWidth, setX, setY, styleChanged, toString
public MediaComponent(Object player)
player
- the media playerprotected void initComponent()
Component
initComponent
in class Component
protected void deinitialize()
Component
deinitialize
in class Component
public void paint(Graphics g)
Component
protected void paintBackground(Graphics g)
Component
paintBackground
in class Component
g
- the component graphicspublic void paintBackgrounds(Graphics g)
Component
paintBackgrounds
in class Component
g
- the graphics objectprotected Dimension calcPreferredSize()
Component
calcPreferredSize
in class Component
public void setVisible(boolean visible)
setVisible
in class Component
visible
- true to display, false to hidepublic void start()
public void stop()
public void setLoopCount(int count)
count
- the number of times the media should looppublic long getMediaTime()
public long setMediaTime(long now)
now
- the point in time to "Jump" topublic void setFullScreen(boolean fullscreen)
fullscreen
- true for fullscreen modepublic boolean isFullScreen()
public Object getVideoControl()