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:edu.ku.brc.af.ui.forms.PanelViewable.java
public Component createSeparator(final String title) { int titleAlignment = builder.isLeftToRight() ? SwingConstants.LEFT : SwingConstants.RIGHT; JComponent titledSeparator = builder.getComponentFactory().createSeparator(title, titleAlignment); setControlSize(titledSeparator);/*from w w w.ja va 2s. c o m*/ return titledSeparator; }
From source file:org.lmn.fc.frameworks.starbase.plugins.observatory.ui.tabs.charts.ChartUIHelper.java
/*********************************************************************************************** * Create the default Toolbar for a Chart. * * @param obsinstrument/*from www. jav a2 s .co m*/ * @param chart * @param title * @param fontdata * @param colourforeground * @param colourbackground * @param debug * * @return JToolBar */ public static JToolBar createDefaultToolbar(final ObservatoryInstrumentInterface obsinstrument, final ChartUIComponentPlugin chart, final String title, final FontInterface fontdata, final ColourInterface colourforeground, final ColourInterface colourbackground, final boolean debug) { final JToolBar toolbar; if ((obsinstrument != null) && (chart != null)) { final List<Component> listComponentsToAdd; final JLabel labelName; listComponentsToAdd = new ArrayList<Component>(10); //------------------------------------------------------------------------------------- // Initialise the Label labelName = new JLabel(title, RegistryModelUtilities.getAtomIcon(obsinstrument.getHostAtom(), ObservatoryInterface.FILENAME_ICON_CHART_VIEWER), SwingConstants.LEFT) { static final long serialVersionUID = 7580736117336162922L; // Enable Antialiasing in Java 1.5 protected void paintComponent(final Graphics graphics) { final Graphics2D graphics2D = (Graphics2D) graphics; // For antialiasing text graphics2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); super.paintComponent(graphics2D); } }; labelName.setFont( fontdata.getFont().deriveFont(ReportTableHelper.SIZE_HEADER_FONT).deriveFont(Font.BOLD)); labelName.setForeground(colourforeground.getColor()); labelName.setIconTextGap(UIComponentPlugin.TOOLBAR_ICON_TEXT_GAP); listComponentsToAdd.add(new JToolBar.Separator(UIComponentPlugin.DIM_TOOLBAR_SEPARATOR_BUTTON)); listComponentsToAdd.add(labelName); listComponentsToAdd.add(new JToolBar.Separator(UIComponentPlugin.DIM_TOOLBAR_SEPARATOR)); listComponentsToAdd.add(Box.createHorizontalGlue()); UIComponentHelper.addToolbarPrintButtons(listComponentsToAdd, chart, chart.getChartPanel(), title, fontdata, colourforeground, colourbackground, debug); // Build the Toolbar using the Components, if any toolbar = UIComponentHelper.buildToolbar(listComponentsToAdd); } else { toolbar = new JToolBar(); } toolbar.setFloatable(false); toolbar.setMinimumSize(UIComponentPlugin.DIM_TOOLBAR_SIZE); toolbar.setPreferredSize(UIComponentPlugin.DIM_TOOLBAR_SIZE); toolbar.setMaximumSize(UIComponentPlugin.DIM_TOOLBAR_SIZE); toolbar.setBackground(colourbackground.getColor()); NavigationUtilities.updateComponentTreeUI(toolbar); return (toolbar); }
From source file:com.aw.core.format.FillerFormat.java
public static String alignLeft(String source, int length) { return fill(source, ' ', length, SwingConstants.LEFT); }
From source file:au.org.ala.delta.intkey.ui.FindInTaxaDialog.java
public FindInTaxaDialog(Intkey intkeyApp) { super(intkeyApp.getMainFrame(), false); setResizable(false);//from www . jav a2s . co m ResourceMap resourceMap = Application.getInstance().getContext().getResourceMap(FindInTaxaDialog.class); resourceMap.injectFields(this); ActionMap actionMap = Application.getInstance().getContext().getActionMap(this); _intkeyApp = intkeyApp; _numMatchedTaxa = 0; _currentMatchedTaxon = -1; _findAction = actionMap.get("findTaxa"); _nextAction = actionMap.get("nextFoundTaxon"); this.setTitle(windowTitle); getContentPane().setLayout(new BorderLayout(0, 0)); _pnlMain = new JPanel(); _pnlMain.setBorder(new EmptyBorder(20, 20, 20, 20)); getContentPane().add(_pnlMain, BorderLayout.CENTER); _pnlMain.setLayout(new BorderLayout(0, 0)); _pnlMainTop = new JPanel(); _pnlMain.add(_pnlMainTop, BorderLayout.NORTH); _pnlMainTop.setLayout(new BoxLayout(_pnlMainTop, BoxLayout.Y_AXIS)); _lblEnterSearchString = new JLabel(enterSearchStringCaption); _lblEnterSearchString.setBorder(new EmptyBorder(0, 0, 5, 0)); _lblEnterSearchString.setHorizontalAlignment(SwingConstants.LEFT); _lblEnterSearchString.setVerticalAlignment(SwingConstants.TOP); _lblEnterSearchString.setAlignmentY(Component.TOP_ALIGNMENT); _pnlMainTop.add(_lblEnterSearchString); _textField = new JTextField(); _textField.getDocument().addDocumentListener(new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { reset(); } @Override public void insertUpdate(DocumentEvent e) { reset(); } @Override public void changedUpdate(DocumentEvent e) { reset(); } }); _pnlMainTop.add(_textField); _textField.setColumns(10); _pnlMainMiddle = new JPanel(); _pnlMainMiddle.setBorder(new EmptyBorder(10, 0, 0, 0)); _pnlMain.add(_pnlMainMiddle, BorderLayout.CENTER); _pnlMainMiddle.setLayout(new BoxLayout(_pnlMainMiddle, BoxLayout.Y_AXIS)); _rdbtnSelectOne = new JRadioButton(selectOneCaption); _rdbtnSelectOne.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { reset(); } }); _pnlMainMiddle.add(_rdbtnSelectOne); _rdbtnSelectAll = new JRadioButton(selectAllCaption); _rdbtnSelectAll.setSelected(true); _rdbtnSelectAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { reset(); } }); _pnlMainMiddle.add(_rdbtnSelectAll); ButtonGroup radioButtonGroup = new ButtonGroup(); radioButtonGroup.add(_rdbtnSelectOne); radioButtonGroup.add(_rdbtnSelectAll); _pnlMainBottom = new JPanel(); _pnlMain.add(_pnlMainBottom, BorderLayout.SOUTH); _pnlMainBottom.setLayout(new BoxLayout(_pnlMainBottom, BoxLayout.Y_AXIS)); _chckbxSearchSynonyms = new JCheckBox(searchSynonymsCaption); _chckbxSearchSynonyms.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { reset(); } }); _pnlMainBottom.add(_chckbxSearchSynonyms); _chckbxSearchEliminatedTaxa = new JCheckBox(searchEliminatedTaxaCaption); _chckbxSearchEliminatedTaxa.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { reset(); } }); _pnlMainBottom.add(_chckbxSearchEliminatedTaxa); _pnlButtons = new JPanel(); _pnlButtons.setBorder(new EmptyBorder(20, 0, 0, 10)); getContentPane().add(_pnlButtons, BorderLayout.EAST); _pnlButtons.setLayout(new BorderLayout(0, 0)); _pnlInnerButtons = new JPanel(); _pnlButtons.add(_pnlInnerButtons, BorderLayout.NORTH); GridBagLayout gbl_pnlInnerButtons = new GridBagLayout(); gbl_pnlInnerButtons.columnWidths = new int[] { 0, 0 }; gbl_pnlInnerButtons.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_pnlInnerButtons.columnWeights = new double[] { 0.0, Double.MIN_VALUE }; gbl_pnlInnerButtons.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; _pnlInnerButtons.setLayout(gbl_pnlInnerButtons); _btnFindNext = new JButton(); _btnFindNext.setAction(_findAction); GridBagConstraints gbc_btnFind = new GridBagConstraints(); gbc_btnFind.fill = GridBagConstraints.HORIZONTAL; gbc_btnFind.insets = new Insets(0, 0, 5, 0); gbc_btnFind.gridx = 0; gbc_btnFind.gridy = 0; _pnlInnerButtons.add(_btnFindNext, gbc_btnFind); _btnPrevious = new JButton(); _btnPrevious.setAction(actionMap.get("previousFoundTaxon")); _btnPrevious.setEnabled(false); GridBagConstraints gbc_btnPrevious = new GridBagConstraints(); gbc_btnPrevious.insets = new Insets(0, 0, 5, 0); gbc_btnPrevious.gridx = 0; gbc_btnPrevious.gridy = 1; _pnlInnerButtons.add(_btnPrevious, gbc_btnPrevious); _btnDone = new JButton(); _btnDone.setAction(actionMap.get("findTaxaDone")); GridBagConstraints gbc_btnDone = new GridBagConstraints(); gbc_btnDone.fill = GridBagConstraints.HORIZONTAL; gbc_btnDone.gridx = 0; gbc_btnDone.gridy = 2; _pnlInnerButtons.add(_btnDone, gbc_btnDone); this.pack(); this.setLocationRelativeTo(_intkeyApp.getMainFrame()); }
From source file:net.sf.firemox.ui.wizard.About.java
/** * Creates a new instance of About <br> * /*from www .j av a 2 s . com*/ * @param parent */ public About(JFrame parent) { super(LanguageManager.getString("wiz_about.title"), LanguageManager.getString("wiz_about.description"), "mp64.gif", LanguageManager.getString("close"), 420, 620); JPanel thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setMaximumSize(new Dimension(32767, 26)); thanksPanel.setOpaque(false); JLabel jLabel5 = new JLabel(LanguageManager.getString("version") + " : "); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.RIGHT); jLabel5.setMaximumSize(new Dimension(100, 16)); jLabel5.setMinimumSize(new Dimension(100, 16)); jLabel5.setPreferredSize(new Dimension(100, 16)); thanksPanel.add(jLabel5); jLabel5 = new JLabel(IdConst.VERSION); thanksPanel.add(jLabel5); gameParamPanel.add(thanksPanel); thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setOpaque(false); JPanel thanksPanelLeft = new JPanel(new FlowLayout(FlowLayout.LEADING)); thanksPanelLeft.setLayout(new BoxLayout(thanksPanelLeft, BoxLayout.Y_AXIS)); thanksPanelLeft.setMaximumSize(new Dimension(100, 2000)); thanksPanelLeft.setMinimumSize(new Dimension(100, 16)); jLabel5 = new JLabel(LanguageManager.getString("thanks") + " : "); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.RIGHT); jLabel5.setMaximumSize(new Dimension(100, 16)); jLabel5.setMinimumSize(new Dimension(100, 16)); jLabel5.setPreferredSize(new Dimension(100, 16)); thanksPanelLeft.add(jLabel5); thanksPanel.add(thanksPanelLeft); thanksPanelLeft = new JPanel(); thanksPanelLeft.setLayout(new BoxLayout(thanksPanelLeft, BoxLayout.Y_AXIS)); StringBuilder contributors = new StringBuilder(); addContributor(contributors, "Fabrice Daugan", "developper", "france"); addContributor(contributors, "Hoani Cross", "developper", "frenchpolynesia"); addContributor(contributors, "nico100", "graphist", "france"); addContributor(contributors, "seingalt_tm", "graphist", "france"); addContributor(contributors, "surtur2", "tester", null); addContributor(contributors, "Jan Blaha", "developper", "cz"); addContributor(contributors, "Tureba", "developper", "brazil"); addContributor(contributors, "hakvf", "tester", "france"); addContributor(contributors, "Stefano \"Kismet\" Lenzi", "developper", "italian"); jLabel5 = new JLabel(contributors.toString()); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.LEFT); thanksPanelLeft.add(jLabel5); jLabel5 = new JLink("http://obsidiurne.free.fr", "morgil has designed the splash screen"); jLabel5.setFont(MToolKit.defaultFont); thanksPanelLeft.add(jLabel5); thanksPanel.add(thanksPanelLeft); gameParamPanel.add(thanksPanel); thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setMaximumSize(new Dimension(32767, 26)); thanksPanel.setOpaque(false); JLabel blanklbl = new JLabel(); blanklbl.setHorizontalAlignment(SwingConstants.RIGHT); blanklbl.setMaximumSize(new Dimension(100, 16)); blanklbl.setMinimumSize(new Dimension(100, 16)); blanklbl.setPreferredSize(new Dimension(100, 16)); thanksPanel.add(blanklbl); jLabel5 = new JLink( "http://sourceforge.net/tracker/?func=add&group_id=" + IdConst.PROJECT_ID + "&atid=601043", LanguageManager.getString("joindev")); jLabel5.setFont(MToolKit.defaultFont); thanksPanel.add(jLabel5); gameParamPanel.add(thanksPanel); thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setOpaque(false); jLabel5 = new JLabel(LanguageManager.getString("projecthome") + " : "); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.RIGHT); jLabel5.setMaximumSize(new Dimension(100, 16)); jLabel5.setMinimumSize(new Dimension(100, 16)); jLabel5.setPreferredSize(new Dimension(100, 16)); thanksPanel.add(jLabel5); jLabel5 = new JLink(IdConst.MAIN_PAGE, IdConst.MAIN_PAGE); jLabel5.setFont(MToolKit.defaultFont); thanksPanel.add(jLabel5); gameParamPanel.add(thanksPanel); // forum francais thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setOpaque(false); jLabel5 = new JLabel(LanguageManager.getString("othersites") + " : "); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.RIGHT); jLabel5.setMaximumSize(new Dimension(100, 16)); jLabel5.setMinimumSize(new Dimension(100, 16)); jLabel5.setPreferredSize(new Dimension(100, 16)); thanksPanel.add(jLabel5); jLabel5 = new JLink("http://www.Firemox.fr.st", UIHelper.getIcon("mpfrsml.gif"), SwingConstants.LEFT); jLabel5.setToolTipText(LanguageManager.getString("frenchforum.tooltip")); thanksPanel.add(jLabel5); jLabel5 = new JLabel(); jLabel5.setMaximumSize(new Dimension(1000, 16)); thanksPanel.add(jLabel5); gameParamPanel.add(thanksPanel); JTextArea disclaimer = new JTextArea(); disclaimer.setEditable(false); disclaimer.setLineWrap(true); disclaimer.setWrapStyleWord(true); disclaimer.setAutoscrolls(true); disclaimer.setTabSize(2); disclaimer.setFont(new Font("Arial", 0, 10)); // Then try and read it locally BufferedReader inGPL = null; try { inGPL = new BufferedReader(new InputStreamReader(MToolKit.getResourceAsStream(IdConst.FILE_LICENSE))); disclaimer.read(inGPL, ""); } catch (IOException e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(inGPL); } JScrollPane disclaimerSPanel = new JScrollPane(); disclaimerSPanel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); MToolKit.addOverlay(disclaimerSPanel); disclaimerSPanel.setViewportView(disclaimer); gameParamPanel.add(disclaimerSPanel); }
From source file:com.sec.ose.osi.ui.frm.main.identification.stringmatch.table.JTableInfoForSMFile.java
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);// w w w. j a v a 2 s . c om if (value != null) { if (table.getColumnName(column).equals("Version") || table.getColumnName(column).equals("Pending Hits") || table.getColumnName(column).equals("Status") || table.getColumnName(column).equals("Identified Hits") || table.getColumnName(column).equals("Files")) { setHorizontalAlignment(SwingConstants.CENTER); } else { setHorizontalAlignment(SwingConstants.LEFT); } comp.setToolTipText(String.valueOf(value)); if (table.getValueAt(row, TableModelForSMFile.COL_STATUS) != null && table.getValueAt(row, TableModelForSMFile.COL_STATUS).toString().equals("Identified")) { comp.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 12)); comp.setForeground(new Color(20, 20, 20)); } else if (table.getValueAt(row, TableModelForSMFile.COL_STATUS).toString().equals("Declared")) { comp.setForeground(new Color(150, 150, 150)); } else { comp.setForeground(new Color(20, 20, 20)); } } else { comp.setToolTipText(null); } return comp; }
From source file:be.ugent.maf.cellmissy.gui.controller.analysis.doseresponse.area.AreaDRInputController.java
/** * Initialize view// w w w .j a v a 2 s. com */ @Override protected void initDRInputPanel() { dRInputPanel = new DRInputPanel(); // control opaque property of bottom table dRInputPanel.getSlopesTableScrollPane().getViewport().setBackground(Color.white); slopesTable = dRInputPanel.getSlopesTable(); slopesTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT)); slopesTable.getTableHeader().setReorderingAllowed(false); slopesTable.setFillsViewportHeight(true); slopesTable.setModel(new NonEditableTableModel()); //create a ButtonGroup for the radioButtons used for analysis ButtonGroup experimentTypeRadioButtonGroup = new ButtonGroup(); //adding buttons to a ButtonGroup automatically deselect one when another one gets selected experimentTypeRadioButtonGroup.add(dRInputPanel.getStimulationRadioButton()); experimentTypeRadioButtonGroup.add(dRInputPanel.getInhibitionRadioButton()); //select as default first button (Stimulation) dRInputPanel.getStimulationRadioButton().setSelected(true); //initialize treatment choice dialog chooseTreatmentDialog = new ChooseTreatmentDialog(doseResponseController.getCellMissyFrame(), true); /* * Action listeners for buttons */ dRInputPanel.getAddConditionButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //add selected condition to analysis addToDRAnalysis(); } }); dRInputPanel.getRemoveConditionButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // remove condition from analysis removeFromDRAnalysis(); } }); /** * Choosing stimulation or inhibition type experiment defines standard * hillslope parameter */ dRInputPanel.getStimulationRadioButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doseResponseController.setStandardHillslope(1); } }); dRInputPanel.getInhibitionRadioButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { doseResponseController.setStandardHillslope(-1); } }); /** * When button is pressed, selection of combo box gets taken into * account as treatment to analyse and dialog closes. */ chooseTreatmentDialog.getSelectTreatmentButton().addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setTreatment(chooseTreatmentDialog.getTreatmentComboBox().getSelectedItem().toString()); chooseTreatmentDialog.setVisible(false); doseResponseController.setFirstFitting(true); } }); }
From source file:be.ac.ua.comp.scarletnebula.gui.ServerCellRenderer.java
private JLabel getServernameComponent(final Server server, final Color foreground) { final JLabel label = new JLabel(server.getFriendlyName(), getServerIcon(server), SwingConstants.LEFT); label.setOpaque(false);/*ww w.j a v a 2s . c o m*/ label.setForeground(foreground); return label; }
From source file:edu.ku.brc.specify.utilapps.ERDTable.java
/** * @param p/*w w w .j a v a 2 s. c o m*/ * @param tbl * @param font * @param y * @param all */ public void build(final PanelBuilder p, final DBTableInfo tbl, final Font font, final int y, boolean all) { String typ = StringUtils.substringAfterLast(tbl.getIdType(), "."); if (StringUtils.isEmpty(typ)) { typ = tbl.getIdType(); } CellConstraints cc = new CellConstraints(); p.add(ERDVisualizer.mkLabel(font, tbl.getIdColumnName(), SwingConstants.LEFT), cc.xy(1, y)); p.add(ERDVisualizer.mkLabel(font, typ, SwingConstants.CENTER), cc.xy(3, y)); p.add(ERDVisualizer.mkLabel(font, "", SwingConstants.CENTER), cc.xy(5, y)); if (all) { p.add(ERDVisualizer.mkLabel(font, yesStr, SwingConstants.CENTER), cc.xy(7, y)); p.add(ERDVisualizer.mkLabel(font, yesStr, SwingConstants.CENTER), cc.xy(9, y)); } }
From source file:be.ugent.maf.cellmissy.gui.controller.analysis.doseresponse.area.AreaDoseResponseController.java
/** * Called by parent controller, initialise tables *//*from w w w . j a v a 2s . com*/ public void onDoseResponse() { dRPanel.getInputDRButton().setSelected(true); dRInputController.initDRInputData(); //switch shared table view updateModelInTable(dRInputController.getTableModel()); dataTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT)); updateTableInfoMessage("This table contains all conditions and their respective slopes"); }