public int getIconWidth(){ Dimension min = getMinimumIconSize(); return Math.max( min.width, model.getMaxIconSize().width ); }
public int getIconHeight(){ Dimension min = getMinimumIconSize(); return Math.max( min.height, model.getMaxIconSize().height ); }
public int getIconWidth(){ Dimension min = getMinimumIconSize(); return Math.max( min.width, model.getMaxIconSize().width ); }
public int getIconHeight(){ Dimension min = getMinimumIconSize(); return Math.max( min.height, model.getMaxIconSize().height ); }
public void paintIcon( Component c, Graphics g, int x, int y ){ Icon icon = model.getPaintIcon(); if( icon != null ){ Dimension min = getMinimumIconSize(); Dimension max = model.getMaxIconSize(); int dx = (Math.max( max.width, min.width ) - icon.getIconWidth()) / 2; int dy = (Math.max( max.height, min.height ) - icon.getIconHeight()) / 2; icon.paintIcon( c, g, x+dx, y+dy ); } }
public void paintIcon( Component c, Graphics g, int x, int y ){ Icon icon = model.getPaintIcon(); if( icon != null ){ Dimension min = getMinimumIconSize(); Dimension max = model.getMaxIconSize(); int dx = (Math.max( max.width, min.width ) - icon.getIconWidth()) / 2; int dy = (Math.max( max.height, min.height ) - icon.getIconHeight()) / 2; icon.paintIcon( c, g, x+dx, y+dy ); } }