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

CADTools - Drawing Blocks throws NPEs #56

Closed
ma15569 opened this issue Aug 19, 2022 · 7 comments
Closed

CADTools - Drawing Blocks throws NPEs #56

ma15569 opened this issue Aug 19, 2022 · 7 comments

Comments

@ma15569
Copy link
Contributor

ma15569 commented Aug 19, 2022

PlugIn: CADTools

Bug description: It is not possible to draw a good 50% of the embedded blocks this which throw null point exceptions.

It seems that blocks made by simple polygons or multipolygons with no holes can be drawn.
Blocks made by the previous geometries with holes not.

Blocks displayed by CADTools are stored into Lib/Ext/VertexImages folder (blocks are used by CadPlan Vertex Images plugin too) and they are simple WKT files

@ma15569
Copy link
Contributor Author

ma15569 commented Aug 24, 2022

OpenJUMP-Portable-20220823-r5135[6899249]-PLUS

Just a reminder to explain the bug and define the last test

CadTools: the bug affects blocks made by polygons with holes (for instance bore_01 or geology_05. It does not ot affect blocks made by polygons without holes (for instance geology_01) or multipolygons (geology_03)

Vertex Synbology the same: the bug affects shapes (symbols) made by polygons with holes (for instance bore_01 or geology_05. It does not ot affect blocks made by polygons without holes (for instance geology_01) or multipolygons (geology_03)

Both CadTools and Vertex Synbology define the geometries/shapes reading WKT files in lib/ext/VertexImages folder

@edeso
Copy link
Contributor

edeso commented Aug 24, 2022

Peppe,

let me refer you to my answers on the sf.net ticket,
https://sourceforge.net/p/jump-pilot/bugs/522/#1cb9

also i explicitly asked you not to open another one here, guess you didn't see that.

so again, works for me since rev5128 see bore01

if it still does not for you i will need more details. specifically

  • the error stack from the log and
  • maybe the java runtime you use
    as i'm not able to replicate any issue.

i will close the issue an sf.net assuming that we will stay here the for the issue being.

@ma15569
Copy link
Contributor Author

ma15569 commented Aug 25, 2022

Hi Ede,

I started to test the errror with this java versions 1.8.0_311 and 1.8.0_341

This is the error stack from the log file when I try to load a project with ExtendedVertexSymbols (Vertex Image plugin)
Read next message for CadTools plugin error

 (Null Pointer Exception)
[ERROR] 2022-08-25_06:56:04.390 java.lang.NullPointerException
java.lang.NullPointerException
	at com.vividsolutions.jump.workbench.ui.renderer.SimpleFeatureCollectionRenderer.paint(SimpleFeatureCollectionRenderer.java:27)
	at com.vividsolutions.jump.workbench.ui.renderer.SimpleFeatureCollectionRenderer.paint(SimpleFeatureCollectionRenderer.java:58)
	at com.vividsolutions.jump.workbench.ui.renderer.SimpleRenderer.copyTo(SimpleRenderer.java:74)
	at com.vividsolutions.jump.workbench.ui.renderer.FeatureCollectionRenderer.copyTo(FeatureCollectionRenderer.java:55)
	at com.vividsolutions.jump.workbench.ui.renderer.LayerRenderer.copyTo(LayerRenderer.java:93)
	at com.vividsolutions.jump.workbench.ui.renderer.RenderingManager.copyTo(RenderingManager.java:362)
	at com.vividsolutions.jump.workbench.ui.LayerViewPanel.paintComponent(LayerViewPanel.java:486)
	```

@ma15569
Copy link
Contributor Author

ma15569 commented Aug 25, 2022

I Ede,
this is a description of the bug with java version "1.8.0_341" with CadTools

a) select the first icon to the left (Draw a block), select block bore_01
Everything is fine and the block is drawn with no errors as in picture of your message

b) select the second icon to the left (Draw an oriented block)

  • move the cursor on the workbench: the shade of the block appears following the cursor, no error
  • one click and move the cursor: the shade stays on the click coorsinates rotating according the position of the cursor, no error
  • Dragging the cursor with second click: angle of rotation comes out on the status bar, rotates, no error
  • Second click )which should draw the rotated block), the error pops up
java.lang.NullPointerException
at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn.execute(AbstractPlugIn.java:376)
at com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool.execute(AbstractCursorTool.java:640)
at org.openjump.advancedtools.block.DrawOrientedBlockTool.gestureFinished(DrawOrientedBlockTool.java:121)
at com.vividsolutions.jump.workbench.ui.cursortool.AbstractCursorTool.fireGestureFinished(AbstractCursorTool.java:621)
at org.openjump.core.ui.plugin.edittoolbox.cursortools.ConstrainedMultiClickTool.finishGesture(ConstrainedMultiClickTool.java:280)
at org.openjump.core.ui.plugin.edittoolbox.cursortools.ConstrainedMultiClickTool.mouseReleased(ConstrainedMultiClickTool.java:155)
at com.vividsolutions.jump.workbench.ui.cursortool.DelegatingTool.mouseReleased(DelegatingTool.java:105)
...

Note that, with the older java version 1.8.0_311, both a) and b) were generating errors

With OpenJUMP 1.16 no error were generating (I did this test just in case to have an history if there wers some changes)

I still think that the bug in CadTools and the one in VertexImagesas are related as they share some code on how to read WKT symbols, rotate and transform into geometries. I will not open another issue, maybe solving CadTools solves also VertexImage

Bets regards

@edeso
Copy link
Contributor

edeso commented Aug 25, 2022

a) select the first icon to the left (Draw a block), select block bore_01 Everything is fine and the block is drawn with no errors as in picture of your message

yes, this was fixed in my initial approach

b) select the second icon to the left (Draw an oriented block)
SNIP

right, didn't try that one. the fix is identical and i'll tackle that soonish

Note that, with the older java version 1.8.0_311, both a) and b) were generating errors

With OpenJUMP 1.16 no error were generating (I did this test just in case to have an history if there wers some changes)

according to my debugging the cause lies in the upgraded jts 1.19 . for some reason some symbols fail the geometry validity test. as they are only symbols, deactivatiing the need for validity solves the issue.

I still think that the bug in CadTools and the one in VertexImagesas are related as they share some code on how to read WKT symbols, rotate and transform into geometries. I will not open another issue, maybe solving CadTools solves also VertexImage

wrt. VertexSymbols. please try to create a new project with VertexSymbol decorations in OJ2. we lost old OJ1.x project compatibility as it seems in that regard.

edeso added a commit to openjump-gis/cadtools-extension that referenced this issue Aug 28, 2022
@edeso
Copy link
Contributor

edeso commented Aug 28, 2022

hey @ma15569

pls test the next snapshot.
https://sourceforge.net/projects/jump-pilot/files/OpenJUMP2_snapshots/

the issue should be fixed now. if so pls close this issue . thx!

@ma15569
Copy link
Contributor Author

ma15569 commented Aug 30, 2022

The bug is solved for CADTools Blocks plugin.
I close this issue

@ma15569 ma15569 closed this as completed Aug 30, 2022
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