| Author |
Message |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-03 09:02:55
|
castorp
Joined: 2008-03-06 13:38:06
Messages: 129
Offline
|
Jonathan wrote:
castorp wrote:
Jonathan wrote:If you paste a multi-line string into the playpen, the Architect will create one table per line of text. Then if you paste a multi-line string into a table, the Architect will create one column in that table per line of text. This is probably the easiest way to achieve what you want to do.
How do I do that?
The paste item is always disabled for me.
I assume you're using the latest Architect code from svn  , but which OS and JRE version are you using? In all our testing, the new copy&paste features have "just worked."
I'm actually using hudson builds
In this case I tried with 0.9.13-20090619191212, WindowsXP and JDK 1.6.0_14-b08
I tried it again with 0.9.13-20090702225402.
Pasting using the shortcut works, but only if there is no empty line in the clipboard (i.e. if there is no newline after the last table name). That might have been the case when I tried it the first time.
But the menu item is still grayed out.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-03 10:10:19
|
Thomas
Joined: 2008-12-08 10:14:11
Messages: 165
Offline
|
Hi Castorp,
Eason also had a problem with copy and paste under the post http://www.sqlpower.ca/forum/posts/list/2403.page. I tried to answer his and your question there as well as explain how copy and paste works in Architect. If you have any thoughts on how to make copy and paste better feel free to follow up there.
Thomas
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-06 21:12:38
|
JAyliffe
Joined: 2009-06-23 11:17:10
Messages: 13
Offline
|
Jonathan wrote:
It might be a bit late for you, but I've created the promised example program. Find it here:
-Jonathan
It's never too late Actually your post is timely, I have most of the code creating the database objects in place, your example helped finalise the setup part so I should be able to get it working properly now! Thanks again for your help
Justin
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-14 12:07:26
|
JAyliffe
Joined: 2009-06-23 11:17:10
Messages: 13
Offline
|
I just got back from another assignment so now I am looking to complete my program. Oe question remains, the ArchitectSwingSessionContextImpl constructor is not public in the code I downloaded. Eclipse is complaining about that. Should I just make it public or do you have an alternative recommendation?
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-14 14:01:36
|
Jonathan
SQL Power Developer
Joined: 2007-01-08 15:10:32
Messages: 873
Offline
|
I ran into that problem when writing up the example code, so I made the constructor public. If you got your copy of the Architect code from the subversion server, just do an update and you'll be good to go.
-Jonathan
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-15 17:41:32
|
JAyliffe
Joined: 2009-06-23 11:17:10
Messages: 13
Offline
|
That worked for me! I am now playing with the layout classes, I can get the basic tree layout or the line straightener layout to run before I save but I can't find the one that is generating the fancy layout that I get in the case that I load my file to PowerArchitect and press the Automatic Layout button. Which of the layout implementation classes are you using there? my code is
ArchitectLayout layout = new BasicTreeAutoLayout();
layout.setup(pp.getTablePanes(), pp.getRelationships(), pp.getBounds());
while (!layout.isDone()) {
layout.nextFrame();
}
thanks
Justin
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-15 17:55:18
|
Jonathan
SQL Power Developer
Joined: 2007-01-08 15:10:32
Messages: 873
Offline
|
Hey wow, you are getting fancy.
The class you're looking for is FruchtermanReingoldForceLayout. We could have just called it SpringForceLayout, but it was actually based on an academic paper and we thought the authors' names were cool.
I believe the example code you gave should drive the force layout correctly. If it doesn't, check out the AutoLayoutAction class. It has a "disturbing piece of code" that appears to exclude tables that lack FK relations from the layout before letting the springs go "boing." It lines up those non-connected tables along the bottom of the layout area. If you let them participate in the spring layout, they will probably get mushed into the four corners of the layout's bounds.
You could probably reuse the AutoLayoutAction class by concocting a bogus ActionEvent and calling its actionPerformed() method. If we were thinking ahead, we could have put a public method on AutoLayoutAction that does everything and doesn't need an ActionEvent. actionPerformed() could then call that, and you could too without jumping through hoops.
-Jonathan
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-16 10:22:38
|
JAyliffe
Joined: 2009-06-23 11:17:10
Messages: 13
Offline
|
I thought it had to be the FruchtermanReingoldForceLayout! Thanks for the pointers on the AutoLayoutAction class, I think that's where i am getting the trouble. I just want to minimize the 'manual' effort for the non-technical consumers of the diagrams. Now I am wondering how hard it would be for me to output it to pdf whilst I am at it!
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-07-17 09:40:11
|
JAyliffe
Joined: 2009-06-23 11:17:10
Messages: 13
Offline
|
Well I m definitely missing something with the layout class. Right now, I am laying my diagrams out, primary/foreign keys only displayed in a grid, approximately N by N where N is the integer closest to the square root of the number of tables. Not as pretty as Fruchrerman and Reingold but then I'm not a math major . Here's my full routine, if I put the layout class on the end and let it run, it never returns. If I don't call the layout class and load the diagram, it takes a couple of minutes to redraw. Obviously I am missing something but I don't see what!
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-08-06 11:22:35
|
Jonathan
SQL Power Developer
Joined: 2007-01-08 15:10:32
Messages: 873
Offline
|
Hmm, do you mean it takes a long time to draw the playpen when you load your .architect file into the Architect's GUI? But this problem doesn't happen if you perform the Fruchterman-Reingold layout? That does sound suspicious.
-Jonathan
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2009-08-06 11:28:48
|
JAyliffe
Joined: 2009-06-23 11:17:10
Messages: 13
Offline
|
Actually the 'slowdown' occurs if I attempt to use the Fruchterman-Reingold layout class from within my code whilst I am building the architect model through the API. I have a model with about 80 tables in it that never reaches the point of layout.isDone()!! If I leave that model in another layout and load into the architect GUI, it takes less than five minutes to complete.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2011-02-16 16:13:47
|
JRAyliffe
Joined: 2011-02-14 11:29:00
Messages: 2
Offline
|
We are upgrading our application to use the newest version of the API and for the most part everything is working. However, in the code creating the column lists for the PK Index, I would set three properties on the column class, the last one being the primary key sequence using the following call
aColumn.setPrimaryKeySeq(someInteger);
The method is no longer available on the Column class and in spite of digging through the various associated classes, I am not able to find it yet. Leaving the value unset results in the PK section of the table being rendered empty when I load my generated architect file. When I move some of the columns into the PK section, all that changes on their attributes is the PrimaryKeySeq. Can someone help me understand how the application is doing this and where in the API I can achieve the equivalent result. Thanks
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 2011-02-16 17:41:12
|
JRAyliffe
Joined: 2011-02-14 11:29:00
Messages: 2
Offline
|
OK, a little more study got me there! SQLTable method addToPK (you really shouldn't use such obvious names apparently) Looks like I fixed my original error (of going in at the wrong point) into the bargain.
This message was edited 1 time. Last update was at 2011-02-16 17:42:09
|
|
|
 |
|
|