########################################################################
#
#    Vision Network - Python source code - file generated by vision
#    Friday 13 April 2007 12:50:38 
#    
#       The Scripps Research Institute (TSRI)
#       Molecular Graphics Lab
#       La Jolla, CA 92037, USA
#
# Copyright: Daniel Stoffler, Michel Sanner and TSRI
#   
# revision: Guillaume Vareille
#  
#########################################################################
#
# $Header: /opt/cvs/python/packages/share1.5/Vision/doc/Examples/matplotlib/Fill_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#
# $Id: Fill_net.py,v 1.3 2007/08/29 20:37:16 vareille Exp $
#

from traceback import print_exc
## loading libraries ##
from Vision.matplotlibNodes import matplotliblib
masterNet.getEditor().addLibraryInstance(matplotliblib,"Vision.matplotlibNodes", "matplotliblib")

from Vision.StandardNodes import stdlib
masterNet.getEditor().addLibraryInstance(stdlib,"Vision.StandardNodes", "stdlib")

try:
    ## saving node FillColor ##
    from Vision.matplotlibNodes import FillNE
    FillColor_48 = FillNE(constrkw = {}, name='FillColor', library=matplotliblib)
    masterNet.addNode(FillColor_48,105,371)
    FillColor_48.inputPortByName['fillcolor'].widget.set("red", run=False)
    apply(FillColor_48.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore FillNE named FillColor in network masterNet"
    print_exc()
    FillColor_48=None

try:
    ## saving node ReadTable ##
    from Vision.StandardNodes import ReadTable
    ReadTable_49 = ReadTable(constrkw = {}, name='ReadTable', library=stdlib)
    masterNet.addNode(ReadTable_49,123,38)
    ReadTable_49.inputPortByName['filename'].widget.set("Data/fillcolor_data.dat", run=False)
    ReadTable_49.inputPortByName['sep'].widget.set(",", run=False)
    ReadTable_49.inputPortByName['datatype'].widget.set("float", run=False)
    apply(ReadTable_49.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore ReadTable named ReadTable in network masterNet"
    print_exc()
    ReadTable_49=None

try:
    ## saving node Set Matplotlib options ##
    from Vision.matplotlibNodes import MatPlotLibOptions
    Set_Matplotlib_options_50 = MatPlotLibOptions(constrkw = {}, name='Set Matplotlib options', library=matplotliblib)
    masterNet.addNode(Set_Matplotlib_options_50,360,233)
    Set_Matplotlib_options_50.inputPortByName['matplotlibOptions'].widget.set({'gridOn': 1}, run=False)
except:
    print "WARNING: failed to restore MatPlotLibOptions named Set Matplotlib options in network masterNet"
    print_exc()
    Set_Matplotlib_options_50=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_51 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_51,29,202)
    apply(Index_51.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_51=None

try:
    ## saving node Index ##
    from Vision.StandardNodes import Index
    Index_52 = Index(constrkw = {}, name='Index', library=stdlib)
    masterNet.addNode(Index_52,209,201)
    apply(Index_52.inputPortByName['index'].widget.configure, (), {'max': 1})
    Index_52.inputPortByName['index'].widget.set(1, run=False)
    apply(Index_52.configure, (), {'expanded': True})
except:
    print "WARNING: failed to restore Index named Index in network masterNet"
    print_exc()
    Index_52=None

masterNet.freeze()

## saving connections for network Fill ##
if Set_Matplotlib_options_50 is not None and FillColor_48 is not None:
    try:
        masterNet.connectNodes(
            Set_Matplotlib_options_50, FillColor_48, "matplotlibOptions", "drawAreaDef", blocking=True)
    except:
        print "WARNING: failed to restore connection between Set_Matplotlib_options_50 and FillColor_48 in network masterNet"
if ReadTable_49 is not None and Index_51 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_49, Index_51, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_49 and Index_51 in network masterNet"
if ReadTable_49 is not None and Index_52 is not None:
    try:
        masterNet.connectNodes(
            ReadTable_49, Index_52, "data", "data", blocking=True)
    except:
        print "WARNING: failed to restore connection between ReadTable_49 and Index_52 in network masterNet"
if Index_51 is not None and FillColor_48 is not None:
    try:
        masterNet.connectNodes(
            Index_51, FillColor_48, "data", "x", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_51 and FillColor_48 in network masterNet"
if Index_52 is not None and FillColor_48 is not None:
    try:
        masterNet.connectNodes(
            Index_52, FillColor_48, "data", "y", blocking=True)
    except:
        print "WARNING: failed to restore connection between Index_52 and FillColor_48 in network masterNet"
masterNet.unfreeze()
#masterNet.run()

