@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); } }
/** * Constructs a default renderer object for an item in a list. */ public SubstanceDefaultListCellRenderer() { super(); this.putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0); }
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { this.setComponentOrientation(list.getComponentOrientation()); Map<ComponentState, StateContributionInfo> activeStates = modelStateInfo .getStateContributionMap(); SubstanceColorScheme colorScheme = getColorSchemeForState(list, ui, currState); if (currState.isDisabled() || (activeStates == null) .getStateContributionMap().entrySet()) { ComponentState activeState = activeEntry.getKey(); SubstanceColorScheme scheme = getColorSchemeForState( list, ui, activeState); Color schemeFg = scheme.getForegroundColor(); SubstanceColorScheme scheme = getColorSchemeForState(list, ui, currState); if (isDropLocation) { this.setForeground(list.getSelectionForeground()); } else { this.setForeground(list.getForeground()); this.setIcon((Icon) value); this.setText(""); } else { this.setIcon(null); this.setText((value == null) ? "" : value.toString());
int index, boolean isSelected, boolean cellHasFocus) { JComponent result = (JComponent) super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus); if (currState.isDisabled() || (activeStates == null) || (activeStates.size() == 1)) { super.setForeground(new ColorUIResource(colorScheme .getForegroundColor())); } else {
@Override public Dimension getPreferredSize() { Dimension size; if ((this.getText() == null) || (this.getText().equals(""))) { this.setText(" "); size = super.getPreferredSize(); this.setText(""); } else { size = super.getPreferredSize(); } return size; }
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { this.setComponentOrientation(list.getComponentOrientation()); Map<ComponentState, StateContributionInfo> activeStates = modelStateInfo .getStateContributionMap(); SubstanceColorScheme colorScheme = getColorSchemeForState(list, ui, currState); if (currState.isDisabled() || (activeStates == null) .getStateContributionMap().entrySet()) { ComponentState activeState = activeEntry.getKey(); SubstanceColorScheme scheme = getColorSchemeForState( list, ui, activeState); Color schemeFg = scheme.getForegroundColor(); SubstanceColorScheme scheme = getColorSchemeForState(list, ui, currState); if (isDropLocation) { this.setForeground(list.getSelectionForeground()); } else { this.setForeground(list.getForeground()); this.setIcon((Icon) value); this.setText(""); } else { this.setIcon(null); this.setText((value == null) ? "" : value.toString());
int index, boolean isSelected, boolean cellHasFocus) { JComponent result = (JComponent) super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus); if (currState.isDisabled() || (activeStates == null) || (activeStates.size() == 1)) { super.setForeground(new ColorUIResource(colorScheme .getForegroundColor())); } else {
@Override public Dimension getPreferredSize() { Dimension size; if ((this.getText() == null) || (this.getText().equals(""))) { this.setText(" "); size = super.getPreferredSize(); this.setText(""); } else { size = super.getPreferredSize(); } return size; }
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); } }
/** * Constructs a default renderer object for an item in a list. */ public SubstanceDefaultListCellRenderer() { super(); this.putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0); }
@Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel label = (JLabel) super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus); label.setIcon(icon); return label; }
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Component res = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); setValue(value); return res; }
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Component res = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); this.setText("Gaby"); setValue(value); this.setIcon(this); return res; }