package views;_x000D_
_x000D_
import controllers.AccountController;_x000D_
import helpers.MenuButton;_x000D_
_x000D_
import javax.swing.*;_x000D_
import java.awt.*;_x000D_
import java.awt.event.ActionEvent;_x000D_
import java.awt.event.ActionListener;_x000D_
_x000D_
/**_x000D_
 * User: Reinier Koops_x000D_
 * Class: View, shows what the user sees (and gets its info through the controller)_x000D_
 */_x000D_
_x000D_
public class AccessView extends IpsenView implements ActionListener_x000D_
{_x000D_
    private AccountController controller;_x000D_
_x000D_
    private JTable table;_x000D_
    private JButton btnRightGrp, btnRight, btnAccount, btnStatistics;_x000D_
    private JPanel topPanel;_x000D_
_x000D_
    /**_x000D_
     * Class Constructor_x000D_
     * @param controller Account Controller_x000D_
     */_x000D_
_x000D_
    public AccessView(AccountController controller) // controller mist_x000D_
    {_x000D_
        //link aan betreffende controller_x000D_
_x000D_
        this.setLayout( new BorderLayout() );_x000D_
        topPanel = new JPanel();_x000D_
        topPanel.setPreferredSize( new Dimension( 1000, 68 ) );_x000D_
_x000D_
        //buttons afbeelding nog toewijzen_x000D_
_x000D_
        btnRight = new MenuButton( "assets/rechten.png", null, null );_x000D_
        btnRightGrp = new MenuButton( "assets/nw_rightgroep_btn.png", null, null );_x000D_
        btnAccount = new MenuButton( "assets/accounts.png", null, null );_x000D_
        btnStatistics = new MenuButton( "assets/statistiek_inzien", null, null );_x000D_
_x000D_
        //buttons laten werken als je erop klikt_x000D_
_x000D_
        btnRight.addActionListener( this );_x000D_
        btnAccount.addActionListener( this );_x000D_
        btnRightGrp.addActionListener( this );_x000D_
        btnStatistics.addActionListener( this );_x000D_
_x000D_
        //buttons toevoegen aan het topPanel_x000D_
_x000D_
        this.topPanel.add( btnRight );_x000D_
        this.topPanel.add( btnRightGrp );_x000D_
        this.topPanel.add( btnAccount );_x000D_
        this.topPanel.add( btnStatistics );_x000D_
_x000D_
        this.add( topPanel, BorderLayout.NORTH );_x000D_
_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * Method to actionPerformed changes the view, by using the controller and displaying the next view_x000D_
     *_x000D_
     * the actionPerfomed performs no action in this class only showing the buttons_x000D_
     */_x000D_
_x000D_
    @Override_x000D_
    public void actionPerformed( ActionEvent e )_x000D_
    {_x000D_
        Object s = e.getSource();_x000D_
        if (s == btnRight)_x000D_
        {_x000D_
            //Right button geselecteerd -> ga naar dit submenu_x000D_
//            AccessRightView accesRightView;_x000D_
//            {_x000D_
//                accesRightView = new AccessRightView();_x000D_
//            }_x000D_
        }_x000D_
_x000D_
        if (s == btnRightGrp)_x000D_
        {_x000D_
            //Rightgroup button geselecteerd -> ga naar dit submenu_x000D_
//            AccessRightGroupView accesRightGroupView;_x000D_
//            {_x000D_
//                accesRightGroupView = new AccessRightGroupView();_x000D_
//            }_x000D_
        }_x000D_
_x000D_
        if (s == btnAccount)_x000D_
        {_x000D_
            //Account button geselecteerd -> ga naar dit submenu_x000D_
//            AccesAccountView accesAccountView;_x000D_
//            {_x000D_
//                accesAccountView = new AccesAccountView();_x000D_
//            }_x000D_
        }_x000D_
_x000D_
        if (s == btnStatistics)_x000D_
        {_x000D_
            //Statistics button geselecteerd -> ga naar dit submenu_x000D_
//            AccessStatisticsView accesStatisticsView;_x000D_
//            {_x000D_
//                accesStatisticsView = new AccessStatisticsView();_x000D_
//            }_x000D_
        }_x000D_
    }_x000D_
_x000D_
}_x000D_
_x000D_

//buttons toevoegen aan het topPanel_x000D_
package views;_x000D_
_x000D_
import controllers.AccountController;_x000D_
import helpers.MenuButton;_x000D_
_x000D_
import javax.swing.*;_x000D_
import java.awt.*;_x000D_
import java.awt.event.ActionEvent;_x000D_
import java.awt.event.ActionListener;_x000D_
_x000D_
/**_x000D_
 * User: Reinier Koops_x000D_
 * Class: View, shows what the user sees (and gets its info through the controller)_x000D_
 */_x000D_
_x000D_
public class AccessView extends IpsenView implements ActionListener_x000D_
{_x000D_
    private AccountController controller;_x000D_
_x000D_
    private JTable table;_x000D_
    private JButton btnRightGrp, btnRight, btnAccount, btnStatistics;_x000D_
    private JPanel topPanel;_x000D_
_x000D_
    /**_x000D_
     * Class Constructor_x000D_
     * @param controller Account Controller_x000D_
     */_x000D_
_x000D_
    public AccessView(AccountController controller) // controller mist_x000D_
    {_x000D_
        //link aan betreffende controller_x000D_
_x000D_
        this.setLayout( new BorderLayout() );_x000D_
        topPanel = new JPanel();_x000D_
        topPanel.setPreferredSize( new Dimension( 1000, 68 ) );_x000D_
_x000D_
        //buttons afbeelding nog toewijzen_x000D_
_x000D_
        btnRight = new MenuButton( "assets/rechten.png", null, null );_x000D_
        btnRightGrp = new MenuButton( "assets/nw_rightgroep_btn.png", null, null );_x000D_
        btnAccount = new MenuButton( "assets/accounts.png", null, null );_x000D_
        btnStatistics = new MenuButton( "assets/statistiek_inzien", null, null );_x000D_
_x000D_
        //buttons laten werken als je erop klikt_x000D_
_x000D_
        btnRight.addActionListener( this );_x000D_
        btnAccount.addActionListener( this );_x000D_
        btnRightGrp.addActionListener( this );_x000D_
        btnStatistics.addActionListener( this );_x000D_
_x000D_
        //buttons toevoegen<SUF>
_x000D_
        this.topPanel.add( btnRight );_x000D_
        this.topPanel.add( btnRightGrp );_x000D_
        this.topPanel.add( btnAccount );_x000D_
        this.topPanel.add( btnStatistics );_x000D_
_x000D_
        this.add( topPanel, BorderLayout.NORTH );_x000D_
_x000D_
    }_x000D_
_x000D_
    /**_x000D_
     * Method to actionPerformed changes the view, by using the controller and displaying the next view_x000D_
     *_x000D_
     * the actionPerfomed performs no action in this class only showing the buttons_x000D_
     */_x000D_
_x000D_
    @Override_x000D_
    public void actionPerformed( ActionEvent e )_x000D_
    {_x000D_
        Object s = e.getSource();_x000D_
        if (s == btnRight)_x000D_
        {_x000D_
            //Right button geselecteerd -> ga naar dit submenu_x000D_
//            AccessRightView accesRightView;_x000D_
//            {_x000D_
//                accesRightView = new AccessRightView();_x000D_
//            }_x000D_
        }_x000D_
_x000D_
        if (s == btnRightGrp)_x000D_
        {_x000D_
            //Rightgroup button geselecteerd -> ga naar dit submenu_x000D_
//            AccessRightGroupView accesRightGroupView;_x000D_
//            {_x000D_
//                accesRightGroupView = new AccessRightGroupView();_x000D_
//            }_x000D_
        }_x000D_
_x000D_
        if (s == btnAccount)_x000D_
        {_x000D_
            //Account button geselecteerd -> ga naar dit submenu_x000D_
//            AccesAccountView accesAccountView;_x000D_
//            {_x000D_
//                accesAccountView = new AccesAccountView();_x000D_
//            }_x000D_
        }_x000D_
_x000D_
        if (s == btnStatistics)_x000D_
        {_x000D_
            //Statistics button geselecteerd -> ga naar dit submenu_x000D_
//            AccessStatisticsView accesStatisticsView;_x000D_
//            {_x000D_
//                accesStatisticsView = new AccessStatisticsView();_x000D_
//            }_x000D_
        }_x000D_
    }_x000D_
_x000D_
}_x000D_
_x000D_
