private void updateTable() { if (table == null || tableModel == null) { return; } int selectedRow = table.getSelectedRow(); tableModel.fireTableDataChanged(); if (table.getRowCount() > 0) { selectedRow = MathUtils.clamp(selectedRow, 0, table.getRowCount()); table.setRowSelectionInterval(selectedRow, selectedRow); } else { imageContainer.setDisabledIcon(null); } }
/** * <p>Remove an icon from a label. Both icon states (enabled/disabled) will be removed.</p> * * @param label The label */ public static void removeIcon(JLabel label) { label.setIcon(null); label.setDisabledIcon(null); }
@Override public Object visitar(NoTitulo noTitulo) throws ExcecaoVisitaASA { component.setText("titulo"); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "unknown.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(NoEscolha noEscolha) throws ExcecaoVisitaASA { StringBuilder sb = new StringBuilder(); sb.append("<html>"); sb.append(noEscolha.getClass().getSimpleName().replace("No", "").toLowerCase()); component.setText(sb.toString()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "desvio.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(NoPara noPara) throws ExcecaoVisitaASA { StringBuilder sb = new StringBuilder(); sb.append("<html>"); sb.append(noPara.getClass().getSimpleName().replace("No", "").toLowerCase()); component.setText(sb.toString()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "loop.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(NoSe noSe) throws ExcecaoVisitaASA { StringBuilder sb = new StringBuilder(); sb.append("<html>"); sb.append(noSe.getClass().getSimpleName().replace("No", "").toLowerCase()); component.setText(sb.toString()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "desvio.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public void setTabDisabledIcon(javax.swing.Icon disabledIcon) { if (isClosed())return; titleLabel.setDisabledIcon(disabledIcon); }
@Override public Object visitar(NoEnquanto noEnquanto) throws ExcecaoVisitaASA { StringBuilder sb = new StringBuilder(); sb.append("<html>"); sb.append(noEnquanto.getClass().getSimpleName().replace("No", "").toLowerCase()); component.setText(sb.toString()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "loop.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(NoContinue noContinue) throws ExcecaoVisitaASA { component.setText("continue"); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "unknown.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(NoVaPara noVaPara) throws ExcecaoVisitaASA { component.setText("va-para"); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "unknown.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; } }
public void setDisabledIcon(Icon _icon) { if((delegate_==this)||(delegate_==null)) super.setDisabledIcon(_icon); else delegate_.setDisabledIcon(_icon); }
@Override public Object visitar(NoCaso noCaso) throws ExcecaoVisitaASA { StringBuilder sb = new StringBuilder(); sb.append("<html>"); sb.append(noCaso.getClass().getSimpleName().replace("No", "").toLowerCase()); component.setText(sb.toString()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "desvio.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(NoFacaEnquanto noFacaEnquanto) throws ExcecaoVisitaASA { StringBuilder sb = new StringBuilder(); sb.append("<html>"); // sb.append(noFacaEnquanto.getClass().getSimpleName().replace("No", "").toLowerCase()); sb.append("faca-enquanto"); component.setText(sb.toString()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "loop.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override protected void done(Image value) { if (value == null) { failed(new IOException("Could not load image.")); return; } label.setText(null); ImageIcon icon = new ImageIcon(value); label.setIcon(icon); label.setDisabledIcon(icon); SwingUtilities.getWindowAncestor(ILBMViewer.this).pack(); }
@Override protected void done(Image value) { if (value == null) { failed(new IOException("Could not load image.")); return; } label.setText(null); ImageIcon icon = new ImageIcon(value); label.setIcon(icon); label.setDisabledIcon(icon); SwingUtilities.getWindowAncestor(PBMViewer.this).pack(); }
@Override public Object visitar(ProgramaTreeNode no) { component.setText((String) no.getUserObject()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "light_pix.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(NoInclusaoBiblioteca noInclusaoBiblioteca) throws ExcecaoVisitaASA { StringBuilder sb = new StringBuilder(); sb.append("<html>"); sb.append(noInclusaoBiblioteca.getNome()); if (noInclusaoBiblioteca.getAlias() != null) { sb.append(" ("); sb.append(noInclusaoBiblioteca.getAlias()); sb.append(")"); } component.setText(sb.toString()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "lib2.png"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(GenericTreeNode no) { component.setText((String) no.getUserObject()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "unknown.png"); if(no.getUserObject().equals("verdadeiro")){ icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "true.png"); }else if(no.getUserObject().equals("falso")){ icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "false.png"); } component.setIcon(icone); component.setDisabledIcon(icone); return null; }
@Override public Object visitar(LibraryTreeNode no) { StringBuilder sb = new StringBuilder("<html>"); if (no.getErro() != null) { sb.append(no.getErro().getMessage()); } else { sb.append(no.getNoInclusaoBiblioteca().getNome()); if (no.getNoInclusaoBiblioteca().getAlias() != null) { sb.append(" ("); sb.append(no.getNoInclusaoBiblioteca().getAlias()); sb.append(")"); } } component.setText(sb.toString()); Icon icone = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "biblioteca.gif"); component.setIcon(icone); component.setDisabledIcon(icone); return null; }
/** * <p>Bind an icon to a label. Both icon states (enabled/disabled) will be added.</p> * <p>The icon will use the font and color from the label and will reflect any subsequent updates.</p> * * @param icon The icon reference * @param label The label (iconography will change will changes to the label color and font) * @param leading True if the icon comes before the text in the reading direction (LTR and RTL is handled automatically) * @param size The icon size (font metrics) */ public static void bindIcon(AwesomeIcon icon, JLabel label, boolean leading, int size) { Icon enabledIcon = new AwesomeSwingIcon(label, icon.getChar(), size, true); Icon disabledIcon = new AwesomeSwingIcon(label, icon.getChar(), size, false); label.setIcon(enabledIcon); label.setDisabledIcon(disabledIcon); align(label, leading); }