apollo.config
Class Style

java.lang.Object
  extended by apollo.config.Style

public class Style
extends java.lang.Object

A Style is basically config options for a particular data adapter


Field Summary
protected static org.apache.log4j.Logger logger
           
protected  java.util.Hashtable parameters
          General way to store config variables.
 
Constructor Summary
Style(java.lang.String styleFileString)
           
 
Method Summary
 void addAnnotationComment(java.lang.String comment)
          Add a canned annotation comment.
 void addParameter(java.lang.String name, java.lang.String value)
          Whenever we add a new parameter to the style file, we've been adding methods in Style.java to set/get some variable--it's getting annoying.
 boolean addSyntenyResultMenuItem()
          Whether to add a menu item to the result popup menu that will bring up the selected feature as the other species in synteny
 boolean addSyntenySpeciesNumDropdown()
          Whether to add link query radio buttons to synteny adap gui
 void addTranscriptComment(java.lang.String comment)
          Add a canned transcript comment.
static void askRenameGameConfig(java.lang.String oldname, java.lang.String newname)
          7/2005: Special backwards-compatibility hand-holding: game.style and game.tiers were recently renamed fly.style (which imports game.style) and fly.tiers, but some users may still have a private game.style or game.tiers in their .apollo directory.
 boolean checkBoolean(java.lang.String value, java.lang.String variableName)
           
 boolean checkValidColor(java.lang.String colorStr, java.lang.String variableName)
           
 boolean colorAllAnnotsByOwner()
           
 void complain(java.lang.String message)
          Print message to stderr
 boolean databaseHasStyle(java.lang.String db)
          Returns true if have style for db
 boolean doUserTranscriptColouring()
           
 java.lang.String getAllStyleFilesString()
          Returns a string of all the style files used to create this file
 java.awt.Color getAnnotationBackground()
           
 java.awt.Color getAnnotationColor(java.lang.String username)
          Retrieve color for user name; if no color use defaultAnnotationColor.
 java.util.Vector getAnnotationComments()
           
 java.awt.Color getAnnotationLabelColor()
           
 java.lang.String getBandUrl()
           
 java.lang.String getBlixemLocation()
           
 java.util.Vector getChromosomes()
          Returns a vector of chromosome names as strings, null if none given
 java.awt.Color getCoordBackground()
           
 java.awt.Color getCoordForeground()
           
 java.awt.Color getCoordRevcompColor()
           
 boolean getDashSets()
           
 java.util.Vector getDatabaseList()
          If no DatabaseList set in style, defaults to a list of just the DatabaseDefault (which defaults to gadfly if not set)
 java.util.Vector getDatabaseList(java.lang.String queryType)
          Get list of databases with changes possible based on queryType.
 java.lang.String getDatabaseURLField()
          Field in url to replace with database selection
 java.lang.String getDefaultDatabase()
          Used for navigation bar db (for game), also if no database list is provided, getDatabaseList defaults to a list of default db.
 int getDefaultPadding()
           
 java.lang.String getDefaultSyntenyDataAdapterString()
          String of class name for default synteny data adapter to use if none are specified in style file - default is null
protected  DisplayPrefsI getDisplayPrefs()
           
 boolean getDraw3D()
           
 boolean getDrawOutline()
           
 java.awt.Color getEdgematchColor()
           
 int getEdgematchWidth()
           
 java.lang.String getErrors()
           
 int getEvidencePanelHeight()
           
 java.awt.Font getExonDetailEditorSequenceFont()
          Font for amino and dna sequence in EDE
 java.awt.Color getFeatureBackground()
           
 java.awt.Color getFeatureLabelColor()
           
 int getFeatureLoadSize()
           
 java.lang.String getFileName()
           
 int getGeneticCodeNumber()
           
 java.lang.String getGeneUrl()
           
 java.awt.Color getHighlightColor()
           
 boolean getInitialSitesVisibility()
          Initial state for sites visibility (view menu item)
 java.lang.String getLayoutIniFile()
           
 int getLinkPanelSize()
           
 boolean getNaiveCrossSpeciesDataLoading()
          This indicates whether a composite adapter UI is to load cross-species data simply - that is, just read the adapters for each species & the compara sets in turn, and not propagate information from one read to the other.
 java.lang.String getNameAdapter()
           
 boolean getNoStripes()
           
 int getNumberOfSpecies()
          How many species to display in synteny - default is 1
 int getNumberOfSyntenySpecies()
           
 java.awt.Color getOutlineColor()
          Edgematch color is also used for generic outlines around features
 java.lang.String getOverlapDefinition()
           
 java.lang.String getPadLeftURLField()
          Field in url to replace with padding int
 java.lang.String getPadRightURLField()
           
 java.lang.String getParameter(java.lang.String name)
          Returns the last value (even if there are many)
 java.util.Vector getParameterMulti(java.lang.String name)
          Returns the whole vector of values for this parameter
 java.util.Hashtable getParameters()
          Returns hash with only one string for each key.
 java.util.Hashtable getParametersMulti()
          Returns hash of Parameter vectors.
 java.lang.String getProjectName(java.lang.String username)
           
 PropertyScheme getPropertyScheme()
           
 java.lang.String getRangeUrl()
           
 java.util.Vector getResultTag(java.lang.String result_type)
           
 java.util.Hashtable getResultTags()
           
 java.lang.String getScaffoldUrl()
           
 java.awt.Color getSelectionColor()
           
 java.awt.Color getSeqErrorColor()
          Return color for showing genomic sequencing errors or frameshifts
 java.awt.Color getSeqGapColor()
           
 java.awt.Color getSequenceColor()
           
 java.lang.String getSeqUrl()
           
 boolean getShowAnnotations()
           
 boolean getShowResults()
           
 int getSingleSpeciesPanelSize()
           
 Style getStyleForDb(java.lang.String db)
          Returns null if cant make style for db
 java.lang.String getSyntenyDatabaseForSpecies(java.lang.String species)
          Database species maps to as proscribed by SpeciesToDatabase entries.
 java.util.List getSyntenyLinkOrder()
           
 java.util.List getSyntenySpeciesAndLinkOrder()
          List of Strings which are the species/names/tags of sub-adapters.
 java.util.HashMap getSyntenySpeciesNames()
          Maps names (Name.Mouse) to adapter label/logical name (Mus Musculus).
 java.util.List getSyntenySpeciesOrder()
          Same as syntenySpeciesAndLinkOrder(Strings) minus links(denoted by "Compara") eg "Name.Mouse", "Name.Human" If synteny species names not explicitly set(ensj,gff), and useGenericSyntenySpecies is true, make a generic list up to getNumberOfSpecies (Species1,Species2,...SpeciesN) (game)
 java.util.HashMap getSyntenySpeciesProperties()
          This maps these kinds of strings from the style file: "Species.Mouse.DataAdapter" -> "apollo.dataadapter.ensj.AnnotationEnsJAdapter" So basically its where the dataadapter is
 java.lang.String getSyntenySpeciesString(int i)
           
 java.awt.Color getTaggedColor()
          Return color for boxing tagged results
 java.lang.String getTiersFile()
           
 java.util.Vector getTranscriptComments()
           
 boolean getTranscriptSymbolEditable()
          Whether transcript symbol/name is editable in annot info, default true
 boolean igbHttpConnectionEnabled()
           
 boolean initialLockedScrolling()
          Whether synteny's initial state is to lock scrolling.
 boolean initialShiftForLockedZooming()
          Whether synteny should lock zooming with a shift or vice versa, initially.
 boolean internalMode()
           
 boolean isEditingEnabled()
           
 boolean isSuperUser(java.lang.String name)
           
 boolean queryForNamesOnSplit()
          added BY TAIR someday we may need to change this to something more fitting than a boolean, but for now it is binary
 void readStyle(java.io.File styleFile)
          Saves error messages for later checking
 void readStyle(java.lang.String styleFilename)
           
 void removeParameter(java.lang.String key)
           
 void replaceParameter(java.lang.String key, java.lang.String value)
           
 boolean seqErrorEditingIsEnabled()
           
 void setAnnotationBackground(java.awt.Color color)
           
 void setAnnotationLabelColor(java.awt.Color col)
           
 void setCoordBackground(java.awt.Color col)
           
 void setCoordForeground(java.awt.Color col)
           
 void setCoordRevcompColor(java.awt.Color col)
           
 void setDraw3D(boolean state)
           
 void setDrawOutline(boolean state)
           
 void setEdgematchColor(java.awt.Color col)
           
 void setEditingEnabled(boolean editingEnabled)
           
 void setFeatureBackground(java.awt.Color col)
           
 void setFeatureLabelColor(java.awt.Color col)
           
 void setLocalNavigationManagerEnabled(java.lang.Boolean enable)
           
 void setSequenceColor(java.awt.Color col)
           
 void setShowAnnotations(boolean showAnnotations)
           
 void setShowResults(boolean showResults)
           
 void setStyleFile(java.lang.String name)
           
 void setTiersFile(java.lang.String tiersFile)
           
 boolean showDbXRefTable()
          Whether to show db cross reference table in annot info
 boolean showEvalOfPeptide()
           
 boolean showFinishedCheckbox()
          Whether to show/use finished checkbox in annot info transcript panel
 boolean showIdField()
          Whether gene id field is displayed in annot info
 boolean showIsDicistronicCheckbox()
          Whether to show, and therefore use, the "Is Dicistronic?" checkbox in annot info editor
 boolean showIsProbCheckbox()
           
 boolean showOwnershipAnnotMenuItem()
           
 boolean showReplaceStopCheckbox()
           
 boolean showTranscriptFinishedAnnotMenuItem()
           
 boolean syntenyLinksAreGeneToGene()
           
 java.lang.String toString()
           
 boolean transactionsAreInGameFile()
           
 boolean translationalFrameShiftEditingIsEnabled()
           
 boolean useOpaqueLinks()
          If the links between individual species' features are drawn opaquely then rendering of the panels as a whole will be faster.
 boolean writeStyle(java.io.File styleFile)
          Writes the style data to a file.
 void writeStyle(java.lang.String styleFilename)
          Writes the style data to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

parameters

protected java.util.Hashtable parameters
General way to store config variables. We could start replacing the special-purpose variables and methods with add/getProperty.

Constructor Detail

Style

public Style(java.lang.String styleFileString)
Method Detail

setStyleFile

public void setStyleFile(java.lang.String name)

getAllStyleFilesString

public java.lang.String getAllStyleFilesString()
Returns a string of all the style files used to create this file


readStyle

public void readStyle(java.lang.String styleFilename)

readStyle

public void readStyle(java.io.File styleFile)
Saves error messages for later checking


writeStyle

public void writeStyle(java.lang.String styleFilename)
Writes the style data to a file.

Parameters:
styleFilename - - String for the name of the style file to write to

writeStyle

public boolean writeStyle(java.io.File styleFile)
Writes the style data to a file.

Parameters:
styleFile - - File for the style file to write to
Returns:
true if successful

complain

public void complain(java.lang.String message)
Print message to stderr


getErrors

public java.lang.String getErrors()

queryForNamesOnSplit

public boolean queryForNamesOnSplit()
added BY TAIR someday we may need to change this to something more fitting than a boolean, but for now it is binary


askRenameGameConfig

public static void askRenameGameConfig(java.lang.String oldname,
                                       java.lang.String newname)
7/2005: Special backwards-compatibility hand-holding: game.style and game.tiers were recently renamed fly.style (which imports game.style) and fly.tiers, but some users may still have a private game.style or game.tiers in their .apollo directory. Ask if they want to rename it to the new name.


checkValidColor

public boolean checkValidColor(java.lang.String colorStr,
                               java.lang.String variableName)

getBlixemLocation

public java.lang.String getBlixemLocation()

checkBoolean

public boolean checkBoolean(java.lang.String value,
                            java.lang.String variableName)

getTiersFile

public java.lang.String getTiersFile()

setTiersFile

public void setTiersFile(java.lang.String tiersFile)

getLayoutIniFile

public java.lang.String getLayoutIniFile()

getShowAnnotations

public boolean getShowAnnotations()

setShowAnnotations

public void setShowAnnotations(boolean showAnnotations)

getShowResults

public boolean getShowResults()

setShowResults

public void setShowResults(boolean showResults)

getEdgematchWidth

public int getEdgematchWidth()

doUserTranscriptColouring

public boolean doUserTranscriptColouring()

colorAllAnnotsByOwner

public boolean colorAllAnnotsByOwner()

getDraw3D

public boolean getDraw3D()

setDraw3D

public void setDraw3D(boolean state)

getNoStripes

public boolean getNoStripes()

getEvidencePanelHeight

public int getEvidencePanelHeight()

isEditingEnabled

public boolean isEditingEnabled()

setEditingEnabled

public void setEditingEnabled(boolean editingEnabled)

setLocalNavigationManagerEnabled

public void setLocalNavigationManagerEnabled(java.lang.Boolean enable)

getChromosomes

public java.util.Vector getChromosomes()
Returns a vector of chromosome names as strings, null if none given


getDrawOutline

public boolean getDrawOutline()

setDrawOutline

public void setDrawOutline(boolean state)

getDatabaseList

public java.util.Vector getDatabaseList()
If no DatabaseList set in style, defaults to a list of just the DatabaseDefault (which defaults to gadfly if not set)


getDatabaseList

public java.util.Vector getDatabaseList(java.lang.String queryType)
Get list of databases with changes possible based on queryType. FOR NOW, database list for sequence queries doesn't include database r3.2


getDefaultDatabase

public java.lang.String getDefaultDatabase()
Used for navigation bar db (for game), also if no database list is provided, getDatabaseList defaults to a list of default db. defaultDatabase defaults to "gadfly" if not provided.


getAnnotationComments

public java.util.Vector getAnnotationComments()

getTranscriptComments

public java.util.Vector getTranscriptComments()

addAnnotationComment

public void addAnnotationComment(java.lang.String comment)
Add a canned annotation comment.

Parameters:
comment - - String to be added

addTranscriptComment

public void addTranscriptComment(java.lang.String comment)
Add a canned transcript comment.

Parameters:
comment - - String to be added

internalMode

public boolean internalMode()

getProjectName

public java.lang.String getProjectName(java.lang.String username)

getAnnotationColor

public java.awt.Color getAnnotationColor(java.lang.String username)
Retrieve color for user name; if no color use defaultAnnotationColor. Note that this is called only if doUserTranscriptColouring is true and we're in internal (not public) mode.


getTaggedColor

public java.awt.Color getTaggedColor()
Return color for boxing tagged results


getSeqErrorColor

public java.awt.Color getSeqErrorColor()
Return color for showing genomic sequencing errors or frameshifts


getFeatureLoadSize

public int getFeatureLoadSize()

getGeneUrl

public java.lang.String getGeneUrl()

getBandUrl

public java.lang.String getBandUrl()

getScaffoldUrl

public java.lang.String getScaffoldUrl()

getSeqUrl

public java.lang.String getSeqUrl()

getRangeUrl

public java.lang.String getRangeUrl()

getDashSets

public boolean getDashSets()

getAnnotationBackground

public java.awt.Color getAnnotationBackground()

setAnnotationBackground

public void setAnnotationBackground(java.awt.Color color)

getFeatureBackground

public java.awt.Color getFeatureBackground()

setFeatureBackground

public void setFeatureBackground(java.awt.Color col)

getEdgematchColor

public java.awt.Color getEdgematchColor()

setEdgematchColor

public void setEdgematchColor(java.awt.Color col)

getOutlineColor

public java.awt.Color getOutlineColor()
Edgematch color is also used for generic outlines around features


getFeatureLabelColor

public java.awt.Color getFeatureLabelColor()

setFeatureLabelColor

public void setFeatureLabelColor(java.awt.Color col)

getAnnotationLabelColor

public java.awt.Color getAnnotationLabelColor()

setAnnotationLabelColor

public void setAnnotationLabelColor(java.awt.Color col)

getCoordBackground

public java.awt.Color getCoordBackground()

setCoordBackground

public void setCoordBackground(java.awt.Color col)

getCoordForeground

public java.awt.Color getCoordForeground()

setCoordForeground

public void setCoordForeground(java.awt.Color col)

getCoordRevcompColor

public java.awt.Color getCoordRevcompColor()

setCoordRevcompColor

public void setCoordRevcompColor(java.awt.Color col)

getSequenceColor

public java.awt.Color getSequenceColor()

setSequenceColor

public void setSequenceColor(java.awt.Color col)

getHighlightColor

public java.awt.Color getHighlightColor()

getSelectionColor

public java.awt.Color getSelectionColor()

getSeqGapColor

public java.awt.Color getSeqGapColor()

getDisplayPrefs

protected DisplayPrefsI getDisplayPrefs()

getNameAdapter

public java.lang.String getNameAdapter()

getOverlapDefinition

public java.lang.String getOverlapDefinition()

getFileName

public java.lang.String getFileName()

getExonDetailEditorSequenceFont

public java.awt.Font getExonDetailEditorSequenceFont()
Font for amino and dna sequence in EDE


getResultTag

public java.util.Vector getResultTag(java.lang.String result_type)

getResultTags

public java.util.Hashtable getResultTags()

getDatabaseURLField

public java.lang.String getDatabaseURLField()
Field in url to replace with database selection


getPadLeftURLField

public java.lang.String getPadLeftURLField()
Field in url to replace with padding int


getPadRightURLField

public java.lang.String getPadRightURLField()

getDefaultPadding

public int getDefaultPadding()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isSuperUser

public boolean isSuperUser(java.lang.String name)

getPropertyScheme

public PropertyScheme getPropertyScheme()

getSingleSpeciesPanelSize

public int getSingleSpeciesPanelSize()

getLinkPanelSize

public int getLinkPanelSize()

getInitialSitesVisibility

public boolean getInitialSitesVisibility()
Initial state for sites visibility (view menu item)


addSyntenySpeciesNumDropdown

public boolean addSyntenySpeciesNumDropdown()
Whether to add link query radio buttons to synteny adap gui


addSyntenyResultMenuItem

public boolean addSyntenyResultMenuItem()
Whether to add a menu item to the result popup menu that will bring up the selected feature as the other species in synteny


syntenyLinksAreGeneToGene

public boolean syntenyLinksAreGeneToGene()

initialShiftForLockedZooming

public boolean initialShiftForLockedZooming()
Whether synteny should lock zooming with a shift or vice versa, initially. Default: true


initialLockedScrolling

public boolean initialLockedScrolling()
Whether synteny's initial state is to lock scrolling. Default false


getNaiveCrossSpeciesDataLoading

public boolean getNaiveCrossSpeciesDataLoading()
This indicates whether a composite adapter UI is to load cross-species data simply - that is, just read the adapters for each species & the compara sets in turn, and not propagate information from one read to the other.


useOpaqueLinks

public boolean useOpaqueLinks()
If the links between individual species' features are drawn opaquely then rendering of the panels as a whole will be faster.


getDefaultSyntenyDataAdapterString

public java.lang.String getDefaultSyntenyDataAdapterString()
String of class name for default synteny data adapter to use if none are specified in style file - default is null


getNumberOfSpecies

public int getNumberOfSpecies()
How many species to display in synteny - default is 1


getSyntenySpeciesNames

public java.util.HashMap getSyntenySpeciesNames()
Maps names (Name.Mouse) to adapter label/logical name (Mus Musculus). if useGenericSyntenySpecies is true just maps "Species1" -> "Species1", "Species2" -> "Species2", ... to work with SyntenyAdapter


getSyntenySpeciesProperties

public java.util.HashMap getSyntenySpeciesProperties()
This maps these kinds of strings from the style file: "Species.Mouse.DataAdapter" -> "apollo.dataadapter.ensj.AnnotationEnsJAdapter" So basically its where the dataadapter is


getSyntenySpeciesOrder

public java.util.List getSyntenySpeciesOrder()
Same as syntenySpeciesAndLinkOrder(Strings) minus links(denoted by "Compara") eg "Name.Mouse", "Name.Human" If synteny species names not explicitly set(ensj,gff), and useGenericSyntenySpecies is true, make a generic list up to getNumberOfSpecies (Species1,Species2,...SpeciesN) (game)


getSyntenyLinkOrder

public java.util.List getSyntenyLinkOrder()

getSyntenySpeciesString

public java.lang.String getSyntenySpeciesString(int i)

getNumberOfSyntenySpecies

public int getNumberOfSyntenySpecies()

getSyntenySpeciesAndLinkOrder

public java.util.List getSyntenySpeciesAndLinkOrder()
List of Strings which are the species/names/tags of sub-adapters. This is not a list of the adapters themselves. (eg "Name.Species1","Name.Species2",...) If UseGenericSyntenySpecies is true, just return the generic getSyntenySpeciesOrder Species1 thru SpeciesN with no link names (assume no link adapters - game)


getSyntenyDatabaseForSpecies

public java.lang.String getSyntenyDatabaseForSpecies(java.lang.String species)
Database species maps to as proscribed by SpeciesToDatabase entries. This is for synteny links to other species (used in game synteny). Returns null (and prints err msg) if no such mapping.


databaseHasStyle

public boolean databaseHasStyle(java.lang.String db)
Returns true if have style for db


getStyleForDb

public Style getStyleForDb(java.lang.String db)
Returns null if cant make style for db


showIdField

public boolean showIdField()
Whether gene id field is displayed in annot info


getTranscriptSymbolEditable

public boolean getTranscriptSymbolEditable()
Whether transcript symbol/name is editable in annot info, default true


showIsDicistronicCheckbox

public boolean showIsDicistronicCheckbox()
Whether to show, and therefore use, the "Is Dicistronic?" checkbox in annot info editor


showEvalOfPeptide

public boolean showEvalOfPeptide()

showIsProbCheckbox

public boolean showIsProbCheckbox()

showFinishedCheckbox

public boolean showFinishedCheckbox()
Whether to show/use finished checkbox in annot info transcript panel


showDbXRefTable

public boolean showDbXRefTable()
Whether to show db cross reference table in annot info


showReplaceStopCheckbox

public boolean showReplaceStopCheckbox()

translationalFrameShiftEditingIsEnabled

public boolean translationalFrameShiftEditingIsEnabled()

seqErrorEditingIsEnabled

public boolean seqErrorEditingIsEnabled()

showOwnershipAnnotMenuItem

public boolean showOwnershipAnnotMenuItem()

showTranscriptFinishedAnnotMenuItem

public boolean showTranscriptFinishedAnnotMenuItem()

igbHttpConnectionEnabled

public boolean igbHttpConnectionEnabled()

transactionsAreInGameFile

public boolean transactionsAreInGameFile()

getGeneticCodeNumber

public int getGeneticCodeNumber()

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value)
Whenever we add a new parameter to the style file, we've been adding methods in Style.java to set/get some variable--it's getting annoying. Parameters give us a general-purpose, extensible way to set key=value(s) pairs in the style. The default can be set here (which, of course, means we can't set it for brand-new parameters that are not yet known) or by the caller. For case-insensitivity, keys are stored as lowercase and getParameter converts the request to lowercase before looking for it.


removeParameter

public void removeParameter(java.lang.String key)

replaceParameter

public void replaceParameter(java.lang.String key,
                             java.lang.String value)

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the last value (even if there are many)


getParameterMulti

public java.util.Vector getParameterMulti(java.lang.String name)
Returns the whole vector of values for this parameter


getParameters

public java.util.Hashtable getParameters()
Returns hash with only one string for each key.


getParametersMulti

public java.util.Hashtable getParametersMulti()
Returns hash of Parameter vectors.