Skip to content
Snippets Groups Projects
Commit a8520266 authored by Tim Molter's avatar Tim Molter
Browse files

fix for issue #99 - Why do the FileFilters within XChartPanel don't accept directories?

parent da44c053
No related branches found
No related tags found
No related merge requests found
...@@ -129,17 +129,13 @@ public class XChartPanel extends JPanel { ...@@ -129,17 +129,13 @@ public class XChartPanel extends JPanel {
try { try {
if (fileChooser.getFileFilter() == null) { if (fileChooser.getFileFilter() == null) {
BitmapEncoder.saveBitmap(chart, theFileToSave.getCanonicalPath().toString(), BitmapFormat.PNG); BitmapEncoder.saveBitmap(chart, theFileToSave.getCanonicalPath().toString(), BitmapFormat.PNG);
} } else if (fileChooser.getFileFilter().getDescription().equals("*.jpg,*.JPG")) {
else if (fileChooser.getFileFilter().getDescription().equals("*.jpg,*.JPG")) {
BitmapEncoder.saveJPGWithQuality(chart, theFileToSave.getCanonicalPath().toString() + ".jpg", 1.0f); BitmapEncoder.saveJPGWithQuality(chart, theFileToSave.getCanonicalPath().toString() + ".jpg", 1.0f);
} } else if (fileChooser.getFileFilter().getDescription().equals("*.png,*.PNG")) {
else if (fileChooser.getFileFilter().getDescription().equals("*.png,*.PNG")) {
BitmapEncoder.saveBitmap(chart, theFileToSave.getCanonicalPath().toString(), BitmapFormat.PNG); BitmapEncoder.saveBitmap(chart, theFileToSave.getCanonicalPath().toString(), BitmapFormat.PNG);
} } else if (fileChooser.getFileFilter().getDescription().equals("*.bmp,*.BMP")) {
else if (fileChooser.getFileFilter().getDescription().equals("*.bmp,*.BMP")) {
BitmapEncoder.saveBitmap(chart, theFileToSave.getCanonicalPath().toString(), BitmapFormat.BMP); BitmapEncoder.saveBitmap(chart, theFileToSave.getCanonicalPath().toString(), BitmapFormat.BMP);
} } else if (fileChooser.getFileFilter().getDescription().equals("*.gif,*.GIF")) {
else if (fileChooser.getFileFilter().getDescription().equals("*.gif,*.GIF")) {
BitmapEncoder.saveBitmap(chart, theFileToSave.getCanonicalPath().toString(), BitmapFormat.GIF); BitmapEncoder.saveBitmap(chart, theFileToSave.getCanonicalPath().toString(), BitmapFormat.GIF);
} }
} catch (IOException e) { } catch (IOException e) {
...@@ -155,13 +151,7 @@ public class XChartPanel extends JPanel { ...@@ -155,13 +151,7 @@ public class XChartPanel extends JPanel {
@Override @Override
public boolean accept(File f) { public boolean accept(File f) {
if (f.isDirectory()) { return true;
return false;
}
String s = f.getName();
return s.endsWith(".jpg") || s.endsWith(".JPG");
} }
@Override @Override
...@@ -177,13 +167,7 @@ public class XChartPanel extends JPanel { ...@@ -177,13 +167,7 @@ public class XChartPanel extends JPanel {
@Override @Override
public boolean accept(File f) { public boolean accept(File f) {
if (f.isDirectory()) { return true;
return false;
}
String s = f.getName();
return s.endsWith(".bmp") || s.endsWith(".BMP");
} }
@Override @Override
...@@ -199,13 +183,7 @@ public class XChartPanel extends JPanel { ...@@ -199,13 +183,7 @@ public class XChartPanel extends JPanel {
@Override @Override
public boolean accept(File f) { public boolean accept(File f) {
if (f.isDirectory()) { return true;
return false;
}
String s = f.getName();
return s.endsWith(".gif") || s.endsWith(".GIF");
} }
@Override @Override
...@@ -221,13 +199,7 @@ public class XChartPanel extends JPanel { ...@@ -221,13 +199,7 @@ public class XChartPanel extends JPanel {
@Override @Override
public boolean accept(File f) { public boolean accept(File f) {
if (f.isDirectory()) { return true;
return false;
}
String s = f.getName();
return s.endsWith(".png") || s.endsWith(".PNG");
} }
@Override @Override
...@@ -303,8 +275,8 @@ public class XChartPanel extends JPanel { ...@@ -303,8 +275,8 @@ public class XChartPanel extends JPanel {
} }
/** /**
* update a series by only updating the Y-Axis data. The X-Axis data will be automatically generated as a list of increasing Integers starting from 1 and ending at the size of the new Y-Axis data * update a series by only updating the Y-Axis data. The X-Axis data will be automatically generated as a list of increasing Integers starting from
* list. * 1 and ending at the size of the new Y-Axis data list.
* *
* @param seriesName * @param seriesName
* @param newYData * @param newYData
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment