![]() |
|
|||||||
| Registrieren | Benutzerliste | Interessengemeinschaften | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren | ||
| Java Link Base | Wiki | NoPaste | Chat | Boardregeln | F.A.Q. |
| DockingFrames DockingFrames An extension of Swing, used to flexibly arrange windows. - Ist eine Erweiterung von Swing, mit der flexibel Panels angeordnet werden können. |
![]() |
|
|
Themen-Optionen | Thema durchsuchen |
|
|
#1 |
|
Registriert seit: 07.05.2010
Beiträge: 32
|
Hi!
I am facing problems with the following grid layout: Java Code:
Something like this works fine: Java Code:
I know the first two numbers are the x- and y- coordinates, but how should I use the third and fourth numbers. I used to have them set to 1, 2 or 3, same as the weightx or weighty settings in a GridBagLayout. Is this correct? As they are doubles I would have suspected them to be so, but I entered e.g. 0.3 or 0.7 for two components in a column which destroyed the layout. Another thing I have not yet understood is how a list of dockables can be assigned to the same location, especially a list of single dockables. I get the sense of multiple dockables as they tab automatically, but singles? Thanks for your reply and best regards, grml Geändert von grml (10.06.2010 um 09:46 Uhr). Grund: additional info |
|
|
|
|
|
#2 |
|
Moderator
|
1. Comparing to a GridBagLayout, the 3. and 4. parameter would be gridwith and gridheight.
Imagine a sheet of paper on which you draw your layout. You draw a set of boxes (box = Dockable) preferrable such that they do not overlap and such that there are no empty spaces between them. Each box has a position and a size. The position is the 1. and 2. parameter ("x" and "y"), the size is the 3. and 4. parameter (hence they are called "width" and "height"). This sheet is the "grid", and magically the sheet is big enough that all your boxes always fit in. ![]() Afterwards someone has a close look to this sheet, finds out how to organize the Dockables, and "deploys" them (the grid has no use afterwards). 2. As for the "list of dockables": first of all, "add" has a vararg-argument. You can just call something like: Java Code:
3. The difference between single- and multiple-Dockables is how they are handled when the framework stores the layout (the position, size and relations between all elements). - Single-Dockable: just its identifier gets stored. The client is responsible for storing its content. Each single-Dockable has a unique identifier set by the client, no two dockables can share the same identifier. - Multiple-Dockable: the client has to provide a factory which is used to store the content of the Dockable. There can be many dockables for each factory, they are not unique. Apart from that, single- and multiple-Dockables are handled exactly the same way everywhere (unless the client application treats the differently). It has nothing todo with tabs. Btw.: if I run your settings the Dockables clearly appear. The framework might not always guess correctly how to fill empty spaces and resolve overlappings, but no component gets hidden or forgotten. Java Code:
__________________
|
|
|
|
|
|
#3 |
|
Registriert seit: 07.05.2010
Beiträge: 32
|
Thanks Beni!
Do I understand the last two parameters correctly when I say that when e.g. width = 1 and height = 2 that the dockable spans over two rows or does it mean that the dockable is twice as high as wide? This is important for me as I use the coded layout as default layout which is called by a "restore layout" button. It does then not read from the written data-files but from this layout. Therefore, I would like to be as flexible as possible to "initialize" the layout via code. Or are there easier solutions for that? Thanks and best regards, grml |
|
|
|
|
|
#4 |
|
Moderator
|
The rows/column analogy is correct. And something like "width = 1.5" would mean 1 + a half row.
For your button that is certainly a valid solution. (Personally I prefer to store the "default layouts" in a file that never gets overridden, because then I can drag & drop my layout one time and don't have to think about how to build it in code.)
__________________
|
|
|
|
|
|
#5 |
|
Registriert seit: 07.05.2010
Beiträge: 32
|
OK. Thank you
That would mean anybody would have the possibility to delete the default layout files (when sHe finds them in the directories) which could cause an error when restoring that. I bypass that by trying to model the layout within the code. Thanks for your input. BTW: I have never mentioned how great your framework is. Congratulations and thanks for that and your superb support! grml |
|
|
|
![]() |
| Lesezeichen |
| Stichworte |
| grid width height |
| Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1) | |
| Themen-Optionen | Thema durchsuchen |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Problems when updating title of dockable | MMM | DockingFrames | 5 | 27.04.2010 09:01 |
| Problems with v1.0.8p3a and v1.0.7 | ThomasHilbert | DockingFrames | 5 | 17.03.2010 20:16 |
| Link problems on Windows 7 | Unregistered | JCuda | 4 | 14.03.2010 22:36 |
| Getting grid co-ordinates of a dockable just before it closes | parag | DockingFrames | 1 | 18.09.2009 07:13 |
| [Erledigt] Grid und BorderLayout kombinieren | swerflash | Java Standard Edition (J2SE) | 7 | 21.12.2006 16:59 |