public interface JHotDrawAdapter<F extends Figure> extends ImageJPlugin, RichPlugin
Overlay
and a JHotDraw Figure
.
JHotDraw adapters discoverable at runtime must implement this interface and
be annotated with @Plugin
with attribute Plugin.type()
=
JHotDrawAdapter
.class. While it possible to create a JHotDraw adapter
merely by implementing this interface, it is encouraged to instead extend
AbstractJHotDrawAdapter
, for convenience.
Modifier and Type | Method and Description |
---|---|
Figure |
createDefaultFigure()
Creates a default figure of the type handled by this adapter.
|
Overlay |
createNewOverlay()
Creates a new overlay.
|
JHotDrawTool |
getCreationTool(ImageDisplay display) |
void |
mouseDown(Display<?> d,
int x,
int y) |
void |
mouseDrag(Display<?> d,
int x,
int y) |
void |
report(RealCoords p1,
RealCoords p2) |
boolean |
supports(Overlay overlay,
Figure figure)
Determines whether the adapter can handle a particular overlay, or overlay
/ figure combination.
|
boolean |
supports(Tool tool)
Determines whether the adapter is designed to work with the given tool.
|
void |
updateFigure(OverlayView view,
F figure)
Update the appearance of the figure to match the overlay
|
void |
updateOverlay(F figure,
OverlayView view)
Update the overlay to match the appearance of the figure
|
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
boolean supports(Tool tool)
tool
- The tool in question.boolean supports(Overlay overlay, Figure figure)
overlay
- - an overlay that might be editablefigure
- - a figure that will be either updated by the overlay or will
update the overlay. The figure can be null: this indicates that
the adapter is capable of creating the figure associated with the
overlay/Overlay createNewOverlay()
Figure createDefaultFigure()
void updateOverlay(F figure, OverlayView view)
figure
- the figure that holds the current correct appearanceview
- view of the overlay that needs to be changed to bring it
in-sync with the figure.void updateFigure(OverlayView view, F figure)
view
- view of the overlay to be represented by the figurefigure
- the figure that is to be made to look like the overlayJHotDrawTool getCreationTool(ImageDisplay display)
void mouseDown(Display<?> d, int x, int y)
void mouseDrag(Display<?> d, int x, int y)
void report(RealCoords p1, RealCoords p2)
Copyright © 2014–2022 ImageJ. All rights reserved.