Example usage for java.awt BorderLayout EAST

List of usage examples for java.awt BorderLayout EAST

Introduction

In this page you can find the example usage for java.awt BorderLayout EAST.

Prototype

String EAST

To view the source code for java.awt BorderLayout EAST.

Click Source Link

Document

The east layout constraint (right side of container).

Usage

From source file:mulavito.gui.components.GraphPanel.java

protected GraphPanel() {
    super(new BorderLayout());
    layout = new MyGridLayout(1, 1);

    contentPane = new JPanel();
    add(contentPane);//from w w  w  . jav a  2  s .c  o m
    contentPane.setLayout(layout);

    vvs = new LinkedList<LV>();

    verticalScrollBar = new JScrollBar(JScrollBar.VERTICAL);
    verticalScrollBar.setValues(0, 0, 0, 0);
    add(verticalScrollBar, BorderLayout.EAST);

    horizontalScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
    horizontalScrollBar.setValues(0, 0, 0, 0);

    south = new JPanel(new BorderLayout());
    south.add(horizontalScrollBar);
    add(south, BorderLayout.SOUTH);
    setCorner(new SatelliteMultiViewerCorner());

    // for layer stack
    stackListener = new ChangeListener() {
        @SuppressWarnings("unchecked")
        @Override
        public void stateChanged(ChangeEvent e) {
            // handle layer change
            if (e instanceof LayerChangedEvent<?>) {
                LayerChangedEvent<L> lce = (LayerChangedEvent<L>) e;
                if (lce.remove) {
                    if (lce.g != null)// remove layer
                        removeLayer(getViewer(lce.g));
                    else
                        // clear layers
                        while (vvs.size() > 0)
                            removeLayer(vvs.get(0));
                } else if (lce.g != null) // add layer
                    addLayer(lce.g);

                javax.swing.SwingUtilities.invokeLater(new Runnable() {
                    // To ensure correct behavior when several layers are
                    // added at the same time, we slightly delay these
                    // calls.
                    @Override
                    public void run() {
                        configureScrollBars();
                        configureSpinner();
                        arrangeViewers();
                        autoZoomToFit();
                    }
                });
            }
            // else removed vertices

            updateUI();
        }
    };
    // configure contexts
    contexts = new LinkedList<ViewerContext<L, LV>>();
    //
    addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            arrangeViewers();
            autoZoomToFit();
        }
    });
}

From source file:com.hazelcast.simulator.visualiser.ui.Chart.java

public Chart(Model model, AccuracyRadioButtons accuracyRadioButtons,
        AutoScaleRadioButtons autoScaleRadioButtons, ProbesCheckboxes probesCheckboxes) {
    this.model = model;
    this.accuracyRadioButtons = accuracyRadioButtons;
    this.autoScaleRadioButtons = autoScaleRadioButtons;
    this.probesCheckboxes = probesCheckboxes;

    setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    setLayout(new BorderLayout());

    initSliders();/*from w w  w  .  j  a v  a2  s . c o  m*/

    JPanel horizontalSlidersPanel = new JPanel();
    horizontalSlidersPanel.setLayout(new BoxLayout(horizontalSlidersPanel, BoxLayout.Y_AXIS));
    horizontalSlidersPanel.add(mainHorizontalSlider);
    horizontalSlidersPanel.add(fineHorizontalSlider);

    JFreeChart chart = ChartFactory.createHistogram("Latency Distribution", "Latency (s)", "Operations", null,
            PlotOrientation.VERTICAL, true, true, true);

    plot = chart.getXYPlot();
    plot.setForegroundAlpha(ALPHA);

    ChartPanel chartPanel = new ChartPanel(null);
    chartPanel.setChart(chart);

    add(horizontalSlidersPanel, BorderLayout.SOUTH);
    add(verticalSlider, BorderLayout.EAST);
    add(chartPanel, BorderLayout.CENTER);

    initSliderChangeListener();
}

From source file:lu.lippmann.cdb.datasetview.tabs.WeightedMapOfDecisionTreesTabView.java

/**
 * Constructor./*w  ww .ja  v a 2s .co  m*/
 */
public WeightedMapOfDecisionTreesTabView(final EventPublisher eventPublisher,
        final CommandDispatcher commandDispatcher, final ApplicationContext applicationContext) {
    super();

    this.applicationContext = applicationContext;
    this.commandDispatcher = commandDispatcher;
    this.eventPublisher = eventPublisher;

    final double defaultValueConfidenceFactor = DecisionTreeHelper.HIGH_CONFIDENCE_FACTOR;
    this.dtFactory = new J48DecisionTreeFactory(defaultValueConfidenceFactor, false);
    this.panel = new JXPanel();
    this.panel.setLayout(new BorderLayout());

    this.slider = new JSlider();
    this.slider.setBorder(new TitledBorder("Confidence factor"));
    this.slider.setOpaque(false);
    this.slider.setMaximum((int) (defaultValueConfidenceFactor * 100));
    this.slider.setValue((int) (defaultValueConfidenceFactor * 100));
    this.slider.setMinimum(1);
    this.slider.setMinorTickSpacing(1);
    this.slider.setMajorTickSpacing(10);
    this.slider.setPaintTicks(true);
    this.slider.setPaintLabels(true);
    this.panel.add(this.slider, BorderLayout.SOUTH);

    this.attrSelectionCombo = new JComboBox();
    this.attrSelectionCombo.setBorder(new TitledBorder("Attribute used to split"));

    final JXPanel cmdPanel = new JXPanel();
    cmdPanel.setLayout(new BorderLayout());
    cmdPanel.add(this.attrSelectionCombo, BorderLayout.CENTER);
    this.withWeightCheckBox = new JCheckBox("Weighted");
    this.withWeightCheckBox.setBorder(new TitledBorder("With weight"));
    cmdPanel.add(this.withWeightCheckBox, BorderLayout.EAST);
    this.panel.add(cmdPanel, BorderLayout.NORTH);
}

From source file:org.ecoinformatics.seek.ecogrid.RegistrySearchDialog.java

/**
 * Construct of this dialog//from ww  w .  ja v  a2s.c o m
 * 
 * @param parent
 *            Frame
 * @param title
 *            String
 */
public RegistrySearchDialog(EcogridPreferencesTab parent, String title, Vector originalServiceList) {
    this.parent = parent;
    this.originalServiceList = originalServiceList;
    this.setLocation(parent.getLocation());
    setSize(new Dimension(WIDTH, HEIGHT));
    initMainPanel();
    getContentPane().add(Box.createVerticalStrut(EcogridPreferencesTab.MARGINGSIZE), BorderLayout.NORTH);
    getContentPane().add(Box.createHorizontalStrut(EcogridPreferencesTab.MARGINGSIZE), BorderLayout.EAST);
    getContentPane().add(mainPanel, BorderLayout.CENTER);
    getContentPane().add(Box.createVerticalStrut(EcogridPreferencesTab.MARGINGSIZE), BorderLayout.SOUTH);
    getContentPane().add(Box.createHorizontalStrut(EcogridPreferencesTab.MARGINGSIZE), BorderLayout.WEST);
    setVisible(true);
}

From source file:net.femtoparsec.jwhois.gui.JWhoIsQueryGUI.java

public JWhoIsQueryGUI(JWhoIsGUIModel<?> model) {
    Validate.notNull(model, "model");
    this.model = model;
    this.model.addSourceResultListener(this);
    this.resourceBundle = Utf8ResourceBundle.getBundle("JWhoIsQueryGUI");

    this.setLayout(new BorderLayout());

    this.queryField = new JTextField();
    queryField.setActionCommand(QUERY_FIELD_ACTION_NAME);
    queryField.addActionListener(this);
    queryField.addKeyListener(this);
    queryField.setPreferredSize(new Dimension(300, queryField.getHeight()));

    this.queryButton = new JButton(resourceBundle.getString("query.button.label"));
    queryButton.setActionCommand(QUERY_BUTTON_ACTION_NAME);
    queryButton.addActionListener(this);

    final String labelLabel = resourceBundle.getString("query.label.label");
    this.add(new JLabel(labelLabel), BorderLayout.WEST);
    this.add(this.queryField, BorderLayout.CENTER);
    this.add(this.queryButton, BorderLayout.EAST);

    this.queryField.setText(this.model.getQuery());
    this.updateButtonState();
}

From source file:fi.smaa.jsmaa.gui.SMAATRIGUIFactory.java

@Override
protected JToolBar buildBottomToolBar() {
    JToolBar tb = super.buildBottomToolBar();
    tb.add(new LambdaPanel(smaaModel), BorderLayout.EAST);
    return tb;//from   w  w  w.ja va 2 s.  c o m
}

From source file:de.unidue.inf.is.ezdl.gframedl.components.checkboxlist.CheckBoxListCellRenderer.java

private void initialize() {
    panel = new JPanel();
    panel.setLayout(new BorderLayout());

    choicePanel = new JPanel(new BorderLayout());

    choice = new JCheckBox();

    choicePanel.add(choice, BorderLayout.CENTER);
    choicePanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    choicePanel.setPreferredSize(new Dimension(150, 48));

    description = new JTextArea();
    description.setOpaque(true);/*from  w  w w. ja  va  2  s.  c  o  m*/
    description.setEditable(false);
    description.setLineWrap(true);
    description.setWrapStyleWord(true);

    description.setSize(400, 30);
    description.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    iconLabel = new JLabel();
    iconLabel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

    choicePanel.add(iconLabel, BorderLayout.EAST);

    panel.add(choicePanel, BorderLayout.WEST);
    panel.add(description, BorderLayout.CENTER);

    panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    panel.revalidate();
    panel.repaint();
}

From source file:org.openconcerto.map.ui.ITextComboVilleViewer.java

public ITextComboVilleViewer() {
    this.setOpaque(false);
    this.setLayout(new BorderLayout());

    this.supp = new ValueChangeSupport<String>(this);
    this.emptyHelper = new EmptyObjectHelper(this, new Predicate() {
        public boolean evaluate(final Object object) {
            // object: le getUncheckedValue()
            return ITextComboVilleViewer.this.getValue() == null
                    || ITextComboVilleViewer.this.getValue().trim().length() == 0;
        }/*from ww  w .  j ava2 s. c o  m*/
    });
    this.text.addValueListener(new PropertyChangeListener() {
        public void propertyChange(final PropertyChangeEvent evt) {
            ITextComboVilleViewer.this.supp.fireValueChange();
        }
    });

    this.cache = new ITextComboCacheVille();
    this.text.initCache(this.cache);
    this.add(this.text, BorderLayout.CENTER);

    this.add(this.button, BorderLayout.EAST);
    this.button.addActionListener(new ActionListener() {

        public void actionPerformed(final ActionEvent e) {
            final JFrame f = new JFrame();
            final MapViewerPanel mapViewerPanel = new MapViewerPanel(true);

            f.setContentPane(mapViewerPanel);
            f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            f.setSize(600, 500);
            f.setMinimumSize(new Dimension(600, 500));
            final File conf = new File(System.getProperty("user.home"),
                    ".java" + File.separator + "ilm" + File.separator + "map" + File.separator);
            new WindowStateManager(f, new File(conf, "Configuration" + File.separator + "MapFrame.properties"),
                    true).loadState();
            f.setVisible(true);
            if (ITextComboVilleViewer.this.currentVille != null) {
                final long x = ITextComboVilleViewer.this.currentVille.getXLambert();
                final long y = ITextComboVilleViewer.this.currentVille.getYLambert();
                f.setTitle(ITextComboVilleViewer.this.currentVille.getName());
                mapViewerPanel.getVilleRendererPanel().centerScreenXYLambert(x, y);
                mapViewerPanel.getVilleRendererPanel().setHighlight(ITextComboVilleViewer.this.currentVille);
                mapViewerPanel.getVilleRendererPanel().setAlwayVisible(ITextComboVilleViewer.this.currentVille);
            }
        }
    });
    this.text.getDocument().addDocumentListener(new DocumentListener() {

        public void changedUpdate(final DocumentEvent e) {
            ITextComboVilleViewer.this.currentVille = Ville
                    .getVilleFromVilleEtCode(ITextComboVilleViewer.this.text.getValue());
            ITextComboVilleViewer.this.button.setEnabled(
                    ITextComboVilleViewer.this.currentVille != null && ITextComboVilleViewer.this.isEnabled());

        }

        public void insertUpdate(final DocumentEvent e) {
            this.changedUpdate(e);
        }

        public void removeUpdate(final DocumentEvent e) {
            this.changedUpdate(e);
        }
    });
    final JPopupMenu popupMenu = new JPopupMenu();
    // FIXME ajouter la possibilit de supprimer une ville prcdemment enregistre
    final JMenuItem menuItem = new JMenuItem("Enregistrer cette ville");
    menuItem.addActionListener(new ActionListener() {

        public void actionPerformed(final ActionEvent e) {
            final String t = ITextComboVilleViewer.this.text.getTextComp().getText();
            ITextComboVilleViewer.this.cache.addToCache(t);
            final Ville createVilleFrom = ITextComboVilleViewer.this.cache.createVilleFrom(t);
            if (createVilleFrom != null) {
                final String villeEtCode = createVilleFrom.getVilleEtCode();
                ITextComboVilleViewer.this.setValue(villeEtCode);
                ITextComboVilleViewer.this.firePropertyChange("value", null, villeEtCode);
            }
        }
    });
    popupMenu.add(menuItem);

    this.text.getTextComp().addMouseListener(new PopupMouseListener(popupMenu));

}

From source file:net.sf.mzmine.modules.visualization.spectra.SpectraVisualizerWindow.java

public SpectraVisualizerWindow(RawDataFile dataFile) {

    super(dataFile.getName());
    this.dataFile = dataFile;

    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    setBackground(Color.white);/*from w  w w . ja  v a  2 s.  c  om*/

    spectrumPlot = new SpectraPlot(this);
    add(spectrumPlot, BorderLayout.CENTER);

    toolBar = new SpectraToolBar(this);
    add(toolBar, BorderLayout.EAST);

    // Create relationship between the current Plot and Tool bar
    // spectrumPlot.setRelatedToolBar(toolBar);

    bottomPanel = new SpectraBottomPanel(this, dataFile);
    add(bottomPanel, BorderLayout.SOUTH);

    MZmineCore.getDesktop().addPeakListTreeListener(bottomPanel);

    pack();

}

From source file:guineu.modules.visualization.intensityplot.IntensityPlotFrame.java

public IntensityPlotFrame(ParameterSet parameters) {
    super("", true, true, true, true);

    String title = "Intensity plot [" + GuineuCore.getDesktop().getSelectedDataFiles()[0].getDatasetName()
            + "]";
    String xAxisLabel = parameters.getParameter(IntensityPlotParameters.xAxisValueSource).getValue().toString();

    // create dataset
    dataset = new IntensityPlotDataset(parameters);

    // create new JFreeChart
    logger.finest("Creating new chart instance");

    chart = ChartFactory.createLineChart(title, xAxisLabel, "Height", dataset, PlotOrientation.VERTICAL, true,
            true, false);/*from  w  ww.  j a v  a  2 s  . c o m*/

    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    // set renderer
    StatisticalLineAndShapeRenderer renderer = new StatisticalLineAndShapeRenderer(false, true);
    renderer.setBaseStroke(new BasicStroke(2));
    plot.setRenderer(renderer);
    plot.setBackgroundPaint(Color.white);

    // set tooltip generator
    CategoryToolTipGenerator toolTipGenerator = new IntensityPlotTooltipGenerator();
    renderer.setBaseToolTipGenerator(toolTipGenerator);

    CategoryAxis xAxis = (CategoryAxis) plot.getDomainAxis();
    xAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);

    chart.setBackgroundPaint(Color.white);

    // create chart JPanel
    ChartPanel chartPanel = new ChartPanel(chart);
    add(chartPanel, BorderLayout.CENTER);

    IntensityPlotToolBar toolBar = new IntensityPlotToolBar(this);
    add(toolBar, BorderLayout.EAST);

    // disable maximum size (we don't want scaling)
    chartPanel.setMaximumDrawWidth(Integer.MAX_VALUE);
    chartPanel.setMaximumDrawHeight(Integer.MAX_VALUE);

    // set title properties
    TextTitle chartTitle = chart.getTitle();
    chartTitle.setMargin(5, 0, 0, 0);
    chartTitle.setFont(titleFont);

    LegendTitle legend = chart.getLegend();
    legend.setItemFont(legendFont);
    legend.setBorder(0, 0, 0, 0);

    Plot dplot = chart.getPlot();

    // set shape provider
    IntensityPlotDrawingSupplier shapeSupplier = new IntensityPlotDrawingSupplier();
    dplot.setDrawingSupplier(shapeSupplier);

    // set y axis properties
    NumberAxis yAxis;

    yAxis = (NumberAxis) ((CategoryPlot) dplot).getRangeAxis();

    NumberFormat yAxisFormat = new DecimalFormat("0.0E0");
    yAxis.setNumberFormatOverride(yAxisFormat);

    setTitle(title);
    setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
    setBackground(Color.white);
    pack();

}