package com.teamdev.jxmaps.demo;

import com.teamdev.jxmaps.examples.ControlPanel;

import javax.swing.*;
import java.awt.*;

class ContentView extends JPanel implements MenuListener {
    private JComponent sampleView;

    public ContentView() {
        setLayout(new GridLayout());
    }

    @Override
    public void sampleSelected(SampleDescriptor descriptor) {
        if (sampleView != null) {
            remove(sampleView);
            validate();
        }

        Dimension size = getSize();
        sampleView = descriptor.createInstance(size);

        add(sampleView, BorderLayout.CENTER);
        validate();
    }

    public ControlPanel getControlPanel() {
        if (sampleView instanceof ControlPanel) {
            return (ControlPanel) sampleView;
        } else {
            return null;
        }
    }
}

@@ -1,8 +1,123 @@
+/*%0A * Copyright (c) 2000-2016 TeamDev Ltd. All rights reserved.%0A * Use is subject to Apache 2.0 license terms.%0A */%0A
 package 

Add copyright header