/** * 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); }
mosaic.setBackground(Color.WHITE); mosaic.setFont(new Font("SansSerif",Font.PLAIN,12)); mosaic.setWidthMinimum(1,200); mosaic.setWidthElastic(1,200); mosaic.setHeightElastic(0,0);