Package javax.swing

Examples of javax.swing.JInternalFrame$JDesktopIcon$AccessibleJDesktopIcon


  /**
   * Handler method called by the preview action. This method should perform all operations to preview the report.
   */
  protected void attemptPreview()
  {
    final JInternalFrame frame = findSelectedFrame();
    if (frame == null)
    {
      return;
    }
    final Rectangle bounds = frame.getBounds();
    final Container parent = frame.getParent();
    final boolean visible = frame.isVisible();
    final int layer = frame.getLayer();

    // now print ..
    previewReport(frame);

    if (parent != null)
    {
      if (frame.getParent() != parent)
      {
        frame.getParent().remove(frame);
        parent.add(frame);
      }
    }
    frame.setBounds(bounds);
    frame.setVisible(visible);
    frame.setLayer(new Integer(layer));
  }
View Full Code Here


  private JInternalFrame findSelectedFrame()
  {
    final JInternalFrame[] frames = desktop.getAllFrames();
    for (int i = 0; i < frames.length; i++)
    {
      final JInternalFrame frame = frames[i];
      if (frame.isSelected())
      {
        return frame;
      }
    }
    return null;
View Full Code Here

    /**
     * Invoked when an action occurs.
     */
    public void actionPerformed(final ActionEvent e)
    {
      final JInternalFrame frame = new DocumentInternalFrame();
      frame.setSize(400, 300);
      frame.setVisible(true); //necessary as of 1.3
      desktop.add(frame);
      try
      {
        frame.setSelected(true);
      }
      catch (PropertyVetoException ex)
      {
        // ignore exception ..
      }
View Full Code Here

    final JPanel content = new JPanel(new BorderLayout());
    content.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    content.add(createDefaultTable(data));
    content.add(new ActionButton(ctrl.getExportAction()), BorderLayout.SOUTH);

    final JInternalFrame frame = new JInternalFrame();
    frame.setClosable(false);
    frame.setVisible(true);
    frame.setContentPane(content);
    frame.pack();

    final JDesktopPane desktop = new JDesktopPane();
    desktop.setDoubleBuffered(false);
    desktop.add(frame);
    return desktop;
View Full Code Here

    public static JInternalFrame getPaletteInternalWindow(
                                                          Component gui,
                                                          String windowName,
                                                          InternalFrameListener ifl) {

        JInternalFrame paletteWindow;

        // create the palette's scroll pane
        JScrollPane scrollPane = new JScrollPane(gui, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
        scrollPane.setAlignmentY(Component.TOP_ALIGNMENT);

        // create the palette internal window
        paletteWindow = new JInternalFrame(windowName, true, //resizable
                true, //closable
                false, //maximizable
                true //iconifiable
        );

        // add a window listener that destroys the palette when
        // the window is closed
        paletteWindow.addInternalFrameListener(ifl);
        paletteWindow.getContentPane().add(scrollPane);
        paletteWindow.setOpaque(true);

        //layout all the components
        paletteWindow.pack();

        return paletteWindow;
    }
View Full Code Here

                JFrame window = new JFrame("Swing Video Player");
                JDesktopPane panel = new JDesktopPane();
                window.add(panel);
                for (int i = files.length - 1; i >= 0; --i) {
                    File file = files[i];
                    JInternalFrame frame = new JInternalFrame(file.getName());
                    frame.setResizable(true);
                    frame.setClosable(true);
                    frame.setIconifiable(true);
                    frame.setMaximizable(true);
                   
                    frame.setLocation(i * 100, i * 100);
                    final VideoPlayer player = new VideoPlayer(file);
                    player.setPreferredSize(new Dimension(640, 480));
                    player.setControlsVisible(true);
                    frame.add(player, BorderLayout.CENTER);
                    frame.pack();
                    panel.add(frame);
                    frame.setVisible(true);
                    javax.swing.Timer timer = new javax.swing.Timer(5000 * i, new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            player.getMediaPlayer().play();
                        }
                    });
View Full Code Here

                JFrame window = new JFrame("Swing Video Player");
                JDesktopPane panel = new JDesktopPane();
                window.add(panel);
                for (int i = files.length - 1; i >= 0; --i) {
                    File file = files[i];
                    JInternalFrame frame = new JInternalFrame(file.getName());
                    panel.add(frame);
                    frame.setResizable(true);
                    frame.setClosable(true);
                    frame.setIconifiable(true);
                    frame.setMaximizable(true);
                   
                    frame.setLocation(i * 100, i * 100);
                    final float alpha = 0.6f;
                    final VideoPlayer player = new VideoPlayer(file) {

                        private static final long serialVersionUID = 4925431893247320169L;

                        protected void paintComponent(Graphics g) {
                            Graphics2D g2d = (Graphics2D) g.create();
                            g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
                            g2d.setColor(Color.BLACK);
                            g2d.fillRect(0, 0, getWidth(), getHeight());
                            g2d.dispose();
                        }
                    };
                    player.setPreferredSize(new Dimension(400, 250));
                    player.setControlsVisible(true);
                    player.setOpaque(false);
                    player.setOpacity(alpha);
                    Pipeline pipe = player.getMediaPlayer().getPipeline();
                    if (pipe instanceof PlayBin2) {
                        ((PlayBin2) pipe).setAudioSink(ElementFactory.make("fakesink", "audio"));
                    }
                   
                    frame.setOpaque(false);
                    frame.setContentPane(player);
                    frame.pack();
                   
                    frame.setVisible(true);
                    javax.swing.Timer timer = new javax.swing.Timer(5000 * i, new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            player.getMediaPlayer().play();
                        }
                    });
View Full Code Here

  private void clearAllBuffers() {
    BufferList bufferList = getBufferList();
    while (bufferList.size() > 0) {
      Buffer buffer = bufferList.get(bufferList.size() - 1);
      JInternalFrame frame = buffer.getInternalFrame();
      if (frame.isIcon()) {
        try {
          frame.setIcon(false);
        }
        catch (Throwable e) {
          e.printStackTrace();
        }
      }
View Full Code Here

      executing = false;
    }
  }

  private void addEvents(Buffer pBuffer) {
    JInternalFrame frame = pBuffer.getInternalFrame();
    frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() {
      public void internalFrameClosed(
          javax.swing.event.InternalFrameEvent e) {
        JInternalFrame frame = (JInternalFrame) e.getSource();
        BufferList bufferList = getBufferList();
        for (Buffer buffer : bufferList) {
          if (frame == buffer.getInternalFrame()) {
            bufferList.remove(buffer);
            actionList.removeBuffer(buffer, getBufferList());
View Full Code Here

    public void actionPerformed(final ActionEvent e) {
        final JInternalFrame[] frames = gcViewer.getDesktopPane().getAllFrames();
        final DesktopManager desktopManager = gcViewer.getDesktopPane().getDesktopManager();
        for (int i=0; i<frames.length; i++) {
            final JInternalFrame frame = frames[i];
            desktopManager.deiconifyFrame(frame);
            try {
                frame.setMaximum(false);
            } catch (PropertyVetoException e1) {
                e1.printStackTrace();
            }
            final int height = gcViewer.getDesktopPane().getHeight()/frames.length;
            desktopManager.setBoundsForFrame(frame, 0, height * i, gcViewer.getDesktopPane().getWidth(), height);
View Full Code Here

TOP

Related Classes of javax.swing.JInternalFrame$JDesktopIcon$AccessibleJDesktopIcon

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.