trackeditor: fix file chooser titles
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8219 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: b6046b9a2ed8c1d2e349775d405f1e93aad43660 Former-commit-id: 09f92150d8fbeff30b01feb34924cad1399884c5
This commit is contained in:
parent
39248f0909
commit
3b5429017d
6 changed files with 77 additions and 112 deletions
|
@ -151,7 +151,7 @@ public class EnvMapProperties extends PropertyPanel
|
|||
private JTextField nameTextField = new JTextField();
|
||||
private JLabel envMapLabel = new JLabel();
|
||||
private JTextField envMapTextField = new JTextField();
|
||||
private JButton browseButton = null;
|
||||
private JButton envMapButton = null;
|
||||
|
||||
private final String sep = System.getProperty("file.separator");
|
||||
|
||||
|
@ -177,40 +177,40 @@ public class EnvMapProperties extends PropertyPanel
|
|||
addTextField(this, 0, nameTextField, name, 115, 60);
|
||||
addTextField(this, 1, envMapTextField, environmentMap, 115, 250);
|
||||
|
||||
add(getBrowseButton(), null);
|
||||
add(getEnvMapButton(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes browseButton
|
||||
* This method initializes envMapButton
|
||||
*
|
||||
* @return javax.swing.JButton
|
||||
*/
|
||||
private JButton getBrowseButton()
|
||||
private JButton getEnvMapButton()
|
||||
{
|
||||
if (browseButton == null)
|
||||
if (envMapButton == null)
|
||||
{
|
||||
browseButton = new JButton();
|
||||
browseButton.setBounds(370, 33, 80, 25);
|
||||
browseButton.setText("Browse");
|
||||
browseButton.addActionListener(new java.awt.event.ActionListener()
|
||||
envMapButton = new JButton();
|
||||
envMapButton.setBounds(370, 33, 80, 25);
|
||||
envMapButton.setText("Browse");
|
||||
envMapButton.addActionListener(new java.awt.event.ActionListener()
|
||||
{
|
||||
public void actionPerformed(java.awt.event.ActionEvent e)
|
||||
{
|
||||
selectFile();
|
||||
envMapFile();
|
||||
}
|
||||
});
|
||||
}
|
||||
return browseButton;
|
||||
return envMapButton;
|
||||
}
|
||||
|
||||
protected void selectFile()
|
||||
protected void envMapFile()
|
||||
{
|
||||
JFileChooser fc = new JFileChooser();
|
||||
fc.setSelectedFiles(null);
|
||||
fc.setSelectedFile(null);
|
||||
fc.rescanCurrentDirectory();
|
||||
fc.setApproveButtonMnemonic(0);
|
||||
fc.setDialogTitle("Enfironment Mapping image file selection");
|
||||
fc.setDialogTitle("Environment Mapping image file selection");
|
||||
fc.setVisible(true);
|
||||
fc.setAcceptAllFileFilterUsed(false);
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("PNG images", "png");
|
||||
|
|
|
@ -51,7 +51,7 @@ public class GeneralProperties extends PropertyPanel
|
|||
private JComboBox<String> skyVersionComboBox = null;
|
||||
private JLabel pathLabel = new JLabel();
|
||||
private JTextField pathTextField = new JTextField();
|
||||
private JButton browseButton = null;
|
||||
private JButton pathButton = null;
|
||||
private JLabel authorLabel = new JLabel();
|
||||
private JTextField authorTextField = new JTextField();
|
||||
private JLabel descriptionLabel = new JLabel();
|
||||
|
@ -96,7 +96,7 @@ public class GeneralProperties extends PropertyPanel
|
|||
addTextField(this, 6, authorTextField, Editor.getProperties().getHeader().getAuthor(), 80, 390);
|
||||
addTextField(this, 7, descriptionTextField, Editor.getProperties().getHeader().getDescription(), 80, 390);
|
||||
|
||||
add(getBrowseButton(), null);
|
||||
add(getPathButton(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -177,18 +177,18 @@ public class GeneralProperties extends PropertyPanel
|
|||
}
|
||||
|
||||
/**
|
||||
* This method initializes browseButton
|
||||
* This method initializes pathButton
|
||||
*
|
||||
* @return javax.swing.JButton
|
||||
*/
|
||||
public JButton getBrowseButton()
|
||||
public JButton getPathButton()
|
||||
{
|
||||
if (browseButton == null)
|
||||
if (pathButton == null)
|
||||
{
|
||||
browseButton = new JButton();
|
||||
browseButton.setBounds(390, 132, 80, 25);
|
||||
browseButton.setText("Browse");
|
||||
browseButton.addActionListener(new java.awt.event.ActionListener()
|
||||
pathButton = new JButton();
|
||||
pathButton.setBounds(390, 132, 80, 25);
|
||||
pathButton.setText("Browse");
|
||||
pathButton.addActionListener(new java.awt.event.ActionListener()
|
||||
{
|
||||
public void actionPerformed(java.awt.event.ActionEvent e)
|
||||
{
|
||||
|
@ -196,7 +196,7 @@ public class GeneralProperties extends PropertyPanel
|
|||
}
|
||||
});
|
||||
}
|
||||
return browseButton;
|
||||
return pathButton;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -85,7 +85,7 @@ public class GraphicProperties extends PropertyPanel
|
|||
private JTextField shininessTextField = new JTextField();
|
||||
private JLabel fovFactorLabel = new JLabel();
|
||||
private JTextField fovFactorTextField = new JTextField();
|
||||
private JButton browseButton = null;
|
||||
private JButton backgroundImageButton = null;
|
||||
|
||||
private final String sep = System.getProperty("file.separator");
|
||||
|
||||
|
@ -156,7 +156,7 @@ public class GraphicProperties extends PropertyPanel
|
|||
addTextField(this, 20, shininessTextField, Editor.getProperties().getGraphic().getShininess(), 140, 80);
|
||||
addTextField(this, 21, fovFactorTextField, Editor.getProperties().getGraphic().getFovFactor(), 140, 80);
|
||||
|
||||
add(getBrowseButton(), null);
|
||||
add(getBackgroundImageButton(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -180,36 +180,36 @@ public class GraphicProperties extends PropertyPanel
|
|||
}
|
||||
|
||||
/**
|
||||
* This method initializes browseButton
|
||||
* This method initializes backgroundImageButton
|
||||
*
|
||||
* @return javax.swing.JButton
|
||||
*/
|
||||
private JButton getBrowseButton()
|
||||
private JButton getBackgroundImageButton()
|
||||
{
|
||||
if (browseButton == null)
|
||||
if (backgroundImageButton == null)
|
||||
{
|
||||
browseButton = new JButton();
|
||||
browseButton.setBounds(390, 82, 80, 25);
|
||||
browseButton.setText("Browse");
|
||||
browseButton.addActionListener(new java.awt.event.ActionListener()
|
||||
backgroundImageButton = new JButton();
|
||||
backgroundImageButton.setBounds(390, 82, 80, 25);
|
||||
backgroundImageButton.setText("Browse");
|
||||
backgroundImageButton.addActionListener(new java.awt.event.ActionListener()
|
||||
{
|
||||
public void actionPerformed(java.awt.event.ActionEvent e)
|
||||
{
|
||||
selectFile();
|
||||
backgroundImageFile();
|
||||
}
|
||||
});
|
||||
}
|
||||
return browseButton;
|
||||
return backgroundImageButton;
|
||||
}
|
||||
|
||||
protected void selectFile()
|
||||
protected void backgroundImageFile()
|
||||
{
|
||||
JFileChooser fc = new JFileChooser();
|
||||
fc.setSelectedFiles(null);
|
||||
fc.setSelectedFile(null);
|
||||
fc.rescanCurrentDirectory();
|
||||
fc.setApproveButtonMnemonic(0);
|
||||
fc.setDialogTitle("Surface texture image file selection");
|
||||
fc.setDialogTitle("Background image file selection");
|
||||
fc.setVisible(true);
|
||||
fc.setAcceptAllFileFilterUsed(false);
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("RGB and PNG images", "rgb", "png");
|
||||
|
|
|
@ -41,7 +41,7 @@ public class ImageProperties extends PropertyPanel
|
|||
{
|
||||
private JLabel pathLabel = new JLabel();
|
||||
private JTextField pathTextField = new JTextField();
|
||||
private JButton browseButton = null;
|
||||
private JButton pathButton = null;
|
||||
private JLabel imageScaleLabel = new JLabel();
|
||||
private JTextField imageScaleTextField = new JTextField();
|
||||
|
||||
|
@ -70,22 +70,22 @@ public class ImageProperties extends PropertyPanel
|
|||
addTextField(this, 0, pathTextField, Editor.getProperties().getImage(), 100, 285);
|
||||
addTextField(this, 1, imageScaleTextField, Editor.getProperties().getImageScale(), 100, 50);
|
||||
|
||||
this.add(getBrowseButton(), null);
|
||||
this.add(getPathButton(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes browseButton
|
||||
* This method initializes pathButton
|
||||
*
|
||||
* @return javax.swing.JButton
|
||||
*/
|
||||
public JButton getBrowseButton()
|
||||
public JButton getPathButton()
|
||||
{
|
||||
if (browseButton == null)
|
||||
if (pathButton == null)
|
||||
{
|
||||
browseButton = new JButton();
|
||||
browseButton.setBounds(390, 7, 80, 25);
|
||||
browseButton.setText("Browse");
|
||||
browseButton.addActionListener(new java.awt.event.ActionListener()
|
||||
pathButton = new JButton();
|
||||
pathButton.setBounds(390, 7, 80, 25);
|
||||
pathButton.setText("Browse");
|
||||
pathButton.addActionListener(new java.awt.event.ActionListener()
|
||||
{
|
||||
public void actionPerformed(java.awt.event.ActionEvent e)
|
||||
{
|
||||
|
@ -93,7 +93,7 @@ public class ImageProperties extends PropertyPanel
|
|||
}
|
||||
});
|
||||
}
|
||||
return browseButton;
|
||||
return pathButton;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -351,7 +351,7 @@ public class SurfaceProperties extends PropertyPanel
|
|||
fc.setSelectedFile(null);
|
||||
fc.rescanCurrentDirectory();
|
||||
fc.setApproveButtonMnemonic(0);
|
||||
fc.setDialogTitle("Surface texture image file selection");
|
||||
fc.setDialogTitle("Surface image file selection");
|
||||
fc.setVisible(true);
|
||||
fc.setAcceptAllFileFilterUsed(false);
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("RGB and PNG images", "rgb", "png");
|
||||
|
@ -399,7 +399,7 @@ public class SurfaceProperties extends PropertyPanel
|
|||
fc.setSelectedFile(null);
|
||||
fc.rescanCurrentDirectory();
|
||||
fc.setApproveButtonMnemonic(0);
|
||||
fc.setDialogTitle("Surface texture image file selection");
|
||||
fc.setDialogTitle("Raceline image file selection");
|
||||
fc.setVisible(true);
|
||||
fc.setAcceptAllFileFilterUsed(false);
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("RGB and PNG images", "rgb", "png");
|
||||
|
|
|
@ -275,7 +275,7 @@ public class TerrainProperties extends PropertyPanel
|
|||
fc.setSelectedFile(null);
|
||||
fc.rescanCurrentDirectory();
|
||||
fc.setApproveButtonMnemonic(0);
|
||||
fc.setDialogTitle("Surface texture image file selection");
|
||||
fc.setDialogTitle("Elevation map image file selection");
|
||||
fc.setVisible(true);
|
||||
fc.setAcceptAllFileFilterUsed(false);
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("RGB and PNG images", "rgb", "png");
|
||||
|
@ -300,7 +300,7 @@ public class TerrainProperties extends PropertyPanel
|
|||
fc.setSelectedFile(null);
|
||||
fc.rescanCurrentDirectory();
|
||||
fc.setApproveButtonMnemonic(0);
|
||||
fc.setDialogTitle("Surface texture image file selection");
|
||||
fc.setDialogTitle("Relief image file selection");
|
||||
fc.setVisible(true);
|
||||
fc.setAcceptAllFileFilterUsed(false);
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("RGB and PNG images", "rgb", "png");
|
||||
|
@ -461,11 +461,11 @@ public class TerrainProperties extends PropertyPanel
|
|||
|
||||
private class ObjectMapPanel extends JPanel
|
||||
{
|
||||
private JLabel nameLabel = null;
|
||||
private JTextField nameTextField = null;
|
||||
private JLabel objectMapLabel = null;
|
||||
private JTextField objectMapTextField = null;
|
||||
private JButton browseButton = null;
|
||||
private JLabel nameLabel = new JLabel();
|
||||
private JTextField nameTextField = new JTextField();
|
||||
private JLabel objectMapLabel = new JLabel();
|
||||
private JTextField objectMapTextField = new JTextField();
|
||||
private JButton objectMapButton = null;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -481,76 +481,41 @@ public class TerrainProperties extends PropertyPanel
|
|||
*/
|
||||
private void initialize(String name, String objectMap)
|
||||
{
|
||||
nameLabel = new JLabel();
|
||||
objectMapLabel = new JLabel();
|
||||
nameLabel.setBounds(15, 15, 90, 20);
|
||||
nameLabel.setText("Name");
|
||||
objectMapLabel.setBounds(15, 40, 90, 20);
|
||||
objectMapLabel.setText("Object Map");
|
||||
add(nameLabel);
|
||||
add(objectMapLabel);
|
||||
setLayout(null);
|
||||
add(getNameTextField(), null);
|
||||
add(getObjectMapTextField(), null);
|
||||
add(getBrowseButton(), null);
|
||||
|
||||
addLabel(this, 0, nameLabel, "Name", 90);
|
||||
addLabel(this, 1, objectMapLabel, "Environment Map", 90);
|
||||
|
||||
getNameTextField().setText(name);
|
||||
getObjectMapTextField().setText(objectMap);
|
||||
addTextField(this, 0, nameTextField, name, 115, 60);
|
||||
addTextField(this, 1, objectMapTextField, objectMap, 115, 250);
|
||||
|
||||
add(getObjectMapButton(), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes nameTextField
|
||||
*
|
||||
* @return javax.swing.JTextField
|
||||
*/
|
||||
public JTextField getNameTextField()
|
||||
{
|
||||
if (nameTextField == null)
|
||||
{
|
||||
nameTextField = new JTextField();
|
||||
nameTextField.setBounds(105, 15, 60, 20);
|
||||
}
|
||||
return nameTextField;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes objectMapTextField
|
||||
*
|
||||
* @return javax.swing.JTextField
|
||||
*/
|
||||
public JTextField getObjectMapTextField()
|
||||
{
|
||||
if (objectMapTextField == null)
|
||||
{
|
||||
objectMapTextField = new JTextField();
|
||||
objectMapTextField.setBounds(105, 40, 260, 20);
|
||||
}
|
||||
return objectMapTextField;
|
||||
}
|
||||
/**
|
||||
* This method initializes browseButton
|
||||
* This method initializes objectMapButton
|
||||
*
|
||||
* @return javax.swing.JButton
|
||||
*/
|
||||
private JButton getBrowseButton()
|
||||
private JButton getObjectMapButton()
|
||||
{
|
||||
if (browseButton == null)
|
||||
if (objectMapButton == null)
|
||||
{
|
||||
browseButton = new JButton();
|
||||
browseButton.setBounds(370, 37, 80, 25);
|
||||
browseButton.setText("Browse");
|
||||
browseButton.addActionListener(new java.awt.event.ActionListener()
|
||||
objectMapButton = new JButton();
|
||||
objectMapButton.setBounds(370, 32, 80, 25);
|
||||
objectMapButton.setText("Browse");
|
||||
objectMapButton.addActionListener(new java.awt.event.ActionListener()
|
||||
{
|
||||
public void actionPerformed(java.awt.event.ActionEvent e)
|
||||
{
|
||||
selectFile();
|
||||
objectMapFile();
|
||||
}
|
||||
});
|
||||
}
|
||||
return browseButton;
|
||||
return objectMapButton;
|
||||
}
|
||||
|
||||
protected void selectFile()
|
||||
protected void objectMapFile()
|
||||
{
|
||||
JFileChooser fc = new JFileChooser();
|
||||
fc.setSelectedFiles(null);
|
||||
|
@ -571,7 +536,7 @@ public class TerrainProperties extends PropertyPanel
|
|||
String pathToFile = fileName.substring(0, index);
|
||||
if (pathToFile.equals(Editor.getProperties().getPath()))
|
||||
fileName = fileName.substring(index + 1);
|
||||
getObjectMapTextField().setText(fileName);
|
||||
objectMapTextField.setText(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -671,12 +636,12 @@ public class TerrainProperties extends PropertyPanel
|
|||
{
|
||||
utils.circuit.ObjectMap objectMap = objectMaps.elementAt(i);
|
||||
ObjectMapPanel panel = (ObjectMapPanel) tabbedPane.getComponentAt(i);
|
||||
if (isDifferent(panel.getNameTextField().getText(), objectMap.getName(), stringResult))
|
||||
if (isDifferent(panel.nameTextField.getText(), objectMap.getName(), stringResult))
|
||||
{
|
||||
objectMap.setName(stringResult.getValue());
|
||||
frame.documentIsModified = true;
|
||||
}
|
||||
if (isDifferent(panel.getObjectMapTextField().getText(), objectMap.getObjectMap(), stringResult))
|
||||
if (isDifferent(panel.objectMapTextField.getText(), objectMap.getObjectMap(), stringResult))
|
||||
{
|
||||
objectMap.setObjectMap(stringResult.getValue());
|
||||
frame.documentIsModified = true;
|
||||
|
@ -697,8 +662,8 @@ public class TerrainProperties extends PropertyPanel
|
|||
{
|
||||
ObjectMapPanel panel = (ObjectMapPanel) tabbedPane.getComponentAt(objectMaps.size());
|
||||
ObjectMap objectMap = new ObjectMap();
|
||||
objectMap.setName(panel.getNameTextField().getText());
|
||||
objectMap.setObjectMap(panel.getObjectMapTextField().getText());
|
||||
objectMap.setName(panel.nameTextField.getText());
|
||||
objectMap.setObjectMap(panel.objectMapTextField.getText());
|
||||
objectMaps.add(objectMap);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue