#647 update depricated code

This commit is contained in:
Scott Fennell 2018-07-13 15:15:35 -05:00
parent 8a4c8e3dd9
commit a6274680a5
12 changed files with 43 additions and 43 deletions

View File

@ -251,7 +251,7 @@ public abstract class TrickApplication extends SingleFrameApplication implements
@Override
public Object getSessionState(Component component) {
if (component instanceof JToggleButton) {
return new Boolean(((JToggleButton)component).isSelected());
return ((JToggleButton) component).isSelected();
}
return null;
}
@ -363,8 +363,8 @@ public abstract class TrickApplication extends SingleFrameApplication implements
@Override
protected void startup() {
String defaultValue = Boolean.toString(false);
boolean savedExitProperty = new Boolean(trickProperties.getProperty(
"confirmExit", defaultValue)).booleanValue();
boolean savedExitProperty = Boolean.valueOf(trickProperties.getProperty(
"confirmExit", defaultValue));
if (( savedExitProperty == true ) && (getExitListeners().length==0)) {
// initialize gets called again if you reconnect, so don't add another exitlistener
addExitListener(exitListener);

View File

@ -284,7 +284,7 @@ public class UIUtils {
public static boolean isRightMouseClick(MouseEvent e) {
boolean rval = false;
if( (e.getModifiers()&MouseEvent.BUTTON3_MASK)==MouseEvent.BUTTON3_MASK ) {
if( (e.getModifiersEx()&MouseEvent.BUTTON3_DOWN_MASK)==MouseEvent.BUTTON3_DOWN_MASK ) {
rval = true;
}

View File

@ -108,7 +108,7 @@ public class FontChooser extends JDialog implements ActionListener, ListSelectio
currentFont = font;
if (font != null) {
fontList.setSelectedValue(font.getName(), true);
sizeList.setSelectedValue(new Integer(font.getSize()), true);
sizeList.setSelectedValue(font.getSize(), true);
if (font.getStyle() == Font.PLAIN) {
boldBox.setSelected(false);
italicBox.setSelected(false);

View File

@ -64,7 +64,7 @@ public abstract class CommonProduct {
* @param tstart The start time of the related data.
*/
public void setTStart(double tstart) {
this.tstart = new Double(tstart);
this.tstart = tstart;
}
/**
@ -74,7 +74,7 @@ public abstract class CommonProduct {
*/
public void setTStart(String tstartStr) {
try {
tstart = new Double(tstartStr);
tstart = Double.valueOf(tstartStr);
} catch (NumberFormatException e) {
tstart = null;
} catch (NullPointerException e) {
@ -97,7 +97,7 @@ public abstract class CommonProduct {
* @param tstop The stop time of the related data.
*/
public void setTStop(double tstop) {
this.tstop = new Double(tstop);
this.tstop = tstop;
}
/**
@ -107,7 +107,7 @@ public abstract class CommonProduct {
*/
public void setTStop(String tstopStr) {
try {
tstop = new Double(tstopStr);
tstop = Double.valueOf(tstopStr);
} catch (NumberFormatException e) {
tstop = null;
} catch (NullPointerException e) {
@ -130,7 +130,7 @@ public abstract class CommonProduct {
* @param freq The frequency of the related data.
*/
public void setFrequency(double freq) {
frequency = new Double(freq);
frequency = freq;
}
/**
@ -140,7 +140,7 @@ public abstract class CommonProduct {
*/
public void setFrequency(String freqStr) {
try {
frequency = new Double(freqStr);
frequency = Double.valueOf(freqStr);
} catch (NumberFormatException e) {
frequency = null;
} catch (NullPointerException e) {

View File

@ -45,8 +45,8 @@ public class ProductPage extends CommonProduct {
//========================================
private List<ProductPlot> plotList;
private Integer hcells = new Integer(0); // default to 0
private Integer vcells = new Integer(0); // default to 0
private Integer hcells = 0; // default to 0
private Integer vcells = 0; // default to 0
//========================================
// Constructors
@ -69,7 +69,7 @@ public class ProductPage extends CommonProduct {
*/
public void setHcells(String hcellsStr) {
try {
hcells = new Integer(hcellsStr);
hcells = Integer.valueOf(hcellsStr);
} catch (NumberFormatException e) {
hcells = null;
} catch (NullPointerException e) {
@ -83,7 +83,7 @@ public class ProductPage extends CommonProduct {
*/
public void setVcells(String vcellsStr) {
try {
vcells = new Integer(vcellsStr);
vcells = Integer.valueOf(vcellsStr);
} catch (NumberFormatException e) {
vcells = null;
} catch (NullPointerException e) {

View File

@ -346,7 +346,7 @@ public class ProductPlot extends CommonProduct {
* @param xmin The minimum value for X variable.
*/
public void setXMin(double xmin) {
this.xmin = new Double(xmin);
this.xmin = xmin;
}
/**
@ -356,7 +356,7 @@ public class ProductPlot extends CommonProduct {
*/
public void setXMin(String xminStr) {
try {
xmin = new Double(xminStr);
xmin = Double.valueOf(xminStr);
} catch (NumberFormatException e) {
xmin = null;
} catch (NullPointerException e) {
@ -379,7 +379,7 @@ public class ProductPlot extends CommonProduct {
* @param xmax The maximum value for X variable.
*/
public void setXMax(double xmax) {
this.xmax = new Double(xmax);
this.xmax = xmax;
}
/**
@ -389,7 +389,7 @@ public class ProductPlot extends CommonProduct {
*/
public void setXMax(String xmaxStr) {
try {
xmax = new Double(xmaxStr);
xmax = Double.valueOf(xmaxStr);
} catch (NumberFormatException e) {
xmax = null;
} catch (NullPointerException e) {
@ -403,7 +403,7 @@ public class ProductPlot extends CommonProduct {
* @param ymin The minimum value for Y variable.
*/
public void setYMin(double ymin) {
this.ymin = new Double(ymin);
this.ymin = ymin;
}
/**
@ -413,7 +413,7 @@ public class ProductPlot extends CommonProduct {
*/
public void setYMin(String yminStr) {
try {
ymin = new Double(yminStr);
ymin = Double.valueOf(yminStr);
} catch (NumberFormatException e) {
ymin = null;
} catch (NullPointerException e) {
@ -435,7 +435,7 @@ public class ProductPlot extends CommonProduct {
* @param ymax The maximum value for Y variable.
*/
public void setYMax(double ymax) {
this.ymax = new Double(ymax);
this.ymax = ymax;
}
/**
@ -445,7 +445,7 @@ public class ProductPlot extends CommonProduct {
*/
public void setYMax(String ymaxStr) {
try {
ymax = new Double(ymaxStr);
ymax = Double.valueOf(ymaxStr);
} catch (NumberFormatException e) {
ymax = null;
} catch (NullPointerException e) {

View File

@ -515,7 +515,7 @@ public class ProductVar {
* @param bias The var bias.
*/
public void setBias(double bias) {
this.bias = new Double(bias);
this.bias = bias;
}
/**
@ -525,7 +525,7 @@ public class ProductVar {
*/
public void setBias(String biasStr) {
try {
bias = new Double(biasStr);
bias = Double.valueOf(biasStr);
} catch (NumberFormatException e) {
bias = null;
} catch (NullPointerException e) {
@ -539,7 +539,7 @@ public class ProductVar {
* @param scale The var scale.
*/
public void setScale(double scale) {
this.scale = new Double(scale);
this.scale = scale;
}
/**
@ -549,7 +549,7 @@ public class ProductVar {
*/
public void setScale(String scaleStr) {
try {
scale = new Double(scaleStr);
scale = Double.valueOf(scaleStr);
} catch (NumberFormatException e) {
scale = null;
} catch (NullPointerException e) {
@ -563,7 +563,7 @@ public class ProductVar {
* @param max The var max.
*/
public void setMax(double max) {
this.max = new Double(max);
this.max = max;
}
/**
@ -573,7 +573,7 @@ public class ProductVar {
*/
public void setMax(String maxStr) {
try {
max = new Double(maxStr);
max = Double.valueOf(maxStr);
} catch (NumberFormatException e) {
max = null;
} catch (NullPointerException e) {

View File

@ -319,7 +319,7 @@ public class MonteMonitorApplication extends RunTimeTrickApplication {
protected JComponent createMainPanel() {
return new JXPanel(new BorderLayout()) {
Integer noRunNumber = new Integer(-1);
Integer noRunNumber = -1;
{
progressBar = new JProgressBar() {{
@ -583,12 +583,12 @@ public class MonteMonitorApplication extends RunTimeTrickApplication {
}
slave.name = data[dataIndex++];
if (data[dataIndex++].equals("BAD_REF")) {
slave.currentRun = new Integer(-1);
slave.currentRun = -1;
}
else {
slave.currentRun = new Integer(data[dataIndex - 1]);
slave.currentRun = Integer.valueOf(data[dataIndex - 1]);
}
slave.numResults = new Integer(data[dataIndex++]);
slave.numResults = Integer.valueOf(data[dataIndex++]);
}
for (int i = slaves.size() - 1; i >= 0; --i) {

View File

@ -56,10 +56,10 @@ public class Slave {
public String name;
/** current run number */
public Integer currentRun = new Integer(-1);
public Integer currentRun = -1;
/** number or results returned */
public Integer numResults = new Integer(0);
public Integer numResults = 0;
/**
* constructs a new Slave whose initial state is UNKNOWN

View File

@ -355,7 +355,7 @@ public class MtvView extends FrameView {
if (eventname.length > 1) {
// put grouped events on their own tab
if (!tabmap.containsKey(eventname[0])) {
tabmap.put(eventname[0], new Integer(tabcount));
tabmap.put(eventname[0], tabcount);
tabs[tabcount] = new Tab();
tabs[tabcount].panel = new JPanel();
tabs[tabcount].panel.setName(eventname[0]);

View File

@ -33,8 +33,8 @@ public class DoubleComboBox extends JXPanel {
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
for (int i = 0; i < count; i++) {
minimumBox.addItem(new Integer(i));
maximumBox.addItem(new Integer(i));
minimumBox.addItem(i);
maximumBox.addItem(i);
}
minimumBox.setSelectedIndex(0);
@ -43,12 +43,12 @@ public class DoubleComboBox extends JXPanel {
minimumBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
int min = ((Integer)minimumBox.getSelectedItem());
int min = (int)minimumBox.getSelectedItem();
for (int i = ((Integer)maximumBox.getItemAt(0)); i < min; ++i) {
maximumBox.removeItemAt(0);
}
for (int i = ((Integer)maximumBox.getItemAt(0)); i > min; ) {
maximumBox.insertItemAt(new Integer(--i), 0);
maximumBox.insertItemAt(--i, 0);
}
}
});
@ -56,12 +56,12 @@ public class DoubleComboBox extends JXPanel {
maximumBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
int max = ((Integer)maximumBox.getSelectedItem());
int max = (int)maximumBox.getSelectedItem();
for (int i = ((Integer)minimumBox.getItemAt(minimumBox.getItemCount() - 1)); i > max; --i) {
minimumBox.removeItemAt(minimumBox.getItemCount() - 1);
}
for (int i = ((Integer)minimumBox.getItemAt(minimumBox.getItemCount() - 1)); i < max; ) {
minimumBox.addItem(new Integer(++i));
minimumBox.addItem(++i);
}
}
});

View File

@ -239,7 +239,7 @@ public class StripChartManager {
* updates the log by adding the most recent value
*/
public void update() {
values.add(new Double(variable.getValue().toVariableServer()));
values.add(Double.valueOf(variable.getValue().toVariableServer()));
}
/**