package _VisualDVM.Visual.Windows;
import Visual_DVM_2021.Passes.PassCode;
import _VisualDVM.Global;
import _VisualDVM.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( Global.mainModule.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));
    }
}
