package Common.Visual.Controls;
import Common.MainModule_;
import Common.Passes.PassCode_;
import Common.Visual.Menus.VisualiserMenuBar;

import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class TabToolBar extends VisualiserMenuBar {
    public TabToolBar(String titleText, PassCode_... passes) {
        setFloatable(false);
        setOpaque(false);
        //-
        JLabel title = new JLabel(titleText);
        title.setOpaque(false);
        add(title);
        addSeparator();
        //-
        for (PassCode_ code : passes)
            add(MainModule_.instance.getPass(code).createTabButton());
        MouseAdapter adapter = new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                leftMouseAction();
            }
        };
        addMouseListener(adapter);
        title.addMouseListener(adapter);
    }
    public void leftMouseAction() {
    }
    @Override
    public void setSizeLimits() {
        // setPreferredSize(new Dimension(-1, 18));
    }
}
