input
stringlengths
10
828
output
stringlengths
5
107
private void about gene x gene xevent handler about gene x this
display about dialog
public boolean is opt string opt return options contains key opt
tell whether a particular option was found
public string get opt string key return string options get key
retrieve the value for options that require them
public int get int opt string key throws number format exception return integer parse int string options get key
retrieve the integer value for options that require them
private void print doc renderer set scale width to fit true htmldocument htdoc if focus manager focus flag on one htdoc htmldocument gen seq panel one text pane get document doc renderer print htdoc else htdoc htmldocument gen seq panel two text pane get document doc renderer print htdoc
print the selected dna sequence panel
public list get shift list return args left
return whats left over after option parsing in a list of strings
public string tokenizer get shift tokenizer string s for iterator iter args left iterator iter has next s string iter next return new string tokenizer s
return whats left over after option parsing in a string tokenizer
public void exitapplication msg n checking whether it is coming from the gui if debug flag on debug msg show exit message end of exitapplication
method for exiting the application
public void done folding attributes a report statistics system out println manager report manager create canvas output palette output panel output panel repaint
report statistics create and add canvas showing folded protein
private attributes create attributes attrib new attributes buffer to string standard straight is selected straight bent hexagonal incremental 8 4 hydro phobic text field get text hydrogen weight field get text ionic weight field get text null null return attrib
initialize different atrributes most of them are fixed as required by
protected jpanel create button panel jpanel button panel new jpanel fold button new jbutton fold exit button new jbutton exit fold button set enabled true exit button set enabled true fold button add action listener new action listener public void action performed action event evt try manager fold create attributes catch folding exception ex ex print stack trace exit button add action listener new action listener public void action performed action event evt show exit message button panel add fold button button panel add exit button return button panel
create button panel with fold and exit buttons
public grid point add grid point p return new grid point x p x y p y z p z
add a grid point to this grid point
public grid point subtract grid point p return new grid point x p x y p y z p z
subtract a grid point from this grid point
public void done folding attributes attrib if folding manager get instance debug system out println manager report
im done folding
private void print to file if m cage panel collection null file print file select file m default directory print work to file enter file name to print to false m prt filter string print files 1 if print file null if print file get path ends with html print file convert to print file html create htmlfile print file m cage panel collection m trait
prints the current work done by the user to a
public string to string return protex main app
for debugging purposes mostly
private void print to file if gene xlist null gene xevent handler print to file gene xlist work dir this
print to file html display of exisiting dna in the history
public void set text if pp null super set text default text else if pp is in history super set text pp get id
set the string text value in the iopanel jbutton bar
private void check for valid input final jformatted text field text field text field get input map put key stroke get key stroke key event vk enter 0 check text field get action map put check new abstract action public void action performed action event e if text field is edit valid the text is invalid toolkit get default toolkit beep text field select all else try the text is valid text field commit edit so use it catch java text parse exception exc
check for valid input in text field
public void attach folding observer obs if observers index of obs 0 if debug system out print n folding manager attach system out println adding obs to string to the list of observer objects observers add obs
add a folding observer to the list of observer objects
private void save if gene xlist null gene xevent handler save gene xlist work dir this
method to save the exiting session saves the dna sequences in the history
protected jpanel create input output panel input output panel new jpanel new border layout input output panel add create input panel border layout north input output panel add create break ties panel border layout south input output panel add create output canvas panel border layout center return input output panel
create input and output panel
public void detach folding observer obs observers remove obs
remove a folding observer from the list of observer objects
public void fold attributes attrib throws folding exception reset current current attrib attrib fold pp attrib attrib save state outfile todo implement attrib save state observers protex main app and protex admin gui notify observers
folding happens here
protected jpanel create output canvas panel output panel new output palette output panel set opaque true content panes must be opaque return output panel
create output canvas panel
public void set uhl polypeptide uhl polypeptide pp from history uhl 1 set uhl pp from history
set references for one polypeptide
public void set next int index direction d acid array index set next d
set the direction of the next amino acid in the chain
private void show exit message int result joption pane show confirm dialog null do you want to exit folding window exit folding window joption pane yes no option if result joption pane yes option system exit 1
display exit message with yes no option
public void set to active set active color true set border border factory create raised bevel border
set this iopanel to active state
public void create canvas output palette output panel output panel get drawing pane repaint output panel get drawing pane set grid current grid
another create canvas method
private void create hexagon hexagon new polygon hexagon add point cell radius 2 0 hexagon add point 3 cell radius 2 0 hexagon add point 2 cell radius sqrt3 cell radius hexagon add point 3 cell radius 2 2 sqrt3 cell radius hexagon add point cell radius 2 2 sqrt3 cell radius hexagon add point 0 sqrt3 cell radius
this creates a hexagon of the proper size
public void save state string filename define a new output stream print the following text strings to output pp chain consisting of amino acids string break ties string hydrophobic index value string hydrogen index value string ionic index value string
save the current state as of this object attributes
public void set to in active set active color false set border border factory create lowered bevel border
set this iopanel to inactive state
private void reset current is plotting false current attrib null current pp null current folder null current grid null
initialize or resets current state for each folding
public attributes load state string filename return new attributes
load an existing state as defined by an attribute object
private void open for opening the existing arraylist needs to be emptied first or the session should be closed done in gene xevent handler if gene xlist null gene xlist null gene xevent handler open gene xlist work dir this
method to open a saved session work
public void set polypeptide polypeptide pp this pp pp input palette get input panel set is changed to false output palette get output canvas panel set title get pppid button set text
associate a polypeptide with this iopanel adjust the value of is changed
public void clear all clear input palette clear output palette
clear this iopanel
public void add amino acid a double probability throws folding exception table put a get name trim to upper case new acid in table a probability
add an amino acid to the table with its frequency
public void add amino acid a throws folding exception throw new folding exception can t add to standard table without probability
add an amino acid to the table
public amino acid get string name acid in table a acid in table table get name trim to upper case if a null return null return a a
retrieve an acid from the table
public float get contrast scaler return float 1 0
a constant between 0 and 1 that leads to good contrast when normalized
public string get name return amino acid table standard
returns the name of this table
private void create grid attributes attrib throws folding exception string grid attrib get grid if grid equals ignore case hexagonal current grid new hex grid current pp else throw new folding exception folding manager create grid required hexagonal given grid
create a grid
public void mouse clicked mouse event event protex main app active iopanel this protex main app set active iopanel border
if mouse is clicked make current iopanel the active panel
public string acids to string string s iterator itr list iterator while itr has next s concat amino acid itr next to string return s
convert amino acid chain to string
public void prompt is changed to boolean b if b int result joption pane show confirm dialog null polypeptide chain has been modified n clear folded protein i op get name joption pane yes no option if result joption pane yes option i op clear output palette set is changed to b
notifies the input palette that the amino acid chain is modified but does
public void set is changed to boolean b is changed b
notifies the input palette that the amino acid chain is modified
private void clean up if m history list null m history list clear hlist initialize the cage uipanel if m cage panel null m cage panel remove active cage m cage panel remove selected cage panel true m cage panel remove selected cage panel false m cage panel collection null m genetics null m current saved file null m next cage id 1 enable all false m is balloon help active null m status label set text
method to release temporary objects and re initialize objects and
public void remove amino acid int amino acid index if folding manager get instance debug system out print n input palette remove amino acid system out println amino acid index amino acid index list remove amino acid index
remove amino acid from polypeptide chain
protected jpanel make history panel history panel new jpanel gene xlist new array list msg n making history panel if debug flag on debug msg history panel set border border factory create titled border history history panel set background genex sequence panel background color history panel add init history return history panel
jpanel to save history
protected jscroll pane init history m hlist model new default list model m hlist new jlist m hlist model m hlist set cell renderer new my cell renderer m hlist listener new hlist listener m hlist add list selection listener m hlist listener m hlist scroll pane new jscroll pane m hlist scroll pane get viewport add m hlist m hlist scroll pane set preferred size new dimension 160 650 m hlist scroll pane set vertical scroll bar policy javax swing scroll pane constants vertical scrollbar always m hlist scroll pane get viewport repaint return m hlist scroll pane
initializing history to be displayed
public void mouse clicked mouse event event activate this iopanel protex main app active iopanel i op protex main app set active iopanel border remove amino acid from chain point p event get point try amino acid index amino acid at p if amino acid index 0 remove amino acid amino acid index drawing pane repaint if is changed i op get polypeptide null prompt is changed to true catch exception ex ex print stack trace
if mouse is clicked make current iopanel active remove amino acid from
protected void set selected dna string dna string if focus manager focus flag on one gen seq panel one update htmlpanel dna string else gen seq panel two update htmlpanel dna string
remove all the components from the active sequence panel
protected void clear display gen seq panel one update htmlpanel gen seq panel two update htmlpanel
method to clear the display in both the panels
protected void clear hlist removing the objects in the arraylist if gene xlist null iterator it gene xlist iterator while it has next it next it remove gene xlist new array list m hlist model remove all elements m hlist scroll pane revalidate m hlist scroll pane repaint
method to clear the history list
private void show exit message genex sequence panel display saved dna int result joption pane show confirm dialog null do you want to exit gene x window exit gene x window joption pane yes no option if result joption pane yes option system exit 1
display exit message with yes no option
public string get ftlinstruction stack return ftl instruction stack
returns the quote of the problematic ftl instruction and the ftl stack strace
public object wrapper get object wrapper return object wrapper
returns the object wrapper instance used by this wrapping template model
protected template model handle unknown type object obj throws template model exception if w3 c dom node class null w3 c dom node class is instance obj return wrap dom node obj if jython wrapper null jython obj class is instance obj return jython wrapper wrap obj return super wrap obj
called if an unknown type is passed in
static public template get plain text template string name string content configuration config template template new template name config text block block new text block content template root element block debugger service register template template return template
returns a trivial template one that is just a single block of
protected object convert array object arr final int size array get length arr array list list new array list size for int i 0 i size i list add array get arr i return list
converts an array to a java
public void add object obj list add obj unwrapped list null
adds an arbitrary object to the end of this tt simple sequence tt
public void add boolean b if b add template boolean model true else add template boolean model false
adds a boolean to the end of this tt simple sequence tt by
public void put string key object obj map put key obj unwrapped map null
adds a key value entry to the map
public void put string key boolean b put key b template boolean model true template boolean model false
puts a boolean in the map
public void clear encoding map encoding map clear
clears language to encoding map
public string to string string writer sw new string writer try dump sw catch ioexception ioe throw new runtime exception ioe get message return sw to string
returns a string representing the raw template
static public configuration get default configuration return default config
returns the default singleton configuration object
static public void set default configuration configuration config default config config
sets the configuration object that will be retrieved from future calls
public configuration get configuration return configuration get parent
returns the configuration object associated with this template
public void set directory for template loading file dir throws ioexception template loader tl get template loader if tl instanceof file template loader string path file template loader tl base dir get canonical path if path equals dir get canonical path return set template loader new file template loader dir
set the explicit directory from which to load templates
public void dump print stream ps ps print root element get canonical form
dump the raw template in canonical form
public void set servlet context for template loading object sctxt string path try if path null set template loader template loader class util for name freemarker cache webapp template loader get constructor new class class util for name javax servlet servlet context new instance new object sctxt else set template loader template loader class util for name freemarker cache webapp template loader get constructor new class class util for name javax servlet servlet context string class new instance new object sctxt path catch exception exc throw new runtime exception internal free marker error exc
sets the servlet context from which to load templates
public void dump writer out throws ioexception out write root element get canonical form
dump the raw template in canonical form
public void set class for template loading class clazz string path prefix set template loader new class template loader clazz path prefix
sets a class relative to which we do the
public void add macro macro macro macros put macro get name macro
called by code internally to maintain
public void add import library load ll imports add ll
called by code internally to maintain
public boolean get strict syntax mode return strict syntax
tells whether directives such as if else etcetera
public void set whitespace stripping boolean b whitespace stripping b
sets whether the ftl parser will try to remove
public boolean get whitespace stripping return whitespace stripping
gets whether the ftl parser will try to remove
public void set tag syntax int tag syntax if tag syntax auto detect tag syntax tag syntax square bracket tag syntax tag syntax angle bracket tag syntax throw new illegal argument exception this can only be set to one of three settings configuration auto detect tag syntax configuration angle bracket syntax or configuration sqauare bracket syntax this tag syntax tag syntax
determines the syntax of the template files angle bracket vs square bracket
public template get template string name throws ioexception locale loc get locale return get template name loc get encoding loc true
equivalent to tt get template name this cfg
public template get template string name locale locale throws ioexception return get template name locale get encoding locale true
equivalent to tt get template name locale this cfg
public template get template string name string encoding throws ioexception return get template name get locale encoding true
equivalent to tt get template name this cfg
static public void main string args try transform proc transform from args args proc transform catch illegal argument exception iae system err println iae get message usage catch exception e e print stack trace
a convenient main method for command line invocation
static public void set document builder factory document builder factory doc builder factory node model doc builder factory doc builder factory
sets the dom parser implementation to be used when building node model
public template get template string name locale locale string encoding boolean parse throws ioexception template result cache get template name locale encoding parse if result null throw new file not found exception template name not found return result
retrieves a template specified by a name and locale interpreted using
static public void set error handler error handler error handler node model error handler error handler
sets the error handler to use when parsing the document
public void set default encoding string encoding default encoding encoding
sets the default encoding for converting bytes to characters when
public string get encoding locale loc try for a full name match may include country and variant string charset string encoding map get loc to string if charset null if loc get variant length 0 locale l new locale loc get language loc get country charset string encoding map get l to string if charset null encoding map put loc to string charset charset string encoding map get loc get language if charset null encoding map put loc to string charset return charset null charset default encoding
gets the preferred character encoding for the given locale or the
public void set encoding locale locale string encoding encoding map put locale to string encoding
sets the character set encoding to use for templates of
public void set shared variable string name template model tm variables put name tm
adds a shared variable to the configuration
public set get shared variable names return new hash set variables key set
returns the set containing the names of all defined shared variables
static public void remove comments node node node list children node get child nodes int i 0 int len children get length while i len node child children item i if child has child nodes remove comments child i else if child get node type node comment node node remove child child len else i
recursively removes all comment nodes
public void set shared variable string name object obj throws template model exception set shared variable name get object wrapper wrap obj
adds shared variable to the configuration
static public void remove pis node node node list children node get child nodes int i 0 int len children get length while i len node child children item i if child has child nodes remove pis child i else if child get node type node processing instruction node node remove child child len else i
recursively removes all processing instruction nodes
public void set all shared variables template hash model ex hash throws template model exception template model iterator keys hash keys iterator template model iterator values hash values iterator while keys has next set shared variable template scalar model keys next get as string values next
adds all object in the hash as shared variable to the configuration
static public void use default xpath support xpath support class null jaxen xpath support null try use xalan xpath support catch exception e ignore if xpath support class null try use jaxen xpath support catch exception e ignore
tells the system to use restore the default initial xpath system used by
public template model get shared variable string name return template model variables get name
gets a shared variable