Skip to content

Commit

Permalink
Renamed GNEAttributeTable to GNEAttributeEditor. Refs #15776
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Nov 28, 2024
1 parent 20bc17a commit ee66300
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions src/netedit/frames/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ set(netedit_frames_SRCS
GNEPlanCreatorLegend.cpp
GNEAttributeRow.h
GNEAttributeRow.cpp
GNEAttributeTable.h
GNEAttributeTable.cpp
GNEAttributeEditor.h
GNEAttributeEditor.cpp
)

add_library(netedit_frames STATIC ${netedit_frames_SRCS})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <utils/foxtools/MFXTextFieldTooltip.h>
#include <utils/foxtools/MFXLabelTooltip.h>

#include "GNEAttributeTable.h"
#include "GNEAttributeEditor.h"
#include "GNEAttributeRow.h"

// ===========================================================================
Expand All @@ -51,18 +51,18 @@
// temporal
#define MAX_ATTR 32

FXDEFMAP(GNEAttributeTable) GNEAttributeTableMap[] = {
FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEAttributeTable::onCmdAttributeTableHelp)
FXDEFMAP(GNEAttributeEditor) GNEAttributeTableMap[] = {
FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEAttributeEditor::onCmdAttributeTableHelp)
};

// Object implementation
FXIMPLEMENT(GNEAttributeTable, MFXGroupBoxModule, GNEAttributeTableMap, ARRAYNUMBER(GNEAttributeTableMap))
FXIMPLEMENT(GNEAttributeEditor, MFXGroupBoxModule, GNEAttributeTableMap, ARRAYNUMBER(GNEAttributeTableMap))

// ===========================================================================
// method definitions
// ===========================================================================

GNEAttributeTable::GNEAttributeTable(GNEFrame* frameParent, const int editorOptions) :
GNEAttributeEditor::GNEAttributeEditor(GNEFrame* frameParent, const int editorOptions) :
MFXGroupBoxModule(frameParent, TL("Internal attributes")),
myFrameParent(frameParent),
myEditorOptions(editorOptions) {
Expand All @@ -77,15 +77,15 @@ GNEAttributeTable::GNEAttributeTable(GNEFrame* frameParent, const int editorOpti


void
GNEAttributeTable::showAttributeTableModule(GNEAttributeCarrier* AC) {
GNEAttributeEditor::showAttributeTableModule(GNEAttributeCarrier* AC) {
myEditedACs.clear();
myEditedACs.push_back(AC);
refreshAttributeTable();
}


void
GNEAttributeTable::showAttributeTableModule(const std::unordered_set<GNEAttributeCarrier*>& ACs) {
GNEAttributeEditor::showAttributeTableModule(const std::unordered_set<GNEAttributeCarrier*>& ACs) {
myEditedACs.clear();
for (const auto& AC : ACs) {
myEditedACs.push_back(AC);
Expand All @@ -95,7 +95,7 @@ GNEAttributeTable::showAttributeTableModule(const std::unordered_set<GNEAttribut


void
GNEAttributeTable::hideAttributeTableModule() {
GNEAttributeEditor::hideAttributeTableModule() {
myEditedACs.clear();
// hide all rows before hidding table
for (const auto& row : myAttributeRows) {
Expand All @@ -106,7 +106,7 @@ GNEAttributeTable::hideAttributeTableModule() {


void
GNEAttributeTable::refreshAttributeTable() {
GNEAttributeEditor::refreshAttributeTable() {
if (myEditedACs.size() > 0) {
// Iterate over tag property of first AC and show row for every attribute
int itRows = 0;
Expand Down Expand Up @@ -134,13 +134,13 @@ GNEAttributeTable::refreshAttributeTable() {


GNEFrame*
GNEAttributeTable::getFrameParent() const {
GNEAttributeEditor::getFrameParent() const {
return myFrameParent;
}


long
GNEAttributeTable::onCmdAttributeTableHelp(FXObject*, FXSelector, void*) {
GNEAttributeEditor::onCmdAttributeTableHelp(FXObject*, FXSelector, void*) {
if (myEditedACs.size() > 0) {
myFrameParent->openHelpAttributesDialog(myEditedACs.front());
}
Expand All @@ -149,7 +149,7 @@ GNEAttributeTable::onCmdAttributeTableHelp(FXObject*, FXSelector, void*) {


void
GNEAttributeTable::setAttribute(SumoXMLAttr attr, const std::string& value) {
GNEAttributeEditor::setAttribute(SumoXMLAttr attr, const std::string& value) {
const auto undoList = myFrameParent->getViewNet()->getUndoList();
const auto& tagProperty = myEditedACs.front()->getTagProperty();
// first check if we're editing a single attribute or an ID
Expand All @@ -174,7 +174,7 @@ GNEAttributeTable::setAttribute(SumoXMLAttr attr, const std::string& value) {


void
GNEAttributeTable::toggleEnableAttribute(SumoXMLAttr attr, const bool value) {
GNEAttributeEditor::toggleEnableAttribute(SumoXMLAttr attr, const bool value) {
const auto undoList = myFrameParent->getViewNet()->getUndoList();
const auto& tagProperty = myEditedACs.front()->getTagProperty();
// first check if we're editing a single attribute
Expand All @@ -200,13 +200,13 @@ GNEAttributeTable::toggleEnableAttribute(SumoXMLAttr attr, const bool value) {


void
GNEAttributeTable::inspectParent() {
GNEAttributeEditor::inspectParent() {
//myFrameParent->getViewNet()->getInspectedElements().inspectAC(
}


void
GNEAttributeTable::moveLaneUp() {
GNEAttributeEditor::moveLaneUp() {
const auto lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(myEditedACs.front()->getAttribute(SUMO_ATTR_LANE), false);
if (lane) {
// set next lane
Expand All @@ -216,7 +216,7 @@ GNEAttributeTable::moveLaneUp() {


void
GNEAttributeTable::moveLaneDown() {
GNEAttributeEditor::moveLaneDown() {
const auto lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(myEditedACs.front()->getAttribute(SUMO_ATTR_LANE), false);
if (lane) {
// set previous lane
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
/****************************************************************************/
/// @file GNEAttributeTable.h
/// @file GNEAttributeEditor.h
/// @author Pablo Alvarez Lopez
/// @date Nov 2024
///
Expand All @@ -32,12 +32,12 @@ class GNEAttributeCarrier;
class GNEAttributeRow;

// ===========================================================================
// class GNEAttributeTable
// class GNEAttributeEditor
// ===========================================================================

class GNEAttributeTable : public MFXGroupBoxModule {
class GNEAttributeEditor : public MFXGroupBoxModule {
/// @brief FOX-declaration
FXDECLARE(GNEAttributeTable)
FXDECLARE(GNEAttributeEditor)

/// @brief declare friend class
friend class GNEAttributeRow;
Expand All @@ -51,7 +51,7 @@ class GNEAttributeTable : public MFXGroupBoxModule {
};

/// @brief constructor
GNEAttributeTable(GNEFrame* frameParent, const int editorOptions);
GNEAttributeEditor(GNEFrame* frameParent, const int editorOptions);

/// @brief edit attributes of the given AC (usually the edited template AC)
void showAttributeTableModule(GNEAttributeCarrier* AC);
Expand All @@ -77,7 +77,7 @@ class GNEAttributeTable : public MFXGroupBoxModule {

protected:
/// @brief fox need this
FOX_CONSTRUCTOR(GNEAttributeTable)
FOX_CONSTRUCTOR(GNEAttributeEditor)

/// @brief set attribute in the current ACs (Callend from row)
void setAttribute(SumoXMLAttr attr, const std::string& value);
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/frames/GNEAttributeRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
/****************************************************************************/
/// @file GNEAttributeTable.cpp
/// @file GNEAttributeEditor.cpp
/// @author Pablo Alvarez Lopez
/// @date Nov 2024
///
Expand Down Expand Up @@ -69,7 +69,7 @@ FXIMPLEMENT(GNEAttributeRow, FXHorizontalFrame, GNEAttributeRowMap
// method definitions
// ===========================================================================

GNEAttributeRow::GNEAttributeRow(GNEAttributeTable* attributeTable) :
GNEAttributeRow::GNEAttributeRow(GNEAttributeEditor* attributeTable) :
FXHorizontalFrame(attributeTable->getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame),
myAttributeTable(attributeTable) {
// get static tooltip menu
Expand Down
8 changes: 4 additions & 4 deletions src/netedit/frames/GNEAttributeRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

#include <netedit/elements/GNEAttributeCarrier.h>

#include "GNEAttributeTable.h"
#include "GNEAttributeEditor.h"

// ===========================================================================
// class declaration
// ===========================================================================

class GNEAttributeTable;
class GNEAttributeEditor;
class GNEAttributeCarrier;

// ===========================================================================
Expand All @@ -41,7 +41,7 @@ class GNEAttributeRow : protected FXHorizontalFrame {

public:
/// @brief constructor
GNEAttributeRow(GNEAttributeTable* attributeTable);
GNEAttributeRow(GNEAttributeEditor* attributeTable);

/// @brief show attribute row
void showAttributeRow(const GNEAttributeProperties& attrProperty);
Expand Down Expand Up @@ -123,7 +123,7 @@ class GNEAttributeRow : protected FXHorizontalFrame {

private:
/// @brief pointer to attribute table parent
GNEAttributeTable* myAttributeTable;
GNEAttributeEditor* myAttributeTable;

/// @brief edited attribute
SumoXMLAttr myAttribute = SUMO_ATTR_NOTHING;
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/GNEFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <config.h>

#include "GNEFrameAttributeModules.h"
#include <netedit/frames/GNEAttributeTable.h>
#include <netedit/frames/GNEAttributeEditor.h>

// ===========================================================================
// class definitions
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/frames/common/GNEInspectorFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ GNEInspectorFrame::GNEInspectorFrame(GNEViewParent* viewParent, GNEViewNet* view
myOverlappedInspection = new GNEOverlappedInspection(this);

// Create Attributes Editor module
myAttributesEditor = new GNEAttributeTable(this, GNEAttributeTable::EditorOptions::EXTENDED_ATTRIBUTES);
myAttributesEditor = new GNEAttributeEditor(this, GNEAttributeEditor::EditorOptions::EXTENDED_ATTRIBUTES);

// Create GEO Parameters Editor module
myGEOAttributesEditor = new GEOAttributesEditor(this);
Expand Down Expand Up @@ -1145,7 +1145,7 @@ GNEInspectorFrame::clearInspectedAC() {
}


GNEAttributeTable*
GNEAttributeEditor*
GNEInspectorFrame::getAttributesEditor() const {
return myAttributesEditor;
}
Expand Down
4 changes: 2 additions & 2 deletions src/netedit/frames/common/GNEInspectorFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class GNEInspectorFrame : public GNEFrame {
void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked);

/// @brief get AttributesEditor
GNEAttributeTable* getAttributesEditor() const;
GNEAttributeEditor* getAttributesEditor() const;

/// @brief get Netedit Attributes editor
GNEInspectorFrame::NeteditAttributesEditor* getNeteditAttributesEditor() const;
Expand Down Expand Up @@ -398,7 +398,7 @@ class GNEInspectorFrame : public GNEFrame {
GNEOverlappedInspection* myOverlappedInspection;

/// @brief Attribute editor
GNEAttributeTable* myAttributesEditor;
GNEAttributeEditor* myAttributesEditor;

/// @brief Netedit Attributes editor
NeteditAttributesEditor* myNeteditAttributesEditor;
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/data/GNEMeanDataFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ GNEMeanDataFrame::GNEMeanDataFrame(GNEViewParent* viewParent, GNEViewNet* viewNe
// build meanData selector
myMeanDataSelector = new MeanDataSelector(this);
// build meanData attributes editor
myMeanDataAttributesEditor = new GNEAttributeTable(this, GNEAttributeTable::EditorOptions::EXTENDED_ATTRIBUTES);
myMeanDataAttributesEditor = new GNEAttributeEditor(this, GNEAttributeEditor::EditorOptions::EXTENDED_ATTRIBUTES);
}


Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/data/GNEMeanDataFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class GNEMeanDataFrame : public GNEFrame {
MeanDataSelector* myMeanDataSelector = nullptr;

/// @brief meanData attributes editor
GNEAttributeTable* myMeanDataAttributesEditor = nullptr;
GNEAttributeEditor* myMeanDataAttributesEditor = nullptr;

private:
/// @brief Invalidated copy constructor.
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/demand/GNEDistributionFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ GNEDistributionFrame::DistributionRow::isValidNewKey() const {
// ---------------------------------------------------------------------------

GNEDistributionFrame::DistributionValuesEditor::DistributionValuesEditor(GNEFrame* frameParent, DistributionEditor* distributionEditor,
DistributionSelector* distributionSelector, GNEAttributeTable* attributesEditor, SumoXMLTag distributionValueTag) :
DistributionSelector* distributionSelector, GNEAttributeEditor* attributesEditor, SumoXMLTag distributionValueTag) :
MFXGroupBoxModule(frameParent, TL("Distribution values")),
myFrameParent(frameParent),
myDistributionEditor(distributionEditor),
Expand Down
6 changes: 3 additions & 3 deletions src/netedit/frames/demand/GNEDistributionFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class GNEDistributionFrame {
DistributionEditor* myDistributionEditor = nullptr;

/// @brief attributes editor
GNEAttributeTable* myAttributesEditor = nullptr;
GNEAttributeEditor* myAttributesEditor = nullptr;

/// @brief distribution values editor
DistributionValuesEditor* myDistributionValuesEditor = nullptr;
Expand Down Expand Up @@ -243,7 +243,7 @@ class GNEDistributionFrame {
/// @brief constructor
DistributionValuesEditor(GNEFrame* frameParent, DistributionEditor* distributionEditor,
DistributionSelector* distributionSelector,
GNEAttributeTable* attributesEditor,
GNEAttributeEditor* attributesEditor,
SumoXMLTag distributionValueTag);

/// @brief show attributes of multiple ACs
Expand Down Expand Up @@ -290,7 +290,7 @@ class GNEDistributionFrame {
DistributionSelector* myDistributionSelector;

/// @brief attributes editor
GNEAttributeTable* myAttributesEditor;
GNEAttributeEditor* myAttributesEditor;

/// @brief distribution value tag
SumoXMLTag myDistributionValueTag;
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/demand/GNERouteDistributionFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ GNERouteDistributionFrame::GNERouteDistributionFrame(GNEViewParent* viewParent,
myDistributionSelector = new GNEDistributionFrame::DistributionSelector(this);

/// @brief distribution attributes editor
myAttributesEditor = new GNEAttributeTable(this, GNEAttributeTable::EditorOptions::EXTENDED_ATTRIBUTES);
myAttributesEditor = new GNEAttributeEditor(this, GNEAttributeEditor::EditorOptions::EXTENDED_ATTRIBUTES);

// Create route distribution attributes editor
myDistributionValuesEditor = new GNEDistributionFrame::DistributionValuesEditor(this, myDistributionEditor, myDistributionSelector, myAttributesEditor, SUMO_TAG_ROUTE);
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/demand/GNERouteDistributionFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class GNERouteDistributionFrame : public GNEFrame {
GNEDistributionFrame::DistributionSelector* myDistributionSelector = nullptr;

/// @brief distribution attributes editor
GNEAttributeTable* myAttributesEditor = nullptr;
GNEAttributeEditor* myAttributesEditor = nullptr;

/// @brief editor for distribution values
GNEDistributionFrame::DistributionValuesEditor* myDistributionValuesEditor = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/demand/GNETypeDistributionFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ GNETypeDistributionFrame::GNETypeDistributionFrame(GNEViewParent* viewParent, GN
myDistributionSelector = new GNEDistributionFrame::DistributionSelector(this);

/// @brief distribution attributes editor
myAttributesEditor = new GNEAttributeTable(this, GNEAttributeTable::EditorOptions::EXTENDED_ATTRIBUTES);
myAttributesEditor = new GNEAttributeEditor(this, GNEAttributeEditor::EditorOptions::EXTENDED_ATTRIBUTES);

// Create type distribution attributes editor
myDistributionValuesEditor = new GNEDistributionFrame::DistributionValuesEditor(this, myDistributionEditor, myDistributionSelector, myAttributesEditor, SUMO_TAG_VTYPE);
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/demand/GNETypeDistributionFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class GNETypeDistributionFrame : public GNEFrame {
GNEDistributionFrame::DistributionSelector* myDistributionSelector = nullptr;

/// @brief distribution attributes editor
GNEAttributeTable* myAttributesEditor = nullptr;
GNEAttributeEditor* myAttributesEditor = nullptr;

/// @brief editor for distribution values
GNEDistributionFrame::DistributionValuesEditor* myDistributionValuesEditor = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/demand/GNETypeFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ GNETypeFrame::GNETypeFrame(GNEViewParent* viewParent, GNEViewNet* viewNet) :
myTypeSelector = new TypeSelector(this);

// Create vehicle type attributes editor
myTypeAttributesEditor = new GNEAttributeTable(this, 0);
myTypeAttributesEditor = new GNEAttributeEditor(this, 0);

// create module for open extended attributes dialog
myAttributesEditorExtended = new GNEFrameAttributeModules::AttributesEditorExtended(this);
Expand Down
2 changes: 1 addition & 1 deletion src/netedit/frames/demand/GNETypeFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class GNETypeFrame : public GNEFrame {
TypeEditor* myTypeEditor;

/// @brief editorinternal vehicle type attributes
GNEAttributeTable* myTypeAttributesEditor = nullptr;
GNEAttributeEditor* myTypeAttributesEditor = nullptr;

/// @brief modul for open extended attributes dialog
GNEFrameAttributeModules::AttributesEditorExtended* myAttributesEditorExtended = nullptr;
Expand Down

0 comments on commit ee66300

Please sign in to comment.