151 lines
5.0 KiB
Java
151 lines
5.0 KiB
Java
/*
|
|
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
|
|
*/
|
|
|
|
import ch.psi.pshell.dev.Motor;
|
|
import ch.psi.pshell.plot.LinePlotBase;
|
|
import ch.psi.pshell.plot.LinePlotJFree;
|
|
import ch.psi.pshell.plot.LinePlotSeries;
|
|
import ch.psi.pshell.plot.Plot;
|
|
import ch.psi.pshell.swing.MotorPanel;
|
|
import ch.psi.pshell.ui.App;
|
|
import ch.psi.utils.swing.MonitoredPanel;
|
|
import ch.psi.pshell.ui.Panel;
|
|
import ch.psi.utils.swing.SwingUtils;
|
|
import ch.psi.wsaf.ApplicationStateException;
|
|
import ch.psi.wsaf.Task;
|
|
import ch.psi.wsaf.TaskRunMode;
|
|
import ch.psi.wsaf.TaskRunningException;
|
|
import java.awt.event.ActionEvent;
|
|
import java.awt.event.ActionListener;
|
|
import java.util.HashMap;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Logger;
|
|
import javax.swing.JButton;
|
|
import javax.swing.JCheckBox;
|
|
import javax.swing.JFrame;
|
|
import javax.swing.JPanel;
|
|
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public class TestingList extends Panel {
|
|
|
|
Task task = new Task() {
|
|
@Override
|
|
protected Object execute() throws Exception {
|
|
|
|
return true;
|
|
}
|
|
};
|
|
@Override
|
|
protected JPanel create() {
|
|
return new NetbeansPluginPanel();
|
|
}
|
|
|
|
public class NetbeansPluginPanel extends MonitoredPanel {
|
|
|
|
public NetbeansPluginPanel() {
|
|
initComponents();
|
|
buildGUI();
|
|
hookUpEvents();
|
|
}
|
|
@SuppressWarnings("unchecked")
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
|
private void initComponents() {
|
|
|
|
jButton1 = new javax.swing.JButton();
|
|
jScrollPane1 = new javax.swing.JScrollPane();
|
|
txtOutput = new javax.swing.JTextArea();
|
|
|
|
jButton1.setText("jButton1");
|
|
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
jButton1ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
txtOutput.setColumns(20);
|
|
txtOutput.setRows(5);
|
|
jScrollPane1.setViewportView(txtOutput);
|
|
|
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
|
this.setLayout(layout);
|
|
layout.setHorizontalGroup(
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(layout.createSequentialGroup()
|
|
.addGap(244, 244, 244)
|
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jButton1))
|
|
.addContainerGap(370, Short.MAX_VALUE))
|
|
);
|
|
layout.setVerticalGroup(
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(layout.createSequentialGroup()
|
|
.addGap(198, 198, 198)
|
|
.addComponent(jButton1)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addContainerGap(327, Short.MAX_VALUE))
|
|
);
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
|
// TODO add your handling code here:
|
|
}//GEN-LAST:event_jButton1ActionPerformed
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
private javax.swing.JButton jButton1;
|
|
private javax.swing.JScrollPane jScrollPane1;
|
|
private javax.swing.JTextArea txtOutput;
|
|
// End of variables declaration//GEN-END:variables
|
|
JButton remove;
|
|
JButton appear;
|
|
JCheckBox cb[]=new JCheckBox[10];
|
|
|
|
|
|
|
|
|
|
|
|
public void buildGUI() {
|
|
JFrame fr=new JFrame();
|
|
JPanel p=new JPanel();
|
|
remove=new JButton("remove");
|
|
appear=new JButton("appear");
|
|
for(int i=0;i<10;i++) {
|
|
cb[i]=new JCheckBox("checkbox:"+i);
|
|
cb[i].setVisible(false);
|
|
}
|
|
fr.add(p);
|
|
p.add(remove);
|
|
p.add(appear);
|
|
for(int i=0;i<10;i++) {
|
|
p.add(cb[i]);
|
|
}
|
|
fr.setVisible(true);
|
|
fr.setSize(400,400);
|
|
}
|
|
|
|
public void hookUpEvents() {
|
|
remove.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
for(int i=0;i<10;i++) {
|
|
cb[i].setVisible(false);
|
|
}
|
|
}
|
|
});
|
|
|
|
appear.addActionListener(new ActionListener() {
|
|
public void actionPerformed(ActionEvent ae) {
|
|
for(int i=0;i<10;i++) {
|
|
cb[i].setVisible(true);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
}
|
|
}
|