List of usage examples for javax.swing BoxLayout Y_AXIS
int Y_AXIS
To view the source code for javax.swing BoxLayout Y_AXIS.
Click Source Link
From source file:org.apache.jmeter.protocol.http.control.gui.WebServiceSamplerGui.java
/** * init() adds soapAction to the mainPanel. The class reuses logic from * SOAPSampler, since it is common./*from w w w . ja v a 2s.c om*/ */ private void init() { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); // MAIN PANEL JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(createTopPanel(), BorderLayout.NORTH); mainPanel.add(createMessagePanel(), BorderLayout.CENTER); mainPanel.add(createBottomPanel(), BorderLayout.SOUTH); this.add(mainPanel); }
From source file:org.apache.jmeter.protocol.http.control.gui.WebServiceSamplerGui.java
private final JPanel createTopPanel() { JPanel topPanel = new JPanel(); topPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH)); JPanel wsdlHelper = new JPanel(); wsdlHelper.setLayout(new BoxLayout(wsdlHelper, BoxLayout.Y_AXIS)); wsdlHelper.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("webservice_configuration_wizard"))); // $NON-NLS-1$ // Button for browsing webservice wsdl JPanel wsdlEntry = new JPanel(); wsdlEntry.setLayout(new BoxLayout(wsdlEntry, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(0, 5, 0, 5); wsdlEntry.setBorder(margin);/*from w w w . j a v a 2 s . co m*/ wsdlHelper.add(wsdlEntry); wsdlEntry.add(wsdlField); wsdlEntry.add(wsdlButton); wsdlButton.addActionListener(this); // Web Methods JPanel listPanel = new JPanel(); listPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); JLabel selectLabel = new JLabel(JMeterUtils.getResString("webservice_methods")); // $NON-NLS-1$ wsdlMethods = new JLabeledChoice(); wsdlHelper.add(listPanel); listPanel.add(selectLabel); listPanel.add(wsdlMethods); listPanel.add(selectButton); selectButton.addActionListener(this); topPanel.add(wsdlHelper); JPanel urlPane = new JPanel(); urlPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); urlPane.add(protocol); urlPane.add(Box.createRigidArea(new Dimension(5, 0))); urlPane.add(domain); urlPane.add(Box.createRigidArea(new Dimension(5, 0))); urlPane.add(port); urlPane.add(Box.createRigidArea(new Dimension(5, 0))); urlPane.add(connectTimeout); topPanel.add(urlPane); topPanel.add(createParametersPanel()); return topPanel; }
From source file:org.apache.jmeter.protocol.http.control.gui.WebServiceSamplerGui.java
private final JPanel createMessagePanel() { JPanel msgPanel = new JPanel(); msgPanel.setLayout(new BorderLayout(5, 0)); msgPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("webservice_message_soap"))); // $NON-NLS-1$ JPanel soapXmlPane = new JPanel(); soapXmlPane.setLayout(new BorderLayout(5, 0)); soapXmlPane.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("soap_data_title"))); // $NON-NLS-1$ soapXmlPane.setPreferredSize(new Dimension(4, 4)); // Permit dynamic resize of TextArea soapXml = new JTextArea(); soapXml.setLineWrap(true);//from w w w.ja v a 2 s . c om soapXml.setWrapStyleWord(true); soapXml.setTabSize(4); // improve xml display soapXmlPane.add(new JScrollPane(soapXml), BorderLayout.CENTER); msgPanel.add(soapXmlPane, BorderLayout.CENTER); JPanel southPane = new JPanel(); southPane.setLayout(new BoxLayout(southPane, BoxLayout.Y_AXIS)); southPane.add(soapXmlFile); JPanel randomXmlPane = new JPanel(); randomXmlPane.setLayout(new BorderLayout(5, 0)); randomXmlPane.setBorder( BorderFactory.createTitledBorder(JMeterUtils.getResString("webservice_get_xml_from_random_title"))); // $NON-NLS-1$ randomXmlPane.add(randomXmlFile, BorderLayout.CENTER); southPane.add(randomXmlPane); msgPanel.add(southPane, BorderLayout.SOUTH); return msgPanel; }
From source file:org.apache.jmeter.visualizers.RespTimeGraphVisualizer.java
/** * Initialize the GUI./*w ww.ja v a 2s . com*/ */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) this.setLayout(new BorderLayout()); // MAIN PANEL JPanel mainPanel = new JPanel(); Border margin = new EmptyBorder(10, 10, 5, 10); Border margin2 = new EmptyBorder(10, 10, 5, 10); mainPanel.setBorder(margin); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(makeTitlePanel()); JPanel settingsPane = new VerticalPanel(); settingsPane.setBorder(margin2); graphPanel = new RespTimeGraphChart(); graphPanel.setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGTH)); settingsPane.add(createGraphActionsPane()); settingsPane.add(createGraphSettingsPane()); settingsPane.add(createGraphTitlePane()); settingsPane.add(createLinePane()); settingsPane.add(createGraphDimensionPane()); JPanel axisPane = new JPanel(new BorderLayout()); axisPane.add(createGraphXAxisPane(), BorderLayout.WEST); axisPane.add(createGraphYAxisPane(), BorderLayout.CENTER); settingsPane.add(axisPane); settingsPane.add(createLegendPane()); tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_settings"), settingsPane); //$NON-NLS-1$ tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_graph"), graphPanel); //$NON-NLS-1$ // If clic on the Graph tab, make the graph (without apply interval or filter) ChangeListener changeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent changeEvent) { JTabbedPane srcTab = (JTabbedPane) changeEvent.getSource(); int index = srcTab.getSelectedIndex(); if (srcTab.getTitleAt(index).equals(JMeterUtils.getResString("aggregate_graph_tab_graph"))) { //$NON-NLS-1$ actionMakeGraph(); } } }; tabbedGraph.addChangeListener(changeListener); this.add(mainPanel, BorderLayout.NORTH); this.add(tabbedGraph, BorderLayout.CENTER); }
From source file:org.apache.jmeter.visualizers.StatGraphVisualizer.java
/** * Main visualizer setup./*from ww w. j a v a 2s . c om*/ */ private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final) this.setLayout(new BorderLayout()); // MAIN PANEL JPanel mainPanel = new JPanel(); Border margin = new EmptyBorder(10, 10, 5, 10); Border margin2 = new EmptyBorder(10, 10, 5, 10); mainPanel.setBorder(margin); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.add(makeTitlePanel()); myJTable = new JTable(model); JMeterUtils.applyHiDPI(myJTable); // Fix centering of titles myJTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer(COLUMNS_MSG_PARAMETERS)); myJTable.setPreferredScrollableViewportSize(new Dimension(500, 70)); RendererUtils.applyRenderers(myJTable, RENDERERS); myScrollPane = new JScrollPane(myJTable); settingsPane = new VerticalPanel(); settingsPane.setBorder(margin2); graphPanel = new AxisGraph(); graphPanel.setPreferredSize(new Dimension(defaultWidth, defaultHeight)); settingsPane.add(createGraphActionsPane()); settingsPane.add(createGraphColumnPane()); settingsPane.add(createGraphTitlePane()); settingsPane.add(createGraphDimensionPane()); JPanel axisPane = new JPanel(new BorderLayout()); axisPane.add(createGraphXAxisPane(), BorderLayout.WEST); axisPane.add(createGraphYAxisPane(), BorderLayout.CENTER); settingsPane.add(axisPane); settingsPane.add(createLegendPane()); tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_settings"), settingsPane); //$NON-NLS-1$ tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_graph"), graphPanel); //$NON-NLS-1$ // If clic on the Graph tab, make the graph (without apply interval or filter) ChangeListener changeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent changeEvent) { JTabbedPane srcTab = (JTabbedPane) changeEvent.getSource(); int index = srcTab.getSelectedIndex(); if (srcTab.getTitleAt(index).equals(JMeterUtils.getResString("aggregate_graph_tab_graph"))) { //$NON-NLS-1$ actionMakeGraph(); } } }; tabbedGraph.addChangeListener(changeListener); spane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); spane.setLeftComponent(myScrollPane); spane.setRightComponent(tabbedGraph); spane.setResizeWeight(.2); spane.setBorder(null); // see bug jdk 4131528 spane.setContinuousLayout(true); this.add(mainPanel, BorderLayout.NORTH); this.add(spane, BorderLayout.CENTER); }
From source file:org.apache.oodt.cas.workflow.gui.perspective.view.impl.DefaultPropView.java
@Override public void refreshView(final ViewState state) { this.removeAll(); tableMenu = new JPopupMenu("TableMenu"); this.add(tableMenu); override = new JMenuItem(OVERRIDE); override.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int row = DefaultPropView.this.table.getSelectedRow();// rowAtPoint(DefaultPropView.this.table.getMousePosition()); String key = getKey((String) DefaultPropView.this.table.getValueAt(row, 1), state); Metadata staticMet = state.getSelected().getModel().getStaticMetadata(); if (staticMet == null) { staticMet = new Metadata(); }//w ww.j a va 2s . co m if (e.getActionCommand().equals(OVERRIDE)) { if (!staticMet.containsKey(key)) { staticMet.addMetadata(key, (String) DefaultPropView.this.table.getValueAt(row, 2)); String envReplace = (String) DefaultPropView.this.table.getValueAt(row, 3); if (Boolean.valueOf(envReplace)) { staticMet.addMetadata(key + "/envReplace", envReplace); } state.getSelected().getModel().setStaticMetadata(staticMet); DefaultPropView.this.notifyListeners(); } } } }); delete = new JMenuItem(DELETE); delete.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int row = DefaultPropView.this.table.getSelectedRow();// rowAtPoint(DefaultPropView.this.table.getMousePosition()); String key = getKey((String) DefaultPropView.this.table.getValueAt(row, 1), state); Metadata staticMet = state.getSelected().getModel().getStaticMetadata(); if (staticMet == null) { staticMet = new Metadata(); } staticMet.removeMetadata(key); staticMet.removeMetadata(key + "/envReplace"); state.getSelected().getModel().setStaticMetadata(staticMet); DefaultPropView.this.notifyListeners(); } }); tableMenu.add(override); tableMenu.add(delete); if (state.getSelected() != null) { JPanel masterPanel = new JPanel(); masterPanel.setLayout(new BoxLayout(masterPanel, BoxLayout.Y_AXIS)); masterPanel.add(this.getModelIdPanel(state.getSelected(), state)); masterPanel.add(this.getModelNamePanel(state.getSelected(), state)); if (!state.getSelected().getModel().isParentType()) { masterPanel.add(this.getInstanceClassPanel(state.getSelected(), state)); } masterPanel.add(this.getExecutionTypePanel(state.getSelected(), state)); masterPanel.add(this.getPriorityPanel(state)); masterPanel.add(this.getExecusedIds(state.getSelected())); if (state.getSelected().getModel().getExecutionType().equals("condition")) { masterPanel.add(this.getTimeout(state.getSelected(), state)); masterPanel.add(this.getOptional(state.getSelected(), state)); } JScrollPane scrollPane = new JScrollPane(table = this.createTable(state), JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.getHorizontalScrollBar().setUnitIncrement(10); scrollPane.getVerticalScrollBar().setUnitIncrement(10); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.setBorder(new EtchedBorder()); final JLabel metLabel = new JLabel("Static Metadata"); metLabel.setAlignmentX(Component.CENTER_ALIGNMENT); final JLabel extendsLabel = new JLabel("<extends>"); extendsLabel.setFont(new Font("Serif", Font.PLAIN, 10)); extendsLabel.setAlignmentX(Component.CENTER_ALIGNMENT); extendsLabel.addMouseListener(new MouseListener() { private JScrollPane availableScroller; private JScrollPane mineScroller; private JList mineList; private JList availableList; private DefaultListModel mineModel; private DefaultListModel availableModel; public void mouseClicked(MouseEvent e) { final JPopupMenu popup = new JPopupMenu(); popup.setLayout(new BorderLayout()); JPanel main = new JPanel(); main.setLayout(new BoxLayout(main, BoxLayout.X_AXIS)); JPanel mine = new JPanel(); mine.setBorder(new EtchedBorder()); mine.setLayout(new BorderLayout()); JLabel mineLabel = new JLabel("Mine"); mineScroller = new JScrollPane(mineList = createJList(mineModel = new DefaultListModel(), state.getSelected().getModel().getExtendsConfig())); mineScroller.setPreferredSize(new Dimension(250, 80)); mine.add(mineLabel, BorderLayout.NORTH); mine.add(mineScroller, BorderLayout.CENTER); JPanel available = new JPanel(); available.setBorder(new EtchedBorder()); available.setLayout(new BorderLayout()); JLabel availableLabel = new JLabel("Available"); Vector<String> availableGroups = new Vector<String>(state.getGlobalConfigGroups().keySet()); availableGroups.removeAll(state.getSelected().getModel().getExtendsConfig()); availableScroller = new JScrollPane(availableList = this .createJList(availableModel = new DefaultListModel(), availableGroups)); availableScroller.setPreferredSize(new Dimension(250, 80)); available.add(availableLabel, BorderLayout.NORTH); available.add(availableScroller, BorderLayout.CENTER); JPanel buttons = new JPanel(); buttons.setLayout(new BoxLayout(buttons, BoxLayout.Y_AXIS)); JButton addButton = new JButton("<---"); addButton.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { String selected = availableList.getSelectedValue().toString(); Vector<String> extendsConfig = new Vector<String>( state.getSelected().getModel().getExtendsConfig()); extendsConfig.add(selected); state.getSelected().getModel().setExtendsConfig(extendsConfig); availableModel.remove(availableList.getSelectedIndex()); mineModel.addElement(selected); popup.revalidate(); DefaultPropView.this.notifyListeners(); } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } }); JButton removeButton = new JButton("--->"); removeButton.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { String selected = mineList.getSelectedValue().toString(); Vector<String> extendsConfig = new Vector<String>( state.getSelected().getModel().getExtendsConfig()); extendsConfig.remove(selected); state.getSelected().getModel().setExtendsConfig(extendsConfig); mineModel.remove(mineList.getSelectedIndex()); availableModel.addElement(selected); popup.revalidate(); DefaultPropView.this.notifyListeners(); } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } }); buttons.add(addButton); buttons.add(removeButton); main.add(mine); main.add(buttons); main.add(available); popup.add(main, BorderLayout.CENTER); popup.show(extendsLabel, e.getX(), e.getY()); } public void mouseEntered(MouseEvent e) { extendsLabel.setForeground(Color.blue); } public void mouseExited(MouseEvent e) { extendsLabel.setForeground(Color.black); } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } private JList createJList(DefaultListModel model, final List<String> list) { for (String value : list) { model.addElement(value); } JList jList = new JList(model); jList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); jList.setLayoutOrientation(JList.VERTICAL); return jList; } }); JLabel metGroupLabel = new JLabel("(Sub-Group: " + (state.getCurrentMetGroup() != null ? state.getCurrentMetGroup() : "<base>") + ")"); metGroupLabel.setAlignmentX(Component.CENTER_ALIGNMENT); JPanel labelPanel = new JPanel(); labelPanel.setLayout(new BoxLayout(labelPanel, BoxLayout.Y_AXIS)); JPanel top = new JPanel(); top.setLayout(new BoxLayout(top, BoxLayout.Y_AXIS)); top.add(extendsLabel); top.add(metLabel); labelPanel.add(top); labelPanel.add(metGroupLabel); panel.add(labelPanel, BorderLayout.NORTH); panel.add(scrollPane, BorderLayout.CENTER); masterPanel.add(panel); this.add(masterPanel); } else { this.add(new JPanel()); } this.revalidate(); }
From source file:org.apache.uima.tools.docanalyzer.DBAnnotationViewerDialog.java
/** * Create an AnnotationViewer Dialog//from w w w. j a va 2 s . c om * * @param aParentFrame * frame containing this panel * @param aTitle * title to display for the dialog * @param aInputDir * directory containing input files (in XCAS foramt) to read * @param aStyleMapFile * filename of style map to be used to view files in HTML * @param aPerformanceStats * string representaiton of performance statistics, optional. * @param aTypeSystem * the CAS Type System to which the XCAS files must conform. * @param aTypesToDisplay * array of types that should be highlighted in the viewer. This can be set to the output * types of the Analysis Engine. A value of null means to display all types. */ /*public DBAnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, DBPrefsMediator med, File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem, final String[] aTypesToDisplay, String interactiveTempFN, boolean javaViewerRBisSelected, boolean javaViewerUCRBisSelected, boolean xmlRBisSelected, CAS cas) { super(aParentFrame, aDialogTitle); // create the AnnotationViewGenerator (for HTML view generation) this.med1 = med; this.cas = cas; annotationViewGenerator = new AnnotationViewGenerator(tempDir); launchThatViewer(med.getOutputDir(), interactiveTempFN, aTypeSystem, aTypesToDisplay, javaViewerRBisSelected, javaViewerUCRBisSelected, xmlRBisSelected, aStyleMapFile, tempDir); }*/ public DBAnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, DBPrefsMediator med, File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem, final String[] aTypesToDisplay, boolean generatedStyleMap, CAS cas) { super(aParentFrame, aDialogTitle); this.xmiDAO = med.getXmiDAO(); this.med1 = med; this.cas = cas; styleMapFile = aStyleMapFile; final String performanceStats = aPerformanceStats; typeSystem = aTypeSystem; typesToDisplay = aTypesToDisplay; // create the AnnotationViewGenerator (for HTML view generation) annotationViewGenerator = new AnnotationViewGenerator(tempDir); // create StyleMapEditor dialog styleMapEditor = new StyleMapEditor(aParentFrame, cas); JPanel resultsTitlePanel = new JPanel(); resultsTitlePanel.setLayout(new BoxLayout(resultsTitlePanel, BoxLayout.Y_AXIS)); resultsTitlePanel.add(new JLabel("These are the Analyzed Documents.")); resultsTitlePanel.add(new JLabel("Select viewer type and double-click file to open.")); try { String[] documents = this.xmiDAO.getXMIList(); analyzedResultsList = new JList(documents); } catch (DAOException e) { displayError(e.getMessage()); } /* * File[] documents = dir.listFiles(); Vector docVector = new Vector(); for (int i = 0; i < * documents.length; i++) { if (documents[i].isFile()) { docVector.add(documents[i].getName()); } } * final JList analyzedResultsList = new JList(docVector); */ JScrollPane scrollPane = new JScrollPane(); scrollPane.getViewport().add(analyzedResultsList, null); JPanel southernPanel = new JPanel(); southernPanel.setLayout(new BoxLayout(southernPanel, BoxLayout.Y_AXIS)); JPanel controlsPanel = new JPanel(); controlsPanel.setLayout(new SpringLayout()); Caption displayFormatLabel = new Caption("Results Display Format:"); controlsPanel.add(displayFormatLabel); JPanel displayFormatPanel = new JPanel(); displayFormatPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); displayFormatPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); javaViewerRB = new JRadioButton("Java Viewer"); javaViewerUCRB = new JRadioButton("JV user colors"); htmlRB = new JRadioButton("HTML"); xmlRB = new JRadioButton("XML"); ButtonGroup displayFormatButtonGroup = new ButtonGroup(); displayFormatButtonGroup.add(javaViewerRB); displayFormatButtonGroup.add(javaViewerUCRB); displayFormatButtonGroup.add(htmlRB); displayFormatButtonGroup.add(xmlRB); // select the appropraite viewer button according to user's prefs javaViewerRB.setSelected(true); // default, overriden below if ("Java Viewer".equals(med.getViewType())) { javaViewerRB.setSelected(true); } else if ("JV User Colors".equals(med.getViewType())) { javaViewerUCRB.setSelected(true); } else if ("HTML".equals(med.getViewType())) { htmlRB.setSelected(true); } else if ("XML".equals(med.getViewType())) { xmlRB.setSelected(true); } displayFormatPanel.add(javaViewerRB); displayFormatPanel.add(javaViewerUCRB); displayFormatPanel.add(htmlRB); displayFormatPanel.add(xmlRB); controlsPanel.add(displayFormatPanel); SpringUtilities.makeCompactGrid(controlsPanel, 1, 2, // rows, cols 4, 4, // initX, initY 0, 0); // xPad, yPad JButton editStyleMapButton = new JButton("Edit Style Map"); // event for the editStyleMapButton button editStyleMapButton.addActionListener(this); southernPanel.add(controlsPanel); // southernPanel.add( new JSeparator() ); JPanel buttonsPanel = new JPanel(); buttonsPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); // APL: edit style map feature disabled for SDK buttonsPanel.add(editStyleMapButton); if (performanceStats != null) { JButton perfStatsButton = new JButton("Performance Stats"); perfStatsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JOptionPane.showMessageDialog((Component) ae.getSource(), performanceStats, null, JOptionPane.PLAIN_MESSAGE); } }); buttonsPanel.add(perfStatsButton); } JButton closeButton = new JButton("Close"); buttonsPanel.add(closeButton); southernPanel.add(buttonsPanel); // add jlist and panel container to Dialog getContentPane().add(resultsTitlePanel, BorderLayout.NORTH); getContentPane().add(scrollPane, BorderLayout.CENTER); getContentPane().add(southernPanel, BorderLayout.SOUTH); // event for the closeButton button closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { DBAnnotationViewerDialog.this.setVisible(false); } }); // event for analyzedResultsDialog window closing this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setLF(); // set default look and feel analyzedResultsList.setCellRenderer(new MyListCellRenderer()); // doubleclicking on document shows the annotated result MouseListener mouseListener = new ListMouseAdapter(); // styleMapFile, analyzedResultsList, // inputDirPath,typeSystem , typesToDisplay , // javaViewerRB , javaViewerUCRB ,xmlRB , // viewerDirectory , this); // add mouse Listener to the list analyzedResultsList.addMouseListener(mouseListener); }
From source file:org.apereo.learninganalytics.snapp.ClusteringDemo.java
private void setUpView(Graph<Integer, Number> grp, Map<Integer, String> name) { /*/* ww w. j a v a 2s.co m*/ Factory<Number> vertexFactory = new Factory<Number>() { int n = 0; public Number create() { return n++; } }; Factory<Number> edgeFactory = new Factory<Number>() { int n = 0; public Number create() { return n++; } }; PajekNetReader<Graph<Number, Number>, Number,Number> pnr = new PajekNetReader<Graph<Number, Number>, Number,Number>(vertexFactory, edgeFactory); final Graph<Number,Number> graph = new SparseMultigraph<Number, Number>(); pnr.load(br, graph); */ //Create a simple layout frame //specify the Fruchterman-Rheingold layout algorithm this.usernames = name; final AggregateLayout<Integer, Number> layout = new AggregateLayout<Integer, Number>( new FRLayout<Integer, Number>(grp)); layout.setSize(new Dimension(500, 500)); vv = new VisualizationViewer<Integer, Number>(layout); vv.setBackground(Color.white); //Tell the renderer to use our own customized color rendering vv.getRenderContext() .setVertexFillPaintTransformer(MapTransformer.<Integer, Paint>getInstance(vertexPaints)); vv.getRenderContext().setVertexDrawPaintTransformer(new Transformer<Integer, Paint>() { public Paint transform(Integer v) { if (vv.getPickedVertexState().isPicked(v)) { return Color.cyan; } else { return Color.BLACK; } } }); vv.getRenderContext().setEdgeDrawPaintTransformer(MapTransformer.<Number, Paint>getInstance(edgePaints)); vv.getRenderContext().setEdgeStrokeTransformer(new Transformer<Number, Stroke>() { protected final Stroke THIN = new BasicStroke(1); protected final Stroke THICK = new BasicStroke(2); public Stroke transform(Number e) { Paint c = edgePaints.get(e); if (c == Color.LIGHT_GRAY) return THIN; else return THICK; } }); vv.getRenderContext().setVertexLabelTransformer( // this chains together Transformers so that the html tags // are prepended to the toString method output new ChainedTransformer<Integer, String>( new Transformer[] { new ToStringLabeller<String>(), new Transformer<String, String>() { public String transform(String input) { return usernames.get(Integer.parseInt(input)); } } })); vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.S); /* //add restart button JButton scramble = new JButton("Restart"); scramble.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { Layout layout = vv.getGraphLayout(); layout.initialize(); Relaxer relaxer = vv.getModel().getRelaxer(); if(relaxer != null) { relaxer.stop(); relaxer.prerelax(); relaxer.relax(); } } }); */ DefaultModalGraphMouse gm = new DefaultModalGraphMouse(); vv.setGraphMouse(gm); final JToggleButton groupVertices = new JToggleButton("Group Clusters"); //Create slider to adjust the number of edges to remove when clustering final JSlider edgeBetweennessSlider = new JSlider(JSlider.HORIZONTAL); edgeBetweennessSlider.setBackground(Color.WHITE); edgeBetweennessSlider.setPreferredSize(new Dimension(210, 50)); edgeBetweennessSlider.setPaintTicks(true); edgeBetweennessSlider.setMaximum(grp.getEdgeCount()); edgeBetweennessSlider.setMinimum(0); edgeBetweennessSlider.setValue(0); edgeBetweennessSlider.setMajorTickSpacing(10); edgeBetweennessSlider.setPaintLabels(true); edgeBetweennessSlider.setPaintTicks(true); // edgeBetweennessSlider.setBorder(BorderFactory.createLineBorder(Color.black)); //TO DO: edgeBetweennessSlider.add(new JLabel("Node Size (PageRank With Priors):")); //I also want the slider value to appear final JPanel eastControls = new JPanel(); eastControls.setOpaque(true); eastControls.setLayout(new BoxLayout(eastControls, BoxLayout.Y_AXIS)); eastControls.add(Box.createVerticalGlue()); eastControls.add(edgeBetweennessSlider); final String COMMANDSTRING = "Edges removed for clusters: "; final String eastSize = COMMANDSTRING + edgeBetweennessSlider.getValue(); final TitledBorder sliderBorder = BorderFactory.createTitledBorder(eastSize); eastControls.setBorder(sliderBorder); //eastControls.add(eastSize); eastControls.add(Box.createVerticalGlue()); groupVertices.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { clusterAndRecolor(layout, edgeBetweennessSlider.getValue(), similarColors, e.getStateChange() == ItemEvent.SELECTED); vv.repaint(); } }); clusterAndRecolor(layout, 0, similarColors, groupVertices.isSelected()); edgeBetweennessSlider.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { JSlider source = (JSlider) e.getSource(); if (!source.getValueIsAdjusting()) { int numEdgesToRemove = source.getValue(); clusterAndRecolor(layout, numEdgesToRemove, similarColors, groupVertices.isSelected()); sliderBorder.setTitle(COMMANDSTRING + edgeBetweennessSlider.getValue()); eastControls.repaint(); vv.validate(); vv.repaint(); } } }); // Add a restart button so the graph can be redrawn to fit the size of the frame JFrame jf = new JFrame("SNAPP: Find Clusters"); //jf.getContentPane().add(); //Container content = getContentPane(); //content.add(new GraphZoomScrollPane(vv)); jf.getContentPane().add(new GraphZoomScrollPane(vv)); JPanel south = new JPanel(); JPanel grid = new JPanel(new GridLayout(2, 1)); //grid.add(scramble); grid.add(groupVertices); south.add(grid); south.add(eastControls); JPanel p = new JPanel(); p.setBorder(BorderFactory.createTitledBorder("Mouse Mode")); p.add(gm.getModeComboBox()); south.add(p); //content.add(south, BorderLayout.SOUTH); jf.getContentPane().add(south, BorderLayout.SOUTH); //jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.pack(); jf.setVisible(true); }
From source file:org.barcelonamedia.uima.tools.docanalyzer.DBAnnotationViewerDialog.java
/** * Create an AnnotationViewer Dialog// w w w .j a va2s .c o m * * @param aParentFrame * frame containing this panel * @param aTitle * title to display for the dialog * @param aInputDir * directory containing input files (in XCAS foramt) to read * @param aStyleMapFile * filename of style map to be used to view files in HTML * @param aPerformanceStats * string representaiton of performance statistics, optional. * @param aTypeSystem * the CAS Type System to which the XCAS files must conform. * @param aTypesToDisplay * array of types that should be highlighted in the viewer. This can be set to the output * types of the Analysis Engine. A value of null means to display all types. */ /*public DBAnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, DBPrefsMediator med, File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem, final String[] aTypesToDisplay, String interactiveTempFN, boolean javaViewerRBisSelected, boolean javaViewerUCRBisSelected, boolean xmlRBisSelected, CAS cas) { super(aParentFrame, aDialogTitle); // create the AnnotationViewGenerator (for HTML view generation) this.med1 = med; this.cas = cas; annotationViewGenerator = new AnnotationViewGenerator(tempDir); launchThatViewer(med.getOutputDir(), interactiveTempFN, aTypeSystem, aTypesToDisplay, javaViewerRBisSelected, javaViewerUCRBisSelected, xmlRBisSelected, aStyleMapFile, tempDir); }*/ public DBAnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, DBPrefsMediator med, File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem, final String[] aTypesToDisplay, boolean generatedStyleMap, CAS cas) { super(aParentFrame, aDialogTitle); this.xmiDAO = med.getXmiDAO(); this.med1 = med; this.cas = cas; styleMapFile = aStyleMapFile; final String performanceStats = aPerformanceStats; typeSystem = aTypeSystem; typesToDisplay = aTypesToDisplay; // create the AnnotationViewGenerator (for HTML view generation) annotationViewGenerator = new AnnotationViewGenerator(tempDir); // create StyleMapEditor dialog styleMapEditor = new StyleMapEditor(aParentFrame, cas); JPanel resultsTitlePanel = new JPanel(); resultsTitlePanel.setLayout(new BoxLayout(resultsTitlePanel, BoxLayout.Y_AXIS)); resultsTitlePanel.add(new JLabel("These are the Analyzed Documents.")); resultsTitlePanel.add(new JLabel("Select viewer type and double-click file to open.")); try { String[] documents = this.xmiDAO.getXMIList(); analyzedResultsList = new JList(documents); JScrollPane scrollPane = new JScrollPane(); scrollPane.getViewport().add(analyzedResultsList, null); JPanel southernPanel = new JPanel(); southernPanel.setLayout(new BoxLayout(southernPanel, BoxLayout.Y_AXIS)); JPanel controlsPanel = new JPanel(); controlsPanel.setLayout(new SpringLayout()); Caption displayFormatLabel = new Caption("Results Display Format:"); controlsPanel.add(displayFormatLabel); JPanel displayFormatPanel = new JPanel(); displayFormatPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); displayFormatPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); javaViewerRB = new JRadioButton("Java Viewer"); javaViewerUCRB = new JRadioButton("JV user colors"); htmlRB = new JRadioButton("HTML"); xmlRB = new JRadioButton("XML"); ButtonGroup displayFormatButtonGroup = new ButtonGroup(); displayFormatButtonGroup.add(javaViewerRB); displayFormatButtonGroup.add(javaViewerUCRB); displayFormatButtonGroup.add(htmlRB); displayFormatButtonGroup.add(xmlRB); // select the appropraite viewer button according to user's prefs javaViewerRB.setSelected(true); // default, overriden below if ("Java Viewer".equals(med.getViewType())) { javaViewerRB.setSelected(true); } else if ("JV User Colors".equals(med.getViewType())) { javaViewerUCRB.setSelected(true); } else if ("HTML".equals(med.getViewType())) { htmlRB.setSelected(true); } else if ("XML".equals(med.getViewType())) { xmlRB.setSelected(true); } displayFormatPanel.add(javaViewerRB); displayFormatPanel.add(javaViewerUCRB); displayFormatPanel.add(htmlRB); displayFormatPanel.add(xmlRB); controlsPanel.add(displayFormatPanel); SpringUtilities.makeCompactGrid(controlsPanel, 1, 2, // rows, cols 4, 4, // initX, initY 0, 0); // xPad, yPad JButton editStyleMapButton = new JButton("Edit Style Map"); // event for the editStyleMapButton button editStyleMapButton.addActionListener(this); southernPanel.add(controlsPanel); // southernPanel.add( new JSeparator() ); JPanel buttonsPanel = new JPanel(); buttonsPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); // APL: edit style map feature disabled for SDK buttonsPanel.add(editStyleMapButton); if (performanceStats != null) { JButton perfStatsButton = new JButton("Performance Stats"); perfStatsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JOptionPane.showMessageDialog((Component) ae.getSource(), performanceStats, null, JOptionPane.PLAIN_MESSAGE); } }); buttonsPanel.add(perfStatsButton); } JButton closeButton = new JButton("Close"); buttonsPanel.add(closeButton); southernPanel.add(buttonsPanel); // add list and panel container to Dialog getContentPane().add(resultsTitlePanel, BorderLayout.NORTH); getContentPane().add(scrollPane, BorderLayout.CENTER); getContentPane().add(southernPanel, BorderLayout.SOUTH); // event for the closeButton button closeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { DBAnnotationViewerDialog.this.setVisible(false); } }); // event for analyzedResultsDialog window closing this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setLF(); // set default look and feel analyzedResultsList.setCellRenderer(new MyListCellRenderer()); // doubleclicking on document shows the annotated result MouseListener mouseListener = new ListMouseAdapter(); // styleMapFile, analyzedResultsList, // inputDirPath,typeSystem , typesToDisplay , // javaViewerRB , javaViewerUCRB ,xmlRB , // viewerDirectory , this); // add mouse Listener to the list analyzedResultsList.addMouseListener(mouseListener); } catch (DAOException e) { displayError(e.getMessage()); this.dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING)); } }
From source file:org.broad.igv.cbio.FilterGeneNetworkUI.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license tabbedPane = new JTabbedPane(); dialogPane = new JPanel(); panel1 = new JPanel(); addRow = new JButton(); contentPane = new JPanel(); scrollPane1 = new JScrollPane(); geneTable = new JTable(); buttonBar = new JPanel(); totNumGenes = new JLabel(); keepIsolated = new JCheckBox(); okButton = new JButton(); refFilter = new JButton(); cancelButton = new JButton(); helpButton = new JButton(); saveButton = new JButton(); thresholds = new JPanel(); contentPanel = new JPanel(); label2 = new JLabel(); label3 = new JLabel(); delInput = new JTextField(); label4 = new JLabel(); expUpInput = new JTextField(); label7 = new JLabel(); expDownInput = new JTextField(); ampInput = new JTextField(); label1 = new JLabel(); mutInput = new JTextField(); label6 = new JLabel(); label8 = new JLabel(); separator1 = new JSeparator(); separator3 = new JSeparator(); separator2 = new JSeparator(); panel2 = new JPanel(); textArea1 = new JTextArea(); //======== this ======== setMinimumSize(new Dimension(600, 22)); setModalityType(Dialog.ModalityType.DOCUMENT_MODAL); Container contentPane2 = getContentPane(); contentPane2.setLayout(new BorderLayout()); //======== tabbedPane ======== {/*from ww w . jav a 2s . co m*/ tabbedPane.setPreferredSize(new Dimension(550, 346)); tabbedPane.setMinimumSize(new Dimension(550, 346)); tabbedPane.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { tabbedPaneStateChanged(e); } }); //======== dialogPane ======== { dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12)); dialogPane.setMinimumSize(new Dimension(443, 300)); dialogPane.setPreferredSize(new Dimension(443, 300)); dialogPane.setLayout(new GridBagLayout()); ((GridBagLayout) dialogPane.getLayout()).columnWidths = new int[] { 0, 0 }; ((GridBagLayout) dialogPane.getLayout()).rowHeights = new int[] { 0, 0, 0, 0, 0, 0 }; ((GridBagLayout) dialogPane.getLayout()).columnWeights = new double[] { 1.0, 1.0E-4 }; ((GridBagLayout) dialogPane.getLayout()).rowWeights = new double[] { 0.0, 0.0, 1.0, 0.0, 0.0, 1.0E-4 }; //======== panel1 ======== { panel1.setLayout(new GridBagLayout()); ((GridBagLayout) panel1.getLayout()).columnWidths = new int[] { 0, 0, 0 }; ((GridBagLayout) panel1.getLayout()).rowHeights = new int[] { 0, 0 }; ((GridBagLayout) panel1.getLayout()).columnWeights = new double[] { 0.0, 0.0, 1.0E-4 }; ((GridBagLayout) panel1.getLayout()).rowWeights = new double[] { 0.0, 1.0E-4 }; //---- addRow ---- addRow.setText("Add Filter"); addRow.setMaximumSize(new Dimension(200, 28)); addRow.setMinimumSize(new Dimension(100, 28)); addRow.setPreferredSize(new Dimension(150, 28)); addRow.setVisible(false); addRow.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addRowActionPerformed(e); } }); panel1.add(addRow, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } dialogPane.add(panel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //======== contentPane ======== { contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); } dialogPane.add(contentPane, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //======== scrollPane1 ======== { //---- geneTable ---- geneTable.setAutoCreateRowSorter(true); scrollPane1.setViewportView(geneTable); } dialogPane.add(scrollPane1, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); buttonBar.setLayout(new GridBagLayout()); ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] { 0, 85, 85, 80 }; ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] { 1.0, 0.0, 0.0, 0.0 }; //---- totNumGenes ---- totNumGenes.setText("Total Genes: #"); buttonBar.add(totNumGenes, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- keepIsolated ---- keepIsolated.setText("Keep Isolated Genes"); keepIsolated.setVisible(false); buttonBar.add(keepIsolated, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- okButton ---- okButton.setText("View Network"); okButton.setToolTipText("Display the network in a web browser"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); } }); buttonBar.add(okButton, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); //---- refFilter ---- refFilter.setText("Refresh Filter"); refFilter.setVisible(false); refFilter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { refFilterActionPerformed(e); } }); buttonBar.add(refFilter, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- cancelButton ---- cancelButton.setText("Cancel"); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { cancelButtonActionPerformed(e); } }); buttonBar.add(cancelButton, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- helpButton ---- helpButton.setText("Help"); helpButton.setVisible(false); buttonBar.add(helpButton, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); //---- saveButton ---- saveButton.setText("Save Table"); saveButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveButtonActionPerformed(e); } }); buttonBar.add(saveButton, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); } dialogPane.add(buttonBar, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } tabbedPane.addTab("Filter", dialogPane); //======== thresholds ======== { thresholds.setPreferredSize(new Dimension(550, 196)); thresholds.setMinimumSize(new Dimension(550, 196)); thresholds.setLayout(null); //======== contentPanel ======== { contentPanel.setBorder(new EtchedBorder()); contentPanel.setLayout(null); //---- label2 ---- label2.setText("Amplification:"); label2.setHorizontalAlignment(SwingConstants.RIGHT); label2.setLabelFor(ampInput); label2.setToolTipText("Amplification score, on a log-normalized scale"); label2.setPreferredSize(new Dimension(90, 18)); contentPanel.add(label2); label2.setBounds(140, 96, label2.getPreferredSize().width, 18); //---- label3 ---- label3.setText("Deletion:"); label3.setHorizontalAlignment(SwingConstants.RIGHT); label3.setLabelFor(delInput); label3.setToolTipText("Deletion score, on a log-normalized scale"); label3.setPreferredSize(new Dimension(60, 16)); contentPanel.add(label3); label3.setBounds(360, 96, label3.getPreferredSize().width, 18); //---- delInput ---- delInput.setText("0.7"); delInput.setMinimumSize(new Dimension(34, 28)); delInput.setPreferredSize(new Dimension(45, 28)); delInput.setMaximumSize(new Dimension(50, 2147483647)); contentPanel.add(delInput); delInput.setBounds(new Rectangle(new Point(240, 162), delInput.getPreferredSize())); //---- label4 ---- label4.setText("Up:"); label4.setHorizontalAlignment(SwingConstants.RIGHT); label4.setLabelFor(expUpInput); label4.setToolTipText("Expression score, log-normalized scale"); label4.setPreferredSize(new Dimension(100, 18)); contentPanel.add(label4); label4.setBounds(130, 168, label4.getPreferredSize().width, 18); //---- expUpInput ---- expUpInput.setText("0.1"); expUpInput.setMinimumSize(new Dimension(34, 28)); expUpInput.setPreferredSize(new Dimension(45, 28)); contentPanel.add(expUpInput); expUpInput.setBounds(new Rectangle(new Point(430, 91), expUpInput.getPreferredSize())); //---- label7 ---- label7.setText("Down:"); label7.setHorizontalAlignment(SwingConstants.RIGHT); label7.setLabelFor(expDownInput); label7.setToolTipText("Expression score, log-normalized scale"); label7.setPreferredSize(new Dimension(120, 16)); contentPanel.add(label7); label7.setBounds(300, 168, label7.getPreferredSize().width, 18); //---- expDownInput ---- expDownInput.setText("0.1"); expDownInput.setPreferredSize(new Dimension(45, 28)); expDownInput.setMinimumSize(new Dimension(34, 28)); expDownInput.setMaximumSize(new Dimension(50, 2147483647)); contentPanel.add(expDownInput); expDownInput.setBounds(new Rectangle(new Point(430, 162), expDownInput.getPreferredSize())); //---- ampInput ---- ampInput.setText("0.7"); ampInput.setMinimumSize(new Dimension(34, 28)); ampInput.setPreferredSize(new Dimension(45, 28)); contentPanel.add(ampInput); ampInput.setBounds(new Rectangle(new Point(240, 91), ampInput.getPreferredSize())); //---- label1 ---- label1.setText("Mutation:"); label1.setHorizontalAlignment(SwingConstants.RIGHT); label1.setLabelFor(mutInput); label1.setToolTipText("Minimum number of mutations found"); label1.setPreferredSize(new Dimension(66, 18)); contentPanel.add(label1); label1.setBounds(50, 26, label1.getPreferredSize().width, 18); //---- mutInput ---- mutInput.setText("1"); mutInput.setAutoscrolls(false); mutInput.setMinimumSize(new Dimension(34, 28)); mutInput.setPreferredSize(new Dimension(45, 28)); contentPanel.add(mutInput); mutInput.setBounds(new Rectangle(new Point(240, 21), mutInput.getPreferredSize())); //---- label6 ---- label6.setText("Copy Number:"); contentPanel.add(label6); label6.setBounds(30, 96, label6.getPreferredSize().width, 18); //---- label8 ---- label8.setText("Expression:"); label8.setHorizontalAlignment(SwingConstants.RIGHT); contentPanel.add(label8); label8.setBounds(30, 168, 86, 18); contentPanel.add(separator1); separator1.setBounds(0, 135, 500, 10); contentPanel.add(separator3); separator3.setBounds(0, 65, 500, 10); //---- separator2 ---- separator2.setPreferredSize(new Dimension(10, 210)); separator2.setOrientation(SwingConstants.VERTICAL); contentPanel.add(separator2); separator2.setBounds(new Rectangle(new Point(120, 0), separator2.getPreferredSize())); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < contentPanel.getComponentCount(); i++) { Rectangle bounds = contentPanel.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = contentPanel.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; contentPanel.setMinimumSize(preferredSize); contentPanel.setPreferredSize(preferredSize); } } thresholds.add(contentPanel); contentPanel.setBounds(12, 80, 500, 210); //======== panel2 ======== { panel2.setLayout(null); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < panel2.getComponentCount(); i++) { Rectangle bounds = panel2.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = panel2.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; panel2.setMinimumSize(preferredSize); panel2.setPreferredSize(preferredSize); } } thresholds.add(panel2); panel2.setBounds(new Rectangle(new Point(55, 25), panel2.getPreferredSize())); //---- textArea1 ---- textArea1.setText( "Samples are considered to have a given \"event\" if the value is above the thresholds below."); textArea1.setEditable(false); textArea1.setLineWrap(true); textArea1.setBackground(UIManager.getColor("Button.background")); thresholds.add(textArea1); textArea1.setBounds(15, 10, 430, 40); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < thresholds.getComponentCount(); i++) { Rectangle bounds = thresholds.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = thresholds.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; thresholds.setMinimumSize(preferredSize); thresholds.setPreferredSize(preferredSize); } } tabbedPane.addTab("Thresholds", thresholds); } contentPane2.add(tabbedPane, BorderLayout.NORTH); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }