Java Code Examples for java.awt.BorderLayout#WEST

The following examples show how to use java.awt.BorderLayout#WEST . These examples are extracted from open source projects. 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 Project: osp   File: ConstantParser.java    License: GNU General Public License v3.0 6 votes vote down vote up
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 Project: Logisim   File: Frame.java    License: GNU General Public License v3.0 5 votes vote down vote up
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
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
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 Project: pdfxtk   File: JWindowToolBarUI.java    License: Apache License 2.0 5 votes vote down vote up
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
@Override
public String getDefaultPosition() {
    return BorderLayout.WEST;
}
 
Example 7
Source Project: ramus   File: BranchView.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public String getDefaultPosition() {
    return BorderLayout.WEST;
}
 
Example 8
Source Project: ramus   File: ReportsView.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public String getDefaultPosition() {
    return BorderLayout.WEST;
}
 
Example 9
@Override
public String getDefaultPosition() {
    return BorderLayout.WEST;
}
 
Example 10
Source Project: ramus   File: RolesView.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public String getDefaultPosition() {
    return BorderLayout.WEST;
}
 
Example 11
Source Project: seaglass   File: ToolBarWestState.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public boolean isInState(JComponent c) {
    JToolBar toolbar = (JToolBar) c;

    return SeaGlassLookAndFeel.resolveToolbarConstraint(toolbar) == BorderLayout.WEST;
}