CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
FWCollectionSummaryModelCellRenderer Class Reference

#include <Fireworks/Core/interface/FWCollectionSummaryModelCellRenderer.h>

Inheritance diagram for FWCollectionSummaryModelCellRenderer:
FWTextTableCellRenderer FWTableCellRendererBase

Public Types

enum  ClickHit { kMiss, kHitCheck, kHitColor }
 
- Public Types inherited from FWTextTableCellRenderer
enum  Justify { kJustifyLeft, kJustifyRight, kJustifyCenter }
 

Public Member Functions

ClickHit clickHit (int iX, int iY) const
 
void draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
 
 FWCollectionSummaryModelCellRenderer (const TGGC *iContext, const TGGC *iSelectContext)
 
void setData (const FWEventItem *iItem, int iIndex)
 
UInt_t width () const override
 returns the minimum width of the cell to which the renderer is representing More...
 
 ~FWCollectionSummaryModelCellRenderer () override
 
- Public Member Functions inherited from FWTextTableCellRenderer
const std::string & data ()
 
void draw (Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
 
const TGFont * font () const
 
 FWTextTableCellRenderer (const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
 
const TGGC * graphicsContext () const
 
UInt_t height () const override
 returns the minimum height of the cell to which the renderer is representing More...
 
const TGGC * highlightContext () const
 
bool selected ()
 
void setData (const char *, bool isSelected)
 
void setData (const std::string &, bool isSelected)
 
void setGraphicsContext (const TGGC *iContext)
 
void setHighlightContext (const TGGC *context)
 
void setJustify (Justify)
 
UInt_t width () const override
 returns the minimum width of the cell to which the renderer is representing More...
 
 ~FWTextTableCellRenderer () override
 
- Public Member Functions inherited from FWTableCellRendererBase
virtual void buttonEvent (Event_t *iClickEvent, int iRelClickX, int iRelClickY)
 
 FWTableCellRendererBase ()
 
virtual ~FWTableCellRendererBase ()
 

Private Member Functions

 FWCollectionSummaryModelCellRenderer (const FWCollectionSummaryModelCellRenderer &)=delete
 
const FWCollectionSummaryModelCellRendereroperator= (const FWCollectionSummaryModelCellRenderer &)=delete
 

Private Attributes

FWCheckBoxIconm_checkBox
 
FWColorBoxIconm_colorBox
 
TGGC * m_colorContext
 

Additional Inherited Members

- Static Public Member Functions inherited from FWTextTableCellRenderer
static const TGGC & getDefaultGC ()
 
static const TGGC & getDefaultHighlightGC ()
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 31 of file FWCollectionSummaryModelCellRenderer.h.

Member Enumeration Documentation

◆ ClickHit

Enumerator
kMiss 
kHitCheck 
kHitColor 

Definition at line 36 of file FWCollectionSummaryModelCellRenderer.h.

Constructor & Destructor Documentation

◆ FWCollectionSummaryModelCellRenderer() [1/2]

FWCollectionSummaryModelCellRenderer::FWCollectionSummaryModelCellRenderer ( const TGGC *  iContext,
const TGGC *  iSelectContext 
)

Definition at line 37 of file FWCollectionSummaryModelCellRenderer.cc.

38  : FWTextTableCellRenderer(iGC, iSelectContext),
41  GCValues_t t = *(iGC->GetAttributes());
42  m_colorContext = gClient->GetResourcePool()->GetGCPool()->GetGC(&t, kTRUE);
44 }

References m_colorBox, m_colorContext, FWColorBoxIcon::setColor(), and OrderedSet::t.

◆ ~FWCollectionSummaryModelCellRenderer()

FWCollectionSummaryModelCellRenderer::~FWCollectionSummaryModelCellRenderer ( )
override

Definition at line 51 of file FWCollectionSummaryModelCellRenderer.cc.

51  {
52  delete m_colorBox;
53  delete m_checkBox;
54  gClient->GetResourcePool()->GetGCPool()->FreeGC(m_colorContext->GetGC());
55 }

References m_checkBox, m_colorBox, and m_colorContext.

◆ FWCollectionSummaryModelCellRenderer() [2/2]

FWCollectionSummaryModelCellRenderer::FWCollectionSummaryModelCellRenderer ( const FWCollectionSummaryModelCellRenderer )
privatedelete

Member Function Documentation

◆ clickHit()

FWCollectionSummaryModelCellRenderer::ClickHit FWCollectionSummaryModelCellRenderer::clickHit ( int  iX,
int  iY 
) const

Definition at line 100 of file FWCollectionSummaryModelCellRenderer.cc.

100  {
101  if (iY < 0 || iY > static_cast<int>(kIconSize)) {
102  return kMiss;
103  }
104  if (iX >= 0 && iX <= static_cast<int>(kIconSize)) {
105  return kHitCheck;
106  }
107  if (iX >= static_cast<int>(kIconSize + kSeparation) && iX <= static_cast<int>(kIconSize + kSeparation + kIconSize)) {
108  return kHitColor;
109  }
110  return kMiss;
111 }

References kHitCheck, kHitColor, kIconSize, kMiss, and kSeparation.

Referenced by FWCollectionSummaryTableManager::buttonReleasedInRowHeader().

◆ draw()

void FWCollectionSummaryModelCellRenderer::draw ( Drawable_t  iID,
int  iX,
int  iY,
unsigned int  iWidth,
unsigned int  iHeight 
)
overridevirtual

Called to draw a particular cell: arguments iID: the id for the drawable in the window. Needed in order to do calls to gVirtualX or to TGFont iX: screen x position that the cell drawing area starts iY: screen y position that the cell drawing area starts iWidth: width (x dimension) of cell drawing area. May be larger than value returned from width() iHeight: height (x dimension) of cell drawing area. May be larger than value returned from height()

Implements FWTableCellRendererBase.

Definition at line 77 of file FWCollectionSummaryModelCellRenderer.cc.

78  {
79  int dY = (iHeight - kIconSize) / 2;
80  m_checkBox->draw(iID, graphicsContext()->GetGC(), iX, iY + dY);
81  m_colorBox->draw(iID, graphicsContext()->GetGC(), iX + kIconSize + kSeparation, iY + dY);
84  iY,
86  iHeight);
87  return;
88 }

References FWBoxIconBase::draw(), FWTextTableCellRenderer::draw(), FWTextTableCellRenderer::graphicsContext(), kIconSize, kSeparation, m_checkBox, and m_colorBox.

◆ operator=()

const FWCollectionSummaryModelCellRenderer& FWCollectionSummaryModelCellRenderer::operator= ( const FWCollectionSummaryModelCellRenderer )
privatedelete

◆ setData()

void FWCollectionSummaryModelCellRenderer::setData ( const FWEventItem iItem,
int  iIndex 
)

◆ width()

UInt_t FWCollectionSummaryModelCellRenderer::width ( ) const
overridevirtual

returns the minimum width of the cell to which the renderer is representing

Implements FWTableCellRendererBase.

Definition at line 72 of file FWCollectionSummaryModelCellRenderer.cc.

72  {
75 }

References kIconSize, kSeparation, w, and FWTextTableCellRenderer::width().

Member Data Documentation

◆ m_checkBox

FWCheckBoxIcon* FWCollectionSummaryModelCellRenderer::m_checkBox
private

◆ m_colorBox

FWColorBoxIcon* FWCollectionSummaryModelCellRenderer::m_colorBox
private

◆ m_colorContext

TGGC* FWCollectionSummaryModelCellRenderer::m_colorContext
private
FWTextTableCellRenderer::draw
void draw(Drawable_t iID, int iX, int iY, unsigned int iWidth, unsigned int iHeight) override
Definition: FWTextTableCellRenderer.cc:66
FWCollectionSummaryModelCellRenderer::kHitColor
Definition: FWCollectionSummaryModelCellRenderer.h:36
FWTextTableCellRenderer::FWTextTableCellRenderer
FWTextTableCellRenderer(const TGGC *iContext=&(getDefaultGC()), const TGGC *iHighlightContext=&(getDefaultHighlightGC()), Justify iJustify=kJustifyLeft)
Definition: FWTextTableCellRenderer.cc:34
FWEventItem::modelInfo
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
FWDisplayProperties::isVisible
bool isVisible() const
Definition: FWDisplayProperties.h:51
FWCollectionSummaryModelCellRenderer::m_colorBox
FWColorBoxIcon * m_colorBox
Definition: FWCollectionSummaryModelCellRenderer.h:56
FWTextTableCellRenderer::graphicsContext
const TGGC * graphicsContext() const
Definition: FWTextTableCellRenderer.h:45
FWCheckBoxIcon
Definition: FWCheckBoxIcon.h:28
FWDisplayProperties::color
Color_t color() const
Definition: FWDisplayProperties.h:47
kSeparation
static const unsigned int kSeparation
Definition: FWCollectionSummaryModelCellRenderer.cc:33
FWBoxIconBase::draw
void draw(Drawable_t iID, GContext_t iContext, int iX, int iY) const
Definition: FWBoxIconBase.cc:58
FWEventItem::ModelInfo
Definition: FWEventItem.h:58
kIconSize
static const unsigned int kIconSize
Definition: FWCollectionSummaryModelCellRenderer.cc:32
FWTextTableCellRenderer::width
UInt_t width() const override
returns the minimum width of the cell to which the renderer is representing
Definition: FWTextTableCellRenderer.cc:113
w
const double w
Definition: UKUtility.cc:23
FWCollectionSummaryModelCellRenderer::kMiss
Definition: FWCollectionSummaryModelCellRenderer.h:36
OrderedSet.t
t
Definition: OrderedSet.py:90
FWEventItem::modelName
std::string modelName(int iIndex) const
Definition: FWEventItem.cc:471
FWEventItem::ModelInfo::isSelected
bool isSelected() const
Definition: FWEventItem.h:65
FWCollectionSummaryModelCellRenderer::m_colorContext
TGGC * m_colorContext
Definition: FWCollectionSummaryModelCellRenderer.h:58
FWEventItem::ModelInfo::displayProperties
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
FWTextTableCellRenderer::setData
void setData(const std::string &, bool isSelected)
Definition: FWTextTableCellRenderer.cc:98
FWCollectionSummaryModelCellRenderer::kHitCheck
Definition: FWCollectionSummaryModelCellRenderer.h:36
FWColorBoxIcon
Definition: FWColorBoxIcon.h:28
FWColorBoxIcon::setColor
void setColor(GContext_t iColorContext)
Definition: FWColorBoxIcon.h:38
FWCollectionSummaryModelCellRenderer::m_checkBox
FWCheckBoxIcon * m_checkBox
Definition: FWCollectionSummaryModelCellRenderer.h:57
FWCheckBoxIcon::setChecked
void setChecked(bool iChecked)
Definition: FWCheckBoxIcon.h:40