Skip to content

Commit

Permalink
Cleaned folderpath - uses current folder only now
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutralizer committed Feb 5, 2019
1 parent 4b7807b commit 30be80b
Show file tree
Hide file tree
Showing 21 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public PropertiesOperations(ROIManipulator roiManipulator) {
this.roiManipulator = roiManipulator;
}

public void saveRoiToPropFile(String folderPath, String currentPropFile) {
public void saveRoiToPropFile(String currentPropFile) {
try {
prop = new Properties();
File file = new File(currentPropFile);
Expand Down Expand Up @@ -153,11 +153,9 @@ private void addRoiToProperty(String key, int width, int height, int sizeWidth,
* @param folderPath
* @param filename
*/
public void loadPropertiesFileIntoInternalRoiManipulator(String folderPath, String filename) {
public void loadPropertiesFileIntoInternalRoiManipulator(String filename) {
try {
// input = new FileInputStream(folderPath + "\\" + filename);//TODO not curr dir
input = new FileInputStream(filename);
// input = new FileInputStream("REMOVEME.properties");//TODO for prop inside jar
if (input == null) {
System.err.println("Error - unable to find " + filename);// TODO throw for future displaying of err
return;
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/interfacePanel/panel/KeyTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class KeyTable extends JTable {
String[] columnNames;
ROIManipulator roi;
PropertiesOperations prop;
String folderPath;
String currentPropFile;
JTable table;
DefaultTableModel model;
Expand All @@ -69,15 +68,14 @@ public class KeyTable extends JTable {
* @param currentPropFile
* @param selectedPropFile
*/
public KeyTable(Display display, ROIManipulator roi, PropertiesOperations prop, String folderPath, String selectedPropFile) {
public KeyTable(Display display, ROIManipulator roi, PropertiesOperations prop, String selectedPropFile) {

this.display = display;
allowedKeysObject = new AllowedKeys();
comboBoxKeyName = new JComboBox<String>(allowedKeysObject.getAllowedKeys());
columnNames = new String[] { "Keyboard Key", "Square Location", "Key Type" };
this.roi = roi;
this.prop = prop;
this.folderPath = folderPath;
this.currentPropFile = selectedPropFile;
comboBoxKeyType = new JComboBox<String>(new String[] { KeyPressType.CONSTANT.toString(),
KeyPressType.PRESS.toString(), KeyPressType.TOGGLE.toString() });
Expand Down Expand Up @@ -241,7 +239,7 @@ public void actionPerformed(ActionEvent e) {
if (i >= 0) {
// remove a row from jtable
model.removeRow(i);
roi.removeRoiFromList(i);// TODO test if indexes will not be the same
roi.removeRoiFromList(i);
} else {
System.out.println("Delete Error");
}
Expand Down Expand Up @@ -303,7 +301,7 @@ public void actionPerformed(ActionEvent e) {
@Override
public void actionPerformed(ActionEvent e) {

prop.saveRoiToPropFile(null,currentPropFile);//TODO changed to current dir
prop.saveRoiToPropFile(currentPropFile);

}
});
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/interfacePanel/panel/MainPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public class MainPanel extends JFrame{
JSlider sliderDilate2 = new JSlider(1, 15, 1);
JSlider sliderHistory = new JSlider(1, 50, 1);
JSlider sliderThresh = new JSlider(1, 100, 16);
private boolean started = false;
GridBagConstraints c;
JPanel panelMain;
JPanel panelForm;
Expand Down Expand Up @@ -250,14 +249,14 @@ private void startExecution() {
Display display = new Display();
roi = new ROIManipulator(camera);
prop = new PropertiesOperations(roi);//cpp way - give obj and populate it
prop.loadPropertiesFileIntoInternalRoiManipulator(null, selectedPropFile);// "config.properties"
prop.loadPropertiesFileIntoInternalRoiManipulator(selectedPropFile);// "config.properties"

if(useWS) {//TODO dropped to deprecated status
SpecialKey wsKey = new SpecialKey(KeyEvent.VK_DOLLAR, KeyPressType.SPECIAL);
roi.addRoiToList(0, 0.52, wsKey);
roi.addRoiToList(0.16, 0.96, 0.70, 0.04, KeyEvent.VK_W, KeyPressType.CONSTANT);// must be last
}
kt = new KeyTable(display,roi,prop,null, selectedPropFile);
kt = new KeyTable(display,roi,prop, selectedPropFile);

kt.createTable(c,panelForm);
this.pack();
Expand Down
Binary file modified target/classes/bgSubtraction/properties/PropertiesOperations.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/KeyTable$1.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/KeyTable$2.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/KeyTable$3.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/KeyTable$4.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/KeyTable$5.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/KeyTable$6.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/KeyTable$7.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/KeyTable.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel$1.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel$2.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel$3.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel$4.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel$5.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel$6.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel$7.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel$8.class
Binary file not shown.
Binary file modified target/classes/interfacePanel/panel/MainPanel.class
Binary file not shown.

0 comments on commit 30be80b

Please sign in to comment.