Skip to content

Commit

Permalink
Complete the rename changes including .form files
Browse files Browse the repository at this point in the history
  • Loading branch information
dsand47 committed Mar 2, 2019
1 parent 8bfc87c commit ae09055
Show file tree
Hide file tree
Showing 42 changed files with 272 additions and 317 deletions.
2 changes: 1 addition & 1 deletion java/src/jmri/jmrit/ctc/editor/code/CheckJMRIObject.java
Expand Up @@ -129,7 +129,7 @@ private VerifyClassReturnValue verifyClassCommon(String prefix, Object object) {
// Only JTextField's and JTable's are checked.
// A LIST of errors is returned, i.e. it checks ALL fields.
// Gotcha: All JTextField's in a dialog are declared "private" by the IDE, ergo the need for "field.setAccessible(true);"
public void analyzeForm(String prefix, javax.swing.JDialog dialog, ArrayList<String> errors) {
public void analyzeForm(String prefix, javax.swing.JFrame dialog, ArrayList<String> errors) {
Field[] objFields = dialog.getClass().getDeclaredFields();
for (Field field : objFields) { // For all fields in the class
Class<?> fieldType = field.getType();
Expand Down
116 changes: 58 additions & 58 deletions java/src/jmri/jmrit/ctc/editor/code/Columns.java

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions java/src/jmri/jmrit/ctc/editor/code/InternalSensorManager.java
Expand Up @@ -5,50 +5,50 @@

/**
* @author Gregory J. Bedlek Copyright (C) 2018, 2019
*
*
* The purpose of this class is to internally manage the sensors needed by the
* CTC system. All routines that modify either "OtherData" or
* "CodeButtonHandlerData" in any way will ultimately call this routine, so that
* it can determine if any internal sensors need to be deleted and/or created
* dynamically. This is for integration into JMRI internally.
*
*
* This also includes the "search and replace" function.
*
*
* Right now this routine just makes two "delete" and "create" lists, but does
* nothing since there is no integration with JMRI at this time (12/6/18).
*
*
*/

public class InternalSensorManager {
private final HashSet<String> _mInternalSensorsToDelete;

public InternalSensorManager(CTCSerialData ctcSerialData) {
_mInternalSensorsToDelete = ctcSerialData.getAllInternalSensors();
}

public void checkForChanges(CTCSerialData ctcSerialData) {
HashSet<String> internalSensorsToCreate = ctcSerialData.getAllInternalSensors();
process(internalSensorsToCreate, _mInternalSensorsToDelete);
}
static public void doDialog(javax.swing.JDialog dialog, CTCSerialData ctcSerialData) {
// Get "before" image (anything left in here after analysis will be deleted):

static public void doDialog(javax.swing.JFrame dialog, CTCSerialData ctcSerialData) {
// Get "before" image (anything left in here after analysis will be deleted):
HashSet<String> internalSensorsToDelete = ctcSerialData.getAllInternalSensors();
// Let the dialog hack the data any way it wants, without regard for us:
// Let the dialog hack the data any way it wants, without regard for us:
dialog.setVisible(true);
// Get "after" image (anything left in here after analysis will be created):
// Get "after" image (anything left in here after analysis will be created):
HashSet<String> internalSensorsToCreate = ctcSerialData.getAllInternalSensors();
process(internalSensorsToCreate, internalSensorsToDelete);
}

static private void process(HashSet<String> internalSensorsToCreate, HashSet<String> internalSensorsToDelete) {
// Now, find out what was modified ANYWHERE:
HashSet<String> intersection = new HashSet<>(internalSensorsToDelete);
intersection.retainAll(internalSensorsToCreate);

internalSensorsToDelete.removeAll(intersection);
internalSensorsToCreate.removeAll(intersection);
/*
/*
PrintWriter printWriter;
try {
printWriter = new PrintWriter(new FileWriter("junkit.txt"));
Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrit/ctc/editor/gui/FrmAbout.form
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="title" type="java.lang.String" value="About"/>
Expand Down
9 changes: 4 additions & 5 deletions java/src/jmri/jmrit/ctc/editor/gui/FrmAbout.java
Expand Up @@ -7,19 +7,19 @@
*
* @author Gregory J. Bedlek Copyright (C) 2018, 2019
*/
public class DlgAbout extends javax.swing.JDialog {
public class FrmAbout extends javax.swing.JFrame {

private static final String FORM_PROPERTIES = "dlgAbout";
private final AwtWindowProperties _mAwtWindowProperties;
/**
* Creates new form dlgAbout
*/
public DlgAbout(java.awt.Frame parent, boolean modal, AwtWindowProperties awtWindowProperties) {
super(parent, modal);
public FrmAbout(AwtWindowProperties awtWindowProperties) {
super();
initComponents();
_mHelpTitle.setText(_mHelpTitle.getText() + CTCSerialData.CTCVersion);
_mAwtWindowProperties = awtWindowProperties;
_mAwtWindowProperties.setWindowState(this, FORM_PROPERTIES);
_mAwtWindowProperties.setWindowState(this, FORM_PROPERTIES);
this.getRootPane().setDefaultButton(_mOK);
}

Expand All @@ -41,7 +41,6 @@ private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle("About");
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
Expand Down
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="modalityType" type="java.awt.Dialog$ModalityType" editor="org.netbeans.modules.form.editors.EnumEditor">
<Value id="DOCUMENT_MODAL"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
Expand Down
8 changes: 3 additions & 5 deletions java/src/jmri/jmrit/ctc/editor/gui/FrmAddModifyCTCColumn.java
Expand Up @@ -9,7 +9,7 @@
*
* @author Gregory J. Bedlek Copyright (C) 2018, 2019
*/
public class DlgAddModifyCTCColumn extends javax.swing.JDialog {
public class FrmAddModifyCTCColumn extends javax.swing.JFrame {

private static final String FORM_PROPERTIES = "DlgAddModifyCTCColumn"; // NOI18N
private final AwtWindowProperties _mAwtWindowProperties;
Expand All @@ -26,8 +26,8 @@ public class DlgAddModifyCTCColumn extends javax.swing.JDialog {
private boolean _mClosedNormally = false;
public boolean closedNormally() { return _mClosedNormally; }

public DlgAddModifyCTCColumn(java.awt.Frame parent, boolean modal, AwtWindowProperties awtWindowProperties, Columns columns, boolean isModify, int existingSwitchNumber, int existingGUIColumnNumber, boolean existingGUIGeneratedAtLeastOnceAlready) {
super(parent, modal);
public FrmAddModifyCTCColumn(AwtWindowProperties awtWindowProperties, Columns columns, boolean isModify, int existingSwitchNumber, int existingGUIColumnNumber, boolean existingGUIGeneratedAtLeastOnceAlready) {
super();
initComponents();
_mAwtWindowProperties = awtWindowProperties;
_mColumns = columns;
Expand Down Expand Up @@ -66,9 +66,7 @@ private void initComponents() {
_mGUIGeneratedAtLeastOnceAlready = new javax.swing.JCheckBox();

setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setModalityType(java.awt.Dialog.ModalityType.DOCUMENT_MODAL);
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrit/ctc/editor/gui/FrmCB.form
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
Expand Down
26 changes: 12 additions & 14 deletions java/src/jmri/jmrit/ctc/editor/gui/FrmCB.java
Expand Up @@ -14,10 +14,10 @@
*
* @author Gregory J. Bedlek Copyright (C) 2018, 2019
*/
public class DlgCB extends javax.swing.JDialog {
public class FrmCB extends javax.swing.JFrame {

/**
*
*
*/
private static final String FORM_PROPERTIES = "DlgCB"; // NOI18N
private static final String PREFIX = "_mOS"; // NOI18N
Expand All @@ -29,7 +29,7 @@ public class DlgCB extends javax.swing.JDialog {
private final CTCSerialData _mCTCSerialData;
private final CheckJMRIObject _mCheckJMRIObject;
private final ArrayList<Integer> _mArrayListOfSelectableOSSectionUniqueIDs;

private String _mCodeButtonInternalSensorOrig;
private String _mOSSectionOccupiedExternalSensorOrig;
private String _mOSSectionOccupiedExternalSensor2Orig;
Expand All @@ -51,10 +51,9 @@ private boolean dataChanged() {
return false;
}

public DlgCB( java.awt.Frame parent, boolean modal,
AwtWindowProperties awtWindowProperties, CodeButtonHandlerData codeButtonHandlerData, ProgramProperties programProperties,
public FrmCB( AwtWindowProperties awtWindowProperties, CodeButtonHandlerData codeButtonHandlerData, ProgramProperties programProperties,
CTCSerialData ctcSerialData, CheckJMRIObject checkJMRIObject) {
super(parent, modal);
super();
initComponents();
_mAwtWindowProperties = awtWindowProperties;
_mCodeButtonHandlerData = codeButtonHandlerData;
Expand All @@ -69,27 +68,27 @@ public DlgCB( java.awt.Frame parent, boolean modal,
CommonSubs.setMillisecondsEdit(_mCodeButtonDelayTime);
_mCodeButtonDelayTime.setText(Integer.toString(_mCodeButtonHandlerData._mCodeButtonDelayTime));
initOrig();
_mAwtWindowProperties.setWindowState(this, FORM_PROPERTIES);
_mAwtWindowProperties.setWindowState(this, FORM_PROPERTIES);
this.getRootPane().setDefaultButton(_mSaveAndClose);
}

public static boolean dialogCodeButtonHandlerDataValid(CheckJMRIObject checkJMRIObject, CodeButtonHandlerData codeButtonHandlerData) {
// Checks:
// Checks:
if (ProjectsCommonSubs.isNullOrEmptyString(codeButtonHandlerData._mCodeButtonInternalSensor)) return false;
if (ProjectsCommonSubs.isNullOrEmptyString(codeButtonHandlerData._mOSSectionOccupiedExternalSensor)) return false;
return checkJMRIObject.validClassWithPrefix(PREFIX, codeButtonHandlerData);
}

// Validate all internal fields as much as possible:
private ArrayList<String> formFieldsValid() {
ArrayList<String> errors = new ArrayList<>();
// Checks:
// Checks:
CommonSubs.checkJTextFieldNotEmpty(_mCodeButtonInternalSensor, _mCodeButtonInternalSensorPrompt, errors);
CommonSubs.checkJComboBoxNotEmpty(_mOSSectionOccupiedExternalSensor, _mOSSectionOccupiedExternalSensorPrompt, errors);
_mCheckJMRIObject.analyzeForm(PREFIX, this, errors);
return errors;
}

/**
* 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
Expand Down Expand Up @@ -123,7 +122,6 @@ private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle(Bundle.getMessage("TitleDlgCB"));
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
Expand Down Expand Up @@ -324,7 +322,7 @@ private void _mOSSectionSwitchSlavedToUniqueIDActionPerformed(java.awt.event.Act
}
}
}//GEN-LAST:event__mOSSectionSwitchSlavedToUniqueIDActionPerformed

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JFormattedTextField _mCodeButtonDelayTime;
private javax.swing.JTextField _mCodeButtonInternalSensor;
Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrit/ctc/editor/gui/FrmCO.form
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
Expand Down
8 changes: 3 additions & 5 deletions java/src/jmri/jmrit/ctc/editor/gui/FrmCO.java
Expand Up @@ -23,7 +23,7 @@
*
* @author Gregory J. Bedlek Copyright (C) 2018, 2019
*/
public class DlgCO extends javax.swing.JDialog {
public class FrmCO extends javax.swing.JFrame {
/**
* Creates new form DlgCO
*/
Expand Down Expand Up @@ -60,10 +60,9 @@ private boolean dataChanged() {
return false;
}

public DlgCO( java.awt.Frame parent, boolean modal,
AwtWindowProperties awtWindowProperties, CodeButtonHandlerData codeButtonHandlerData, ProgramProperties programProperties,
public FrmCO( AwtWindowProperties awtWindowProperties, CodeButtonHandlerData codeButtonHandlerData, ProgramProperties programProperties,
CTCSerialData ctcSerialData, CheckJMRIObject checkJMRIObject, boolean signalHeadSelected) {
super(parent, modal);
super();
initComponents();
_mSignalFacingDirection.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { Bundle.getMessage("InfoDlgCOLeftTraffic"), // NOI18N
Bundle.getMessage("InfoDlgCORightTraffic") })); // NOI18N
Expand Down Expand Up @@ -182,7 +181,6 @@ private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle(Bundle.getMessage("TitleDlgCO"));
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrit/ctc/editor/gui/FrmDebugging.form
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="0"/>
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
Expand Down
17 changes: 8 additions & 9 deletions java/src/jmri/jmrit/ctc/editor/gui/FrmDebugging.java
Expand Up @@ -9,7 +9,7 @@
*
* @author Gregory J. Bedlek Copyright (C) 2018, 2019
*/
public class DlgDebugging extends javax.swing.JDialog {
public class FrmDebugging extends javax.swing.JFrame {

/**
* Creates new form dlgProperties
Expand All @@ -19,10 +19,10 @@ public class DlgDebugging extends javax.swing.JDialog {
private final OtherData _mOtherData;
private boolean _mClosedNormally = false;
public boolean closedNormally() { return _mClosedNormally; }

private String _mCTCDebugSystemReloadInternalSensorOrig;
private String _mCTCDebug_TrafficLockingRuleTriggeredDisplayInternalSensorOrig;

private void initOrig(OtherData otherData) {
_mCTCDebugSystemReloadInternalSensorOrig = otherData._mCTCDebugSystemReloadInternalSensor;
_mCTCDebug_TrafficLockingRuleTriggeredDisplayInternalSensorOrig = otherData._mCTCDebug_TrafficLockingRuleTriggeredDisplayInternalSensor;
Expand All @@ -32,19 +32,19 @@ private boolean dataChanged() {
if (!_mCTCDebug_TrafficLockingRuleTriggeredDisplayInternalSensorOrig.equals(_mCTCDebug_TrafficLockingRuleTriggeredDisplayInternalSensor.getText())) return true;
return false;
}
public DlgDebugging(java.awt.Frame parent, boolean modal, AwtWindowProperties awtWindowProperties, OtherData otherData) {
super(parent, modal);

public FrmDebugging(AwtWindowProperties awtWindowProperties, OtherData otherData) {
super();
initComponents();
_mAwtWindowProperties = awtWindowProperties;
_mOtherData = otherData;
_mCTCSystemReloadInternalSensor.setText(otherData._mCTCDebugSystemReloadInternalSensor);
_mCTCDebug_TrafficLockingRuleTriggeredDisplayInternalSensor.setText(otherData._mCTCDebug_TrafficLockingRuleTriggeredDisplayInternalSensor);
initOrig(otherData);
_mAwtWindowProperties.setWindowState(this, FORM_PROPERTIES);
_mAwtWindowProperties.setWindowState(this, FORM_PROPERTIES);
this.getRootPane().setDefaultButton(_mSaveAndClose);
}

/**
* 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
Expand All @@ -66,7 +66,6 @@ private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
setTitle(Bundle.getMessage("TitleDlgDeb"));
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
Expand Down
2 changes: 1 addition & 1 deletion java/src/jmri/jmrit/ctc/editor/gui/FrmDefaults.form
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Component class="javax.swing.ButtonGroup" name="_mSignalSystemType">
</Component>
Expand Down

0 comments on commit ae09055

Please sign in to comment.