`
176170847
  • 浏览: 95995 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

springgraph自定义连线

    博客分类:
  • Flex
阅读更多
http://www.flexdeveloper.eu/forums/mxml/how-to-have-custom-edgerenderer-for-springgraph-roamer/


Welcome, Guest. Please login or register.
Did you miss your activation email?
07 Jun 2010, 13:21:22 UTC
 

Follow us on Twitter      

   flexdeveloper.eu Forum
  Flex and ActionScript 3.0
  Flex 3 Framework (Moderators: JMWhittaker, Jan K, thewarpedcoder, James)
  How to have custom EdgeRenderer for springgraph.Roamer « previous next »
Pages: [1]
Author Topic: How to have custom EdgeRenderer for springgraph.Roamer (Read 1451 times)
bjg
Newbie FD

Posts: 25



How to have custom EdgeRenderer for springgraph.Roamer
« on: 08 Aug 2008, 05:06:59 UTC »
Hello All,

I am currently using com.adobe.flex.extras.controls.springgraph.Roamer class to display a spring graph. I am using an ItemRenderer (thats actually an mxml file) to render each Item (node) in the Roamer.

Now, I want to have names beside each of the edges and also arrows showing direction of the edges.

I tried with implementing the IEdgeRenderer interface to create an ActionScript class "MyEdgeRenderer", wrote the draw() method in it. Then I asigned the edgeRenderer property of Roamer with this class name.

Code:
<fc:Roamer id="roamer" backgroundColor="#ffffff"
lineColor="#333388" width="100%" x="0" height="100%" y="0"
itemRenderer="com.mypackage.renderers.MyItemView"
edgeRenderer="com.mypackage.renderers.MyEdgeRenderer"
autoFit="true"/>

But it gives a compile time error
Code:
Initializer for 'edgeRenderer': values of type com.adobe.flex.extras.controls.springgraph.IEdgeRenderer cannot be represented in text.

I tried to assign the MyEdgeRenderer to edgeRenderer property dynamically.
Code:
roamer.edgeRenderer = (IEdgeRenderer)(MyEdgeRenderer);

Then it throws a error during execution of the above code
Code:
TypeError: Error #1034: Type Coercion failed: cannot convert com.mypackage.renderers.::MyEdgeRenderer$ to com.adobe.flex.extras.controls.springgraph.IEdgeRenderer.

I am in urgent need of some help. Would greatly appreciate any input(s).

Thanks
bjg




Logged
thanks
BJG

"The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed." - Albert Einstein


flexy
flexdeveloper.eu
Guru/Addict FD

Posts: 3,099


Recovering Coffee Addict & Adobe Expert




Re: How to have custom EdgeRenderer for springgraph.Roamer
« Reply #1 on: 09 Aug 2008, 09:58:46 UTC »
Does your EdgeRenderer implement IEdgeRenderer? It needs to be typed to this interface, or it's not going to work.
Logged
I'm a diver and a Flash Platform consultant!
You can follow me on Twitter if you like! - I find questions about Trees boring.
bjg
Newbie FD

Posts: 25



Re: How to have custom EdgeRenderer for springgraph.Roamer
« Reply #2 on: 11 Aug 2008, 06:29:26 UTC »
Hi,

I was getting wrong in assigning the the MyEdgeRenderer to edgeRenderer property dynamically.
I do it now like this... and it worked..
Code:
roamer.edgeRenderer = (IEdgeRenderer)(new myEdgeRenderer());

But, I am still unable to have Labels to edges (though I could draw the edges myself).
I am also able to draw the arrows, but they donot point to correct "to" as the fromView and toView parameters of the implemented draw() method of the IEdgeRenderer interface donot refer to the correct "from" and "to". This is perhaps because the Graph object (that acts as dataProvider for the Roamer) does not treat its edges as directional!

Any solution to these problems? I'm getting restless...

Regards
bjg
        
Logged
thanks
BJG

"The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed." - Albert Einstein


Pages: [1]
« previous next »
Share this on:  Twitter  del.icio.us  Digg
Jump to:   
©2006-2010 Flexdeveloper.eu/Jodie O'Rourke. All rights reserved.
Adobe®, Adobe® Flash™, Adobe® AIR™ and Adobe® Flex™ are registered trademarks of Adobe Systems Incorporated in the United States and other countries. All rights reserved.

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
分享到:
评论

相关推荐

    一个SpringGraph的demo

    自己研究的可以运行的springgraph例子,可以在edge上添加自己的组件和文字

    springgraph.zip

    一个n的flex组件(SpringGraph Flex Component) SpringGraph Flex Component 有几个demo,不多做解释,用了就知道强大了,关于如何使用,以后在慢慢写了。 &lt;A href="http://mark-shepherd.com/thesaurus"&gt;...

    SpringGraph实例

    总结来说,SpringGraph实例展示了如何使用该工具来构建和展示数据关系图,通过自定义节点和边、调整布局以及添加交互功能,我们可以创建出既美观又实用的图形化模型。这个过程涉及到了项目结构理解、源代码编写、...

    springgraph例子

    例子可能展示了如何创建和自定义这些组件,以及如何将它们可视化在Flex界面上。 4. **数据绑定**:Flex与SpringGraph之间的数据同步是通过数据绑定完成的。这包括将服务器端的图模型数据映射到客户端的视图组件上,...

    springgraph 带API

    你可以自定义节点的外观,添加图标、文本标签等。 - **边(Edges)**: 边用于表示节点间的连接关系,可以设置线型、粗细、颜色等属性,甚至可以添加箭头表示方向。 - **布局(Layout)**: SpringGraph 提供了几种...

    springGraph拓扑组件api

    **SpringGraph拓扑组件API详解** SpringGraph是一个用于构建和操作复杂拓扑结构的Java库,它在Spring框架的基础上提供了一套强大的API,使得开发者能够方便地处理节点、边和图的各种操作。在这个主题中,我们将深入...

    根据SpringGraph改的简易节点连接器

    5. **自定义性**:用户能否自定义节点样式、边的形状和颜色,以及整体布局风格。 总的来说,这个简易节点连接器是一个将SpringGraph的复杂功能进行简化和定制后的产品,结合了Flex的强大UI设计能力,旨在提供一种...

    重写SpringGraph的带标签的IEdgeRenderer

    对SpringGraph组件中的IEdgeRenderer接口进行重写,可以在edge上添加汉字说明做为标签

    springGraph API

    springGrap用于拓扑与流程图的绘制。

    Flex Spring Graph

    3. **自定义节点和边**:为了满足不同的需求,开发人员可能需要自定义节点的外观和行为,以及边的样式。Flex Spring Graph 可能提供丰富的API和接口,允许开发者根据项目需求定制节点和边的样式及行为。 4. **性能...

    SrpingGranph 动态生成 拓扑图

    SrpingGranph 动态生成 拓扑图 非常酷的flex拓扑关系组件springgraph。-Topological relationships are very cool flex component springgraph.

    flex图形组件

    在Flex项目中,通过集成SpringGraph库,开发者可以创建自定义的图形界面,实现更灵活的数据可视化。 1. 引入SpringGraph:在Flex项目中,首先需要将SpringGraph库引入,可以通过MXML或ActionScript代码添加库引用。...

    Flex拓扑图精品文档

    - **自定义组件**:开发者可以使用自定义组件来扩展`itemRenderer`的功能。需要注意的是,对于`edgeRenderer`,所使用的组件必须继承自`IEdgeRenderer`接口。 #### 三、Birdeye(RaVis)的特点及应用场景 - **简介...

    flex的组织结构图组件

    2. 自定义节点:通过继承TreeNode或TreeItemRenderer类,你可以自定义节点的外观和行为,比如添加图标、改变文字颜色等。 3. 事件处理:Tree组件会触发多种事件,如itemClick、itemOpen和itemClose,你可以监听这些...

    我的Flex学习之路

    同时,理解Flex的事件处理、数据绑定、行为和自定义组件机制,能形成对Flex的全面认知,具备实际项目开发能力。 进入提高阶段,可能会遇到Flex自带组件无法满足需求的情况。这时,可以查找开源组件或自行扩展。例如...

    一些不错的开源Flex项目.txt

    #### 四、SpringGraph Flex Component - **网址**:http://mark-shepherd.com/blog/springgraph-flex-component/ - **简介**:由Mark Shepherd开发的一款图形组件,主要用于展示节点之间的关系图。 - **特点**: -...

    专题资料(2021-2022年)Flex开源项目.docx

    3. **SpringGraph Flex Component**: 这是一个用于绘制拓扑关系图的组件,适用于需要显示复杂网络结构的应用。 4. **Flex Visual Graph Library**: 另一个用于显示拓扑图形的类库,以其动态效果而受到赞誉,提供了...

    Flex开源项目

    3. **SpringGraph Flex Component**: 这是一个用于绘制拓扑关系图的组件,非常适合展示复杂的网络或数据结构。 4. **Flex Visual Graph Library**: 类似于SpringGraph,它也专注于拓扑图形展示,动态效果出色。 5....

    Flex组建大全|Flash|Flex|ActionScript3.0

    24. **SpringGraph Flex Component**: 用于绘制弹簧网络图的Flex组件,适用于数据可视化。 25. **GoASAP**: AS3动画库,提供高效的动画控制和时间线管理。 26. **asaplibrary**: 另一个开源的AS3库,提供了更多...

Global site tag (gtag.js) - Google Analytics