Skip to content
Snippets Groups Projects
Commit 00f90d81 authored by Jean-Luc Pons's avatar Jean-Luc Pons
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 1403 additions and 0 deletions
nbactions.xml
build/
dist/
test/
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="jrfklys" default="default" basedir=".">
<description>Builds, tests, and runs the project jrfklys.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="jrfklys-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
This diff is collapsed.
build.xml.data.CRC32=3af4b9fd
build.xml.script.CRC32=3e2567f6
build.xml.stylesheet.CRC32=f85dc8f2@1.94.0.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=3af4b9fd
nbproject/build-impl.xml.script.CRC32=5a38782f
nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.94.0.48
application.args=srrf1
compile.on.save=true
do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=/users/pons/.netbeans/12.0/build.properties
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/>
</open-files>
</project-private>
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=jrfklys
application.vendor=pons
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.modulepath=\
${run.modulepath}
debug.test.classpath=\
${run.test.classpath}
debug.test.modulepath=\
${run.test.modulepath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/jrfklys.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.atkpanel.jar=/segfs/tango/release/java/appli/atkpanel.jar
file.reference.ATKTuning.jar=/segfs/tango/release/java/appli/ATKTuning.jar
file.reference.Taco.jar=/segfs/taco/release/java/lib/Taco.jar
includes=**
jar.compress=false
javac.classpath=\
${libs.Tango.classpath}:\
${file.reference.atkpanel.jar}:\
${file.reference.Taco.jar}:\
${file.reference.ATKTuning.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.external.vm=false
javac.modulepath=
javac.processormodulepath=
javac.processorpath=\
${javac.classpath}
javac.source=1.7
javac.target=1.7
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.modulepath=\
${javac.modulepath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=RFKLYS.MainPanel
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project.
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-prop.name=value:
run.jvmargs=-DTANGO_HOST=acs:10000 -Dlogback.configurationFile=/segfs/tango/release/java/lib/logback-linux.xml
run.modulepath=\
${javac.modulepath}
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
run.test.modulepath=\
${javac.test.modulepath}
source.encoding=UTF-8
src.dir=src
test.src.dir=test
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>jrfklys</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>
package RFKLYS;
import fr.esrf.tangoatk.core.*;
import fr.esrf.tangoatk.widget.attribute.SimpleScalarViewer;
import fr.esrf.tangoatk.widget.attribute.StringScalarViewer;
import fr.esrf.tangoatk.widget.util.ATKGraphicsUtils;
import fr.esrf.tangoatk.widget.util.ErrorHistory;
import fr.esrf.tangoatk.widget.util.ErrorPopup;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Vector;
/**
* A panel for the configuration file
*/
public class ConfigFilePanel extends JPanel implements IResultListener, ActionListener {
private AttributeList attList;
private CommandList cmdList;
private ICommand gfilePathModel;
private String configFilePath=null;
private ICommand loadCmd;
private ICommand saveCmd;
private SimpleScalarViewer configFileViewer;
private JButton loadConfigBtn;
private JButton saveConfigBtn;
private JButton previewConfigBtn;
private PreviewDialog previewDialog = null;
private String devName = "";
ConfigFilePanel(String title,int textWidth) {
setLayout(null);
setPreferredSize(new Dimension(500,55));
setBorder( BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), title,
TitledBorder.LEFT, TitledBorder.DEFAULT_POSITION,
new Font("Dialog",Font.BOLD,12), Color.BLACK) );
configFileViewer = new SimpleScalarViewer();
configFileViewer.setBackgroundColor(new Color(245,245,245));
configFileViewer.setBounds(5,20,textWidth,25);
add(configFileViewer);
loadConfigBtn = new JButton("Load ...");
loadConfigBtn.setBounds(textWidth+10,20,90,25);
loadConfigBtn.addActionListener(this);
add(loadConfigBtn);
saveConfigBtn = new JButton("Save ...");
saveConfigBtn.setBounds(textWidth+105,20,90,25);
saveConfigBtn.addActionListener(this);
add(saveConfigBtn);
previewConfigBtn = new JButton("View ...");
previewConfigBtn.setBounds(textWidth+200,20,90,25);
previewConfigBtn.addActionListener(this);
add(previewConfigBtn);
}
public void setModel(String devName, ErrorHistory errWin) {
this.devName = devName;
attList = new AttributeList();
attList.addErrorListener(errWin);
cmdList = new CommandList();
try {
// Config file name attribute
IStringScalar cfileModel = (IStringScalar)attList.add(devName+"/Configuration_File");
configFileViewer.setModel(cfileModel);
// Commands
gfilePathModel = (ICommand)cmdList.add(devName+"/GetConfigurationFilePath");
gfilePathModel.addErrorListener(errWin);
gfilePathModel.addResultListener(this);
gfilePathModel.execute();
loadCmd = (ICommand)cmdList.add(devName+"/LoadConfigurationFile");
loadCmd.addErrorListener(ErrorPopup.getInstance());
saveCmd = (ICommand)cmdList.add(devName+"/SaveConfigurationFile");
saveCmd.addErrorListener(ErrorPopup.getInstance());
// Set timeout to 10 sec
DeviceFactory.getInstance().getDevice(devName).setDevTimeout(10000);
} catch (ConnectionException e) {
}
attList.startRefresher();
}
public void clearModel() {
attList.stopRefresher();
}
public void resultChange(ResultEvent e)
{
Object src = e.getSource();
if( src==gfilePathModel ) {
setDirPath(e);
}
}
public void errorChange(ErrorEvent e)
{
}
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if ( src==loadConfigBtn ) {
loadConfigFile();
} else if ( src==saveConfigBtn ) {
saveConfigFile();
} else if ( src==previewConfigBtn ) {
previewConfigFile();
}
}
private void setDirPath(ResultEvent resEvent)
{
java.util.List result = null;
Object resElem = null;
result = resEvent.getResult();
if (result == null)
{
return;
}
if (result.isEmpty())
{
return;
}
try
{
resElem = result.get(0);
}
catch (java.lang.IndexOutOfBoundsException iob)
{
return;
}
if (resElem == null)
{
return;
}
if (!(resElem instanceof String))
{
return;
}
String cFilePath = (String) resElem;
// The following lines are added to work around a Bug appeared since Java 1.5.
// Bug description : When a mounting point is used through a symbolic link in a file system
// (for example /operation -->link--> /_mntdirect/operation (which is the real mounting point)
// The first time the "FileChooser.setCurrentDirectory(new File(serverDirPath)) is called the path returned through
// filechooser.getSelelectedFile().getAbsolutePath() or getPath() is the path with the real mounting point
// where the second call to FileChooser.setCurrentDirectory(new File(serverDirPath)) will make the
// filechooser.getSelelectedFile().getAbsolutePath() return the path using the symbolique link. To avoid this
// inconsistency we should save the ServerDirPath with the symbolic link resolved (not containing any symb. link)
// by calling getCanonicalPath();
File sDir = new File(cFilePath);
try
{
configFilePath = sDir.getCanonicalPath();
}
catch (IOException ioex)
{
}
}
void previewConfigFile() {
int dialReturn;
String selectedFilePath;
String shortFileName;
int serverPathLength;
if (configFilePath == null) {
javax.swing.JOptionPane.showMessageDialog(
null, "Cannot get the config file root directory.\n"
+ "Check that the device " + devName + " is running and responding correctly to command GetConfigurationFilePath.\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
serverPathLength = configFilePath.length();
if (serverPathLength <= 0) {
javax.swing.JOptionPane.showMessageDialog(
null, "The config file root directory is not set correctly.\n"
+ "Check that the device " + devName + " + is running and responding correctly to command GetConfigurationFilePath.\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File(configFilePath));
dialReturn = fc.showDialog(this, "View");
if (dialReturn == JFileChooser.APPROVE_OPTION)
{
try
{
selectedFilePath = fc.getSelectedFile().getCanonicalPath();
shortFileName = fc.getSelectedFile().getName();
}
catch (IOException ioex)
{
javax.swing.JOptionPane.showMessageDialog(
null, "Failed to get the canonical path of the selected file.\n\n"
+ ioex + "\n\n\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
StringBuffer cFile = new StringBuffer();
try {
FileReader f = new FileReader(selectedFilePath);
while(f.ready())
cFile.append((char)f.read());
f.close();
} catch(IOException e) {
JOptionPane.showMessageDialog(this,"Error while loading file:\n"+e.getMessage(),"Error",JOptionPane.ERROR_MESSAGE);
return;
}
if( previewDialog==null ) previewDialog = new PreviewDialog();
previewDialog.setText(cFile.toString());
previewDialog.setTitle("Configuration file [" + shortFileName + "]");
ATKGraphicsUtils.centerFrameOnScreen(previewDialog);
previewDialog.setVisible(true);
}
}
void loadConfigFile()
{
int dialReturn;
String selectedFilePath = null, fileRelativePathName = null;
int serverPathLength = 0, filePathLength = 0, increment = 1;
if (configFilePath == null) {
javax.swing.JOptionPane.showMessageDialog(
null, "Cannot get the config file root directory.\n"
+ "Check that the device " + devName + " is running and responding correctly to command GetConfigurationFilePath.\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
serverPathLength = configFilePath.length();
if (serverPathLength <= 0) {
javax.swing.JOptionPane.showMessageDialog(
null, "The config file root directory is not set correctly.\n"
+ "Check that the device " + devName + " + is running and responding correctly to command GetConfigurationFilePath.\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
if (configFilePath.endsWith(File.separator)) {
increment = 0;
} else {
increment = 1;
}
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File(configFilePath));
dialReturn = fc.showDialog(this, "Load");
if (dialReturn == JFileChooser.APPROVE_OPTION)
{
try
{
selectedFilePath = fc.getSelectedFile().getCanonicalPath();
}
catch (IOException ioex)
{
javax.swing.JOptionPane.showMessageDialog(
null, "Failed to get the canonical path of the selected file.\n\n"
+ ioex + "\n\n\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
filePathLength = selectedFilePath.length();
if (!selectedFilePath.startsWith(configFilePath))
{
javax.swing.JOptionPane.showMessageDialog(
null, "The selected file is not inside the authorized root directory.\n\n"
+ "The file should be located in " + configFilePath + " directory tree.\n\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
if ((serverPathLength + increment) >= filePathLength)
{
javax.swing.JOptionPane.showMessageDialog(
null, "Invalid config file name :" + selectedFilePath + ".\n\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
fileRelativePathName = selectedFilePath.substring(serverPathLength + increment);
System.out.println("call " + loadCmd.getName() + " command on server with = " + fileRelativePathName);
Vector inputArg = new Vector();
inputArg.add(fileRelativePathName);
loadCmd.execute(inputArg);
}
}
void saveConfigFile()
{
int dialReturn;
String selectedFilePath = null, fileRelativePathName = null;
int serverPathLength = 0, filePathLength = 0, increment = 1;
if (configFilePath == null) {
javax.swing.JOptionPane.showMessageDialog(
null, "Cannot get the config file root directory.\n"
+ "Check that the device " + devName + " + is running and responding correctly to command GetConfigurationFilePath.\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
serverPathLength = configFilePath.length();
if (serverPathLength <= 0) {
javax.swing.JOptionPane.showMessageDialog(
null, "The config file root directory is not set correctly.\n"
+ "Check that the device " + devName + " + is running and responding correctly to command GetConfigurationFilePath.\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
if (configFilePath.endsWith(File.separator)) {
increment = 0;
} else {
increment = 1;
}
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File(configFilePath));
dialReturn = fc.showDialog(this, "Save");
if (dialReturn == JFileChooser.APPROVE_OPTION)
{
try
{
selectedFilePath = fc.getSelectedFile().getCanonicalPath();
}
catch (IOException ioex)
{
javax.swing.JOptionPane.showMessageDialog(
null, "Failed to get the canonical path of the selected file.\n\n"
+ ioex + "\n\n\n",
"Load config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
filePathLength = selectedFilePath.length();
if (!selectedFilePath.startsWith(configFilePath))
{
javax.swing.JOptionPane.showMessageDialog(
null, "The selected file is not inside the authorized root directory.\n\n"
+ "The file should be located in " + configFilePath + " directory tree.\n\n",
"Save config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
if ((serverPathLength + increment) >= filePathLength)
{
javax.swing.JOptionPane.showMessageDialog(
null, "Invalid config file name :" + selectedFilePath + ".\n\n",
"Save config file aborted\n",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
fileRelativePathName = selectedFilePath.substring(serverPathLength + increment);
System.out.println("call " + saveCmd.getName() + " command on server with = " + fileRelativePathName);
Vector inputArg = new Vector();
inputArg.add(fileRelativePathName);
saveCmd.execute(inputArg);
}
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.2" maxVersion="1.2" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="fileJTextArea">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Monospaced" size="12" style="0"/>
</Property>
<Property name="rows" type="int" value="40"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="downPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Last"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
<Property name="alignment" type="int" value="2"/>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="closeJButton">
<Properties>
<Property name="text" type="java.lang.String" value="Dismiss"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="closeJButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
package RFKLYS;
import java.io.*;
/**
*
* @author PONCET
*/
public class FileViewerFrame extends javax.swing.JFrame {
private final static String newline = "\n";
/**
* Creates new form JRFFileViewerJFrame
*/
public FileViewerFrame() {
initComponents();
}
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
fileJTextArea = new javax.swing.JTextArea();
downPanel = new javax.swing.JPanel();
closeJButton = new javax.swing.JButton();
fileJTextArea.setEditable(false);
fileJTextArea.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
fileJTextArea.setRows(40);
jScrollPane1.setViewportView(fileJTextArea);
getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
downPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
closeJButton.setText("Dismiss");
closeJButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
closeJButtonActionPerformed(evt);
}
});
downPanel.add(closeJButton);
getContentPane().add(downPanel, java.awt.BorderLayout.PAGE_END);
pack();
}// </editor-fold>//GEN-END:initComponents
private void closeJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeJButtonActionPerformed
// TODO add your handling code here:
setVisible(false);
}//GEN-LAST:event_closeJButtonActionPerformed
public void displayFileContent(File f)
{
FileReader fread = null;
int fchar, indexchar=0;
char[] oneline = null;
fileJTextArea.setText("");
fileJTextArea.setCaretPosition(0);
oneline = new char[200];
try
{
fread = new FileReader(f);
fchar = fread.read();
}
catch (Exception ex)
{
return;
}
setTitle(f.getName());
while (fchar != -1 )
{
if (newline.indexOf(fchar) != -1)
{
fileJTextArea.append(String.copyValueOf(oneline, 0, indexchar) + newline);
indexchar = 0;
}
else
{
if (indexchar >= 200)
{
fileJTextArea.append(String.copyValueOf(oneline, 0, indexchar));
indexchar = 0;
}
oneline[indexchar] = (char) fchar;
indexchar++;
}
try
{
fchar = fread.read();
}
catch (Exception ex)
{
fileJTextArea.append(String.copyValueOf(oneline, 0, indexchar) + newline);
indexchar = 0;
fchar = -1;
}
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new FileViewerFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton closeJButton;
private javax.swing.JPanel downPanel;
private javax.swing.JTextArea fileJTextArea;
private javax.swing.JScrollPane jScrollPane1;
// End of variables declaration//GEN-END:variables
}
This diff is collapsed.
This diff is collapsed.
package RFKLYS;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Preview file dialog
*/
public class PreviewDialog extends JFrame implements ActionListener {
private JPanel innerPanel;
private JTextArea text;
private JButton dismissBtn;
public PreviewDialog() {
innerPanel = new JPanel();
innerPanel.setLayout(new BorderLayout());
setContentPane(innerPanel);
text = new JTextArea();
JScrollPane scrollPane = new JScrollPane(text);
innerPanel.add(scrollPane,BorderLayout.CENTER);
JPanel btnPanel = new JPanel();
btnPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
innerPanel.add(btnPanel,BorderLayout.SOUTH);
dismissBtn = new JButton("Dismiss");
dismissBtn.addActionListener(this);
btnPanel.add(dismissBtn);
setTitle("View configuration file");
}
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if( src==dismissBtn ) {
setVisible(false);
}
}
public void setText(String msg) {
text.setText(msg);
}
}
package RFKLYS;
/**
*
* @author pons
*/
public class RFKLYSConst {
static public final String APP_RELEASE = "5.3";
static public final String MS_DEVNAME="sy/ms/1";
static public final String[] SYNOPTIC_FILE_NAME = {
"/RFKLYS/srrf1_klyst.jdw",
"/RFKLYS/srrf2_klyst.jdw"
};
static public final String[] PLC_SYNOPTIC_FILE_NAME = {
"/RFKLYS/srrf1_plc.jdw",
"/RFKLYS/srrf2_plc.jdw"
};
static public final String[][] PLC_NAMES = {
{"srrf/plc/tra1-1","srrf/plc/tra1-2","srrf/cav-wg/load","srrf/his/tra1-psw","srrf/his/tra1-crwb","srrf/his/tra1-arcs"},
{"srrf/plc/tra2-1","srrf/plc/tra2-2","srrf/cav-wg/load","srrf/his/tra2-psw","srrf/his/tra2-crwb","srrf/his/tra2-arcs"}
};
static public final String[] TRA_DEVNAME = {
"srrf/tra/tra1",
"srrf/tra/tra2"
};
static public final String[] TUNNING_KLYSTRON_PARAMS = {
"srrf1-klys" ,
"srrf2-klys"
};
static public final String[] TUNNING_OPERATION_PARAMS = {
"srrf1-oper",
"srrf2-oper"
};
static public final String[] TUNNING_LOOP_PARAMS = {
"srrf1-loop",
"srrf2-loop"
};
static public final String[] TUNNING_COUNTERS = {
"srrf1-time",
"srrf2-time"
};
}
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-117,0,0,1,17"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="centerPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor" name="rfSelectComboEditor">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="3" insetsBottom="3" insetsRight="20" anchor="18" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor" name="noRFComboEditor">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="79" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="3" insetsRight="20" anchor="18" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor" name="oscComboEditor">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="79" ipadY="0" insetsTop="3" insetsLeft="3" insetsBottom="10" insetsRight="20" anchor="18" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Container class="fr.esrf.tangoatk.widget.util.JSmoothLabel" name="jSmoothLabel1">
<Properties>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="opaque" type="boolean" value="false"/>
<Property name="text" type="java.lang.String" value="RF Select"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="20" ipadY="0" insetsTop="10" insetsLeft="20" insetsBottom="3" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
</Container>
<Container class="fr.esrf.tangoatk.widget.util.JSmoothLabel" name="jSmoothLabel2">
<Properties>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="opaque" type="boolean" value="false"/>
<Property name="text" type="java.lang.String" value="No RF"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="20" ipadY="0" insetsTop="3" insetsLeft="20" insetsBottom="3" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
</Container>
<Container class="fr.esrf.tangoatk.widget.util.JSmoothLabel" name="jSmoothLabel3">
<Properties>
<Property name="horizontalAlignment" type="int" value="2"/>
<Property name="opaque" type="boolean" value="false"/>
<Property name="text" type="java.lang.String" value="Oscillator"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="20" ipadY="0" insetsTop="3" insetsLeft="20" insetsBottom="10" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="btnPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="South"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
<Property name="alignment" type="int" value="2"/>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="dismissButton">
<Properties>
<Property name="text" type="java.lang.String" value="Dismiss"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dismissButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package RFKLYS;
import static RFKLYS.MainPanel.errWin;
import fr.esrf.tangoatk.core.AttributeList;
import fr.esrf.tangoatk.core.ConnectionException;
import fr.esrf.tangoatk.core.attribute.EnumScalar;
import javax.swing.JFrame;
/**
*
* @author pons
*/
public class RelayFrame extends javax.swing.JFrame {
private AttributeList attList;
private EnumScalar rfSelect;
private EnumScalar noRFDisa;
private EnumScalar oscDisa;
private Boolean runningFromShell;
/**
* Creates new form RelayFrame
*/
public RelayFrame(int klysIdx) {
this(klysIdx,false);
}
public RelayFrame(int klysIdx,boolean runningFromShell) {
this.runningFromShell = runningFromShell;
initComponents();
attList = new AttributeList();
if( errWin != null)
attList.addErrorListener(errWin);
try {
rfSelect = (EnumScalar)attList.add("srrf/wago/tra"+Integer.toString(klysIdx+1)+"-digital/RF_Select");
rfSelectComboEditor.setEnumModel(rfSelect);
noRFDisa = (EnumScalar)attList.add("srrf/wago/tra"+Integer.toString(klysIdx+1)+"-digital/NoRF_Disable");
noRFComboEditor.setEnumModel(noRFDisa);
oscDisa = (EnumScalar)attList.add("srrf/wago/tra"+Integer.toString(klysIdx+1)+"-digital/OSC_Disable");
oscComboEditor.setEnumModel(oscDisa);
rfSelect.refresh();
noRFDisa.refresh();
oscDisa.refresh();
} catch( ConnectionException e) {
}
attList.startRefresher();
setTitle("TRA"+Integer.toString(klysIdx+1)+" conditioning");
}
/**
* 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() {
java.awt.GridBagConstraints gridBagConstraints;
centerPanel = new javax.swing.JPanel();
rfSelectComboEditor = new fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor();
noRFComboEditor = new fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor();
oscComboEditor = new fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor();
jSmoothLabel1 = new fr.esrf.tangoatk.widget.util.JSmoothLabel();
jSmoothLabel2 = new fr.esrf.tangoatk.widget.util.JSmoothLabel();
jSmoothLabel3 = new fr.esrf.tangoatk.widget.util.JSmoothLabel();
btnPanel = new javax.swing.JPanel();
dismissButton = new javax.swing.JButton();
centerPanel.setLayout(new java.awt.GridBagLayout());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
gridBagConstraints.insets = new java.awt.Insets(10, 3, 3, 20);
centerPanel.add(rfSelectComboEditor, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 79;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 20);
centerPanel.add(noRFComboEditor, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 79;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
gridBagConstraints.insets = new java.awt.Insets(3, 3, 10, 20);
centerPanel.add(oscComboEditor, gridBagConstraints);
jSmoothLabel1.setHorizontalAlignment(2);
jSmoothLabel1.setOpaque(false);
jSmoothLabel1.setText("RF Select");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 20;
gridBagConstraints.insets = new java.awt.Insets(10, 20, 3, 3);
centerPanel.add(jSmoothLabel1, gridBagConstraints);
jSmoothLabel2.setHorizontalAlignment(2);
jSmoothLabel2.setOpaque(false);
jSmoothLabel2.setText("No RF");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 20;
gridBagConstraints.insets = new java.awt.Insets(3, 20, 3, 3);
centerPanel.add(jSmoothLabel2, gridBagConstraints);
jSmoothLabel3.setHorizontalAlignment(2);
jSmoothLabel3.setOpaque(false);
jSmoothLabel3.setText("Oscillator");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 20;
gridBagConstraints.insets = new java.awt.Insets(3, 20, 10, 3);
centerPanel.add(jSmoothLabel3, gridBagConstraints);
getContentPane().add(centerPanel, java.awt.BorderLayout.CENTER);
btnPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
dismissButton.setText("Dismiss");
dismissButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
dismissButtonActionPerformed(evt);
}
});
btnPanel.add(dismissButton);
getContentPane().add(btnPanel, java.awt.BorderLayout.SOUTH);
pack();
}// </editor-fold>//GEN-END:initComponents
private void dismissButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dismissButtonActionPerformed
if( runningFromShell ) {
System.exit(0);
} else {
setVisible(false);
}
}//GEN-LAST:event_dismissButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel btnPanel;
private javax.swing.JPanel centerPanel;
private javax.swing.JButton dismissButton;
private fr.esrf.tangoatk.widget.util.JSmoothLabel jSmoothLabel1;
private fr.esrf.tangoatk.widget.util.JSmoothLabel jSmoothLabel2;
private fr.esrf.tangoatk.widget.util.JSmoothLabel jSmoothLabel3;
private fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor noRFComboEditor;
private fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor oscComboEditor;
private fr.esrf.tangoatk.widget.attribute.EnumScalarComboEditor rfSelectComboEditor;
// End of variables declaration//GEN-END:variables
}
package RFKLYS;
import fr.esrf.tangoatk.core.AttributeList;
import fr.esrf.tangoatk.core.CommandList;
import fr.esrf.tangoatk.core.IStringSpectrum;
import fr.esrf.tangoatk.core.ICommand;
import fr.esrf.tangoatk.core.AttributeStateEvent;
import fr.esrf.tangoatk.core.ConnectionException;
import fr.esrf.tangoatk.core.DevStateScalarEvent;
import fr.esrf.tangoatk.core.ErrorEvent;
import fr.esrf.tangoatk.core.IDevStateScalarListener;
import fr.esrf.tangoatk.core.IDevice;
import fr.esrf.tangoatk.core.attribute.DevStateScalar;
import fr.esrf.tangoatk.core.command.VoidVoidCommand;
import fr.esrf.tangoatk.widget.util.ErrorPopup;
import java.awt.Font;
import javax.swing.JPanel;
/**
* A class to display a sequence history
* The MainPanel parent class should have 2 methods
* hideSeqHistory and showSeqHistory and an accessible
* ErrorHistory named errWin.
*/
public class SeqHistoryPanel extends JPanel implements IDevStateScalarListener {
private AttributeList attList = null;
private CommandList cmdList = null;
private DevStateScalar stateModel = null;
private VoidVoidCommand abortCmd = null;
private MainPanel parent;
private String devName;
private String lastState;
/**
* Creates new form JLinacSeqHistoryPanel
*/
SeqHistoryPanel(MainPanel parent,String devName) {
this.parent = parent;
this.devName = devName;
lastState = IDevice.UNKNOWN;
attList = new AttributeList();
attList.addErrorListener(MainPanel.errWin);
cmdList = new CommandList();
cmdList.addErrorListener(MainPanel.errWin);
cmdList.addErrorListener(ErrorPopup.getInstance());
initComponents();
try {
seqHistoryStringSpectrumViewer.setModel((IStringSpectrum)attList.add(devName + "/SequenceHistory"));
stateModel = (DevStateScalar)attList.add(devName+"/State");
if(stateModel!=null) stateModel.addDevStateScalarListener(this);
abortSeqCommandViewer.setModel((ICommand)cmdList.add(devName+"/Stop"));
} catch (ConnectionException e) {
}
attList.setRefreshInterval(1000);
attList.startRefresher();
}
void clearModel() {
attList.removeErrorListener(MainPanel.errWin);
attList.stopRefresher();
seqHistoryStringSpectrumViewer.setModel((IStringSpectrum)null);
if(stateModel!=null) stateModel.removeDevStateScalarListener(this);
attList.clear();
cmdList.removeErrorListener(MainPanel.errWin);
cmdList.removeErrorListener(ErrorPopup.getInstance());
cmdList.clear();
}
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
seqHistoryStringSpectrumViewer = new fr.esrf.tangoatk.widget.attribute.SimpleStringSpectrumViewer();
seqHistoryStringSpectrumViewer.getText().setFont(new Font("Monospaced",Font.PLAIN,12));
hideButton = new javax.swing.JButton();
abortSeqCommandViewer = new fr.esrf.tangoatk.widget.command.VoidVoidCommandViewer();
setLayout(new java.awt.GridBagLayout());
seqHistoryStringSpectrumViewer.setAutoscrolls(true);
seqHistoryStringSpectrumViewer.setViewEnd(true);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.gridwidth = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 2, 5, 2);
add(seqHistoryStringSpectrumViewer, gridBagConstraints);
hideButton.setText("Hide");
hideButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
hideButtonActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(3, 5, 3, 5);
add(hideButton, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.insets = new java.awt.Insets(3, 5, 3, 5);
add(abortSeqCommandViewer, gridBagConstraints);
}
private void hideButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hideButtonActionPerformed
parent.hideSeqHistory();
}
private fr.esrf.tangoatk.widget.command.VoidVoidCommandViewer abortSeqCommandViewer;
private javax.swing.JButton hideButton;
private fr.esrf.tangoatk.widget.attribute.SimpleStringSpectrumViewer seqHistoryStringSpectrumViewer;
@Override
public void devStateScalarChange(DevStateScalarEvent dsse) {
String state = dsse.getValue();
if( state.equalsIgnoreCase(IDevice.MOVING) &&
!state.equalsIgnoreCase(lastState) )
parent.showSeqHistory();
lastState = dsse.getValue();
}
@Override
public void stateChange(AttributeStateEvent ase) {
}
@Override
public void errorChange(ErrorEvent ee) {
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment