mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Change the default position of the laid out component
This commit is contained in:
@@ -112,12 +112,12 @@ public final class HorizontalLayout implements LayoutManager2 {
|
||||
@Override
|
||||
public void addLayoutComponent(String name, Component component) {
|
||||
synchronized (component.getTreeLock()) {
|
||||
if (name == null || CENTER.equalsIgnoreCase(name)) {
|
||||
myCenter.add(component);
|
||||
}
|
||||
else if (LEFT.equalsIgnoreCase(name)) {
|
||||
if (name == null || LEFT.equalsIgnoreCase(name)) {
|
||||
myLeft.add(component);
|
||||
}
|
||||
else if (CENTER.equalsIgnoreCase(name)) {
|
||||
myCenter.add(component);
|
||||
}
|
||||
else if (RIGHT.equalsIgnoreCase(name)) {
|
||||
myRight.add(component);
|
||||
}
|
||||
@@ -242,7 +242,7 @@ public final class HorizontalLayout implements LayoutManager2 {
|
||||
if (result == null) {
|
||||
result = new Dimension();
|
||||
}
|
||||
else if (aligned) {
|
||||
else if (aligned && center != null) {
|
||||
int leftWidth = left == null ? 0 : left.width;
|
||||
int rightWidth = right == null ? 0 : right.width;
|
||||
result.width += Math.abs(leftWidth - rightWidth);
|
||||
|
||||
@@ -112,12 +112,12 @@ public final class VerticalLayout implements LayoutManager2 {
|
||||
@Override
|
||||
public void addLayoutComponent(String name, Component component) {
|
||||
synchronized (component.getTreeLock()) {
|
||||
if (name == null || CENTER.equalsIgnoreCase(name)) {
|
||||
myCenter.add(component);
|
||||
}
|
||||
else if (TOP.equalsIgnoreCase(name)) {
|
||||
if (name == null || TOP.equalsIgnoreCase(name)) {
|
||||
myTop.add(component);
|
||||
}
|
||||
else if (CENTER.equalsIgnoreCase(name)) {
|
||||
myCenter.add(component);
|
||||
}
|
||||
else if (BOTTOM.equalsIgnoreCase(name)) {
|
||||
myBottom.add(component);
|
||||
}
|
||||
@@ -242,7 +242,7 @@ public final class VerticalLayout implements LayoutManager2 {
|
||||
if (result == null) {
|
||||
result = new Dimension();
|
||||
}
|
||||
else if (aligned) {
|
||||
else if (aligned && center != null) {
|
||||
int topHeight = top == null ? 0 : top.height;
|
||||
int bottomHeight = bottom == null ? 0 : bottom.height;
|
||||
result.width += Math.abs(topHeight - bottomHeight);
|
||||
|
||||
@@ -66,9 +66,9 @@ final class Banner extends JPanel {
|
||||
}
|
||||
else {
|
||||
if (i > 0) {
|
||||
myLeftPanel.add(HorizontalLayout.LEFT, RelativeFont.HUGE.install(new JLabel("\u203A")));
|
||||
myLeftPanel.add(RelativeFont.HUGE.install(new JLabel("\u203A")));
|
||||
}
|
||||
myLeftPanel.add(HorizontalLayout.LEFT, RelativeFont.BOLD.install(new JLabel(name)));
|
||||
myLeftPanel.add(RelativeFont.BOLD.install(new JLabel(name)));
|
||||
}
|
||||
i += 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user