Object source = event.getSource();  if (source == cbBinaryEncode) { cbCompressLayerData.setEnabled(cbBinaryEncode.isSelected()); } else if (source == cbEmbedImages) { rbEmbedInTiles.setSelected(cbEmbedImages.isSelected() && rbEmbedInTiles.isSelected()); rbEmbedInTiles.setEnabled(cbEmbedImages.isSelected()); rbEmbedInSet.setSelected(cbEmbedImages.isSelected() && rbEmbedInSet.isSelected()); rbEmbedInSet.setEnabled(cbEmbedImages.isSelected()); }
    public void stateChanged(ChangeEvent event) {        // TODO: Check state change relevance (don't enable apply when it's        // just a hover event)        Object source = event.getSource();        if (source == cbBinaryEncode) {            cbCompressLayerData.setEnabled(cbBinaryEncode.isSelected());        } else if (source == cbEmbedImages) {            rbEmbedInTiles.setSelected(cbEmbedImages.isSelected() && rbEmbedInTiles.isSelected());            rbEmbedInTiles.setEnabled(cbEmbedImages.isSelected());            rbEmbedInSet.setSelected(cbEmbedImages.isSelected() && rbEmbedInSet.isSelected());            rbEmbedInSet.setEnabled(cbEmbedImages.isSelected());        }        bApply.setEnabled(true);    }