Class StylePaletteCellRenderer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
lu.kbra.modelizer_next.ui.canvas.StylePaletteCellRenderer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ListCellRenderer<StylePalette>

public class StylePaletteCellRenderer extends JPanel implements ListCellRenderer<StylePalette>
Swing list renderer for style palette previews.
See Also:
  • Constructor Details

    • StylePaletteCellRenderer

      public StylePaletteCellRenderer()
      Creates a style palette cell renderer instance.
  • Method Details

    • setScope

      public void setScope(StyleScope scope)
      Sets the scope on the active canvas.
      Parameters:
      scope - export scope to use
    • getListCellRendererComponent

      public Component getListCellRendererComponent(JList<? extends StylePalette> list, StylePalette value, int index, boolean isSelected, boolean cellHasFocus)
      Returns the list cell renderer component.
      Specified by:
      getListCellRendererComponent in interface ListCellRenderer<StylePalette>
      Parameters:
      list - list to read or update
      value - value to process
      index - zero-based index to read or update
      isSelected - whether is selected is enabled
      cellHasFocus - whether cell has focus is enabled
      Returns:
      the list cell renderer component