Skip to content

Commit

Permalink
Renamed GNEAttributesEditor functions. Refs #15776
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Nov 28, 2024
1 parent 41f7e0a commit 043127e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 47 deletions.
24 changes: 12 additions & 12 deletions src/netedit/frames/GNEAttributesEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#define MAX_ATTR 32

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

// Object implementation
Expand All @@ -77,25 +77,25 @@ GNEAttributesEditor::GNEAttributesEditor(GNEFrame* frameParent, const int editor


void
GNEAttributesEditor::showAttributeTableModule(GNEAttributeCarrier* AC) {
GNEAttributesEditor::showAttributesEditor(GNEAttributeCarrier* AC) {
myEditedACs.clear();
myEditedACs.push_back(AC);
refreshAttributeTable();
refreshAttributesEditor();
}


void
GNEAttributesEditor::showAttributeTableModule(const std::unordered_set<GNEAttributeCarrier*>& ACs) {
GNEAttributesEditor::showAttributesEditor(const std::unordered_set<GNEAttributeCarrier*>& ACs) {
myEditedACs.clear();
for (const auto& AC : ACs) {
myEditedACs.push_back(AC);
}
refreshAttributeTable();
refreshAttributesEditor();
}


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


void
GNEAttributesEditor::refreshAttributeTable() {
GNEAttributesEditor::refreshAttributesEditor() {
if (myEditedACs.size() > 0) {
// Iterate over tag property of first AC and show row for every attribute
int itRows = 0;
Expand Down Expand Up @@ -136,12 +136,12 @@ GNEAttributesEditor::refreshAttributeTable() {
}
// only show if at least one row was shown
if (itRows == 0) {
hideAttributeTableModule();
hideAttributesEditor();
} else {
show();
}
} else {
hideAttributeTableModule();
hideAttributesEditor();
}
}

Expand All @@ -153,7 +153,7 @@ GNEAttributesEditor::getFrameParent() const {


long
GNEAttributesEditor::onCmdAttributeTableHelp(FXObject*, FXSelector, void*) {
GNEAttributesEditor::onCmdAttributesEditorHelp(FXObject*, FXSelector, void*) {
if (myEditedACs.size() > 0) {
myFrameParent->openHelpAttributesDialog(myEditedACs.front());
}
Expand All @@ -180,7 +180,7 @@ GNEAttributesEditor::setAttribute(SumoXMLAttr attr, const std::string& value) {
if ((myEditedACs.size() > 1) || (attr == SUMO_ATTR_ID)) {
undoList->end();
}
refreshAttributeTable();
refreshAttributesEditor();
// update frame parent (needed to update other attribute tables)
myFrameParent->attributeUpdated(attr);
}
Expand All @@ -206,7 +206,7 @@ GNEAttributesEditor::toggleEnableAttribute(SumoXMLAttr attr, const bool value) {
if ((myEditedACs.size() > 1) || (attr == SUMO_ATTR_ID)) {
undoList->end();
}
refreshAttributeTable();
refreshAttributesEditor();
// update frame parent (needed to update other attribute tables)
myFrameParent->attributeUpdated(attr);
}
Expand Down
10 changes: 5 additions & 5 deletions src/netedit/frames/GNEAttributesEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ class GNEAttributesEditor : public MFXGroupBoxModule {
GNEAttributesEditor(GNEFrame* frameParent, const int editorOptions);

/// @brief edit attributes of the given AC (usually the edited template AC)
void showAttributeTableModule(GNEAttributeCarrier* AC);
void showAttributesEditor(GNEAttributeCarrier* AC);

/// @brief edit attributes of the given hash of ACs (usually the inspected ACs)
void showAttributeTableModule(const std::unordered_set<GNEAttributeCarrier*>& ACs);
void showAttributesEditor(const std::unordered_set<GNEAttributeCarrier*>& ACs);

/// @brief hide attribute editor
void hideAttributeTableModule();
void hideAttributesEditor();

/// @brief refresh attribute editor
void refreshAttributeTable();
void refreshAttributesEditor();

/// @brief pointer to GNEFrame parent
GNEFrame* getFrameParent() const;

/// @name FOX-callbacks
/// @{
/// @brief Called when user press the help button
long onCmdAttributeTableHelp(FXObject*, FXSelector, void*);
long onCmdAttributesEditorHelp(FXObject*, FXSelector, void*);

/// @}

Expand Down
32 changes: 16 additions & 16 deletions src/netedit/frames/common/GNEInspectorFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute(FXObject* o
myInspectorFrameParent->myViewNet->getUndoList()->end();
}
// force refresh values of AttributesEditor and GEOAttributesEditor
myInspectorFrameParent->myAttributesEditor->refreshAttributeTable();
myInspectorFrameParent->myFlowAttributesEditor->refreshAttributeTable();
myInspectorFrameParent->myGEOAttributesEditor->refreshAttributeTable();
myInspectorFrameParent->myAttributesEditor->refreshAttributesEditor();
myInspectorFrameParent->myFlowAttributesEditor->refreshAttributesEditor();
myInspectorFrameParent->myGEOAttributesEditor->refreshAttributesEditor();
}
return 1;
}
Expand Down Expand Up @@ -521,7 +521,7 @@ GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate(FXObject*, FXSelector, void
// end copy template
myInspectorFrameParent->myViewNet->getUndoList()->end();
// refresh inspector parent
myInspectorFrameParent->myAttributesEditor->refreshAttributeTable();
myInspectorFrameParent->myAttributesEditor->refreshAttributesEditor();
}
return 1;
}
Expand Down Expand Up @@ -859,10 +859,10 @@ GNEInspectorFrame::refreshInspection() {
myHeaderLeftFrame->hide();
myBackButton->hide();
// Hide all elements
myAttributesEditor->hideAttributeTableModule();
myFlowAttributesEditor->hideAttributeTableModule();
myAttributesEditor->hideAttributesEditor();
myFlowAttributesEditor->hideAttributesEditor();
myNeteditAttributesEditor->hideNeteditAttributesEditor();
myGEOAttributesEditor->hideAttributeTableModule();
myGEOAttributesEditor->hideAttributesEditor();
myParametersEditor->hideParametersEditor();
myAdditionalDialog->hideAdditionalDialog();
myTemplateEditor->hideTemplateEditor();
Expand Down Expand Up @@ -910,16 +910,16 @@ GNEInspectorFrame::refreshInspection() {
getFrameHeaderLabel()->setText(headerString.c_str());

// Show attributes editor
myAttributesEditor->showAttributeTableModule(inspectedElements.getACs());
myAttributesEditor->showAttributesEditor(inspectedElements.getACs());

// Show flow attributes editor
myFlowAttributesEditor->showAttributeTableModule(inspectedElements.getACs());
myFlowAttributesEditor->showAttributesEditor(inspectedElements.getACs());

// show netedit attributes editor if we're inspecting elements with Netedit Attributes
myNeteditAttributesEditor->showNeteditAttributesEditor();

// Show GEO attributes editor
myGEOAttributesEditor->showAttributeTableModule(inspectedElements.getACs());
myGEOAttributesEditor->showAttributesEditor(inspectedElements.getACs());

// show parameters editor
myParametersEditor->showParametersEditor();
Expand Down Expand Up @@ -1028,9 +1028,9 @@ GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) {

void
GNEInspectorFrame::updateFrameAfterUndoRedo() {
myAttributesEditor->refreshAttributeTable();
myFlowAttributesEditor->refreshAttributeTable();
myGEOAttributesEditor->refreshAttributeTable();
myAttributesEditor->refreshAttributesEditor();
myFlowAttributesEditor->refreshAttributesEditor();
myGEOAttributesEditor->refreshAttributesEditor();
myParametersEditor->refreshParametersEditor();
myHierarchicalElementTree->refreshHierarchicalElementTree();
}
Expand Down Expand Up @@ -1060,10 +1060,10 @@ GNEInspectorFrame::inspectClickedElement(const GNEViewNetHelper::ViewObjectsSele

void
GNEInspectorFrame::attributeUpdated(SumoXMLAttr /*attribute*/) {
myAttributesEditor->refreshAttributeTable();
myFlowAttributesEditor->refreshAttributeTable();
myAttributesEditor->refreshAttributesEditor();
myFlowAttributesEditor->refreshAttributesEditor();
myNeteditAttributesEditor->refreshNeteditAttributesEditor(true);
myGEOAttributesEditor->refreshAttributeTable();
myGEOAttributesEditor->refreshAttributesEditor();
}


Expand Down
10 changes: 5 additions & 5 deletions src/netedit/frames/data/GNEMeanDataFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ GNEMeanDataFrame::MeanDataSelector::showMeanDataSelector() {
void
GNEMeanDataFrame::MeanDataSelector::hideMeanDataSelector() {
// hide attributes editor
myMeanDataFrameParent->myMeanDataAttributesEditor->hideAttributeTableModule();
myMeanDataFrameParent->myMeanDataAttributesEditor->hideAttributesEditor();
// hide
hide();
}
Expand Down Expand Up @@ -373,9 +373,9 @@ GNEMeanDataFrame::MeanDataSelector::refreshMeanDataSelector(bool afterChangingID
// check if show attribute editor
if (!afterChangingID) {
if (myCurrentMeanData) {
myMeanDataFrameParent->myMeanDataAttributesEditor->showAttributeTableModule(myCurrentMeanData);
myMeanDataFrameParent->myMeanDataAttributesEditor->showAttributesEditor(myCurrentMeanData);
} else {
myMeanDataFrameParent->myMeanDataAttributesEditor->hideAttributeTableModule();
myMeanDataFrameParent->myMeanDataAttributesEditor->hideAttributesEditor();
}
}
}
Expand Down Expand Up @@ -403,7 +403,7 @@ GNEMeanDataFrame::MeanDataSelector::onCmdSelectItem(FXObject*, FXSelector, void*
// refresh meanData editor module
myMeanDataFrameParent->myMeanDataEditor->refreshMeanDataEditorModule();
// show modules if selected item is valid
myMeanDataFrameParent->myMeanDataAttributesEditor->showAttributeTableModule(myCurrentMeanData);
myMeanDataFrameParent->myMeanDataAttributesEditor->showAttributesEditor(myCurrentMeanData);
// Write Warning in console if we're in testing mode
WRITE_DEBUG(("Selected item '" + myMeanDataComboBox->getText() + "' in MeanDataSelector").text());
// update viewNet
Expand All @@ -415,7 +415,7 @@ GNEMeanDataFrame::MeanDataSelector::onCmdSelectItem(FXObject*, FXSelector, void*
// refresh meanData editor module
myMeanDataFrameParent->myMeanDataEditor->refreshMeanDataEditorModule();
// hide all modules if selected item isn't valid
myMeanDataFrameParent->myMeanDataAttributesEditor->hideAttributeTableModule();
myMeanDataFrameParent->myMeanDataAttributesEditor->hideAttributesEditor();
// set color of myMeanDataMatchBox to red (invalid)
myMeanDataComboBox->setTextColor(FXRGB(255, 0, 0));
// Write Warning in console if we're in testing mode
Expand Down
8 changes: 4 additions & 4 deletions src/netedit/frames/demand/GNEDistributionFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ GNEDistributionFrame::DistributionSelector::refreshDistributionSelector() {
// continue depending of myCurrentDistribution
if (myCurrentDistribution) {
// show modules
myAttributesEditor->showAttributeTableModule(myCurrentDistribution);
myAttributesEditor->showAttributesEditor(myCurrentDistribution);
myDistributionValuesEditor->showDistributionValuesEditor();
} else {
// hide modules
myAttributesEditor->hideAttributeTableModule();
myAttributesEditor->hideAttributesEditor();
myDistributionValuesEditor->hideDistributionValuesEditor();
}
}
Expand All @@ -240,7 +240,7 @@ GNEDistributionFrame::DistributionSelector::onCmdSelectDistribution(FXObject*, F
// set color of myTypeMatchBox to black (valid)
myDistributionsComboBox->setTextColor(FXRGB(0, 0, 0));
// show modules
myAttributesEditor->showAttributeTableModule(distribution.second);
myAttributesEditor->showAttributesEditor(distribution.second);
myDistributionValuesEditor->showDistributionValuesEditor();
// Write Warning in console if we're in testing mode
WRITE_DEBUG(("Selected item '" + myDistributionsComboBox->getText() + "' in DistributionSelector").text());
Expand All @@ -252,7 +252,7 @@ GNEDistributionFrame::DistributionSelector::onCmdSelectDistribution(FXObject*, F
// not found, then reset myCurrentDistribution
myCurrentDistribution = nullptr;
// hide modules
myAttributesEditor->hideAttributeTableModule();
myAttributesEditor->hideAttributesEditor();
myDistributionValuesEditor->hideDistributionValuesEditor();
// set color of myTypeMatchBox to red (invalid)
myDistributionsComboBox->setTextColor(FXRGB(255, 0, 0));
Expand Down
10 changes: 5 additions & 5 deletions src/netedit/frames/demand/GNETypeFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ GNETypeFrame::TypeSelector::refreshTypeSelector(const bool updateModuls) {
// refresh vehicle type editor module
myTypeFrameParent->myTypeEditor->refreshTypeEditorModule();
// show modules
myTypeFrameParent->myTypeAttributesEditor->showAttributeTableModule(myCurrentType);
myTypeFrameParent->myTypeAttributesEditor->showAttributesEditor(myCurrentType);
myTypeFrameParent->myAttributesEditorExtended->showAttributesEditorExtendedModule();
myTypeFrameParent->myParametersEditor->refreshParametersEditor();
}
Expand All @@ -166,7 +166,7 @@ GNETypeFrame::TypeSelector::onCmdSelectItem(FXObject*, FXSelector, void*) {
// refresh vehicle type editor module
myTypeFrameParent->myTypeEditor->refreshTypeEditorModule();
// show modules if selected item is valid
myTypeFrameParent->myTypeAttributesEditor->showAttributeTableModule(myCurrentType);
myTypeFrameParent->myTypeAttributesEditor->showAttributesEditor(myCurrentType);
myTypeFrameParent->myAttributesEditorExtended->showAttributesEditorExtendedModule();
myTypeFrameParent->myParametersEditor->refreshParametersEditor();
// Write Warning in console if we're in testing mode
Expand All @@ -180,7 +180,7 @@ GNETypeFrame::TypeSelector::onCmdSelectItem(FXObject*, FXSelector, void*) {
// refresh vehicle type editor module
myTypeFrameParent->myTypeEditor->refreshTypeEditorModule();
// hide all modules if selected item isn't valid
myTypeFrameParent->myTypeAttributesEditor->hideAttributeTableModule();
myTypeFrameParent->myTypeAttributesEditor->hideAttributesEditor();
myTypeFrameParent->myAttributesEditorExtended->hideAttributesEditorExtendedModule();
// set color of myTypeMatchBox to red (invalid)
myTypeComboBox->setTextColor(FXRGB(255, 0, 0));
Expand Down Expand Up @@ -415,7 +415,7 @@ GNETypeFrame::show() {
// refresh vehicle type and Attribute Editor
myTypeSelector->refreshTypeSelector(true);
// show modules
myTypeAttributesEditor->showAttributeTableModule(myTypeSelector->getCurrentType());
myTypeAttributesEditor->showAttributesEditor(myTypeSelector->getCurrentType());
myAttributesEditorExtended->showAttributesEditorExtendedModule();
// show frame
GNEFrame::show();
Expand Down Expand Up @@ -443,7 +443,7 @@ GNETypeFrame::attributesEditorExtendedDialogOpened() {
if (myTypeSelector->getCurrentType()) {
GNEVehicleTypeDialog(myTypeSelector->getCurrentType(), true); // NOSONAR, constructor returns after dialog has been closed
// call "showAttributeEditorModule" to refresh attribute list
myTypeAttributesEditor->showAttributeTableModule(myTypeSelector->getCurrentType());
myTypeAttributesEditor->showAttributesEditor(myTypeSelector->getCurrentType());
myParametersEditor->refreshParametersEditor();
}
}
Expand Down

0 comments on commit 043127e

Please sign in to comment.