/** * DOCUMENT ME! * * @param value DOCUMENT ME! */ private void setPointValue(final double value) { if (isEditable()) { if (LOG.isDebugEnabled()) { LOG.debug("change bean value to " + value); } final CidsBean pointBean = getCidsBean(); final double oldValue = LinearReferencingHelper.getLinearValueFromStationBean(pointBean); if (oldValue != value) { try { if (!isFeatureChangeLocked()) { MAPPING_COMPONENT.getFeatureCollection().select(getFeature()); } if (!isBeanChangeLocked()) { LinearReferencingHelper.setLinearValueToStationBean( (double) Math.round(value), pointBean); } } catch (Exception ex) { if (LOG.isDebugEnabled()) { LOG.debug("error changing bean", ex); } } } else { if (LOG.isDebugEnabled()) { LOG.debug("no changes needed, old value was " + oldValue); } } } }
/** DOCUMENT ME! */ private void switchBadGeomVisibility() { if (isEditable()) { final Feature badGeomFeature = getBadGeomFeature(); final Feature pointFeature = getFeature(); final boolean selected = getBadGeomButton().isSelected(); if (selected) { boundingbox = (XBoundingBox) MAPPING_COMPONENT.getCurrentBoundingBox(); MAPPING_COMPONENT.getFeatureCollection().addFeature(badGeomFeature); MAPPING_COMPONENT.getFeatureCollection().select(pointFeature); zoomToBadFeature(); } else { MAPPING_COMPONENT.getFeatureCollection().removeFeature(badGeomFeature); MAPPING_COMPONENT.gotoBoundingBoxWithoutHistory(boundingbox); } getBadGeomCorrectButton().setVisible(selected); } }
/** DOCUMENT ME! */ private void cleanup() { final CidsBean pointBean = getCidsBean(); if (pointBean != null) { pointBean.removePropertyChangeListener(getCidsBeanListener()); } if (isEditable()) { if (pointBean != null) { // altes feature entfernen final LinearReferencedPointFeature oldFeature = FEATURE_REGISTRY.removeStationFeature(pointBean); if (oldFeature != null) { // listener auf altem Feature entfernen oldFeature.removeListener(getFeatureListener()); } FEATURE_REGISTRY.removeListener(pointBean, getMapRegistryListener()); } final Feature badGeomFeature = getBadGeomFeature(); if (badGeomFeature != null) { // badgeomfeature entfernen. MAPPING_COMPONENT.getFeatureCollection().removeFeature(badGeomFeature); setBadGeomFeature(null); } } setInited(false); if (isEditable()) { // auf startzustand setzen => hinzufügenpanel anzeigen showCard(Card.add); } else { setErrorMsg("keine Station zugewiesen"); showCard(Card.error); } }