From 254ee6f47eebfc00462c10756a92066e82cc1a96 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Tue, 21 Jun 2011 15:46:02 +0200 Subject: Initial commit --- .../collection/gui/view/PropertyPanel.java | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 source/com/c2kernel/collection/gui/view/PropertyPanel.java (limited to 'source/com/c2kernel/collection/gui/view/PropertyPanel.java') diff --git a/source/com/c2kernel/collection/gui/view/PropertyPanel.java b/source/com/c2kernel/collection/gui/view/PropertyPanel.java new file mode 100755 index 0000000..903ddf9 --- /dev/null +++ b/source/com/c2kernel/collection/gui/view/PropertyPanel.java @@ -0,0 +1,36 @@ +package com.c2kernel.collection.gui.view; + +import com.c2kernel.collection.AggregationMember; +import com.c2kernel.collection.Collection; +import com.c2kernel.collection.CollectionMember; +import com.c2kernel.common.ObjectNotFoundException; +import com.c2kernel.graph.model.Vertex; +import com.c2kernel.graph.view.VertexPropertyPanel; + +public class PropertyPanel extends VertexPropertyPanel { + + Collection mCollection; + + public PropertyPanel() { + super(); + } + + public void setCollection(Collection collection) { + mCollection = collection; + } + + public void setVertex(Vertex vert) { + try { + CollectionMember newMember = mCollection.getMember(vert.getID()); + if (newMember instanceof AggregationMember) { + super.setVertex((AggregationMember)newMember); + return; + } + else + clear(); + } catch (ObjectNotFoundException ex) { + clear(); + selObjClass.setText("No Collection Member object found"); + } + } +} -- cgit v1.2.3