if (panel.getLayout() instanceof BorderLayout) { if (configuration.equalsIgnoreCase(WEST_CONFIG)) { panel.add(this, BorderLayout.WEST); } else if (configuration.equalsIgnoreCase(EAST_CONFIG)) { panel.add(this, BorderLayout.EAST); } else if (configuration.equalsIgnoreCase(NORTH_CONFIG)) { panel.add(this, BorderLayout.NORTH); } else if (configuration.equalsIgnoreCase(SOUTH_CONFIG)) { panel.add(this, BorderLayout.SOUTH); } else if (configuration.equalsIgnoreCase(NORTH_SOUTH_CONFIG)) { panel.add(up, BorderLayout.NORTH); panel.add(down, BorderLayout.SOUTH);
if (embedded) { createInterface();  setLayout(new BoxLayout(this, orientation));  if (panel.getLayout() instanceof BorderLayout) { if (configuration.equalsIgnoreCase(WEST_CONFIG)) { panel.add(this, BorderLayout.WEST); } else if (configuration.equalsIgnoreCase(EAST_CONFIG)) { panel.add(this, BorderLayout.EAST); } else if (configuration.equalsIgnoreCase(NORTH_CONFIG)) { panel.add(this, BorderLayout.NORTH); } else if (configuration.equalsIgnoreCase(SOUTH_CONFIG)) { panel.add(this, BorderLayout.SOUTH); } else if (configuration.equalsIgnoreCase(NORTH_SOUTH_CONFIG)) { panel.add(up, BorderLayout.NORTH); panel.add(down, BorderLayout.SOUTH); } } else { panel.add(this);
    public void setLayersPanel(LayersPanel panel) {        panel.addPropertyChangeListener(this);        addPropertyChangeListener(panel);        if (embedded) {            createInterface(); // again, reset for new config values            setLayout(new BoxLayout(this, orientation));            if (panel.getLayout() instanceof BorderLayout) {                if (configuration.equalsIgnoreCase(WEST_CONFIG)) {                    panel.add(this, BorderLayout.WEST);                } else if (configuration.equalsIgnoreCase(EAST_CONFIG)) {                    panel.add(this, BorderLayout.EAST);                } else if (configuration.equalsIgnoreCase(NORTH_CONFIG)) {                    panel.add(this, BorderLayout.NORTH);                } else if (configuration.equalsIgnoreCase(SOUTH_CONFIG)) {                    panel.add(this, BorderLayout.SOUTH);                } else if (configuration.equalsIgnoreCase(NORTH_SOUTH_CONFIG)) {                    panel.add(up, BorderLayout.NORTH);                    panel.add(down, BorderLayout.SOUTH);                }            } else {                panel.add(this);            }        }    }