package _VisualDVM.Visual.Windows;
import Common.Visual.Windows.Dialog.Dialog;
import _VisualDVM.ComponentsServer.Component.UI.ComponentsFields;
import _VisualDVM.Global;

import java.awt.*;
public class ComponentsWindow extends Dialog<Object, ComponentsFields> {
    public ComponentsWindow() {
        super(ComponentsFields.class);
    }
    @Override
    public boolean NeedsScroll() {
        return false;
    }
    @Override
    public int getDefaultWidth() {
        return Global.normalProperties.ComponentsWindowWidth;
    }
    @Override
    public int getDefaultHeight() {
        return Global.normalProperties.ComponentsWindowHeight;
    }
    @Override
    public void CreateButtons() {
    }
    @Override
    public void Init(Object... params) {
        Global.components.ShowUI();
    }
    @Override
    public void LoadSize() {
        setMinimumSize(new Dimension(650, 250));
        Dimension dimension = new Dimension(getDefaultWidth(), getDefaultHeight());
        setPreferredSize(dimension);
        setSize(dimension);
    }
    @Override
    public void onClose() {
        super.onClose();
        Global.normalProperties.ComponentsWindowWidth = getWidth();
        Global.normalProperties.ComponentsWindowHeight = getHeight();
        Global.normalProperties.Update();
    }
}
