BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
Loading...
Searching...
No Matches
BioGTK.NodeView Class Reference
Inheritance diagram for BioGTK.NodeView:

Public Member Functions

void InitItems ()
 
void UpdateItems ()
 

Static Public Member Functions

static NodeView Create (string[] args)
 

Protected Member Functions

 NodeView (Builder builder, IntPtr handle, string[] args)
 
void SetupHandlers ()
 Sets up the handlers.
 
void OnLocalDeleteEvent (object sender, DeleteEventArgs a)
 Handle Close of Form, Quit Application.
 
void newTabsViewClick (object sender, EventArgs a)
 Handle Click of Button.
 
void aboutClick (object sender, EventArgs a)
 Handle Click of Button.
 

Constructor & Destructor Documentation

◆ NodeView()

BioGTK.NodeView.NodeView ( Builder  builder,
IntPtr  handle,
string[]  args 
)
inlineprotected
48 : base(handle)
49 {
50 Console.WriteLine("Creating Nodeview.");
51 _builder = builder;
52 builder.Autoconnect(this);
53 string st = System.IO.Path.GetDirectoryName(Environment.ProcessPath);
54 //Let's make sure the directories we need for startup exist.
55 Console.WriteLine("Reading start up folders.");
56 System.IO.Directory.CreateDirectory(st + "/Scripts");
57 System.IO.Directory.CreateDirectory(st + "/Functions");
58 System.IO.Directory.CreateDirectory(st + "/Tools");
59 System.IO.Directory.CreateDirectory(st + "/Plugins");
60 System.IO.Directory.CreateDirectory(st + "/Models");
61 App.nodeView = this;
62 App.Initialize(true);
64 Console.WriteLine("Parsing arguments.");
65 if (args != null)
66 {
67 if (args.Length > 0)
68 {
69 App.tabsView = TabsView.Create();
70 }
71 foreach (string item in args)
72 {
73 BioImage.OpenAsync(item, false, true, true, 0);
74 }
75 }
76 Console.WriteLine("Initializing nodes.");
77 InitItems();
78 App.ApplyStyles(this);
79 }
void InitItems()
Definition NodeView.cs:83
void SetupHandlers()
Sets up the handlers.
Definition NodeView.cs:147

Member Function Documentation

◆ aboutClick()

void BioGTK.NodeView.aboutClick ( object  sender,
EventArgs  a 
)
inlineprotected

Handle Click of Button.

Parameters
senderSource of the event.
aEvent information to send to registered event handlers.
177 {
179 about.Show();
180 }
Definition About.cs:15
static About Create()
Definition About.cs:32
Definition About.cs:11

◆ Create()

static NodeView BioGTK.NodeView.Create ( string[]  args)
inlinestatic

The function creates a NodeView object using a Glade file and returns it.

Parameters
argsThe "args" parameter is an array of strings that can be passed to the Create method. It is used to provide additional arguments or data that may be needed for the creation of the NodeView object. The specific purpose or usage of these arguments would depend on the implementation of the NodeView class and
Returns
The method is returning a NodeView object.
41 {
42 Builder builder = new Builder(new FileStream(System.IO.Path.GetDirectoryName(Environment.ProcessPath) + "/" + "Glade/NodeView.glade", FileMode.Open));
43 return new NodeView(builder, builder.GetObject("nodeView").Handle,args);
44 }
NodeView(Builder builder, IntPtr handle, string[] args)
Definition NodeView.cs:48

◆ InitItems()

void BioGTK.NodeView.InitItems ( )
inline

It takes a list of images, and for each image, it takes a list of bitmaps, and for each bitmap, it adds a row to the treeview with the bitmap's coordinate, exposure, and delta

84 {
85 Gtk.TreeViewColumn coordCol = new Gtk.TreeViewColumn();
86 coordCol.Title = "Coordinate";
87 Gtk.CellRendererText coordCell = new Gtk.CellRendererText();
88 coordCol.PackStart(coordCell, true);
89
90 Gtk.TreeViewColumn expCol = new Gtk.TreeViewColumn();
91 expCol.Title = "Exposure";
92 Gtk.CellRendererText expCell = new Gtk.CellRendererText();
93 expCol.PackStart(expCell, true);
94
95 Gtk.TreeViewColumn deltaCol = new Gtk.TreeViewColumn();
96 deltaCol.Title = "Delta";
97 Gtk.CellRendererText deltaCell = new Gtk.CellRendererText();
98 deltaCol.PackStart(deltaCell, true);
99
100
101 tree.AppendColumn(coordCol);
102 tree.AppendColumn(expCol);
103 tree.AppendColumn(deltaCol);
104
105 coordCol.AddAttribute(coordCell, "text", 0);
106 expCol.AddAttribute(expCell, "text", 1);
107 deltaCol.AddAttribute(deltaCell, "text", 2);
108
109 Gtk.TreeStore store = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string));
110
111 foreach (BioImage b in Images.images)
112 {
113 Gtk.TreeIter iter = store.AppendValues(System.IO.Path.GetFileName(b.Filename));
114 foreach (AForge.Bitmap bit in b.Buffers)
115 {
116 store.AppendValues(iter, bit.Coordinate.ToString(), bit.Plane.Exposure, bit.Plane.Delta);
117 }
118 }
119 tree.Model = store;
120
121 }

◆ newTabsViewClick()

void BioGTK.NodeView.newTabsViewClick ( object  sender,
EventArgs  a 
)
inlineprotected

Handle Click of Button.

Parameters
senderSource of the event.
aEvent information to send to registered event handlers.
168 {
170 tabsView.Show();
171
172 }
Definition TabsView.cs:17
static TabsView Create()
Definition TabsView.cs:164

◆ OnLocalDeleteEvent()

void BioGTK.NodeView.OnLocalDeleteEvent ( object  sender,
DeleteEventArgs  a 
)
inlineprotected

Handle Close of Form, Quit Application.

Parameters
senderSource of the event.
aEvent information to send to registered event handlers.
159 {
160 Application.Quit();
161 a.RetVal = true;
162 }

◆ SetupHandlers()

void BioGTK.NodeView.SetupHandlers ( )
inlineprotected

Sets up the handlers.

148 {
149 DeleteEvent += OnLocalDeleteEvent;
150 newTabsViewMenu.ButtonPressEvent += newTabsViewClick;
151 aboutMenu.ButtonPressEvent += aboutClick;
152
153 }
void OnLocalDeleteEvent(object sender, DeleteEventArgs a)
Handle Close of Form, Quit Application.
Definition NodeView.cs:158
void aboutClick(object sender, EventArgs a)
Handle Click of Button.
Definition NodeView.cs:176
void newTabsViewClick(object sender, EventArgs a)
Handle Click of Button.
Definition NodeView.cs:167

◆ UpdateItems()

void BioGTK.NodeView.UpdateItems ( )
inline

It takes a list of images, and for each image, it takes a list of bitmaps, and for each bitmap, it adds a row to the treeview

125 {
126 Gtk.TreeStore store = new Gtk.TreeStore(typeof(string), typeof(string), typeof(string));
127
128 foreach (BioImage b in Images.images)
129 {
130 Gtk.TreeIter iter = store.AppendValues(System.IO.Path.GetFileName(b.Filename));
131 foreach (AForge.Bitmap bit in b.Buffers)
132 {
133 if(bit.Plane != null)
134 store.AppendValues(iter, bit.Coordinate.ToString(), bit.Plane.Exposure, bit.Plane.Delta);
135 else
136 store.AppendValues(iter, bit.Coordinate.ToString(), 0, 0);
137 }
138 }
139 tree.Model = store;
140
141 }

The documentation for this class was generated from the following file: