|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
ij.plugin.frame.PlugInFrame
ij.plugin.frame.SyncWindows
public class SyncWindows
This class "synchronizes" mouse input in multiple windows. Once several windows are synchronized, mouse events in any one of the synchronized windows are propagated to the others. Note, the notion of synchronization use by the SyncWindows class here (i.e. multiple windows that all get the same mouse input) is somewhat different than the use of the synchronize keyword in the Java language. (In Java, synchronize has to do w/ critical section access by multiple threads.)
Optionally passes on change of z-slice of a stack to other stacks; Optionally translates positions to different windows via offscreen coordinates, i.e. correctly translates coordinates to windows with a different zoom; Updates the list of windows by click of a button;
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected Button |
bSyncAll
Buttons for user control. |
protected Button |
bUnsyncAll
Buttons for user control. |
protected Checkbox |
cChannel
Checkboxes for user control. |
protected Checkbox |
cCoords
Checkboxes for user control. |
protected Checkbox |
cCursor
Checkboxes for user control. |
protected Checkbox |
cFrame
Checkboxes for user control. |
protected Checkbox |
cScaling
Checkboxes for user control. |
protected Checkbox |
cSlice
Checkboxes for user control. |
protected ImageJ |
ijInstance
reference to current instance of ImageJ (to avoid repeated IJ.getInstance() s) |
protected int |
oldX
|
protected int |
oldY
|
protected Panel |
panel
Panel for GUI |
protected Vector |
vListMap
Hashtable to map list ids to image window ids. |
protected Vector |
vwins
Indices of synchronized image windows are maintained in this Vector. |
protected List |
wList
List of currently displayed windows retrieved from ImageJ window manager. |
protected int |
x
|
protected int |
y
|
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SyncWindows()
Create window sync frame. |
|
SyncWindows(String s)
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Implementation of ActionListener interface. |
protected Rectangle |
boundingRect(int x,
int y,
int oldX,
int oldY)
Compute bounding rectangle given current and old cursor locations. |
protected Panel |
buildControlPanel()
Builds panel containing control buttons. |
protected Component |
buildWindowList()
Builds list of open ImageWindows |
void |
close()
Closes this window. |
protected Panel |
controlPanel()
Build window list display and button controls. |
void |
displayChanged(ij.plugin.frame.DisplayChangeEvent e)
Method to pass on changes of the z-slice of a stack. |
ImagePlus |
getImageFromVector(int n)
Get ImagePlus from Windows-Vector vwins. |
String |
getImageTitleFromVector(int n)
Get the title of image n from Windows-Vector vwins. |
int |
getIndexOfImage(ImagePlus image)
Get index of "image" in vector of synchronized windows, if image is in vector. |
Insets |
getInsets()
|
static SyncWindows |
getInstance()
|
protected Point |
getMatchingCoords(ImageCanvas ic,
ImageCanvas icc,
int x,
int y)
Get Screen Coordinates for ImageCanvas ic matching the OffScreen Coordinates of the current ImageCanvas. |
void |
imageClosed(ImagePlus imp)
Implementation of ImageListener interface: update window list, if image is opened or closed |
void |
imageOpened(ImagePlus imp)
Implementation of ImageListener interface: update window list, if image is opened or closed |
void |
imageUpdated(ImagePlus imp)
|
void |
itemStateChanged(ItemEvent e)
Item Listener method |
void |
mouseClicked(MouseEvent e)
Propagate mouse clicked events to all synchronized windows. |
void |
mouseDragged(MouseEvent e)
Propagate mouse dragged events to all synchronized windows. |
void |
mouseEntered(MouseEvent e)
Propagate mouse entered events to all synchronized windows. |
void |
mouseExited(MouseEvent e)
Propagate mouse exited events to all synchronized windows. |
void |
mouseMoved(MouseEvent e)
Draws the "synchronize" cursor in each of the synchronized windows. |
void |
mousePressed(MouseEvent e)
Propagate mouse pressed events to all synchronized windows. |
void |
mouseReleased(MouseEvent e)
Propagate mouse released events to all synchronized windows. |
static void |
setC(ImageWindow source,
int channel)
|
static void |
setT(ImageWindow source,
int frame)
|
static void |
setZ(ImageWindow source,
int slice)
|
protected void |
updateWindowList()
|
void |
windowClosing(WindowEvent e)
Override parent windowClosing method to clean up synchronized resources on exit. |
| Methods inherited from class ij.plugin.frame.PlugInFrame |
|---|
focusGained, focusLost, run, windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
protected Vector vwins
protected int oldX
protected int oldY
protected int x
protected int y
protected List wList
protected Panel panel
protected Checkbox cCursor
protected Checkbox cSlice
protected Checkbox cChannel
protected Checkbox cFrame
protected Checkbox cCoords
protected Checkbox cScaling
protected Button bSyncAll
protected Button bUnsyncAll
protected Vector vListMap
protected final ImageJ ijInstance
| Constructor Detail |
|---|
public SyncWindows()
public SyncWindows(String s)
| Method Detail |
|---|
public static void setC(ImageWindow source,
int channel)
public static void setZ(ImageWindow source,
int slice)
public static void setT(ImageWindow source,
int frame)
public void displayChanged(ij.plugin.frame.DisplayChangeEvent e)
public void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic void itemStateChanged(ItemEvent e)
itemStateChanged in interface ItemListenerpublic void windowClosing(WindowEvent e)
windowClosing in interface WindowListenerwindowClosing in class PlugInFramepublic void imageOpened(ImagePlus imp)
imageOpened in interface ImageListenerpublic void imageClosed(ImagePlus imp)
imageClosed in interface ImageListenerpublic void imageUpdated(ImagePlus imp)
imageUpdated in interface ImageListenerprotected Panel controlPanel()
protected Component buildWindowList()
protected Panel buildControlPanel()
protected Rectangle boundingRect(int x,
int y,
int oldX,
int oldY)
protected void updateWindowList()
public ImagePlus getImageFromVector(int n)
public String getImageTitleFromVector(int n)
public int getIndexOfImage(ImagePlus image)
protected Point getMatchingCoords(ImageCanvas ic,
ImageCanvas icc,
int x,
int y)
public Insets getInsets()
getInsets in class Containerpublic void close()
PlugInFrame
close in class PlugInFramepublic static SyncWindows getInstance()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||