Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Zest 2.0] added getter for ZestRoorLayer ordering constants #532

Closed
wants to merge 1 commit into from

Conversation

BauePhil
Copy link
Contributor

To be able to overwrite the ordering of the layers. See #518.

/**
* Adds a node to the ZestRootLayer
*
* @param nodeFigure The figure representing the node
*/
public void addNode(IFigure nodeFigure) {
addFigure(nodeFigure, NODES_LAYER);
addFigure(nodeFigure, getNodesLayer());
Copy link
Contributor

@ptziegler ptziegler Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be honest; I don't like this at all. A getNodesLayer() method should always return NODES_LAYER. Anything else I would consider a conceptual flaw.

Can't you just overwrite the addNode(IFigure) method and then use a different constant? For example:

public void addNode(IFigure nodeFigure) {
	addFigure(nodeFigure, CONNECTIONS_LAYER)
}

You might have to make the changeFigureLayer() method protected to override the highlight methods, but that's fine. It still looks a little weird adding figures to other layers, but at least it's immediately obvious what's happening, when looking at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you just overwrite the addNode(IFigure) method and then use a different constant?

Oh... yes that makes a lot more sense. I might have been a bit blinded by the constants, that I missed I don't even have to use them.
Thank you. I will close this PR.

@BauePhil BauePhil closed this Aug 26, 2024
@BauePhil BauePhil deleted the zest2.0 branch August 26, 2024 07:32
@BauePhil BauePhil restored the zest2.0 branch August 26, 2024 07:32
@BauePhil BauePhil deleted the zest2.0 branch August 26, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants