public class TransformHandler extends Object implements ChangeListener, Runnable, Saveable
Modifier and Type | Field and Description |
---|---|
protected boolean |
animating
Flag indicating status of animation.
|
protected int |
animAxis
Dimensional axis to use for animation.
|
protected Object |
animSync
Synchronization object for animation.
|
protected Thread |
animThread
Thread responsible for animation.
|
protected long |
burnDelay
Default burn-in delay in milliseconds.
|
protected DataCache |
cache
Cache of full-resolution data in memory.
|
static int |
DEFAULT_ANIMATION_RATE
Starting FPS for animation.
|
static long |
DEFAULT_BURN_DELAY
Starting burn-in delay in milliseconds.
|
protected int |
fps
Animation rate.
|
protected Vector |
links
Data transform links.
|
static long |
MINIMUM_BURN_DELAY
Minimum amount of time to delay burn-in.
|
protected Vector |
newLinks
List of uninitialized links.
|
protected TransformPanel |
panel
GUI controls for transform handler.
|
protected JPanel |
sliderPanel
Panel containing dimensional slider widgets.
|
protected Vector |
sliders
Dimensional slider widgets for linked transforms.
|
protected DisplayWindow |
window
Associated display window.
|
Constructor and Description |
---|
TransformHandler(DisplayWindow dw)
Creates a display transform handler.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addAxis(String axis)
Notifies the transform panel of a new dimensional axis.
|
void |
addTransform(DataTransform trans)
Links the given data transform to the display.
|
protected void |
doCustomMaps()
Adds any required custom mappings to the display.
|
protected void |
doLinks(int startIndex,
boolean unlinkFirst)
Links in the transform links, starting at the given index.
|
int |
getAnimationAxis()
Gets the currently assigned animation axis.
|
int |
getAnimationRate()
Gets animation rate.
|
int |
getAxis(DataTransform trans,
int axis)
Identifies the dimensional axis of the given transform to which the
specified slider axis corresponds, or -1 if none.
|
long |
getBurnDelay()
Gets the delay in milliseconds before full-resolution burn-in occurs.
|
DataCache |
getCache()
Gets cache of full-resolution data in memory.
|
TransformLink |
getLink(DataTransform trans)
Gets the transform link object for the given data transform.
|
int |
getLinkIndex(DataTransform trans)
Gets the transform link index for the given data transform.
|
TransformPanel |
getPanel()
Gets GUI controls for this transform handler.
|
int[] |
getPos(DataTransform trans)
Gets the dimensional position specified by the given transform's slider
widgets.
|
BioSlideWidget |
getSlider(int index)
Gets the slider at the given index, or null if no such slider exists.
|
JPanel |
getSliderPanel()
Gets a panel containing sliders widgets for linked transforms.
|
int |
getTransformCount()
Gets number of data transforms linked to the display.
|
DataTransform[] |
getTransforms()
Gets data transforms linked to the display.
|
DisplayWindow |
getWindow()
Gets associated display window.
|
boolean |
hasTransform(DataTransform trans)
Gets whether the given transform is currently linked to the display.
|
void |
initState(TransformHandler handler)
Modifies this object's state to match that of the given object.
|
boolean |
isAnimating()
Gets whether display is currently animating.
|
protected void |
makePanel()
Constructs GUI controls for the transform handler.
|
boolean |
matches(TransformHandler handler)
Tests whether two objects are in equivalent states.
|
void |
moveTransformDown(DataTransform trans)
Moves the given transform down in the Z-order.
|
void |
moveTransformUp(DataTransform trans)
Moves the given transform up in the Z-order.
|
protected void |
rebuild(boolean resetColors)
Rebuilds sliders and display mappings for all linked transforms.
|
void |
removeAllTransforms()
Unlinks all data transforms from the display.
|
void |
removeTransform(DataTransform trans)
Removes the given data transform from the display.
|
void |
restoreState(Element el)
Restores the current state from the given DOM element ("Display").
|
void |
run()
Animates the display.
|
void |
saveState(Element el)
Writes the current state to the given DOM element ("Display").
|
void |
setAnimating(boolean on)
Toggles animation of the display.
|
void |
setAnimationAxis(int animAxis)
Assigns the given axis as the animation axis.
|
void |
setAnimationRate(int fps)
Sets animation rate.
|
void |
setBurnDelay(long delay)
Sets the delay in milliseconds before full-resolution burn-in occurs.
|
protected void |
startAnimation()
Starts a new thread for animation.
|
void |
stateChanged(ChangeEvent e)
Handles slider updates.
|
public static final long DEFAULT_BURN_DELAY
public static final long MINIMUM_BURN_DELAY
public static final int DEFAULT_ANIMATION_RATE
protected DisplayWindow window
protected TransformPanel panel
protected DataCache cache
protected Vector links
protected Vector sliders
protected JPanel sliderPanel
protected long burnDelay
protected boolean animating
protected int fps
protected int animAxis
protected Thread animThread
protected Object animSync
protected Vector newLinks
public TransformHandler(DisplayWindow dw)
public void addTransform(DataTransform trans)
public void removeTransform(DataTransform trans)
public void removeAllTransforms()
public void moveTransformUp(DataTransform trans)
public void moveTransformDown(DataTransform trans)
public boolean hasTransform(DataTransform trans)
public DataTransform[] getTransforms()
public int getTransformCount()
public DataCache getCache()
public DisplayWindow getWindow()
public TransformPanel getPanel()
public JPanel getSliderPanel()
public BioSlideWidget getSlider(int index)
public int[] getPos(DataTransform trans)
public void setBurnDelay(long delay)
public long getBurnDelay()
public void setAnimating(boolean on)
public boolean isAnimating()
public void setAnimationRate(int fps)
public int getAnimationRate()
public void setAnimationAxis(int animAxis)
public int getAnimationAxis()
public TransformLink getLink(DataTransform trans)
public int getLinkIndex(DataTransform trans)
public int getAxis(DataTransform trans, int axis)
public boolean matches(TransformHandler handler)
public void initState(TransformHandler handler)
protected void makePanel()
protected void addAxis(String axis)
protected void doCustomMaps() throws VisADException, RemoteException
VisADException
RemoteException
protected void doLinks(int startIndex, boolean unlinkFirst)
protected void rebuild(boolean resetColors)
protected void startAnimation()
public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
public void saveState(Element el) throws SaveException
saveState
in interface Saveable
SaveException
public void restoreState(Element el) throws SaveException
restoreState
in interface Saveable
SaveException
Copyright © 2015–2022 SciJava. All rights reserved.