Package javax.swing

Examples of javax.swing.GroupLayout$BaselineGroup


        mixOptionsPanel.add(optionsChecksPanel);

        stepTextField.setText(Integer.toString(MixParsedCommand.DEFAULT_STEP));
        secondStepTextField.setText(Integer.toString(MixParsedCommand.DEFAULT_STEP));

        GroupLayout optionFieldsLayout = new GroupLayout(optionsFieldsPanel);
        optionsFieldsPanel.setLayout(optionFieldsLayout);
        optionFieldsLayout.setAutoCreateGaps(true);

        optionFieldsLayout
                .setHorizontalGroup(optionFieldsLayout.createSequentialGroup().addGroup(
                        optionFieldsLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(stepLabel)
                                .addComponent(secondStepLabel)).addGroup(
                        optionFieldsLayout.createParallelGroup().addComponent(stepTextField).addComponent(
                                secondStepTextField)));

        optionFieldsLayout.setVerticalGroup(optionFieldsLayout.createSequentialGroup().addGroup(
                optionFieldsLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(stepLabel)
                        .addComponent(stepTextField)).addGroup(
                optionFieldsLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(secondStepLabel)
                        .addComponent(secondStepTextField)));

        mixOptionsPanel.add(optionsFieldsPanel);

        topConst.fill = GridBagConstraints.HORIZONTAL;
View Full Code Here


            //SearchBox.setCaretPosition(pos + 1);
        }
    }
   
    public LayoutManager getPage(JComponent context, DocumentListener listener) {
        GroupLayout page = new GroupLayout(context);
       
        //String[] fnames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
        //for (String fname: fnames) System.out.println("font: " + fname);
       
        Font font = Font.decode("SansSerif");
        if (font != null) font = font.deriveFont((float) 14.0);
        //if (font != null) font = font.deriveFont(Font.BOLD);

        SearchBox = new JTextField();
        SearchBox.setText("search...");
        SearchBox.setCaretPosition(0);
        SearchBox.moveCaretPosition(9);
        SearchBox.setFont(font.deriveFont((float) 14.0).deriveFont(Font.BOLD));
        SearchBox.setSize(width + 4, textHeight);
        SearchBox.setBorder(BorderFactory.createEmptyBorder());
        SearchBox.setBackground(Color.decode("#EEEEDD"));
        SearchBox.getDocument().addDocumentListener(listener);
        InputMap im = SearchBox.getInputMap();
        ActionMap am = SearchBox.getActionMap();
        im.put(KeyStroke.getKeyStroke("ENTER"), COMMIT_ACTION);
        am.put(COMMIT_ACTION, new CommitAction());
       
        Switchboard.InfoBox = new JTextField();
        Switchboard.InfoBox.setBorder(BorderFactory.createTitledBorder(""));
        Switchboard.InfoBox.setSize(width, textHeight);
        Switchboard.InfoBox.setBorder(BorderFactory.createEmptyBorder());
        Switchboard.InfoBox.setBackground(Color.decode("#EEEEDD"));
        Switchboard.InfoBox.setText("search window initialized");
        Switchboard.InfoBox.setFont(font.deriveFont((float) 11.0));
       
        // make the scroll pane that contains the search result
        JComponent mainText = new JEditorPane();
        mainText.setPreferredSize(new java.awt.Dimension(480, 590));
        String infotext =
            "This is a very early test for a YaCy GUI.\n\n" +
            "The YaCy administration interface is in your browser\n" +
            "just open http://localhost:8090\n\n" +
            "You may also enter a search term and press enter,\n" +
            "then the query will be opened in your browser\n";
        if (OS.isMacArchitecture) infotext += "\nThe application data on Mac is stored at ~Library/YaCy/\n";
        ((JEditorPane) mainText).setText(infotext);
        //page.add(new splashCanvas());

        //SplashScreen splash = SplashScreen.getSplashScreen();
        //Graphics2D g2 = splash.createGraphics();
        //splash.update();
       
        JScrollPane pane = new JScrollPane();
        pane.setViewportView(mainText);
       
        // combine search box and scroll pane
        page.setVerticalGroup(page.createSequentialGroup()
            .addComponent(SearchBox, GroupLayout.PREFERRED_SIZE, textHeight + 4, GroupLayout.PREFERRED_SIZE)
            .addComponent(pane, 0, height, Short.MAX_VALUE) // height
            .addComponent(Switchboard.InfoBox, GroupLayout.PREFERRED_SIZE, textHeight, GroupLayout.PREFERRED_SIZE)
            );
        page.setHorizontalGroup(page.createSequentialGroup()
            .addGroup(page.createParallelGroup()
                .addComponent(SearchBox, GroupLayout.Alignment.LEADING, 0, width, Short.MAX_VALUE) // width
                .addComponent(pane, GroupLayout.Alignment.LEADING, 0, width, Short.MAX_VALUE)
                .addComponent(Switchboard.InfoBox, GroupLayout.Alignment.TRAILING, 0, width, Short.MAX_VALUE)));
        return page;
    }
View Full Code Here

        setJMenuBar(jMenuBar1);
        JLabel label = new JLabel();
        label.setText("Perskaiciuoti pridejus taska");

        GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addComponent(jProgressBar1, GroupLayout.DEFAULT_SIZE, 535, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
                    .addComponent(steinerButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cleanButton, GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE)
                    .addComponent(graphContructionButton, GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()

                    .addComponent(solveOnClickCheckbox, GroupLayout.DEFAULT_SIZE,0,Short.MAX_VALUE)
                    .addComponent(label, GroupLayout.DEFAULT_SIZE,0,Short.MAX_VALUE)
                    )
                    )
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(cleanButton)
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(steinerButton)
                        .addComponent(graphContructionButton)
                        .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                            .addComponent(solveOnClickCheckbox)
                                .addComponent(label)
                        )
                        )
                    .addComponent(jPanel1, GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE))
View Full Code Here

        clearLabel.addMouseListener(onClearLabelClick);
        importLabel.addMouseListener(onImportLabelClick);
        exportLabel.addMouseListener(onExportLabelClick);
        settingsLabel.addMouseListener(onSettingsLabelClick);

        GroupLayout controlPanelLayout = new GroupLayout(controlPanel);
        controlPanel.setLayout(controlPanelLayout);
        controlPanelLayout.setHorizontalGroup(
            controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(controlPanelLayout.createSequentialGroup()
                .addGroup(controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(controlPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addComponent(importLabel)
                            .addComponent(solveLabel)
                            .addComponent(exportLabel)))
                    .addGroup(controlPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(clearLabel))
                    .addGroup(controlPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(settingsLabel)))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        controlPanelLayout.setVerticalGroup(
            controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(controlPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(solveLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(importLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(exportLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(clearLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(settingsLabel)
                .addContainerGap(19, Short.MAX_VALUE))
        );

        graphBackgroundPanel.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        //graphBackgroundPanel.setName("graphBackgroundPanel");

        graphDrawPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        //graphDrawPanel.setName("graphDrawPanel");
        graphDrawPanel.setBackground(Color.WHITE);

    graphMouseListener = new GraphMouseListener(graphDrawPanel, controller, null);
        graphDrawPanel.addMouseListener(graphMouseListener);
        graphDrawPanel.addMouseMotionListener(mouseMotionListener);
       
        GroupLayout graphBackgroundPanelLayout = new GroupLayout(graphBackgroundPanel);
        graphBackgroundPanel.setLayout(graphBackgroundPanelLayout);
        graphBackgroundPanelLayout.setHorizontalGroup(
            graphBackgroundPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(GroupLayout.Alignment.TRAILING, graphBackgroundPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(graphDrawPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        graphBackgroundPanelLayout.setVerticalGroup(
            graphBackgroundPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(graphBackgroundPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(graphDrawPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(controlPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(graphBackgroundPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(controlPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addComponent(graphBackgroundPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
View Full Code Here

        clearLabel.addMouseListener(onClearLabelClick);
        importLabel.addMouseListener(onImportLabelClick);
        exportLabel.addMouseListener(onExportLabelClick);
        settingsLabel.addMouseListener(onSettingsLabelClick);

        GroupLayout controlPanelLayout = new GroupLayout(controlPanel);
        controlPanel.setLayout(controlPanelLayout);
        controlPanelLayout.setHorizontalGroup(
            controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(controlPanelLayout.createSequentialGroup()
                .addGroup(controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(controlPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addComponent(importLabel)
                            .addComponent(solveLabel)
                            .addComponent(exportLabel)))
                    .addGroup(controlPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(clearLabel))
                    .addGroup(controlPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(settingsLabel)))
                .addContainerGap(19, Short.MAX_VALUE))
        );
        controlPanelLayout.setVerticalGroup(
            controlPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(controlPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(solveLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(importLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(exportLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(clearLabel)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(settingsLabel)
                .addContainerGap(19, Short.MAX_VALUE))
        );

        graphBackgroundPanel.setBorder(BorderFactory.createLineBorder(Color.WHITE));
        //graphBackgroundPanel.setName("graphBackgroundPanel");

        graphDrawPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        //graphDrawPanel.setName("graphDrawPanel");
        graphDrawPanel.setBackground(Color.WHITE);

    graphMouseListener = new GraphMouseListener(graphDrawPanel, controller, null);
        graphDrawPanel.addMouseListener(graphMouseListener);
        graphDrawPanel.addMouseMotionListener(mouseMotionListener);
       
        GroupLayout graphBackgroundPanelLayout = new GroupLayout(graphBackgroundPanel);
        graphBackgroundPanel.setLayout(graphBackgroundPanelLayout);
        graphBackgroundPanelLayout.setHorizontalGroup(
            graphBackgroundPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(GroupLayout.Alignment.TRAILING, graphBackgroundPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(graphDrawPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        graphBackgroundPanelLayout.setVerticalGroup(
            graphBackgroundPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(graphBackgroundPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(graphDrawPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(controlPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(graphBackgroundPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(controlPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addComponent(graphBackgroundPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
View Full Code Here

  }

  public static JPanel makeSimpleForm (final int rows, final int cols, final Component... components)
  {
    final JPanel panel = new JPanel();
    final GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);

    final GroupLayout.SequentialGroup horizontalGroup = layout.createSequentialGroup();
    for (int c = 0; c < cols; c += 1)
    {
      final GroupLayout.ParallelGroup parallelGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
      for (int r = 0; r < rows; r += 1)
      {
        final int index = r * cols + c;
        parallelGroup.addComponent(components[index]);
      }
      horizontalGroup.addGroup(parallelGroup);
    }
    layout.setHorizontalGroup(horizontalGroup);

    final GroupLayout.SequentialGroup verticalGroup = layout.createSequentialGroup();
    for (int r = 0; r < rows; r += 1)
    {
      final GroupLayout.ParallelGroup parallelGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
      for (int c = 0; c < cols; c += 1)
      {
        final int index = r * cols + c;
        parallelGroup.addComponent(components[index]);
      }
      verticalGroup.addGroup(parallelGroup);
    }
    layout.setVerticalGroup(verticalGroup);
    return panel;
  }
View Full Code Here

    }

    private JPanel createExamplesPanel() {
        JPanel examplesPanel = new JPanel();
        examplesPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        GroupLayout layout = new GroupLayout(examplesPanel);
        examplesPanel.setLayout(layout);
        JPanel toyExamplesPanel = createToyExamplesPanel();
        JPanel realExamplesPanel = createRealExamplesPanel();
        JPanel difficultExamplesPanel = createDifficultExamplesPanel();
        layout.setHorizontalGroup(layout.createSequentialGroup()
                .addComponent(toyExamplesPanel)
                .addGap(10)
                .addComponent(realExamplesPanel)
                .addGap(10)
                .addComponent(difficultExamplesPanel));
        layout.setVerticalGroup(layout.createParallelGroup()
                .addComponent(toyExamplesPanel)
                .addComponent(realExamplesPanel)
                .addComponent(difficultExamplesPanel));
        return examplesPanel;
    }
View Full Code Here

        public CloudProcessListDialog() {
            setModal(true);
            setTitle(getComputerLabel());
            JPanel contentPanel = new JPanel();
            GroupLayout layout = new GroupLayout(contentPanel);
            contentPanel.setLayout(layout);
            JPanel headerPanel = createHeaderPanel();
            JPanel assignmentsPanel = createAssignmentsPanel();
            layout.setHorizontalGroup(layout.createParallelGroup()
                    .addComponent(headerPanel).addComponent(assignmentsPanel));
            layout.setVerticalGroup(layout.createSequentialGroup()
                    .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addComponent(assignmentsPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.PREFERRED_SIZE));
            JScrollPane contentScrollPane = new JScrollPane(contentPanel);
View Full Code Here

    private EmployeePanel unassignedPanel;
    private Map<Employee, EmployeePanel> employeeToPanelMap;
    private Map<ShiftAssignment, EmployeePanel> shiftAssignmentToPanelMap;

    public NurseRosteringPanel() {
        GroupLayout layout = new GroupLayout(this);
        setLayout(layout);
        createEmployeeListPanel();
        JPanel headerPanel = createHeaderPanel();
        layout.setHorizontalGroup(layout.createParallelGroup()
                .addComponent(headerPanel).addComponent(employeeListPanel));
        layout.setVerticalGroup(layout.createSequentialGroup()
                .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                        GroupLayout.PREFERRED_SIZE)
                .addComponent(employeeListPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                        GroupLayout.PREFERRED_SIZE));
    }
View Full Code Here

    private MrMachinePanel unassignedPanel;
    private Map<MrMachine, MrMachinePanel> machineToPanelMap;
    private Map<MrProcessAssignment, MrMachinePanel> processAssignmentToPanelMap;

    public MachineReassignmentPanel() {
        GroupLayout layout = new GroupLayout(this);
        setLayout(layout);
        createMachineListPanel();
        JPanel headerPanel = new JPanel();
        layout.setHorizontalGroup(layout.createParallelGroup()
                .addComponent(headerPanel).addComponent(machineListPanel));
        layout.setVerticalGroup(layout.createSequentialGroup()
                .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                        GroupLayout.PREFERRED_SIZE)
                .addComponent(machineListPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                        GroupLayout.PREFERRED_SIZE));
    }
View Full Code Here

TOP

Related Classes of javax.swing.GroupLayout$BaselineGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.