Example usage for java.awt FlowLayout LEFT

List of usage examples for java.awt FlowLayout LEFT

Introduction

In this page you can find the example usage for java.awt FlowLayout LEFT.

Prototype

int LEFT

To view the source code for java.awt FlowLayout LEFT.

Click Source Link

Document

This value indicates that each row of components should be left-justified.

Usage

From source file:com.peterbochs.instrument.InstrumentPanel.java

private JPanel getJPanel2() {
    if (jPanel2 == null) {
        jPanel2 = new JPanel();
        FlowLayout jPanel2Layout = new FlowLayout();
        jPanel2Layout.setAlignment(FlowLayout.LEFT);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2.add(getJLabel10());/* w  ww.  j  a  v  a2  s.  c  om*/
        jPanel2.add(getJNoOfLineComboBox());
        jPanel2.add(getJGroupCheckBox());
    }
    return jPanel2;
}

From source file:de.bwravencl.controllerbuddy.gui.Main.java

private void updateOverlayAlignment(final Rectangle maxWindowBounds) {
    final var inLowerHalf = overlayFrame.getY() + overlayFrame.getHeight() / 2 < maxWindowBounds.height / 2;

    overlayFrame.remove(labelCurrentMode);
    overlayFrame.add(labelCurrentMode, inLowerHalf ? BorderLayout.PAGE_START : BorderLayout.PAGE_END);

    var alignment = SwingConstants.RIGHT;
    var flowLayoutAlignment = FlowLayout.RIGHT;
    if (overlayFrame.getX() + overlayFrame.getWidth() / 2 < maxWindowBounds.width / 2) {
        alignment = SwingConstants.LEFT;
        flowLayoutAlignment = FlowLayout.LEFT;
    }/*  ww w .j ava  2s .co  m*/

    labelCurrentMode.setHorizontalAlignment(alignment);

    indicatorPanelFlowLayout.setAlignment(flowLayoutAlignment);
    indicatorPanel.invalidate();

    overlayFrame.setBackground(TRANSPARENT);
    overlayFrame.pack();
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Create the assertions panel// w  w w  . ja  v a  2  s .  co  m
 * 
 * @return The assertions JPanel
 */
private JPanel setupAssertionsPanel() {
    JPanel assertionPanel;
    JPanel gridPanel;
    JPanel flowPanel;

    assertionPanel = new JPanel();
    assertionPanel.setLayout(new BorderLayout());

    // Top of panel will allow for configuration of
    // inferencing environment
    gridPanel = new JPanel();
    gridPanel.setLayout(new GridLayout(0, 3));

    // First Row

    // Create Model Button
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(runInferencing);
    gridPanel.add(flowPanel);

    // Model/Reasoner Choice
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(new JLabel("Model/Reasoning:"));
    flowPanel.add(reasoningLevel);
    gridPanel.add(flowPanel);

    // Number of asserted triples
    flowPanel = new JPanel();
    flowPanel.setLayout(new GridLayout(1, 1));
    flowPanel.add(assertedTripleCount);
    flowPanel.setBorder(BorderFactory.createTitledBorder("Asserted Triples"));
    gridPanel.add(flowPanel);

    // Second Row

    // Empty cell
    gridPanel.add(new JLabel());

    // Language drop-down
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(new JLabel("Language:"));
    flowPanel.add(language);
    gridPanel.add(flowPanel);

    // Number of inferred triples
    flowPanel = new JPanel();
    flowPanel.setLayout(new GridLayout(1, 1));
    flowPanel.add(inferredTripleCount);
    flowPanel.setBorder(BorderFactory.createTitledBorder("Inferred Triples"));
    gridPanel.add(flowPanel);

    assertionPanel.add(gridPanel, BorderLayout.NORTH);

    gridPanel = new JPanel();
    gridPanel.setLayout(new GridLayout(1, 1));
    gridPanel.setBorder(BorderFactory.createTitledBorder("Assertions"));
    gridPanel.add(new JScrollPane(assertionsInput));
    assertionPanel.add(gridPanel, BorderLayout.CENTER);

    return assertionPanel;
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Setup the SPARQL panel/*from   w  w w . j  av a2 s . c  o m*/
 * 
 * @return The SPARQL JPanel
 */
private JPanel setupSparqlPanel() {
    JPanel sparqlPanel;
    JPanel labelPanel;
    JPanel gridPanel;
    JPanel innerGridPanel;
    JPanel flowPanel;
    JPanel queryPanel;
    JPanel resultsPanel;
    JPanel controlGrid;

    sparqlPanel = new JPanel();
    sparqlPanel.setLayout(new BorderLayout());

    // Controls
    labelPanel = new JPanel();
    labelPanel.setLayout(new BorderLayout());
    gridPanel = new JPanel();
    gridPanel.setLayout(new GridLayout(0, 1));

    innerGridPanel = new JPanel();
    innerGridPanel.setLayout(new GridLayout(1, 3));
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(runSparql);
    innerGridPanel.add(flowPanel);
    innerGridPanel.add(sparqlServerInfo);
    innerGridPanel.add(proxyInfo);
    gridPanel.add(innerGridPanel);

    innerGridPanel = new JPanel();
    innerGridPanel.setLayout(new GridLayout(1, 2));
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(new JLabel("Service: "));
    flowPanel.add(sparqlServiceUrl);
    innerGridPanel.add(flowPanel);
    controlGrid = new JPanel();
    controlGrid.setLayout(new GridLayout(1, 2));
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(new JLabel("User Id:"));
    flowPanel.add(sparqlServiceUserId);
    controlGrid.add(flowPanel);
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(new JLabel("Password:"));
    flowPanel.add(sparqlServicePassword);
    controlGrid.add(flowPanel);
    innerGridPanel.add(controlGrid);
    gridPanel.add(innerGridPanel);

    innerGridPanel = new JPanel();
    innerGridPanel.setLayout(new GridLayout(1, 2));
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(new JLabel("Default Graph URI: "));
    flowPanel.add(defaultGraphUri);
    innerGridPanel.add(flowPanel);
    flowPanel = new JPanel();
    flowPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(previousQuery);
    flowPanel.add(nextQuery);
    innerGridPanel.add(flowPanel);
    gridPanel.add(innerGridPanel);

    sparqlPanel.add(gridPanel, BorderLayout.NORTH);

    // SPARQL query
    queryPanel = new JPanel();
    queryPanel.setLayout(new GridLayout(1, 1));
    queryPanel.setBorder(BorderFactory.createTitledBorder("Query"));
    queryPanel.add(new JScrollPane(sparqlInput));

    // SPARQL results
    resultsPanel = new JPanel();
    resultsPanel.setLayout(new GridLayout(1, 1));
    resultsPanel.setBorder(BorderFactory.createTitledBorder("Results"));
    resultsPanel.add(new JScrollPane(sparqlResultsTable));

    // Query and Results Split Pane
    sparqlQueryAndResults = new JSplitPane(JSplitPane.VERTICAL_SPLIT, queryPanel, resultsPanel);

    sparqlQueryAndResults.setDividerLocation(DEFAULT_SPARQL_QUERY_AND_RESULTS_DIVIDER_LOCATION);
    sparqlQueryAndResults.setOneTouchExpandable(true);

    sparqlPanel.add(sparqlQueryAndResults, BorderLayout.CENTER);

    return sparqlPanel;
}

From source file:gov.llnl.lustre.lwatch.PlotFrame2.java

/**
 * Build the GUI.//from w w  w.  ja v a2  s .  c  o  m
 *
 * @param container container in which GUI will be built.
 */

void buildUI(Container container) {
    container.setLayout(new BorderLayout());

    plotPanel = new JPanel();
    ppgbl = new GridBagLayout();
    plotPanel.setLayout(ppgbl);
    plotPanel.setBackground(Color.black);

    chartContainerPane = new ChartContainerPanel(this);
    plotPanel.add(chartContainerPane);

    ppc = new GridBagConstraints();
    ppc.gridx = 0;
    ppc.gridy = 0;
    ppc.insets = new Insets(2, 2, 0, 2); //(8, 4, 0, 5);
    ppc.anchor = GridBagConstraints.NORTH;
    ppc.fill = GridBagConstraints.BOTH;
    ppc.weightx = 1.0; //1.0;
    ppc.weighty = .75; //0.0;
    ppgbl.setConstraints(chartContainerPane, ppc);

    // Add panel for the overview data and pan & zoom control
    wideView = new OverView(); //(this);
    plotPanel.add(wideView);

    ppc = new GridBagConstraints();
    ppc.gridx = 0;
    ppc.gridy = 1;

    // Insets are Top, Left, Bottom, Right
    ppc.insets = new Insets(0, 76, 10, 18); //(8, 4, 0, 5);
    ppc.anchor = GridBagConstraints.NORTH;
    ppc.fill = GridBagConstraints.BOTH;
    ppc.weightx = 1.0;
    ppc.weighty = 0.25; //0.15;  //1.0;
    ppgbl.setConstraints(wideView, ppc);
    //

    container.add(plotPanel, BorderLayout.CENTER);

    scPane = new StatControlPanel();

    //controls = new ControlPanel();

    JPanel idAndHideControlPanel = new JPanel();
    FlowLayout iaccLayout = new FlowLayout(FlowLayout.LEFT);
    idAndHideControlPanel.setLayout(iaccLayout);

    if (rawData != null)
        label = new JLabel(
                "Panel dimension : " + chartContainerPane.getWidth() + " X " + chartContainerPane.getHeight());

    else
        label = new JLabel("Error: accessing raw data from \"timehist.dat\"");

    idLabel = new JLabel(fsName + " (" + type + ") Time History Plot");
    idAndHideControlPanel.add(idLabel);

    cpHideButt = new JButton("Hide Controls");
    cpHideButt.setFont(new Font("helvetica", Font.BOLD, 10));
    cpHideButt.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String buttonLabel = e.getActionCommand();
            //System.out.println(buttonLabel + " button pressed.");

            if (buttonLabel.indexOf("Hide") < 0) {
                showControls();
                cpHideButt.setText("Hide Controls");
            } else if (buttonLabel.indexOf("Show") < 0) {
                hideControls();
                cpHideButt.setText("Show Controls");
            }

            //catPanel.selectAll();
        }
    });
    idAndHideControlPanel.add(cpHideButt);

    ovpHideButt = new JButton("Hide Overview Plot");
    ovpHideButt.setFont(new Font("helvetica", Font.BOLD, 10));
    ovpHideButt.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String buttonLabel = e.getActionCommand();
            //System.out.println(buttonLabel + " button pressed.");

            if (buttonLabel.indexOf("Hide") < 0) {
                showOverviewPlot();
                ovpHideButt.setText("Hide  Overview Plot");
            } else if (buttonLabel.indexOf("Show") < 0) {
                hideOverviewPlot();
                ovpHideButt.setText("Show  Overview Plot");
            }
            //catPanel.selectAll();
        }
    });
    idAndHideControlPanel.add(ovpHideButt);

    container.add(scPane, BorderLayout.SOUTH);
    //container.add(idLabel, BorderLayout.NORTH);
    container.add(idAndHideControlPanel, BorderLayout.NORTH);

    //ra.setAlignmentX(java.awt.Component.LEFT_ALIGNMENT);
    chartContainerPane.setAlignmentX(java.awt.Component.LEFT_ALIGNMENT);
    label.setAlignmentX(java.awt.Component.LEFT_ALIGNMENT); // Unecessary, but won't hurt.

    updateControlValues();
    //this.thpFrame.pack();
    //this.thpFrame.setVisible(true);

    //  Added timer start in case HEARTBEAT came thru as prefs granularity.
    if (granularity == HEARTBEAT) {
        //setRefresh(refreshRate, 3600000);

        refreshPlotFrame();
    }

}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Setup the status panel//w w w.  j a v  a  2s .co m
 * 
 * @return The status JPanel
 */
private JPanel setupStatusPanel() {
    JPanel statusPanel;

    statusPanel = new JPanel();
    statusPanel.setLayout(new GridLayout(1, 1));
    statusPanel
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.black), "Status"));
    statusPanel.add(makeFlowPanel(status, FlowLayout.LEFT));

    return statusPanel;
}

From source file:com.peterbochs.instrument.InstrumentPanel.java

private JPanel getJPanel5() {
    if (jPanel5 == null) {
        jPanel5 = new JPanel();
        FlowLayout jPanel5Layout = new FlowLayout();
        jPanel5Layout.setAlignment(FlowLayout.LEFT);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5.add(getJAddCallGraphButton());
        jPanel5.add(getJDeleteButton());
    }//from   w w  w  . j  a  va  2  s  . c o  m
    return jPanel5;
}

From source file:com.peterbochs.instrument.InstrumentPanel.java

private JPanel getJPanel13() {
    if (jPanel13 == null) {
        jPanel13 = new JPanel();
        FlowLayout jPanel13Layout = new FlowLayout();
        jPanel13Layout.setAlignment(FlowLayout.LEFT);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13.add(getJLabel13());/*from w  w w.j  a va2  s  .co  m*/
        jPanel13.add(getJTimeframeComboBox());
        jPanel13.add(getJLabel14());
        jPanel13.add(getJSpeedComboBox());
        jPanel13.add(getJLabel15());
        jPanel13.add(getJChartBackgroundComboBox());
        jPanel13.add(getJLabel16());
        jPanel13.add(getJChartGirdColorComboBox());
        jPanel13.add(getJClearInterruptButton());
    }
    return jPanel13;
}

From source file:com.peterbochs.instrument.InstrumentPanel.java

private JPanel getJPanel15() {
    if (jPanel15 == null) {
        jPanel15 = new JPanel();
        FlowLayout jPanel15Layout = new FlowLayout();
        jPanel15Layout.setAlignment(FlowLayout.LEFT);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15.add(getJInvisible3dChartButton());
    }//from  ww w  . j a v  a 2  s  .c  o  m
    return jPanel15;
}

From source file:lcmc.gui.resources.ServiceInfo.java

/** Returns existing service manu item. */
private MyMenu getExistingServiceMenuItem(final String name, final boolean enableForNew,
        final boolean testOnly) {
    final ServiceInfo thisClass = this;
    return new MyMenu(name, new AccessMode(ConfigData.AccessType.ADMIN, false),
            new AccessMode(ConfigData.AccessType.OP, false)) {
        private static final long serialVersionUID = 1L;
        private final Lock mUpdateLock = new ReentrantLock();

        @Override/*from w w  w  . ja  v  a2s . c o  m*/
        public String enablePredicate() {
            if (getBrowser().clStatusFailed()) {
                return ClusterBrowser.UNKNOWN_CLUSTER_STATUS_STRING;
            } else if (getService().isRemoved()) {
                return IS_BEING_REMOVED_STRING;
            } else if (getService().isOrphaned()) {
                return IS_ORPHANED_STRING;
            } else if (!enableForNew && getService().isNew()) {
                return IS_NEW_STRING;
            }
            if (getBrowser().getExistingServiceList(thisClass).size() == 0) {
                return "&lt;&lt;empty;&gt;&gt;";
            }
            return null;
        }

        @Override
        public void update() {
            final Thread t = new Thread(new Runnable() {
                @Override
                public void run() {
                    if (mUpdateLock.tryLock()) {
                        try {
                            updateThread();
                        } finally {
                            mUpdateLock.unlock();
                        }
                    }
                }
            });
            t.start();
        }

        private void updateThread() {
            final JCheckBox colocationWi = new JCheckBox("Colo", true);
            final JCheckBox orderWi = new JCheckBox("Order", true);
            colocationWi.setBackground(ClusterBrowser.STATUS_BACKGROUND);
            colocationWi.setPreferredSize(colocationWi.getMinimumSize());
            orderWi.setBackground(ClusterBrowser.STATUS_BACKGROUND);
            orderWi.setPreferredSize(orderWi.getMinimumSize());
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    setEnabled(false);
                }
            });
            Tools.invokeAndWait(new Runnable() {
                @Override
                public void run() {
                    removeAll();
                }
            });

            final MyListModel<MyMenuItem> dlm = new MyListModel<MyMenuItem>();
            final Map<MyMenuItem, ButtonCallback> callbackHash = new HashMap<MyMenuItem, ButtonCallback>();
            final MyList<MyMenuItem> list = new MyList<MyMenuItem>(dlm, getBackground());

            final List<JDialog> popups = new ArrayList<JDialog>();
            for (final ServiceInfo asi : getBrowser().getExistingServiceList(thisClass)) {
                if (asi.isConstraintPH() && isConstraintPH()) {
                    continue;
                }
                if (asi.getCloneInfo() != null || asi.getGroupInfo() != null) {
                    /* skip services that are clones or in groups. */
                    continue;
                }
                addExistingServiceMenuItem(asi.toString(), asi, dlm, callbackHash, list, colocationWi, orderWi,
                        popups, testOnly);
                asi.addExistingGroupServiceMenuItems(thisClass, dlm, callbackHash, list, colocationWi, orderWi,
                        popups, testOnly);
            }
            final JPanel colOrdPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            colOrdPanel.setBackground(ClusterBrowser.STATUS_BACKGROUND);
            colOrdPanel.add(colocationWi);
            colOrdPanel.add(orderWi);
            final MyMenu thisM = this;
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    @Override
                    public void run() {
                        final boolean ret = Tools.getScrollingMenu(name, colOrdPanel, thisM, dlm, list,
                                thisClass, popups, callbackHash);
                        if (!ret) {
                            setEnabled(false);
                        }
                    }
                });
            } catch (final InterruptedException ix) {
                Thread.currentThread().interrupt();
            } catch (final InvocationTargetException x) {
                Tools.printStackTrace();
            }
            super.update();
        }
    };
}