Class SynthXListUI

    • Constructor Detail

      • SynthXListUI

        public SynthXListUI()
    • Method Detail

      • createUI

        public static ComponentUI createUI​(JComponent list)
        Returns a new instance of SynthXListUI. SynthXListUI delegates are allocated one per JList.
        Returns:
        A new ListUI implementation for the Synth look and feel.
      • createPropertyChangeListener

        protected PropertyChangeListener createPropertyChangeListener()
        Creates an instance of PropertyChangeHandler that's added to the JList by installUI(). Subclasses can override this method to return a custom PropertyChangeListener, e.g.
         class MyListUI extends BasicXListUI {
            protected PropertyChangeListener createPropertyChangeListener() {
                return new MyPropertyChangeListener();
            }
            public class MyPropertyChangeListener extends PropertyChangeHandler {
                public void propertyChange(PropertyChangeEvent e) {
                    if (e.getPropertyName().equals("model")) {
                        // do some extra work when the model changes
                    }
                    super.propertyChange(e);
                }
            }
         }
         

        Overridden to update style if appropriate.

        Overrides:
        createPropertyChangeListener in class BasicXListUI
        See Also:
        PropertyChangeListener, BasicXListUI.installUI(javax.swing.JComponent)
      • installSynthBorder

        protected void installSynthBorder()
        Installs a SynthBorder from the current style, if ui-installable.
        Parameters:
        context - the context
      • paintBorder

        public void paintBorder​(SynthContext context,
                                Graphics g,
                                int x,
                                int y,
                                int w,
                                int h)
        Paints border with the context's style's painter. Implemented for SynthUI interface.
        Specified by:
        paintBorder in interface SynthUI
      • getContext

        public SynthContext getContext​(JComponent c)

        Returns a context for the component's current state. Implemented for SynthUI interface.

        PENDING JW: not entirely sure if allowed ... but need to replace SynthUI anyway?.

        Specified by:
        getContext in interface SynthUI
        Throws:
        IllegalArgumentException - if the component is not controlled by this delegate