class UniqueColorTransformerPanel extends javax.swing.JPanel {

    private AbstractUniqueColorTransformer transformer;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private net.java.dev.colorchooser.ColorChooser colorChooser;
    private javax.swing.JLabel colorLabel;
    // End of variables declaration//GEN-END:variables

    public UniqueColorTransformerPanel() {
        initComponents();

        colorChooser.addPropertyChangeListener(new PropertyChangeListener() {
            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                if (evt.getPropertyName().equals(ColorChooser.PROP_COLOR)) {
                    if (!transformer.getColor().equals(colorChooser.getColor())) {
                        transformer.setColor(colorChooser.getColor());
                        colorLabel.setText(getHex(colorChooser.getColor()));
                    }
                }
            }
        });
    }

    public void setup(SimpleFunction function) {
        transformer = function.getTransformer();
        colorChooser.setColor(transformer.getColor());
        colorLabel.setText(getHex(transformer.getColor()));
    }

    private String getHex(Color color) {
        return "#" + String.format("%06x", color.getRGB() & 0x00FFFFFF);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {<FILL_FUNCTION_BODY>}// </editor-fold>//GEN-END:initComponents
}


        colorChooser = new net.java.dev.colorchooser.ColorChooser();
        colorLabel = new javax.swing.JLabel();

        colorChooser.setMinimumSize(new java.awt.Dimension(14, 14));
        colorChooser.setPreferredSize(new java.awt.Dimension(14, 14));
        colorChooser.setToolTipText(org.openide.util.NbBundle.getMessage(UniqueColorTransformerPanel.class,
            "UniqueColorTransformerPanel.colorChooser.toolTipText")); // NOI18N

        javax.swing.GroupLayout colorChooserLayout = new javax.swing.GroupLayout(colorChooser);
        colorChooser.setLayout(colorChooserLayout);
        colorChooserLayout.setHorizontalGroup(
            colorChooserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 12, Short.MAX_VALUE)
        );
        colorChooserLayout.setVerticalGroup(
            colorChooserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 12, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(colorChooser, javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(colorLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 380,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(colorLabel)
                        .addComponent(colorChooser, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(278, 278, 278))
        );
    
<methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void setUI(javax.swing.plaf.PanelUI) ,public void updateUI() <variables>private static final java.lang.String uiClassID