Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) NodeListView (Read 8060 times)
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
NodeListView
Sep 9th, 2015 at 8:40am
Print Post  
Hi,
I have a problem with samples number 2, Controls, I use the NodeListView with rectangle, decision and ellipse but I want to change the names that appear in the toolbar on the screen, I want to give them other names, how can I do?
I use this code:
final String shapes[] =
                {
                        "Rectangle", "Ellipse", "Decision", "Arrow1"
                };


       List<DiagramNode> nodes = new ArrayList<DiagramNode>();

        for (String shape : shapes)
        {
            final ShapeNode p = new ShapeNode(diagram);
            p.setShape(Shape.fromId(shape));
            Pen pen = new Pen();
            pen.setColor(Color.RED);
            p.setPen(pen);
            p.resizeToFitText(FitSize.KeepRatio);
            //p.setText("entity");

            //diagram.setLinkText("Relation");
            nodes.add(p);


        }

        nodeListView.addNodes(nodes, shapes);
        diagramView = (DiagramView)findViewById(R.id.diag_view);
        nodeListView.setDiagramView(diagramView);
        diagramView.setBehavior(Behavior.DrawLinks);

If I change names here: final String shapes[] =
                {
                        "Rectangle", "Ellipse", "Decision", "Arrow1"
                };
then it doesn't find the shapes.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView
Reply #1 - Sep 9th, 2015 at 10:05am
Print Post  
Hi,

Define a separate array for names and pass it to addNodes:

Code
Select All
final String labels[] =
{
    "entity", "relation", "something", "anything"
};
nodeListView.addNodes(nodes, labels); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: NodeListView
Reply #2 - Sep 9th, 2015 at 10:16am
Print Post  
Thank you very much  Smiley
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: NodeListView
Reply #3 - Sep 14th, 2015 at 4:25pm
Print Post  
Hi, is there a way to put the NodeListView in horizontal instead of keeping it vertical?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView
Reply #4 - Sep 15th, 2015 at 5:54am
Print Post  
Hi,

Unfortunately there's no way as the base ListView class does not support horizontal orientation.

Stoyan
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: NodeListView
Reply #5 - Sep 15th, 2015 at 3:16pm
Print Post  
Ok, thank you anyway Smiley
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: NodeListView
Reply #6 - Sep 24th, 2015 at 9:39am
Print Post  
Hi, I have a problem, I use this layout:
<RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">

        <com.mindfusion.diagramming.DiagramView
            android:id="@+id/diag_view"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            tools:context=".MainActivity" />

        <com.mindfusion.diagramming.NodeListView
            android:id="@+id/node_list_view"
            android:layout_width="85dp"
            android:layout_height="350dp"
            android:layout_alignParentTop="true"
            android:visibility="visible"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true">
        </com.mindfusion.diagramming.NodeListView>
</RelativeLayout>

but I want to be able to draw even under the NodeListView, while if I add some shapes right under the NodeListView, it doesn't work. How can I solve this problem?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView
Reply #7 - Sep 24th, 2015 at 12:26pm
Print Post  
This build should let you drag there:
https://www.mindfusion.eu/_temp/DroidDiagram.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: NodeListView
Reply #8 - Sep 24th, 2015 at 12:52pm
Print Post  
Ok, thank you very much, but how can I add it to my android studio projects? Should I replace the old one with this or should I keep both versions?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView
Reply #9 - Sep 24th, 2015 at 1:53pm
Print Post  
Replace the old jar file with new one.
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: NodeListView
Reply #10 - Sep 24th, 2015 at 1:55pm
Print Post  
Ok, thank you very much Smiley
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: NodeListView
Reply #11 - Sep 25th, 2015 at 9:38am
Print Post  
Hi,
I imported the .jar you gave me yesterday and it works but before I had a trial version of the library with the jar you gave me is it a problem? I mean is this new jar a trial version or will it expire after some time?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView
Reply #12 - Sep 25th, 2015 at 10:37am
Print Post  
Hi,

There is no separate trial jar; it will show trial label after some number of objects if you haven't set license key string.

Stoyan
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: NodeListView
Reply #13 - Sep 25th, 2015 at 11:16am
Print Post  
Ok, thank you very much  Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint