Class ChartElementImage

java.lang.Object
com._1c.g5.v8.dt.form.ui.internal.chart.editor.ChartElementImage

public class ChartElementImage extends Object
Represents an image of some chart element to be placed on ChartControl's canvas.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChartElementImage(IModelApi modelApi, AnyChartElement chartElement, org.eclipse.swt.widgets.Canvas canvas, boolean isReadOnlyMode)
    Creates instance for the specified chart element.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(int x, int y)
    Checks whether the specified point lies inside this image rectangle.
    void
    Disposes the stored image.
    void
    draw(org.eclipse.swt.graphics.GC gc, boolean isSelected)
    Draws the image.
    int
    getTrackResizeCursorId(int x, int y)
    Returns SWT cursor id for tracking change of image rectangle.
    boolean
    track(int x, int y)
    Tracks changing of image bounds by mouse via Tracker element.
    void
    update(org.eclipse.swt.graphics.ImageData newImageData)
    Updates the current image with new image data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChartElementImage

      public ChartElementImage(IModelApi modelApi, AnyChartElement chartElement, org.eclipse.swt.widgets.Canvas canvas, boolean isReadOnlyMode)
      Creates instance for the specified chart element.
      Parameters:
      modelApi - the IModelApi instance, cannot be null.
      chartElement - the chart element for which to create the image, cannot be null
      canvas - the canvas on which to draw the image, cannot be null
      isReadOnlyMode - the flag indicating that chart editing is not allowed
  • Method Details

    • update

      public void update(org.eclipse.swt.graphics.ImageData newImageData)
      Updates the current image with new image data.
      Parameters:
      newImageData - the new image data or null if there is no image to display
    • dispose

      public void dispose()
      Disposes the stored image.
    • contains

      public boolean contains(int x, int y)
      Checks whether the specified point lies inside this image rectangle.
      Parameters:
      x - the x-coordinate of the point to check
      y - the y-coordinate of the point to check
      Returns:
      true if the point is inside of the image rectangle, false otherwise
    • track

      public boolean track(int x, int y)
      Tracks changing of image bounds by mouse via Tracker element.
      Parameters:
      x - the x-coordinate of the starting point
      y - the y-coordinate of the starting point
      Returns:
      true if image rectangle has been changed, false otherwise
    • getTrackResizeCursorId

      public int getTrackResizeCursorId(int x, int y)
      Returns SWT cursor id for tracking change of image rectangle.
      Parameters:
      x - the x-coordinate of the point to check
      y - the y-coordinate of the point to check
      Returns:
      one of SWT.CURSOR_SIZE* constants or SWT.NONE if checking point is outside of the image
    • draw

      public void draw(org.eclipse.swt.graphics.GC gc, boolean isSelected)
      Draws the image.
      Parameters:
      gc - the GC on which to draw, cannot be null
      isSelected - true if the image is currently selected