public interface DataView extends PositionableByAxis, ImageJPlugin, Contextual
Data
object (such as a Dataset
or Overlay
)
for use with an ImageDisplay
. The view keeps track of the currently
visualized position within the N-dimensional data space (and beyond), as well
as color settings and other view-specific metadata.
For example, a typical 2D display may have a number of sliders enabling a
user to select a particular plane of a Dataset
for display. The view
keeps track of the current position and provides access to the resultant
plane.
For dimensions outside the linked Data
object's space, calling
PositionableByAxis.setPosition(long, AxisType)
embeds the view at the specified
position along that axis. When the view is part of a display that contains
that dimension, the view will only be visible when the display's position for
that dimension matches the view's value.
Data views discoverable at runtime must implement this interface and be
annotated with @Plugin
with attribute Plugin.type()
=
DataView
.class. While it possible to create a data view merely by
implementing this interface, it is encouraged to instead extend
AbstractDataView
, for convenience.
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Discards the view, performing any needed cleanup.
|
Data |
getData()
Gets the
Data represented by this view. |
Position |
getPlanePosition()
Gets the N-dimensional plane position of this view.
|
int |
getPreferredHeight()
Gets the view's natural height in pixels.
|
int |
getPreferredWidth()
Gets the view's natural width in pixels.
|
void |
initialize(Data data)
Initializes the view with the given
Data . |
boolean |
isCompatible(Data data)
Gets whether this view is compatible with the given
Data . |
boolean |
isSelected() |
void |
rebuild()
Recreates the view.
|
void |
setSelected(boolean isSelected)
Set the view's selection state.
|
void |
update()
Updates and redraws the view onscreen.
|
getIntPosition, getLongPosition, setPosition
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, positionAsLongArray, positionAsPoint
localize, localize, localize, positionAsDoubleArray, positionAsRealPoint
numDimensions
bck, fwd, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition
context, getContext, setContext
boolean isCompatible(Data data)
Data
.void initialize(Data data)
Data
. This method should only
be called once.Position getPlanePosition()
void setSelected(boolean isSelected)
isSelected
- - true if selected, false if not.boolean isSelected()
int getPreferredWidth()
int getPreferredHeight()
void update()
void rebuild()
Data
has changed structurally somehow.void dispose()
Copyright © 2014–2022 ImageJ. All rights reserved.