/** * Initialize the values of the Inputfields. Choose -1 for Integers in the VNode to disable a * Value, if the Checkboxes are enabled. * * @param v VNode containing the Values for Initializeation * @param setVisibility set true, if the NodeNameVisibility should be activated, else false. Has * no effect, if checks are disabled */ public void InitValues(VNode v, boolean setVisibility) { chNode = v; if (chNode == null) { GeneralPreferences gp = GeneralPreferences.getInstance(); iNodeNameRotation.setValue(gp.getIntValue("node.name_rotation")); iNodeNameDistance.setValue(gp.getIntValue("node.name_distance")); iNodeNameSize.setValue(gp.getIntValue("node.name_size")); bShowNodeName.setSelected(!gp.getBoolValue("node.name_visible")); bShowNodeName.doClick(); } else { if (checksEnabled) { // if checks are enabled...set the activity and select the checkbox if a // value is given iNodeNameRotation.setEnabled((chNode.getNameRotation() != -1)); bChNodeNameRotation.setSelected((chNode.getNameRotation() != -1)); } if (chNode.getNameRotation() != -1) iNodeNameRotation.setValue(chNode.getNameRotation()); else if (checksEnabled) NodeNameRotation.setForeground(Color.GRAY); if (checksEnabled) { iNodeNameDistance.setEnabled((chNode.getNameDistance() != -1)); bChNodeNameDistance.setSelected((chNode.getNameDistance() != -1)); } if (chNode.getNameDistance() != -1) iNodeNameDistance.setValue(chNode.getNameDistance()); else if (checksEnabled) NodeNameDistance.setForeground(Color.GRAY); if (checksEnabled) { iNodeNameSize.setEnabled((chNode.getNameSize() != -1)); bChNodeNameSize.setSelected((chNode.getNameSize() != -1)); } if (chNode.getNameSize() != -1) iNodeNameSize.setValue(chNode.getNameSize()); else if (checksEnabled) NodeNameSize.setForeground(Color.GRAY); if (checksEnabled) { bShowNodeName.setEnabled(setVisibility); bChShowNodeName.setSelected(setVisibility); } if (setVisibility) { bShowNodeName.setSelected(!chNode.isNameVisible()); bShowNodeName.doClick(); } else { // disable } } }