Package net.cloudcodex.client.widgets

Source Code of net.cloudcodex.client.widgets.CharacterAvatar

package net.cloudcodex.client.widgets;

import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;


public class CharacterAvatar extends Avatar {
 
  private String alias ;
  private boolean isActiveCharacter;
 
  public CharacterAvatar() {
    super();
  }

  public CharacterAvatar(String imageURL, String name) {
    this();
    initComponent(imageURL, name, true);
  }

  public CharacterAvatar(String imageURL, String name, boolean withName) {
    this();
    initComponent(imageURL, name, withName);
  }

  public void initComponent(String imageURL, String name, boolean withName) {

    setImageURL(imageURL);
    setName(name);
    defaultImageURL();
    setWithName(withName);
    init();
    setIconeStyleName("caractereIconeAvatar");
    setNameStyleName("characterNameAvatar");
  }
 
 
 
  @Override
  protected void defaultImageURL() {
    setDefaultImageURL("images/avatar/character/default.png");

  }
 
  public void initAliasPanel(String alias) {
    this.alias = alias ;
    DockPanel panel = new DockPanel();
    Label aliasLabel = new Label();
    aliasLabel.setText("Alias : ");
    panel.add(aliasLabel,DockPanel.NORTH);
    TextBox aliasTextBox = new TextBox();
    aliasTextBox.setEnabled(false);
    aliasTextBox.setText(alias);
    panel.add(aliasTextBox,DockPanel.CENTER);
    this.add(panel);

  }

  public void isActiveCharacter(boolean isActiveCharacter) {
    this.isActiveCharacter = isActiveCharacter ;
  }

  public void initComponent(String imageURL, String name) {
    this.initComponent(imageURL, name, true);
  }

}
TOP

Related Classes of net.cloudcodex.client.widgets.CharacterAvatar

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.