Exemple #1
0
  /**
   * Builds the panel. Initializes and configures components first, then creates a FormLayout,
   * configures the layout, creates a builder, sets a border, and finally adds the components.
   *
   * @return the built panel
   */
  public JComponent createContentPanel() {
    // Separating the component initialization and configuration
    // from the layout code makes both parts easier to read.
    // TODO set minimum size
    FormLayout layout =
        new FormLayout(
            "180px", // cols //$NON-NLS-1$
            "p, 6dlu,  p,6dlu,p,6dlu,p"); // rows //$NON-NLS-1$

    // Create a builder that assists in adding components to the container.
    // Wrap the panel with a standardized border.
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();
    JLabel logo = new JLabel(IconManager.getIcon("icon.projity"));
    logo.addMouseListener(
        new MouseAdapter() {
          public void mouseClicked(MouseEvent arg0) {
            BrowserControl.displayURL("http://www.projity.com"); // $NON-NLS-1$
          }
        });
    builder.append(logo);
    builder.nextLine(2);
    builder.append(link);
    //		builder.nextLine(2);
    //		builder.append(videos);
    if (Environment.isOpenProj()) {
      builder.nextLine(2);
      builder.append(tipOfTheDay);
    }
    builder.nextLine(2);
    builder.append(license);

    if (false || Environment.isOpenProj()) { // removed donation link
      JPanel p = new JPanel();
      p.add(builder.getPanel());
      //		p.add(makeDonatePanel(false));
      return p;
    } else return builder.getPanel();
  }
 public static boolean showDialog(Frame owner, boolean force) {
   if (!Environment.isOpenProj()) return false;
   System.setProperty(
       "projectlibre.userEmail",
       Preferences.userNodeForPackage(UserInfoDialog.class).get("userEmail", ""));
   if (!validated || force) {
     UserInfoDialog dlg = new UserInfoDialog(owner);
     //			if (!validated)
     //				dlg.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); // force user to click a button
     dlg.doModal();
     return true;
   }
   return false;
 }
Exemple #3
0
  protected void initComponents() {
    link = new JButton(Messages.getString("HelpDialog.GoToOnlineHelp")); // $NON-NLS-1$
    link.setEnabled(true);
    link.setToolTipText(helpUrl);
    link.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            BrowserControl.displayURL(helpUrl);
          }
        });
    //		videos = new JButton(Messages.getString("HelpDialog.WatchHowToVideos")); //$NON-NLS-1$
    //		videos.setEnabled(true);
    //		videos.setToolTipText(helpUrl);
    //		videos.addActionListener(new ActionListener() {
    //			public void actionPerformed(ActionEvent arg0) {
    //				BrowserControl.displayURL(videosUrl);
    //			}
    //		});
    if (Environment.isOpenProj()) {
      tipOfTheDay = new JButton(Messages.getString("HelpDialog.ShowTipsOfTheDay")); // $NON-NLS-1$
      tipOfTheDay.setEnabled(true);
      tipOfTheDay.setToolTipText(Messages.getString("HelpDialog.ShowTipsOfTheDay")); // $NON-NLS-1$
      tipOfTheDay.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
              TipOfTheDay.showDialog(HelpDialog.this.getOwner(), true);
            }
          });
    }
    license = new JButton(Messages.getString("HelpDialog.ShowLicense")); // $NON-NLS-1$
    license.setEnabled(true);
    license.setToolTipText(Messages.getString("HelpDialog.ShowLicense")); // $NON-NLS-1$
    license.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            LicenseDialog.showDialog(GraphicManager.getFrameInstance(), true);
          }
        });

    super.initComponents();
  }