Win a copy of Rust Web Development this week in the Other Languages forum!

Akhil Jain

Ranch Hand
+ Follow
since Oct 14, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Akhil Jain

I have this scenario, where i have three tables.

TABLE A has a_id (PK)
TABLE B has b_id (PK), c_id (FK), a_id (FK)
TABLE C has c_id (PK)

I am using JPA , now in Object terms, if i define the relationships, it is like







Now, if want to have class B as self referencing class, i.e If the Object of B will have an extra property of parentId, which refers to the different B object, then how to achieve that and code sample of how can i persist A object with all the relationships set to it directly by calling entityManager.saveobject(a);

example

A object contains collection of B objects which are say b1, b2, b3 and b2 and b3 object in that collection has parentId set as b1_id.
I want to save Object A such that all the records of B also gets saved normally without giving any transaction exception of transient object not being saved.

If anyone of you here can help me out in this, this will be really a great help.

regards
Akhil.
HI guys,
Need your help here,
I have created a structure using Java2D API and wanna apply the Rotation, Zooming and translation facility using Mouse.

The structure i have created is painted in steps. like i am drawing few points on the coordinate system , then joining them (lots of calculations for plotting it ...uffff). like connecting few points and creating some sort of strcuture. now i want to apply mouse listeners so that user can interactively rotate the complete structure.


Please help me with some example. which i can refer to...I read about Affine Transform but could able to achieve it on a complete structure... like i got an example from internet of doing transform using mouse on certain shapes....but mine is a shape comprising of many shapes...(basically...some points, some texts and some lines......forming a complete structure.)


regards
Akhil Jain
13 years ago
Hi Guys,

I am fairly new to Java3D and trying to create a program to visualize molecules. currently i am facing problem with rendering all sort of molecules with same size.

I have a file with information such as Atoms and bonds in molecule and which bond is in between which all atoms.

simple Molecule file looks like this.

-1.1562 -0.7537 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-1.8707 -0.3412 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.8707 0.4838 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.4418 0.4838 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.4418 -0.3412 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 5 1 0 0 0 0
2 3 2 0 0 0 0
3 4 1 0 0 0 0
4 5 2 0 0 0 0

where the first 5 lines denotes all the atoms. with information such as :
-1.1562 is the xCord where atoms is to be placed and -0.7537 is y-cord and 0.0000 is the z-cord respectively.

the second table blockl defines the bond between atoms like
1 2 1 refers to there is a single bond between atom 1 and 2 which are first and second atom lines in above table.

Problem: When i draw these atoms and bonds betwen them , i want to apply an algo, where all the x,y ,z cords gets shifted to a normal view and appears in a specific size.

if the cord of an aotm is simple enough say -1.0000 to +1.0000, it renders properly but if cords are like -13.0000 to 69.00000 it created problem and when i center the complete molecule, the image becomes very small.

any clues or suggestions:
The main Problem is to shift all the atom cordinates such that, the viewing of the molecule remains constant, and then user can zoom, rotate or translate.


regards
Akhil
13 years ago
Hi all,

I am faving a problem with deletng some entries from a table.
Example:
Suppose, there is a table named Parent and Child. Child contains the reference of Parent. But parent doesn't know anything about that child of his.

When any data is deleted from Parent Table, the child data which contains the foreing key as that parent_id should also be deleted.

How can i do that?

Pleasenote: that parent does have many-to-one relationship with child hypothetically, but that is not defined explicitly in mappings.
Only child contains the reference of parent.

now, can someone please tell me, how i can set cascade delete operation in the scenario mentioned above, so that when someone deletes a parent tablle entry with id 1, then all the entries in child table which has foreing key (parent id) as 1 will automatically gets deleted.


Thanks
Please make sure that you have the prefeered size and the minimum size of both the component in splitPane properly set.
Thats the one reason, why it could have had happening.
14 years ago
can i send my code to you in pvt.
since its too long to be pasted here.

that will give you a proper insight.
14 years ago
Yes, the message dialog gets shown. and after user clicks ok.

I am doing this.




can you help me out.



regards
Akhil

[ November 27, 2007: Message edited by: Akhil Jain ]
[ November 27, 2007: Message edited by: Akhil Jain ]
14 years ago
Hi Guys,

I am completly stucked with something.
scenario:

A JFrame has a splitpane. on left side of splitpane i am adding a JPanel which is a seperate class so i do something like splitPane.setLeftComponent(new EventTablePanel()); and similarly on the right side i do splitPane.setRightComponent(new EventObjectPanel());

EventTablePanel class is extending JPanel and has some small local panels and some panels which are seperate classes.

Now when an user encounters some problem with some backend operation, i show a message dialog. but at the same time, when user clicks on "OK" of the message dialog, i like to clear the content pane of the JFrame with everything in it except MENU BAR. so that user can again select files and whatever.

EventTablePanel has a reference of JFrame, which i pass when i call splitPane.setLeftComponent(new EventTablePanel(MyFrame.this));

when an exception is encountered. i do something like.


the contentPane of the JFrame is not removing any of its component.

can someone help me out on urgent basis regarding this.


regards
Akhil Jain
14 years ago
Hi Guys,

Can someone please tell me how to set focus on JMenu
i have a Jmenu Bar, in which i have some JMenu and they contain there respective JMenuItem.

I want to set the tab order basically to these Jmenus, so that, as for example, when user opens the File Menu and presees "Tab" on keyboard, he should be taken to the next Jmenu in row.

Can some one tell me how to do this?

regards
Akhil
14 years ago
i think, thats just the appearance...so i guess this is fine.

thanks for helping out in this.
14 years ago
Hi guys,

Can some please answer these questions.
1. If someone gives me a serialized object in a file. Can i show its complete understandable graph on console, something in Tree form (just static one)

2. Does it required to have those Object class or object related classes in the classpath of the Utility which is about to show its graph on console with actual saved values when retrieving those values using Reflection API.

3. Can some one point me to such an utility.

Urgent help required.

Regards,
Akhil
14 years ago
Hi guys,

I am really in a desperate need of getting this thing work.
I want to create a Jtree with object Details.
Something like, i can pass any object and that tree should be able to show all its details using java reflection.

can someone please help me out with this.
i have done some coding, but not bale to instantiate few objects inside an object and so on.

sample code is as follows, which can give you fair idea of what i am trying to do here. Need you support on this, otherwise i am gone.



Guys, pleae help me out with this...i want this code to handle any damn object it is passed on to create tree....no matter contructors are protected, private or anything, object passed can contain n-level objects in them and i should be able to show each one of them properly in tree form something like when you debug an object at runtime and in debug window you come to see all its properties, as well as properties of all the objects which it holds.

Object which will be supplied to create Jtree, is a serialized object, whcih is persisted in a file, so basically i have to read that object from a file and show its state graph with all the fields, their names, their values and so on.

regards
Akhil
14 years ago
hi cole,

Though your hack worked just fine for me as well, except one problem, that the "OK" button is getitng focus, and the cursor comes inside the JTextField of a JPanel (type of having focus).

Is there any way to remove that focus from "OK" button completely?

AND

When you say re-implement the showConfirmDialog, what does it mean exactly. Do you mean to say that i should write a class which will extend JDialog.

can you give an example, where in, i can use the same thing, which i am using right now, but with custom implmentation of JDialog.

Note: the JPanel which i am passing as a message to the showConfirmDialog is also a seperate class which extends JPanel.

I am calling this showConfirmDialog method of JOptionPane in my main frame.
[ November 20, 2007: Message edited by: Akhil Jain ]
14 years ago
Hi guys,

I am using a showConfirmDialog



to get user input, user input fields are in a JPanel, i am passing that JPanel as "message" argument, (as can be seen from the code above, 2nd argument in showConfirmDialog method).

But when this dialog is opened, the focus by default is on "OK" button of the Confirmation Dialog.

Can someone please tell me, how to set focus on my JTextField, in JPanel inside Confirmation Dialog.

Regards,
Akhil
14 years ago