/** * Sets the label for the vertical axis in the specified row. * @param irow the row index. * @param label the label. */ public void setVLabel(int irow, String label) { if (_axesPlacement!=AxesPlacement.NONE) { _mosaic.getTileAxisLeft(irow).setLabel(label); } }
/** * 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(); }
/** * Sets the label for the horizontal axis in the specified column. * @param icol the column index. * @param label the label. */ public void setHLabel(int icol, String label) { if (_axesPlacement==AxesPlacement.LEFT_TOP) { _mosaic.getTileAxisTop(icol).setLabel(label); adjustColorBar(); } else if (_axesPlacement==AxesPlacement.LEFT_BOTTOM) { _mosaic.getTileAxisBottom(icol).setLabel(label); adjustColorBar(); } }
mosaic.getTileAxisTop(0).setLabel("axis label"); mosaic.getTileAxisTop(1).setLabel("axis label"); mosaic.getTileAxisTop(2).setLabel("axis label"); mosaic.getTileAxisLeft(0).setLabel("axis label"); mosaic.getTileAxisLeft(1).setLabel("axis label"); mosaic.getTileAxisBottom(0).setLabel("axis label"); mosaic.getTileAxisBottom(1).setLabel("axis label"); mosaic.getTileAxisBottom(2).setLabel("axis label"); mosaic.getTileAxisRight(0).setLabel("axis label"); mosaic.getTileAxisRight(1).setLabel("axis label");
/** * Constructs a new color bar with specified label. * @param label the label; null, if none. */ public ColorBar(String label) { super(); _mosaic = new Mosaic(1,1,EnumSet.of(Mosaic.AxesPlacement.RIGHT)); if (label!=null) _mosaic.getTileAxisRight(0).setLabel(label); _mosaic.setWidthMinimum(0,15); _mosaic.setWidthElastic(0,0); _tile = _mosaic.getTile(0,0); this.setLayout(new BorderLayout()); this.add(_mosaic,BorderLayout.CENTER); }