Search in sources :

Example 1 with ResourceManager

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();
        }
    }
}
Also used : MaterialSettings(org.jwildfire.create.tina.base.solidrender.MaterialSettings) Color(java.awt.Color) RGBColor(org.jwildfire.create.tina.palette.RGBColor) Stereo3dColor(org.jwildfire.create.tina.base.Stereo3dColor) ResourceManager(com.l2fprod.common.util.ResourceManager)

Example 2 with ResourceManager

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();
            }
        }
    }
}
Also used : Color(java.awt.Color) RGBColor(org.jwildfire.create.tina.palette.RGBColor) ResourceManager(com.l2fprod.common.util.ResourceManager)

Example 3 with ResourceManager

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();
        }
    }
}
Also used : Color(java.awt.Color) RGBColor(org.jwildfire.create.tina.palette.RGBColor) ResourceManager(com.l2fprod.common.util.ResourceManager)

Example 4 with ResourceManager

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);
    }
}
Also used : JFileChooser(javax.swing.JFileChooser) ResourceManager(com.l2fprod.common.util.ResourceManager) IOException(java.io.IOException) File(java.io.File)

Example 5 with ResourceManager

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);
    }
}
Also used : JFileChooser(javax.swing.JFileChooser) ResourceManager(com.l2fprod.common.util.ResourceManager) File(java.io.File)

Aggregations

ResourceManager (com.l2fprod.common.util.ResourceManager)12 Color (java.awt.Color)10 RGBColor (org.jwildfire.create.tina.palette.RGBColor)8 File (java.io.File)2 JFileChooser (javax.swing.JFileChooser)2 Stereo3dColor (org.jwildfire.create.tina.base.Stereo3dColor)2 IOException (java.io.IOException)1 DistantLight (org.jwildfire.create.tina.base.solidrender.DistantLight)1 MaterialSettings (org.jwildfire.create.tina.base.solidrender.MaterialSettings)1