List of usage examples for javax.swing SwingConstants LEFT
int LEFT
To view the source code for javax.swing SwingConstants LEFT.
Click Source Link
From source file:com.eviware.soapui.SoapUI.java
private void buildUI() { // display used java version log.info("Used java version: " + System.getProperty("java.version")); frame.addWindowListener(new MainFrameWindowListener()); UISupport.setMainFrame(frame);/* www .ja v a2s .c o m*/ navigator = new Navigator(workspace); navigator.addNavigatorListener(new InternalNavigatorListener()); desktopPanelsList = new JDesktopPanelsList(desktop); mainInspector = JInspectorPanelFactory.build(buildContentPanel(), SwingConstants.LEFT); mainInspector.addInspector( new JComponentInspector<JComponent>(buildMainPanel(), "Navigator", "The soapUI Navigator", true)); mainInspector.setCurrentInspector("Navigator"); frame.setJMenuBar(buildMainMenu()); frame.getContentPane().add(buildToolbar(), BorderLayout.NORTH); frame.getContentPane().add(mainInspector.getComponent(), BorderLayout.CENTER); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); frame.setSize(1000, 750); mainInspector.setDividerLocation(250); mainInspector.setResizeWeight(0.1); navigator.selectModelItem(workspace); desktop.addDesktopListener(internalDesktopListener); ToolTipManager.sharedInstance().setInitialDelay(200); JTree mainTree = navigator.getMainTree(); DragSource dragSource = DragSource.getDefaultDragSource(); SoapUIDragAndDropHandler navigatorDragAndDropHandler = new SoapUIDragAndDropHandler( new NavigatorDragAndDropable(mainTree), DropType.ON + DropType.AFTER); dragSource.createDefaultDragGestureRecognizer(mainTree, DnDConstants.ACTION_COPY_OR_MOVE, navigatorDragAndDropHandler); desktop.init(); }
From source file:ar.edu.uns.cs.vyglab.arq.rockar.gui.JFrameControlPanel.java
private void initGUI() { try {/*from ww w. java 2 s . c o m*/ setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.setIconImage(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/splash/purple-monkey32.png")) .getImage()); this.setTitle("Rock.AR v2.0"); this.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent evt) { thisComponentResized(evt); } }); this.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent evt) { thisWindowClosed(evt); } }); { jPanelSouth = new JPanel(); BorderLayout jPanelSouthLayout = new BorderLayout(); getContentPane().add(jPanelSouth, BorderLayout.SOUTH); jPanelSouth.setLayout(jPanelSouthLayout); { jLabelInformation = new JLabel(); jPanelSouth.add(jLabelInformation, BorderLayout.CENTER); jLabelInformation.setText(DataCenter.langResource.getString("control_information_label")); jLabelInformation.setOpaque(true); jLabelInformation.setBackground(new java.awt.Color(241, 191, 101)); } } { jPanelCenter = new JPanel(); GridLayout jPanelCenterLayout = new GridLayout(1, 1); jPanelCenterLayout.setHgap(5); jPanelCenterLayout.setVgap(5); jPanelCenterLayout.setColumns(1); getContentPane().add(jPanelCenter, BorderLayout.CENTER); jPanelCenter.setLayout(jPanelCenterLayout); { jPanelWest = new JPanel(); BorderLayout jPanelWestLayout = new BorderLayout(); jPanelCenter.add(jPanelWest); jPanelWest.setLayout(jPanelWestLayout); jPanelWest.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); { jToolBarMineralTable = new JToolBar(); jToolBarMineralTable.setLayout(new FlowLayout(FlowLayout.LEFT)); jPanelWest.add(jToolBarMineralTable, BorderLayout.NORTH); jToolBarMineralTable.setFloatable(false); jToolBarMineralTable.setFocusable(false); { jButtonNew = new JButton(); jToolBarMineralTable.add(jButtonNew); jButtonNew.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/Actions-tab-new-icon.png"))); jButtonNew.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonNewActionPerformed(evt); } }); } { jButtonOpen = new JButton(); jToolBarMineralTable.add(jButtonOpen); jButtonOpen.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/open.png"))); jButtonOpen.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonOpenActionPerformed(evt); } }); } { jButtonSave = new JButton(); jToolBarMineralTable.add(jButtonSave); jButtonSave.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/save.png"))); jButtonSave.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonSaveActionPerformed(evt); } }); } { jSeparator1 = new JSeparator(); jToolBarMineralTable.add(jSeparator1); jSeparator1.setOrientation(SwingConstants.VERTICAL); jSeparator1.setSize(5, 44); jSeparator1.setPreferredSize(new java.awt.Dimension(5, 44)); } { jButtonAdd = new JButton(); jToolBarMineralTable.add(jButtonAdd); jButtonAdd.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/add.png"))); jButtonAdd.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonAddActionPerformed(evt); } }); } { jButtonEdit = new JButton(); jToolBarMineralTable.add(jButtonEdit); jButtonEdit.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/modify.png"))); jButtonEdit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonEditActionPerformed(evt); } }); } { jButtonRemove = new JButton(); jToolBarMineralTable.add(jButtonRemove); jButtonRemove.setIcon(new ImageIcon(getClass().getClassLoader() .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/remove.png"))); jButtonRemove.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { jButtonRemoveActionPerformed(evt); } }); } } { jLabelMineralTableInformation = new JLabel(); jPanelWest.add(jLabelMineralTableInformation, BorderLayout.SOUTH); jLabelMineralTableInformation .setText(DataCenter.langResource.getString("total_counted_table")); jLabelMineralTableInformation.setHorizontalAlignment(SwingConstants.LEFT); jLabelMineralTableInformation.setBackground(new java.awt.Color(255, 212, 133)); jLabelMineralTableInformation.setOpaque(true); } { jScrollPaneMineralTable = new JScrollPane(); jPanelWest.add(jScrollPaneMineralTable, BorderLayout.CENTER); { jTableMineralsModel = new RockTableModel( new String[] { DataCenter.langResource.getString("keyvalue_table"), DataCenter.langResource.getString("name_table"), DataCenter.langResource.getString("color_table"), DataCenter.langResource.getString("counted_table"), DataCenter.langResource.getString("area_table") }, 0); // jTableMineralsModel.addRow(new Object[] { // 0, "x?", Color.gray, 0, // "0.00" }); jTableMinerals = new JReadOnlyTable(); jScrollPaneMineralTable.setViewportView(jTableMinerals); jTableMinerals.setModel(jTableMineralsModel); jTableMinerals.setDefaultRenderer(Color.class, new ColorRenderer(true)); TableCellRenderer centerRenderer = new CenterRenderer(); TableColumn column = jTableMinerals.getColumnModel().getColumn(0); column.setCellRenderer(centerRenderer); column = jTableMinerals.getColumnModel().getColumn(1); column.setCellRenderer(centerRenderer); column = jTableMinerals.getColumnModel().getColumn(3); column.setCellRenderer(centerRenderer); column = jTableMinerals.getColumnModel().getColumn(4); column.setCellRenderer(centerRenderer); } } } { jPanelEast = new JPanel(); jPanelCenter.add(jPanelEast); GridLayout jPanelEastLayout = new GridLayout(2, 1); jPanelEastLayout.setHgap(5); jPanelEastLayout.setVgap(5); jPanelEastLayout.setColumns(1); jPanelEast.setLayout(jPanelEastLayout); { jPanelTop = new JPanel(); BorderLayout jPanelTopLayout = new BorderLayout(); jPanelEast.add(jPanelTop); jPanelTop.setLayout(jPanelTopLayout); jPanelTop.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); { jToolBarStats = new JToolBar(); jPanelTop.add(jToolBarStats, BorderLayout.NORTH); jToolBarStats.setFloatable(false); jToolBarStats.setFocusable(false); { jButtonExportStats = new JButton(); jButtonExportStats.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { saveChartAsImage(); } }); //jToolBarStats.add(jButtonExportStats); jButtonExportStats.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/export-graph.png"))); } { jButtonExportExcel = new JButton(); //jToolBarStats.add(jButtonExportExcel); //jToolBarMineralTable.add(jButtonExportExcel); jButtonExportExcel.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/excel-icon.png"))); jButtonExportExcel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { exportToExcel(); } }); } { jButtonExportAll = new JButton(); //jToolBarStats.add(jButtonExportAll); jButtonExportAll.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/Mimetypes-application-vnd-ms-excel-icon.png"))); } } { } } { jPanelBottom = new JPanel(); BorderLayout jPanelBottomLayout = new BorderLayout(); jPanelEast.add(jPanelBottom); jPanelBottom.setLayout(jPanelBottomLayout); jPanelBottom.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false)); { jToolBarOverview = new JToolBar(); jPanelBottom.add(jToolBarOverview, BorderLayout.NORTH); jToolBarOverview.setFloatable(false); jToolBarOverview.setFocusable(false); { jButtonExportOverview = new JButton(); jToolBarOverview.add(jButtonExportOverview); jButtonExportOverview.setIcon(new ImageIcon(getClass().getClassLoader().getResource( "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/export-graph.png"))); jButtonExportOverview.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { exportOverview(); } }); } } { jPanelOverviewContent = new JPanel(); jPanelBottom.add(jPanelOverviewContent, BorderLayout.CENTER); jPanelOverviewContent.setLayout(new GridBagLayout()); this.jLabelOverview = new JLabel(); jPanelOverviewContent.add(this.jLabelOverview); } } } } pack(); this.setSize(800, 600); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:com.github.fritaly.dualcommander.DirectoryBrowser.java
public DirectoryBrowser(UserPreferences preferences, File directory) { Validate.notNull(preferences, "The given user preferences are null"); Validate.notNull(directory, "The given directory is null"); Validate.isTrue(directory.exists(),/*from w w w . j a v a2 s . com*/ String.format("The given directory '%s' doesn't exist", directory.getAbsolutePath())); Validate.isTrue(directory.isDirectory(), String.format("The given path '%s' doesn't denote a directory", directory.getAbsolutePath())); this.preferences = preferences; // Layout, columns & rows setLayout(new MigLayout("insets 0px", "[grow]", "[]1[grow]1[]")); this.tableModel = new FileTableModel(this); this.table = new JTable(tableModel); this.table.setBackground(Utils.getDefaultBackgroundColor()); this.table.addKeyListener(this); this.table.addMouseListener(this); this.table.addFocusListener(this); this.table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); this.table.getSelectionModel().addListSelectionListener(this); // Listen to column event resize events final ColumnEventHelper eventHelper = new ColumnEventHelper(this); this.table.getColumnModel().addColumnModelListener(eventHelper); this.table.getTableHeader().addMouseListener(eventHelper); // Render the table headers with a bold font this.table.getTableHeader().setFont(Utils.getBoldFont(this.table.getTableHeader().getFont())); this.table.getTableHeader().setBackground(Utils.getDefaultBackgroundColor()); this.table.getTableHeader().setDefaultRenderer(new TableHeaderRenderer()); this.table.getTableHeader().addMouseListener(this); final TableColumn typeColumn = this.table.getColumn(FileTableModel.COLUMN_TYPE); typeColumn.setCellRenderer(new FileTypeRenderer()); typeColumn.setResizable(false); typeColumn.setHeaderValue(""); typeColumn.setMaxWidth(Icons.FOLDER_ICON.getIconWidth() + 5); final TableColumn fileColumn = this.table.getColumn(FileTableModel.COLUMN_NAME); fileColumn.setCellRenderer(new FileNameRenderer()); fileColumn.setResizable(true); final TableColumn sizeColumn = this.table.getColumn(FileTableModel.COLUMN_SIZE); sizeColumn.setCellRenderer(new FileSizeRenderer()); sizeColumn.setResizable(true); // Dynamically set the column to the correct size final TableColumn lastUpdateColumn = this.table.getColumn(FileTableModel.COLUMN_LAST_UPDATE); lastUpdateColumn.setCellRenderer(new LastUpdateRenderer()); lastUpdateColumn.setResizable(false); lastUpdateColumn.setMaxWidth(Utils.getTimestampRenderWidth() + 5); lastUpdateColumn.setMinWidth(Utils.getTimestampRenderWidth() + 5); // Use a square border (not one with rounded corners) this.directoryButton.setBorder(Utils.createRaisedBevelBorder()); this.directoryButton.setFont(Utils.getDefaultFont()); this.directoryButton.setFocusable(false); this.directoryButton.setHorizontalAlignment(SwingConstants.LEFT); this.summary = new JLabel(" "); this.summary.setBorder(Utils.createRaisedBevelBorder()); add(directoryButton, "grow, wrap"); add(new JScrollPane(table), "grow, wrap"); add(summary, "grow"); // Set the directory (this will populate the table) setDirectory(directory); }
From source file:de.codesourcery.eve.skills.ui.components.impl.AssetListComponent.java
@Override protected JPanel createPanel() { // Merge controls. final JPanel mergeControlsPanel = new JPanel(); mergeControlsPanel.setLayout(new GridBagLayout()); mergeControlsPanel.setBorder(BorderFactory.createTitledBorder("Merging")); int y = 0;/*from www . j a v a 2 s . c o m*/ // merge by type mergeAssetsByType.setSelected(true); mergeAssetsByType.addActionListener(actionListener); mergeControlsPanel.add(mergeAssetsByType, constraints(0, y).anchorWest().end()); mergeControlsPanel.add(new JLabel("Merge assets by type", SwingConstants.LEFT), constraints(1, y++).width(2).end()); // "ignore different packaging" ignorePackaging.setSelected(true); ignorePackaging.addActionListener(actionListener); mergeControlsPanel.add(new JLabel(""), constraints(0, y).anchorWest().end()); mergeControlsPanel.add(ignorePackaging, constraints(1, y).anchorWest().end()); final JLabel label1 = new JLabel("Merge different packaging", SwingConstants.RIGHT); mergeControlsPanel.add(label1, constraints(2, y++).end()); // "ignore different locations" ignoreLocations.setSelected(true); ignoreLocations.addActionListener(actionListener); mergeControlsPanel.add(new JLabel(""), constraints(0, y).anchorWest().end()); mergeControlsPanel.add(ignoreLocations, constraints(1, y).anchorWest().end()); final JLabel label2 = new JLabel("Merge different locations", SwingConstants.RIGHT); mergeControlsPanel.add(label2, constraints(2, y++).end()); linkComponentEnabledStates(mergeAssetsByType, ignoreLocations, ignorePackaging, label1, label2); /* * Filter controls. */ final JPanel filterControlsPanel = new JPanel(); filterControlsPanel.setLayout(new GridBagLayout()); filterControlsPanel.setBorder(BorderFactory.createTitledBorder("Filters")); y = 0; // filter by location combo box filterByLocation.addActionListener(actionListener); locationComboBox.addActionListener(actionListener); filterByLocation.setSelected(false); linkComponentEnabledStates(filterByLocation, locationComboBox); locationComboBox.setRenderer(new LocationRenderer()); locationComboBox.setPreferredSize(new Dimension(150, 20)); locationComboBox.setModel(locationModel); filterControlsPanel.add(filterByLocation, constraints(0, y).end()); filterControlsPanel.add(locationComboBox, constraints(1, y++).end()); // filter by type combo box filterByType.addActionListener(actionListener); typeComboBox.addActionListener(actionListener); filterByType.setSelected(false); linkComponentEnabledStates(filterByType, typeComboBox); typeComboBox.setPreferredSize(new Dimension(150, 20)); typeComboBox.setModel(typeModel); filterControlsPanel.add(filterByType, constraints(0, y).end()); filterControlsPanel.add(typeComboBox, constraints(1, y++).end()); // filter by item category combobox filterByCategory.addActionListener(actionListener); categoryComboBox.addActionListener(actionListener); categoryComboBox.setRenderer(new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); setText(getDisplayName((InventoryCategory) value)); setEnabled(categoryComboBox.isEnabled()); return this; } }); filterByCategory.setSelected(false); linkComponentEnabledStates(filterByCategory, categoryComboBox); categoryComboBox.setPreferredSize(new Dimension(150, 20)); categoryComboBox.setModel(categoryModel); filterControlsPanel.add(filterByCategory, constraints(0, y).end()); filterControlsPanel.add(categoryComboBox, constraints(1, y++).end()); // filter by item group combobox filterByGroup.addActionListener(actionListener); groupComboBox.addActionListener(actionListener); filterByGroup.setSelected(false); linkComponentEnabledStates(filterByGroup, groupComboBox); groupComboBox.setPreferredSize(new Dimension(150, 20)); groupComboBox.setModel(groupModel); filterControlsPanel.add(filterByGroup, constraints(0, y).end()); filterControlsPanel.add(groupComboBox, constraints(1, y++).end()); /* * Table panel. */ table = new JTable() { @Override public TableCellRenderer getCellRenderer(int row, int column) { // subclassing hack is needed because table // returns different renderes depending on column type final TableCellRenderer result = super.getCellRenderer(row, column); return new TableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { final Component comp = result.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); final int modelRow = table.convertRowIndexToModel(row); final Asset asset = model.getRow(modelRow); final StringBuilder label = new StringBuilder("<HTML><BODY>"); label.append(asset.getItemId() + " - flags: " + asset.getFlags() + "<BR>"); if (asset.hasMultipleLocations()) { label.append("<BR>"); for (ILocation loc : asset.getLocations()) { label.append(loc.getDisplayName()).append("<BR>"); } } label.append("</BODY></HTML>"); ((JComponent) comp).setToolTipText(label.toString()); return comp; } }; } }; model.setViewFilter(this.viewFilter); table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { updateSelectedVolume(); } }); FixedBooleanTableCellRenderer.attach(table); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setModel(model); table.setBorder(BorderFactory.createLineBorder(Color.BLACK)); table.setRowSorter(model.getRowSorter()); popupMenuBuilder.addItem("Refine...", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { final List<Asset> assets = getSelectedAssets(); if (assets == null || assets.isEmpty()) { return; } final ICharacter c = selectionProvider.getSelectedItem(); final RefiningComponent comp = new RefiningComponent(c); comp.setItemsToRefine(assets); ComponentWrapper.wrapComponent("Refining", comp).setVisible(true); } @Override public boolean isEnabled() { return table.getSelectedRow() != -1; } }); popupMenuBuilder.addItem("Copy selection to clipboard (text)", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { final List<Asset> assets = getSelectedAssets(); if (assets == null || assets.isEmpty()) { return; } new PlainTextTransferable(toPlainText(assets)).putOnClipboard(); } @Override public boolean isEnabled() { return table.getSelectedRow() != -1; } }); popupMenuBuilder.addItem("Copy selection to clipboard (CSV)", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { final List<Asset> assets = getSelectedAssets(); if (assets == null || assets.isEmpty()) { return; } final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(new PlainTextTransferable(toCsv(assets)), null); } @Override public boolean isEnabled() { return table.getSelectedRow() != -1; } }); table.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); this.popupMenuBuilder.attach(table); final JScrollPane scrollPane = new JScrollPane(table); /* * Name filter */ final JPanel nameFilterPanel = new JPanel(); nameFilterPanel.setLayout(new GridBagLayout()); nameFilterPanel.setBorder(BorderFactory.createTitledBorder("Filter by name")); nameFilterPanel.setPreferredSize(new Dimension(150, 70)); nameFilter.setColumns(10); nameFilter.getDocument().addDocumentListener(new DocumentListener() { @Override public void changedUpdate(DocumentEvent e) { model.viewFilterChanged(); } @Override public void insertUpdate(DocumentEvent e) { model.viewFilterChanged(); } @Override public void removeUpdate(DocumentEvent e) { model.viewFilterChanged(); } }); nameFilterPanel.add(nameFilter, constraints(0, 0).resizeHorizontally().end()); final JButton clearButton = new JButton("Clear"); clearButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { nameFilter.setText(null); } }); nameFilterPanel.add(clearButton, constraints(1, 0).noResizing().end()); // Selected volume final JPanel selectedVolumePanel = this.selectedVolume.getPanel(); // add control panels to result panel final JPanel topPanel = new JPanel(); topPanel.setLayout(new GridBagLayout()); topPanel.add(mergeControlsPanel, constraints(0, 0).height(2).weightX(0).anchorWest().end()); topPanel.add(filterControlsPanel, constraints(1, 0).height(2).anchorWest().weightX(0).end()); topPanel.add(nameFilterPanel, constraints(2, 0).height(1).anchorWest().useRemainingWidth().end()); topPanel.add(selectedVolumePanel, constraints(2, 1).height(1).anchorWest().useRemainingWidth().end()); final JSplitPane splitPane = new ImprovedSplitPane(JSplitPane.VERTICAL_SPLIT, topPanel, scrollPane); splitPane.setDividerLocation(0.3d); final JPanel content = new JPanel(); content.setLayout(new GridBagLayout()); content.add(splitPane, constraints().resizeBoth().useRemainingSpace().end()); return content; }
From source file:be.ugent.maf.cellmissy.gui.controller.analysis.doseresponse.generic.GenericDoseResponseController.java
/** * Initialize main view/*from ww w. j av a 2 s . c o m*/ */ @Override protected void initMainView() { genericDRParentPanel = new GenericDRParentPanel(); dRPanel = new DRPanel(); //buttons disabled at start genericDRParentPanel.getCancelButton().setEnabled(false); genericDRParentPanel.getNextButton().setEnabled(false); getCardLayout().first(genericDRParentPanel.getContentPanel()); onCardSwitch(); //create a ButtonGroup for the radioButtons used for analysis ButtonGroup mainDRRadioButtonGroup = new ButtonGroup(); //adding buttons to a ButtonGroup automatically deselect one when another one gets selected mainDRRadioButtonGroup.add(dRPanel.getInputDRButton()); mainDRRadioButtonGroup.add(dRPanel.getInitialPlotDRButton()); mainDRRadioButtonGroup.add(dRPanel.getNormalizedPlotDRButton()); mainDRRadioButtonGroup.add(dRPanel.getResultsDRButton()); //select as default first button dRPanel.getInputDRButton().setSelected(true); //init dataTable dataTable = new JTable(); JScrollPane scrollPane = new JScrollPane(dataTable); //the table will take all the viewport height available dataTable.setFillsViewportHeight(true); scrollPane.getViewport().setBackground(Color.white); dataTable.getTableHeader().setReorderingAllowed(false); //row and column selection must be false //dataTable.setColumnSelectionAllowed(false); //dataTable.setRowSelectionAllowed(false); dRPanel.getDatatableDRPanel().add(scrollPane, BorderLayout.CENTER); setLogTransform(true); /** * Action listeners for uppermost panel. */ //this button is ONLY used when going from the loading to the analysis genericDRParentPanel.getNextButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { genericDRParentPanel.getNextButton().setEnabled(false); genericDRParentPanel.getCancelButton().setEnabled(true); //save any metadata that was provided manually loadGenericDRDataController.setManualMetaData(importedDRDataHolder); //switch between child panels getCardLayout().next(genericDRParentPanel.getContentPanel()); onCardSwitch(); } }); genericDRParentPanel.getCancelButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // warn the user and reset everything Object[] options = { "Yes", "No" }; int showOptionDialog = JOptionPane.showOptionDialog(null, "Current analysis won't be saved. Continue?", "", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[1]); if (showOptionDialog == 0) { // reset everything resetOnCancel(); } } }); /** * Action listeners for shared panel. When button is selected, switch * view to corresponding subview */ dRPanel.getInputDRButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //switch shared table view updateModelInTable(dRInputController.getTableModel()); updateTableInfoMessage("This table contains all conditions and their respective responses"); /** * for (int columnIndex = 0; columnIndex < * dataTable.getColumnCount(); columnIndex++) { * GuiUtils.packColumn(dataTable, columnIndex); } */ dataTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT)); //remove other panels dRInitialController.getInitialChartPanel().setChart(null); dRNormalizedController.getNormalizedChartPanel().setChart(null); dRResultsController.getDupeInitialChartPanel().setChart(null); dRResultsController.getDupeNormalizedChartPanel().setChart(null); dRPanel.getGraphicsDRParentPanel().removeAll(); dRPanel.getGraphicsDRParentPanel().revalidate(); dRPanel.getGraphicsDRParentPanel().repaint(); //add panel to view dRPanel.getGraphicsDRParentPanel().add(dRInputController.getdRInputPanel(), gridBagConstraints); } }); dRPanel.getInitialPlotDRButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (dRAnalysisGroup != null) { if (isFirstFitting()) { initFirstFitting(); setFirstFitting(false); } //switch shared table view updateModelInTable(dRInitialController.getTableModel()); updateTableInfoMessage( "If you checked the box at the import screen, the doses have been log-transformed. Responses have not been changed"); /** * for (int columnIndex = 0; columnIndex < * dataTable.getColumnCount(); columnIndex++) { * GuiUtils.packColumn(dataTable, columnIndex); } */ dataTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT)); //remove other panels dRNormalizedController.getNormalizedChartPanel().setChart(null); dRResultsController.getDupeInitialChartPanel().setChart(null); dRResultsController.getDupeNormalizedChartPanel().setChart(null); dRPanel.getGraphicsDRParentPanel().removeAll(); dRPanel.getGraphicsDRParentPanel().revalidate(); dRPanel.getGraphicsDRParentPanel().repaint(); dRPanel.getGraphicsDRParentPanel().add(dRInitialController.getDRInitialPlotPanel(), gridBagConstraints); //Plot fitted data in dose-response curve, along with R annotation plotDoseResponse(dRInitialController.getInitialChartPanel(), dRInitialController.getDRInitialPlotPanel().getDoseResponseChartParentPanel(), getDataToFit(false), getdRAnalysisGroup(), false); } } }); dRPanel.getNormalizedPlotDRButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (dRAnalysisGroup != null) { //in case user skips "initial" subview and goes straight to normalization if (isFirstFitting()) { initFirstFitting(); setFirstFitting(false); } //switch shared table view updateModelInTable(dRNormalizedController.getTableModel()); updateTableInfoMessage( "Potentially log-transformed doses with their normalized responses per replicate"); /** * for (int columnIndex = 0; columnIndex < * dataTable.getColumnCount(); columnIndex++) { * GuiUtils.packColumn(dataTable, columnIndex); } */ dataTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT)); //remove other panels dRInitialController.getInitialChartPanel().setChart(null); dRResultsController.getDupeInitialChartPanel().setChart(null); dRResultsController.getDupeNormalizedChartPanel().setChart(null); dRPanel.getGraphicsDRParentPanel().removeAll(); dRPanel.getGraphicsDRParentPanel().revalidate(); dRPanel.getGraphicsDRParentPanel().repaint(); dRPanel.getGraphicsDRParentPanel().add(dRNormalizedController.getDRNormalizedPlotPanel(), gridBagConstraints); //Plot fitted data in dose-response curve, along with R annotation plotDoseResponse(dRNormalizedController.getNormalizedChartPanel(), dRNormalizedController.getDRNormalizedPlotPanel().getDoseResponseChartParentPanel(), getDataToFit(true), getdRAnalysisGroup(), true); } } }); dRPanel.getResultsDRButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (dRAnalysisGroup != null) { //switch shared table view: create and set new table model with most recent statistical values // (these values get recalculated after each new fitting) dRResultsController.setTableModel(dRResultsController.reCreateTableModel(dRAnalysisGroup)); updateModelInTable(dRResultsController.getTableModel()); updateTableInfoMessage( "Statistical values from the curve fit of the initial and normalized data."); //remove other panels dRInitialController.getInitialChartPanel().setChart(null); dRNormalizedController.getNormalizedChartPanel().setChart(null); dRPanel.getGraphicsDRParentPanel().removeAll(); dRPanel.getGraphicsDRParentPanel().revalidate(); dRPanel.getGraphicsDRParentPanel().repaint(); dRPanel.getGraphicsDRParentPanel().add(dRResultsController.getdRResultsPanel(), gridBagConstraints); //plot curves dRResultsController.plotCharts(); } } }); //add views to parent panels cellMissyController.getCellMissyFrame().getDoseResponseAnalysisParentPanel().add(genericDRParentPanel, gridBagConstraints); genericDRParentPanel.getDataLoadingPanel().add(loadGenericDRDataController.getDataLoadingPanel(), gridBagConstraints); genericDRParentPanel.getDoseResponseParentPanel().add(dRPanel, gridBagConstraints); }
From source file:com.diversityarrays.kdxplore.KDXploreFrame.java
KDXploreFrame(ApplicationFolder appFolder, String title, int versionCode, String version, Closure<UpdateCheckContext> updateChecker) throws IOException { super(title); this.applicationFolder = appFolder; this.baseTitle = title; this.versionCode = versionCode; this.version = version; this.updateChecker = updateChecker; KdxploreConfig config = KdxploreConfig.getInstance(); this.onlineHelpUrl = config.getOnlineHelpUrl(); String supportEmail = config.getSupportEmail(); if (Check.isEmpty(supportEmail)) { supportEmail = "someone@somewhere"; //$NON-NLS-1$ }//from www . j a v a 2 s .c o m DefaultUncaughtExceptionHandler eh = new DefaultUncaughtExceptionHandler(this, appFolder.getApplicationName() + "_Error", //$NON-NLS-1$ supportEmail, version + "(" + versionCode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ Thread.setDefaultUncaughtExceptionHandler(eh); MsgBox.DEFAULT_PROBLEM_REPORTER = eh; this.userDataFolder = applicationFolder.getUserDataFolder(); this.loginUrlsProvider = new PropertiesLoginUrlsProvider(CommandArgs.getPropertiesFile(applicationFolder)); displayVersion = RunMode.getRunMode().isDeveloper() ? version + "-dev" //$NON-NLS-1$ : version; List<? extends Image> iconImages = loadIconImages(); iconImage = iconImageBig != null ? iconImageBig : iconImageSmall; kdxploreIcon = new ImageIcon(iconImageSmall != null ? iconImageSmall : iconImageBig); setIconImages(iconImages); if (Util.isMacOS()) { try { System.setProperty("apple.laf.useScreenMenuBar", "true"); //$NON-NLS-1$ //$NON-NLS-2$ macapp = new MacApplication(null); macapp.setAboutHandler(aboutAction); macapp.setQuitHandler(exitAction); if (iconImage != null) { macapp.setDockIconImage(iconImage); } macapp.setPreferencesHandler(settingsAction); macapp.setAboutHandler(aboutAction); macapp.setQuitHandler(exitAction); } catch (MacApplicationException e) { macapp = null; Shared.Log.w(TAG, "isMacOS", e); //$NON-NLS-1$ } } if (iconImage != null) { this.setIconImage(iconImage); } clientProvider = new DefaultDALClientProvider(this, loginUrlsProvider, createBrandingImageComponent()); clientProvider.setCanChangeUrl(false); clientProvider.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { handleClientChanged(); } }); connectDisconnectActions = new ConnectDisconnectActions(clientProvider, Msg.TOOLTIP_CONNECT_TO_DATABASE(), Msg.TOOLTIP_DISCONNECT_FROM_DATABASE()); connectDisconnectActions.setConnectIntercept(connectIntercept); desktopSupport = new DefaultDesktopSupport(KDXploreFrame.this, baseTitle); frameWindowOpener = new DefaultFrameWindowOpener(desktopSupport) { @Override public Image getIconImage() { return iconImage; } }; frameWindowOpener.setOpenOnSameScreenAs(KDXploreFrame.this); setGlassPane(desktopSupport.getBlockingPane()); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(windowListener); initialiseKdxApps(); JMenuBar mb = buildMenuBar(); if (iconImage != null) { backgroundPanel.setBackgroundImage(iconImage); } else { backgroundPanel.setBackgroundImage(KDClientUtils.getImage(ImageId.DART_LOGO_128x87)); } backgroundPanel.setBackground(Color.decode("0xccffff")); //$NON-NLS-1$ splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, cardPanel, messagesPanel); splitPane.setResizeWeight(0.8); // = = = = = = Container cp = getContentPane(); cp.add(splitPane, BorderLayout.CENTER); statusInfoLine.setHorizontalAlignment(SwingConstants.LEFT); logoImagesLabel = new LogoImagesLabel(); JPanel bottom = new JPanel(new BorderLayout()); bottom.add(statusInfoLine, BorderLayout.CENTER); bottom.add(logoImagesLabel, BorderLayout.EAST); cp.add(bottom, BorderLayout.SOUTH); addWindowListener(new WindowAdapter() { @Override public void windowOpened(WindowEvent e) { removeWindowListener(this); logoImagesLabel.startCycling(); } }); showCard(CARD_KDXAPPS); setJMenuBar(mb); pack(); Dimension size = getSize(); boolean changed = false; if (size.width < MINIMUM_SIZE.width) { size.width = MINIMUM_SIZE.width; changed = true; } if (size.height < MINIMUM_SIZE.height) { size.height = MINIMUM_SIZE.height; changed = true; } if (changed) { setSize(size); } setLocationRelativeTo(null); final MemoryUsageMonitor mum = new MemoryUsageMonitor(); mum.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { updateStatusLineWithMemoryUsage(mum.getMemoryUsage()); } }); }
From source file:levelBuilder.DialogMaker.java
/** * Provides instructions for using the program. *//*from w w w. j a v a 2 s . c o m*/ private static void instructionsWindow() { JFrame frame = new JFrame("Instructions"); JPanel panel = new JPanel(new GridLayout(0, 1, 0, 0)); panel.add(new JLabel("DO NOT USE THE RIGHT CLICK MENU.", SwingConstants.LEFT)); panel.add(new JLabel("DO NOT REMOVE NODES OR VERTICES WITH THIS GUI. EDIT THE XML FILE INSTEAD.", SwingConstants.LEFT)); panel.add(new JLabel("", SwingConstants.LEFT)); panel.add( new JLabel("The 'Check' button runs various checks to make sure the graph does not contain errors.", SwingConstants.LEFT)); panel.add(new JLabel("", SwingConstants.LEFT)); panel.add(new JLabel("Transforming mode:", SwingConstants.LEFT)); panel.add(new JLabel("Shift + click + drag to rotate", SwingConstants.LEFT)); panel.add(new JLabel("Scroll to zoom", SwingConstants.LEFT)); panel.add(new JLabel("Command + click + drag to to weird stretchy thing", SwingConstants.LEFT)); panel.add(new JLabel("", SwingConstants.LEFT)); panel.add(new JLabel("Picking mode:", SwingConstants.LEFT)); panel.add(new JLabel("Click + drag to select multiple nodes", SwingConstants.LEFT)); panel.add(new JLabel("Click + drag moves node or group of nodes", SwingConstants.LEFT)); panel.add(new JLabel("Only in picking mode can you see different strategies", SwingConstants.LEFT)); panel.add(new JLabel("New strategies will also only appear after refocusing on the main window", SwingConstants.LEFT)); panel.add(new JLabel("", SwingConstants.LEFT)); panel.add(new JLabel("Editing mode:", SwingConstants.LEFT)); panel.add(new JLabel("Click + drag from one node to another creates an edge", SwingConstants.LEFT)); panel.add(new JLabel("After drawing a new edge you have to click the 'new edge' button", SwingConstants.LEFT)); panel.add(new JLabel("Click to add a new node", SwingConstants.LEFT)); panel.setOpaque(true); frame.setContentPane(panel); frame.pack(); frame.setLocation(windowWidth, verticalWindowPlacement); frame.setVisible(true); verticalWindowPlacement += frame.getBounds().height; }
From source file:de.dmarcini.submatix.pclogger.gui.ProgramProperetysDialog.java
/** * Initialisiere das Fenster Project: SubmatixBTForPC Package: de.dmarcini.submatix.pclogger.gui * //from ww w . j a v a2 s .co m * @author Dirk Marciniak (dirk_marciniak@arcor.de) Stand: 03.08.2012 */ private void initDialog() { setResizable(false); setIconImage(Toolkit.getDefaultToolkit().getImage( ProgramProperetysDialog.class.getResource("/de/dmarcini/submatix/pclogger/res/search.png"))); // setVisible( true ); setBounds(100, 100, 750, 417); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.SOUTH); { btnCancel = new JButton(LangStrings.getString("ProgramProperetysDialog.btnCancel.text")); //$NON-NLS-1$ btnCancel.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/de/dmarcini/submatix/pclogger/res/114.png"))); btnCancel.setHorizontalAlignment(SwingConstants.LEFT); btnCancel.setIconTextGap(15); btnCancel.setPreferredSize(new Dimension(180, 40)); btnCancel.setMaximumSize(new Dimension(160, 40)); btnCancel.setMargin(new Insets(6, 30, 6, 30)); btnCancel.setForeground(Color.RED); btnCancel.setBackground(new Color(255, 192, 203)); btnCancel.setActionCommand("cancel"); btnCancel.addActionListener(this); btnCancel.addMouseMotionListener(this); } { btnOk = new JButton(LangStrings.getString("ProgramProperetysDialog.btnOk.text")); //$NON-NLS-1$ btnOk.setIconTextGap(15); btnOk.setHorizontalAlignment(SwingConstants.LEFT); btnOk.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/de/dmarcini/submatix/pclogger/res/31.png"))); btnOk.setPreferredSize(new Dimension(180, 40)); btnOk.setMaximumSize(new Dimension(160, 40)); btnOk.setMargin(new Insets(6, 30, 6, 30)); btnOk.setForeground(new Color(0, 100, 0)); btnOk.setBackground(new Color(152, 251, 152)); btnOk.setActionCommand("set_propertys"); btnOk.addActionListener(this); btnOk.addMouseMotionListener(this); } unitsPanel = new JPanel(); unitsPanel.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), " UNITS ", TitledBorder.LEADING, TitledBorder.TOP, null, null)); pahtsPanel = new JPanel(); pahtsPanel.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), " DIRECTORYS ", TitledBorder.LEADING, TitledBorder.TOP, null, null)); GroupLayout gl_contentPanel = new GroupLayout(contentPanel); gl_contentPanel.setHorizontalGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING).addGroup( Alignment.LEADING, gl_contentPanel.createSequentialGroup().addContainerGap().addGroup(gl_contentPanel .createParallelGroup(Alignment.LEADING) .addComponent(pahtsPanel, GroupLayout.PREFERRED_SIZE, 714, GroupLayout.PREFERRED_SIZE) .addGroup(gl_contentPanel.createSequentialGroup() .addComponent(btnCancel, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED, 394, Short.MAX_VALUE) .addComponent(btnOk, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE)) .addComponent(unitsPanel, GroupLayout.DEFAULT_SIZE, 714, Short.MAX_VALUE)) .addContainerGap())); gl_contentPanel.setVerticalGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING) .addGroup(gl_contentPanel.createSequentialGroup() .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pahtsPanel, GroupLayout.PREFERRED_SIZE, 225, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(unitsPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE) .addComponent(btnOk, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE) .addComponent(btnCancel, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)))); databaseDirLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.databaseDirLabel.text")); //$NON-NLS-1$ databaseDirTextField = new JTextField(); databaseDirTextField.setEditable(false); databaseDirTextField.addMouseMotionListener(this); databaseDirTextField.setColumns(10); logfileLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.logFileLabel.text")); //$NON-NLS-1$ logfileNameTextField = new JTextField(); logfileNameTextField.setEditable(false); logfileNameTextField.addMouseMotionListener(this); logfileNameTextField.setColumns(10); moveDataCheckBox = new JCheckBox(LangStrings.getString("ProgramProperetysDialog.moveDataCheckBox.text")); //$NON-NLS-1$ moveDataCheckBox.addMouseMotionListener(this); databaseDirFileButton = new JButton(""); databaseDirFileButton.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/javax/swing/plaf/metal/icons/ocean/directory.gif"))); databaseDirFileButton.addActionListener(this); databaseDirFileButton.setActionCommand("choose_datadir"); databaseDirFileButton.addMouseMotionListener(this); logfileNameButton = new JButton(""); logfileNameButton.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/javax/swing/plaf/metal/icons/ocean/directory.gif"))); logfileNameButton.addActionListener(this); logfileNameButton.setActionCommand("choose_logfile"); logfileNameButton.addMouseMotionListener(this); exportDirLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.exportDirLabel.text")); //$NON-NLS-1$ exportDirTextField = new JTextField(); exportDirTextField.setEditable(false); exportDirTextField.setColumns(10); exportDirButton = new JButton(""); exportDirButton.setIcon(new ImageIcon( ProgramProperetysDialog.class.getResource("/javax/swing/plaf/metal/icons/ocean/directory.gif"))); exportDirButton.setActionCommand("choose_exportdir"); exportDirButton.addActionListener(this); exportDirButton.addMouseMotionListener(this); GroupLayout gl_pahtsPanel = new GroupLayout(pahtsPanel); gl_pahtsPanel.setHorizontalGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING).addGroup(gl_pahtsPanel .createSequentialGroup().addContainerGap() .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, gl_pahtsPanel.createSequentialGroup().addGroup(gl_pahtsPanel .createParallelGroup(Alignment.LEADING) .addGroup(gl_pahtsPanel.createSequentialGroup() .addComponent(databaseDirLabel, GroupLayout.DEFAULT_SIZE, 419, Short.MAX_VALUE) .addGap(193)) .addGroup(gl_pahtsPanel.createSequentialGroup() .addComponent(databaseDirTextField, GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED))) .addComponent(databaseDirFileButton, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)) .addComponent(moveDataCheckBox, Alignment.TRAILING) .addGroup(Alignment.TRAILING, gl_pahtsPanel.createSequentialGroup() .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_pahtsPanel.createSequentialGroup() .addComponent(logfileLabel, GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE) .addGap(267)) .addGroup(Alignment.TRAILING, gl_pahtsPanel.createSequentialGroup() .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.TRAILING) .addComponent(exportDirLabel, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE) .addComponent(logfileNameTextField, GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE) .addComponent(exportDirTextField, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED))) .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING) .addComponent(logfileNameButton, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE) .addComponent(exportDirButton, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)))) .addContainerGap())); gl_pahtsPanel.setVerticalGroup(gl_pahtsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_pahtsPanel.createSequentialGroup() .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.TRAILING) .addComponent(databaseDirFileButton, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) .addGroup(gl_pahtsPanel.createSequentialGroup().addComponent(databaseDirLabel) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(databaseDirTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED))) .addGap(1).addComponent(moveDataCheckBox).addGap(18) .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.TRAILING) .addComponent(logfileNameButton, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE) .addGroup(gl_pahtsPanel.createSequentialGroup().addComponent(logfileLabel) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(logfileNameTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addGap(18).addComponent(exportDirLabel).addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_pahtsPanel.createParallelGroup(Alignment.BASELINE) .addComponent(exportDirTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(exportDirButton, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)) .addGap(24))); pahtsPanel.setLayout(gl_pahtsPanel); defaultUnitsRadioButton = new JRadioButton( LangStrings.getString("ProgramPropertysDialog.defaultUnitsRadioButton.text")); //$NON-NLS-1$ defaultUnitsRadioButton.setSelected(true); defaultUnitsRadioButton.setActionCommand("rbutton"); defaultUnitsRadioButton.addActionListener(this); metricUnitsRadioButton = new JRadioButton( LangStrings.getString("ProgramPropertysDialog.metricUnitsRadioButton.text")); //$NON-NLS-1$ metricUnitsRadioButton.setActionCommand("rbutton"); metricUnitsRadioButton.addActionListener(this); imperialUnitsRadioButton = new JRadioButton( LangStrings.getString("ProgramPropertysDialog.imperialUnitsRadioButton.text")); //$NON-NLS-1$ imperialUnitsRadioButton.addActionListener(this); imperialUnitsRadioButton.setActionCommand("rbutton"); defaultUnitsLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.defaultUnitsLabel.text")); //$NON-NLS-1$ metricUnitsLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.metricUnitsLabel.text")); //$NON-NLS-1$ imperialUnitsLabel = new JLabel(LangStrings.getString("ProgramProperetysDialog.imperialUnitsLabel.text")); //$NON-NLS-1$ GroupLayout gl_untitsPanel = new GroupLayout(unitsPanel); gl_untitsPanel.setHorizontalGroup(gl_untitsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_untitsPanel.createSequentialGroup().addContainerGap() .addGroup(gl_untitsPanel.createParallelGroup(Alignment.LEADING, false) .addComponent(metricUnitsRadioButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(imperialUnitsRadioButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(defaultUnitsRadioButton, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(gl_untitsPanel.createParallelGroup(Alignment.LEADING) .addComponent(metricUnitsLabel, GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE) .addComponent(defaultUnitsLabel, GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE) .addComponent(imperialUnitsLabel, GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)) .addContainerGap())); gl_untitsPanel.setVerticalGroup(gl_untitsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_untitsPanel.createSequentialGroup() .addGroup(gl_untitsPanel.createParallelGroup(Alignment.BASELINE) .addComponent(defaultUnitsRadioButton).addComponent(defaultUnitsLabel)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_untitsPanel.createParallelGroup(Alignment.BASELINE) .addComponent(metricUnitsRadioButton).addComponent(metricUnitsLabel)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_untitsPanel.createParallelGroup(Alignment.BASELINE) .addComponent(imperialUnitsRadioButton).addComponent(imperialUnitsLabel)) .addContainerGap(10, Short.MAX_VALUE))); unitsPanel.setLayout(gl_untitsPanel); contentPanel.setLayout(gl_contentPanel); unitsButtonGroup = new ButtonGroup(); unitsButtonGroup.add(defaultUnitsRadioButton); unitsButtonGroup.add(metricUnitsRadioButton); unitsButtonGroup.add(imperialUnitsRadioButton); }
From source file:es.ubu.XRayDetector.interfaz.PanelAplicacion.java
/** * Gets the clear log button.//from w w w.jav a 2 s . c o m */ public void getBotonLimpiarLog() { btnLimpiarLog = new JButton("Limpiar Log"); btnLimpiarLog.setToolTipText("Limpia el \u00E1rea de texto del log"); btnLimpiarLog.setMaximumSize(new Dimension(95, 30)); btnLimpiarLog.setMinimumSize(new Dimension(95, 30)); btnLimpiarLog.setPreferredSize(new Dimension(95, 30)); btnLimpiarLog.setBounds(10, 281, 116, 30); btnLimpiarLog.addActionListener(new LimpiarLogListener()); btnLimpiarLog.setIcon(new ImageIcon("./res/img/app/trash.png")); btnLimpiarLog.setHorizontalTextPosition(SwingConstants.LEFT); btnLimpiarLog.setIconTextGap(5); panelLog_1.add(btnLimpiarLog); }
From source file:es.ubu.XRayDetector.interfaz.PanelAplicacion.java
/** * Gets the export log button./*www . j a va 2s . c o m*/ */ public void getBotonExportarLog() { btnExportarLog = new JButton("Exportar"); btnExportarLog.setToolTipText("Permite exportar el log a un HTML"); btnExportarLog.setBounds(136, 281, 116, 30); btnExportarLog.addActionListener(new ExportarLogListener()); btnExportarLog.setIcon(new ImageIcon("./res/img/app/exporthtml.png")); btnExportarLog.setHorizontalTextPosition(SwingConstants.LEFT); btnExportarLog.setIconTextGap(5); panelLog_1.add(btnExportarLog); }