public ImageIcon getButtonIcon() { ImageIcon icon = (ImageIcon) this.getIcon(); if (isFixedIcon) return icon; // draw the icon for the current table selection if (hasTable) { switch (mode) { case SelectionTable.MODE_TEXT: // Strings are converted to icons. We don't use setText so that the button size can be // controlled // regardless of the layout manager. icon = GeoGebraIcon.createStringIcon( (String) data[getSelectedIndex()], app.getPlainFont(), false, false, true, iconSize, Color.BLACK, null); break; case SelectionTable.MODE_ICON: case SelectionTable.MODE_LATEX: icon = (ImageIcon) myTable.getSelectedValue(); break; default: icon = myTable.getDataIcon(data[getSelectedIndex()]); } } return icon; }