use of com.l2fprod.common.util.ResourceManager in project JWildfire by thargor6.
the class FlameControlsDelegate method solidRenderingMaterialSpecularColorBtn_clicked.
public void solidRenderingMaterialSpecularColorBtn_clicked() {
MaterialSettings material = getSolidRenderingSelectedMaterial();
if (material != null) {
owner.undoManager.saveUndoPoint(getCurrFlame());
ResourceManager rm = ResourceManager.all(FilePropertyEditor.class);
String title = rm.getString("ColorPropertyEditor.title");
Color selectedColor = JColorChooser.showDialog(rootPanel, title, new Color(Tools.roundColor(material.getPhongRed() * GammaCorrectionFilter.COLORSCL), Tools.roundColor(material.getPhongGreen() * GammaCorrectionFilter.COLORSCL), Tools.roundColor(material.getPhongBlue() * GammaCorrectionFilter.COLORSCL)));
if (selectedColor != null) {
material.setPhongRed((double) selectedColor.getRed() / GammaCorrectionFilter.COLORSCL);
material.setPhongGreen((double) selectedColor.getGreen() / GammaCorrectionFilter.COLORSCL);
material.setPhongBlue((double) selectedColor.getBlue() / GammaCorrectionFilter.COLORSCL);
owner.refreshFlameImage(true, false, 1, true, true);
refreshSolidRenderMaterialSpecularColorIndicator();
}
}
}
use of com.l2fprod.common.util.ResourceManager in project JWildfire by thargor6.
the class TinaController method backgroundColorCCBtn_clicked.
public void backgroundColorCCBtn_clicked() {
if (getCurrFlame() != null) {
undoManager.saveUndoPoint(getCurrFlame());
ResourceManager rm = ResourceManager.all(FilePropertyEditor.class);
String title = rm.getString("ColorPropertyEditor.title");
if (BGColorType.GRADIENT_2X2_C.equals(getCurrFlame().getBgColorType())) {
Color selectedColor = JColorChooser.showDialog(rootPanel, title, new Color(getCurrFlame().getBgColorCCRed(), getCurrFlame().getBgColorCCGreen(), getCurrFlame().getBgColorCCBlue()));
if (selectedColor != null) {
getCurrFlame().setBgColorCCRed(selectedColor.getRed());
getCurrFlame().setBgColorCCGreen(selectedColor.getGreen());
getCurrFlame().setBgColorCCBlue(selectedColor.getBlue());
refreshFlameImage(true, false, 1, true, true);
refreshBGColorCCIndicator();
}
} else {
Color selectedColor = JColorChooser.showDialog(rootPanel, title, new Color(getCurrFlame().getBgColorRed(), getCurrFlame().getBgColorGreen(), getCurrFlame().getBgColorBlue()));
if (selectedColor != null) {
getCurrFlame().setBgColorRed(selectedColor.getRed());
getCurrFlame().setBgColorGreen(selectedColor.getGreen());
getCurrFlame().setBgColorBlue(selectedColor.getBlue());
refreshFlameImage(true, false, 1, true, true);
refreshBGColorCCIndicator();
}
}
}
}
use of com.l2fprod.common.util.ResourceManager in project JWildfire by thargor6.
the class TinaController method backgroundColorLLBtn_clicked.
public void backgroundColorLLBtn_clicked() {
if (getCurrFlame() != null) {
undoManager.saveUndoPoint(getCurrFlame());
ResourceManager rm = ResourceManager.all(FilePropertyEditor.class);
String title = rm.getString("ColorPropertyEditor.title");
Color selectedColor = JColorChooser.showDialog(rootPanel, title, new Color(getCurrFlame().getBgColorLLRed(), getCurrFlame().getBgColorLLGreen(), getCurrFlame().getBgColorLLBlue()));
if (selectedColor != null) {
getCurrFlame().setBgColorLLRed(selectedColor.getRed());
getCurrFlame().setBgColorLLGreen(selectedColor.getGreen());
getCurrFlame().setBgColorLLBlue(selectedColor.getBlue());
refreshFlameImage(true, false, 1, true, true);
refreshBGColorLLIndicator();
}
}
}
use of com.l2fprod.common.util.ResourceManager in project CodenameOne by codenameone.
the class DirectoryPropertyEditor method selectFile.
protected void selectFile() {
ResourceManager rm = ResourceManager.all(FilePropertyEditor.class);
JFileChooser chooser = UserPreferences.getDefaultDirectoryChooser();
chooser.setDialogTitle(rm.getString("DirectoryPropertyEditor.dialogTitle"));
chooser.setApproveButtonText(rm.getString("DirectoryPropertyEditor.approveButtonText"));
chooser.setApproveButtonMnemonic(rm.getChar("DirectoryPropertyEditor.approveButtonMnemonic"));
File oldFile = (File) getValue();
if (oldFile != null && oldFile.isDirectory()) {
try {
chooser.setCurrentDirectory(oldFile.getCanonicalFile());
} catch (IOException e) {
e.printStackTrace();
}
}
if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(editor)) {
File newFile = chooser.getSelectedFile();
String text = newFile.getAbsolutePath();
textfield.setText(text);
firePropertyChange(oldFile, newFile);
}
}
use of com.l2fprod.common.util.ResourceManager in project CodenameOne by codenameone.
the class FilePropertyEditor method selectFile.
protected void selectFile() {
ResourceManager rm = ResourceManager.all(FilePropertyEditor.class);
JFileChooser chooser = UserPreferences.getDefaultFileChooser();
chooser.setDialogTitle(rm.getString("FilePropertyEditor.dialogTitle"));
chooser.setApproveButtonText(rm.getString("FilePropertyEditor.approveButtonText"));
chooser.setApproveButtonMnemonic(rm.getChar("FilePropertyEditor.approveButtonMnemonic"));
customizeFileChooser(chooser);
if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(editor)) {
File oldFile = (File) getValue();
File newFile = chooser.getSelectedFile();
String text = newFile.getAbsolutePath();
textfield.setText(text);
firePropertyChange(oldFile, newFile);
}
}
Aggregations