/** * Sets the best projectors for this tiled view. Classes that extend * this class call this method when their best projectors change. * @param bhp a horizontal projector. * @param bvp a vertical projector. */ protected void setBestProjectors(Projector bhp, Projector bvp) { if (!equal(_bhp,bhp) || !equal(_bvp,bvp)) { _bhp = (bhp!=null)?new Projector(bhp):null; _bvp = (bvp!=null)?new Projector(bvp):null; // protect against setting unsupported TiledViews to non-linear scales if(setScales(bhp.getScale(),bvp.getScale())==null){ _bhp.setScale(AxisScale.LINEAR); _bvp.setScale(AxisScale.LINEAR); } if (_tile!=null) _tile.alignProjectors(_bhp.getScale(),_bvp.getScale()); } }
/** * Constructs a projector with specified v and u values. The * parameters u0 and u1 determine the margins of the projector. * The world coordinate v0 corresponds to normalized coordinate u0; * the world coordinate v1 corresponds to normalized coordinate u1. * @param v0 the v coordinate that corresponds to u coordinate u0; * v0 != v1 is required. * @param v1 the v coordinate that corresponds to u coordinate u1; * v0 != v1 is required. * @param u0 the u coordinate closest to normalized coordinate 0; * 0.0 <= u0 < u1 is required. * @param u1 the u coordinate closest to normalized coordinate 1; * u0 < u1 <= 1.0 is required. * @param s the AxisScale type of this projector */ public Projector(double v0, double v1, double u0, double u1, AxisScale s) { Check.argument(0.0<=u0,"0.0 <= u0"); Check.argument(u0<u1,"u0 < u1"); Check.argument(u1<=1.0,"u1 <= 1.0"); Check.argument(v0!=v1,"v0 != v1"); setScale(s); _u0 = u0; _u1 = u1; _v0 = v0; _v1 = v1; _scaleType = s; computeShiftsAndScales(); }
setScale(AxisScale.LINEAR);