Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2010-2014, Danilo Pianini and contributors
* listed in the project's pom.xml file.
*
* This file is part of Alchemist, and is distributed under the terms of
* the GNU General Public License, with a linking exception, as described
* in the file LICENSE in the Alchemist distribution's top directory.
*/
package org.danilopianini.view;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import org.danilopianini.lang.CollectionWithCurrentElement;
import org.danilopianini.lang.RangedInteger;
/**
* @author Danilo Pianini
*
*/
public class ObjectModFrame extends JFrame {
private static final long serialVersionUID = 5816449414660853953L;
private String actionCommand = "";
private final AtomicInteger idgen = new AtomicInteger();
private final List listeners = Collections.synchronizedList(new ArrayList());
private class BooleanGUIComponent extends NoRefGUIComponent implements ActionListener {
private static final long serialVersionUID = -7149307455972615932L;
private final JCheckBox box;
public BooleanGUIComponent(final String name, final Object obj, final Field f) throws IllegalAccessException {
super(obj, f);
box = new JCheckBox(name, getField().getBoolean(getObject()));
add(box);
box.addActionListener(this);
}
@Override
public void actionPerformed(final ActionEvent e) {
update(box.isSelected());
}
}
private class EnumGUIComponent extends NoRefGUIComponent implements ActionListener {
private static final long serialVersionUID = 3329099673991014137L;
private final JComboBox> box;
public EnumGUIComponent(final String name, final Object obj, final Field f) throws IllegalAccessException {
super(obj, f);
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
box = new JComboBox