protected void paintComponent(Graphics g) { super.paintComponent(g); paintToRect((Graphics2D)g,0,0,getWidth(),getHeight()); }
/** * 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 format for major tic annotation of the 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 setColorBarFormat(String format) { _colorBarFormat = format; if (_colorBar!=null) { _colorBar.setFormat(format); revalidate(); } }
_colorBar = new ColorBar(label); _colorBar.setFont(getFont()); _colorBar.setForeground(getForeground()); _colorBar.setBackground(getBackground()); if (_colorBarFormat!=null) _colorBar.setFormat(_colorBarFormat); if (_colorBarWidthMinimum!=0) _colorBar.setWidthMinimum(_colorBarWidthMinimum); if (_colorMapped!=null) _colorMapped.getColorMap().addListener(_colorBar); add(_colorBar,makeColorBarConstraints()); } else { _colorBar.setLabel(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); }
/** * Sets the foreground color in all components of this panel. * @param color the foreground color. */ public void setForeground(Color color) { super.setForeground(color); if (_mosaic!=null) _mosaic.setForeground(color); if (_colorBar!=null) _colorBar.setForeground(color); if (_title!=null) _title.setForeground(color); }
/** * Sets the background color in all components of this panel. * @param color the background color. */ public void setBackground(Color color) { super.setBackground(color); if (_mosaic!=null) _mosaic.setBackground(color); if (_colorBar!=null) _colorBar.setBackground(color); if (_title!=null) _title.setBackground(color); }
/** * Sets the font in all components of this panel. * Sets the title font to be 1.5 times larger than the specified font. * @param font the font. */ public void setFont(Font font) { super.setFont(font); if (_mosaic!=null) _mosaic.setFont(font); if (_colorBar!=null) _colorBar.setFont(font); if (_title!=null) _title.setFont(font.deriveFont(1.5f*font.getSize2D())); adjustColorBar(); revalidate(); }
/** * 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 setWidthMinimum(int widthMinimum) { _mosaic.getTileAxisRight(0).setWidthMinimum(widthMinimum); revalidate(); }