|
||||||||
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
ShapeComponent
public class ShapeComponent
Class ShapeCanvas: holds shapes in a custom drawn area and handles a region selection Copyright Georgia Institute of Technology 2007
Nested Class Summary | |
---|---|
(package private) class |
ShapeComponent.MyMouseAdapter
An inner class for handling the mouse listener interface |
(package private) class |
ShapeComponent.MyMouseMotionAdapter
Inner class for handling the mouse motion listener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 | |
---|---|
ShapeComponent()
A constructor that uses the default size |
|
ShapeComponent(BufferedImage image)
A constructor that takes a buffered image for the background |
|
ShapeComponent(int width,
int height)
A constructor that takes the width and height |
Method Summary | |
---|---|
void |
add(AbstractShape shape)
Method to add a shape to the shape vector |
void |
clearShapes()
Clear all shapes out of the shape vector |
static void |
main(String[] argv)
|
void |
paintComponent(Graphics g)
Method to paint the shape canvas and all objects in it |
void |
remove(int index)
Method to remove a shape given the index |
void |
remove(Shape shape)
Method to remove a shape from the shape vector |
void |
setBackgroundImage(BufferedImage image)
Method to set the background image to select the region from |
void |
setShape(String shapeType)
Set the type of the shape that will be created when the user clicks in the shape canvas. |
void |
setVideoCapture(VideoCapturer handler)
|
void |
update(Graphics g)
Update normally clears the background and calls paint override it here to just call paint |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ShapeComponent()
public ShapeComponent(int width, int height)
width
- the width of the canvasheight
- the height of the canvaspublic ShapeComponent(BufferedImage image)
Method Detail |
---|
public void setVideoCapture(VideoCapturer handler)
public void setBackgroundImage(BufferedImage image)
RegionInterface
setBackgroundImage
in interface RegionInterface
image
- the image to usepublic void add(AbstractShape shape)
shape
- the shape to addpublic void remove(Shape shape)
shape
- the shape to removepublic void remove(int index)
remove
in class Container
index
- the index of the shape in the shape vector that you
wish to removepublic void update(Graphics g)
update
in class JComponent
g
- the graphics context on which to drawpublic void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- the graphic context on which to paintpublic void setShape(String shapeType)
shapeType
- the name of the shapepublic void clearShapes()
clearShapes
in interface RegionInterface
public static void main(String[] argv)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |