Package javax.swing

Examples of javax.swing.JProgressBar$ModelListener


        //
        // Initialization
        //
        final AboutDialog initDialog = new AboutDialog();
        final JProgressBar pb = new JProgressBar(0, 3);
        initDialog.getContentPane().add("South", pb);

        // Work around pack() bug on some platforms
        Dimension ss = initDialog.getToolkit().getScreenSize();
        Dimension ds = initDialog.getPreferredSize();

        initDialog.setLocation((ss.width  - ds.width) / 2,
                               (ss.height - ds.height) / 2);

        initDialog.setSize(ds);
        initDialog.setVisible(true);

        final JSVGViewerFrame v = new JSVGViewerFrame(this);
        JSVGCanvas c = v.getJSVGCanvas();
        c.addSVGDocumentLoaderListener(new SVGDocumentLoaderAdapter() {
            public void documentLoadingStarted(SVGDocumentLoaderEvent e) {
                pb.setValue(1);
            }
            public void documentLoadingCompleted(SVGDocumentLoaderEvent e) {
                pb.setValue(2);
            }
        });
        c.addGVTTreeBuilderListener(new GVTTreeBuilderAdapter() {
            public void gvtBuildCompleted(GVTTreeBuilderEvent e) {
                pb.setValue(3);
            }
        });
        c.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
            public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
                initDialog.dispose();
View Full Code Here


        //
        // Initialization
        //
        final AboutDialog initDialog = new AboutDialog();
        final JProgressBar pb = new JProgressBar(0, 3);
        initDialog.getContentPane().add("South", pb);

        // Work around pack() bug on some platforms
        Dimension ss = initDialog.getToolkit().getScreenSize();
        Dimension ds = initDialog.getPreferredSize();

        initDialog.setLocation((ss.width  - ds.width) / 2,
                               (ss.height - ds.height) / 2);

        initDialog.setSize(ds);
        initDialog.setVisible(true);

        final JSVGViewerFrame v = new JSVGViewerFrame(this);
        JSVGCanvas c = v.getJSVGCanvas();
        c.addSVGDocumentLoaderListener(new SVGDocumentLoaderAdapter() {
            public void documentLoadingStarted(SVGDocumentLoaderEvent e) {
                pb.setValue(1);
            }
            public void documentLoadingCompleted(SVGDocumentLoaderEvent e) {
                pb.setValue(2);
            }
        });
        c.addGVTTreeBuilderListener(new GVTTreeBuilderAdapter() {
            public void gvtBuildCompleted(GVTTreeBuilderEvent e) {
                pb.setValue(3);
            }
        });
        c.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
            public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
                initDialog.dispose();
View Full Code Here

    gbc.gridy = 0;
    gbc.insets = new Insets(4, 4, 4, 4);

    southernCentralPanel.setLayout(gbl);

    progressBar = new JProgressBar();
    gbc.gridx = 0;
    gbc.weightx = 1.0;
    gbc.anchor = GridBagConstraints.WEST;
    southernCentralPanel.add(progressBar, gbc);
View Full Code Here

    super(null);
  }

  @Override
  protected Component createWidget() {
    JProgressBar bar = new JProgressBar();
    Dimension size = bar.getPreferredSize();
    bar.setSize(size);
    bar.doLayout();
    bar.validate();
    return bar;
  }
View Full Code Here

    bar.validate();
    return bar;
  }
  @Override
  protected Component newWidget() {
    return new JProgressBar();
  }
View Full Code Here

    lastEvent = event;
  }

  public void test(TestHarness harness)
  {
    JProgressBar pb = new JProgressBar();
    harness.check(pb.getString(), "0%");
   
    pb.addPropertyChangeListener(this);
    pb.setString("XYZ");
    harness.check(pb.getString(), "XYZ");
    harness.check(lastEvent.getPropertyName(), "string");
    harness.check(lastEvent.getOldValue(), null);
    harness.check(lastEvent.getNewValue(), "XYZ");
   
    pb.setString(null);
    harness.check(pb.getString(), "0%");
    harness.check(lastEvent.getPropertyName(), "string");
    harness.check(lastEvent.getOldValue(), "XYZ");
    harness.check(lastEvent.getNewValue(), null);
   
  }
View Full Code Here

public class isStringPainted implements Testlet
{

  public void test(TestHarness harness)
  {
    JProgressBar pb = new JProgressBar();
    harness.check(pb.isStringPainted(), false);
   
    pb.setStringPainted(true);
    harness.check(pb.isStringPainted(), true);
  }
View Full Code Here

    lastEvent = event;
  }

  public void test(TestHarness harness)
  {
    JProgressBar pb = new JProgressBar();
    harness.check(pb.isBorderPainted(), true);
   
    pb.addPropertyChangeListener(this);
    pb.setBorderPainted(true);
    harness.check(lastEvent, null);
   
    pb.setBorderPainted(false);
    harness.check(pb.isBorderPainted(), false);
    harness.check(lastEvent.getPropertyName(), "borderPainted");
    harness.check(lastEvent.getOldValue(), Boolean.TRUE);
    harness.check(lastEvent.getNewValue(), Boolean.FALSE);
  }
View Full Code Here

  }

  public void constructor1(TestHarness harness)
  {
    harness.checkPoint("JProgressBar()");
    JProgressBar bar = new JProgressBar();
    harness.check(bar.getOrientation(), JProgressBar.HORIZONTAL);
    harness.check(bar.getValue(), 0);
    harness.check(bar.getMinimum(), 0);
    harness.check(bar.getMaximum(), 100);
    harness.check(bar.getString(), "0%");
    harness.check(bar.isStringPainted(), false);
  }
View Full Code Here

  public void constructor2(TestHarness harness)
  {
    harness.checkPoint("JProgressBar(BoundedRangeModel)");
    BoundedRangeModel m = new DefaultBoundedRangeModel(50, 10, 0, 100);
    JProgressBar bar = new JProgressBar(m);
    harness.check(bar.getOrientation(), JProgressBar.HORIZONTAL);
    harness.check(bar.getValue(), 50);
    harness.check(bar.getMinimum(), 0);
    harness.check(bar.getMaximum(), 100);
    harness.check(bar.getString(), "50%");
    harness.check(bar.isStringPainted(), false);
   
    boolean pass = false;
    try
    {
      bar = new JProgressBar(null);
    }
    catch (NullPointerException e)
    {
      harness.check(pass);
    }
View Full Code Here

TOP

Related Classes of javax.swing.JProgressBar$ModelListener

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.