From fc21c58ab3e1e44e5f046921d1673792c031ce94 Mon Sep 17 00:00:00 2001 From: flatberg Date: Wed, 30 Aug 2006 10:27:45 +0000 Subject: [PATCH] Added icons to navigator --- icons/category_dataset.png | Bin 0 -> 666 bytes icons/dataset.png | Bin 0 -> 671 bytes icons/folder_grey.png | Bin 0 -> 636 bytes icons/graph_dataset.png | Bin 0 -> 762 bytes icons/line_plot.png | Bin 0 -> 727 bytes system/fluents.py | 1 + system/navigator.py | 9 ++++++--- system/plots.py | 4 ++-- system/project.py | 33 +++++++++++++++++++++++---------- 9 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 icons/category_dataset.png create mode 100644 icons/dataset.png create mode 100644 icons/folder_grey.png create mode 100644 icons/graph_dataset.png create mode 100644 icons/line_plot.png diff --git a/icons/category_dataset.png b/icons/category_dataset.png new file mode 100644 index 0000000000000000000000000000000000000000..bddfc9bfd489d330edddf6a0e371a3460a16f93f GIT binary patch literal 666 zcmV;L0%iS)P)z zlQB6Jfl_69&DOpkRBE;ozfEIBgvph3cUq+mXihRKsrcJb`j8Li#f(4N4kC5`YLUKrO!}!ufqN~JhW}tDnKEc?Ivzlt0+l$eX0g$?K zY&y^8FMRJ@1;|tnyXQt;&&F`Q0@GDje}Abii#^X?G`2;y2L4*j`Bro`(bFb4(>U4J zlGL1U_j{tomS95z6QyZrWi=T;avA`#S|WvuXEG%Kc*W8*v^&v-o+sDP5@8TjOT&w| z?dFyBi=&2!*m3;>K#ZV@0MGCnBGn&`hNwvS14ptlR$We0bN~PV07*qoM6N<$g5EJM A+5i9m literal 0 HcmV?d00001 diff --git a/icons/dataset.png b/icons/dataset.png new file mode 100644 index 0000000000000000000000000000000000000000..d974e1753976a83c572f3476c37151afc674bc9f GIT binary patch literal 671 zcmV;Q0$}}#P)z zlRa+}K@f)D+1tJIIUjax84OB5id!P3;HyHUr=W#jkcO6mhM$0-aatPw0@O5#L<>kH z5JiG0iZO9w$M*T|c7|eomM;MsC|GHWXKv@YcSl;hXf{7TYc>}}1b?#?{?YpXM0y&Y zJbqOLF!P(U^aoEzpDA4I7s}USe{R8ba%wO*iHoyU0PsZY{NcB~&hk%h?ws_-`E%yirVXk)zyAjyXWfZkp%kf>B5EkZbr6C^nUB~QvE?D(rNNi z+Pggs018+G5UK$02$D}ZH4i|DfFSps#Q;zW0IX6^AFZ!H9G&QoO01CBh{Q&o*jPyd zVjB_LNQp#55@bwlBV{e&SHqr(e;j~l)7?Lb!lZL3o*uKC(Om2MX4Vt-jyhoRaw4tm zd=!*dx?%kW0C*htl#vhJa{V>{D4PtgYP;L5*ViVZVHb2vd%3sf>!fBVu1pewwZW)5 zJuhD;ja-k6Y6L0d5*d@$3h0*%4^sdLB%+W9Ws^EKb|l864Ks2K00ld!5uFkFCVjJ{ zKV82f+X5mI0$_o~_7{K|Pzo~Z;pX=19U}LJS%j1(`xE_JLHs)h;1d7<002ovPDHLk FV1n8dBQO8} literal 0 HcmV?d00001 diff --git a/icons/folder_grey.png b/icons/folder_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..f9d48df6f275b10f96dde22f55487283cb0e4b02 GIT binary patch literal 636 zcmV-?0)zdDP)Lxewq+#lO_vAy1% zS$ipxT!T2Kp7}^K^Glw;e&h2zFTC@-c=Zxva`si*Hq445ZkzVklgE!9nr~k(&FuJ? za<$_AY{sOR>;)1a^)4Ai4o~LuQ==Mi-XW?u>llY|FW^OJHXBxDnFALl1SN9wp$cex>jEMIDTsPO8pPljJ_mz1Im>`O#LeN07 zZMgR!LnI*1aWFl^J4Z2@;A~G&rD+;E+vEB^+^irPNfJba&31$BEtA6oeDAQfqq7~k z$w|@_*Y{Z4v92rX?KbXKh>WNTbzNh!jOlbr7zSD(NfIOxthK~(#9GU`s;TY(5oHVm zy>nFSHO3g~vLpi2qa$qF0uXOM)Av1Bs})V#nj64-YzU|-byZ`G*}bu@>c4W}oa5Q~ zQ@&h&kMBOb$B1||1mZYSS2bCd?GKXoEY>BfvK#?SxE+o$Qq>h{n(hTeghg4htjf3p z#&{Foa<%?1pg~!#*OXPo4!AqfVzD4elD$A2M?QY~%xbw*fF#Dq$$WkaTf* literal 0 HcmV?d00001 diff --git a/icons/graph_dataset.png b/icons/graph_dataset.png new file mode 100644 index 0000000000000000000000000000000000000000..5ce8239253a19aede167739a2913c081d4ead7a5 GIT binary patch literal 762 zcmVz z)J;fKQ4|O8|Go1*=EHeTIxws zk^sx-^p}eH^lL|hcdRjRa5D%1iS?dlodkMJXC{Q?b!13wgZ(pHjwczdIdC-^qLimo zMJ%?^aYW0Kttqv6qR7f+Q%8(j@*qeq%;9?P;QZTt$I6J51&7UjbYVzqyg%^ay}u2I0vzuX>Gj?#^U`$LseYoh0LG@lG<6@;^{rBsWG=IA5Jg=!O&)0C6;K2362ej zMH(Xzz6TtJM*si{oB&`mWJI}&Y|u7*{E$cWr81Lc58u6+w%HZ6t+M-6Q{75cA~j#z zr`>y&+YtpQ1%NE24{o)$U)ENIF`aOER;!4uZcuG}**o6Q5T5b-tJc9G0>GNa1f6g> zH#kB5Wdo3>ZI?!3${XLLiyw4W3h8Hf40d=vJ?Fa_lmXh$QGG04iZ#d84tv zcx7*Cfu;Z&ink_1I_f`}AW<}a2IXOCdyP1}G^cMG5>xHfE)mRTf@CWn&?yaXmlE)A sz|I#z2sr0Nc9bDbuFL{}w4Fo00`rhHf8wfg`2YX_07*qoM6N<$g8xfTUH||9 literal 0 HcmV?d00001 diff --git a/icons/line_plot.png b/icons/line_plot.png new file mode 100644 index 0000000000000000000000000000000000000000..70de6a78606d45bfa1805886527a0bc8fc85992e GIT binary patch literal 727 zcmV;|0x127P)@ z(@#iLK^zD0@63DauIt;?=bLR!#D8lhv_u%0NYH;G2!alg(V+;^Lmlf>C|wJqrC2Wo zT_U7Ior36MhCvXB5Sg24x%p>z{j*QE{quHaI+(O?lL+e6!0#|Wn9sm>euGdr{P9*e zTqC8#-xS3^TK_Sm7H)__f)Kby%W+|?0rDrvjq9O{Hb`wiEFZ-%WnlMt%?XPj(?z4t zeuq5ZwVlzt<+MQxgC-L2^r_WnN(gOmLef6EnO)XrH^f{V)VoCYa+!Pk3zRQ|r%{v~ z>TI6s0f2{*`d+_R8A+6Is~9>N(_6l}ax-~w)fTp5Kx=oq>pyGRC>RVd7(@Qm*Imo( zxMILin7wx8+y|c2neQxE4ix~15c_WT_oqGMz78#xKK9D-Z6rI2qW};R33@kGv&R~N zTM)>C_$5-<{vxs}r{^B~RREyCegLI`wkdX$9B5pOr`lxMArYxgufQL3O8mcaHeZRggg<2|z&BJR$)I0Q6^Y#M*002ov JPDHLkV1f|(O56Yd literal 0 HcmV?d00001 diff --git a/system/fluents.py b/system/fluents.py index 6bd4e33..1c23b51 100755 --- a/system/fluents.py +++ b/system/fluents.py @@ -18,6 +18,7 @@ from system import project, workflow, dataset, logger, plots, navigator, dialogs PROGRAM_NAME = 'fluents' VERSION = '0.1.0' DATADIR = os.path.dirname(sys.modules['system'].__file__) +ICONDIR = os.path.join(DATADIR,"..","icons") GLADEFILENAME = os.path.join(DATADIR, 'fluents.glade') class FluentApp: diff --git a/system/navigator.py b/system/navigator.py index fb996cf..33064be 100644 --- a/system/navigator.py +++ b/system/navigator.py @@ -18,6 +18,7 @@ class NavigatorView (gtk.TreeView): # various properties self.set_headers_visible(False) + self.get_hadjustment().set_value(0) # Selection Mode self.get_selection().set_mode(gtk.SELECTION_MULTIPLE) self.get_selection().set_select_function(self.is_selectable) @@ -29,10 +30,12 @@ class NavigatorView (gtk.TreeView): self.connect('row_activated', self.row_activated_handler) self.textrenderer = textrenderer = gtk.CellRendererText() - textrenderer.set_property('foreground_set',True) + pixbufrenderer = gtk.CellRendererPixbuf() self.object_col = gtk.TreeViewColumn('Object') + self.object_col.pack_start(pixbufrenderer,expand=False) self.object_col.pack_start(textrenderer,expand=False) self.object_col.set_attributes(textrenderer, cell_background=3, foreground=4, text=0) + self.object_col.set_attributes(pixbufrenderer, pixbuf=5) self.append_column(self.object_col) # send events to plots / itself @@ -75,10 +78,10 @@ class NavigatorView (gtk.TreeView): tmp = self._previous_selection self._previous_selection = paths # set timestamp on newly selected objects - [self.data_tree.set_value(self.data_tree.get_iter(path),5,time.time()) for path in paths if path not in tmp] + [self.data_tree.set_value(self.data_tree.get_iter(path),6,time.time()) for path in paths if path not in tmp] objs = [self.data_tree.get_iter(path) for path in paths] - objs = [(self.data_tree.get_value(iter,5), self.data_tree.get_value(iter,2)) for iter in objs] + objs = [(self.data_tree.get_value(iter,6), self.data_tree.get_value(iter,2)) for iter in objs] objs.sort() objs = [obj for timestamp, obj in objs] # order dataset diff --git a/system/plots.py b/system/plots.py index 72efd4e..7ad233d 100644 --- a/system/plots.py +++ b/system/plots.py @@ -558,7 +558,7 @@ has no color and size options.""" #remove old selection if self._selection_line: self.ax.lines.remove(self._selection_line) - self._selection_line, = self.ax.plot(xdata_new,ydata_new,marker='o',markersize=self.ms,linestyle=None) + self._selection_line, = self.ax.plot(xdata_new,ydata_new,marker='o',markersize=self.ms,linestyle=None,markerfacecolor='r') self._toolbar.forward() #update data lims before draw self.canvas.draw() @@ -578,7 +578,7 @@ has no color and size options.""" self.xaxis_data = dataset_1._array[:,x_index] self.yaxis_data = dataset_2._array[:,y_index] - ax.scatter(self.xaxis_data,self.yaxis_data,s=s,c=c,faceted=False,edgecolor='k') + ax.scatter(self.xaxis_data,self.yaxis_data,s=s,c=c,faceted=False,edgecolor='k',alpha=.6,cmap = cm.Set1) ax.set_title(self.get_title()) #ax.set_xlabel("%s - %s" % (sel_dim, id_1)) #ax.set_ylabel("%s - %s" % (sel_dim, id_2)) diff --git a/system/project.py b/system/project.py index 0a9b7c3..f83c093 100644 --- a/system/project.py +++ b/system/project.py @@ -1,7 +1,8 @@ - +import os import scipy import gobject import gtk +import fluents import logger from system import dataset, plots @@ -9,7 +10,8 @@ class Project: def __init__(self,name="Testing"): self.data_tree = gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_STRING, - gobject.TYPE_STRING, gobject.TYPE_DOUBLE) + gobject.TYPE_STRING, gobject.TYPE_OBJECT, + gobject.TYPE_DOUBLE) self.name = name self.dim_names = [] @@ -69,26 +71,36 @@ class Project: has finished and returns its output.""" parent_iter = self.get_data_iter(parents) - it = self.data_tree_insert(parent_iter, fun, None, "grey","black") - + icon_fname = os.path.join(fluents.ICONDIR,"folder_grey.png") + icon = gtk.gdk.pixbuf_new_from_file(icon_fname) + it = self.data_tree_insert(parent_iter, fun, None, None,"black",icon) + for d in data: if isinstance(d, dataset.GraphDataset): self.add_dataset(d) - self.data_tree_insert(it, d.get_name(), d, "LightPink", "black") + icon_fname = os.path.join(fluents.ICONDIR,"graph_dataset.png") + icon = gtk.gdk.pixbuf_new_from_file(icon_fname) + self.data_tree_insert(it, d.get_name(), d, None, "black",icon) elif isinstance(d,dataset.CategoryDataset): + icon_fname = os.path.join(fluents.ICONDIR,"category_dataset.png") + icon = gtk.gdk.pixbuf_new_from_file(icon_fname) self.add_dataset(d) - self.data_tree_insert(it, d.get_name(), d, "LightSalmon", "black") + self.data_tree_insert(it, d.get_name(), d, None, "black",icon) elif isinstance(d, dataset.Dataset): + icon_fname = os.path.join(fluents.ICONDIR,"dataset.png") + icon = gtk.gdk.pixbuf_new_from_file(icon_fname) self.add_dataset(d) - self.data_tree_insert(it, d.get_name(), d, "LightSkyBlue", "black") + self.data_tree_insert(it, d.get_name(), d, None, "black",icon) elif isinstance(d, plots.Plot): - self.data_tree_insert(it, d.get_title(), d, "PaleGreen", "black") + icon_fname = os.path.join(fluents.ICONDIR,"line_plot.png") + icon = gtk.gdk.pixbuf_new_from_file(icon_fname) + self.data_tree_insert(it, d.get_title(), d, None, "black",icon) d.set_selection_listener(self.set_selection) self._selection_observers.append(d) elif isinstance(d, dataset.Selection): self.add_selection(d) - def data_tree_insert(self, parent, text, data, bgcolour,fontcolour,selected = 0): + def data_tree_insert(self, parent, text, data, bgcolour,fontcolour,icon,selected = 0): tree = self.data_tree it = tree.append(parent) tree.set_value(it, 0, text) @@ -96,7 +108,8 @@ class Project: tree.set_value(it, 2, data) tree.set_value(it, 3, bgcolour) tree.set_value(it, 4, fontcolour) - tree.set_value(it, 5, selected) + tree.set_value(it, 5, icon) + tree.set_value(it, 6, selected) return it def add_dataset(self, dataset):