[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/attrview BooleanAttribute.java, 1.1, 1.2
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2006-11-04 16:54:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5372/src/net/sourceforge/bprocessor/gui/attrview Modified Files: BooleanAttribute.java StringAttribute.java GenericPanel.java Log Message: Fixed the "cant click on more than one item" bug in the attribute panel Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** StringAttribute.java 24 Apr 2006 08:45:10 -0000 1.11 --- StringAttribute.java 4 Nov 2006 16:54:53 -0000 1.12 *************** *** 25,33 **** --- 25,42 ---- import net.sourceforge.bprocessor.model.Attribute; + import org.apache.log4j.Logger; + /** * The StringAttributeView */ public class StringAttribute extends GenericAttribute implements KeyListener, MouseListener { + /** + * serial version UID + */ + private static final long serialVersionUID = 602299046329792847L; + /** The logger */ + private static Logger log = Logger.getLogger(StringAttribute.class); + /** The listeners */ private List listeners; *************** *** 43,50 **** /** The editor, when this EditableAttribute is being edited */ ! private JTextField editor; ! ! ! /** --- 52,56 ---- /** The editor, when this EditableAttribute is being edited */ ! private JTextField editor; /** Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GenericPanel.java 30 Oct 2006 00:00:02 -0000 1.23 --- GenericPanel.java 4 Nov 2006 16:54:53 -0000 1.24 *************** *** 11,16 **** --- 11,19 ---- import java.awt.event.MouseEvent; import java.awt.event.MouseListener; + import java.util.ArrayList; + import java.util.HashMap; import java.util.Iterator; import java.util.List; + import java.util.Map; import javax.swing.BorderFactory; *************** *** 47,50 **** --- 50,56 ---- private List attributes; + /** The list of generic attributes */ + private List genAttributes = new ArrayList(); + /** The box of content */ private Box content; *************** *** 87,94 **** /** * local method for generating the content ! * @param what The list of attrinutes * @param where The place to put all the generated content; */ private void generateContent(List what, JComponent where) { Iterator iter = what.iterator(); while (iter.hasNext()) { --- 93,101 ---- /** * local method for generating the content ! * @param what The list of attributes * @param where The place to put all the generated content; */ private void generateContent(List what, JComponent where) { + genAttributes.clear(); Iterator iter = what.iterator(); while (iter.hasNext()) { *************** *** 108,111 **** --- 115,119 ---- } }); + genAttributes.add(sa); where.add(new AttributeRow(sa)); } else if (a.getValue() instanceof List) { *************** *** 121,125 **** if (iterElems.next() instanceof Attribute) { generateContent(elems, more); ! } where.add(more); } else if (a.getValue() instanceof Description) { --- 129,133 ---- if (iterElems.next() instanceof Attribute) { generateContent(elems, more); ! } where.add(more); } else if (a.getValue() instanceof Description) { *************** *** 137,140 **** --- 145,149 ---- } }); + genAttributes.add(da); where.add(new AttributeRow(da)); } else if (a.getValue() instanceof Parametric) { *************** *** 152,155 **** --- 161,165 ---- } }); + genAttributes.add(la); where.add(new AttributeRow(la)); } else if (a.getValue() instanceof Material) { *************** *** 167,170 **** --- 177,181 ---- } }); + genAttributes.add(ma); where.add(new AttributeRow(ma)); } else if (a.getValue() instanceof Boolean) { *************** *** 182,185 **** --- 193,197 ---- } }); + genAttributes.add(ba); where.add(new AttributeRow(ba)); } else if (a.getValue() instanceof Classification) { *************** *** 197,200 **** --- 209,213 ---- } }); + genAttributes.add(catext);; where.add(new AttributeRow(catext)); if (a.getClassification() != null) { *************** *** 213,216 **** --- 226,230 ---- } }); + genAttributes.add(caid); where.add(new AttributeRow(caid)); } *************** *** 224,232 **** /** * Start editing the specified AttributeView ! * @param ga The genericAttribute to edit */ ! public void startEditing(GenericAttribute ga) { stopEditing(); ! current = ga; if (current != null) { current.startEditing(); --- 238,246 ---- /** * Start editing the specified AttributeView ! * @param i index of the attribute to edit */ ! public void startEditing(int i) { stopEditing(); ! current = (GenericAttribute)genAttributes.get(i); if (current != null) { current.startEditing(); *************** *** 299,303 **** */ public void mouseClicked(MouseEvent event) { ! startEditing(ga); } --- 313,317 ---- */ public void mouseClicked(MouseEvent event) { ! startEditing(genAttributes.indexOf(ga)); } *************** *** 325,329 **** /** ! * Getter for the parametric * @return the parametric */ --- 339,343 ---- /** ! * getter for the parametric * @return the parametric */ *************** *** 337,346 **** public void update() { complexUpdate(); ! /*if (simpleUpdate) { ! simpleUpdate(); ! simpleUpdate = false; ! } else { ! complexUpdate(); ! }*/ } --- 351,360 ---- public void update() { complexUpdate(); ! // if (simpleUpdate) { ! // simpleUpdate(); ! // simpleUpdate = false; ! // } else { ! // //complexUpdate(); ! // } } *************** *** 361,364 **** * */ ! public void simpleUpdate() { } } --- 375,379 ---- * */ ! public void simpleUpdate() { ! } } Index: BooleanAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/BooleanAttribute.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BooleanAttribute.java 17 Jul 2006 08:32:00 -0000 1.1 --- BooleanAttribute.java 4 Nov 2006 16:54:53 -0000 1.2 *************** *** 42,49 **** /** The valueLabel */ ! private JCheckBox valueLabel; ! ! ! /** --- 42,46 ---- /** The valueLabel */ ! private JCheckBox valueLabel; /** *************** *** 151,156 **** valueChanged(); } ! } ! /** --- 148,152 ---- valueChanged(); } ! } /** |