Package java.awt

Examples of java.awt.Container$EventTargetFilter


        public void windowClosing(WindowEvent e) {
          System.exit(0);
        }
      });

    Container contentPane = getContentPane();
   
    pane.setLayout(new BorderLayout());

    // Add the menubar
    menuBar = new TestMenuBar(this);
    setJMenuBar(menuBar);
      
    // Get the Graphics object for pdf writing
    Graphics pdfGraphics = null;
    job = new PDFJob(fileOutputStream);
    pdfGraphics = job.getGraphics();
    Dimension d = job.getPageDimension();
    documentDimension = d;

    // Finish setting up the window and bring to front
    int w = (int)d.getWidth();
    int h = (int)d.getHeight();

    drawingArea = new TestPanel();

    // Put the drawing area in a scroll pane
    JScrollPane scrollPane = new JScrollPane(drawingArea,
                        ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    // Set the preferred size bigger than the scroll pane so the bars show up
    drawingArea.setPreferredSize(new Dimension(1000, 1000));
   
    pane.add(scrollPane, "Center");
   
    contentPane.add(pane);

    setTitle("PDF Test Application");

    // Set the location and size of the window and show it
    Toolkit toolkit = Toolkit.getDefaultToolkit();
View Full Code Here


class HelpFrame extends JFrame
{
  public HelpFrame() {
    setTitle("gnupdf Help");
       
    Container helpContent = getContentPane();
   
    helpContent.setLayout(new BorderLayout());
    JTextArea textArea = new JTextArea(20, 40);
    textArea.setLineWrap(true);
    textArea.append(getHelpText());   
    JScrollPane helpScroller = new JScrollPane(textArea);
    helpContent.add(helpScroller);
    setSize(helpScroller.getSize());
    setLocation(new Point(200, 200));
    pack();
    toFront();
    show();
View Full Code Here

   
    @Override
    public void mouseReleased(MouseEvent e) {
       
        if (parent == null) {
            Container c = getTopLevelAncestor();
            parent = c instanceof ItemForm ? (ItemForm) c : null;
        }
       
        if (SwingUtilities.isRightMouseButton(e)) {
           
View Full Code Here

      super("Chat Client");
      setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      setSize(640, 200);
      setLocationRelativeTo(null);

      Container contentPane = getContentPane();
      cardLayout = new CardLayout();
      contentPane.setLayout(cardLayout);
      {
        JPanel panel = new JPanel(new BorderLayout());
        contentPane.add(panel, "progress");
        panel.add(new JLabel("Connecting to " + host + "..."));
        {
          panel.add(progressBar = new JProgressBar(), BorderLayout.SOUTH);
          progressBar.setIndeterminate(true);
        }
      }
      {
        JPanel panel = new JPanel(new BorderLayout());
        contentPane.add(panel, "chat");
        {
          JPanel topPanel = new JPanel(new GridLayout(1, 2));
          panel.add(topPanel);
          {
            topPanel.add(new JScrollPane(messageList = new JList()));
View Full Code Here

      super("Chat RMI Client");
      setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      setSize(640, 200);
      setLocationRelativeTo(null);

      Container contentPane = getContentPane();
      cardLayout = new CardLayout();
      contentPane.setLayout(cardLayout);
      {
        JPanel panel = new JPanel(new BorderLayout());
        contentPane.add(panel, "progress");
        panel.add(new JLabel("Connecting to " + host + "..."));
        {
          panel.add(progressBar = new JProgressBar(), BorderLayout.SOUTH);
          progressBar.setIndeterminate(true);
        }
      }
      {
        JPanel panel = new JPanel(new BorderLayout());
        contentPane.add(panel, "chat");
        {
          JPanel topPanel = new JPanel(new GridLayout(1, 2));
          panel.add(topPanel);
          {
            topPanel.add(new JScrollPane(messageList = new JList()));
View Full Code Here

          if (anchorIndex.getPageIndex() != pageIndex)
          {
            setPageIndex(anchorIndex.getPageIndex());
            refreshPage();
          }
          Container container = pnlInScroll.getParent();
          if (container instanceof JViewport)
          {
            JViewport viewport = (JViewport) container;

            int newX = (int)(anchorIndex.getElementAbsoluteX() * realZoom);
            int newY = (int)(anchorIndex.getElementAbsoluteY() * realZoom);

            int maxX = pnlInScroll.getWidth() - viewport.getWidth();
            int maxY = pnlInScroll.getHeight() - viewport.getHeight();

            if (newX < 0)
            {
              newX = 0;
            }
            if (newX > maxX)
            {
              newX = maxX;
            }
            if (newY < 0)
            {
              newY = 0;
            }
            if (newY > maxY)
            {
              newY = maxY;
            }

            viewport.setViewPosition(new Point(newX, newY));
          }
        }

        break;
      }
      case LOCAL_PAGE :
      {
        int page = pageIndex + 1;
        if (hyperlink.getHyperlinkPage() != null)
        {
          page = hyperlink.getHyperlinkPage().intValue();
        }

        if (page >= 1 && page <= jasperPrint.getPages().size() && page != pageIndex + 1)
        {
          setPageIndex(page - 1);
          refreshPage();
          Container container = pnlInScroll.getParent();
          if (container instanceof JViewport)
          {
            JViewport viewport = (JViewport) container;
            viewport.setViewPosition(new Point(0, 0));
          }
View Full Code Here

  }//GEN-LAST:event_btnSaveActionPerformed

  void pnlLinksMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pnlLinksMouseDragged
    // Add your handling code here:

    Container container = pnlInScroll.getParent();
    if (container instanceof JViewport)
    {
      JViewport viewport = (JViewport) container;
      Point point = viewport.getViewPosition();
      int newX = point.x - (evt.getX() - downX);
View Full Code Here

          if (anchorIndex.getPageIndex() != viewerContext.getPageIndex())
          {
            viewerContext.setPageIndex(anchorIndex.getPageIndex());
            viewerContext.refreshPage();
          }
          Container container = pnlInScroll.getParent();
          if (container instanceof JViewport)
          {
            JViewport viewport = (JViewport) container;

            int newX = (int)(anchorIndex.getElementAbsoluteX() * realZoom);
            int newY = (int)(anchorIndex.getElementAbsoluteY() * realZoom);

            int maxX = pnlInScroll.getWidth() - viewport.getWidth();
            int maxY = pnlInScroll.getHeight() - viewport.getHeight();

            if (newX < 0)
            {
              newX = 0;
            }
            if (newX > maxX)
            {
              newX = maxX;
            }
            if (newY < 0)
            {
              newY = 0;
            }
            if (newY > maxY)
            {
              newY = maxY;
            }

            viewport.setViewPosition(new Point(newX, newY));
          }
        }

        break;
      }
      case LOCAL_PAGE :
      {
        int page = viewerContext.getPageIndex() + 1;
        if (hyperlink.getHyperlinkPage() != null)
        {
          page = hyperlink.getHyperlinkPage().intValue();
        }

        if (page >= 1 && page <= viewerContext.getJasperPrint().getPages().size() && page != viewerContext.getPageIndex() + 1)
        {
          viewerContext.setPageIndex(page - 1);
          viewerContext.refreshPage();
          Container container = pnlInScroll.getParent();
          if (container instanceof JViewport)
          {
            JViewport viewport = (JViewport) container;
            viewport.setViewPosition(new Point(0, 0));
          }
View Full Code Here

  }//GEN-LAST:event_pnlLinksMousePressed

  void pnlLinksMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pnlLinksMouseDragged
    // Add your handling code here:

    Container container = pnlInScroll.getParent();
    if (container instanceof JViewport)
    {
      JViewport viewport = (JViewport) container;
      Point point = viewport.getViewPosition();
      int newX = point.x - (evt.getX() - downX);
View Full Code Here

    dialog = new JDialog(parent, title, false);
 
    // TODO : should not be resizable if it worked correctly
    //dialog.setResizable(false);
     
    Container contentPane = dialog.getContentPane();

    contentPane.setLayout(new BorderLayout());
    contentPane.add(createSourcePanel(), BorderLayout.EAST);
   
   
    contentPane.add( new JScrollPane(createDataPanel(), JScrollPane.VERTICAL_SCROLLBAR_ALWAYS , JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED ), BorderLayout.CENTER);
   
    contentPane.add(createNamePanel(node.getName()), BorderLayout.NORTH);
    contentPane.add(createButtonPanel(), BorderLayout.SOUTH);
    if (JDialog.isDefaultLookAndFeelDecorated()) {
      boolean supportsWindowDecorations =
        UIManager.getLookAndFeel().getSupportsWindowDecorations();
      if (supportsWindowDecorations) {
        dialog.setUndecorated(true);
View Full Code Here

TOP

Related Classes of java.awt.Container$EventTargetFilter

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.