List of usage examples for java.awt BorderLayout WEST
String WEST
To view the source code for java.awt BorderLayout WEST.
Click Source Link
From source file:playground.sergioo.facilitiesGenerator2012.gui.ClustersWindow.java
public ClustersWindow(String title, Map<Integer, Cluster<Double>> clusters, int numTotalPoints) { setTitle(title);//from w w w. ja va2 s.com setDefaultCloseOperation(EXIT_ON_CLOSE); this.setLocation(0, 0); this.setLayout(new BorderLayout()); layersPanels.put(PanelIds.ONE, new ClustersPanel(this, clusters, numTotalPoints)); this.add(layersPanels.get(PanelIds.ONE), BorderLayout.CENTER); option = Options.ZOOM; JPanel buttonsPanel = new JPanel(); buttonsPanel.setLayout(new GridLayout(Options.values().length, 1)); for (Options option : Options.values()) { JButton optionButton = new JButton(option.getCaption()); optionButton.setActionCommand(option.getCaption()); optionButton.addActionListener(this); buttonsPanel.add(optionButton); } this.add(buttonsPanel, BorderLayout.EAST); JPanel infoPanel = new JPanel(); infoPanel.setLayout(new BorderLayout()); readyButton = new JButton("Ready to exit"); readyButton.addActionListener(this); readyButton.setActionCommand(READY_TO_EXIT); infoPanel.add(readyButton, BorderLayout.WEST); JPanel labelsPanel = new JPanel(); labelsPanel.setLayout(new GridLayout(1, Labels.values().length)); labelsPanel.setBorder(new TitledBorder("Information")); labels = new JTextField[Labels.values().length]; for (int i = 0; i < Labels.values().length; i++) { labels[i] = new JTextField(""); labels[i].setEditable(false); labels[i].setBackground(null); labels[i].setBorder(null); labelsPanel.add(labels[i]); } infoPanel.add(labelsPanel, BorderLayout.CENTER); JPanel coordsPanel = new JPanel(); coordsPanel.setLayout(new GridLayout(1, 2)); coordsPanel.setBorder(new TitledBorder("Coordinates")); coordsPanel.add(lblCoords[0]); coordsPanel.add(lblCoords[1]); infoPanel.add(coordsPanel, BorderLayout.EAST); this.add(infoPanel, BorderLayout.SOUTH); pack(); }
From source file:playground.sergioo.workplaceCapacities2012.gui.ClustersWindow.java
public ClustersWindow(String title, Map<Integer, Cluster<Double>> clusters, int numTotalPoints) { setTitle(title);//w ww.j a v a 2s. c om setDefaultCloseOperation(HIDE_ON_CLOSE); this.setLocation(0, 0); this.setLayout(new BorderLayout()); layersPanels.put(PanelIds.ONE, new ClustersPanel(this, clusters, numTotalPoints)); this.add(layersPanels.get(PanelIds.ONE), BorderLayout.CENTER); option = Options.ZOOM; JPanel buttonsPanel = new JPanel(); buttonsPanel.setLayout(new GridLayout(Options.values().length, 1)); for (Options option : Options.values()) { JButton optionButton = new JButton(option.getCaption()); optionButton.setActionCommand(option.getCaption()); optionButton.addActionListener(this); buttonsPanel.add(optionButton); } this.add(buttonsPanel, BorderLayout.EAST); JPanel infoPanel = new JPanel(); infoPanel.setLayout(new BorderLayout()); readyButton = new JButton("Ready to exit"); readyButton.addActionListener(this); readyButton.setActionCommand(READY_TO_EXIT); infoPanel.add(readyButton, BorderLayout.WEST); JPanel labelsPanel = new JPanel(); labelsPanel.setLayout(new GridLayout(1, Labels.values().length)); labelsPanel.setBorder(new TitledBorder("Information")); labels = new JTextField[Labels.values().length]; for (int i = 0; i < Labels.values().length; i++) { labels[i] = new JTextField(""); labels[i].setEditable(false); labels[i].setBackground(null); labels[i].setBorder(null); labelsPanel.add(labels[i]); } infoPanel.add(labelsPanel, BorderLayout.CENTER); JPanel coordsPanel = new JPanel(); coordsPanel.setLayout(new GridLayout(1, 2)); coordsPanel.setBorder(new TitledBorder("Coordinates")); coordsPanel.add(lblCoords[0]); coordsPanel.add(lblCoords[1]); infoPanel.add(coordsPanel, BorderLayout.EAST); this.add(infoPanel, BorderLayout.SOUTH); pack(); }
From source file:org.bimserver.client.Client.java
public Client() { SwingUtil.setLookAndFeelToNice();/*from w w w . j a va 2s . com*/ try { setIconImage(ImageIO.read(getClass().getResource("logo_small.png"))); } catch (IOException e) { LOGGER.error("", e); } revisionPanel = new RevisionPanel(serviceHolder, this); revisionPanel.setMinimumSize(new Dimension(200, 150)); checkoutsPanel = new CheckoutsPanel(serviceHolder, this); checkoutsPanel.setMinimumSize(new Dimension(200, 150)); treePanel = new TreePanel(this, serviceHolder); JMenu auth = new JMenu("File"); JMenuItem changeAuth = new JMenuItem("(Re)connect"); changeAuth.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { SettingsFrame settingsFrame = new SettingsFrame(Client.this); settingsFrame.setVisible(true); } }); auth.add(changeAuth); JMenuBar menuBar = new JMenuBar(); menuBar.add(auth); setJMenuBar(menuBar); setTitle(APP_NAME + " - Not connected"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JSplitPane right = new JSplitPane(JSplitPane.VERTICAL_SPLIT, revisionPanel, checkoutsPanel); JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setPreferredSize(new Dimension(300, 300)); topPanel.add(treePanel, BorderLayout.WEST); topPanel.add(right, BorderLayout.CENTER); Console console = new Console(); JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topPanel, console); getContentPane().add(splitPane, BorderLayout.CENTER); setVisible(true); ConsoleAppender.setLogHandler(console); setSize(640, 550); LOGGER.info("Application started"); }
From source file:org.nuclos.client.wizard.steps.NuclosEntityAttributeValueListShipStep.java
@Override protected void initComponents() { lstValues = new ArrayList<ValueList>(); this.setLayout(new BorderLayout(5, 5)); pnlName = new JPanel(); pnlName.setLayout(new BorderLayout(5, 5)); lbName = new JLabel( SpringLocaleDelegate.getInstance().getMessage("wizard.step.attributevaluelist.7", "Name")); tfName = new JTextField(); tfName.setDocument(new LimitSpecialCharacterDocument(25)); pnlName.add(lbName, BorderLayout.WEST); pnlName.add(tfName, BorderLayout.CENTER); lbInfo = new JLabel(SpringLocaleDelegate.getInstance().getMessage("wizard.step.attributevaluelist.1", "Entitt ist schon vorhanden. Bitte anderen Namen vergeben!")); lbInfo.setForeground(Color.RED); lbInfo.setVisible(false);//from w w w.ja v a2 s.c om this.add(pnlName, BorderLayout.NORTH); this.add(subform, BorderLayout.CENTER); this.add(lbInfo, BorderLayout.SOUTH); subform.getSubformTable().setModel(new ValuelistTableModel()); JTextField textField = new JTextField(); textField.addFocusListener(NuclosWizardUtils.createWizardFocusAdapter()); DefaultCellEditor editor = new DefaultCellEditor(textField); editor.setClickCountToStart(1); subform.getSubformTable().setDefaultEditor(String.class, editor); subform.getSubformTable().setDefaultEditor(Date.class, new DateEditor()); ListenerUtil.registerSubFormToolListener(subform, this, new SubForm.SubFormToolListener() { @Override public void toolbarAction(String actionCommand) { if (SubForm.ToolbarFunction.fromCommandString(actionCommand) == SubForm.ToolbarFunction.NEW) { ValuelistTableModel model = (ValuelistTableModel) subform.getSubformTable().getModel(); lstValues.add(new ValueList()); model.fireTableDataChanged(); } } }); tfName.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { doSomeWork(e); } @Override public void insertUpdate(DocumentEvent e) { doSomeWork(e); } @Override public void changedUpdate(DocumentEvent e) { doSomeWork(e); } private void doSomeWork(DocumentEvent e) { try { String s = e.getDocument().getText(0, e.getDocument().getLength()); model.getAttribute().setValueListName(s); if (s.length() == 0) NuclosEntityAttributeValueListShipStep.this.setComplete(false); else NuclosEntityAttributeValueListShipStep.this.setComplete(true); if (model.getAttribute().isValueListNew()) { for (EntityMetaDataVO voEntity : MetaDataClientProvider.getInstance().getAllEntities()) { if (s.equals(voEntity.getEntity()) || ("V_EO_" + s).equalsIgnoreCase(voEntity.getDbEntity())) { NuclosEntityAttributeValueListShipStep.this.setComplete(false); lbInfo.setVisible(true); break; } NuclosEntityAttributeValueListShipStep.this.setComplete(true); lbInfo.setVisible(false); } } } catch (BadLocationException e1) { LOG.info("doSomeWork failed: " + e1, e1); } } }); }
From source file:edu.virginia.speclab.juxta.author.view.export.WebServiceExportDialog.java
public WebServiceExportDialog(JuxtaAuthorFrame frame, WebServiceClient wsClient) { super(frame); this.juxtaFrame = frame; if (wsClient == null) { this.wsClient = new WebServiceClient(frame.getWebServiceUrl()); } else {//from w ww . ja v a2 s . co m this.wsClient = wsClient; } // size and title the main dialog body setTitle("Juxta Web Export"); setResizable(false); setSize(495, 345); setLocationRelativeTo(getParent()); ((JPanel) getContentPane()).setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); getContentPane().setLayout(new BorderLayout(15, 15)); getContentPane().setBackground(Color.white); // add the logo to the top left JPanel logoPnl = new JPanel(); logoPnl.setBackground(Color.white); logoPnl.setLayout(new BoxLayout(logoPnl, BoxLayout.Y_AXIS)); logoPnl.add(new JLabel(JuxtaUserInterfaceStyle.JUXTA_LOGO)); logoPnl.add(Box.createVerticalGlue()); getContentPane().add(logoPnl, BorderLayout.WEST); createSetupPane(); createStatusPane(); getContentPane().add(this.setupPanel, BorderLayout.CENTER); getContentPane().add(createButtonBar(), BorderLayout.SOUTH); // create a single scheduled executor to periodically // check for export status. There can only be one at any // give time, so a pool seemed unnecessary this.scheduler = Executors.newSingleThreadScheduledExecutor(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); }
From source file:SortedTableModel.java
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component text;//from w w w . java 2s .co m JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); if (textRenderer != null) { text = textRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); } else { text = new JLabel((String) value, JLabel.CENTER); LookAndFeel.installColorsAndFont((JComponent) text, "TableHeader.background", "TableHeader.foreground", "TableHeader.font"); } panel.add(text, BorderLayout.CENTER); if (column == sortColumn) { BasicArrowButton bab = new BasicArrowButton( (sortAscending ? SwingConstants.NORTH : SwingConstants.SOUTH)); panel.add(bab, BorderLayout.WEST); } LookAndFeel.installBorder(panel, "TableHeader.cellBorder"); return panel; }
From source file:org.gvsig.remotesensing.profiles.gui.ZProfileOptionsPanel.java
public ZProfileOptionsPanel(ProfilePanel mainPanel) { super();/*from w w w .j av a 2s. co m*/ this.mapControl = mainPanel.getMapControl(); this.mainPanel = mainPanel; this.fLayer = mainPanel.getFlayer(); BorderLayout bd = new BorderLayout(); listener = new ZProfileOptionsListener(this); bd.setHgap(1); setLayout(bd); add(getTable(), BorderLayout.CENTER); add(getControlPanel(), BorderLayout.WEST); previousTool = mapControl.getCurrentTool(); initialize(); }
From source file:captureplugin.drivers.defaultdriver.AdditionalParams.java
/** * Create GUI//from w w w.j ava 2s. co m */ private void createGUI() { setTitle(mLocalizer.msg("Additional", "Additional Commands")); UiUtilities.registerForClosing(this); JPanel content = (JPanel) getContentPane(); content.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); content.setLayout(new BorderLayout()); content.add(createListPanel(), BorderLayout.WEST); content.add(createDetailsPanel(), BorderLayout.CENTER); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK)); JButton cancel = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL)); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okPressed(); } }); cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); } }); buttonPanel.add(ok); buttonPanel.add(cancel); content.add(buttonPanel, BorderLayout.SOUTH); mList.setSelectedIndex(0); mList.setCellRenderer(new ParamEntryCellRenderer()); CapturePlugin.getInstance().layoutWindow("additionalParams", this, new Dimension(400, 300)); }
From source file:Proiect.uploadFTP.java
public uploadFTP() { uploadFTP.setIconImage(/* w w w .j a va 2s . com*/ Toolkit.getDefaultToolkit().getImage(getClass().getClassLoader().getResource("assets/ico.png"))); uploadFTP.setUndecorated(true); uploadFTP.getRootPane().setBorder(BorderFactory.createLineBorder(Encrypter.color_black, 2)); uploadFTP.setSize(400, 240); uploadFTP.setLocationRelativeTo(Encrypter.Center); uploadFTP.setResizable(false); uploadFTP.setVisible(true); cm.registerComponent(uploadFTP); uploadFTP.setLayout(new BorderLayout()); pan1.setLayout(new BorderLayout()); pan2.setLayout(new BorderLayout()); inpan1.setLayout(new GridLayout(6, 2, 0, 10)); inpan2.setLayout(new GridLayout(1, 2, 20, 0)); pan3.setLayout(new BorderLayout()); pan4.setLayout(new FlowLayout()); uploadFTP.add(pan3, BorderLayout.EAST); pan3.add(adv, BorderLayout.SOUTH); uploadFTP.add(pan1, BorderLayout.NORTH); pan1.add(titleFTP, BorderLayout.WEST); pan1.add(exit, BorderLayout.EAST); uploadFTP.add(pan2, BorderLayout.CENTER); pan2.add(inpan1, BorderLayout.NORTH); inpan1.add(adress); inpan1.add(adressf); inpan1.add(user); inpan1.add(userf); inpan1.add(pass); inpan1.add(passf); inpan1.add(folder); inpan1.add(folderf); inpan1.add(filen); inpan1.add(filenf); inpan1.add(status); pan2.add(inpan2, BorderLayout.SOUTH); inpan2.add(browsef); inpan2.add(connect); uploadFTP.add(pan4, BorderLayout.WEST); propFTP(); actionFTP(); /* BOF Load state */ try { FileInputStream fileStream = new FileInputStream( ClassLoader.getSystemResource("upload.prop").getPath()); ObjectInputStream os = new ObjectInputStream(fileStream); adressf.setText(os.readObject().toString()); userf.setText(os.readObject().toString()); passf.setText(os.readObject().toString()); os.close(); fileStream.close(); } catch (FileNotFoundException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } catch (ClassNotFoundException e1) { e1.printStackTrace(); } /* EOF Load state */ }
From source file:edu.purdue.cc.bionet.ui.MoleculeDetailPanel.java
public MoleculeDetailPanel(Molecule molecule, Range range, DetailWindow detailWindow, int correlationMethod) { super(new BorderLayout()); Logger logger = Logger.getLogger(getClass()); this.molecule = molecule; this.correlations = detailWindow.getCorrelations(); this.correlationMethod = correlationMethod; logger.debug(String.format("Showing Molecule detail:\n" + "\tMolecule: %s\n\tRange: %s\n", this.molecule, range)); this.correlationRange = range.clone(); this.detailWindow = detailWindow; Language language = Settings.getLanguage(); this.moleculeDetailTable = DataTable.getMoleculeTable(this.correlations, this.molecule); this.correlationsTable = DataTable.getCorrelatedTable(this.correlations, this.molecule, this.correlationRange, this.correlationMethod); this.selectedMoleculeLabel = new JLabel(language.get("Selected Molecule")); this.showElementButton = new JButton(language.get("Show Element")); this.showCorrelationButton = new JButton(language.get("Show Correlation")); this.coefLabel = new JLabel(String.format(language.get("Correlations between %.3f and %.3f"), this.correlationRange.getMin(), this.correlationRange.getMax())); // JPanel leftPanel = new JPanel( new BorderLayout( )); // JPanel rightPanel = new JPanel( new BorderLayout( )); JPanel moleculePanel = new JPanel(new BorderLayout()); JPanel correlationPanel = new JPanel(new BorderLayout()); JPanel buttonPanel = new JPanel(new BorderLayout()); this.showElementButton.addActionListener(this); this.showCorrelationButton.addActionListener(this); buttonPanel.add(this.showElementButton, BorderLayout.WEST); buttonPanel.add(this.showCorrelationButton, BorderLayout.EAST); moleculePanel.add(this.selectedMoleculeLabel, BorderLayout.NORTH); moleculePanel.add(new JScrollPane(this.moleculeDetailTable), BorderLayout.CENTER); correlationPanel.add(this.coefLabel, BorderLayout.NORTH); correlationPanel.add(new JScrollPane(this.correlationsTable), BorderLayout.CENTER); correlationPanel.add(buttonPanel, BorderLayout.SOUTH); JSplitPane leftPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT, moleculePanel, correlationPanel); leftPanel.setDividerLocation(200);/*from w w w . j a v a2 s . c o m*/ // leftPanel.add( moleculePanel, BorderLayout.NORTH ); // leftPanel.add( correlationPanel, BorderLayout.CENTER ); JPanel rightPanel = new ResponseGraph(this.molecule.getSampleMap(this.correlations.getSamples())); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rightPanel); splitPane.setDividerLocation(300); this.add(splitPane, BorderLayout.CENTER); }