use of com.codename1.ui.layouts.BorderLayout in project codenameone-google-maps by codenameone.
the class MapInfoPanel method show.
public void show() {
if (getParent() != null) {
return;
}
Display disp = Display.getInstance();
if (disp.isTablet()) {
if (disp.isPortrait()) {
markers.setLayout(new BoxLayout(BoxLayout.X_AXIS));
for (Component marker : markers) {
if (marker instanceof Button) {
Button btnMarker = (Button) marker;
btnMarker.setTextPosition(Label.BOTTOM);
}
}
InteractionDialog dlg = new InteractionDialog("Map Info");
dlg.setLayout(new BorderLayout());
dlg.add(BorderLayout.CENTER, this);
int dh = disp.getDisplayHeight();
int dw = disp.getDisplayWidth();
dlg.show(3 * dh / 4, 0, 0, 0);
updateMapPosition();
} else {
markers.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
for (Component marker : markers) {
if (marker instanceof Button) {
Button btnMarker = (Button) marker;
btnMarker.setTextPosition(Label.RIGHT);
}
}
InteractionDialog dlg = new InteractionDialog("Map Info");
dlg.setLayout(new BorderLayout());
dlg.add(BorderLayout.CENTER, this);
int dh = disp.getDisplayHeight();
int dw = disp.getDisplayWidth();
// makeTransparent(dlg);
dlg.getAllStyles().setBorder(Border.createEmpty());
dlg.getAllStyles().setBgColor(0x0);
dlg.getAllStyles().setBgTransparency(128);
List<Component> dialogTitle = findByUIID("DialogTitle", dlg);
for (Component c : dialogTitle) {
c.getAllStyles().setFgColor(0xffffff);
}
List<Component> tabsContainer = findByUIID("TabsContainer", dlg);
for (Component c : tabsContainer) {
c.getAllStyles().setBgColor(0xEAEAEA);
// c.getAllStyles().setBackgroundType(Style.BACKGROUND_NONE);
c.getAllStyles().setBgTransparency(255);
}
;
dlg.show(0, 0, 0, dw * 3 / 4);
updateMapPosition();
System.out.println("Making transparent");
// makeTransparent(dlg);
}
} else {
if (disp.isPortrait()) {
markers.setLayout(new BoxLayout(BoxLayout.X_AXIS));
for (Component marker : markers) {
if (marker instanceof Button) {
Button btnMarker = (Button) marker;
btnMarker.setTextPosition(Label.BOTTOM);
}
}
InteractionDialog dlg = new InteractionDialog("Map Info");
dlg.setLayout(new BorderLayout());
dlg.add(BorderLayout.CENTER, this);
int dh = disp.getDisplayHeight();
int dw = disp.getDisplayWidth();
dlg.show(dh / 2, 0, 0, 0);
updateMapPosition();
} else {
markers.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
for (Component marker : markers) {
if (marker instanceof Button) {
Button btnMarker = (Button) marker;
btnMarker.setTextPosition(Label.RIGHT);
}
}
InteractionDialog dlg = new InteractionDialog("Map Info");
dlg.setLayout(new BorderLayout());
dlg.add(BorderLayout.CENTER, this);
int dh = disp.getDisplayHeight();
int dw = disp.getDisplayWidth();
dlg.show(0, dw / 2, 0, 0);
updateMapPosition();
}
}
}
Aggregations