Package shadowrun.bean.unit

Examples of shadowrun.bean.unit.ShadowrunCharacter


  }

  @Override
  public void setDocument(BeanDocument document) {

    ShadowrunCharacter character = document.getBean();

    textFieldName.setText(character.getName());

    ImageBean bean = CampaignClient.getInstance().getBean(
        character.getImage());

    BufferedImage img;
    try {
      img = bean.getImage().restoreImage();
      if (img != null) {
View Full Code Here


    ImageBean image = new ImageBean(transfertImage);
    CampaignClient.getInstance().addBean(image);

    String name = textFieldName.getText();

    ShadowrunCharacter character = new ShadowrunCharacter(name,
        image.getId());

    panelAttribut.apply(character);

    return character;
View Full Code Here

    this.character.addPropertyChangeListener(this);
    characterChange();
  }

  protected void characterChange() {
    ShadowrunCharacter character = CampaignClient.getInstance().getBean(
        this.character.getBeanId());
    this.textFieldName.setText(character.getName());
    // this.spinnerModInit.setValue(character.getInitModifier());

    // this.spinnerHpTotal.setValue(character.getTotalHp());
    // this.spinnerHpCurrent.setValue(character.getCurrentHp());

    // this.spinnerAc.setValue(character.getAc());
    // this.spinnerAcFlatFooted.setValue(character.getAcFlatFooted());
    // this.spinnerAcTouch.setValue(character.getAcTouch());

    BufferedImage img = ImageUtil.resizeImage(
        character.getCharacterImage(), 120, 120);
    this.btnIcon.setIcon(new ImageIcon(img));
  }
View Full Code Here

    return CampaignClient.getInstance().getBean(
        characterDocument.getBeanId());
  }

  public void updateCharacterView() {
    ShadowrunCharacter character = getCharacter();
    if (character != null) {
      int totalPhysical = character.getPhysicalPoint();
      int totalStun = character.getStunPoint();

      this.healthBarPhysical.setTotalHp(totalPhysical);
      this.healthBarStun.setTotalHp(totalStun);

      this.healthBarPhysical.setCurrentHp(totalPhysical
          - character.getPhysicalDamage());
      this.healthBarStun.setCurrentHp(totalStun
          - character.getStunDamage());
      this.revalidate();
      this.repaint();
    }
  }
View Full Code Here

  public static int HEIGHT_HEALTH_BAR = 7;

  protected void drawCharacter(Graphics2D g, BeanDocument doc) {
    Graphics2D g2 = (Graphics2D) g.create();

    ShadowrunCharacter character = CampaignClient.getInstance().getBean(
        doc.getBeanId());

    BufferedImage background = character.getCharacterImage();

    if (background != null) {
      g2.drawImage(background, 0, 0, WIDTH, HEIGHT, null);
    } else {
      g2.fillRect(0, 0, 50, 50);
View Full Code Here

  public CharacterImageIconFactory() {
  }

  @Override
  public BufferedImage getImage(BeanDocument doc) {
    ShadowrunCharacter bean = doc.getBean();
    BufferedImage img = bean.getCharacterImage();
    if (img != null) {
      img = ImageUtil.resizeImage(img, 50, 50);
    }
    return img;
  }
View Full Code Here

  }

  @Override
  protected void drawElement(Graphics2D g) {
    Graphics2D g2 = (Graphics2D) g.create();
    ShadowrunCharacter character = getCharacter();
    BufferedImage background = character.getCharacterImage();

    Point position = getPosition();
    int x = (int) (position.getX());
    int y = (int) (position.getY());
    int width = getWidthPixels().intValue();
View Full Code Here

  }

  @Override
  public List<IAction> getActions() {
    ArrayList<IAction> actions = new ArrayList<IAction>();
    ShadowrunCharacter character = getCharacter();
    actions.add(new DoDamage(character));
    actions.add(new DoHeal(character));

    actions.add(new AddToCombatTracker(character));
View Full Code Here

  @Override
  protected void mapElementChanged() {
    ShadowrunCharacterElement characterElement = getMapElement();

    ShadowrunCharacter character = characterElement.getCharacter();
    BufferedImage img = character.getCharacterImage();
    img = ImageUtil.resizeImage(img, 50, 50);
    lblImg.setIcon(new ImageIcon(img));

    lblName.setText(character.getName());

    panelWidth.setElementSizeAt(0, characterElement.getWidth());
    panelHeight.setElementSizeAt(0, characterElement.getHeight());

  }
View Full Code Here

TOP

Related Classes of shadowrun.bean.unit.ShadowrunCharacter

Copyright © 2018 www.massapicom. 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.