Examples of Gump


Examples of net.sourceforge.dsnk.model.Gump

  @Override
  public void actionPerformed(ActionEvent e) {
    Object obj = gumpList.getSelectedValue();
    if (obj != null) {
      Gump gump = (Gump) obj;
      Gump newGump = (Gump) gump.clone();
      newGump.setTransparent(true);

      paperdollVector.add(newGump);
      gumpCanvas.addGump(newGump);
      paperdollList.setListData(paperdollVector);
      gumpCanvas.repaint();
View Full Code Here

Examples of net.sourceforge.dsnk.model.Gump

    super(text, icon, desc, mnemonic, dataProvider);
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    Gump femaleGump = dataProvider.getFemaleGump();
    if (femaleGump != null) {
      Gump gump = femaleGump;
      Gump newGump = (Gump) gump.clone();

      paperdollVector.add(newGump);
      gumpCanvas.addGump(newGump);
      paperdollList.setListData(paperdollVector);
      gumpCanvas.repaint();
View Full Code Here

Examples of net.sourceforge.dsnk.model.Gump

      if ((gumpartPath != null) && (!"".equals(gumpartPath))) {
        gumpReader = new GumpArtReader(new File(gumpartPath));

        for (GumpIdx idx : data) {
          if (idx.getOffset() != GumpIdxReader.UNDEFINED) {
            Gump g = new Gump(idx, gumpReader);
            gumpVector.add(g);
          }
        }
      }
    }
View Full Code Here

Examples of net.sourceforge.dsnk.model.Gump

    super(text, icon, desc, mnemonic, dataProvider);
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    Gump maleGump = dataProvider.getMaleGump();
    if (maleGump != null) {
      Gump gump = maleGump;
      Gump newGump = (Gump) gump.clone();

      dataProvider.getPaperdollVector().add(newGump);
      dataProvider.getGumpCanvas().addGump(newGump);
      dataProvider.getPaperdollList().setListData(
          dataProvider.getPaperdollVector());
View Full Code Here

Examples of net.sourceforge.dsnk.model.Gump

   * @return Gump
   * @throws IOException
   *             if an io error occurs
   */
  public Gump read(GumpIdx idx) throws IOException {
    Gump gump = new Gump(idx, this);

    BufferedImage image = new BufferedImage(idx.getWidth(),
        idx.getHeight(), BufferedImage.TYPE_INT_ARGB);
    WritableRaster wr = image.getRaster();

    byte[] gumpData = new byte[idx.getSize()];
    System.arraycopy(data, idx.getOffset(), gumpData, 0, idx.getSize());
    String hash = generateHash(gumpData);
    gump.setHash(hash);
   
    BlockIterator blockIt = new BlockIterator(gumpData);

    int x = idx.getWidth();
    int y = idx.getHeight() - 1;
    byte[] block = null;
    // at the beginning of the gump there is only crap :) so
    // draw image from end to start
    while ((block = blockIt.getNextBlockFromEnd()) != null) {
      Color color = getColor(block);
      int length = getLength(block);
      x = x - length;
      drawBlock(wr, color, length, x, y);
      if (x == 0) {
        y = y - 1;
        x = idx.getWidth();
      }
      if (y == -1) {
        break;
      }
    }

    gump.setImage(image);

    return gump;
  }
View Full Code Here

Examples of net.sourceforge.dsnk.model.Gump

        .getString("GumpScanningThread.Message.SearchNewGumps"), "", 0,
        gumpVector.size());
    pm.setProgress(0);

    for (int i = 0; i < gumpVector.size(); i++) {
      Gump gump = gumpVector.elementAt(i);

      final int progress = i;
      if (pm.isCanceled()) {
        newGumpVector.removeAllElements();
        break;
      }

      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          pm.setProgress(progress);
        }
      });

      try {
        gump = gumpReader.read(gump.getIndex());
        String gumpIndex = String.valueOf(gump.getIndex().getIndex());
        String oldHash = hashProps.getProperty(gumpIndex, "");
        if (!gump.getHash().equals(oldHash)) {
          newGumpVector.add(gump);
          hashProps.setProperty(gumpIndex, gump.getHash());
        }
        gump.setImage(null);
      } catch (IOException e) {
        UOGumpViewer.getLogger().log(Level.SEVERE, ErrorMessages.GUMPS_CANNOT_READ_MESSAGE, e);
      }
    }
    pm.close();
View Full Code Here

Examples of net.sourceforge.dsnk.model.Gump

   * @param hex
   *            id
   * @return gump
   */
  private Gump findGump(String hex) {
    Gump backgroundGump = null;

    for (Gump gump : gumpVector) {
      String gumpHash = Integer.toHexString(gump.getIndex().getIndex());
      if (gumpHash.equals(hex)) {
        backgroundGump = gump;
View Full Code Here
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.