[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/attrview GenericPanel.java, 1.39, 1.40 C
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-08-09 16:07:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4335/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java ClassificationTextAttribute.java Log Message: Made the way the attributes are pressented for classification and classificationtype look better and added a types folder to the DBK tree. Made the project hold all the possible types to make it possible to alter them. Space can now hold their own classificationtype parameter values if they are altered there. Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** GenericPanel.java 23 Jul 2007 13:57:39 -0000 1.39 --- GenericPanel.java 9 Aug 2007 16:07:48 -0000 1.40 *************** *** 155,174 **** genAttributes.add(da); where.add(new AttributeRow(da)); - } else if (a.getValue() instanceof Parametric && !(a.getValue() instanceof Structure)) { - // Handles the links - LinkAttribute la = new LinkAttribute(a); - la.addStringAttributeListener(new AttributeListener() { - public void valueChanged(Attribute a) { - obj.setAttributes(attributes); - if (obj instanceof Entity) { - simpleUpdate = true; - ((Entity)obj).changed(); - } else if (obj instanceof Camera) { - Project.getInstance().changed((Camera)obj); - } - } - }); - genAttributes.add(la); - where.add(new AttributeRow(la)); } else if (a.getValue() instanceof Material) { // Handles the materials --- 155,158 ---- *************** *** 203,207 **** genAttributes.add(ba); where.add(new AttributeRow(ba)); ! } else if (a.getValue() instanceof Structure) { // Handles the text part classification ClassificationTextAttribute catext = new ClassificationTextAttribute(a); --- 187,191 ---- genAttributes.add(ba); where.add(new AttributeRow(ba)); ! } else if (a.getThe2ndValue() instanceof Structure) { // Handles the text part classification ClassificationTextAttribute catext = new ClassificationTextAttribute(a); *************** *** 258,261 **** --- 242,261 ---- genAttributes.add(satt); where.add(new AttributeRow(satt)); + } else if (a.getValue() instanceof Parametric) { + // Handles the links + LinkAttribute la = new LinkAttribute(a); + la.addStringAttributeListener(new AttributeListener() { + public void valueChanged(Attribute a) { + obj.setAttributes(attributes); + if (obj instanceof Entity) { + simpleUpdate = true; + ((Entity)obj).changed(); + } else if (obj instanceof Camera) { + Project.getInstance().changed((Camera)obj); + } + } + }); + genAttributes.add(la); + where.add(new AttributeRow(la)); } else { log.info("[GenericPanel] Something were not implemented"); Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ClassificationTextAttribute.java 23 Jul 2007 13:57:39 -0000 1.9 --- ClassificationTextAttribute.java 9 Aug 2007 16:07:48 -0000 1.10 *************** *** 85,90 **** Box column = Box.createVerticalBox(); component = Box.createHorizontalBox(); ! if (attribute.getThe2ndValue() != null) { ! JLabel cur = (JLabel) createValueLabel((Structure)attribute.getThe2ndValue()); cur.setFont(AttributeView.FONT_PLAIN); component.add(cur); --- 85,90 ---- Box column = Box.createVerticalBox(); component = Box.createHorizontalBox(); ! if (attribute.getValue() != null) { ! JLabel cur = (JLabel) createValueLabel((Structure)attribute.getValue()); cur.setFont(AttributeView.FONT_PLAIN); component.add(cur); *************** *** 94,98 **** component.add(cur); } ! createMenu((Structure)attribute.getValue()); Box header = Box.createHorizontalBox(); header.add(Box.createHorizontalStrut(7)); --- 94,98 ---- component.add(cur); } ! createMenu((Structure)attribute.getThe2ndValue()); Box header = Box.createHorizontalBox(); header.add(Box.createHorizontalStrut(7)); *************** *** 194,200 **** */ private JComponent createValueLabel(Structure value) { ! JLabel valueLabel = new JLabel(value.getName()); ! valueLabel.setFont(AttributeView.FONT_PLAIN); ! /*if (attribute.getClassification().getId().equalsIgnoreCase("-1")) { valueLabel = new JLabel(value.getName()); } else { --- 194,201 ---- */ private JComponent createValueLabel(Structure value) { ! JLabel valueLabel = null; ! if (value != null) { ! valueLabel = new JLabel(value.getName()); ! /*if (attribute.getClassification().getId().equalsIgnoreCase("-1")) { valueLabel = new JLabel(value.getName()); } else { *************** *** 208,212 **** } }*/ ! return valueLabel; } --- 209,218 ---- } }*/ ! ! } else { ! valueLabel = new JLabel("None"); ! } ! valueLabel.setFont(AttributeView.FONT_PLAIN); ! return valueLabel; } *************** *** 278,282 **** if (e.getSource() instanceof MyMenuItem) { MyMenuItem source = (MyMenuItem)(e.getSource()); ! attribute.setThe2ndValue(source.getClassification()); component.remove(0); component.add(createValueLabel((Structure)attribute.getThe2ndValue())); --- 284,288 ---- if (e.getSource() instanceof MyMenuItem) { MyMenuItem source = (MyMenuItem)(e.getSource()); ! attribute.setValue(source.getClassification()); component.remove(0); component.add(createValueLabel((Structure)attribute.getThe2ndValue())); *************** *** 337,341 **** } if (entered != null) { ! attribute.setThe2ndValue(entered); } /*else { Classification newclas, egne; --- 343,347 ---- } if (entered != null) { ! attribute.setValue(entered); } /*else { Classification newclas, egne; *************** *** 358,362 **** editor.removeKeyListener(this); editor = null; ! component.add(createValueLabel((Structure) attribute.getThe2ndValue())); component.revalidate(); valueChanged(); --- 364,368 ---- editor.removeKeyListener(this); editor = null; ! component.add(createValueLabel((Structure) attribute.getValue())); component.revalidate(); valueChanged(); |