Examples of ImagePanel


Examples of org.jwildfire.swing.ImagePanel

    frame.setTitle("Welcome to " + Tools.APP_TITLE + " " + Tools.APP_VERSION);
    // Load logo
    try {
      SimpleImage img = getImage(Tools.SPECIAL_VERSION ? "logo_special.png" : "logo.png");
      northPanel.setLayout(null);
      ImagePanel imgPanel = new ImagePanel(img, 0, 0, img.getImageWidth());
      imgPanel.setPreferredSize(new Dimension(img.getImageWidth(), img.getImageHeight()));
      imgPanel.setLocation(Tools.SPECIAL_VERSION ? 7 : 107, 4);
      getNorthPanel().add(imgPanel);
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }

    String imageFilename = "";
    try {
      if (Tools.SPECIAL_VERSION) {
        final int IMG_COUNT = 3;
        int imageIdx = (int) (Math.random() * IMG_COUNT) + 1;
        String id = String.valueOf(imageIdx);
        while (id.length() < 3) {
          id = "0" + id;
        }
        imageFilename = "special" + id + ".jpg";
      }
      else {
        final int IMG_COUNT = 101;
        int imageIdx = (int) (Math.random() * IMG_COUNT) + 1;
        String id = String.valueOf(imageIdx);
        while (id.length() < 3) {
          id = "0" + id;
        }
        imageFilename = "image" + id + ".jpg";
      }
      SimpleImage img = getImage(imageFilename);
      imgDisplayPanel.setLayout(null);
      ImagePanel imgPanel = new ImagePanel(img, 0, 0, img.getImageWidth());
      getImgDisplayPanel().add(imgPanel);

      //      System.out.println(imgDisplayPanel.getSize().height + " " + imgDisplayPanel.getSize().width);
      imgPanel.setLayout(null);
    }
    catch (Throwable ex) {
      System.out.println(imageFilename);
      ex.printStackTrace();
    }
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

    if (data.palettePanel == null) {
      int width = data.paletteImgPanel.getWidth();
      int height = data.paletteImgPanel.getHeight();
      SimpleImage img = new SimpleImage(width, height);
      img.fillBackground(0, 0, 0);
      data.palettePanel = new ImagePanel(img, 0, 0, data.paletteImgPanel.getWidth());
      data.paletteImgPanel.add(data.palettePanel, BorderLayout.CENTER);
      data.paletteImgPanel.getParent().validate();
    }
    return data.palettePanel;
  }
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

    if (data.colorChooserPalettePanel == null) {
      int width = data.colorChooserPaletteImgPanel.getWidth();
      int height = data.colorChooserPaletteImgPanel.getHeight();
      SimpleImage img = new SimpleImage(width, height);
      img.fillBackground(0, 0, 0);
      data.colorChooserPalettePanel = new ImagePanel(img, 0, 0, data.colorChooserPaletteImgPanel.getWidth());
      data.colorChooserPaletteImgPanel.add(data.colorChooserPalettePanel, BorderLayout.CENTER);
      data.colorChooserPaletteImgPanel.getParent().validate();
    }
    return data.colorChooserPalettePanel;
  }
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

      if (!pMouseDown && !cfg.isNoControls()) {
        for (int i = 0; i < randomBatch.size(); i++) {
          Flame bFlame = randomBatch.get(i).getFlame();
          if (bFlame == flame) {
            randomBatch.get(i).preview = null;
            ImagePanel pnl = randomBatch.get(i).getImgPanel();
            if (pnl != null) {
              pnl.replaceImage(randomBatch.get(i).getPreview(prefs.getTinaRenderPreviewQuality() / 2));
              pnl.repaint();
            }
            break;
          }
        }
      }
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

    refreshPaletteImg();
  }

  private void refreshPaletteImg() {
    if (getCurrLayer() != null) {
      ImagePanel panels[] = { getPalettePanel(), getColorChooserPalettePanel() };
      for (ImagePanel imgPanel : panels) {
        int width = imgPanel.getWidth();
        int height = imgPanel.getHeight();
        if (width >= 16 && height >= 4) {
          SimpleImage img = new RGBPaletteRenderer().renderHorizPalette(getCurrLayer().getPalette(), width, height);
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

    batchPanel.setSize(panelWidth, panelHeight);
    batchPanel.setPreferredSize(new Dimension(panelWidth, panelHeight));
    for (int i = 0; i < randomBatch.size(); i++) {
      SimpleImage img = randomBatch.get(i).getPreview(3 * prefs.getTinaRenderPreviewQuality() / 4);
      // add it to the main panel
      ImagePanel imgPanel = new ImagePanel(img, 0, 0, img.getImageWidth());
      imgPanel.setImage(img);
      imgPanel.setLocation(BORDER_SIZE, i * IMG_HEIGHT + (i + 1) * BORDER_SIZE);
      randomBatch.get(i).setImgPanel(imgPanel);
      final int idx = i;
      addRemoveButton(imgPanel, idx);
      imgPanel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent e) {
          if (e.getClickCount() > 1 || e.getButton() != MouseEvent.BUTTON1) {
            importFromRandomBatch(idx);
          }
        }
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

      imageScrollPane = null;
    }
    ImgSize size = getImgSize();
    image = new SimpleImage(size.getWidth(), size.getHeight());
    image.fillBackground(prefs.getTinaRandomBatchBGColorRed(), prefs.getTinaRandomBatchBGColorGreen(), prefs.getTinaRandomBatchBGColorBlue());
    ImagePanel imagePanel = new ImagePanel(image, 0, 0, image.getImageWidth());
    imagePanel.setSize(image.getImageWidth(), image.getImageHeight());
    imagePanel.setPreferredSize(new Dimension(image.getImageWidth(), image.getImageHeight()));

    imageScrollPane = new JScrollPane(imagePanel);
    imageScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    imageScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

      int width = previewRootPanel.getWidth();
      int height = previewRootPanel.getHeight();
      SimpleImage img = new SimpleImage(width, height);
      img.fillBackground(0, 0, 0);

      previewPanel = new ImagePanel(img, 0, 0, previewRootPanel.getWidth());
      previewRootPanel.add(previewPanel, BorderLayout.CENTER);
      previewRootPanel.getParent().validate();
      previewRootPanel.repaint();
    }
    return previewPanel;
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

    }
    return previewPanel;
  }

  protected void refreshPreview(boolean pFastPreview) {
    ImagePanel panel = getPreviewPanel();
    int width = panel.getWidth();
    int height = panel.getHeight();
    panel.setImage(renderPreviewImage(width, height, pFastPreview));
    previewRootPanel.repaint();
  }
View Full Code Here

Examples of org.jwildfire.swing.ImagePanel

    if (graph1Panel == null && graph1RootPanel != null) {
      int width = graph1RootPanel.getWidth();
      int height = graph1RootPanel.getHeight();
      SimpleImage img = new SimpleImage(width, height);
      img.fillBackground(0, 0, 0);
      graph1Panel = new ImagePanel(img, 0, 0, graph1RootPanel.getWidth());
      graph1RootPanel.add(graph1Panel, BorderLayout.CENTER);
      graph1RootPanel.getParent().validate();
      graph1RootPanel.repaint();
    }
    return graph1Panel;
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.