class CSDeviceN
{
    private final PDDeviceN deviceN;
    private JPanel panel;

    /**
     * Constructor
     *
     * @param array COSArray instance that holds the DeviceN color space
     * 
     * @throws IOException if the instance could not be created
     */
    public CSDeviceN(COSArray array) throws IOException
    {
        deviceN = new PDDeviceN(array);
        DeviceNColorant[] colorants = getColorantData();
        initUI(colorants);
    }

    /**
     * Parses the colorant data from the array.
     *
     * @return the parsed colorants.
     * @throws java.io.IOException if the color conversion fails.
     */
    private DeviceNColorant[] getColorantData() throws IOException
    {<FILL_FUNCTION_BODY>}

    private void initUI(DeviceNColorant[] colorants)
    {
        panel = new JPanel();
        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
        panel.setPreferredSize(new Dimension(300, 500));

        JLabel colorSpaceLabel = new JLabel("DeviceN colorspace");
        colorSpaceLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
        colorSpaceLabel.setFont(new Font(Font.MONOSPACED, Font.BOLD, 30));

        DeviceNTableModel tableModel = new DeviceNTableModel(colorants);
        JTable table = new JTable(tableModel);
        table.setDefaultRenderer(Color.class, new ColorBarCellRenderer());
        table.setRowHeight(60);
        JScrollPane scrollPane = new JScrollPane();
        scrollPane.setViewportView(table);

        panel.add(colorSpaceLabel);
        panel.add(scrollPane);
    }

    /**
     * return the main panel that hold all the UI elements.
     *
     * @return JPanel instance
     */
    public Component getPanel()
    {
        return panel;
    }

    private Color getColorObj(float[] rgbValues)
    {
        return new Color(rgbValues[0], rgbValues[1], rgbValues[2]);
    }
}

        List<String> colorantNames = deviceN.getColorantNames();
        int componentCount = colorantNames.size();
        DeviceNColorant[] colorants = new DeviceNColorant[componentCount];
        for (int i = 0; i < componentCount; i++)
        {
            DeviceNColorant colorant = new DeviceNColorant();
            colorant.setName(colorantNames.get(i));
            float[] maximum = new float[componentCount];
            float[] minimum = new float[componentCount];
            maximum[i] = 1;
            colorant.setMaximum(getColorObj(deviceN.toRGB(maximum)));
            colorant.setMinimum(getColorObj(deviceN.toRGB(minimum)));
            colorants[i] = colorant;
        }
        return colorants;
    
<no_super_class>