;;; -*- Mode: Lisp -*- #|CLARITY: Common Lisp Data Alignment Repository Copyright (c) 2006 Samantha Kleinberg All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA contact: Samantha AT Bioinformatics DOT nyu DOT edu 715 Broadway, 10th floor New York, NY 10003|# (in-package "CLARITY") (defvar *my-image-list* (make-instance 'capi:image-list :image-sets (list (capi:make-general-image-set :id #.(gp:read-external-image (lispworks:current-pathname "icons/icons.bmp")) :image-count 4)) :image-width 16 :image-height 16)) (capi:define-interface clarity-interface () ((clarity-handle :accessor clarity-handle :initarg :clarity-handle)) (:panes (graph-pane-1 capi:graph-pane :print-function (lambda (x) (princ-to-string (phylogeny-data-id x))) :roots (list (get-phylogeny-root *current-clarity-handle*)) :children-function (lambda (x) (get-phylogeny-children x)) :layout-function :top-down :selection-callback 'phylogeny-select-callback :callback-type :item-interface :accessor phylogeny-pane) (database-buttons capi:push-button-panel :title "Database Options" ; :items '("View all entries" "Search entries") :items '("View all entries") :layout-class 'capi:column-layout :callback-type :data-interface :selection-callback 'database-switch-callback ) (database-all-entries capi:multi-column-list-panel ; :items :visible-min-width 300 :visible-min-height :text-height :columns '((:title "ID" :adjust :left :width (character 15)) (:title "Filename" :adjust :left :visible-min-width (character 20)) (:title "Date" :adjust :left :width (character 20))) ;:selection-callback ;mclp-header-callback :accessor database-all-entries ) (database-single-entry capi:grid-layout :accessor database-single-entry ) (database-switchable capi:switchable-layout :description '(database-all-entries database-single-entry) :accessor database-switchable ) (leaf-terms capi:list-panel :accessor leaf-terms :title "Terms" ) (left-child-detail capi:tree-view :title "Left child" :accessor left-child-detail :children-function (lambda (x) (get-phylogeny-terms-children x)) ;:children-function (lambda (x) nil) :print-function (lambda (x) (phylogeny-terms-print-function x)) :image-lists (list :normal *my-image-list*) :image-function #'(lambda (x) (phylogeny-window-icon x)) ) (right-child-detail capi:tree-view :title "Right child" :accessor right-child-detail :children-function (lambda (x) (get-phylogeny-terms-children x)) ;:children-function (lambda (x) nil) :print-function (lambda (x) (phylogeny-terms-print-function x)) :image-lists (list :normal *my-image-list*) :image-function #'(lambda (x) (phylogeny-window-icon x)) ) (consensus-detail capi:list-panel :title "Consensus" :accessor consensus-detail ) ) (:layouts (column-layout-1 capi:column-layout '(tab-layout-1)) (tab-layout-1 capi:tab-layout () :items '(("Database" database-layout) ("Phylogeny" phylogeny-layout)) :print-function 'car :visible-child-function 'second) (database-layout capi:row-layout '(database-buttons database-switchable) ) (internal-node-detail capi:row-layout '(left-child-detail consensus-detail right-child-detail) ) (leaf-layout capi:row-layout '(leaf-terms) ) (phylogeny-detail capi:tab-layout () :items '(("Leaf node" leaf-layout) ("Internal node" internal-node-detail)) :print-function 'car :visible-child-function 'second ) (phylogeny-layout capi:column-layout '(graph-pane-1 phylogeny-detail)) (column-layout-3 capi:column-layout '(graph-pane-1 phylogeny-detail))) (:menu-bar file edit) (:menus (edit "Edit" ()) (file "File" ((:component ( ("Insert" :callback 'insert-file-popup :callback-type :interface)))))) (:default-initargs :best-height 280 :best-width 300 :layout 'column-layout-1 :title "CLARITY")) (defun start-clarity-interface () (let ((gui (make-instance 'clarity-interface :clarity-handle *current-clarity-handle*))) (capi:display gui) ))