public Object deserialize(Element element) {
String dockableId = element.getAttribute(PersistenceConstants.DOCKING_STATE_ATTRIBUTE_DOCKABLE_ID);
String relativeParentId = element.getAttribute(PersistenceConstants.DOCKING_STATE_ATTRIBUTE_RELATIVE_PARENT_ID);
String region = element.getAttribute(PersistenceConstants.DOCKING_STATE_ATTRIBUTE_REGION);
DockingState dockingState = new DockingState(dockableId);
if (relativeParentId != null && !relativeParentId.equals("")) {
dockingState.setRelativeParentId(relativeParentId);
}
dockingState.setRegion(region.toUpperCase());
String splitRatioString = element.getAttribute(PersistenceConstants.DOCKING_STATE_ATTRIBUTE_SPLIT_RATIO);
if (splitRatioString != null && !splitRatioString.equals("")) {
float splitRatio = Float.parseFloat(splitRatioString);
dockingState.setSplitRatio(splitRatio);
}
String dockingStateState = element.getAttribute(PersistenceConstants.DOCKING_STATE_ATTRIBUTE_STATE);
if (dockingStateState.equals(FLOATING_STATE)) {
String floatingGroupName = element.getAttribute(PersistenceConstants.DOCKING_STATE_ATTRIBUTE_FLOATING_GROUP_NAME);
if (floatingGroupName != null && !floatingGroupName.equals("")) {
dockingState.setFloatingGroup(floatingGroupName);
}
} else if (dockingStateState.equals(MINIMIZED_STATE)) {
String minimizeConstraint = element.getAttribute(PersistenceConstants.DOCKING_STATE_ATTRIBUTE_MINIMIZE_CONSTRAINT);
int minimizeConstraintInt = getRealMinimizeConstraint(minimizeConstraint);
dockingState.setMinimizedConstraint(minimizeConstraintInt);
}
ISerializer pointDeserializer = SerializerRegistry.getSerializer(Point.class);
NodeList pointNodeList = element.getElementsByTagName(PersistenceConstants.POINT_ELEMENT_NAME);
if (pointNodeList.getLength() > 0 && pointNodeList.item(0) instanceof Element) {
Element centerPointElement = (Element) pointNodeList.item(0);
Point centerPoint = (Point) pointDeserializer.deserialize(centerPointElement);
dockingState.setCenter(centerPoint);
}
ISerializer dockingPathDeserializer = SerializerRegistry.getSerializer(DockingPath.class);
NodeList dockingPathNodeList = element.getElementsByTagName(PersistenceConstants.DOCKING_PATH_ELEMENT_NAME);
if (dockingPathNodeList.getLength() > 0 && dockingPathNodeList.item(0) instanceof Element) {
Element dockingPathElement = (Element) dockingPathNodeList.item(0);
DockingPath dockingPath = (DockingPath) dockingPathDeserializer.deserialize(dockingPathElement);
dockingState.setPath(dockingPath);
}
return dockingState;
}