org.emboss.jemboss.gui.form
Class SectionPanel

java.lang.Object
  extended byorg.emboss.jemboss.gui.form.SectionPanel

public class SectionPanel
extends java.lang.Object

Responsible for displaying the Jemboss application form generated from the ACD file. This also handles events related to dependent parameters.


Field Summary
private  AlignFormat af
          alignment format
static int ajaxLength
          sequence length
static boolean ajaxProtein
          sequence type
static float ajaxWeight
          sequence weight
private  java.lang.String appName
          application name
private  javax.swing.JCheckBox[] checkBox
          boolean fields
private  java.lang.String[] db
          available databases
private  javax.swing.JFrame f
          Jemboss frame
private  JembossComboPopup[] fieldOption
          checkbox popup field for list and select
private  ListFilePanel[] filelist
          list file panel
private  SetInFileCard[] inSeq
          input sequence field
private  InputSequenceAttributes[] inSeqAttr
          input sequence attributes
private  boolean isAdd
          true if the additional section
private  boolean isAdv
          true if the advanced section
private  boolean isInp
          true if the input section
private  boolean isOut
          true if the output section
private  boolean isReq
          true if the required section
private  boolean isShadedGUI
          true if shading disabled fields, otherwise they are removed from the form
private  javax.swing.Box[] lab
          field label container
static java.awt.Color labelColor
          label colour
static java.awt.Font labfont
          label font
static java.awt.Font labfont2
          small label font
private  int maxSectionWidth
          maximum width of the form
private  javax.swing.JList[] multiOption
          multiple option field for list and select
private  JembossParams mysettings
          jemboss properties
private  int nf
          field number to start from
private  int numofFields
          number of fields in the ACD
private  javax.swing.JPanel p3
          Jemboss form panel
private  ParseAcd parseAcd
          ACD parser for the application selected
private  javax.swing.JTextField[] rangeField
          range field
private  ReportFormat rf
          report format
private  javax.swing.Box sectionBox
          container for this ACD section
private  javax.swing.JPanel sectionPane
          container for this ACD section
private  TextFieldSink[] textf
          text field sink
private  TextFieldFloat[] textFloat
          float field sink
private  TextFieldInt[] textInt
          integer field sink
private  boolean withSoap
          true if in client-server mode
 
Constructor Summary
protected SectionPanel(javax.swing.JFrame f, javax.swing.JPanel p3, javax.swing.Box fieldPane, ParseAcd parseAcd, int nff, TextFieldSink[] textf, TextFieldInt[] textInt, TextFieldFloat[] textFloat, javax.swing.JTextField[] rangeField, javax.swing.JCheckBox[] checkBox, InputSequenceAttributes[] inSeqAttr, JembossComboPopup[] fieldOption, javax.swing.JList[] multiOption, SetInFileCard[] inSeq, ListFilePanel[] filelist, java.lang.String[] db, java.lang.String des, javax.swing.Box[] lab, int numofFields, JembossParams mysettings, boolean withSoap, java.lang.String[] envp)
           
 
Method Summary
private  void checkDependents(javax.swing.Box section, java.lang.String[] envp)
          Checks for dependent variables and adds in action listeners
private  boolean cygwinSeqAttr(java.lang.String fc, java.lang.String[] envp, java.lang.String att)
          Cygwin uses infoseq to get sequence length and type and uses infoalign to get the sequence weight.
protected  AlignFormat getAlignFormat()
          Get the alignment format
protected  int getFieldNum()
          Get the current field
private  java.lang.String getMinMaxDefault(java.lang.String min, java.lang.String max, java.lang.String def, int nfield)
          Get the min, max and default values for a field in the ACD as a string representation in the form (min: max: default:)
protected  ReportFormat getReportFormat()
          Get the report format
protected  javax.swing.Box getSectionBox()
          get the box or this section
protected  javax.swing.JPanel getSectionPanel()
          get the panel for this section
protected  boolean isAdditionalSection()
           
protected  boolean isAdvancedSection()
           
protected  boolean isAlignFormat()
          Determine if alignment formats are used in the EMBOSS program
protected  boolean isInputSection()
           
protected  boolean isOutputSection()
           
protected  boolean isReportFormat()
          Determine if report formats are used in the EMBOSS program
protected  boolean isRequiredSection()
           
private  void resolveDependents(int nod, Dependent[] dep, java.lang.String textVal, java.lang.String varName)
          Given an ACD variable and the value it takes, resolve any dependent attribute values.
private  void sectionResize(javax.swing.JPanel p)
          Resize the section panel
private  void setAppTitle(java.lang.String des, javax.swing.JPanel p3)
          Set the application title panel
private  void setShadingAndVisibility(java.awt.Component c, boolean useThis, int field)
          Set the shading or visibility of a component
private  boolean updateBeginEnd(java.lang.String s, java.lang.String e)
          Check sbeg and send values before updating in the panel to avoid overriding user selection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textf

private TextFieldSink[] textf
text field sink


textInt

private TextFieldInt[] textInt
integer field sink


textFloat

private TextFieldFloat[] textFloat
float field sink


rangeField

private javax.swing.JTextField[] rangeField
range field


checkBox

private javax.swing.JCheckBox[] checkBox
boolean fields


inSeqAttr

private InputSequenceAttributes[] inSeqAttr
input sequence attributes


filelist

private ListFilePanel[] filelist
list file panel


fieldOption

private JembossComboPopup[] fieldOption
checkbox popup field for list and select


multiOption

private javax.swing.JList[] multiOption
multiple option field for list and select


inSeq

private SetInFileCard[] inSeq
input sequence field


lab

private javax.swing.Box[] lab
field label container


db

private java.lang.String[] db
available databases


parseAcd

private ParseAcd parseAcd
ACD parser for the application selected


numofFields

private int numofFields
number of fields in the ACD


nf

private int nf
field number to start from


ajaxLength

public static int ajaxLength
sequence length


ajaxWeight

public static float ajaxWeight
sequence weight


ajaxProtein

public static boolean ajaxProtein
sequence type


withSoap

private boolean withSoap
true if in client-server mode


appName

private java.lang.String appName
application name


p3

private javax.swing.JPanel p3
Jemboss form panel


sectionPane

private javax.swing.JPanel sectionPane
container for this ACD section


sectionBox

private javax.swing.Box sectionBox
container for this ACD section


mysettings

private JembossParams mysettings
jemboss properties


isInp

private boolean isInp
true if the input section


isReq

private boolean isReq
true if the required section


isAdv

private boolean isAdv
true if the advanced section


isAdd

private boolean isAdd
true if the additional section


isOut

private boolean isOut
true if the output section


isShadedGUI

private boolean isShadedGUI
true if shading disabled fields, otherwise they are removed from the form


labelColor

public static java.awt.Color labelColor
label colour


labfont

public static java.awt.Font labfont
label font


labfont2

public static java.awt.Font labfont2
small label font


maxSectionWidth

private final int maxSectionWidth
maximum width of the form

See Also:
Constant Field Values

f

private javax.swing.JFrame f
Jemboss frame


rf

private ReportFormat rf
report format


af

private AlignFormat af
alignment format

Constructor Detail

SectionPanel

protected SectionPanel(javax.swing.JFrame f,
                       javax.swing.JPanel p3,
                       javax.swing.Box fieldPane,
                       ParseAcd parseAcd,
                       int nff,
                       TextFieldSink[] textf,
                       TextFieldInt[] textInt,
                       TextFieldFloat[] textFloat,
                       javax.swing.JTextField[] rangeField,
                       javax.swing.JCheckBox[] checkBox,
                       InputSequenceAttributes[] inSeqAttr,
                       JembossComboPopup[] fieldOption,
                       javax.swing.JList[] multiOption,
                       SetInFileCard[] inSeq,
                       ListFilePanel[] filelist,
                       java.lang.String[] db,
                       java.lang.String des,
                       javax.swing.Box[] lab,
                       int numofFields,
                       JembossParams mysettings,
                       boolean withSoap,
                       java.lang.String[] envp)
Parameters:
f - Jemboss frame
p3 - JPanel ACD form panel
fieldPane - containing all the fields
parseAcd - representing the ACD file to display as a form
nff - field number
textf - text fields in the form
textInt - integer fields in the form
textFloat - float fields in the form
rangeField - ranges in the form
checkBox - for the boolean switches
inSeqAttr - the input sequence(s) attributes
fieldOption - for the list/selection data types
multiOption - for multiple selection lists
inSeq - the input sequence(s)
filelist - list file panel
db - String array containing the databases
des - String containing the one line description for the application
lab - Box for all the component labels
numofFields - total number of fields
mysettings - jemboss properties
withSoap - true if using a soap server
Method Detail

getReportFormat

protected ReportFormat getReportFormat()
Get the report format


isReportFormat

protected boolean isReportFormat()
Determine if report formats are used in the EMBOSS program

Returns:
true if a report format is used

getAlignFormat

protected AlignFormat getAlignFormat()
Get the alignment format


isAlignFormat

protected boolean isAlignFormat()
Determine if alignment formats are used in the EMBOSS program

Returns:
true if a alignment format is used

getSectionPanel

protected javax.swing.JPanel getSectionPanel()
get the panel for this section


getSectionBox

protected javax.swing.Box getSectionBox()
get the box or this section


isInputSection

protected boolean isInputSection()
Returns:
true if the input section

isOutputSection

protected boolean isOutputSection()
Returns:
true if the output section

isRequiredSection

protected boolean isRequiredSection()
Returns:
true if the required section

isAdvancedSection

protected boolean isAdvancedSection()
Returns:
true if the advanced section

isAdditionalSection

protected boolean isAdditionalSection()
Returns:
true if the additional section

getFieldNum

protected int getFieldNum()
Get the current field

Returns:
current field number

setAppTitle

private void setAppTitle(java.lang.String des,
                         javax.swing.JPanel p3)
Set the application title panel

Parameters:
des - short description of the program
p3 - JPanel for the ACD form

getMinMaxDefault

private java.lang.String getMinMaxDefault(java.lang.String min,
                                          java.lang.String max,
                                          java.lang.String def,
                                          int nfield)
Get the min, max and default values for a field in the ACD as a string representation in the form (min: max: default:)

Parameters:
min - minimum value for parameter
max - maximum value for parameter
def - default value for parameter
nfield - field number in ACD
Returns:
string of (min: max: default:) if specified

checkDependents

private void checkDependents(javax.swing.Box section,
                             java.lang.String[] envp)
Checks for dependent variables and adds in action listeners

Parameters:
section - form container for parameters

cygwinSeqAttr

private boolean cygwinSeqAttr(java.lang.String fc,
                              java.lang.String[] envp,
                              java.lang.String att)
Cygwin uses infoseq to get sequence length and type and uses infoalign to get the sequence weight.


updateBeginEnd

private boolean updateBeginEnd(java.lang.String s,
                               java.lang.String e)
Check sbeg and send values before updating in the panel to avoid overriding user selection

Parameters:
s - start
e - end
Returns:
true to automatically update

resolveDependents

private void resolveDependents(int nod,
                               Dependent[] dep,
                               java.lang.String textVal,
                               java.lang.String varName)
Given an ACD variable and the value it takes, resolve any dependent attribute values.

Parameters:
nod - number of dependent values
textVal - value of variable
varName - variable name

setShadingAndVisibility

private void setShadingAndVisibility(java.awt.Component c,
                                     boolean useThis,
                                     int field)
Set the shading or visibility of a component

Parameters:
c - component
useThis - true if enabled/visible
field - field number in the ACD

sectionResize

private void sectionResize(javax.swing.JPanel p)
Resize the section panel

Parameters:
p - section panel