Java Code Examples for java.awt.BorderLayout#WEST
The following examples show how to use
java.awt.BorderLayout#WEST .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConstantParser.java From osp with GNU General Public License v3.0 | 6 votes |
static public Value constraintsConstant(String _value) { _value = _value.trim().toLowerCase(); if(_value.equals("north")) { //$NON-NLS-1$ return new StringValue(BorderLayout.NORTH); } if(_value.equals("south")) { //$NON-NLS-1$ return new StringValue(BorderLayout.SOUTH); } if(_value.equals("east")) { //$NON-NLS-1$ return new StringValue(BorderLayout.EAST); } if(_value.equals("west")) { //$NON-NLS-1$ return new StringValue(BorderLayout.WEST); } if(_value.equals("center")) { //$NON-NLS-1$ return new StringValue(BorderLayout.CENTER); } return new StringValue(BorderLayout.CENTER); }
Example 2
Source File: Frame.java From Logisim with GNU General Public License v3.0 | 5 votes |
private void placeToolbar() { String loc = AppPreferences.TOOLBAR_PLACEMENT.get(); Container contents = getContentPane(); contents.remove(toolbar); mainPanelSuper.remove(toolbar); if (AppPreferences.TOOLBAR_HIDDEN.equals(loc)) { ; // don't place value anywhere } else if (AppPreferences.TOOLBAR_DOWN_MIDDLE.equals(loc)) { toolbar.setOrientation(Toolbar.VERTICAL); mainPanelSuper.add(toolbar, BorderLayout.WEST); } else { // it is a BorderLayout constant Object value = BorderLayout.NORTH; for (Direction dir : Direction.cardinals) { if (dir.toString().equals(loc)) { if (dir == Direction.EAST) value = BorderLayout.EAST; else if (dir == Direction.SOUTH) value = BorderLayout.SOUTH; else if (dir == Direction.WEST) value = BorderLayout.WEST; else value = BorderLayout.NORTH; } } contents.add(toolbar, value); boolean vertical = value == BorderLayout.WEST || value == BorderLayout.EAST; toolbar.setOrientation(vertical ? Toolbar.VERTICAL : Toolbar.HORIZONTAL); } contents.validate(); }
Example 3
Source File: ConnectDialog.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
public Labeled(final String label, final Font font, final Component toBeLabeled){ this.comp = toBeLabeled; this.leftLabel = new JLabel(label); if(font!=null) this.leftLabel.setFont(font); super.setLayout(new BorderLayout(6,6)); super.add(leftLabel,BorderLayout.WEST); super.add(comp,BorderLayout.CENTER); }
Example 4
Source File: GUIElementFactoryTest.java From snap-desktop with GNU General Public License v3.0 | 5 votes |
public void testAddComponentsToBorderPanel() { BorderLayout bl = new BorderLayout(); JPanel panel = new JPanel(bl); JTextArea centerComp = new JTextArea("textArea"); JLabel westComp = new JLabel("text"); String place = BorderLayout.WEST; BorderLayoutUtils.addToPanel(panel, centerComp, westComp, place); assertEquals(2, panel.getComponentCount()); assertEquals(true, panel.isAncestorOf(centerComp)); assertEquals(true, panel.isAncestorOf(westComp)); }
Example 5
Source File: JWindowToolBarUI.java From pdfxtk with Apache License 2.0 | 5 votes |
private String getDockingConstraint(Component c, Point p) { String result = BorderLayout.NORTH; boolean trBL = p.y * c.getWidth() < p.x * c.getHeight(); boolean tlBR = p.y < c.getHeight() + (p.x * -(c.getHeight()) / c.getWidth()); if(trBL && tlBR) result = BorderLayout.NORTH; if(trBL && !tlBR) result = BorderLayout.EAST; if(!trBL && tlBR) result = BorderLayout.WEST; if(!trBL && !tlBR) result = BorderLayout.SOUTH; // System.out.println(result); return result; }
Example 6
Source File: QualifierView.java From ramus with GNU General Public License v3.0 | 4 votes |
@Override public String getDefaultPosition() { return BorderLayout.WEST; }
Example 7
Source File: BranchView.java From ramus with GNU General Public License v3.0 | 4 votes |
@Override public String getDefaultPosition() { return BorderLayout.WEST; }
Example 8
Source File: ReportsView.java From ramus with GNU General Public License v3.0 | 4 votes |
@Override public String getDefaultPosition() { return BorderLayout.WEST; }
Example 9
Source File: AbstractUniqueView.java From ramus with GNU General Public License v3.0 | 4 votes |
@Override public String getDefaultPosition() { return BorderLayout.WEST; }
Example 10
Source File: RolesView.java From ramus with GNU General Public License v3.0 | 4 votes |
@Override public String getDefaultPosition() { return BorderLayout.WEST; }
Example 11
Source File: ToolBarWestState.java From seaglass with Apache License 2.0 | 4 votes |
/** * {@inheritDoc} */ public boolean isInState(JComponent c) { JToolBar toolbar = (JToolBar) c; return SeaGlassLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.WEST; }