Package javax.swing

Examples of javax.swing.JViewport


    reportScrollPane.setFocusTraversalKeysEnabled(false);
    reportScrollPane.setBackground(new Color(0,0,0,0));
    reportScrollPane.setBorder(new EmptyBorder(0, 0, 0, 0));
    reportScrollPane.setOpaque(false);

    final JViewport viewport = reportScrollPane.getViewport();
    viewport.setOpaque(false);
    viewPortComponent.setBackground(new Color(0,0,0,0));
    viewPortComponent.setBorder(new EmptyBorder(0, 0, 0, 0));

    reportScrollPane.getRowHeader().setOpaque(false);
    ((JComponent) reportScrollPane.getRowHeader().getView()).setOpaque(false);
View Full Code Here


            int x = mouseEvent.getX();
            int y = mouseEvent.getY();

            if (component.getParent() instanceof JViewport) {
                // We are in a viewport: drag the view with the middle mouse button.
                JViewport viewport = (JViewport) component.getParent();
                viewport.setViewPosition(new Point(
                        dragInitialPoint.x - component.getX() - x,
                        dragInitialPoint.y - component.getY() - y
                ));

                // Make sure we stay in the bounds of the MapView.
                viewport.scrollRectToVisible(component.getBounds());
            }
        }
    }
View Full Code Here

   * @param harness the test harness to use
   */
  void test1(TestHarness harness)
  {
    JScrollPane sp = new TestScrollPane();
    JViewport vp = sp.getViewport();
    vp.setView(new JLabel("Hello World"));
    TestScrollPane.TestAccessibleScrollPane asp =
      (TestScrollPane.TestAccessibleScrollPane) sp.getAccessibleContext();
    vp.setViewPosition(new Point(10, 10));
    harness.check(vp.getViewPosition().equals(new Point(0, 0)), false);
    asp.resetViewPort();
    harness.check(vp.getViewPosition().equals(new Point(0, 0)), false);
  }
View Full Code Here

    TestScrollPane.TestAccessibleScrollPane asp =
      (TestScrollPane.TestAccessibleScrollPane) sp.getAccessibleContext();
    resetViewPortCalled = false;
    asp.propertyChange(new PropertyChangeEvent(sp, "viewport",
                                               sp.getViewport(),
                                               new JViewport()));
    harness.check(resetViewPortCalled, false);
  }
View Full Code Here

  {
    JScrollPane sp = new TestScrollPane();
    TestScrollPane.TestAccessibleScrollPane asp =
      (TestScrollPane.TestAccessibleScrollPane) sp.getAccessibleContext();
    resetViewPortCalled = false;
    sp.setViewport(new JViewport());
    harness.check(resetViewPortCalled, true);
  }
View Full Code Here

   *
   * @param h the test harness to use
   */
  private void test1(TestHarness h)
  {
    JViewport vp = new JViewport();
    ViewportLayout layout = (ViewportLayout) vp.getLayout();
    JPanel view = new JPanel(){};
    vp.setView(view);
    view.setMinimumSize(new Dimension(100, 100));
    view.setPreferredSize(new Dimension(200, 200));
    view.setMaximumSize(new Dimension(300, 300));
    vp.setSize(400, 400);
    layout.layoutContainer(vp);
    h.check(view.getSize(), new Dimension(400, 400));
  }
View Full Code Here

   *
   * @param h the test harness to use
   */
  private void test2(TestHarness h)
  {
    JViewport vp = new JViewport();
    ViewportLayout layout = (ViewportLayout) vp.getLayout();
    JPanel view = new JPanel(){};
    vp.setView(view);
    view.setMinimumSize(new Dimension(100, 100));
    view.setPreferredSize(new Dimension(200, 200));
    view.setMaximumSize(new Dimension(300, 300));
    vp.setSize(150, 150);
    layout.layoutContainer(vp);
    h.check(view.getSize(), new Dimension(200, 200));
  }
View Full Code Here

   *
   * @param h the test harness to use
   */
  private void test3(TestHarness h)
  {
    JViewport vp = new JViewport();
    ViewportLayout layout = (ViewportLayout) vp.getLayout();
    JPanel view = new JPanel(){};
    vp.setView(view);
    view.setMinimumSize(new Dimension(100, 100));
    view.setPreferredSize(new Dimension(10, 10));
    view.setMaximumSize(new Dimension(300, 300));
    vp.setSize(50, 50);
    layout.layoutContainer(vp);
    h.check(view.getSize(), new Dimension(50, 50));
  }
View Full Code Here

   *
   * @param h the test harness to use
   */
  private void testMinimumViewSize(TestHarness h)
  {
    JViewport vp = new JViewport();
    ViewportLayout l = (ViewportLayout) vp.getLayout();
    JPanel view = new JPanel();
    view.setMinimumSize(new Dimension(100, 100));
    view.setPreferredSize(new Dimension(200, 200));
    view.setMaximumSize(new Dimension(300, 300));
    vp.setSize(150, 150);
    vp.setView(view);
    view.setBounds(50, 50, 100, 100);
    l.layoutContainer(vp);
    h.check(view.getLocation(), new Point(50, 50));
  }
View Full Code Here

   }
  
   public void setHeightTableHeader(final int intHeight)
   {

      JViewport vwp = new JViewport()
      {

         @Override
         public Dimension getPreferredSize()
         {
View Full Code Here

TOP

Related Classes of javax.swing.JViewport

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.