|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.interactor.AbstractInteractor
diva.canvas.interactor.DragInteractor
jsky.image.graphics.MeasureBand
public class MeasureBand
Class to display a "measure band" showing the distance between 2 points in world coordinates.
Field Summary | |
---|---|
protected diva.canvas.event.MouseFilter |
dragFilter
Used to filter mouse events |
protected diva.canvas.event.EventLayer |
eventLayer
|
protected diva.canvas.FigureLayer |
figureLayer
|
protected DivaGraphicsImageDisplay |
imageDisplay
The image display that we are drawing on |
protected diva.canvas.CompositeFigure |
mband
|
protected diva.canvas.toolbox.BasicFigure |
mbandAngle
Angle lines (horizontal and vertical) |
protected diva.canvas.toolbox.BasicFigure |
mbandDiagRect
box around diagonal label |
protected diva.canvas.toolbox.LabelFigure |
mbandDiagText
The diagonal label |
protected diva.canvas.toolbox.BasicFigure |
mbandHeightRect
box around height label |
protected diva.canvas.toolbox.LabelFigure |
mbandHeightText
The height label |
protected diva.canvas.toolbox.BasicFigure |
mbandLine
Diagonal line with arrows |
protected diva.canvas.toolbox.BasicFigure |
mbandWidthRect
box around width label |
protected diva.canvas.toolbox.LabelFigure |
mbandWidthText
The width label |
protected java.text.NumberFormat |
nf
Used to format values as strings. |
protected double |
originX
|
protected double |
originY
|
Constructor Summary | |
---|---|
MeasureBand(DivaGraphicsImageDisplay imageDisplay)
Create a new MeasureBand attached to the given graphics pane. |
Method Summary | |
---|---|
java.lang.String |
formatHM(double val)
|
protected java.awt.geom.Rectangle2D |
getBoundsWithPadding(diva.canvas.toolbox.LabelFigure fig)
Return the bounds of the given label with padding |
diva.canvas.event.EventLayer |
getEventLayer()
Get the layer that drag events are listened on |
diva.canvas.FigureLayer |
getFigureLayer()
Get the layer that figures are selected on |
static void |
main(java.lang.String[] args)
test main: usage: java GraphicsImageDisplay |
void |
mouseDragged(diva.canvas.event.LayerEvent event)
Reshape the rubber-band, swapping coordinates if necessary. |
void |
mousePressed(diva.canvas.event.LayerEvent event)
Clear the selection, and create the rubber-band |
void |
mouseReleased(diva.canvas.event.LayerEvent event)
Delete the rubber-band |
void |
setEnabled(boolean enabled)
Set the enabled state. |
void |
setEventLayer(diva.canvas.event.EventLayer l)
Set the layer that drag events are listened on |
void |
setFigureLayer(diva.canvas.FigureLayer l)
Set the layer that figures are selected on |
protected void |
updateMBand(double x0,
double y0,
double x1,
double y1,
boolean showAngle)
Update the measure band. |
Methods inherited from class diva.canvas.interactor.DragInteractor |
---|
addLayerListener, appendConstraint, constrainPoint, fireLayerEvent, getSelectiveEnabled, getTargetArray, getX, getY, prependConstraint, removeLayerListener, setSelectiveEnabled, setTargetArray, setup, targets, translate |
Methods inherited from class diva.canvas.interactor.AbstractInteractor |
---|
accept, getMouseFilter, isConsuming, isEnabled, isMotionEnabled, mouseClicked, mouseEntered, mouseExited, mouseMoved, setConsuming, setMotionEnabled, setMouseFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DivaGraphicsImageDisplay imageDisplay
protected diva.canvas.FigureLayer figureLayer
protected diva.canvas.event.EventLayer eventLayer
protected diva.canvas.CompositeFigure mband
protected diva.canvas.toolbox.BasicFigure mbandLine
protected diva.canvas.toolbox.BasicFigure mbandAngle
protected diva.canvas.toolbox.BasicFigure mbandWidthRect
protected diva.canvas.toolbox.BasicFigure mbandHeightRect
protected diva.canvas.toolbox.BasicFigure mbandDiagRect
protected diva.canvas.toolbox.LabelFigure mbandWidthText
protected diva.canvas.toolbox.LabelFigure mbandHeightText
protected diva.canvas.toolbox.LabelFigure mbandDiagText
protected double originX
protected double originY
protected diva.canvas.event.MouseFilter dragFilter
protected java.text.NumberFormat nf
Constructor Detail |
---|
public MeasureBand(DivaGraphicsImageDisplay imageDisplay)
Method Detail |
---|
public diva.canvas.FigureLayer getFigureLayer()
public diva.canvas.event.EventLayer getEventLayer()
public void setFigureLayer(diva.canvas.FigureLayer l)
public void setEventLayer(diva.canvas.event.EventLayer l)
public void setEnabled(boolean enabled)
setEnabled
in interface diva.canvas.interactor.Interactor
setEnabled
in class diva.canvas.interactor.AbstractInteractor
public void mousePressed(diva.canvas.event.LayerEvent event)
mousePressed
in interface diva.canvas.event.LayerListener
mousePressed
in class diva.canvas.interactor.DragInteractor
public void mouseDragged(diva.canvas.event.LayerEvent event)
mouseDragged
in interface diva.canvas.event.LayerListener
mouseDragged
in class diva.canvas.interactor.DragInteractor
public void mouseReleased(diva.canvas.event.LayerEvent event)
mouseReleased
in interface diva.canvas.event.LayerListener
mouseReleased
in class diva.canvas.interactor.DragInteractor
public java.lang.String formatHM(double val)
protected void updateMBand(double x0, double y0, double x1, double y1, boolean showAngle)
x0
- the X screen coordinate of the starting point of the dragy0
- the Y screen coordinate of the starting point of the dragx1
- the X screen coordinate of the mouse pointery1
- the Y screen coordinate of the mouse pointershowAngle
- if true, show the mbandAngle item, otherwise only the diagonal line.protected java.awt.geom.Rectangle2D getBoundsWithPadding(diva.canvas.toolbox.LabelFigure fig)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |