[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/attrview AttributeView.java, 1.36, 1.37
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-08-28 05:54:13
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31897/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java LinkAttribute.java Log Message: Changed selection to only contain "geometric" objects Index: LinkAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/LinkAttribute.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LinkAttribute.java 23 Aug 2006 13:43:12 -0000 1.11 --- LinkAttribute.java 28 Aug 2006 05:54:04 -0000 1.12 *************** *** 34,37 **** --- 34,38 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; *************** *** 302,306 **** */ public void mouseClicked(MouseEvent event) { ! Selection.primary().set(attribute().getValue()); } --- 303,312 ---- */ public void mouseClicked(MouseEvent event) { ! Object object = attribute().getValue(); ! if (object instanceof Geometric) { ! Selection.primary().set(object); ! } else { ! AttributeView.instance().display(object); ! } } Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** AttributeView.java 18 Aug 2006 11:25:01 -0000 1.36 --- AttributeView.java 28 Aug 2006 05:54:04 -0000 1.37 *************** *** 27,30 **** --- 27,33 ---- /** The logger */ private static Logger log = Logger.getLogger(AttributeView.class); + + /** The instance */ + private static AttributeView instance; /** The font used in plain */ *************** *** 53,56 **** --- 56,89 ---- /** + * + * @return Instance of AttributeView + */ + public static AttributeView instance() { + if (instance == null) { + instance = new AttributeView(); + } + return instance; + } + + /** + * + * @param object Object + */ + public void display(Object object) { + this.removeAll(); + if (object != null) { + if (object instanceof Parametric) { + this.add(BorderLayout.NORTH, new GenericPanel((Parametric)object)); + } else { + AttributePanel ap = new AttributePanel(); + ap.display(object); + this.add(BorderLayout.CENTER, ap); + } + } + revalidate(); + repaint(); + } + + /** * @param object The changed object */ *************** *** 59,74 **** Selection selection = Selection.primary(); if (object == selection) { ! this.removeAll(); if (selection.size() == 1) { ! Object o = selection.iterator().next(); ! ! if (o instanceof Parametric) { ! this.add(BorderLayout.NORTH, new GenericPanel((Parametric)o)); ! } else { ! AttributePanel ap = new AttributePanel(); ! ap.display(o); ! this.add(BorderLayout.CENTER, ap); ! } } } else { if (this.getComponents().length > 0) { --- 92,100 ---- Selection selection = Selection.primary(); if (object == selection) { ! Object o = null; if (selection.size() == 1) { ! o = selection.iterator().next(); } + display(o); } else { if (this.getComponents().length > 0) { *************** *** 88,94 **** } } } - revalidate(); - repaint(); } } --- 114,120 ---- } } + revalidate(); + repaint(); } } } |