Please help need advice with planned project!

Hi, im not sure if this is the correct forum to post this (there are so many!) just move it to the correct place if it isn抰.

I need some advice on the correct way of coding a feature that is essential to my dissertation project.

Basically the project is going to be a particle effect tool that works in a similar way to the particle flow tool works in 3DSMax if anyone has used it, if not here is a screeny:

http://www.artificial-studios.co.uk/DumpingGround/partview01.png

It allows you to visually represent your particle system by joining components together and linking them with connecting lines.

Now my questions is what would be the correct way to implement this in java? I am currently using a series of JSplitPanel's to split the main frame up then using a JPanel for the main area and other JPanels for the individual elements that you can move around and link up, here is a screeny:

http://www.artificial-studios.co.uk/DumpingGround/partview02.png

My problem is that when i add a new element via a right click menu I have to call revalidate on the main panel, this causes all the elements to return to their default position. The same thing happens whenever you move one of the JSplitPanes as it called revalidate.

So im wondering if im doing this the correct way, i see that there are many other kinds of panels provided with SWING and wondering if any of the others are perhaps more suited to my requirements?

I know that its definitely possible as Poseidon UML was coded entirely in Java and it has many of the features i am looking for:

http://www.artificial-studios.co.uk/DumpingGround/partview03.png

As this will be my first large GUI application i wasn抰 sure where to turn so if anyone can me any advice whatsoever it would be greatly appreciated. Also if anyone can point me to any books or reading material concerning professional GUI design so that i may be able to code applications that look as professional as Poseidon or Netbeans it would be greatly appreciated.

Thanks,

Mike

[2087 byte] By [mike.canna] at [2007-10-3 3:38:14]
# 1

Do you know about Data Access Object(dao)?

Assume you want to add hydrogen molecule to a panel, you create a new object with the class(class Molecule) representing a new molecule( H2, O2 or H2O).

You can also create a dao for this object of Molecule

class MoleculeProperty

{

private int xLocation, int yLocation, ZLocation;

public void setYLocation(int tempYLocation)

{

yLocation = tempYLocation;

}

public int getYLocation()

{

return yLocation;

}

public int getZLocation()

{

return zLocation;

}

public void setZLocation(int tempZLocation)

{

zLocation = tempZLocation;

}

public void setJustUpdated(boolean tempInput)

{

justUpdated = tempInput;

}

public boolean getJustUpdated()

{

return justUpdated;

}

}

Either within your method paintComponent(Graphics g) or your panel for drawing molecules or method paint(Graphics g), it reads MoleculeProperty of Molecule and it can draw it in proper location.

After you have created a new Molecule, dao.setJustUpdated(true) . At the last line of method paintComponent(Graphics g) or paint(Graphics g), dao.setJustUpdated(false);

evilknighthka at 2007-7-14 21:33:30 > top of Java-index,Desktop,Core GUI APIs...
# 2

The class could be like this

class MoleculeProperty

{

private int xLocation, int yLocation, ZLocation;

private boolean justUpdated = false;

public void setYLocation(int tempYLocation)

{

yLocation = tempYLocation;

}

public int getYLocation()

{

return yLocation;

}

public int getZLocation()

{

return zLocation;

}

public void setZLocation(int tempZLocation)

{

zLocation = tempZLocation;

}

public void setJustUpdated(boolean tempInput)

{

justUpdated = tempInput;

}

public boolean getJustUpdated()

{

return justUpdated;

}

}

evilknighthka at 2007-7-14 21:33:30 > top of Java-index,Desktop,Core GUI APIs...
# 3

Hi, evilknighthk

Thanks for the reply mate. I think what you are trying to say is that i need to re-think the structure of my application so that whenever a revalidate occus i need to manually force the elments into positions that are stored by a DAO.

Can anyone reccomend any good books on this subject?

Mike

mike.canna at 2007-7-14 21:33:30 > top of Java-index,Desktop,Core GUI APIs...