NCBI C++ ToolKit
Public Types | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
CSGConfigUtils Class Reference

Search Toolkit Book for CSGConfigUtils

#include <gui/widgets/seq_graphic/config_utils.hpp>

Public Types

typedef pair< string, stringTKeyValuePair
 
typedef map< string, stringTKeyValuePairs
 

Static Public Member Functions

static string ComposeColorKey (const string &base, const string &key)
 
static string ComposeSizeKey (const string &base, const string &key)
 
static string ComposeDecoKey (const string &base, const string &key)
 
static void ParseProfileString (const string &profile_str, TKeyValuePairs &settings)
 
static string ComposeProfileString (const TKeyValuePairs &settings)
 
static CRegistryReadView GetReadView (const CGuiRegistry &reg, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
 read/readwrite view creation helper methods. More...
 
static CRegistryWriteView GetWriteView (CGuiRegistry &reg, const string &base_key, const string &curr_key, const string &def_key1="", const string &def_key2="", const string &def_key3="")
 
static CRegistryReadView GetColorReadView (const CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
 Create a read view specifically for 'Color' section. More...
 
static CRegistryWriteView GetColorRWView (CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
 
static CRegistryReadView GetSizeReadView (const CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
 
static CRegistryWriteView GetSizeRWView (CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
 
static CRegistryReadView GetTrackProfileReadView (const CGuiRegistry &reg, const string &base_key, const string &key)
 
static CRegistryWriteView GetTrackProfileRWView (CGuiRegistry &reg, const string &base_key, const string &key)
 
static CRegistryReadView GetLabelPosReadView (const CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
 
static CRegistryWriteView GetLabelPosRWView (CGuiRegistry &reg, const string &base_key, const string &sect, const string &key, const string &def_sect="")
 
color accessor and mutator.
static void GetColor (const CRegistryReadView &view, const string &key, CRgbaColor &color)
 
static void SetColor (CRegistryWriteView &view, const string &key, const CRgbaColor &color)
 
font accessor and mutator.
static void GetFont (const CRegistryReadView &view, const string &face_key, const string &size_key, CGlTextureFont &f)
 
static void SetFont (CRegistryWriteView &view, const string &face_key, const string &size_key, const CGlTextureFont &f)
 
static void GetTexFont (const CRegistryReadView &view, const string &face_key, const string &size_key, CGlTextureFont &f)
 
static void SetTexFont (CRegistryWriteView &view, const string &face_key, const string &size_key, const CGlTextureFont &f)
 
five typical keys and default style names.
static const stringColorKey ()
 
static const stringSizeKey ()
 
static const stringDecoKey ()
 
static const stringTrackProfileKey ()
 
static const stringLayoutKey ()
 
static const stringLabelPositionKey ()
 
static const stringGlobalSettingStyleKey ()
 
static const stringUserSettingPrefix ()
 
static const stringDefColorTheme ()
 
static const stringDefSizeLevel ()
 
static const stringDefDecoStyle ()
 
static const stringDefTrackProfile ()
 
static const stringDefLayout ()
 
static const stringDefLabelPosition ()
 
static const stringDefGlobalSettingStyle ()
 

Static Private Member Functions

static bool x_UserFieldToColor (const objects::CUser_field &f, CRgbaColor &c)
 
static void x_ColorToUserField (const CRgbaColor &c, objects::CUser_field &f)
 

Static Private Attributes

static string m_CommonDefaultStyleName = "Default"
 

Detailed Description

Definition at line 45 of file config_utils.hpp.

Member Typedef Documentation

◆ TKeyValuePair

Definition at line 132 of file config_utils.hpp.

◆ TKeyValuePairs

Definition at line 133 of file config_utils.hpp.

Member Function Documentation

◆ ColorKey()

const string & CSGConfigUtils::ColorKey ( )
inlinestatic

◆ ComposeColorKey()

string CSGConfigUtils::ComposeColorKey ( const string base,
const string key 
)
inlinestatic

Definition at line 287 of file config_utils.hpp.

References ColorKey(), and ncbi::grid::netcache::search::fields::key.

◆ ComposeDecoKey()

string CSGConfigUtils::ComposeDecoKey ( const string base,
const string key 
)
inlinestatic

◆ ComposeProfileString()

string CSGConfigUtils::ComposeProfileString ( const TKeyValuePairs settings)
static

◆ ComposeSizeKey()

string CSGConfigUtils::ComposeSizeKey ( const string base,
const string key 
)
inlinestatic

Definition at line 294 of file config_utils.hpp.

References ncbi::grid::netcache::search::fields::key, and SizeKey().

◆ DecoKey()

const string & CSGConfigUtils::DecoKey ( )
inlinestatic

Definition at line 339 of file config_utils.hpp.

References ncbi::grid::netcache::search::fields::key.

Referenced by ComposeDecoKey().

◆ DefColorTheme()

const string & CSGConfigUtils::DefColorTheme ( )
inlinestatic

◆ DefDecoStyle()

const string & CSGConfigUtils::DefDecoStyle ( )
inlinestatic

◆ DefGlobalSettingStyle()

const string & CSGConfigUtils::DefGlobalSettingStyle ( )
inlinestatic

◆ DefLabelPosition()

const string & CSGConfigUtils::DefLabelPosition ( )
inlinestatic

◆ DefLayout()

const string & CSGConfigUtils::DefLayout ( )
inlinestatic

◆ DefSizeLevel()

const string & CSGConfigUtils::DefSizeLevel ( )
inlinestatic

◆ DefTrackProfile()

const string & CSGConfigUtils::DefTrackProfile ( )
inlinestatic

◆ GetColor()

void CSGConfigUtils::GetColor ( const CRegistryReadView view,
const string key,
CRgbaColor color 
)
inlinestatic

◆ GetColorReadView()

CRegistryReadView CSGConfigUtils::GetColorReadView ( const CGuiRegistry reg,
const string base_key,
const string sect,
const string key,
const string def_sect = "" 
)
inlinestatic

Create a read view specifically for 'Color' section.

The method is used for constructing necessary parameters to create a read view for 'Color' section with polymothic data structure. For a given example settings as below: [Base.Section.GeneModel.Default] ShowLabel = true [Base.Section.GeneModel.Default.Color.Color] ; default settings BGColor = white FGColor = green base_key is Base.Section.GeneModel.Default in this example, and key is the current color setting key which is "Color".

Definition at line 192 of file config_utils.hpp.

References ColorKey(), DefColorTheme(), GetReadView(), and ncbi::grid::netcache::search::fields::key.

Referenced by CFeatGlyph::GetCustomColor(), CVcfGlyph::GetCustomColor(), CSeqGraphicConfig::LoadSettings(), CGeneModelConfig::LoadSettings(), CRulerPanel::LoadSettings(), CHistParamsManager::LoadSettings(), CSnpTrack::x_AddSnpsLayout(), CBinsGlyph::x_Draw(), CGeneMarkerGlyph::x_Draw(), CScatterPlotGlyph::x_Draw(), CAlignmentTrack::x_LoadAlignmentSettings(), CSeqGraphicConfig::x_LoadFeatSettings(), CAlignmentTrack::x_LoadMatePairSettings(), CSegmentMapTrack::x_LoadSettings(), CSequenceTrack::x_LoadSettings(), CAlignmentTrack::x_LoadSettings(), and CSixFramesTransTrack::x_LoadSettings().

◆ GetColorRWView()

CRegistryWriteView CSGConfigUtils::GetColorRWView ( CGuiRegistry reg,
const string base_key,
const string sect,
const string key,
const string def_sect = "" 
)
inlinestatic

◆ GetFont()

void CSGConfigUtils::GetFont ( const CRegistryReadView view,
const string face_key,
const string size_key,
CGlTextureFont f 
)
static

◆ GetLabelPosReadView()

CRegistryReadView CSGConfigUtils::GetLabelPosReadView ( const CGuiRegistry reg,
const string base_key,
const string sect,
const string key,
const string def_sect = "" 
)
inlinestatic

◆ GetLabelPosRWView()

CRegistryWriteView CSGConfigUtils::GetLabelPosRWView ( CGuiRegistry reg,
const string base_key,
const string sect,
const string key,
const string def_sect = "" 
)
inlinestatic

◆ GetReadView()

CRegistryReadView CSGConfigUtils::GetReadView ( const CGuiRegistry reg,
const string base_key,
const string curr_key,
const string def_key1 = "",
const string def_key2 = "",
const string def_key3 = "" 
)
static

read/readwrite view creation helper methods.

Create a read view with polymorphic data structure. It returns a read view that overlays several named sub-sections in a given section. Note that the sections listed are presumed to be in decreasing order of importance, so curr_key will overload def_key1 which in turn will overload key_2 and so on. Example: For a given settings as below: [Base.Section.Default] BGColor = white FGColor = black [Base.Section.Gene] FGColor = red The read view created with parameters: GetReadView(reg, "Base.Section", "Gene", "Default") has the effect that settings in Gene section will override the corresponding settings in the Default section. So the FGColor will be red instead of black.

Definition at line 43 of file config_utils.cpp.

References CGuiRegistry::GetReadView().

Referenced by GetColorReadView(), GetLabelPosReadView(), CSequenceTrackFactory::GetSettings(), CSixFramesTransTrackFactory::GetSettings(), CAlignmentTrackFactory::GetSettings(), GetSizeReadView(), GetTrackProfileReadView(), CSeqGraphicConfig::LoadSettings(), CGeneModelConfig::LoadSettings(), CHistParamsManager::LoadSettings(), CGeneModelConfig::LoadSettingsPartial(), CSeqGraphicConfig::LoadSettingStyles(), CAlignmentTrack::x_LoadAlignmentSettings(), CSeqGraphicConfig::x_LoadFeatSettings(), CAlignmentTrack::x_LoadMatePairSettings(), CFeaturePanel::x_LoadSettings(), CSnpTrack::x_LoadSettings(), CSegmentMapTrack::x_LoadSettings(), CSequenceTrack::x_LoadSettings(), CAlignmentTrack::x_LoadSettings(), and CSixFramesTransTrack::x_LoadSettings().

◆ GetSizeReadView()

CRegistryReadView CSGConfigUtils::GetSizeReadView ( const CGuiRegistry reg,
const string base_key,
const string sect,
const string key,
const string def_sect = "" 
)
inlinestatic

◆ GetSizeRWView()

CRegistryWriteView CSGConfigUtils::GetSizeRWView ( CGuiRegistry reg,
const string base_key,
const string sect,
const string key,
const string def_sect = "" 
)
inlinestatic

◆ GetTexFont()

void CSGConfigUtils::GetTexFont ( const CRegistryReadView view,
const string face_key,
const string size_key,
CGlTextureFont f 
)
static

◆ GetTrackProfileReadView()

CRegistryReadView CSGConfigUtils::GetTrackProfileReadView ( const CGuiRegistry reg,
const string base_key,
const string key 
)
inlinestatic

◆ GetTrackProfileRWView()

CRegistryWriteView CSGConfigUtils::GetTrackProfileRWView ( CGuiRegistry reg,
const string base_key,
const string key 
)
inlinestatic

◆ GetWriteView()

CRegistryWriteView CSGConfigUtils::GetWriteView ( CGuiRegistry reg,
const string base_key,
const string curr_key,
const string def_key1 = "",
const string def_key2 = "",
const string def_key3 = "" 
)
static

◆ GlobalSettingStyleKey()

const string & CSGConfigUtils::GlobalSettingStyleKey ( )
inlinestatic

◆ LabelPositionKey()

const string & CSGConfigUtils::LabelPositionKey ( )
inlinestatic

◆ LayoutKey()

const string & CSGConfigUtils::LayoutKey ( )
inlinestatic

◆ ParseProfileString()

void CSGConfigUtils::ParseProfileString ( const string profile_str,
TKeyValuePairs settings 
)
static

◆ SetColor()

void CSGConfigUtils::SetColor ( CRegistryWriteView view,
const string key,
const CRgbaColor color 
)
inlinestatic

◆ SetFont()

void CSGConfigUtils::SetFont ( CRegistryWriteView view,
const string face_key,
const string size_key,
const CGlTextureFont f 
)
static

◆ SetTexFont()

void CSGConfigUtils::SetTexFont ( CRegistryWriteView view,
const string face_key,
const string size_key,
const CGlTextureFont f 
)
static

Definition at line 156 of file config_utils.cpp.

References f, CGlTextureFont::FaceToString(), and CRegistryWriteView::Set().

◆ SizeKey()

const string & CSGConfigUtils::SizeKey ( )
inlinestatic

◆ TrackProfileKey()

const string & CSGConfigUtils::TrackProfileKey ( )
inlinestatic

◆ UserSettingPrefix()

const string & CSGConfigUtils::UserSettingPrefix ( )
inlinestatic

◆ x_ColorToUserField()

void CSGConfigUtils::x_ColorToUserField ( const CRgbaColor c,
objects::CUser_field &  f 
)
staticprivate

◆ x_UserFieldToColor()

bool CSGConfigUtils::x_UserFieldToColor ( const objects::CUser_field &  f,
CRgbaColor c 
)
staticprivate

Member Data Documentation

◆ m_CommonDefaultStyleName

string CSGConfigUtils::m_CommonDefaultStyleName = "Default"
staticprivate

The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:44 2024 by modify_doxy.py rev. 669887