|
Bartosz Firyn (SarXos) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.github.sarxos.webcam.WebcamPanel
public class WebcamPanel
Simply implementation of JPanel allowing users to render pictures taken with webcam.
Nested Class Summary | |
---|---|
class |
WebcamPanel.DefaultPainter
Default painter used to draw image in panel. |
static interface |
WebcamPanel.Painter
Interface of the painter used to draw image in panel. |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.BaselineResizeBehavior |
Field Summary | |
---|---|
static double |
MIN_FREQUENCY
Minimum FPS frequency. |
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
WebcamPanel(Webcam webcam)
Creates webcam panel and automatically start webcam. |
|
WebcamPanel(Webcam webcam,
boolean start)
Creates new webcam panel which display image from camera in you your Swing application. |
|
WebcamPanel(Webcam webcam,
Dimension size,
boolean start)
Creates new webcam panel which display image from camera in you your Swing application. |
Method Summary | |
---|---|
WebcamPanel.Painter |
getDefaultPainter()
|
double |
getFPSLimit()
Get rendering frequency in FPS (equivalent to Hz). |
WebcamPanel.Painter |
getPainter()
Get painter used to draw image in webcam panel. |
boolean |
isFillArea()
Get value of fill area setting. |
boolean |
isFPSDisplayed()
|
boolean |
isFPSLimited()
Is frequency limit enabled? |
boolean |
isStarted()
Is webcam panel repainting started. |
boolean |
isStarting()
Is webcam panel repainting starting. |
void |
pause()
Pause rendering. |
void |
propertyChange(PropertyChangeEvent evt)
|
void |
resume()
Resume rendering. |
void |
setFillArea(boolean fillArea)
Image will be resized to fill panel area if true. |
void |
setFPSDisplayed(boolean displayed)
|
void |
setFPSLimit(double fps)
Set rendering frequency (in Hz or FPS). |
void |
setFPSLimited(boolean frequencyLimit)
Enable or disable frequency limit. |
void |
setPainter(WebcamPanel.Painter painter)
Set new painter. |
void |
start()
Open webcam and start rendering. |
void |
stop()
Stop rendering and close webcam. |
void |
webcamClosed(WebcamEvent we)
Webcam has been closed |
void |
webcamDisposed(WebcamEvent we)
Webcam has been disposed |
void |
webcamImageObtained(WebcamEvent we)
Webcam image has been obtained. |
void |
webcamOpen(WebcamEvent we)
Webcam has been open. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double MIN_FREQUENCY
Constructor Detail |
---|
public WebcamPanel(Webcam webcam)
webcam
- the webcam to be used to fetch imagespublic WebcamPanel(Webcam webcam, boolean start)
webcam
- the webcam to be used to fetch imagesstart
- true if webcam shall be automatically startedpublic WebcamPanel(Webcam webcam, Dimension size, boolean start)
setFillArea(boolean)
method to configure this.
webcam
- the webcam to be used to fetch imagessize
- the size of panelstart
- true if webcam shall be automatically startedsetFillArea(boolean)
Method Detail |
---|
public void setPainter(WebcamPanel.Painter painter)
painter
- the painter object to be setpublic WebcamPanel.Painter getPainter()
public void start()
public void stop()
public void pause()
public void resume()
public boolean isFPSLimited()
public void setFPSLimited(boolean frequencyLimit)
frequencyLimit
- public double getFPSLimit()
public void setFPSLimit(double fps)
fps
- the frequencypublic boolean isFPSDisplayed()
public void setFPSDisplayed(boolean displayed)
public boolean isStarting()
public boolean isStarted()
public void setFillArea(boolean fillArea)
fillArea
- shall image be resided to fill panel areapublic boolean isFillArea()
public WebcamPanel.Painter getDefaultPainter()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public void webcamOpen(WebcamEvent we)
WebcamListener
webcamOpen
in interface WebcamListener
we
- a webcam eventpublic void webcamClosed(WebcamEvent we)
WebcamListener
webcamClosed
in interface WebcamListener
we
- a webcam eventpublic void webcamDisposed(WebcamEvent we)
WebcamListener
webcamDisposed
in interface WebcamListener
we
- a webcam eventpublic void webcamImageObtained(WebcamEvent we)
WebcamListener
webcamImageObtained
in interface WebcamListener
we
- a webcam event
|
Bartosz Firyn (SarXos) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |