Package net.alteiar.beans.map.filter

Examples of net.alteiar.beans.map.filter.CharacterMapFilter


    Image backgroundImage = background.getImage().restoreImage();
    map.setWidth(backgroundImage.getWidth(null));
    map.setHeight(backgroundImage.getHeight(null));

    // ManualMapFilter filter = new ManualMapFilter(map.getId());
    CharacterMapFilter filter = new CharacterMapFilter(map);
    CampaignClient.getInstance().addBean(filter);

    map.setFilter(filter.getId());
    map.setBackground(background.getId());

    return map;
  }
View Full Code Here


    UniqueID mapID = kryo.readObject(in, UniqueID.class);
    HashSet<UniqueID> elements = kryo.readObject(in, HashSet.class);
    UniqueID filteredImageId = kryo.readObjectOrNull(in, UniqueID.class);
    Integer maxVision = kryo.readObject(in, Integer.class);

    return new CharacterMapFilter(id, mapID, elements, filteredImageId,
        maxVision);
  }
View Full Code Here

        mapInfo, true, "Ajouter vision"));

    JButton btnRemoveElementToView = new JButton(
        new AddRemoveElementToView(mapInfo, false, "Enlever vision"));

    final CharacterMapFilter filter = CampaignClient.getInstance().getBean(
        mapInfo.getMap().getFilter());

    JLabel lblVision = new JLabel("Vision max:");
    final JSpinner spinnerVision = new JSpinner(new SpinnerNumberModel(
        filter.getMaxVision().intValue(), 1, Integer.MAX_VALUE, 1));
    spinnerVision.addChangeListener(new ChangeListener() {
      @Override
      public void stateChanged(ChangeEvent arg0) {
        Integer val = (Integer) spinnerVision.getValue();
        filter.setMaxVision(val);
      }
    });

    JButton btnLoadFilter = new JButton(new ChooseFilterAction(mapInfo));
View Full Code Here

          FilterAdapter adapter = panel.getSelectedValue();

          if (MANUAL_MAP_FILTER.equals(adapter.getName())) {
            newFilter = new ManualMapFilter(map.getId());
          } else if (AUTOMATIC_MAP_FILTER.equals(adapter.getName())) {
            newFilter = new CharacterMapFilter(map);
          } else if (NO_MAP_FILTER.equals(adapter.getName())) {
            newFilter = new NoMapFilter();
          }

          CampaignClient.getInstance().addBean(newFilter);
View Full Code Here

    putValue(NAME, "Changer l'image filtre");
  }

  @Override
  public void actionPerformed(ActionEvent action) {
    final CharacterMapFilter filter = CampaignClient.getInstance().getBean(
        getMapInfo().getMap().getFilter());

    File imgFile = StaticDialog.getSelectedImageFile((Component) action
        .getSource());

    if (imgFile != null) {
      try {
        ImageBean bean = new ImageBean(new SerializableImage(imgFile));
        CampaignClient.getInstance().addBean(bean);
        // BufferedImage img = ImageIO.read(imgFile);
        filter.setFilteredImageId(bean.getId());
      } catch (IOException e) {
        Logger.getLogger(getClass()).error(
            "Impossible de lire l'image filtre", e);
      } catch (IllegalArgumentException e) {
        Logger.getLogger(getClass()).warn(
View Full Code Here

    putValue(NAME, name);
    // putValue(SMALL_ICON, Helpers.getIcon(icon));
  }

  private Collection<UniqueID> getVisionElements() {
    CharacterMapFilter filter = CampaignClient.getInstance().getBean(
        getMapInfo().getMap().getFilter());
    return filter.getViewer();
  }
View Full Code Here

      }
    }
  }

  private void doAction(UniqueID element) {
    CharacterMapFilter filter = CampaignClient.getInstance().getBean(
        getMapInfo().getMap().getFilter());
    if (addToView) {
      filter.addElementIdView(element);
    } else {
      filter.removeElementView(element);
    }
  }
View Full Code Here

TOP

Related Classes of net.alteiar.beans.map.filter.CharacterMapFilter

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.