コード例 #1
0
ファイル: StartupManager.java プロジェクト: RickKohrs/mcidasv
 /**
  * Builds and returns a {@link JPanel} containing the various buttons that control the startup
  * manager. These buttons offer identical functionality to those built by the IDV's preference
  * manager code.
  *
  * @return A {@code JPanel} containing the following types of buttons: {@link ApplyButton}, {@link
  *     OkButton}, {@link HelpButton}, and {@link CancelButton}.
  * @see GuiUtils#makeApplyOkHelpCancelButtons(ActionListener)
  */
 private JPanel buildCommandRow() {
   JPanel panel = new JPanel(new FlowLayout());
   // Apply doesn't really mean anything in standalone mode...
   //        panel.add(new ApplyButton());
   panel.add(new OkButton());
   panel.add(new HelpButton());
   panel.add(new CancelButton());
   panel = McVGuiUtils.makePrettyButtons(panel);
   return panel;
 }
コード例 #2
0
ファイル: StartupManager.java プロジェクト: RickKohrs/mcidasv
 public CommandButton(final String label) {
   super(label);
   McVGuiUtils.setComponentWidth(this);
   addActionListener(this);
 }
コード例 #3
0
ファイル: StartupManager.java プロジェクト: RickKohrs/mcidasv
  /**
   * Creates and returns the advanced preferences panel.
   *
   * @return Panel with all of the various startup options.
   */
  private JPanel buildAdvancedPanel() {
    OptionMaster optMaster = OptionMaster.getInstance();
    MemoryOption heapSize = optMaster.getMemoryOption("HEAP_SIZE");
    BooleanOption jogl = optMaster.getBooleanOption("JOGL_TOGL");
    BooleanOption use3d = optMaster.getBooleanOption("USE_3DSTUFF");
    BooleanOption defaultBundle = optMaster.getBooleanOption("DEFAULT_LAYOUT");
    BooleanOption useDirect3d = optMaster.getBooleanOption("D3DREND");
    BooleanOption useCmsCollector = optMaster.getBooleanOption("USE_CMSGC");
    BooleanOption useNpot = optMaster.getBooleanOption("USE_NPOT");
    BooleanOption useGeometryByRef = optMaster.getBooleanOption("USE_GEOBYREF");
    BooleanOption useImageByRef = optMaster.getBooleanOption("USE_IMAGEBYREF");
    DirectoryOption startupBundle = optMaster.getDirectoryOption("STARTUP_BUNDLE");
    //        TextOption jvmArgs = optMaster.getTextOption("JVM_ARGS");
    LoggerLevelOption logLevel = optMaster.getLoggerLevelOption("LOG_LEVEL");

    JPanel startupPanel = new JPanel();
    startupPanel.setBorder(BorderFactory.createTitledBorder("Startup Options"));

    // Build the memory panel
    JPanel heapPanel =
        McVGuiUtils.makeLabeledComponent(heapSize.getLabel() + ":", heapSize.getComponent());

    // Build the 3D panel
    JCheckBox use3dCheckBox = use3d.getComponent();
    use3dCheckBox.setText(use3d.getLabel());
    final JCheckBox joglCheckBox = jogl.getComponent();
    joglCheckBox.setText(jogl.getLabel());
    final JCheckBox direct3dBox = useDirect3d.getComponent();
    direct3dBox.setText(useDirect3d.getLabel());

    JPanel internalPanel = McVGuiUtils.topCenterBottom(use3dCheckBox, joglCheckBox, direct3dBox);
    JPanel j3dPanel = McVGuiUtils.makeLabeledComponent("3D:", internalPanel);

    // Build the bundle panel
    JPanel startupBundlePanel = startupBundle.getComponent();
    JCheckBox defaultBundleCheckBox = defaultBundle.getComponent();
    defaultBundleCheckBox.setText(defaultBundle.getLabel());
    JPanel bundlePanel =
        McVGuiUtils.makeLabeledComponent(
            startupBundle.getLabel() + ":",
            McVGuiUtils.topBottom(
                startupBundlePanel, defaultBundleCheckBox, McVGuiUtils.Prefer.TOP));

    JCheckBox useCmsCollectorCheckBox = useCmsCollector.getComponent();
    useCmsCollectorCheckBox.setText(useCmsCollector.getLabel());

    JCheckBox useGeometryByRefCheckBox = useGeometryByRef.getComponent();
    useGeometryByRefCheckBox.setText(useGeometryByRef.getLabel());

    JCheckBox useImageByRefCheckBox = useImageByRef.getComponent();
    useImageByRefCheckBox.setText(useImageByRef.getLabel());

    JCheckBox useNpotCheckBox = useNpot.getComponent();
    useNpotCheckBox.setText(useNpot.getLabel());

    JComboBox logLevelComboBox = logLevel.getComponent();

    JPanel logLevelPanel =
        McVGuiUtils.makeLabeledComponent(logLevel.getLabel() + ":", logLevelComboBox);

    JPanel miscPanel = McVGuiUtils.makeLabeledComponent("Misc:", useCmsCollectorCheckBox);

    Component[] visadComponents =
        new Component[] {useGeometryByRefCheckBox, useImageByRefCheckBox, useNpotCheckBox};

    JPanel visadPanel =
        McVGuiUtils.makeLabeledComponent("VisAD:", McVGuiUtils.vertical(visadComponents));

    javax.swing.GroupLayout panelLayout = new javax.swing.GroupLayout(startupPanel);
    startupPanel.setLayout(panelLayout);
    panelLayout.setHorizontalGroup(
        panelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(heapPanel)
            .addComponent(j3dPanel)
            .addComponent(bundlePanel)
            .addComponent(visadPanel)
            .addComponent(miscPanel)
            .addComponent(logLevelPanel));
    panelLayout.setVerticalGroup(
        panelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                panelLayout
                    .createSequentialGroup()
                    .addComponent(
                        heapPanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        bundlePanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        j3dPanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        visadPanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        logLevelPanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        miscPanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));
    return startupPanel;
  }