|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavamorph.CMeshDecorator
public class CMeshDecorator
| Field Summary | |
|---|---|
static Color |
CURSOR_COLOR
Draw color of the mesh point move cursor crosss. |
private File |
f_mesh
File to store the mesh to after program shutdown. |
private BufferedImage |
image
Input picture of the own side. |
private static int |
index
Index of those mesh point which is nearest to the mouse pointer. |
private Vector<Point> |
mesh
Collection of the mesh's points. |
static Color |
MESH_COLOR
Draw color of the mesh's lines. |
private CFrame |
parent
Parent component to draw the mesh to. |
private Point |
pos
Fine value of the mouse pointer's position. |
| Constructor Summary | |
|---|---|
CMeshDecorator(CFrame parent,
Vector<Point> mesh,
BufferedImage image,
File f_mesh)
Constructor. |
|
| Method Summary | |
|---|---|
void |
clip()
Ensure that the cursor is situated inside the bounds of the mesh while drawing. |
private int |
getIndex(Point p0)
Seek the index of that one mesh point which is nearest to the mouse cursor. |
void |
init()
If mesh creation from file is not possible or not intended: Create an grid mesh controlled by configuration values. |
void |
load()
Load the mesh on startup from file. |
void |
mouseClicked(MouseEvent e)
Due to Java API. |
void |
mouseDragged(MouseEvent e)
Move a mesh point with the mouse. |
void |
mouseEntered(MouseEvent e)
Due to Java API. |
void |
mouseExited(MouseEvent e)
Due to Java API. |
void |
mouseMoved(MouseEvent e)
Detect where the mouse is before and while moving the mesh point. |
void |
mousePressed(MouseEvent e)
Due to Java API. |
void |
mouseReleased(MouseEvent e)
Due to Java API. |
void |
paint(Graphics g)
Decorator API. |
void |
run()
Save-on-exit-thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Color MESH_COLOR
public static final Color CURSOR_COLOR
private CFrame parent
private static int index
private Vector<Point> mesh
private BufferedImage image
private File f_mesh
private Point pos
| Constructor Detail |
|---|
public CMeshDecorator(CFrame parent,
Vector<Point> mesh,
BufferedImage image,
File f_mesh)
parent - Parent JComponent to paint to.mesh - Pictures of the mesh.image - Picture of the own side.f_mesh - File to store the mesh to after shutdown.| Method Detail |
|---|
public void clip()
public void paint(Graphics g)
paint in interface IDecoratorg - Graphics context of the JComponent.public void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void run()
run in interface Runnablepublic void load()
public void init()
public void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerprivate int getIndex(Point p0)
p0 - on screen, scaled to picture coordinates.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||