Example usage for javax.swing BoxLayout X_AXIS

List of usage examples for javax.swing BoxLayout X_AXIS

Introduction

In this page you can find the example usage for javax.swing BoxLayout X_AXIS.

Prototype

int X_AXIS

To view the source code for javax.swing BoxLayout X_AXIS.

Click Source Link

Document

Specifies that components should be laid out left to right.

Usage

From source file:org.openmicroscopy.shoola.agents.imviewer.util.proj.ProjSavingDialog.java

/**
 * Builds the controls.//w w  w.  j  ava2 s  . c o m
 * 
 * @return See above.
 */
private JPanel buildControls() {
    JPanel p = new JPanel();
    p.setBorder(new TitledBorder(""));
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    p.add(selectionPane);
    p.add(Box.createHorizontalStrut(5));
    p.add(newFolderButton);
    return p;
}

From source file:org.openmicroscopy.shoola.agents.imviewer.view.ImViewerUI.java

/**
 * Displays the plane information.//from   w  ww  .  j  a v  a  2s .  c  o m
 * 
 */
void setPlaneInfoStatus() {
    if (model.getTabbedIndex() == ImViewer.PROJECTION_INDEX) {
        statusBar.setCenterStatus(new JLabel());
        return;
    }
    List<Integer> indexes = model.getActiveChannels();
    if (CollectionUtils.isEmpty(indexes)) {
        statusBar.setCenterStatus(new JLabel());
        return;
    }

    int z = model.getDefaultZ();
    int t = model.getRealSelectedT();
    PlaneInfo info;
    String s, toolTipText;
    Map<Integer, Color> colors = model.getChannelsColorMap();
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
    Map<String, Object> details;
    List<String> tips;
    PlaneInfoComponent comp;

    List<ChannelData> metadata = model.getChannelData();
    Iterator<ChannelData> c = metadata.iterator();
    int index;
    List<String> notSet;
    while (c.hasNext()) {
        index = c.next().getIndex();
        s = "";
        toolTipText = "";
        tips = new ArrayList<String>();
        info = model.getPlane(z, index, t);
        comp = planes.get(index);
        if (info != null) {
            details = EditorUtil.transformPlaneInfo(info);
            notSet = (List<String>) details.get(EditorUtil.NOT_SET);
            comp.setColor(colors.get(index));
            if (!notSet.contains(EditorUtil.DELTA_T)) {
                s += EditorUtil.formatTimeInSeconds((Double) details.get(EditorUtil.DELTA_T));
            }
            if (!notSet.contains(EditorUtil.EXPOSURE_TIME)) {
                toolTipText += EditorUtil.EXPOSURE_TIME + ": ";
                toolTipText += details.get(EditorUtil.EXPOSURE_TIME);
                toolTipText += EditorUtil.TIME_UNIT;
                tips.add(toolTipText);
            }
            toolTipText = "";
            toolTipText += "Stage coordinates: ";
            if (!notSet.contains(EditorUtil.POSITION_X))
                toolTipText += "x=" + details.get(EditorUtil.POSITION_X) + " ";
            if (!notSet.contains(EditorUtil.POSITION_Y))
                toolTipText += "y=" + details.get(EditorUtil.POSITION_Y) + " ";
            if (!notSet.contains(EditorUtil.POSITION_Z))
                toolTipText += "z=" + details.get(EditorUtil.POSITION_Z);
            tips.add(toolTipText);
            comp.setToolTipText(UIUtilities.formatToolTipText(tips));
            if (StringUtils.isEmpty(s))
                s = "0s";
            comp.setText(s);
            panel.add(comp);
        }
    }
    statusBar.setCenterStatus(panel);
}

From source file:org.openmicroscopy.shoola.agents.measurement.view.GraphPane.java

/** Builds and lays out the UI. */
private void buildGUI() {
    buildHistogramNoSelection();/* w  ww  .  j ava 2s. c  om*/
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    JPanel centrePanel = new JPanel();
    centrePanel.setLayout(new BoxLayout(centrePanel, BoxLayout.X_AXIS));

    centrePanel.add(zSlider);
    centrePanel.add(Box.createHorizontalStrut(5));
    centrePanel.add(mainPanel);
    centrePanel.add(export);
    add(centrePanel);
    add(tSlider);
}

From source file:org.openmicroscopy.shoola.agents.measurement.view.IntensityView.java

/** Builds and lays out the UI. */
private void buildGUI() {
    JPanel scrollPanel = new JPanel();
    JPanel containerPanel = new JPanel();
    containerPanel.setLayout(new BoxLayout(containerPanel, BoxLayout.X_AXIS));
    JPanel tPanel = tablePanel();
    containerPanel.add(zSlider);//from   w  w w.j a  v a  2s.  c  o m
    containerPanel.add(tPanel);
    JPanel cPanel = new JPanel();
    cPanel.setLayout(new BoxLayout(cPanel, BoxLayout.Y_AXIS));
    cPanel.add(containerPanel);
    cPanel.add(tSlider);
    JPanel buttonPanel = createButtonPanel();

    scrollPanel.setLayout(new BoxLayout(scrollPanel, BoxLayout.X_AXIS));
    scrollPanel.add(cPanel);
    scrollPanel.add(buttonPanel);
    scrollPanel.add(Box.createGlue());

    this.setLayout(new BorderLayout());
    this.add(scrollPanel, BorderLayout.CENTER);
    intensityDialog = new IntensityValuesDialog(view, tableModel, channelSelection);
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.AnnotationDataUI.java

/**
 * Creates a row.//from   www  .  j a va  2  s .  co m
 * 
 * @return See above.
 */
private JPanel initRow() {
    JPanel p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    p.setBackground(UIUtilities.BACKGROUND_COLOR);
    return p;
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.OriginalMetadataComponent.java

/** Initializes the components. */
private void initComponents() {
    IconManager icons = IconManager.getInstance();
    Icon icon = icons.getIcon(IconManager.DOWNLOAD);
    downloadButton = new JButton(icon);
    downloadButton.setBackground(UIUtilities.BACKGROUND_COLOR);
    downloadButton.setOpaque(false);//from   w  ww.j  a va  2 s . co  m
    UIUtilities.unifiedButtonLookAndFeel(downloadButton);
    downloadButton.setToolTipText("Download the metadata file.");
    downloadButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent evt) {
            download();
        }
    });
    toolBar = buildToolBar();
    toolBar.setBackground(UIUtilities.BACKGROUND_COLOR);
    JXBusyLabel label = new JXBusyLabel(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
    label.setBackground(UIUtilities.BACKGROUND_COLOR);
    label.setBusy(true);
    JPanel p = new JPanel();
    p.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    p.add(label);
    p.add(Box.createHorizontalStrut(5));
    JLabel l = new JLabel("Loading metadata");
    l.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.add(l);
    statusBar = UIUtilities.buildComponentPanel(p);
    statusBar.setBackground(UIUtilities.BACKGROUND_COLOR);
    setBackground(UIUtilities.BACKGROUND_COLOR);
    setLayout(new BorderLayout(0, 0));
    add(statusBar, BorderLayout.NORTH);
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.PropertiesUI.java

/**
 * Builds the properties component.//from   w w  w.j a va  2 s. c  o m
 * 
 * @return See above.
 */
private JPanel buildProperties() {
    Object refObject = model.getRefObject();
    JPanel p = new JPanel();
    p.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    p.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));

    JPanel idPanel = new JPanel();
    idPanel.setLayout(new BoxLayout(idPanel, BoxLayout.X_AXIS));
    idPanel.setBackground(UIUtilities.BACKGROUND_COLOR);
    JPanel l = UIUtilities.buildComponentPanel(idLabel, 0, 0);
    l.setBackground(UIUtilities.BACKGROUND_COLOR);
    idPanel.add(l);
    idPanel.add(Box.createHorizontalGlue());
    idPanel.add(inplaceIcon);
    p.add(idPanel);

    l = UIUtilities.buildComponentPanel(ownerLabel, 0, 0);
    l.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.add(l);
    int w = editName.getIcon().getIconWidth() + 4;
    l = UIUtilities.buildComponentPanel(gpLabel, 0, 0);
    l.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.add(layoutEditablefield(Box.createHorizontalStrut(w), l));
    l = UIUtilities.buildComponentPanel(parentLabel, 0, 0);
    l.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.add(layoutEditablefield(Box.createHorizontalStrut(w), l));
    l = UIUtilities.buildComponentPanel(wellLabel, 0, 0);
    l.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.add(layoutEditablefield(Box.createHorizontalStrut(w), l));

    namePanel = layoutEditablefield(editName, namePane);
    p.add(namePanel);
    p.add(Box.createVerticalStrut(5));

    if (refObject instanceof ImageData || refObject instanceof DatasetData || refObject instanceof ProjectData
            || refObject instanceof TagAnnotationData || refObject instanceof WellSampleData
            || refObject instanceof PlateData || refObject instanceof ScreenData
            || refObject instanceof PlateAcquisitionData) {

        descriptionScrollPane = new JScrollPane(descriptionWiki);
        descriptionScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        descriptionScrollPane.setBorder(AnnotationUI.EDIT_BORDER);
        Dimension viewportSize = new Dimension(WIDTH, HEIGHT);
        descriptionScrollPane.getViewport().setPreferredSize(viewportSize);

        double[][] design = new double[][] { { TableLayout.PREFERRED, TableLayout.FILL },
                { TableLayout.PREFERRED } };

        TableLayout table = new TableLayout(design);
        descriptionPanel = new JPanel(table);
        descriptionPanel.setBackground(UIUtilities.BACKGROUND_COLOR);
        descriptionPanel.add(descriptionButtonEdit, "0, 0, c, t");
        descriptionPanel.add(descriptionScrollPane, "1, 0");

        p.add(descriptionPanel);
        p.add(Box.createVerticalStrut(5));
    }
    return p;
}

From source file:org.openmicroscopy.shoola.agents.metadata.editor.ToolBar.java

/** Builds and lays out the UI. */
private void buildGUI() {
    JPanel bars = new JPanel();
    bars.setBackground(UIUtilities.BACKGROUND_COLOR);
    bars.setLayout(new BoxLayout(bars, BoxLayout.X_AXIS));
    bars.add(buildGeneralBar());/*w  ww. j  a  v  a 2 s . c  om*/
    JPanel p = new JPanel();
    p.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    JPanel pp = UIUtilities.buildComponentPanel(bars);
    pp.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.add(pp);
    pp = UIUtilities.buildComponentPanelRight(busyLabel);
    pp.setBackground(UIUtilities.BACKGROUND_COLOR);
    p.add(pp);
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    setBackground(UIUtilities.BACKGROUND_COLOR);
    add(p);
    add(new JSeparator());
}

From source file:org.openmicroscopy.shoola.agents.treeviewer.browser.BrowserUI.java

/**
 * Builds the tool bar./*  ww w .  j  ava 2  s  .com*/
 * 
 * @return See above.
 */
private JPanel buildToolBar() {
    JPanel bar = new JPanel();
    bar.setLayout(new BoxLayout(bar, BoxLayout.X_AXIS));
    bar.setBorder(null);
    JPanel p = new JPanel();
    p.setLayout(new FlowLayout(FlowLayout.LEFT));
    p.setBorder(null);
    p.add(leftMenuBar);
    p.setPreferredSize(leftMenuBar.getPreferredSize());
    bar.add(p);
    p = new JPanel();
    p.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    p.setBorder(null);
    p.add(rightMenuBar);
    p.setPreferredSize(rightMenuBar.getPreferredSize());
    bar.add(p);
    return bar;
}

From source file:org.openmicroscopy.shoola.agents.treeviewer.util.MoveGroupSelectionDialog.java

/** 
 * Builds and lays out the buttons./*  w w  w  .  jav a 2 s  . c  o m*/
 * 
 * @return See above.
 */
private JPanel buildToolBar() {
    JPanel bar = new JPanel();
    bar.add(moveButton);
    bar.add(Box.createRigidArea(UIUtilities.H_SPACER_SIZE));
    bar.add(cancelButton);
    bar.add(Box.createRigidArea(UIUtilities.H_SPACER_SIZE));
    JPanel barLeft = new JPanel();
    barLeft.add(createButton);

    JPanel row = new JPanel();
    row.setLayout(new BoxLayout(row, BoxLayout.X_AXIS));

    row.add(UIUtilities.buildComponentPanel(barLeft));
    row.add(UIUtilities.buildComponentPanelRight(bar));
    return row;
}