private PreviewTopComponent() {
    initComponents();
    setName(NbBundle.getMessage(PreviewTopComponent.class, "CTL_PreviewTopComponent"));
    //        setToolTipText(NbBundle.getMessage(PreviewTopComponent.class,
    // "HINT_PreviewTopComponent"));
    setIcon(ImageUtilities.loadImage(ICON_PATH));
    if (UIUtils.isAquaLookAndFeel()) {
      previewPanel.setBackground(UIManager.getColor("NbExplorerView.background"));
    }
    if (UIUtils.isAquaLookAndFeel()) {
      southToolbar.setBackground(UIManager.getColor("NbExplorerView.background"));
    }

    bannerPanel.setVisible(false);

    // inits the preview applet
    sketchPanel.add(sketch, BorderLayout.CENTER);
    sketch.init();
    sketch.registerPost(processingListener);
    sketch.registerPre(processingListener);

    // forces the controller instanciation
    PreviewUIController.findInstance();

    // background color
    ((JColorButton) backgroundButton)
        .addPropertyChangeListener(
            JColorButton.EVENT_COLOR,
            new PropertyChangeListener() {

              public void propertyChange(PropertyChangeEvent evt) {
                PreviewController controller = Lookup.getDefault().lookup(PreviewController.class);
                controller.setBackgroundColor((Color) evt.getNewValue());
              }
            });
    southBusyLabel.setVisible(false);
    resetZoomButton.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            sketch.resetZoom();
          }
        });
  }
 /**
  * Defines the preview graph to draw in the applet.
  *
  * @param graph the preview graph to draw in the applet
  */
 public void setGraph(GraphSheet graphSheet) {
   sketch.setGraphSheet(graphSheet);
 }
 /** Refresh the preview applet. */
 public void refreshPreview() {
   sketch.refresh();
 }