[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/attrview StringAttribute.java, 1.14, 1.1
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-09-14 11:32:38
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8713/src/net/sourceforge/bprocessor/gui/attrview Modified Files: StringAttribute.java Log Message: Removed unused attributeview package and added a saveDBK option in file menu Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** StringAttribute.java 8 May 2007 07:19:29 -0000 1.14 --- StringAttribute.java 14 Sep 2007 11:32:38 -0000 1.15 *************** *** 23,26 **** --- 23,27 ---- import javax.swing.JTextField; + import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Attribute; *************** *** 85,89 **** this.add(ext); } ! if (attribute.getName().equalsIgnoreCase("U-value")) { ext = new JLabel(" W/m2K"); ext.setFont(AttributeView.FONT_PLAIN); --- 86,90 ---- this.add(ext); } ! if (attribute.getName().equalsIgnoreCase("uvalue")) { ext = new JLabel(" W/m2K"); ext.setFont(AttributeView.FONT_PLAIN); *************** *** 233,248 **** public void stopEditing() { if (editor != null && attribute.isEditable()) { ! Object val = attribute.getValue(); ! if (val instanceof String) { ! attribute.setValue(editor.getText()); ! } else if (val instanceof Double) { ! attribute.setValue(Double.valueOf(editor.getText()) / 1000); } - component.remove(editor); - editor.removeKeyListener(this); - editor = null; - component.add(createValueLabel(attribute.getValue())); - component.revalidate(); - valueChanged(); } } --- 234,253 ---- public void stopEditing() { if (editor != null && attribute.isEditable()) { ! try { ! Object val = attribute.getValue(); ! if (val instanceof String) { ! attribute.setValue(editor.getText()); ! } else if (val instanceof Double) { ! attribute.setValue(Double.valueOf(editor.getText()) / 1000); ! } ! component.remove(editor); ! editor.removeKeyListener(this); ! editor = null; ! component.add(createValueLabel(attribute.getValue())); ! component.revalidate(); ! valueChanged(); ! } catch (Exception e) { ! GUI.getInstance().alert("Wrong number format: " + e.getMessage()); } } } |