Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/15/10 16:07:38 (14 years ago)
Author:
mkommend
Message:

adapted OperatorGraphView to readyonly mechanism (ticket #973)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs

    r3176 r3355  
    7272      if (createdVisualizationInfo)
    7373        this.graphVisualizationInfoView.RelayoutGraph();
    74     }
     74
     75      this.SetEnableStateOfControls();
     76    }
     77
     78    protected override void OnReadOnlyChanged() {
     79      base.OnReadOnlyChanged();
     80      this.SetEnableStateOfControls();
     81    }
     82
     83    private void SetEnableStateOfControls() {
     84      if (Content == null) {
     85        selectButton.Enabled = false;
     86        panButton.Enabled = false;
     87        relayoutButton.Enabled = false;
     88        zoomAreaButton.Enabled = false;
     89        zoomInButton.Enabled = false;
     90        zoomOutButton.Enabled = false;
     91        screenshotButton.Enabled = false;
     92        detailsViewHost.Enabled = false;
     93        graphVisualizationInfoView.ReadOnly = true;
     94        connectButton.Enabled = false;
     95       
     96      } else {
     97        selectButton.Enabled = true;
     98        panButton.Enabled = true;
     99        relayoutButton.Enabled = true;
     100        zoomAreaButton.Enabled = true;
     101        zoomInButton.Enabled = true;
     102        zoomOutButton.Enabled = true;
     103        screenshotButton.Enabled = true;
     104        detailsViewHost.Enabled = true;
     105        detailsViewHost.ReadOnly = ReadOnly;
     106        graphVisualizationInfoView.ReadOnly = ReadOnly;
     107        connectButton.Enabled = !ReadOnly;
     108      }
     109    }
    75110
    76111    private GraphVisualizationInfo VisualizationInfo {
     
    160195
    161196    private void initialOperatorToolStripMenuItem_Click(object sender, EventArgs e) {
    162       IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
    163       if (this.VisualizationInfo.InitialShape == shapeInfo)
    164         this.VisualizationInfo.InitialShape = null;
    165       else
    166         this.VisualizationInfo.InitialShape = shapeInfo;
     197      if (!ReadOnly) {
     198        IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
     199        if (this.VisualizationInfo.InitialShape == shapeInfo)
     200          this.VisualizationInfo.InitialShape = null;
     201        else
     202          this.VisualizationInfo.InitialShape = shapeInfo;
     203      }
    167204    }
    168205
    169206    private void breakPointToolStripMenuItem_Click(object sender, EventArgs e) {
    170       IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
    171       if (shapeInfo != null) {
    172         IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
    173         op.Breakpoint = !op.Breakpoint;
     207      if (!ReadOnly) {
     208        IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
     209        if (shapeInfo != null) {
     210          IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
     211          op.Breakpoint = !op.Breakpoint;
     212        }
    174213      }
    175214    }
     
    179218    private void OperatorGraphView_DragEnter(object sender, DragEventArgs e) {
    180219      e.Effect = DragDropEffects.None;
     220      if (ReadOnly)
     221        return;
    181222      Type type = e.Data.GetData("Type") as Type;
    182223      if ((type != null) && (typeof(IOperator).IsAssignableFrom(type))) {
Note: See TracChangeset for help on using the changeset viewer.