|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.visualization.batikutil.DragableArea
public class DragableArea
A simple dragable area for Batik.
Nested Class Summary | |
---|---|
static interface |
DragableArea.DragListener
Listener interface for drag events. |
Field Summary | |
---|---|
protected Element |
coordref
The coordinate system node. |
protected Element |
element
Our element node. |
protected DragableArea.DragListener |
listener
A listener to notify on drags (when not subclassing). |
protected org.w3c.dom.svg.SVGPoint |
startDragPoint
The point where the drag started. |
protected SVGPlot |
svgp
The plot we are attached to. |
Constructor Summary | |
---|---|
DragableArea(SVGPlot plot,
double x,
double y,
double w,
double h)
Constructor for a dragable area. use getElement() to get the DOM node. |
|
DragableArea(SVGPlot plot,
double x,
double y,
double w,
double h,
DragableArea.DragListener listener)
Constructor for a dragable area. use getElement() to get the DOM node. |
|
DragableArea(SVGPlot plot,
Element coordref,
double x,
double y,
double w,
double h)
Constructor for a dragable area. use getElement() to get the DOM node. |
|
DragableArea(SVGPlot plot,
Element coordref,
double x,
double y,
double w,
double h,
DragableArea.DragListener listener)
Constructor for a dragable area. use getElement() to get the DOM node. |
Method Summary | |
---|---|
void |
destroy()
Remove the listeners |
void |
disableStart()
Disable capturing of 'mousedown' events. |
protected void |
disableStop()
Disable capturing of 'mousemove' and 'mouseup' events. |
protected boolean |
duringDrag(org.w3c.dom.svg.SVGPoint startPoint,
org.w3c.dom.svg.SVGPoint dragPoint,
Event evt,
boolean inside)
Method called during drags. |
void |
enableStart()
Enable capturing of 'mousedown' events. |
protected void |
enableStop()
Enable capturing of 'mousemove' and 'mouseup' events. |
protected boolean |
endDrag(org.w3c.dom.svg.SVGPoint startPoint,
org.w3c.dom.svg.SVGPoint dragPoint,
Event evt,
boolean inside)
Method called when a drag was ended. |
protected org.w3c.dom.svg.SVGPoint |
getCoordinates(Event evt)
Return the event coordinates for this event. |
Element |
getElement()
The DOM element. |
void |
handleEvent(Event evt)
|
void |
makeInvisible()
Make the rectangle invisible. |
void |
makeVisible()
Make the rectangle visible, for debug purposes. |
protected boolean |
startDrag(org.w3c.dom.svg.SVGPoint startPoint,
Event evt)
Action to do on drag start. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Element element
protected final Element coordref
protected final SVGPlot svgp
protected org.w3c.dom.svg.SVGPoint startDragPoint
protected DragableArea.DragListener listener
Constructor Detail |
---|
public DragableArea(SVGPlot plot, double x, double y, double w, double h)
plot
- Plot we'll be added tox
- X positiony
- Y positionw
- Widthh
- Heightpublic DragableArea(SVGPlot plot, Element coordref, double x, double y, double w, double h)
plot
- Plot we'll be added tocoordref
- Element defining the coordinate systemx
- X positiony
- Y positionw
- Widthh
- Heightpublic DragableArea(SVGPlot plot, double x, double y, double w, double h, DragableArea.DragListener listener)
plot
- Plot we'll be added tox
- X positiony
- Y positionw
- Widthh
- Heightlistener
- Drag listenerpublic DragableArea(SVGPlot plot, Element coordref, double x, double y, double w, double h, DragableArea.DragListener listener)
plot
- Plot we'll be added tocoordref
- Element defining the coordinate systemx
- X positiony
- Y positionw
- Widthh
- Heightlistener
- Drag listenerMethod Detail |
---|
public void destroy()
public Element getElement()
public void enableStart()
public void disableStart()
protected void enableStop()
protected void disableStop()
public void handleEvent(Event evt)
handleEvent
in interface EventListener
protected org.w3c.dom.svg.SVGPoint getCoordinates(Event evt)
evt
- Event
protected boolean startDrag(org.w3c.dom.svg.SVGPoint startPoint, Event evt)
startPoint
- Point where the drag was started.evt
- The event object
true
to start the drag operationprotected boolean duringDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, Event evt, boolean inside)
startPoint
- Drag starting pointdragPoint
- Drag end pointevt
- The event objectinside
- Inside the tracked element
true
to continue the dragprotected boolean endDrag(org.w3c.dom.svg.SVGPoint startPoint, org.w3c.dom.svg.SVGPoint dragPoint, Event evt, boolean inside)
startPoint
- Drag starting pointdragPoint
- Drag end pointevt
- The event objectinside
- Success flag
true
to complete the dragpublic void makeInvisible()
public void makeVisible()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |