public void setFont(Font font) { super.setFont(font); if (_tileList!=null) { for (Tile tile : _tileList) tile.setFont(font); for (TileAxis axis : _axisList) axis.setFont(font); } revalidate(); }
/** * Sets the label for this color bar. * @param label the label; null, if none. */ public void setLabel(String label) { _mosaic.getTileAxisRight(0).setLabel(label); revalidate(); }
public void setForeground(Color color) { super.setForeground(color); if (_tileList!=null) { for (Tile tile : _tileList) tile.setForeground(color); for (TileAxis axis : _axisList) axis.setForeground(color); } }
public void testCombineWithLinearA () { Transcaler tr = new Transcaler(0.0, 0.0, 1.0, 1.0, 0, 0, 100, 100); Projector xp = new Projector(0.0, 10.0, AxisScale.LINEAR); Projector yp = new Projector(0.0, 50.0, AxisScale.LINEAR); Transcaler tr_c = tr.combineWith(xp, yp); assertVeryClose(5.0, tr_c.x(tr_c.x(5.0))); assertVeryClose(5.0, tr_c.y(tr_c.y(5.0))); assertVeryClose(75, tr_c.x(tr_c.x(75))); assertVeryClose(75, tr_c.y(tr_c.y(75))); }
public void testMerge1r () { Projector pa = new Projector(10, 20, 0.0, 1.0); Projector pb = new Projector(10, 20, 0.1, 0.8); pa.merge(pb); Projector expected = new Projector(10, 20, 0.1, 0.8); assertVeryClose(expected,pa); } public void testMerge2 () {
/** * Sets default limits for the horizontal axis in the specified column. * This method may be used to restore default limits after they have * been set explicitly. * @param icol the column index. */ public void setHLimitsDefault(int icol) { int nrow = getMosaic().countRows(); for (int irow=0; irow<nrow; ++irow) getTile(irow,icol).setHLimitsDefault(); }
/** * Sets default limits for the vertical axis in the specified column. * This method may be used to restore default limits after they have * been set explicitly. * @param irow the row index. */ public void setVLimitsDefault(int irow) { int ncol = getMosaic().countColumns(); for (int icol=0; icol<ncol; ++icol) getTile(irow,icol).setVLimitsDefault(); }
/** * Sets the format for the horizontal axis in the specified column. * @param icol the column index. * @param format the format. */ public void setHFormat(int icol, String format) { if (_axesPlacement==AxesPlacement.LEFT_TOP) { _mosaic.getTileAxisTop(icol).setFormat(format); } else if (_axesPlacement==AxesPlacement.LEFT_BOTTOM) { _mosaic.getTileAxisBottom(icol).setFormat(format); } }
/** * Sets the format for major tic annotation for this color bar. * The default format is "%1.4G", which yields a minimum of 1 digit, * with up to 4 digits of precision. Any trailing zeros and decimal * point are removed from tic annotation. * @param format the format. */ public void setFormat(String format) { _mosaic.getTileAxisRight(0).setFormat(format); revalidate(); }
/** * Sets the major labeled tic interval in the axis for this color bar. * @param interval the major labeled tic interval. */ public void setInterval(double interval) { _mosaic.getTileAxisRight(0).setInterval(interval); revalidate(); }
public void setFont(Font font) { super.setFont(font); if (_mosaic!=null) _mosaic.setFont(font); revalidate(); }
public void setBounds(int x, int y, int width, int height) { super.setBounds(x,y,width,height); if (updateAxisTics()) revalidateLater(); // revalidating now will not work! repaint(); }
public void setBackground(Color color) { super.setBackground(color); if (_tileList!=null) { for (Tile tile : _tileList) tile.setBackground(color); for (TileAxis axis : _axisList) axis.setBackground(color); } }
/** * Sets the format for the vertical axis in the specified row. * @param irow the row index. * @param format the format. */ public void setVFormat(int irow, String format) { if (_axesPlacement!=AxesPlacement.NONE) { _mosaic.getTileAxisLeft(irow).setFormat(format); } }
/** * Sets tic label rotation for the vertical axis in the specifie row. * If true, tic labels in the vertical axis are rotated 90 degrees * counter-clockwise. The default is false, not rotated. * @param irow the row index. * @param rotated true, if rotated; false, otherwise. */ public void setVRotated(int irow, boolean rotated) { if (_axesPlacement!=AxesPlacement.NONE) { _mosaic.getTileAxisLeft(irow).setVerticalAxisRotated(rotated); } }
public void setForeground(Color color) { super.setForeground(color); if (_mosaic!=null) _mosaic.setForeground(color); }
public void testCombineWithLinearB () { Transcaler tr = new Transcaler(0.0, 0.0, 1.0, 1.0, 0, 0, 100, 100); Projector xp = new Projector(0.0, 10.0, AxisScale.LINEAR); Projector yp = new Projector(50.0, 0.0, AxisScale.LINEAR); Transcaler tr_c = tr.combineWith(xp, yp); assertVeryClose(5.0, tr_c.x(tr_c.x(5.0))); assertVeryClose(5.0, tr_c.y(tr_c.y(5.0))); assertVeryClose(75, tr_c.x(tr_c.x(75))); assertVeryClose(75, tr_c.y(tr_c.y(75))); }
public void testMergeELog () { Projector pa = new Projector(10, 0, AxisScale.LOG10); Projector pb = new Projector( 1, 11, AxisScale.LOG10); pa.merge(pb); Projector expected = new Projector(11,0, AxisScale.LOG10); assertVeryClose(expected, pa); } public void testMergeFLog () {
public void testMergeHLog () { Projector pa = new Projector( 1.5, 1.4, AxisScale.LOG10); Projector pb = new Projector( 1, 2, AxisScale.LOG10); pa.merge(pb); Projector expected = new Projector(2,1, AxisScale.LOG10); assertVeryClose(expected, pa); }