Пример #1
0
  public void imageReady(boolean skipFrame) {

    // Skip image drawing if minimized or frameskipping:
    if (!skipFrame) {

      if (scaleMode != SCALE_NONE) {

        if (scaleMode == SCALE_NORMAL) {

          Scale.doNormalScaling(pix, pix_scaled, nes.ppu.scanlineChanged);

        } else if (scaleMode == SCALE_SCANLINE) {

          Scale.doScanlineScaling(pix, pix_scaled, nes.ppu.scanlineChanged);

        } else if (scaleMode == SCALE_RASTER) {

          Scale.doRasterScaling(pix, pix_scaled, nes.ppu.scanlineChanged);
        }
      }

      nes.ppu.requestRenderAll = false;
      paint(getGraphics());
    }
  }
  public UpgradesPanel(ORUIManager orUIManager) {
    super(BoxLayout.Y_AXIS);

    this.orUIManager = orUIManager;

    preferredSize = new Dimension((int) Math.round(100 * (2 + Scale.getFontScale()) / 3), 200);
    setSize(preferredSize);
    setVisible(true);

    upgradePanel = new JPanel();

    upgradePanel.setOpaque(true);
    upgradePanel.setBackground(Color.DARK_GRAY);
    upgradePanel.setBorder(border);
    upgradePanel.setLayout(new GridLayout(defaultNbPanelElements, 1));

    scrollPane = new JScrollPane(upgradePanel);
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setSize(getPreferredSize());

    doneButton.setActionCommand("Done");
    doneButton.setMnemonic(KeyEvent.VK_D);
    doneButton.addActionListener(this);
    cancelButton.setActionCommand("Cancel");
    cancelButton.setMnemonic(KeyEvent.VK_C);
    cancelButton.addActionListener(this);

    add(scrollPane);
  }