private void updateWarpStyle() { if (registrationControl == null) { lockTransformButton.Enabled = false; unlockTransformButton.Enabled = false; forceAffineCheckBox.Enabled = false; lockStatusText.Text = ""; return; } forceAffineCheckBox.Checked = registrationControl.model.warpStyle != TransformationStyleFactory.getDefaultTransformationStyle(); if (registrationControl.model.isLocked) { lockTransformButton.Enabled = false; lockStatusText.Text = "Explore the map. Select Render tab when done, or Unlock to improve."; unlockTransformButton.Enabled = true; forceAffineCheckBox.Enabled = false; return; } bool enabled = registrationControl.readyToLock.ReadyToLock(); lockTransformButton.Enabled = enabled; unlockTransformButton.Enabled = false; lockStatusText.Lines = registrationControl.model.GetLockStatusText(); forceAffineCheckBox.Enabled = true; }
public static TransformationStyle getTransformationStyle(int i) { TransformationStyleFactory.init(); if (i < 0 || i >= TransformationStyleFactory.transformationStyles.Count) { i = 0; } return(TransformationStyleFactory.transformationStyles[i]); }
private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (registrationControl != null) { registrationControl.model.warpStyle = ((CheckBox)sender).Checked ? TransformationStyleFactory.getTransformationStyle(1) : TransformationStyleFactory.getDefaultTransformationStyle(); updateWarpStyle(); } }
public RegistrationDefinition(MashupParseContext context, DirtyEvent dirtyEvent) { this.dirtyEvent = new DirtyEvent(dirtyEvent); XMLTagReader xMLTagReader = context.NewTagReader(RegistrationDefinition.RegistrationDefinitionTag); this.warpStyle = TransformationStyleFactory.ReadFromXMLAttribute(context); while (xMLTagReader.FindNextStartTag()) { if (xMLTagReader.TagIs(PositionAssociation.XMLTag())) { this.AddAssociation(new PositionAssociation(context, dirtyEvent)); } } }
public static TransformationStyle ReadFromXMLAttribute(MashupParseContext context) { TransformationStyleFactory.init(); string attribute = context.reader.GetAttribute(TransformationStyle.TransformationStyleNameAttr); if (attribute != null) { for (int i = 0; i < TransformationStyleFactory.transformationStyles.Count; i++) { if (TransformationStyleFactory.transformationStyles[i].getXmlName() == attribute) { return(TransformationStyleFactory.transformationStyles[i]); } } throw new InvalidMashupFile(context, string.Format("Invalid attribute value {1} for {0}", TransformationStyle.TransformationStyleNameAttr, attribute)); } return(TransformationStyleFactory.transformationStyles[0]); }
public static TransformationStyle getDefaultTransformationStyle() { return(TransformationStyleFactory.getTransformationStyle(0)); }