JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
JTableSelection Class Reference

#include <JTableSelection.h>

Inheritance diagram for JTableSelection:
[legend]

Public Member Functions

 JTableSelection (JTable *table)
 
 JTableSelection (JTable *table, const JTableSelection &source)
 
 ~JTableSelection () override
 
void SelectCell (const JPoint &cell, const bool on=true)
 
void SelectCell (const JIndex row, const JIndex col, const bool on=true)
 
void InvertCell (const JPoint &cell)
 
void InvertCell (const JIndex row, const JIndex col)
 
bool HasSelection () const
 
bool IsSelected (const JPoint &cell) const
 
bool IsSelected (const JIndex row, const JIndex col) const
 
JSize GetSelectedCellCount () const
 
bool GetSingleSelectedCell (JPoint *cell) const
 
bool GetFirstSelectedCell (JPoint *cell, const JTableSelectionIterator::Direction d=JTableSelectionIterator::kIterateByCol) const
 
bool GetLastSelectedCell (JPoint *cell, const JTableSelectionIterator::Direction d=JTableSelectionIterator::kIterateByCol) const
 
void SelectRow (const JIndex rowIndex, const bool on=true)
 
void InvertRow (const JIndex rowIndex)
 
void SelectCol (const JIndex colIndex, const bool on=true)
 
void InvertCol (const JIndex rowIndex)
 
void SelectRect (const JRect &rect, const bool on=true)
 
void SelectRect (const JPoint &cell1, const JPoint &cell2, const bool on=true)
 
void SelectRect (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h, const bool on=true)
 
void InvertRect (const JRect &rect)
 
void InvertRect (const JPoint &cell1, const JPoint &cell2)
 
void InvertRect (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h)
 
void SelectAll (const bool on=true)
 
void ClearSelection ()
 
bool HasBoat () const
 
const JPointGetBoat () const
 
bool GetBoat (JPoint *cell) const
 
void SetBoat (const JPoint &cell)
 
void ClearBoat ()
 
bool HasAnchor () const
 
const JPointGetAnchor () const
 
bool GetAnchor (JPoint *cell) const
 
void SetAnchor (const JPoint &cell)
 
void ClearAnchor ()
 
bool OKToExtendSelection () const
 
bool ExtendSelection (const JPoint &newBoat)
 
- Public Member Functions inherited from JAuxTableData< bool >
 JAuxTableData (JTable *table, const bool &defValue)
 
 JAuxTableData (JTable *table, const JAuxTableData< bool > &source)
 
 ~JAuxTableData () override
 
JTableGetTable () const
 
- Public Member Functions inherited from JPackedTableData< T >
 JPackedTableData (const T &defValue)
 
 JPackedTableData (const JPackedTableData< T > &source)
 
 ~JPackedTableData () override
 
const JRunArray< T > & GetData () const
 
GetItem (const JIndex row, const JIndex col) const
 
GetItem (const JPoint &cell) const
 
void SetItem (const JIndex row, const JIndex col, const T &data)
 
void SetItem (const JPoint &cell, const T &data)
 
void GetRow (const JIndex index, JList< T > *rowData) const
 
void SetRow (const JIndex index, const JList< T > &rowData)
 
void SetRow (const JIndex index, const T &data)
 
void SetPartialRow (const JIndex rowIndex, const JIndex firstColIndex, const JIndex lastColIndex, const T &data)
 
void GetCol (const JIndex index, JList< T > *colData) const
 
void SetCol (const JIndex index, const JList< T > &colData)
 
void SetCol (const JIndex index, const T &data)
 
void SetPartialCol (const JIndex colIndex, const JIndex firstRowIndex, const JIndex lastRowIndex, const T &data)
 
void SetRect (const JRect &rect, const T &data)
 
void SetRect (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h, const T &data)
 
void ApplyToRect (const JRect &rect, T(*f)(const T &))
 
void ApplyToRect (const JCoordinate x, const JCoordinate y, const JCoordinate w, const JCoordinate h, T(*f)(const T &))
 
void InsertRows (const JIndex index, const JSize count, const JList< T > *initData=nullptr)
 
void PrependRows (const JSize count, const JList< T > *initData=nullptr)
 
void AppendRows (const JSize count, const JList< T > *initData=nullptr)
 
void DuplicateRow (const JIndex origIndex, const JIndex newIndex)
 
void RemoveRow (const JIndex index)
 
void RemoveNextRows (const JIndex firstIndex, const JSize count)
 
void RemovePrevRows (const JIndex lastIndex, const JSize count)
 
void RemoveAllRows ()
 
void MoveRow (const JIndex origIndex, const JIndex newIndex)
 
void InsertCols (const JIndex index, const JSize count, const JList< T > *initData=nullptr)
 
void PrependCols (const JSize count, const JList< T > *initData=nullptr)
 
void AppendCols (const JSize count, const JList< T > *initData=nullptr)
 
void DuplicateCol (const JIndex origIndex, const JIndex newIndex)
 
void RemoveCol (const JIndex index)
 
void RemoveNextCols (const JIndex firstIndex, const JSize count)
 
void RemovePrevCols (const JIndex lastIndex, const JSize count)
 
void RemoveAllCols ()
 
void MoveCol (const JIndex origIndex, const JIndex newIndex)
 
void SetAllElements (const T &data)
 
void ClearAllElements ()
 
bool AllItemsEqual (T *data=nullptr) const
 
JSize CountElementsWithValue (const T &data) const
 
const T GetDefaultValue () const
 
void SetDefaultValue (const T &data)
 
- Public Member Functions inherited from JTableData
 JTableData ()
 
 JTableData (const JTableData &source)
 
 ~JTableData () override
 
JTableDataoperator= (const JTableData &source)
 
bool IsEmpty () const
 
JSize GetRowCount () const
 
bool RowIndexValid (const JIndex index) const
 
JSize GetColCount () const
 
bool ColIndexValid (const JIndex index) const
 
bool CellValid (const JPoint &cell) const
 
- Public Member Functions inherited from JBroadcaster
 JBroadcaster ()
 
virtual ~JBroadcaster ()
 
JBroadcasteroperator= (const JBroadcaster &source)
 
bool HasSenders () const
 
JSize GetSenderCount () const
 
bool HasRecipients () const
 
JSize GetRecipientCount () const
 
virtual JString ToString () const
 
template<class T >
void ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f)
 

Protected Member Functions

void Receive (JBroadcaster *sender, const Message &message) override
 
- Protected Member Functions inherited from JTableData
void RowsAdded (const JSize count)
 
void RowsDeleted (const JSize count)
 
void SetRowCount (const JSize newRowCount)
 
void ColsAdded (const JSize count)
 
void ColsDeleted (const JSize count)
 
void SetColCount (const JSize newColCount)
 
- Protected Member Functions inherited from JBroadcaster
 JBroadcaster (const JBroadcaster &source)
 
void ListenTo (const JBroadcaster *sender)
 
void StopListening (const JBroadcaster *sender)
 
void ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember)
 
void StopListening (const JBroadcaster *sender, const std::type_info &messageType)
 
template<class T >
void Send (JBroadcaster *recipient, const T &message)
 
template<class T >
void Broadcast (const T &message)
 
void SendWithFeedback (JBroadcaster *recipient, Message *message)
 
void BroadcastWithFeedback (Message *message)
 
virtual void ReceiveWithFeedback (JBroadcaster *sender, Message *message)
 
virtual void ReceiveGoingAway (JBroadcaster *sender)
 

Additional Inherited Members

- Static Public Attributes inherited from JTableData
static const JUtf8BytekRowsInserted = "RowsInserted::JTableData"
 
static const JUtf8BytekRowDuplicated = "RowDuplicated::JTableData"
 
static const JUtf8BytekRowsRemoved = "RowsRemoved::JTableData"
 
static const JUtf8BytekRowMoved = "RowMoved::JTableData"
 
static const JUtf8BytekColsInserted = "ColsInserted::JTableData"
 
static const JUtf8BytekColDuplicated = "ColDuplicated::JTableData"
 
static const JUtf8BytekColsRemoved = "ColsRemoved::JTableData"
 
static const JUtf8BytekColMoved = "ColMoved::JTableData"
 
static const JUtf8BytekRectChanged = "RectChanged::JTableData"
 

Detailed Description

Interface for JTableSelection class

Class for storing which cells are selected in a JTable.

Constructor & Destructor Documentation

◆ JTableSelection() [1/2]

JTableSelection::JTableSelection ( JTable table)

◆ JTableSelection() [2/2]

JTableSelection::JTableSelection ( JTable table,
const JTableSelection source 
)

◆ ~JTableSelection()

JTableSelection::~JTableSelection ( )
override

Member Function Documentation

◆ ClearAnchor()

void JTableSelection::ClearAnchor ( )
inline

◆ ClearBoat()

void JTableSelection::ClearBoat ( )
inline

◆ ClearSelection()

void JTableSelection::ClearSelection ( )
inline

◆ ExtendSelection()

bool JTableSelection::ExtendSelection ( const JPoint newBoat)

Undoes the latest extend operation, sets the new boat cell, and selects the cells between boat and anchor.

◆ GetAnchor() [1/2]

const JPoint & JTableSelection::GetAnchor ( ) const
inline

◆ GetAnchor() [2/2]

bool JTableSelection::GetAnchor ( JPoint cell) const
inline

◆ GetBoat() [1/2]

const JPoint & JTableSelection::GetBoat ( ) const
inline

◆ GetBoat() [2/2]

bool JTableSelection::GetBoat ( JPoint cell) const
inline

◆ GetFirstSelectedCell()

bool JTableSelection::GetFirstSelectedCell ( JPoint cell,
const JTableSelectionIterator::Direction  d = JTableSelectionIterator::kIterateByCol 
) const

Return the first selected cell, starting from the upper left and going in the specified direction.

◆ GetLastSelectedCell()

bool JTableSelection::GetLastSelectedCell ( JPoint cell,
const JTableSelectionIterator::Direction  d = JTableSelectionIterator::kIterateByCol 
) const

Return the first selected cell, starting from the lower right and going in the specified direction.

◆ GetSelectedCellCount()

JSize JTableSelection::GetSelectedCellCount ( ) const
inline

◆ GetSingleSelectedCell()

bool JTableSelection::GetSingleSelectedCell ( JPoint cell) const

◆ HasAnchor()

bool JTableSelection::HasAnchor ( ) const
inline

◆ HasBoat()

bool JTableSelection::HasBoat ( ) const
inline

This is provided as a convenience since most tables need to store it.

◆ HasSelection()

bool JTableSelection::HasSelection ( ) const
inline

◆ InvertCell() [1/2]

void JTableSelection::InvertCell ( const JIndex  row,
const JIndex  col 
)
inline

◆ InvertCell() [2/2]

void JTableSelection::InvertCell ( const JPoint cell)
inline

◆ InvertCol()

void JTableSelection::InvertCol ( const JIndex  rowIndex)
inline

◆ InvertRect() [1/3]

void JTableSelection::InvertRect ( const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  w,
const JCoordinate  h 
)
inline

◆ InvertRect() [2/3]

void JTableSelection::InvertRect ( const JPoint cell1,
const JPoint cell2 
)
inline

◆ InvertRect() [3/3]

void JTableSelection::InvertRect ( const JRect rect)
inline

◆ InvertRow()

void JTableSelection::InvertRow ( const JIndex  rowIndex)
inline

◆ IsSelected() [1/2]

bool JTableSelection::IsSelected ( const JIndex  row,
const JIndex  col 
) const
inline

◆ IsSelected() [2/2]

bool JTableSelection::IsSelected ( const JPoint cell) const
inline

◆ OKToExtendSelection()

bool JTableSelection::OKToExtendSelection ( ) const
inline

◆ Receive()

void JTableSelection::Receive ( JBroadcaster sender,
const Message message 
)
overrideprotectedvirtual

Update our boat and anchor cells.

When a row or column is moved, there is nothing to do but reselect the same area in the new arrangement.

Reimplemented from JAuxTableData< bool >.

◆ SelectAll()

void JTableSelection::SelectAll ( const bool  on = true)
inline

◆ SelectCell() [1/2]

void JTableSelection::SelectCell ( const JIndex  row,
const JIndex  col,
const bool  on = true 
)
inline

◆ SelectCell() [2/2]

void JTableSelection::SelectCell ( const JPoint cell,
const bool  on = true 
)
inline

◆ SelectCol()

void JTableSelection::SelectCol ( const JIndex  colIndex,
const bool  on = true 
)
inline

◆ SelectRect() [1/3]

void JTableSelection::SelectRect ( const JCoordinate  x,
const JCoordinate  y,
const JCoordinate  w,
const JCoordinate  h,
const bool  on = true 
)
inline

◆ SelectRect() [2/3]

void JTableSelection::SelectRect ( const JPoint cell1,
const JPoint cell2,
const bool  on = true 
)
inline

◆ SelectRect() [3/3]

void JTableSelection::SelectRect ( const JRect rect,
const bool  on = true 
)
inline

◆ SelectRow()

void JTableSelection::SelectRow ( const JIndex  rowIndex,
const bool  on = true 
)
inline

◆ SetAnchor()

void JTableSelection::SetAnchor ( const JPoint cell)
inline

◆ SetBoat()

void JTableSelection::SetBoat ( const JPoint cell)
inline

The documentation for this class was generated from the following files: