private void beginTracking(MouseEvent e) { _xmouse = e.getX(); _ymouse = e.getY(); _tile = (Tile)e.getSource(); beginTracking(_tile.getTileAxisTop(),_xmouse,_ymouse); beginTracking(_tile.getTileAxisLeft(),_xmouse,_ymouse); beginTracking(_tile.getTileAxisBottom(),_xmouse,_ymouse); beginTracking(_tile.getTileAxisRight(),_xmouse,_ymouse); fireTrack(); _tile.addMouseMotionListener(_mml); } private void beginTracking(TileAxis ta, int x, int y) {
private void showLines() { Mosaic mosaic = getMosaic(); Tile t00 = mosaic.getTile(0,0); Tile t10 = mosaic.getTile(1,0); Tile t11 = mosaic.getTile(1,1); if (_orientation==Orientation.X1DOWN_X2RIGHT) { t00.addTiledView(_l23); t10.addTiledView(_l12); t11.addTiledView(_l13); } else if (_orientation==Orientation.X1DOWN_X3RIGHT) { t00.addTiledView(_l23); t10.addTiledView(_l13); t11.addTiledView(_l12); } else if (_orientation==Orientation.X1RIGHT_X2UP) { t00.addTiledView(_l13); t10.addTiledView(_l12); t11.addTiledView(_l23); } else if (_orientation==Orientation.X1RIGHT_X3UP) { t00.addTiledView(_l12); t10.addTiledView(_l13); t11.addTiledView(_l23); } } private void hideLines() {
/** * Gets the horizontal projector of this tiled view. * The returned horizontal projector is a reference to that for the tile * that contains this tiled view or null, if this tiled view is not in a * tile. * @return the horizontal projector; null, if none. */ public Projector getHorizontalProjector() { return (_tile!=null)?_tile.getHorizontalProjector():null; }
private void endTracking() { _tile.removeMouseMotionListener(_mml); endTracking(_tile.getTileAxisTop()); endTracking(_tile.getTileAxisLeft()); endTracking(_tile.getTileAxisBottom()); endTracking(_tile.getTileAxisRight()); fireTrack(); _tile = null; } private void endTracking(TileAxis ta) {
private Point complexToPoint(Cdouble z) { Transcaler ts = _tile.getTranscaler(); Projector hp = _tile.getHorizontalProjector(); Projector vp = _tile.getVerticalProjector(); double xu = hp.u(z.r); double yu = vp.u(z.i); int xp = ts.x(xu); int yp = ts.y(yu); return new Point(xp,yp); }
if (source instanceof Tile) { Tile tile = (Tile)source; Container frame = tile.getTopLevelAncestor(); Projector hp = tile.getHorizontalProjector(); Projector vp = tile.getVerticalProjector(); DRectangle r = tile.getViewRectangle(); double ffsize = frame.getFont().getSize(); double fwidth = frame.getWidth(); double fheight = frame.getHeight(); double fratio = fwidth/fheight; double pwidth = tile.getWidth(); double pheight = tile.getHeight(); double pratio = pwidth/pheight; double vwidth = abs(hp.v(r.x)-hp.v(r.x+r.width));
zy = true; drawZoom(_tile,_xdraw,_ydraw,zx,zy); _tile.removeMouseMotionListener(_mml); _tile = null; int ymin = min(_ybegin,_ydraw); int ymax = max(_ybegin,_ydraw); Transcaler ts = tile.getTranscaler(); DRectangle vr = tile.getViewRectangle(); tile.setViewRectangle(vr);
public void paintToRect(Graphics2D g2d, int x, int y, int w, int h) { g2d = createGraphics(g2d,x,y,w,h); // Save transcaler for this panel. Transcaler tsPanel = _ts; // Set transcaler for the graphics rectangle. _ts = getTranscaler(w,h); // Paint tiled views. for (TiledView tv : _tvs) { Graphics2D gtv = (Graphics2D)g2d.create(); tv.paint(gtv); gtv.dispose(); } // Restore transcaler for this panel. _ts = tsPanel; g2d.dispose(); }
/** * Sets default limits for horizontal and vertical axes. This method may * be used to restore default limits after they have been set explicitly. */ public void setLimitsDefault() { _svp=null; _shp=null; alignProjectors(); }
public void mousePressed(MouseEvent e) { if (e.isShiftDown()) { add(e); } else if (e.isControlDown()) { remove(e); } else { if (beginEdit(e)) { _editing = true; _tile.addMouseMotionListener(_mml); } } } public void mouseReleased(MouseEvent e) {
/** * Gets the vertical projector of this tiled view. * The returned vertical projector is a reference to that for the tile * that contains this tiled view or null, if this tiled view is not in * a tile. * @return the vertical projector; null, if none. */ public Projector getVerticalProjector() { return (_tile!=null)?_tile.getVerticalProjector():null; }
/** * Gets the transcaler of this tiled view. * The returned transcaler is a reference to that for the tile that * contains this tiled view or null, if this tiled view is not in a * tile. * @return the transcaler; null, if none. */ public Transcaler getTranscaler() { return (_tile!=null)?_tile.getTranscaler():null; }
public void mouseReleased(MouseEvent e) { if (_editing) { _tile.removeMouseMotionListener(_mml); endEdit(e); _editing = false; } } };
for (int irow=0; irow<nrow; ++irow) { for (int icol=0; icol<ncol; ++icol) { Tile tile = _tiles[irow][icol] = new Tile(this,irow,icol); _tileList.add(tile); add(tile); for (int icol=0; icol<ncol; ++icol) { Tile tile = _tiles[irow][icol]; tile.addMouseWheelListener(new MouseWheelListener() { public void mouseWheelMoved(MouseWheelEvent event) { double u = event.getWheelRotation();
boolean[] checkScales = checkViewScales(hscale,vscale); if(!checkScales[0]) _bhp.setScale(AxisScale.LINEAR);
private Cdouble pointToComplex(int x, int y) { Transcaler ts = _tile.getTranscaler(); Projector hp = _tile.getHorizontalProjector(); Projector vp = _tile.getVerticalProjector(); double xu = ts.x(x); double yu = ts.y(y); double xv = hp.v(xu); double yv = vp.v(yu); return roundToReal(new Cdouble(xv,yv)); }
/** * Sets default limits for the vertical axis. This method may be used * to restore default limits after they have been set explicitly. */ public void setVLimitsDefault() { _svp=null; alignProjectors(); }
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); } }
tile.getHorizontalProjector() : tile.getVerticalProjector(); Transcaler t = tile.getTranscaler(w,h);
/** * Adds the specified tiled view to this plot panel. If the tiled view * is already in the specified tile, it is first removed, before adding * it again. * @param irow the tile row index. * @param icol the tile column index. * @param tv the tiled view. * @return true, if the tile did not already contain the specified * tiled view; false, otherwise. */ public boolean addTiledView(int irow, int icol, TiledView tv) { if (tv instanceof ColorMapped) { ColorMapped cm = (ColorMapped)tv; cm.getColorMap().addListener(_colorMapHandler); } return getTile(irow,icol).addTiledView(tv); }