/**
   * Creates the Factor definition subform
   *
   * @return - JPanel containing the Factor definition subform.
   */
  private Container createTransposedView() {

    Box subformContainer = Box.createVerticalBox();

    transposedSpreadsheetSubform =
        new TransposedSubForm(
            "spreadsheet data",
            FieldTypes.ROW,
            transposedSpreadsheetModel.getFields(),
            transposedSpreadsheetModel.getNumberOfRecords(),
            width,
            height,
            transposedSpreadsheetModel.getData(),
            transposedSpreadsheetModel.getSpreadsheet().getDataEntryEnv());

    transposedSpreadsheetSubform.createGUI();

    transposedSpreadsheetSubform.addPropertyChangeListener(
        "rowAdded",
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
            updateInformation();
          }
        });

    subformContainer.add(Box.createVerticalStrut(15));
    subformContainer.add(transposedSpreadsheetSubform);
    subformContainer.add(Box.createVerticalStrut(15));

    return subformContainer;
  }
Example #2
0
  public DateTimeView(DateTime time) {
    super();
    this.time = time;
    Font f = new Font("Monospaced", Font.BOLD, 13);
    Color c = new Color(44, 68, 152);
    month = new JLabel(strMonth(time.getMonthOfYear()));
    month.setFont(f);
    month.setForeground(c);
    year = new JLabel("" + time.getYear());
    year.setFont(f);
    year.setForeground(c);
    day = new JLabel("" + time.getDayOfMonth());
    day.setFont(new Font("Calibri", Font.BOLD, 26));
    day.setForeground(new Color(126, 148, 227));
    t = new JLabel(formatTime(time.getHourOfDay(), time.getMinuteOfHour()));
    t.setFont(f);
    t.setForeground(c);

    JPanel topPanel = new JPanel();
    topPanel.setLayout(new FlowLayout());
    topPanel.add(month);
    topPanel.add(year);

    this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
    topPanel.setAlignmentX(Component.CENTER_ALIGNMENT);
    this.add(topPanel);
    this.add(Box.createVerticalStrut(3));
    day.setAlignmentX(Component.CENTER_ALIGNMENT);
    this.add(day);
    t.setAlignmentX(Component.CENTER_ALIGNMENT);
    this.add(Box.createVerticalStrut(3));
    this.add(t);
    this.setBorder(BorderFactory.createRaisedBevelBorder());
  }
Example #3
0
  private void setupUI() {
    mainPanel = new JPanel();
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));

    mainPanel.add(createCurrentDirectoryPanel());
    mainPanel.add(Box.createVerticalStrut(10));
    mainPanel.add(createLogLevelPanel());
    mainPanel.add(Box.createVerticalStrut(10));
    mainPanel.add(createStackTracePanel());
    mainPanel.add(Box.createVerticalStrut(10));
    mainPanel.add(createOptionsPanel());
    mainPanel.add(Box.createVerticalStrut(10));
    mainPanel.add(createCustomExecutorPanel());
    mainPanel.add(Box.createVerticalStrut(10));

    // add a panel that can be used to add custom things to the setup tab
    customPanelPlaceHolder = new JPanel(new BorderLayout());
    mainPanel.add(customPanelPlaceHolder);

    // Glue alone doesn't work in this situation. This forces everything to the top.
    JPanel expandingPanel = new JPanel(new BorderLayout());
    expandingPanel.add(Box.createVerticalGlue(), BorderLayout.CENTER);
    mainPanel.add(expandingPanel);

    mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
  }
  public HelpUI(Frame parent, String title) {
    sidebar = new Sidebar();
    sidebar.setBorder(new EmptyBorder(10, 10, 10, 10));
    infoView = new JTextPane();
    Dimension d1 = sidebar.getPreferredSize();
    infoView.setPreferredSize(new Dimension(d1.width * 3, d1.height - 5));
    infoView.setEditable(false);

    MouseAdapter ma =
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent me) {
            SidebarOption sopt = (SidebarOption) me.getComponent();
            if (sel != null) {
              sel.setSelected(false);
              sel.repaint();
            }
            sel = sopt;
            sel.setSelected(true);
            sel.repaint();
            renderInfo();
          }
        };

    general = new SidebarOption("General Info", HELP_GENERAL_LOC);
    general.addMouseListener(ma);
    sidebar.add(general);

    sidebar.add(Box.createVerticalStrut(scy(10)));

    artifact = new SidebarOption("Artifacts", HELP_ARTIFACTS_LOC);
    artifact.addMouseListener(ma);
    sidebar.add(artifact);

    sidebar.add(Box.createVerticalStrut(scy(10)));

    net = new SidebarOption("Networking", HELP_NET_LOC);
    net.addMouseListener(ma);
    sidebar.add(net);

    sidebar.add(Box.createVerticalStrut(scy(10)));

    gpl = new SidebarOption("License", HELP_GPL_LOC);
    gpl.addMouseListener(ma);
    sidebar.add(gpl);

    general.setSelected(true);
    sel = general;

    sidebar.add(Box.createVerticalGlue());

    add(BorderLayout.WEST, sidebar);
    add(BorderLayout.CENTER, new JScrollPane(infoView));
    setResizable(false);
    pack();
    setLocationRelativeTo(parent);
    setTitle(title);

    renderInfo();
  }
  public void createGUI() {
    HUDTitleBar titlePanel = new HUDTitleBar(headerImage, headerImage);

    add(titlePanel, BorderLayout.NORTH);
    titlePanel.installListeners();

    createProgressScreen();

    JPanel exportOptionContainer = new JPanel();
    exportOptionContainer.setLayout(new BoxLayout(exportOptionContainer, BoxLayout.PAGE_AXIS));

    exportOptionContainer.add(createCompressionRateChoiceUI());
    exportOptionContainer.add(Box.createVerticalStrut(20));
    exportOptionContainer.add(createSelectOutputDirectoryUI());
    exportOptionContainer.add(Box.createVerticalStrut(20));
    exportOptionContainer.add(createCreateArchiveButtonUI());

    swappableContainer.add(exportOptionContainer, BorderLayout.CENTER);
    add(swappableContainer, BorderLayout.CENTER);

    ((JComponent) getContentPane()).setBorder(new LineBorder(UIHelper.LIGHT_GREEN_COLOR, 2, true));

    addWindowListener(this);
    pack();
    setVisible(true);
  }
Example #6
0
  /**
   * Creates a dialog that is showing the histogram for the given node (if null one is selected for
   * you)
   */
  private JPanel createNormalityTestDialog(Node selected) {
    DataSet dataSet = (DataSet) dataEditor.getSelectedDataModel();

    QQPlot qqPlot = new QQPlot(dataSet, selected);
    NormalityTestEditorPanel editorPanel = new NormalityTestEditorPanel(qqPlot, dataSet);

    JTextArea display =
        new JTextArea(
            NormalityTests.runNormalityTests(
                dataSet, (ContinuousVariable) qqPlot.getSelectedVariable()),
            20,
            65);
    display.setEditable(false);
    editorPanel.addPropertyChangeListener(new NormalityTestListener(display));

    Box box = Box.createHorizontalBox();
    box.add(display);

    box.add(Box.createHorizontalStrut(3));
    box.add(editorPanel);
    box.add(Box.createHorizontalStrut(5));
    box.add(Box.createHorizontalGlue());

    Box vBox = Box.createVerticalBox();
    vBox.add(Box.createVerticalStrut(15));
    vBox.add(box);
    vBox.add(Box.createVerticalStrut(5));

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.add(vBox, BorderLayout.CENTER);

    return panel;
  }
    public DisplayUserDirectory() {
      GridBagLayout gbl = new GridBagLayout();
      GridBagConstraints gbc = new GridBagConstraints();
      setLayout(gbl);

      gbc.anchor = GridBagConstraints.NORTHWEST;
      gbc.fill = GridBagConstraints.HORIZONTAL;

      hmlabel.setForeground(Color.black);
      add(hmlabel, gbc);
      add(Box.createHorizontalStrut(10), gbc);
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      add(hmdir, gbc);
      add(Box.createVerticalStrut(15), gbc);

      gbc.gridwidth = 1;
      vjlabel.setForeground(Color.black);
      add(vjlabel, gbc);
      add(Box.createHorizontalStrut(10), gbc);
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      add(vjdir, gbc);
      add(Box.createVerticalStrut(0), gbc);

      gbc.gridwidth = 1;
      vjlabel2.setForeground(Color.black);
      add(vjlabel2, gbc);
      setBorder(
          new CompoundBorder(
              // i18n
              // BorderFactory.createTitledBorder(" User_Directories "),
              BorderFactory.createTitledBorder(Util.getAdmLabel("_admin_User_Directories")),
              BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    }
  @Inject
  public CheckoutPanel(BookInventory inventory, CreditCardService cardService, Logger logger) {
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    this.logger = logger;

    this.cartTableModel = new CartTableModel();

    final CheckoutInventoryTableModel inventoryModel = new CheckoutInventoryTableModel(inventory);
    inventoryModel.addTableModelListener(
        new TableModelListener() {

          public void tableChanged(TableModelEvent event) {
            if (inventoryModel.isLastColumn(event.getColumn())) {
              for (int i = event.getFirstRow(); i <= event.getLastRow(); i++) {
                addToCart(inventoryModel.decrementInventry(event.getFirstRow()));
              }
            }
          }
        });
    this.add(new JScrollPane(new CheckoutInventoryTable(inventoryModel)));
    this.add(Box.createVerticalStrut(20));
    this.add(new JScrollPane(new CartTable(cartTableModel)));
    this.add(Box.createVerticalStrut(20));
    this.add(new PaymentPanel(cardService));

    this.add(Box.createVerticalGlue());

    this.setPreferredSize(new Dimension(600, 400));
  }
Example #9
0
 private void createMarginBox(Container c, Component comp) {
   c.add(Box.createVerticalStrut(10));
   Box lrMargins = Box.createHorizontalBox();
   lrMargins.add(Box.createHorizontalStrut(10));
   lrMargins.add(comp);
   lrMargins.add(Box.createHorizontalStrut(10));
   c.add(lrMargins);
   c.add(Box.createVerticalStrut(10));
 }
 public ConstraintsPanel() {
   setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
   add(new DisplayUserDirectory());
   add(Box.createVerticalStrut(15));
   add(new DisplayParentDirectory("", "", false));
   add(Box.createVerticalStrut(15));
   add(new DisplayTemplate("", ""));
   add(Box.createVerticalStrut(15));
   add(new DisplayResults());
   add(Box.createVerticalStrut(15));
 }
Example #11
0
  public void prepareGUI() {
    mainFrame = new JFrame("Game of life");
    mainFrame.setSize(750, 670);
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    grid = new GridPanel(board.getNumOfRows(), board.getNumOfColumns());
    grid.setPreferredSize(new Dimension(600, 600));
    grid.setBoard(this.board.getCurrentRound());
    grid.addMouseListener(this);

    scrollPane = new JScrollPane(grid);
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    buttonStart = new JButton("Start");
    buttonStop = new JButton("Stop");
    buttonNextRound = new JButton("Next round");
    buttonClearBoard = new JButton("Clear board");

    buttonStart.setMaximumSize(
        new Dimension(Integer.MAX_VALUE, buttonStart.getMinimumSize().height));
    buttonStop.setMaximumSize(new Dimension(Integer.MAX_VALUE, buttonStop.getMinimumSize().height));
    buttonNextRound.setMaximumSize(
        new Dimension(Integer.MAX_VALUE, buttonNextRound.getMinimumSize().height));
    buttonClearBoard.setMaximumSize(
        new Dimension(Integer.MAX_VALUE, buttonClearBoard.getMinimumSize().height));

    buttonStart.addActionListener(this);
    buttonStop.addActionListener(this);
    buttonNextRound.addActionListener(this);
    buttonClearBoard.addActionListener(this);

    generationsLabel = new JLabel("Generation " + numOfGenerations);

    drawingCheckBox = new JCheckBox("Drawing");

    buttonsPanel = new JPanel();
    buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.PAGE_AXIS));
    buttonsPanel.add(buttonStart);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(buttonStop);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(buttonNextRound);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(buttonClearBoard);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(generationsLabel);
    buttonsPanel.add(Box.createVerticalStrut(2));
    buttonsPanel.add(drawingCheckBox);

    mainFrame.add(scrollPane, BorderLayout.CENTER);
    mainFrame.add(buttonsPanel, BorderLayout.EAST);
  }
Example #12
0
 private JPanel createPreviewPanel() {
   JPanel p = new JPanel();
   p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
   _screenshot = new PatternPaneScreenshot(_simg);
   createMarginBox(p, _screenshot);
   p.add(Box.createVerticalStrut(5));
   p.add(_screenshot.createControls());
   p.add(Box.createVerticalStrut(5));
   p.add(msgApplied[tabSequence]);
   p.doLayout();
   return p;
 }
  public Component getDemoPanel() {
    // register two converters. Both for CustomType but the first one is the default, the second one
    // is for a special case.
    ObjectConverterManager.registerConverter(CustomType.class, new DefaultCustomTypeConverter());
    ObjectConverterManager.registerConverter(
        CustomType.class, new SpecialCustomTypeConverter(), SpecialCustomTypeConverter.CONTEXT);

    JPanel panel = new JPanel();
    panel.setLayout(new JideBoxLayout(panel, BoxLayout.Y_AXIS));

    CustomType[] customTypes =
        new CustomType[] {
          new CustomType(1, "JIDE Docking Framework"),
          new CustomType(2, "JIDE Action Framework"),
          new CustomType(3, "JIDE Components"),
          new CustomType(4, "JIDE Grids"),
          new CustomType(5, "JIDE Dialogs"),
        };

    panel.add(
        new JLabel(
            "<HTML>We defined a CustomType class which has two fields. See below."
                + "<PRE><BR> <FONT COLOR=\"BLUE\">public class</FONT> CustomType {"
                + "<BR>    <FONT COLOR=\"BLUE\">int</FONT> <FONT COLOR=\"PURPLE\">_intValue</FONT>;"
                + "<BR>    String <FONT COLOR=\"PURPLE\">_stringValue</FONT>;"
                + "<BR> }"
                + "<BR></PRE>"
                + "</HTML>"));

    panel.add(Box.createVerticalStrut(24), JideBoxLayout.FIX);

    panel.add(new JLabel("This ListComboBox uses default converter for this custom type"));
    panel.add(Box.createVerticalStrut(6), JideBoxLayout.FIX);

    AbstractComboBox comboBox1 = createListComboBox(customTypes);
    panel.add(comboBox1);

    panel.add(Box.createVerticalStrut(12), JideBoxLayout.FIX);

    panel.add(new JLabel("This one uses a special converter for this custom type"));
    panel.add(Box.createVerticalStrut(6), JideBoxLayout.FIX);
    AbstractComboBox comboBox2 = createListComboBox(customTypes);
    //        comboBox2.setEditable(false);
    // set the context to use the special converter.
    comboBox2.setConverterContext(SpecialCustomTypeConverter.CONTEXT);
    panel.add(comboBox2);

    panel.add(Box.createVerticalStrut(12), JideBoxLayout.FIX);

    panel.add(Box.createGlue(), JideBoxLayout.VARY);
    return panel;
  }
Example #14
0
 private JPanel createTargetPanel() {
   JPanel p = new JPanel();
   p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
   _tarOffsetPane =
       new PatternPaneTargetOffset(_simg, _imgBtn.getFilename(), _imgBtn.getTargetOffset());
   createMarginBox(p, _tarOffsetPane);
   p.add(Box.createVerticalStrut(5));
   p.add(_tarOffsetPane.createControls());
   p.add(Box.createVerticalStrut(5));
   p.add(msgApplied[tabSequence]);
   p.doLayout();
   return p;
 }
Example #15
0
  public static void main(String[] args) {
    JFrame frame = new JFrame("Demo of Additional Borders");
    frame.setIconImage(JideIconsFactory.getImageIcon(JideIconsFactory.JIDE32).getImage());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(new BorderLayout());

    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
    panel.setLayout(new JideBoxLayout(panel, JideBoxLayout.Y_AXIS, 10));

    JTextArea textField = new JTextArea();
    JPanel border = new JPanel(new BorderLayout());
    border.setPreferredSize(new Dimension(100, 100));
    border.add(new JScrollPane(textField), BorderLayout.CENTER);
    border.setBorder(
        new JideTitledBorder(
            new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH),
            "PartialEtchedBorder"));

    JTextArea textField2 = new JTextArea();
    JPanel border2 = new JPanel(new BorderLayout());
    border2.setPreferredSize(new Dimension(100, 100));
    border2.add(new JScrollPane(textField2), BorderLayout.CENTER);
    border2.setBorder(
        new JideTitledBorder(
            new PartialLineBorder(Color.darkGray, 1, PartialSide.NORTH), "PartialLineBorder"));

    JTextArea textField3 = new JTextArea();
    JPanel border3 = new JPanel(new BorderLayout());
    border3.setPreferredSize(new Dimension(100, 100));
    border3.add(new JScrollPane(textField3), BorderLayout.CENTER);
    border3.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder(
                new PartialLineBorder(Color.gray, 1, true), "Rounded Corners Border"),
            BorderFactory.createEmptyBorder(0, 6, 4, 6)));

    panel.add(border, JideBoxLayout.FLEXIBLE);
    panel.add(Box.createVerticalStrut(12));
    panel.add(border2, JideBoxLayout.FLEXIBLE);
    panel.add(Box.createVerticalStrut(12));
    panel.add(border3, JideBoxLayout.FLEXIBLE);
    panel.add(Box.createGlue(), JideBoxLayout.VARY);

    panel.setPreferredSize(new Dimension(500, 400));
    frame.getContentPane().add(panel, BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);
  }
    public DisplayResults() {
      GridBagLayout gbl = new GridBagLayout();
      GridBagConstraints gbc = new GridBagConstraints();
      setLayout(gbl);

      gbc.anchor = GridBagConstraints.NORTHWEST;
      gbc.fill = GridBagConstraints.HORIZONTAL;

      text.setForeground(Color.black);
      add(text, gbc);
      gbc.gridy = 0;
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      add(emptyLabel, gbc);
      add(Box.createVerticalStrut(0), gbc);
      add(emptyLabel, gbc);

      /*	 gbc.gridy = 1;
      VTextMsg result = new VTextMsg(sshare, vnmrif, null);
      result.setPreferredSize(new Dimension(300, 30));
      result.setForeground(Color.black);
      add( result, gbc );
      */
      setBorder(
          new CompoundBorder(
              BorderFactory.createTitledBorder("  Results  "),
              BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    }
Example #17
0
  /** @return A Box for selecting an asset type, the old asset and its replacement asset. */
  private Box assetChoiceBox() {
    TreeSet<String> types = new TreeSet<String>();

    types.add(AssetType.CHARACTER.toString());
    types.add(AssetType.PROP.toString());
    types.add(AssetType.SET.toString());

    // JDrawer toReturn;
    Box hbox = new Box(BoxLayout.X_AXIS);
    {
      JCollectionField assetType = UIFactory.createCollectionField(types, diag, sTSize);
      assetType.setActionCommand("type");
      assetType.addActionListener(this);

      JCollectionField oldAsset = UIFactory.createCollectionField(charList.keySet(), diag, sVSize);
      JCollectionField newAsset = UIFactory.createCollectionField(charList.keySet(), diag, sVSize);
      hbox.add(assetType);
      hbox.add(Box.createHorizontalStrut(10));
      hbox.add(oldAsset);
      hbox.add(Box.createHorizontalStrut(5));
      hbox.add(newAsset);

      // pPotentials.put(oldAsset, newAsset);
    }
    list.add(Box.createVerticalStrut(5));

    return hbox; // toReturn;
  } // return assetChoiceBox
  @NotNull
  private static JComponent createInformationPanel(@NotNull final String adapterHomePageUrl) {
    JLabel label1 = new JLabel("See");
    HyperlinkLabel hyperlink = SwingHelper.createWebHyperlink(adapterHomePageUrl);

    JLabel label2 = new JLabel("for details.");

    JPanel panel =
        SwingHelper.newHorizontalPanel(
            Component.BOTTOM_ALIGNMENT,
            SwingHelper.newLeftAlignedVerticalPanel(label1, Box.createVerticalStrut(2)),
            hyperlink,
            Box.createHorizontalStrut(5),
            SwingHelper.newLeftAlignedVerticalPanel(label2, Box.createVerticalStrut(2)));
    return SwingHelper.wrapWithoutStretch(panel);
  }
Example #19
0
 public void init(List<T> sources) {
   this.sources = sources;
   consoles = new HashMap<T, ConsolePanel>();
   singleNodeGUIS = new ArrayList<JComponent>();
   // setPreferredSize(new Dimension(1000,700));
   JSplitPane[] leftAndRight =
       new JSplitPane[] {
         new JSplitPane(JSplitPane.VERTICAL_SPLIT), new JSplitPane(JSplitPane.VERTICAL_SPLIT)
       };
   for (int i = 0; i < sources.size(); i++) {
     T t = sources.get(i);
     Box box = Box.createVerticalBox();
     ConsolePanel console = createConsole();
     consoles.put(t, console);
     JScrollPane jsp = new JScrollPane(console);
     jsp.setMinimumSize(new Dimension(600, 300));
     jsp.setPreferredSize(new Dimension(600, 300));
     jsp.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
     box.add(jsp);
     // box.add(Box.createVerticalGlue());
     box.add(createInputTF(t));
     box.add(Box.createVerticalStrut(3));
     box.setBorder(BorderFactory.createTitledBorder(String.valueOf(t)));
     singleNodeGUIS.add(box);
     leftAndRight[i / 2].add(box);
   }
   add(leftAndRight[0]);
   add(leftAndRight[1]);
 }
 public UpdateOrStatusOptionsDialog(Project project, Map<Configurable, AbstractVcs> confs) {
   super(project);
   setTitle(getRealTitle());
   myProject = project;
   if (confs.size() == 1) {
     myMainPanel = new JPanel(new BorderLayout());
     final Configurable configurable = confs.keySet().iterator().next();
     addComponent(confs.get(configurable), configurable, BorderLayout.CENTER);
     myMainPanel.add(Box.createVerticalStrut(10), BorderLayout.SOUTH);
   } else {
     myMainPanel = new JBTabbedPane();
     final ArrayList<AbstractVcs> vcses = new ArrayList<>(confs.values());
     Collections.sort(
         vcses,
         new Comparator<AbstractVcs>() {
           public int compare(final AbstractVcs o1, final AbstractVcs o2) {
             return o1.getDisplayName().compareTo(o2.getDisplayName());
           }
         });
     Map<AbstractVcs, Configurable> vcsToConfigurable = revertMap(confs);
     for (AbstractVcs vcs : vcses) {
       addComponent(vcs, vcsToConfigurable.get(vcs), vcs.getDisplayName());
     }
   }
   init();
 }
  protected void init(JPanel customPanel) {
    setTitle(LanguageBundle.getInstance().getMessage("label.copy"));
    setModal(true);
    setResizable(false);

    JPanel optionPanel = createOptionPanel();

    // generic panels
    JPanel conPanel1 =
        createConnectionPanel(
            details1, LanguageBundle.getInstance().getMessage("copy.confirm.source"));
    JPanel conPanel2 =
        createConnectionPanel(
            details2, LanguageBundle.getInstance().getMessage("copy.confirm.target"));

    JPanel sourceP = createPathPanel(details1.getCurrentPath());
    JPanel toP = createToPanel();
    JPanel targetP = createPathPanel(details2.getCurrentPath());

    JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));

    addLeftToPanel(mainPanel, customPanel);
    mainPanel.add(Box.createVerticalStrut(3));
    addLeftToPanel(mainPanel, conPanel1);
    addLeftToPanel(mainPanel, sourceP);
    mainPanel.add(Box.createVerticalStrut(3));
    addLeftToPanel(mainPanel, toP);
    mainPanel.add(Box.createVerticalStrut(3));
    addLeftToPanel(mainPanel, conPanel2);
    addLeftToPanel(mainPanel, targetP);
    addLeftToPanel(mainPanel, optionPanel);

    mainPanel.setBorder(
        BorderFactory.createCompoundBorder(
            BorderFactory.createEmptyBorder(2, 5, 2, 5),
            BorderFactory.createCompoundBorder(
                BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(5, 5, 5, 5))));

    JPanel buttonPanel = createButtonPanel();
    getContentPane().add(mainPanel, BorderLayout.CENTER);
    getContentPane().add(buttonPanel, BorderLayout.SOUTH);
    pack();
    setLocationRelativeTo(parent);

    okB.requestFocus();
  }
Example #22
0
 /** @param outFileFilters output file selector filter */
 public IOComponent(FileFilter[] outFileFilters) {
   setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
   traceSelector = new FileSelector(true, "Trace", FileFilters.getAllTraceFilters());
   add(traceSelector);
   add(Box.createVerticalStrut(10));
   outputSelector = new FileSelector(false, "Output", outFileFilters);
   add(outputSelector);
 }
  private JPanel createContentPanel() {
    // compute content and other buttons
    SpringLayout springLayout = new SpringLayout();
    JPanel panel = new JPanel(springLayout);
    int panelHeight = 0;
    JTable propertiesPanel = createPropertiesPanel();
    panelHeight += propertiesPanel.getPreferredSize().getHeight();
    panel.add(propertiesPanel);
    panelHeight += 10;
    panel.add(Box.createVerticalStrut(10));
    JScrollPane scrollPane = new JScrollPane(createAdaptersPanel());
    panelHeight += scrollPane.getPreferredSize().getHeight();
    panel.add(scrollPane);
    panelHeight += 10;
    panel.add(Box.createVerticalStrut(10));
    JPanel buttonsPanel = createButtonsPanel();
    panelHeight += buttonsPanel.getPreferredSize().getHeight();
    panel.add(buttonsPanel);

    springLayout.putConstraint(
        SpringLayout.NORTH, panel, DEFAULT_PADDING, SpringLayout.NORTH, propertiesPanel);
    springLayout.putConstraint(
        SpringLayout.WEST, panel, DEFAULT_PADDING, SpringLayout.WEST, propertiesPanel);
    springLayout.putConstraint(
        SpringLayout.EAST, panel, DEFAULT_PADDING, SpringLayout.EAST, propertiesPanel);
    springLayout.putConstraint(
        SpringLayout.NORTH, scrollPane, DEFAULT_PADDING, SpringLayout.SOUTH, propertiesPanel);
    springLayout.putConstraint(
        SpringLayout.WEST, panel, DEFAULT_PADDING, SpringLayout.WEST, scrollPane);
    springLayout.putConstraint(
        SpringLayout.EAST, panel, DEFAULT_PADDING, SpringLayout.EAST, scrollPane);
    springLayout.putConstraint(
        SpringLayout.NORTH, scrollPane, DEFAULT_PADDING, SpringLayout.SOUTH, buttonsPanel);
    springLayout.putConstraint(
        SpringLayout.WEST, panel, DEFAULT_PADDING, SpringLayout.WEST, buttonsPanel);
    springLayout.putConstraint(
        SpringLayout.EAST, panel, DEFAULT_PADDING, SpringLayout.EAST, buttonsPanel);

    panel.setPreferredSize(
        new Dimension(
            CHECK_COLUMN_WIDTH + LABEL_COLUMN_WIDTH + COLUMN_WIDTH - 32,
            panelHeight + DEFAULT_PADDING));
    makeCompactGrid(panel, 5, 1, 0, 0, 0, 0);
    return panel;
  }
Example #24
0
  /** 生成面板内容 */
  private void createContent() {
    contentPanel = new JPanel(new BorderLayout());
    panel.add(contentPanel, BorderLayout.CENTER);

    Box message = Box.createVerticalBox();
    message.setBorder(BorderFactory.createEtchedBorder());

    dateImg = new JLabel(new ImageIcon(TMFrame.class.getResource("/images/calendar.gif")));
    String today = Today.getYear() + "年" + Today.getMonth() + "月" + Today.getDate() + "日";
    date = new JLabel(today);
    date.setFont(font);
    week = new JLabel(Today.getWeek());
    week.setFont(font);
    nameImg = new JLabel(new ImageIcon(TMFrame.class.getResource("/images/role.png")));
    name = new JLabel(staffInfo.getStaffName());
    name.setFont(font);
    role = new JLabel("总经理");
    role.setFont(font);

    Box messageTop = Box.createVerticalBox();
    Box messageCenter = Box.createHorizontalBox();
    Box messageBottom = Box.createVerticalBox();

    messageTop.add(Box.createVerticalStrut(1));
    messageCenter.add(Box.createHorizontalStrut(5));
    messageCenter.add(dateImg);
    messageCenter.add(Box.createHorizontalStrut(2));
    messageCenter.add(date);
    messageCenter.add(Box.createHorizontalStrut(20));
    messageCenter.add(week);
    messageCenter.add(Box.createHorizontalStrut(50));
    messageCenter.add(nameImg);
    messageCenter.add(Box.createHorizontalStrut(2));
    messageCenter.add(name);
    messageCenter.add(Box.createHorizontalStrut(20));
    messageCenter.add(role);
    messageCenter.add(Box.createHorizontalGlue());
    messageBottom.add(Box.createVerticalStrut(1));

    message.add(messageTop);
    message.add(messageCenter);
    message.add(messageBottom);
    contentPanel.add(message, BorderLayout.NORTH);
  }
 @NotNull
 @Override
 protected JComponent createComponent(@NotNull CreationContext creationContext) {
   JPanel linePanel =
       SwingHelper.newHorizontalPanel(
           Component.CENTER_ALIGNMENT,
           new JLabel("Debug in"),
           myPreferredDebugBrowserComboBox,
           new JLabel(" if both browsers are captured."));
   JPanel result =
       SwingHelper.newLeftAlignedVerticalPanel(
           Box.createVerticalStrut(5),
           new JLabel("Debugging is available in a local browser (Chrome or Firefox)"),
           Box.createVerticalStrut(4),
           new JLabel("captured by a local JsTestDriver server running in IDE."),
           Box.createVerticalStrut(15),
           SwingHelper.wrapWithNoFilling(linePanel));
   return SwingHelper.wrapWithNoFilling(result);
 }
  public java.awt.Container createControlPanel() {
    java.awt.Container panel2 = Box.createVerticalBox();
    panel2 = super.createControlPanel();

    brainPlay = new JCheckBox("Brain Play", false);
    if (testMode) brainPlay.setSelected(true);
    panel2.add(brainPlay);

    JPanel row2 = new JPanel();

    // ADVERSARY slider
    row2.add(Box.createVerticalStrut(12));
    row2.add(new JLabel("Adversary:"));

    adversary = new JSlider(0, 100, 0); // min, max, current
    adversary.setPreferredSize(new Dimension(100, 15));
    row2.add(adversary);

    JPanel text = new JPanel();
    text.add(adStat = new JLabel(adversaryOff));
    panel2.add(text);

    panel2.add(row2);

    JPanel row3 = new JPanel();

    // Mr. Happy slider
    row3.add(Box.createVerticalStrut(12));
    row3.add(new JLabel("CELAB"));

    happy = new JSlider(0, 100, 0); // min, max, current
    happy.setPreferredSize(new Dimension(100, 15));
    row3.add(happy);

    JPanel text2 = new JPanel();
    text2.add(adHappy = new JLabel(happyOff));
    panel2.add(text2);

    panel2.add(row3);

    return (panel2);
  }
  /** Called when the panel becomes active. */
  public void panelActivate() {
    parent.lockNextButton();
    parent.lockPrevButton();
    if (idata.installSuccess) {
      // We set the information
      centerPanel.add(
          new JLabel(
              parent.langpack.getString("FinishPanel.success"),
              parent.icons.getImageIcon("information"),
              JLabel.TRAILING));
      centerPanel.add(Box.createVerticalStrut(20));

      if (idata.info.getWriteUninstaller()) {
        // We prepare a message for the uninstaller feature
        String path = translatePath("$INSTALL_PATH") + File.separator + "Uninstaller";

        centerPanel.add(
            new JLabel(
                parent.langpack.getString("FinishPanel.uninst.info"),
                parent.icons.getImageIcon("information"),
                JLabel.TRAILING));
        centerPanel.add(new JLabel(path, parent.icons.getImageIcon("empty"), JLabel.TRAILING));
      }

      // We add the autoButton
      centerPanel.add(Box.createVerticalStrut(20));
      autoButton =
          ButtonFactory.createButton(
              parent.langpack.getString("FinishPanel.auto"),
              parent.icons.getImageIcon("edit"),
              idata.buttonsHColor);
      autoButton.setToolTipText(parent.langpack.getString("FinishPanel.auto.tip"));
      autoButton.addActionListener(this);
      centerPanel.add(autoButton);
    } else
      centerPanel.add(
          new JLabel(
              parent.langpack.getString("FinishPanel.fail"),
              parent.icons.getImageIcon("information"),
              JLabel.TRAILING));
  }
 private void init() {
   setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
   Box labelBox = Box.createHorizontalBox();
   labelBox.add(new JLabel("Initialize Variable: "));
   labelBox.add(varName);
   labelBox.add(Box.createHorizontalGlue());
   add(labelBox);
   add(Box.createVerticalStrut(10));
   varEditPane.setLayout(new BorderLayout());
   add(varEditPane);
   add(Box.createVerticalGlue());
 }
Example #29
0
  /**
   * Creates a dialog that is showing the histogram for the given node (if null one is selected for
   * you)
   */
  private JPanel createScatterPlotDialog(
      ContinuousVariable yVariable, ContinuousVariable xVariable) {
    String dialogTitle = "Scatter Plots";
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());

    DataSet dataSet = (DataSet) dataEditor.getSelectedDataModel();

    ScatterPlotOld scatterPlot = new ScatterPlotOld(dataSet, yVariable, xVariable);
    ScatterPlotEditorPanel editorPanel = new ScatterPlotEditorPanel(scatterPlot, dataSet);
    ScatterPlotDisplayPanelOld display = new ScatterPlotDisplayPanelOld(scatterPlot);
    editorPanel.addPropertyChangeListener(new ScatterPlotListener(display));

    JMenuBar bar = new JMenuBar();
    JMenu menu = new JMenu("File");
    menu.add(new JMenuItem(new SaveComponentImage(display, "Save Scatter Plot")));
    bar.add(menu);

    Box box = Box.createHorizontalBox();
    box.add(display);

    box.add(Box.createHorizontalStrut(3));
    box.add(editorPanel);
    box.add(Box.createHorizontalStrut(5));
    box.add(Box.createHorizontalGlue());

    Box vBox = Box.createVerticalBox();
    vBox.add(Box.createVerticalStrut(15));
    vBox.add(box);
    vBox.add(Box.createVerticalStrut(5));

    panel.add(bar, BorderLayout.NORTH);
    panel.add(vBox, BorderLayout.CENTER);

    //        dialog.getContentPane().add(bar, BorderLayout.NORTH);
    //        dialog.getContentPane().add(vBox, BorderLayout.CENTER);
    //        return dialog;
    return panel;
  }
Example #30
0
  private static JPanel createTextFieldAndListPanel(
      String label, JTextField textField, JList list) {
    GridBagLayout layout = new GridBagLayout();
    JPanel panel = new JPanel(layout);

    GridBagConstraints cons = new GridBagConstraints();
    cons.gridx = cons.gridy = 0;
    cons.gridwidth = cons.gridheight = 1;
    cons.fill = GridBagConstraints.BOTH;
    cons.weightx = 1.0f;

    JLabel _label = new JLabel(jEdit.getProperty(label));
    layout.setConstraints(_label, cons);
    panel.add(_label);

    cons.gridy = 1;
    Component vs = Box.createVerticalStrut(6);
    layout.setConstraints(vs, cons);
    panel.add(vs);

    cons.gridy = 2;
    layout.setConstraints(textField, cons);
    panel.add(textField);

    cons.gridy = 3;
    vs = Box.createVerticalStrut(6);
    layout.setConstraints(vs, cons);
    panel.add(vs);

    cons.gridy = 4;
    cons.gridheight = GridBagConstraints.REMAINDER;
    cons.weighty = 1.0f;
    JScrollPane scroller = new JScrollPane(list);
    layout.setConstraints(scroller, cons);
    panel.add(scroller);

    return panel;
  }