Package com.dragome.model

Source Code of com.dragome.model.SelectableButtonComponent

/*******************************************************************************
* Copyright (c) 2011-2014 Fernando Petrola
*
* This file is part of Dragome SDK.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
package com.dragome.model;

import com.dragome.model.interfaces.VisualComponent;
import com.dragome.model.listeners.ClickListener;

public class SelectableButtonComponent extends SelectableComponent
{
  protected String caption;

  public SelectableButtonComponent(String name, String aCaption)
  {
    this(name);
    caption= aCaption;
  }

  public SelectableButtonComponent()
  {
  }

  public SelectableButtonComponent(String aName)
  {
    super(aName);
  }

  public String getCaption()
  {
    return caption;
  }

  public void setCaption(String caption)
  {
    this.caption= caption;
  }
 
  protected void init()
  {
    setValue(false, false);

    addListener(ClickListener.class, new ClickListener()
    {
      public void clickPerformed(VisualComponent aVisualComponent)
      {
        setValue(!getValue());
      }
    });
  }
}
TOP

Related Classes of com.dragome.model.SelectableButtonComponent

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.