List of usage examples for java.awt BorderLayout EAST
String EAST
To view the source code for java.awt BorderLayout EAST.
Click Source Link
From source file:fsart.diffTools.gui.DiffToolsMainPanel.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it by your code! * * @noinspection ALL//from w ww . j av a2 s . c o m */ private void $$$setupUI$$$() { panel1 = new JPanel(); panel1.setLayout(new BorderLayout(0, 0)); final Spacer spacer1 = new Spacer(); panel1.add(spacer1, BorderLayout.WEST); final Spacer spacer2 = new Spacer(); panel1.add(spacer2, BorderLayout.EAST); final Spacer spacer3 = new Spacer(); panel1.add(spacer3, BorderLayout.SOUTH); final Spacer spacer4 = new Spacer(); panel1.add(spacer4, BorderLayout.NORTH); final JPanel panel2 = new JPanel(); panel2.setLayout(new FormLayout( "left:max(d;4px):noGrow,left:4dlu:noGrow,center:max(d;50px):grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:5dlu:noGrow,fill:max(d;4px):noGrow", "top:d:grow,top:4dlu:noGrow,top:d:noGrow,top:4dlu:noGrow,center:max(d;25px):noGrow,top:6dlu:noGrow,top:max(d;4px):noGrow,top:4dlu:noGrow,top:max(d;25px):noGrow,top:7dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,bottom:d:grow")); panel2.putClientProperty("html.disable", Boolean.FALSE); panel1.add(panel2, BorderLayout.CENTER); final Spacer spacer5 = new Spacer(); CellConstraints cc = new CellConstraints(); panel2.add(spacer5, cc.xy(3, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); browseButton = new JButton(); browseButton.setText("Browse"); panel2.add(browseButton, cc.xy(5, 5)); comparedFileLabel = new JLabel(); comparedFileLabel.setText("Compared file :"); panel2.add(comparedFileLabel, cc.xy(3, 7, CellConstraints.LEFT, CellConstraints.TOP)); browseButton1 = new JButton(); browseButton1.setText("Browse"); panel2.add(browseButton1, cc.xy(5, 9, CellConstraints.DEFAULT, CellConstraints.TOP)); final Spacer spacer6 = new Spacer(); panel2.add(spacer6, cc.xy(3, 13, CellConstraints.DEFAULT, CellConstraints.FILL)); final Spacer spacer7 = new Spacer(); panel2.add(spacer7, cc.xy(1, 9, CellConstraints.FILL, CellConstraints.DEFAULT)); final Spacer spacer8 = new Spacer(); panel2.add(spacer8, cc.xy(7, 7, CellConstraints.FILL, CellConstraints.DEFAULT)); final JPanel panel3 = new JPanel(); panel3.setLayout(new FormLayout("fill:d:grow", "center:d:grow")); panel2.add(panel3, cc.xyw(3, 11, 3, CellConstraints.FILL, CellConstraints.FILL)); compareButton = new JButton(); compareButton.setPreferredSize(new Dimension(100, 29)); compareButton.setText("Compare"); panel3.add(compareButton, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.CENTER)); baseFileLabel = new JLabel(); baseFileLabel.setText("Base file :"); panel2.add(baseFileLabel, cc.xy(3, 3, CellConstraints.FILL, CellConstraints.FILL)); baseFileTxt = new JTextField(); baseFileTxt.setMinimumSize(new Dimension(50, 27)); baseFileTxt.setPreferredSize(new Dimension(50, 27)); panel2.add(baseFileTxt, cc.xy(3, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); comparedFileTxt = new JTextField(); comparedFileTxt.setMinimumSize(new Dimension(50, 27)); comparedFileTxt.setPreferredSize(new Dimension(100, 27)); panel2.add(comparedFileTxt, cc.xy(3, 9, CellConstraints.FILL, CellConstraints.DEFAULT)); outputField = new JTextField(); outputField.setMinimumSize(new Dimension(50, 27)); outputField.setPreferredSize(new Dimension(100, 27)); panel2.add(outputField, cc.xy(3, 15, CellConstraints.FILL, CellConstraints.DEFAULT)); }
From source file:org.eobjects.datacleaner.widgets.result.DateGapAnalyzerResultSwingRenderer.java
@Override public JComponent render(DateGapAnalyzerResult result) { final TaskSeriesCollection dataset = new TaskSeriesCollection(); final Set<String> groupNames = result.getGroupNames(); final TaskSeries completeDurationTaskSeries = new TaskSeries(LABEL_COMPLETE_DURATION); final TaskSeries gapsTaskSeries = new TaskSeries(LABEL_GAPS); final TaskSeries overlapsTaskSeries = new TaskSeries(LABEL_OVERLAPS); for (final String groupName : groupNames) { final String groupDisplayName; if (groupName == null) { if (groupNames.size() == 1) { groupDisplayName = "All"; } else { groupDisplayName = LabelUtils.NULL_LABEL; }//from w w w . j ava 2s . co m } else { groupDisplayName = groupName; } final TimeInterval completeDuration = result.getCompleteDuration(groupName); final Task completeDurationTask = new Task(groupDisplayName, createTimePeriod(completeDuration.getFrom(), completeDuration.getTo())); completeDurationTaskSeries.add(completeDurationTask); // plot gaps { final SortedSet<TimeInterval> gaps = result.getGaps(groupName); int i = 1; Task rootTask = null; for (TimeInterval interval : gaps) { final TimePeriod timePeriod = createTimePeriod(interval.getFrom(), interval.getTo()); if (rootTask == null) { rootTask = new Task(groupDisplayName, timePeriod); gapsTaskSeries.add(rootTask); } else { Task task = new Task(groupDisplayName + " gap" + i, timePeriod); rootTask.addSubtask(task); } i++; } } // plot overlaps { final SortedSet<TimeInterval> overlaps = result.getOverlaps(groupName); int i = 1; Task rootTask = null; for (TimeInterval interval : overlaps) { final TimePeriod timePeriod = createTimePeriod(interval.getFrom(), interval.getTo()); if (rootTask == null) { rootTask = new Task(groupDisplayName, timePeriod); overlapsTaskSeries.add(rootTask); } else { Task task = new Task(groupDisplayName + " overlap" + i, timePeriod); rootTask.addSubtask(task); } i++; } } } dataset.add(overlapsTaskSeries); dataset.add(gapsTaskSeries); dataset.add(completeDurationTaskSeries); final SlidingGanttCategoryDataset slidingDataset = new SlidingGanttCategoryDataset(dataset, 0, GROUPS_VISIBLE); final JFreeChart chart = ChartFactory.createGanttChart( "Date gaps and overlaps in " + result.getFromColumnName() + " / " + result.getToColumnName(), result.getGroupColumnName(), "Time", slidingDataset, true, true, false); ChartUtils.applyStyles(chart); // make sure the 3 timeline types have correct coloring { final CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setDrawingSupplier(new DCDrawingSupplier(WidgetUtils.ADDITIONAL_COLOR_GREEN_BRIGHT, WidgetUtils.ADDITIONAL_COLOR_RED_BRIGHT, WidgetUtils.BG_COLOR_BLUE_BRIGHT)); } final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseMoved(ChartMouseEvent event) { Cursor cursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); ChartEntity entity = event.getEntity(); if (entity instanceof PlotEntity) { cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR); } chartPanel.setCursor(cursor); } @Override public void chartMouseClicked(ChartMouseEvent event) { // do nothing } }); final int visibleLines = Math.min(GROUPS_VISIBLE, groupNames.size()); chartPanel.setPreferredSize(new Dimension(0, visibleLines * 50 + 200)); final JComponent decoratedChartPanel; StringBuilder chartDescription = new StringBuilder(); chartDescription .append("<html><p>The chart displays the recorded timeline based on FROM and TO dates.<br/><br/>"); chartDescription.append( "The <b>red items</b> represent gaps in the timeline and the <b>green items</b> represent points in the timeline where more than one record show activity.<br/><br/>"); chartDescription.append( "You can <b>zoom in</b> by clicking and dragging the area that you want to examine in further detail."); if (groupNames.size() > GROUPS_VISIBLE) { final JScrollBar scroll = new JScrollBar(JScrollBar.VERTICAL); scroll.setMinimum(0); scroll.setMaximum(groupNames.size()); scroll.addAdjustmentListener(new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent e) { int value = e.getAdjustable().getValue(); slidingDataset.setFirstCategoryIndex(value); } }); chartPanel.addMouseWheelListener(new MouseWheelListener() { @Override public void mouseWheelMoved(MouseWheelEvent e) { int scrollType = e.getScrollType(); if (scrollType == MouseWheelEvent.WHEEL_UNIT_SCROLL) { int wheelRotation = e.getWheelRotation(); scroll.setValue(scroll.getValue() + wheelRotation); } } }); final DCPanel outerPanel = new DCPanel(); outerPanel.setLayout(new BorderLayout()); outerPanel.add(chartPanel, BorderLayout.CENTER); outerPanel.add(scroll, BorderLayout.EAST); chartDescription.append("<br/><br/>Use the right <b>scrollbar</b> to scroll up and down on the chart."); decoratedChartPanel = outerPanel; } else { decoratedChartPanel = chartPanel; } chartDescription.append("</p></html>"); final JLabel chartDescriptionLabel = new JLabel(chartDescription.toString()); chartDescriptionLabel.setBorder(new EmptyBorder(4, 10, 4, 10)); final JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); split.add(decoratedChartPanel); split.add(chartDescriptionLabel); split.setDividerLocation(550); return split; }
From source file:org.esa.beam.visat.toolviews.stat.ChartPagePanel.java
protected void createUI(final ChartPanel chartPanel, final JPanel optionsPanel, BindingContext bindingContext) { roiMaskSelector = new RoiMaskSelector(bindingContext); final JPanel extendedOptionsPanel = GridBagUtils.createPanel(); GridBagConstraints extendedOptionsPanelConstraints = GridBagUtils.createConstraints( "insets.left=4,insets.right=2,anchor=NORTHWEST,fill=HORIZONTAL,insets.top=2,weightx=1"); GridBagUtils.addToPanel(extendedOptionsPanel, new JSeparator(), extendedOptionsPanelConstraints, "gridy=0"); GridBagUtils.addToPanel(extendedOptionsPanel, roiMaskSelector.createPanel(), extendedOptionsPanelConstraints, "gridy=1,insets.left=-4"); GridBagUtils.addToPanel(extendedOptionsPanel, optionsPanel, extendedOptionsPanelConstraints, "insets.left=0,insets.right=0,gridy=2,fill=VERTICAL,fill=HORIZONTAL,weighty=1"); GridBagUtils.addToPanel(extendedOptionsPanel, new JSeparator(), extendedOptionsPanelConstraints, "insets.left=4,insets.right=2,gridy=5,anchor=SOUTHWEST"); final JScrollPane optionsScrollPane = new SimpleScrollPane(extendedOptionsPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); optionsScrollPane.setBorder(null);//from ww w . j a v a2 s . c om final JPanel rightPanel = new JPanel(new BorderLayout()); rightPanel.add(createTopPanel(), BorderLayout.NORTH); rightPanel.add(optionsScrollPane, BorderLayout.CENTER); rightPanel.add(createChartBottomPanel(chartPanel), BorderLayout.SOUTH); final ImageIcon collapseIcon = UIUtils.loadImageIcon("icons/PanelRight12.png"); final ImageIcon collapseRolloverIcon = ToolButtonFactory.createRolloverIcon(collapseIcon); final ImageIcon expandIcon = UIUtils.loadImageIcon("icons/PanelLeft12.png"); final ImageIcon expandRolloverIcon = ToolButtonFactory.createRolloverIcon(expandIcon); hideAndShowButton = ToolButtonFactory.createButton(collapseIcon, false); hideAndShowButton.setToolTipText("Collapse Options Panel"); hideAndShowButton.setName("switchToChartButton"); hideAndShowButton.addActionListener(new ActionListener() { public boolean rightPanelShown; @Override public void actionPerformed(ActionEvent e) { rightPanel.setVisible(rightPanelShown); if (rightPanelShown) { hideAndShowButton.setIcon(collapseIcon); hideAndShowButton.setRolloverIcon(collapseRolloverIcon); hideAndShowButton.setToolTipText("Collapse Options Panel"); } else { hideAndShowButton.setIcon(expandIcon); hideAndShowButton.setRolloverIcon(expandRolloverIcon); hideAndShowButton.setToolTipText("Expand Options Panel"); } rightPanelShown = !rightPanelShown; } }); backgroundPanel = new JPanel(new BorderLayout()); backgroundPanel.add(chartPanel, BorderLayout.CENTER); backgroundPanel.add(rightPanel, BorderLayout.EAST); JLayeredPane layeredPane = new JLayeredPane(); layeredPane.add(backgroundPanel, new Integer(0)); layeredPane.add(hideAndShowButton, new Integer(1)); add(layeredPane); }
From source file:com.diversityarrays.kdxplore.curate.MarkerPanelManager.java
public MarkerPanelManager(Trial trial, CurationTableModel curationTableModel, JTable curationTable, TitledTablePanelWithResizeControls curationTablePanel, Transformer<TraitInstance, Color> ticp, CurationTableSelectionModel ctsm) { this.table = curationTable; this.curationTableModel = curationTableModel; this.traitInstanceColorProvider = ticp; this.curationTableSelectionModel = ctsm; traitNameStyle = trial.getTraitNameStyle(); curationTablePanel.scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); markerPanel = new MarkerPanel(curationTablePanel.scrollPane, SwingConstants.VERTICAL); Component corner = curationTablePanel.scrollPane.getCorner(JScrollPane.UPPER_RIGHT_CORNER); if (corner != null) { markerPanel.setHeaderComponent(corner); }/* w w w. j a v a2s.c o m*/ markerPanel.addMarkerMouseClickHandler(mmch); // Initialise the table selection marker Color selfill = curationTable.getSelectionBackground(); tableSelectionMarkerGroup = new TableSelectionMarkerGroup(curationTable, selfill); markerGroups.add(tableSelectionMarkerGroup); markerPanel.addMarkerGroup(tableSelectionMarkerGroup); // Then amend the UI curationTablePanel.add(markerPanel, BorderLayout.EAST); curationTableModel.addPropertyChangeListener(CurationTableModel.PROPERTY_TRAIT_INSTANCES, traitInstancesPropertyChangeListener); curationTableSelectionModel.addChangeListener(selectionChangeListener); }
From source file:com.epiq.bitshark.ui.IVQPanel.java
/** * This was originally generated code,// ww w .j a v a 2 s.c om * so it needs a little cleanup. */ private void initComponents() { topPanel = new javax.swing.JPanel(); headerPanel = new org.jdesktop.swingx.JXPanel(); labelHolderPanel = new javax.swing.JPanel(); chartLabel = new javax.swing.JLabel(); titleLabelLeftSpacer = new javax.swing.JPanel(); topRightPanel = new javax.swing.JPanel(); topRightMainPanel = new javax.swing.JPanel(); rightSpacer = new javax.swing.JPanel(); leftSpacer = new javax.swing.JPanel(); mainPanel = new javax.swing.JPanel(); setLayout(new java.awt.BorderLayout()); topPanel.setPreferredSize(new java.awt.Dimension(0, 30)); topPanel.setLayout(new java.awt.BorderLayout()); headerPanel.setBackground(new java.awt.Color(0, 0, 0)); headerPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(121, 123, 125))); headerPanel.setPreferredSize(new java.awt.Dimension(0, 30)); headerPanel.setLayout(new java.awt.BorderLayout()); labelHolderPanel.setOpaque(false); labelHolderPanel.setLayout(new java.awt.BorderLayout()); chartLabel.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N chartLabel.setForeground(new java.awt.Color(255, 255, 255)); chartLabel.setText("I versus Q"); labelHolderPanel.add(chartLabel, java.awt.BorderLayout.CENTER); titleLabelLeftSpacer.setOpaque(false); titleLabelLeftSpacer.setPreferredSize(new java.awt.Dimension(10, 0)); labelHolderPanel.add(titleLabelLeftSpacer, java.awt.BorderLayout.WEST); headerPanel.add(labelHolderPanel, java.awt.BorderLayout.WEST); topRightPanel.setOpaque(false); topRightPanel.setLayout(new java.awt.BorderLayout()); topRightMainPanel.setOpaque(false); topRightMainPanel.setPreferredSize(new java.awt.Dimension(40, 0)); topRightMainPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 10, 2)); topRightPanel.add(topRightMainPanel, java.awt.BorderLayout.EAST); headerPanel.add(topRightPanel, java.awt.BorderLayout.EAST); topPanel.add(headerPanel, java.awt.BorderLayout.CENTER); rightSpacer.setPreferredSize(new java.awt.Dimension(7, 0)); topPanel.add(rightSpacer, java.awt.BorderLayout.EAST); leftSpacer.setOpaque(false); leftSpacer.setPreferredSize(new java.awt.Dimension(44, 0)); topPanel.add(leftSpacer, java.awt.BorderLayout.WEST); add(topPanel, java.awt.BorderLayout.NORTH); mainPanel.setLayout(new java.awt.BorderLayout()); add(mainPanel, java.awt.BorderLayout.CENTER); }
From source file:com.epiq.bitshark.ui.TimeDomainPanel.java
/** * This was originally generated so it needs to be cleaned up. *//*w w w . j a v a 2 s. c o m*/ private void initComponents() { topPanel = new javax.swing.JPanel(); headerPanel = new org.jdesktop.swingx.JXPanel(); chartLabelHolderPanel = new javax.swing.JPanel(); titleLabel = new javax.swing.JLabel(); titleLabelLeftSpacerPanel = new javax.swing.JPanel(); topRightPanel = new javax.swing.JPanel(); topRightMainPanel = new javax.swing.JPanel(); showICheckBox = new javax.swing.JCheckBox(); showQCheckBox = new javax.swing.JCheckBox(); rightSpacerPanel = new javax.swing.JPanel(); leftSpacerPanel = new javax.swing.JPanel(); mainPanel = new javax.swing.JPanel(); setLayout(new java.awt.BorderLayout()); topPanel.setPreferredSize(new java.awt.Dimension(0, 30)); topPanel.setLayout(new java.awt.BorderLayout()); headerPanel.setBackground(new java.awt.Color(0, 0, 0)); headerPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(121, 123, 125))); headerPanel.setPreferredSize(new java.awt.Dimension(0, 30)); headerPanel.setLayout(new java.awt.BorderLayout()); chartLabelHolderPanel.setOpaque(false); chartLabelHolderPanel.setLayout(new java.awt.BorderLayout()); titleLabel.setFont(new java.awt.Font("Tahoma", 1, 12)); titleLabel.setText("Time Domain"); titleLabel.setForeground(new java.awt.Color(255, 255, 255)); chartLabelHolderPanel.add(titleLabel, java.awt.BorderLayout.CENTER); titleLabelLeftSpacerPanel.setOpaque(false); titleLabelLeftSpacerPanel.setPreferredSize(new java.awt.Dimension(10, 0)); chartLabelHolderPanel.add(titleLabelLeftSpacerPanel, java.awt.BorderLayout.WEST); headerPanel.add(chartLabelHolderPanel, java.awt.BorderLayout.WEST); topRightPanel.setOpaque(false); topRightPanel.setLayout(new java.awt.BorderLayout()); topRightMainPanel.setOpaque(false); topRightMainPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 10, 2)); showICheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); showICheckBox.setForeground(new java.awt.Color(255, 255, 255)); showICheckBox.setSelected(true); showICheckBox.setText("I"); showICheckBox.setOpaque(false); showICheckBox.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { showICheckBoxActionPerformed(evt); } }); topRightMainPanel.add(showICheckBox); showQCheckBox.setFont(new java.awt.Font("Tahoma", 1, 11)); showQCheckBox.setForeground(new java.awt.Color(255, 255, 255)); showQCheckBox.setSelected(true); showQCheckBox.setText("Q"); showQCheckBox.setOpaque(false); showQCheckBox.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { showQCheckBoxActionPerformed(evt); } }); topRightMainPanel.add(showQCheckBox); topRightPanel.add(topRightMainPanel, java.awt.BorderLayout.EAST); headerPanel.add(topRightPanel, java.awt.BorderLayout.EAST); topPanel.add(headerPanel, java.awt.BorderLayout.CENTER); rightSpacerPanel.setPreferredSize(new java.awt.Dimension(0, 0)); topPanel.add(rightSpacerPanel, java.awt.BorderLayout.EAST); leftSpacerPanel.setOpaque(false); leftSpacerPanel.setPreferredSize(new java.awt.Dimension(44, 0)); topPanel.add(leftSpacerPanel, java.awt.BorderLayout.WEST); add(topPanel, java.awt.BorderLayout.NORTH); mainPanel.setLayout(new java.awt.BorderLayout()); add(mainPanel, java.awt.BorderLayout.CENTER); }
From source file:kg.apc.jmeter.vizualizers.SynthesisReportGui.java
/** * Main visualizer setup.// w w w .j a v a 2s . c o m */ private void init() { this.setLayout(new BorderLayout()); // MAIN PANEL JPanel mainPanel = new JPanel(); Border margin = new EmptyBorder(10, 10, 5, 10); mainPanel.setBorder(margin); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(JMeterPluginsUtils.addHelpLinkToPanel(makeTitlePanel(), WIKIPAGE)); // SortFilterModel mySortedModel = // new SortFilterModel(myStatTableModel); JTable myJTable = new JTable(model); myJTable.getTableHeader().setDefaultRenderer(new JMeterHeaderAsPropertyRenderer(COLUMNS_MSG_PARAMETERS)); myJTable.setPreferredScrollableViewportSize(new Dimension(500, 70)); RendererUtils.applyRenderers(myJTable, RENDERERS); JScrollPane myScrollPane = new JScrollPane(myJTable); this.add(mainPanel, BorderLayout.NORTH); this.add(myScrollPane, BorderLayout.CENTER); saveTable.addActionListener(this); JPanel opts = new JPanel(); opts.add(useGroupName, BorderLayout.WEST); opts.add(saveTable, BorderLayout.CENTER); opts.add(saveHeaders, BorderLayout.EAST); this.add(opts, BorderLayout.SOUTH); }
From source file:edu.clemson.cs.nestbed.client.gui.TestbedManagerFrame.java
private final JPanel buildTestbedPanel() throws RemoteException { JPanel testbedPanel = new JPanel(new BorderLayout()); testbedPanel.setBorder(new TitledBorder("Physical Deployments")); // --- left-side ------------------------------------------------- JPanel sidePanel = new JPanel(new BorderLayout()); sidePanel.setPreferredSize(new Dimension(WINDOW_WIDTH / 3, SIZE_IGNORED)); testbedList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); testbedList.setListData(testbedManager.getTestbedList().toArray()); testbedList.addListSelectionListener(new TestbedListSelectionListener()); sidePanel.add(new JScrollPane(testbedList), BorderLayout.CENTER); testbedPanel.add(sidePanel, BorderLayout.WEST); // --- right-side ------------------------------------------------ sidePanel = new JPanel(new BorderLayout()); sidePanel.setPreferredSize(new Dimension(310, SIZE_IGNORED)); JPanel rsTopPanel = new JPanel(new BorderLayout()); rsTopPanel.setPreferredSize(new Dimension(SIZE_IGNORED, 50)); JPanel labelPanel = new JPanel(new GridLayout(2, 1, 0, 5)); labelPanel.add(new JLabel("Name: ")); labelPanel.add(new JLabel("Description: ")); JPanel infoPanel = new JPanel(new GridLayout(2, 1, 0, 5)); infoPanel.add(testbedName);// w w w . j a v a2 s . c o m testbedName.setEditable(false); infoPanel.add(testbedDescription); testbedDescription.setEditable(false); rsTopPanel.add(labelPanel, BorderLayout.WEST); rsTopPanel.add(infoPanel, BorderLayout.CENTER); sidePanel.add(rsTopPanel, BorderLayout.NORTH); testbedPanel.add(sidePanel, BorderLayout.EAST); return testbedPanel; }
From source file:marytts.tools.voiceimport.DatabaseImportMain.java
/** * Run the selected components in a different thread. * *//*from w ww . ja va 2 s .c o m*/ protected void runSelectedComponents() { new Thread("RunSelectedComponentsThread") { public void run() { try { runButton.setEnabled(false); for (int i = 0; i < components.length; i++) { if (checkboxes[i].isSelected()) { boolean success = false; Container parent = checkboxes[i].getParent(); final JProgressBar progress = new JProgressBar(); final VoiceImportComponent oneComponent = components[i]; if (oneComponent.getProgress() != -1) { progress.setStringPainted(true); new Thread("ProgressThread") { public void run() { int percent = 0; while (progress.isVisible()) { progress.setValue(percent); try { Thread.sleep(500); } catch (InterruptedException ie) { } percent = oneComponent.getProgress(); } } }.start(); } else { progress.setIndeterminate(true); } parent.add(progress, BorderLayout.EAST); progress.setVisible(true); parent.validate(); try { success = oneComponent.compute(); } catch (Exception exc) { checkboxes[i].setBackground(Color.RED); throw new Exception("The component " + checkboxes[i].getText() + " produced the following exception: ", exc); } finally { checkboxes[i].setSelected(false); progress.setVisible(false); } if (success) { checkboxes[i].setBackground(Color.GREEN); } else { checkboxes[i].setBackground(Color.RED); } } } } catch (Throwable e) { e.printStackTrace(); } finally { runButton.setEnabled(true); } } }.start(); }
From source file:mulavito.gui.components.GraphPanel.java
protected void setCorner(JComponent cmp) { if (corner != null) south.remove(corner);/*from www .jav a 2 s . c o m*/ corner = cmp; if (cmp != null) { corner.setPreferredSize(new Dimension(verticalScrollBar.getPreferredSize().width, horizontalScrollBar.getPreferredSize().height)); south.add(this.corner, BorderLayout.EAST); } }