JPanel jptitles = new JPanel();
jptitles.setLayout(new GridLayout(4, 2));
jptitles.add(new HelpedLabel(Translator.getTranslation("Diagram title"),
"title", "graphics", view));
jtextTitle = new HelpedTextField("title", "graphics", view);
jptitles.add(jtextTitle);
jptitles.add(new HelpedLabel(Translator.getTranslation("X axis title"),
"titlex", "graphics", view));
jtextTitleX = new HelpedTextField("titlex", "graphics", view);
jptitles.add(jtextTitleX);
jptitles.add(new HelpedLabel(Translator.getTranslation("Y axis title"),
"titley", "graphics", view));
jtextTitleY = new HelpedTextField("titley", "graphics", view);
jptitles.add(jtextTitleY);
JButton butsearch = new HelpedButton(Translator.getTranslation("Find background image"),
"findimage", "graphics", view);
butsearch.addActionListener(
new java.awt.event.ActionListener() {
//{{{ +actionPerformed(java.awt.event.ActionEvent) : void
public void actionPerformed(java.awt.event.ActionEvent evt) {
//Get file name
JFileChooser fileDialog = new JFileChooser();
javax.swing.filechooser.FileFilter filter =
new javax.swing.filechooser.FileFilter() {
//{{{ +accept(File) : boolean
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
//this allows navigation in the file system
}
String extension = SieExport.getExtension(f);
if (extension != null) {
if (extension.equals("jpg")
|| extension.equals("jpeg")
|| extension.equals("gif")
|| extension.equals("png")
) {
return true;
} else {
return false;
}
}
return false;
}//}}}
//{{{ +getDescription() : String
public String getDescription() {
return Translator.getTranslation("JPEG,JPG,PNG or GIF image");
}//}}}
};
fileDialog.setFileFilter(filter);
if (fileDialog.showOpenDialog(null) ==
JFileChooser.APPROVE_OPTION) {
textBackgroundFile.setText(fileDialog.getSelectedFile().getPath());
}
}//}}}
}
);
jptitles.add(butsearch);
textBackgroundFile = new HelpedTextField("findimage", "graphics", view);
jptitles.add(textBackgroundFile);
jp5.add(jptitles);
whatsShowing.add(jp5, BorderLayout.NORTH);