Package snap.viewx

Class ColorButton

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class ColorButton extends View
A View to show/set a simple color selection.
  • Field Details

  • Constructor Details

    • ColorButton

      public ColorButton()
      Creates a new ColorButton.
  • Method Details

    • getColor

      public Color getColor()
      Returns the color.
    • setColor

      public void setColor(Color aColor)
      Sets the color.
    • getTitle

      public String getTitle()
      Returns the title.
    • setTitle

      public void setTitle(String aTitle)
      Sets the title.
    • getImage

      public Image getImage()
      Returns the image.
    • setImage

      public void setImage(Image anImage)
      Sets the image.
    • paintFront

      protected void paintFront(Painter aPntr)
      Paints the button.
      Overrides:
      paintFront in class View
    • processEvent

      protected void processEvent(ViewEvent anEvent)
      Handle events.
      Overrides:
      processEvent in class View
    • fire

      public void fire(ViewEvent anEvent)
      Handles button click.
    • getPopup

      public PopupWindow getPopup()
      Returns the popup.
    • handlePopupMenuEvent

      protected void handlePopupMenuEvent(ViewEvent anEvent)
      Handles popup menu item events.
    • getValuePropName

      public String getValuePropName()
      Returns a mapped property name.
      Overrides:
      getValuePropName in class View
    • getPropValue

      public Object getPropValue(String aPropName)
      Override because TeaVM hates reflection.
      Overrides:
      getPropValue in class View
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Override because TeaVM hates reflection.
      Overrides:
      setPropValue in class View
    • toXML

      public XMLElement toXML(XMLArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface XMLArchiver.Archivable
      Overrides:
      toXML in class View
    • fromXML

      public Object fromXML(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface XMLArchiver.Archivable
      Overrides:
      fromXML in class View