From 3e2bb0e11dec0c3abc2cf267a4f3842dd3b7f69b Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Sat, 9 Jan 2010 18:14:10 +0000 Subject: [PATCH] Relation selection dialog --- net/systemeD/halcyon/connection/Relation.as | 15 ++++++ .../potlatch2/RelationSelectPanel.mxml | 54 +++++++++++++++++++ net/systemeD/potlatch2/TagViewer.mxml | 15 +----- 3 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 net/systemeD/potlatch2/RelationSelectPanel.mxml diff --git a/net/systemeD/halcyon/connection/Relation.as b/net/systemeD/halcyon/connection/Relation.as index 22474adb..784d6f73 100644 --- a/net/systemeD/halcyon/connection/Relation.as +++ b/net/systemeD/halcyon/connection/Relation.as @@ -55,6 +55,21 @@ package net.systemeD.halcyon.connection { removed[0].entity.removeParent(this); } + public function getDescription():String { + var desc:String = ""; + var relTags:Object = getTagsHash(); + if ( relTags["type"] ) { + desc = relTags["type"]; + if ( relTags[desc] ) + desc += " " + relTags[desc]; + } + if ( relTags["ref"] ) + desc += " " + relTags["ref"]; + if ( relTags["name"] ) + desc += " " + relTags["name"]; + return desc; + } + public override function getType():String { return 'relation'; } diff --git a/net/systemeD/potlatch2/RelationSelectPanel.mxml b/net/systemeD/potlatch2/RelationSelectPanel.mxml new file mode 100644 index 00000000..5b2a8bd8 --- /dev/null +++ b/net/systemeD/potlatch2/RelationSelectPanel.mxml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/net/systemeD/potlatch2/TagViewer.mxml b/net/systemeD/potlatch2/TagViewer.mxml index d47478cb..449c05f2 100644 --- a/net/systemeD/potlatch2/TagViewer.mxml +++ b/net/systemeD/potlatch2/TagViewer.mxml @@ -214,19 +214,7 @@ props["id"] = rel.id; var memberIndex:uint = rel.findEntityMemberIndex(entity); props["role"] = rel.getMember(memberIndex).role; - - var desc:String = ""; - var relTags:Object = rel.getTagsHash(); - if ( relTags["type"] ) { - desc = relTags["type"]; - if ( relTags[desc] ) - desc += " " + relTags[desc]; - } - if ( relTags["ref"] ) - desc += " " + relTags["ref"]; - if ( relTags["name"] ) - desc += " " + relTags["name"]; - props["description"] = desc; + props["description"] = rel.getDescription(); relations.push(props); } @@ -292,6 +280,7 @@ } public function addToRelation():void { + new RelationSelectPanel().init(selectedEntity); } public function removeFromRelation():void { -- 2.30.0