Skip to content
Snippets Groups Projects
ShukanViewBar.java 1.08 KiB
package shukan;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.File;

public class ShukanViewBar extends JPanel {
    /** File manager */
    private ShukanIO myIO = null;
    /** Displayed data */
    private ShukanData data = null;
    /** Name of the images files for the buttons of the toolbar */
    private String[] imagesName = {"save", "back", "plus", "delete", "left", "right", "export", "parameter"};
    private JButton buttons[] = new JButton[8];
    /** type of the images */
    private String imagesExtension = ".png";
    /** height in pixel of the toolbar */
    private int height;

    public ShukanViewBar(ShukanIO myIO, ShukanData data, int height){
        this.myIO = myIO;
        this.data = data;
        this.height = height;

        for(int i = 0; i<imagesName.length;i++){
            buttons[i] = new JButton("", new ImageIcon("data/images/"+imagesName[i]+imagesExtension));
            buttons[i].setPreferredSize(new Dimension(80,80));
            add(buttons[i]);
        }
    }


    public int getHeight(){return height;}

}