- added validation of the XML with build in Nifty validaiton tool - added an error list reporting the errors on the file - redisigned the UI a bit git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9112 75d07b2b-3a1a-0410-a2c5-0572b91ccdca3.0
parent
e9614a683a
commit
751b4e851d
@ -1,2 +1,4 @@ |
|||||||
|
|
||||||
PreviewPanel.jLabel1.text=jLabel1 |
PreviewPanel.jLabel1.text=jLabel1 |
||||||
|
ErrorPanel.jLabel1.text=jLabel1 |
||||||
|
ErrorPanel.jLabel2.text=\ Errors |
||||||
|
@ -0,0 +1,62 @@ |
|||||||
|
<?xml version="1.1" encoding="UTF-8" ?> |
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.PanelFormInfo"> |
||||||
|
<NonVisualComponents> |
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1"> |
||||||
|
<Properties> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/gui/multiview/Bundle.properties" key="ErrorPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
</NonVisualComponents> |
||||||
|
<AuxValues> |
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/> |
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> |
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> |
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> |
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/> |
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> |
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> |
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> |
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> |
||||||
|
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,93,0,0,3,24"/> |
||||||
|
</AuxValues> |
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> |
||||||
|
<SubComponents> |
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1"> |
||||||
|
<Constraints> |
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> |
||||||
|
<BorderConstraints direction="Center"/> |
||||||
|
</Constraint> |
||||||
|
</Constraints> |
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> |
||||||
|
<SubComponents> |
||||||
|
<Component class="javax.swing.JList" name="jList1"> |
||||||
|
<Properties> |
||||||
|
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> |
||||||
|
<Connection code="errors" type="code"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
</Component> |
||||||
|
</SubComponents> |
||||||
|
</Container> |
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2"> |
||||||
|
<Properties> |
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> |
||||||
|
<Color blue="c8" green="c8" red="c8" type="rgb"/> |
||||||
|
</Property> |
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> |
||||||
|
<ResourceString bundle="com/jme3/gde/gui/multiview/Bundle.properties" key="ErrorPanel.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/> |
||||||
|
</Property> |
||||||
|
</Properties> |
||||||
|
<Constraints> |
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> |
||||||
|
<BorderConstraints direction="North"/> |
||||||
|
</Constraint> |
||||||
|
</Constraints> |
||||||
|
</Component> |
||||||
|
</SubComponents> |
||||||
|
</Form> |
@ -0,0 +1,114 @@ |
|||||||
|
/* |
||||||
|
* To change this template, choose Tools | Templates |
||||||
|
* and open the template in the editor. |
||||||
|
*/ |
||||||
|
|
||||||
|
/* |
||||||
|
* ErrorPanel.java |
||||||
|
* |
||||||
|
* Created on 23 janv. 2012, 22:19:24 |
||||||
|
*/ |
||||||
|
package com.jme3.gde.gui.multiview; |
||||||
|
|
||||||
|
import java.awt.Component; |
||||||
|
import javax.swing.DefaultListCellRenderer; |
||||||
|
import javax.swing.DefaultListModel; |
||||||
|
import javax.swing.ImageIcon; |
||||||
|
import javax.swing.JLabel; |
||||||
|
import javax.swing.JList; |
||||||
|
import javax.swing.SwingConstants; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @author Nehon |
||||||
|
*/ |
||||||
|
public class ErrorPanel extends java.awt.Panel { |
||||||
|
|
||||||
|
private DefaultListModel errors = new DefaultListModel(); |
||||||
|
private static ImageIcon fatalImage = null, nonFatalImage = null; |
||||||
|
|
||||||
|
/** Creates new form ErrorPanel */ |
||||||
|
public ErrorPanel() { |
||||||
|
initComponents(); |
||||||
|
jList1.setCellRenderer(new DefaultListCellRenderer() { |
||||||
|
|
||||||
|
@Override |
||||||
|
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
||||||
|
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
||||||
|
if (value instanceof JLabel) { |
||||||
|
setIcon(((JLabel) value).getIcon()); |
||||||
|
setText(((JLabel) value).getText()); |
||||||
|
} |
||||||
|
return this; |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private static ImageIcon getFatalErrorIcon() { |
||||||
|
if (fatalImage == null) { |
||||||
|
fatalImage = new ImageIcon(ErrorPanel.class.getResource("/com/jme3/gde/gui/multiview/icons/error.png")); //NOI18N
|
||||||
|
} |
||||||
|
return fatalImage; |
||||||
|
} |
||||||
|
|
||||||
|
private static ImageIcon getNonfatalErrorIcon() { |
||||||
|
if (nonFatalImage == null) { |
||||||
|
nonFatalImage = new ImageIcon(ErrorPanel.class.getResource("/com/jme3/gde/gui/multiview/icons/warning.png")); //NOI18N
|
||||||
|
} |
||||||
|
return nonFatalImage; |
||||||
|
} |
||||||
|
|
||||||
|
public void addError(String error) { |
||||||
|
errors.addElement(new JLabel( |
||||||
|
error, |
||||||
|
getFatalErrorIcon(), |
||||||
|
SwingConstants.LEFT)); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void addWarning(String error) { |
||||||
|
errors.addElement(new JLabel( |
||||||
|
error, |
||||||
|
getNonfatalErrorIcon(), |
||||||
|
SwingConstants.LEFT)); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public void clear(){ |
||||||
|
errors.clear(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** This method is called from within the constructor to |
||||||
|
* initialize the form. |
||||||
|
* WARNING: Do NOT modify this code. The content of this method is |
||||||
|
* always regenerated by the Form Editor. |
||||||
|
*/ |
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() { |
||||||
|
|
||||||
|
jLabel1 = new javax.swing.JLabel(); |
||||||
|
jScrollPane1 = new javax.swing.JScrollPane(); |
||||||
|
jList1 = new javax.swing.JList(); |
||||||
|
jLabel2 = new javax.swing.JLabel(); |
||||||
|
|
||||||
|
jLabel1.setText(org.openide.util.NbBundle.getMessage(ErrorPanel.class, "ErrorPanel.jLabel1.text")); // NOI18N
|
||||||
|
|
||||||
|
setLayout(new java.awt.BorderLayout()); |
||||||
|
|
||||||
|
jList1.setModel(errors); |
||||||
|
jScrollPane1.setViewportView(jList1); |
||||||
|
|
||||||
|
add(jScrollPane1, java.awt.BorderLayout.CENTER); |
||||||
|
|
||||||
|
jLabel2.setBackground(new java.awt.Color(200, 200, 200)); |
||||||
|
jLabel2.setText(org.openide.util.NbBundle.getMessage(ErrorPanel.class, "ErrorPanel.jLabel2.text")); // NOI18N
|
||||||
|
add(jLabel2, java.awt.BorderLayout.NORTH); |
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JLabel jLabel1; |
||||||
|
private javax.swing.JLabel jLabel2; |
||||||
|
private javax.swing.JList jList1; |
||||||
|
private javax.swing.JScrollPane jScrollPane1; |
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
} |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 1.7 KiB |
Loading…
Reference in new issue