Package org.newdawn.slick.particles

Examples of org.newdawn.slick.particles.ConfigurableEmitter


      public void actionPerformed(ActionEvent e) {
        game.setPaused(!game.isPaused());
      }
    });
   
    ConfigurableEmitter test = new ConfigurableEmitter("Default");
    emitters.add(test);
    game.addEmitter(test);
   
    additive.setSelected(true);
   
View Full Code Here


    if (resp == JFileChooser.APPROVE_OPTION) {
      File file = chooser.getSelectedFile();
      File path = file.getParentFile();
     
      try {
        final ConfigurableEmitter emitter = ParticleIO.loadEmitter(file);
       
       
        if (emitter.getImageName() != null) {
          File possible = new File(path, emitter.getImageName());
         
          if (possible.exists()) {
            emitter.setImageName(possible.getAbsolutePath());
          } else {
            chooser.setDialogTitle("Locate the image: "+emitter.getImageName());
            resp = chooser.showOpenDialog(this);
            FileFilter filter = new FileFilter() {
              public boolean accept(File f) {
                if (f.isDirectory()) {
                  return true;
                }
               
                return (f.getName().equals(emitter.getImageName()));
              }
 
              public String getDescription() {
                return emitter.getImageName();
              }
            };
            chooser.addChoosableFileFilter(filter);
            if (resp == JFileChooser.APPROVE_OPTION) {
              File image = chooser.getSelectedFile();
              emitter.setImageName(image.getAbsolutePath());
              path = image.getParentFile();
            }
            chooser.resetChoosableFileFilters();
            chooser.addChoosableFileFilter(xmlFileFilter);
          }
View Full Code Here

   
    try {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      ParticleIO.saveEmitter(bout, selected);
      ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
      ConfigurableEmitter emitter = ParticleIO.loadEmitter(bin);
      emitter.name = emitter.name + "_clone";
     
      addEmitter(emitter);
      emitters.setSelected(emitter);
    } catch (IOException e) {
View Full Code Here

        ParticleSystem system = ParticleIO.loadConfiguredSystem(file);
        game.setSystem(system);
        emitters.clear();
       
        for (int i=0;i<system.getEmitterCount();i++) {
          final ConfigurableEmitter emitter = (ConfigurableEmitter) system.getEmitter(i);
         
          if (emitter.getImageName() != null) {
            File possible = new File(path, emitter.getImageName());
            if (possible.exists()) {
              emitter.setImageName(possible.getAbsolutePath());
            } else {
              chooser.setDialogTitle("Locate the image: "+emitter.getImageName());
              FileFilter filter = new FileFilter() {
                public boolean accept(File f) {
                  if (f.isDirectory()) {
                    return true;
                  }
                 
                  return (f.getName().equals(emitter.getImageName()));
                }
 
                public String getDescription() {
                  return emitter.getImageName();
                }
              };
             
              chooser.addChoosableFileFilter(filter);
              resp = chooser.showOpenDialog(this);
              if (resp == JFileChooser.APPROVE_OPTION) {
                File image = chooser.getSelectedFile();
                emitter.setImageName(image.getAbsolutePath());
                path = image.getParentFile();
              }
              chooser.setDialogTitle("Open");
              chooser.resetChoosableFileFilters();
              chooser.addChoosableFileFilter(xmlFileFilter);
View Full Code Here

      public void actionPerformed(ActionEvent e) {
        game.setPaused(!game.isPaused());
      }
    });
   
    ConfigurableEmitter test = new ConfigurableEmitter("Default");
    emitters.add(test);
    game.addEmitter(test);
   
    additive.setSelected(true);
   
View Full Code Here

    if (resp == JFileChooser.APPROVE_OPTION) {
      File file = chooser.getSelectedFile();
      File path = file.getParentFile();
     
      try {
        final ConfigurableEmitter emitter = ParticleIO.loadEmitter(file);
       
       
        if (emitter.getImageName() != null) {
          File possible = new File(path, emitter.getImageName());
         
          if (possible.exists()) {
            emitter.setImageName(possible.getAbsolutePath());
          } else {
            chooser.setDialogTitle("Locate the image: "+emitter.getImageName());
            resp = chooser.showOpenDialog(this);
            FileFilter filter = new FileFilter() {
              public boolean accept(File f) {
                if (f.isDirectory()) {
                  return true;
                }
               
                return (f.getName().equals(emitter.getImageName()));
              }
 
              public String getDescription() {
                return emitter.getImageName();
              }
            };
            chooser.addChoosableFileFilter(filter);
            if (resp == JFileChooser.APPROVE_OPTION) {
              File image = chooser.getSelectedFile();
              emitter.setImageName(image.getAbsolutePath());
              path = image.getParentFile();
            }
            chooser.resetChoosableFileFilters();
            chooser.addChoosableFileFilter(xmlFileFilter);
          }
View Full Code Here

   
    try {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      ParticleIO.saveEmitter(bout, selected);
      ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
      ConfigurableEmitter emitter = ParticleIO.loadEmitter(bin);
      emitter.name = emitter.name + "_clone";
     
      addEmitter(emitter);
      emitters.setSelected(emitter);
    } catch (IOException e) {
View Full Code Here

        ParticleSystem system = ParticleIO.loadConfiguredSystem(file);
        game.setSystem(system);
        emitters.clear();
       
        for (int i=0;i<system.getEmitterCount();i++) {
          final ConfigurableEmitter emitter = (ConfigurableEmitter) system.getEmitter(i);
         
          if (emitter.getImageName() != null) {
            File possible = new File(path, emitter.getImageName());
            if (possible.exists()) {
              emitter.setImageName(possible.getAbsolutePath());
            } else {
              chooser.setDialogTitle("Locate the image: "+emitter.getImageName());
              FileFilter filter = new FileFilter() {
                public boolean accept(File f) {
                  if (f.isDirectory()) {
                    return true;
                  }
                 
                  return (f.getName().equals(emitter.getImageName()));
                }
 
                public String getDescription() {
                  return emitter.getImageName();
                }
              };
             
              chooser.addChoosableFileFilter(filter);
              resp = chooser.showOpenDialog(this);
              if (resp == JFileChooser.APPROVE_OPTION) {
                File image = chooser.getSelectedFile();
                emitter.setImageName(image.getAbsolutePath());
                path = image.getParentFile();
              }
              chooser.setDialogTitle("Open");
              chooser.resetChoosableFileFilters();
              chooser.addChoosableFileFilter(xmlFileFilter);
View Full Code Here

    add.setBounds(150,125,60,20);
    remove.setBounds(209,125,80,20);
     
    add.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        editor.addEmitter(new ConfigurableEmitter("NewEmitter_"+System.currentTimeMillis()));
      }
    });
    remove.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        ConfigurableEmitter emitter = (ConfigurableEmitter) list.getSelectedValue();
        if (emitter != null) {
          editor.removeEmitter(emitter);
        }
      }
    });
   
    list.setCellRenderer(new Renderer());
    list.addMouseListener(new MouseAdapter() {
      public void mousePressed(MouseEvent e) {
        int index = list.locationToIndex(e.getPoint());

        if (index != -1) {
          if (list.getCellBounds(index, index).contains(e.getPoint())) {
            if (lastSelect == list.getSelectedIndex()) {
              ConfigurableEmitter emitter = (ConfigurableEmitter) list.getModel().getElementAt(index);
              JCheckBox box = (JCheckBox) checks.get(emitter);
              emitter.setEnabled(!emitter.isEnabled());
              box.setSelected(emitter.isEnabled());
             
              repaint();
            } else {
              lastSelect = list.getSelectedIndex();
            }
View Full Code Here

    GraphEditorWindow bottom = new GraphEditorWindow();

    ArrayList curve = new ArrayList();
    curve.add(new Vector2f(0.0f, 0.0f));
    curve.add(new Vector2f(1.0f, 255.0f));
    LinearInterpolator test = new ConfigurableEmitter("bla").new LinearInterpolator(
        curve, 0, 255);
    bottom.registerValue(test, "Test");

    curve = new ArrayList();
    curve.add(new Vector2f(0.0f, 255.0f));
    curve.add(new Vector2f(1.0f, 0.0f));
    test = new ConfigurableEmitter("bla").new LinearInterpolator(curve, 0,
        255);
    bottom.registerValue(test, "Test 2");

    main.add(bottom);
View Full Code Here

TOP

Related Classes of org.newdawn.slick.particles.ConfigurableEmitter

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.