private void duringZoom(MouseEvent e) { int xdraw = e.getX(); int ydraw = e.getY(); if (_tile!=null) { drawZoom(_tile,_xdraw,_ydraw,true,true); drawZoom(_tile, xdraw, ydraw,true,true); } else if (_axis!=null) { drawZoom(_axis,_xdraw,_ydraw,_axis.isHorizontal(),_axis.isVertical()); drawZoom(_axis, xdraw, ydraw,_axis.isHorizontal(),_axis.isVertical()); } }
/** * Constructs a tile zoom mode with specified manager. * @param modeManager the mode manager for this mode. */ public TileZoomMode(ModeManager modeManager) { super(modeManager); setName("Zoom"); setIcon(loadIcon(TileZoomMode.class,"ZoomIn16.gif")); setMnemonicKey(KeyEvent.VK_Z); setAcceleratorKey(KeyStroke.getKeyStroke(KeyEvent.VK_Z,0)); setShortDescription("Zoom in tile or axis"); }
/** * Adds the mode manager to this frame and activates some modes. */ private void addModeManager() { _modeManager = new ModeManager(); _panelTL.getMosaic().setModeManager(_modeManager); if (_panelBR!=_panelTL) _panelBR.getMosaic().setModeManager(_modeManager); _tileZoomMode = new TileZoomMode(_modeManager); _mouseTrackMode = new MouseTrackMode(_modeManager); _tileZoomMode.setActive(true); _mouseTrackMode.setActive(true); }
drawRect(tile,x,y,bx,by); for (int irow=0; irow<nrow; ++irow) { if (irow!=jrow) drawZoom(mosaic.getTile(irow,jcol),x,y,true,false); drawZoom(mosaic.getTile(jrow,icol),x,y,false,true); drawZoom(mosaic.getTileAxisTop(jcol),x,y,true,false); drawZoom(mosaic.getTileAxisLeft(jrow),x,y,false,true); drawZoom(mosaic.getTileAxisBottom(jcol),x,y,true,false); drawZoom(mosaic.getTileAxisRight(jrow),x,y,false,true); drawRect(tile,x,y,bx,by);
mosaic.getTileAxisRight(1).setLabel("axis label"); TileZoomMode zoomMode = new TileZoomMode(mosaic.getModeManager()); zoomMode.setActive(true);
drawRect(axis,x,y,bx,by); int nrow = mosaic.countRows(); for (int irow=0; irow<nrow; ++irow) drawZoom(mosaic.getTile(irow,jcol),x,y,true,false); if (axis.isTop()) { drawZoom(mosaic.getTileAxisBottom(jcol),x,y,true,false); } else { drawZoom(mosaic.getTileAxisTop(jcol),x,y,true,false); int ncol = mosaic.countColumns(); for (int icol=0; icol<ncol; ++icol) drawZoom(mosaic.getTile(jrow,icol),x,y,false,true); if (axis.isLeft()) { drawZoom(mosaic.getTileAxisRight(jrow),x,y,false,true); } else { drawZoom(mosaic.getTileAxisLeft(jrow),x,y,false,true); drawRect(axis,x,y,bx,by);
private void beginZoom(MouseEvent e) { _xbegin = e.getX(); _ybegin = e.getY(); Object source = e.getSource(); if (source instanceof Tile) { Tile tile = _tile = (Tile)source; drawZoom(tile,_xbegin,_ybegin,true,true); tile.addMouseMotionListener(_mml); } else if (source instanceof TileAxis) { TileAxis axis = _axis = (TileAxis)source; drawZoom(axis,_xbegin,_ybegin,_axis.isHorizontal(),_axis.isVertical()); axis.addMouseMotionListener(_mml); } }