if (isPartOf(c, cmpsWithStartSide)) {
cfg.getPanel().add(c, new Integer(1));
startTiles.put(c, cfg.getTile(c).clone());
} else {
cmpsToAddAfterTransition.add(c);
Tile t = cfg.getTile(c);
c.setBounds(t.x, t.y, t.w, t.h);
c.validate();
}
}
// If old components have an end side, their target location will be
// computed later, and they will be removed at the end of the
//transition. Else, they are directly removed from the panel.
for (Component c : oldCmps) {
if (isPartOf(c, cmpsWithEndSide)) {
cmpsToRemoveAfterTransition.add(c);
targetTiles.put(c, prevKf.cfg.getTile(c).clone());
} else {
cfg.getPanel().remove(c);
}
}
// Start/target locations are computed for new/old components
// that have a start/end side set.
for (SLSide s : SLSide.values()) {
hideTiles(getTiles(cmpsWithStartSide.get(s), startTiles), s);
hideTiles(getTiles(cmpsWithEndSide.get(s), targetTiles), s);
}
// New components with a start side are then placed at the location
// computed above.
for (Component c : startTiles.keySet()) {
Tile t = startTiles.get(c);
c.setBounds(t.x, t.y, t.w, t.h);
c.validate();
}
}