Package net.alteiar.beans.media

Examples of net.alteiar.beans.media.ImageBean


    CampaignClient.getInstance().getChat()
        .talk(MessageFactory.currentPlayer("Hello world"));
    sleep();
    save();

    ImageBean toRemove = null;
    try {
      toRemove = new ImageBean(new WebImage(new URL("http://google.com")));
      CampaignClient.getInstance().addBean(toRemove);
    } catch (MalformedURLException e) {
      fail("no exception should occur");
    }
View Full Code Here


  public static File getDefaultImage() {
    return new File("./test/ressources/guerrier.jpg");
  }

  public static ImageBean createBeanImage() {
    return new ImageBean(
        createTransfertImage("./test/ressources/guerrier.jpg"));
  }
View Full Code Here

    map.setWidth(newWidth);

    Integer newHeight = map.getHeight() + 5;
    map.setHeight(newHeight);

    ImageBean imageBean = createBeanImage();

    CampaignClient.getInstance().addBean(imageBean);
    UniqueID newImage = imageBean.getId();

    map.setBackground(newImage);

    UniqueID newFilter = new UniqueID();
    map.setFilter(newFilter);
View Full Code Here

  @Test
  public void testBenchmarkMediumImages() {
    try {
      Timer t = new Timer();
      t.start();
      ImageBean bean = new ImageBean(new WebImage(new URL(
          "http://www.alteiar.net/images/cartes/Carte_du_monde.jpg")));
      UniqueID id = bean.getId();

      CampaignClient.getInstance().addBean(bean);
      t.end("server sended");
      bean = CampaignClient.getInstance().getBean(id, time10second);
      if (bean != null) {
        BufferedImage img = bean.getImage().restoreImage();
        t.end("server received  3.81 Mo (" + img.getWidth() + "x"
            + img.getHeight() + ") ");
      } else {
        System.out.println("server take more than 10 second");
      }

      t.start();
      CampaignClient.getInstance().addBean(
          new ImageBean(new SerializableImage(new File(
              "./test/ressources/medium.jpg"))));
      t.end("transfert sended");
      bean = CampaignClient.getInstance().getBean(id, time10second);
      if (bean != null) {
        BufferedImage img = bean.getImage().restoreImage();
        t.end("transfert received 3.81 Mo (" + img.getWidth() + "x"
            + img.getHeight() + ") ");
      } else {
        System.out.println("transfert take more than 10 second");
      }
View Full Code Here

  @Test
  public void testBenchmarkLargeImages() {
    try {
      Timer t = new Timer();
      t.start();
      ImageBean bean = new ImageBean(new WebImage(new URL(
          "http://www.alteiar.net/MyUpload/large.jpg")));
      UniqueID id = bean.getId();

      CampaignClient.getInstance().addBean(bean);
      t.end("server sended");
      bean = CampaignClient.getInstance().getBean(id, time30second);
      if (bean != null) {
        BufferedImage img = bean.getImage().restoreImage();
        t.end("server received 11.8 Mo (" + img.getWidth() + "x"
            + img.getHeight() + ") ");
      } else {
        System.out.println("server take more than 10 second");
      }

      t.start();
      CampaignClient.getInstance().addBean(
          new ImageBean(new SerializableImage(new File(
              "./test/ressources/large.jpg"))));
      t.end("transfert sended");
      bean = CampaignClient.getInstance().getBean(id, time30second);
      if (bean != null) {
        BufferedImage img = bean.getImage().restoreImage();
        t.end("transfert received 11.8Mo (" + img.getWidth() + "x"
            + img.getHeight() + ") ");
      } else {
        System.out.println("transfert take more than 10 second");
      }
View Full Code Here

  public static File getDefaultImage() {
    return new File("./test/ressources/guerrier.jpg");
  }

  public static ImageBean createBeanImage() {
    return new ImageBean(
        createTransfertImage("./test/ressources/guerrier.jpg"));
  }
View Full Code Here

        createTransfertImage("./test/ressources/guerrier.jpg"));
  }

  @Test
  public void testAttributs() {
    ImageBean img = new ImageBean(createTransfertImage());

    CampaignClient.getInstance().addBean(img);

    Integer totalHp = 32;
    Integer currentHp = 28;
    Integer ac = 15;
    Integer acFlat = 13;
    Integer acTouch = 12;
    Integer initMod = 2;
    PathfinderCharacter character = new PathfinderCharacter("test-name",
        totalHp, currentHp, ac, acTouch, acFlat, initMod, img.getId());

    BeanDocument doc = new BeanDocument(CampaignClient.getInstance()
        .getRootDirectory(), character.getName(),
        DocumentTypeConstant.CHARACTER, character);
View Full Code Here

    this.initPasses = 0;
  }

  // ////////////// METHODS /////////////////
  public BufferedImage getCharacterImage() {
    ImageBean image = CampaignClient.getInstance().getBean(this.image);
    if (image == null) {
      return null;
    }
    try {
      return image.getImage().restoreImage();
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }
View Full Code Here

    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) {
        this.lblAvatar.setIcon(new ImageIcon(ImageUtil.resizeImage(img,
            64, 64)));
      }
    } catch (IOException e) {
View Full Code Here

    return "Aucun avatar selectionn\u00E9e";
  }

  @Override
  public BasicBean buildDocument() {
    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

TOP

Related Classes of net.alteiar.beans.media.ImageBean

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.