Package javax.swing

Examples of javax.swing.ViewportLayout


   * @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

   *
   * @param harness the test harness to use
   */
  public void test(TestHarness harness)
  {
    ViewportLayout l = new ViewportLayout();
    Dimension minSize = l.minimumLayoutSize(null);
    harness.check(minSize, new Dimension(4, 4));
  }
View Full Code Here

    });
  }

  static public void setVerticalScrollingView (JScrollPane scrollPane, final Component view) {
    final JViewport viewport = new JViewport();
    viewport.setLayout(new ViewportLayout() {
      private static final long serialVersionUID = 7701568740313788935L;
      public void layoutContainer (Container parent) {
        viewport.setViewPosition(new Point(0, 0));
        Dimension viewportSize = viewport.getSize();
        int width = viewportSize.width;
View Full Code Here

        });
    }

    public static void setVerticalScrollingView (JScrollPane scrollPane, final Component view) {
        final JViewport viewport = new JViewport();
        viewport.setLayout(new ViewportLayout() {
            private static final long serialVersionUID = 7701568740313788935L;
            @Override
            public void layoutContainer (Container parent) {
                viewport.setViewPosition(new Point(0, 0));
                Dimension viewportSize = viewport.getSize();
View Full Code Here

TOP

Related Classes of javax.swing.ViewportLayout

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.