classdef BerandaKlasifikasiBatik < matlab.apps.AppBase

    % Properties that correspond to app components
    properties (Access = public)
        UIFigure         matlab.ui.Figure
        PanduanSistem_2  matlab.ui.control.Button
        Image2           matlab.ui.control.Image
        Keluar           matlab.ui.control.Button
        Sistem           matlab.ui.control.Button
        Panel            matlab.ui.container.Panel
        Label            matlab.ui.control.Label
        AplikasiKlasifikasiMotifBatikLabel  matlab.ui.control.Label
        Image            matlab.ui.control.Image
    end

    % Callbacks that handle component events
    methods (Access = private)

        % Button pushed function: Sistem
        function SistemPushed(app, event)
            app = KlasifikasiBatik;
        end

        % Button pushed function: PanduanSistem_2
        function PanduanSistem_2ButtonPushed(app, event)
        % Fungsi untuk menutup aplikasi
        delete(app.UIFigure); % Hapus atau tutup figure utama aplikasi
        app = PanduanSistem; % Mengalihkan ke panduan sistem (misalkan membuat instance baru)
        end

        % Button pushed function: Keluar
        function KeluarPushed(app, event)
            close all hidden;
        end
    end

    % Component initialization
    methods (Access = private)

        % Create UIFigure and components
        function createComponents(app)

            % Create UIFigure and hide until all components are created
            app.UIFigure = uifigure('Visible', 'off');
            app.UIFigure.Position = [100 100 640 480];
            app.UIFigure.Name = 'MATLAB App';

            % Create Image
            app.Image = uiimage(app.UIFigure);
            app.Image.ScaleMethod = 'fill';
            app.Image.Position = [1 0 640 481];
            app.Image.ImageSource = 'Background_Batik.jpg';

            % Create Panel
            app.Panel = uipanel(app.UIFigure);
            app.Panel.Position = [1 203 640 143];

            % Create AplikasiKlasifikasiMotifBatikLabel
            app.AplikasiKlasifikasiMotifBatikLabel = uilabel(app.Panel);
            app.AplikasiKlasifikasiMotifBatikLabel.HorizontalAlignment = 'center';
            app.AplikasiKlasifikasiMotifBatikLabel.FontSize = 16;
            app.AplikasiKlasifikasiMotifBatikLabel.FontWeight = 'bold';
            app.AplikasiKlasifikasiMotifBatikLabel.Position = [95 72 452 56];
            app.AplikasiKlasifikasiMotifBatikLabel.Text = {'KLASIFIKASI MOTIF BATIK MENGGUNAKAN K-NEAREST'; 'NEIGHBORS BERDASARKAN GRAY LEVEL  '; 'CO-OCCURRENCE MATRIX (GLCM)'};

            % Create Label
            app.Label = uilabel(app.Panel);
            app.Label.HorizontalAlignment = 'center';
            app.Label.FontSize = 14;
            app.Label.Position = [111 12 417 32];
            app.Label.Text = {'Dania Putri Windartik'; 'Teknik Informatika, Teknologi Informasi, Politeknik Negeri Jember'};

            % Create Sistem
            app.Sistem = uibutton(app.UIFigure, 'push');
            app.Sistem.ButtonPushedFcn = createCallbackFcn(app, @SistemPushed, true);
            app.Sistem.BackgroundColor = [0.9412 0.9412 0.9412];
            app.Sistem.FontWeight = 'bold';
            app.Sistem.Position = [163 146 153 30];
            app.Sistem.Text = 'Sistem';

            % Create Keluar
            app.Keluar = uibutton(app.UIFigure, 'push');
            app.Keluar.ButtonPushedFcn = createCallbackFcn(app, @KeluarPushed, true);
            app.Keluar.BackgroundColor = [1 0 0];
            app.Keluar.FontWeight = 'bold';
            app.Keluar.FontColor = [1 1 1];
            app.Keluar.Position = [529 22 77 30];
            app.Keluar.Text = 'Keluar';

            % Create Image2
            app.Image2 = uiimage(app.UIFigure);
            app.Image2.Position = [-21 439 212 31];
            app.Image2.ImageSource = 'Logo Polije Gabung (New).jpg';

            % Create PanduanSistem_2
            app.PanduanSistem_2 = uibutton(app.UIFigure, 'push');
            app.PanduanSistem_2.ButtonPushedFcn = createCallbackFcn(app, @PanduanSistem_2ButtonPushed, true);
            app.PanduanSistem_2.BackgroundColor = [0.9412 0.9412 0.9412];
            app.PanduanSistem_2.FontWeight = 'bold';
            app.PanduanSistem_2.Position = [344 146 153 30];
            app.PanduanSistem_2.Text = 'Panduan Sistem';

            % Show the figure after all components are created
            app.UIFigure.Visible = 'on';
        end
    end

    % App creation and deletion
    methods (Access = public)

        % Construct app
        function app = BerandaKlasifikasiBatik

            % Create UIFigure and components
            createComponents(app)

            % Register the app with App Designer
            registerApp(app, app.UIFigure)

            if nargout == 0
                clear app
            end
        end

        % Code that executes before app deletion
        function delete(app)

            % Delete UIFigure when app is deleted
            delete(app.UIFigure)
        end
    end
end