/**
   * @param title
   * @throws HeadlessException
   */
  public IcyExternalFrame(String title) throws HeadlessException {
    super(title);

    getRootPane()
        .addPropertyChangeListener(
            "titlePane",
            new PropertyChangeListener() {
              @Override
              public void propertyChange(PropertyChangeEvent evt) {
                // invoke later so the titlePane variable is up to date
                ThreadUtil.invokeLater(
                    new Runnable() {
                      @Override
                      public void run() {
                        updateTitlePane();
                      }
                    });
              }
            });

    setIconImages(ResourceUtil.getIcyIconImages());
    setVisible(false);

    systemMenuCallback = null;
    closeItemVisible = true;
    updateTitlePane(LookAndFeelUtil.getTitlePane(this));

    titleBarVisible = true;
    initialized = true;
  }
  /** update internals informations linked to title pane */
  protected void updateTitlePane() {
    if (initialized) {
      // title pane can have changed
      updateTitlePane(LookAndFeelUtil.getTitlePane(this));

      if (!titleBarVisible) setTitleBarVisible(false);
    }
  }
Ejemplo n.º 3
0
    public ImageJRibbonBand() {
      super(
          NAME,
          new BasicResizableIcon(ImageUtil.loadImage(ImageJ.class.getResource("/microscope.gif"))));

      // initialize some static ImageJ stuff

      // home directory
      System.setProperty("plugins.dir", "ij");
      // background color
      ImageJ.backgroundColor = LookAndFeelUtil.getBackground(this);

      // create ImageJ wrapper
      imageJ = new ImageJWrapper();
      imageJComp = new JRibbonComponent(imageJ.getSwingPanel());

      // add ImageJ GUI wrapper to ribbon
      addRibbonComponent(imageJComp, 3);

      RibbonUtil.setRestrictiveResizePolicies(this);
    }