Skip to content
This repository has been archived by the owner. It is now read-only.

Use Image for Shape #154

Closed
philip-alldredge opened this issue May 4, 2016 · 4 comments
Closed

Use Image for Shape #154

philip-alldredge opened this issue May 4, 2016 · 4 comments
Assignees
Milestone

Comments

@philip-alldredge
Copy link
Contributor

@philip-alldredge philip-alldredge commented May 4, 2016

capability to use a referenced image file as a background for a model element

Attach pictures, e.g. to system blocks to represent the system, e.g. a plane, a wheel, etc.

@philip-alldredge philip-alldredge added this to the Next Iteration Planning milestone May 4, 2016
@philip-alldredge philip-alldredge removed this from the Next Iteration Planning milestone Feb 24, 2017
@philip-alldredge philip-alldredge removed this from the Next Iteration Planning milestone Feb 24, 2017
@philip-alldredge philip-alldredge added this to the Planning (Threshold) milestone Feb 26, 2017
@philip-alldredge philip-alldredge added this to the Planning (Threshold) milestone Feb 26, 2017
@philip-alldredge philip-alldredge changed the title Attach Pictures to Model Elements Use image as a background for shape Feb 27, 2017
@philip-alldredge philip-alldredge changed the title Use image as a background for shape Use Image as Background for Shape Feb 27, 2017
@philip-alldredge philip-alldredge added this to the M4 milestone Aug 22, 2017
@philip-alldredge philip-alldredge removed this from the Future Enhancements milestone Aug 22, 2017
@RyanMcilnay
Copy link
Contributor

@RyanMcilnay RyanMcilnay commented Jan 30, 2018

TODO

  • Test behavior when image file itself is updated. Will need to refresh image.
  • Ensure freed when no longer referenced.
  • Don't register the same image ID multiple times.

Loading

@philip-alldredge philip-alldredge changed the title Use Image as Background for Shape Use Image for Shape Feb 1, 2018
@philip-alldredge
Copy link
Contributor Author

@philip-alldredge philip-alldredge commented Feb 1, 2018

  • LayoutUtil.layout() - Create platform graphics algorithm instead of the one specified by the graphical configuration.
  • Only support image for shape graphics which do not have a dock area.
  • Layout algorithm should be adjusted to avoid resizing diagram elements which have an image.

Loading

@philip-alldredge
Copy link
Contributor Author

@philip-alldredge philip-alldredge commented Feb 5, 2018

  • Add an option to the style and XML to show as image. If this is enabled, the image is used. If not, then the default representation is used. It should be automatically enabled when the user selects an image. This will allow the user to quickly switch between the standard and the image representation as desired. This is similar to functionality provided by other tools.

Loading

@philip-alldredge
Copy link
Contributor Author

@philip-alldredge philip-alldredge commented Feb 5, 2018

Notes from Discussion:

  • AgeDiagramTypeProvider
    • Add a public static method getResources() that returns a resource manger. Delegate to JFaceResources.getResources().
  • GraphitiAgeDiagram
    • Owns a local resource manager. Parent should be result of AgeDiagramTypeProvider.getResources()
    • Closing GraphitiAgeDiagram should dispose the local resource manager.
    • During update process(beforeModificationsCompleted()). Create a new local resource manager and pass it to LayoutUtil. Before ending the update process, dispose of the old resource manager and keep a reference to the new local resource manager.
  • LayoutUtil
    • Will used the passed in resource manager to load image.
    • Will set the ga's image property to the project independent path which can be used to build the image descriptor.
    • Will use methods in PathUtil to convert path as appropriate
  • GA Renderer Factory
    • Will use AgeDiagramTypeProvider.getResources() to retrieve already loaded image. Handle gracefully if it isn't loaded. Do not load.
  • Style
    • Will store a path relative to the project in which the diagram is stored.
  • org.osate.ge.internal.util.PathUtil
    • Create class
    • Add a public static methods for converting path to project relative to path. Use for determing path to store in project.
    • Add a public static method for converting a path to a workspace relative path.
    • See IPath's makeAbsolute(), makeRelativeTo(), toOSString(), toPortableString().
  • Test on Windows and Linux

Loading

philip-alldredge added a commit that referenced this issue Mar 5, 2018
Allow representing shapes as an image. #154
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants