|
|||||||||
| 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
uk.ac.starlink.topcat.plot.BlobPanel
public class BlobPanel
Component which allows the user to draw a blob using the mouse. You drag the mouse around to cover patches of the component; you can create several separate or overlapping blobs by doing several click-drag sequences. If you drag off the window the currently-dragged region will be ditched. Clicking with the right button removes the most recently-added blob. Resizing the window clears any existing blobs (since it's not obvious how or if to resize the blobs). Try it, it's easy.
| Nested Class Summary |
|---|
| 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 | |
|---|---|
BlobPanel()
Creates a new BlobPanel. |
|
| Method Summary | |
|---|---|
protected void |
blobCompleted(Shape blob)
Invoked when this component's action is invoked to terminate a blob drawing session. |
void |
clear()
Resets the current blob to a null shape. |
Shape |
getBlob()
Returns the currently-defined blob. |
Action |
getBlobAction()
Returns the action which is used to start and stop blob drawing. |
boolean |
isActive()
Indicates whether this blob is currently active. |
void |
mouseClicked(MouseEvent evt)
|
void |
mouseDragged(MouseEvent evt)
|
void |
mouseEntered(MouseEvent evt)
|
void |
mouseExited(MouseEvent evt)
|
void |
mouseMoved(MouseEvent evt)
|
void |
mousePressed(MouseEvent evt)
|
void |
mouseReleased(MouseEvent evt)
|
protected void |
paintComponent(Graphics g)
|
void |
setActive(boolean active)
Sets whether this panel is active (visible, accepting mouse gestures, drawing shapes) or inactive (invisible). |
void |
setBlob(Shape blob)
Sets the currently-defined blob. |
void |
setColors(Color fillColor,
Color pathColor)
Sets the colours which will be used for drawing the blob. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BlobPanel()
| Method Detail |
|---|
public Shape getBlob()
public void setBlob(Shape blob)
blob - shape to be displayed and played around with by the userpublic void clear()
public Action getBlobAction()
blobCompleted(java.awt.Shape) is called.
public void setActive(boolean active)
active - true to select activenesspublic boolean isActive()
protected void blobCompleted(Shape blob)
blob - completed shape
public void setColors(Color fillColor,
Color pathColor)
fillColor - colour which fills the blob areapathColor - colour which delineates the blob regionprotected void paintComponent(Graphics g)
paintComponent in class JComponentpublic void mouseEntered(MouseEvent evt)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent evt)
mouseExited in interface MouseListenerpublic void mouseClicked(MouseEvent evt)
mouseClicked in interface MouseListenerpublic void mousePressed(MouseEvent evt)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent evt)
mouseReleased in interface MouseListenerpublic void mouseDragged(MouseEvent evt)
mouseDragged in interface MouseMotionListenerpublic void mouseMoved(MouseEvent evt)
mouseMoved in interface MouseMotionListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||