/** * Creates a default opaque table cell renderer. */ public SubstanceDefaultTableCellRenderer() { this.putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0); }
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { return super.getTableCellRendererComponent(table, tableToString.getString(table, value, row, column), isSelected, hasFocus, row, column); } }
Map<ComponentState, StateContributionInfo> activeStates = modelStateInfo .getStateContributionMap(); SubstanceColorScheme colorScheme = getColorSchemeForState( table, ui, currState); if (currState.isDisabled() || (activeStates == null) .getStateContributionMap().entrySet()) { ComponentState activeState = activeEntry.getKey(); SubstanceColorScheme scheme = getColorSchemeForState( table, ui, activeState); Color schemeFg = scheme.getForegroundColor(); SubstanceColorScheme scheme = getColorSchemeForState(table, ui, currState); super.setForeground(new ColorUIResource(scheme SubstanceColorScheme scheme = getColorSchemeForState(table, ui, currState); if (isDropLocation) { this.setFont(table.getFont()); this.setBorder(new CompoundBorder(new EmptyBorder(table .getRowMargin() / 2, 0, table.getRowMargin() / 2, 0), border)); } else { this.setBorder(border); this.setBorder(new EmptyBorder(regInsets.top, regInsets.left,
@Override protected void setValue(Object value) { if (value instanceof Duration) { String text = null; long vh = ((Duration) value).getStandardHours(); long vm = ((Duration) value).getStandardMinutes(); int days = getDayOfHour((int) vh / 60); if (days >= 1) { StringBuffer sb = new StringBuffer(); sb.append(StaticWidgetHelper.getSynaptixDateConstantsBundle().daysShort(days)).append(" "); sb.append(toHoursString((int) vm % 1440, ":")); text = sb.toString(); } else { text = toHoursString((int) vm, ":"); } super.setValue(text); } else { super.setValue(value); } }
new SubstanceDefaultTableCellRenderer()); this.installRendererIfNecessary(Icon.class, new SubstanceDefaultTableCellRenderer.IconRenderer());
Map<ComponentState, StateContributionInfo> activeStates = modelStateInfo .getStateContributionMap(); SubstanceColorScheme colorScheme = getColorSchemeForState( table, ui, currState); if (currState.isDisabled() || (activeStates == null) .getStateContributionMap().entrySet()) { ComponentState activeState = activeEntry.getKey(); SubstanceColorScheme scheme = getColorSchemeForState( table, ui, activeState); Color schemeFg = scheme.getForegroundColor(); SubstanceColorScheme scheme = getColorSchemeForState(table, ui, currState); super.setForeground(new ColorUIResource(scheme SubstanceColorScheme scheme = getColorSchemeForState(table, ui, currState); if (isDropLocation) { this.setFont(table.getFont()); this.setBorder(new CompoundBorder(new EmptyBorder(table .getRowMargin() / 2, 0, table.getRowMargin() / 2, 0), border)); } else { this.setBorder(border); this.setBorder(new EmptyBorder(regInsets.top, regInsets.left,
new SubstanceDefaultTableCellRenderer()); this.installRendererIfNecessary(Icon.class, new SubstanceDefaultTableCellRenderer.IconRenderer());
/** * Creates a default opaque table cell renderer. */ public SubstanceDefaultTableCellRenderer() { this.putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0); }
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); this.setFont(font); return c; }