Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8091600

Shapes and object-oriented programming - comparison with Java2D

XMLWordPrintable

      I am trying to map a rigorous geometry library (JTS) to JavaFX and finding some inconsistencies.
      My understanding of Java2D is that the Shape interface provides a standard means of interfacing with the geometry by means of the PathIterator.
      Contrast with JavaFX where Shape does not seem to have any reference to the geometry, hence all sub-classes define and access the geometry differently. This seems to be unhelpful and not in the spirit of object-oriented programming. Is this something that could be fixed in future?

      Alternatively is there a simple mechanism for translating Java2D geometries into JavaFX scenegraph? (Since the geometry model in Java2D seems to be quite well designed; why was all this good work ignored?)

      Also could the Path, PathElement, concept be extended to include the equivalent of a FlatteningPathIterator?

      My final comment would be, when designing a 2D geometry based system would it not be better to start with 'proper' geometry model like JTS so that there are no fundamental inconsistencies?

      (from Wikipedia - The JTS Topology Suite (JTS) is an open source Java software library that provides an object model for Euclidean planar linear geometry together with a set of fundamental geometric functions. JTS is primarily intended to be used as a core component of vector-based geomatics software such as geographical information systems. It can also be used as a general-purpose library providing algorithms in computational geometry. JTS implements the geometry model and API defined in the OpenGIS Consortium Simple Features Specification for SQL.)

            Unassigned Unassigned
            jkayjfx Jim Kay (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported: