/** * Convenience method to set both scales the same * @param scale the new scale * @return this TiledView */ public TiledView setScales(AxisScale scale) { return setScales(scale,scale); }
/** * Convenience method to set the scale of the * best horizontal projector. * @param scale the new scale * @return this TiledView */ public TiledView setHScale(AxisScale scale) { return setScales(scale,_bvp.getScale()); }
/** * Convenience method to set the scale of the * best vertical projector. * @param scale the new scale * @return this TiledView */ public TiledView setVScale(AxisScale scale) { return setScales(_bhp.getScale(),scale); }
/** * 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()); } }