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

CircularPlot.getConnections() isEmpty() when from.addToOutgoing(to, ...) is done after CircularPlotBuilder.create() #36

Open
markus-olbrich opened this issue May 11, 2021 · 2 comments

Comments

@markus-olbrich
Copy link
Contributor

Hi Gerrit,
i got the following problem ....

CircularPlot.getConnections() isEmpty() when from.addToOutgoing(to, ...) is done after CircularPlotBuilder.create()

There seams to be a dependency in order of method calls, see validateData().
Its very surprising that allthougt the appearance on screen ist totally fine, there is an empty conenctions list.

This all is upcoming only, because Connections are only internal in CircularPlot.

Another previous mistake was to create Connections outside the plot and using them.
Everything seems ok, the appearance on screen ist totally fine, but i never got the idea that these are totally unused.
I only wondered why i could not get any ConnectionEvent.

IMO it would be great to have Interfaces for PlotItem(NODE) and Connection(EDGE) in order to add own Properties
or even to use existing Graph Structures to implement PlotItem and Connection Interface for Charts.

But thanks for your work,
great FX framework!!

@HanSolo
Copy link
Owner

HanSolo commented May 11, 2021

Hi there,
Well you are probably right, I've only created the whole charts thing for fun so there is definitely room for improvement. Unfortunately I'm really busy these days but if you like...feel free to create a MR with a solution :)
Cheers,
Gerrit

@markus-olbrich
Copy link
Contributor Author

markus-olbrich commented May 12, 2021

Hi Gerrit,

yes ok, unfortunately i am not that familiar with GitHub, but i will see.

I just have another thing. The following Code will fail, i think because the fill is part of hashCode().
It will not be found anymore when color is changed, even if overridden.

{code}
public class GttPlotItem extends PlotItem {

@Override
public Color getFill() {
	if(true) return super.getFill();
	GttDomainDataBean bean = circularCurveElementNode.getBeans().iterator().next();
	// Ist das Element akt. selektiert dann muss es farblich hervorghoben werden
	if(circularCurveElementNode.getCurve().getBeanModel().isSelected(bean)) {
		return Color.CYAN;
	} else {
		return super.getFill();
	}		
}

{code}

So i have also to override hashCode() and equals(), but cannot expect what followups that can have, because the real aim for using this in hashCode is not commented.

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

No branches or pull requests

2 participants