[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/attrview AttributeView.java,1.4,1.5
Status: Pre-Alpha
Brought to you by:
henryml
From: Jesper P. <je...@us...> - 2005-09-15 08:47:54
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3102/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Added support for DESELECTED notifications Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AttributeView.java 11 Jul 2005 08:39:32 -0000 1.4 --- AttributeView.java 15 Sep 2005 08:47:45 -0000 1.5 *************** *** 37,43 **** private AttributesPanel ap; - /** Current object */ - private Object current; - /** * Constructor --- 37,40 ---- *************** *** 50,55 **** addTab("Attributes", ap); - current = null; - Notifier.getInstance().addListener(this); } --- 47,50 ---- *************** *** 68,109 **** FunctionalSpaceFacade fsf = FunctionalSpaceFacade.getInstance(); ! current = fsf.findById(n.getObject()); ap.display(current); - - repaint(); } else if (type.equals(Notification.CONSTRUCTION_SPACE_SELECTED)) { ConstructionSpaceFacade csf = ConstructionSpaceFacade.getInstance(); ! current = csf.findById(n.getObject()); ap.display(current); - - repaint(); } else if (type.equals(Notification.ELEMENT_SELECTED)) { ElementFacade ef = ElementFacade.getInstance(); ! current = ef.findById(n.getObject()); ap.display(current); - - repaint(); } else if (type.equals(Notification.PART_SELECTED)) { PartFacade pf = PartFacade.getInstance(); ! current = pf.findById(n.getObject()); ap.display(current); - - repaint(); } else if (type.equals(Notification.SURFACE_SELECTED)) { SurfaceFacade sf = SurfaceFacade.getInstance(); ! current = sf.findById(n.getObject()); ap.display(current); ! ! repaint(); } } --- 63,103 ---- FunctionalSpaceFacade fsf = FunctionalSpaceFacade.getInstance(); ! Object current = fsf.findById(n.getObject()); ap.display(current); } else if (type.equals(Notification.CONSTRUCTION_SPACE_SELECTED)) { ConstructionSpaceFacade csf = ConstructionSpaceFacade.getInstance(); ! Object current = csf.findById(n.getObject()); ap.display(current); } else if (type.equals(Notification.ELEMENT_SELECTED)) { ElementFacade ef = ElementFacade.getInstance(); ! Object current = ef.findById(n.getObject()); ap.display(current); } else if (type.equals(Notification.PART_SELECTED)) { PartFacade pf = PartFacade.getInstance(); ! Object current = pf.findById(n.getObject()); ap.display(current); } else if (type.equals(Notification.SURFACE_SELECTED)) { SurfaceFacade sf = SurfaceFacade.getInstance(); ! Object current = sf.findById(n.getObject()); ap.display(current); ! } else if (type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || ! type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED) || ! type.equals(Notification.ELEMENT_DESELECTED) || ! type.equals(Notification.PART_DESELECTED) || ! type.equals(Notification.SURFACE_DESELECTED)) { ! ! ap.display(null); } + + repaint(); } *************** *** 115,122 **** public boolean isNotificationEnabled(String type) { if (type.equals(Notification.FUNCTIONAL_SPACE_SELECTED) || type.equals(Notification.CONSTRUCTION_SPACE_SELECTED) || type.equals(Notification.ELEMENT_SELECTED) || type.equals(Notification.PART_SELECTED) || ! type.equals(Notification.SURFACE_SELECTED)) { return true; } --- 109,121 ---- public boolean isNotificationEnabled(String type) { if (type.equals(Notification.FUNCTIONAL_SPACE_SELECTED) || + type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || type.equals(Notification.CONSTRUCTION_SPACE_SELECTED) || + type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED) || type.equals(Notification.ELEMENT_SELECTED) || + type.equals(Notification.ELEMENT_DESELECTED) || type.equals(Notification.PART_SELECTED) || ! type.equals(Notification.PART_DESELECTED) || ! type.equals(Notification.SURFACE_SELECTED) || ! type.equals(Notification.SURFACE_DESELECTED)) { return true; } *************** *** 148,167 **** List components = new ArrayList(); ! Method[] methods = current.getClass().getMethods(); ! for (int i = 0; i < methods.length; i++) { ! Method m = methods[i]; ! String name = m.getName(); ! if (name.startsWith("get")) { ! if (!name.endsWith("Id") && !name.endsWith("Class")) { ! if (returnTypeSupported(m.getReturnType())) { ! try { ! components.add(new JLabel(m.invoke(current, (Object[])null).toString())); ! if (name.length() > 4) { ! names.add(new JLabel(name.substring(3, 4).toUpperCase() + name.substring(4))); ! } else { ! names.add(new JLabel(name.substring(3, 4).toUpperCase())); } - } catch (Exception e) { - // Cant be accessed } } --- 147,168 ---- List components = new ArrayList(); ! if (current != null) { ! Method[] methods = current.getClass().getMethods(); ! for (int i = 0; i < methods.length; i++) { ! Method m = methods[i]; ! String name = m.getName(); ! if (name.startsWith("get")) { ! if (!name.endsWith("Id") && !name.endsWith("Class")) { ! if (returnTypeSupported(m.getReturnType())) { ! try { ! components.add(new JLabel(m.invoke(current, (Object[])null).toString())); ! if (name.length() > 4) { ! names.add(new JLabel(name.substring(3, 4).toUpperCase() + name.substring(4))); ! } else { ! names.add(new JLabel(name.substring(3, 4).toUpperCase())); ! } ! } catch (Exception e) { ! // Cant be accessed } } } |