Class DefaultColorPaletteModel

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.swing.event.ChangeEvent changeEvent  
      protected java.util.List<java.awt.Color> colors  
      protected int columnCount  
      protected javax.swing.event.EventListenerList listenerList  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChangeListener​(javax.swing.event.ChangeListener l)
      Adds listener as a listener to changes in the model.
      void bulkLoad​(java.util.List<java.awt.Color> colors, int columns)
      Replaces all colors in the model, and my alter the structure (column/row count).
      protected void fireStateChanged()  
      java.awt.Color getColor​(int row, int column)
      Returns the color at this location
      int getColumnCount()
      How many columns of colors in the palette
      int getRowCount()
      How many rows of colors in the palette?
      void initDefaultColors()  
      void removeChangeListener​(javax.swing.event.ChangeListener l)
      Removes listener as a listener to changes in the model.
      void setColor​(int row, int column, java.awt.Color color)
      Change the color at a location
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • colors

        protected java.util.List<java.awt.Color> colors
      • columnCount

        protected int columnCount
      • changeEvent

        protected transient javax.swing.event.ChangeEvent changeEvent
      • listenerList

        protected transient javax.swing.event.EventListenerList listenerList
    • Constructor Detail

      • DefaultColorPaletteModel

        public DefaultColorPaletteModel()
    • Method Detail

      • initDefaultColors

        public void initDefaultColors()
      • getColor

        public java.awt.Color getColor​(int row,
                                       int column)
        Description copied from interface: ColorPaletteModel
        Returns the color at this location
        Specified by:
        getColor in interface ColorPaletteModel
      • setColor

        public void setColor​(int row,
                             int column,
                             java.awt.Color color)
        Description copied from interface: ColorPaletteModel
        Change the color at a location
        Specified by:
        setColor in interface ColorPaletteModel
      • bulkLoad

        public void bulkLoad​(java.util.List<java.awt.Color> colors,
                             int columns)
        Description copied from interface: ColorPaletteModel
        Replaces all colors in the model, and my alter the structure (column/row count). The size of the color list must be divisible by the new column count.
        Specified by:
        bulkLoad in interface ColorPaletteModel
      • addChangeListener

        public void addChangeListener​(javax.swing.event.ChangeListener l)
        Description copied from interface: ColorPaletteModel
        Adds listener as a listener to changes in the model.
        Specified by:
        addChangeListener in interface ColorPaletteModel
        Parameters:
        l - the ChangeListener to be added
      • removeChangeListener

        public void removeChangeListener​(javax.swing.event.ChangeListener l)
        Description copied from interface: ColorPaletteModel
        Removes listener as a listener to changes in the model.
        Specified by:
        removeChangeListener in interface ColorPaletteModel
        Parameters:
        l - the ChangeListener to be removed
      • fireStateChanged

        protected void fireStateChanged()