Class DisplayPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class DisplayPanel extends JComponent
Panel for displaying calculated results.
See Also:
  • Field Details

    • HELPTEXT

      public static final String HELPTEXT
      The help text.
      See Also:
    • agent

      protected jadex.core.IExternalAccess agent
      The service provider.
    • colors

      protected Color[] colors
      The colors for drawing.
    • data

      protected AreaData data
      The latest area data used for determining original coordinates of painted regions.
    • image

      protected Image image
      The current image derived from the results.
    • point

      protected Point point
      The current selection start point (if any).
    • range

      protected Rectangle range
      The current selection range (if any).
    • calculating

      protected boolean calculating
      Flag indicating that a calculation is in progress.
    • progressdata

      protected Set<ProgressData> progressdata
      Progress data objects, available only when calculating (progress data -> percent finished).
    • startdrag

      protected Point startdrag
      Start point for dragging (if any).
    • enddrag

      protected Point enddrag
      End point for dragging (if any).
    • displayid

      protected String displayid
      The display id.
    • genservice

      protected IGenerateService genservice
      The generate service.
    • dirty

      protected boolean dirty
    • algos

      protected List<IFractalAlgorithm> algos
  • Constructor Details

    • DisplayPanel

      public DisplayPanel(jadex.core.IExternalAccess agent)
      Create a new display panel.
  • Method Details

    • displayServiceAvailable

      public void displayServiceAvailable(IDisplayService ds)
      Subscribe for updates when display service is available.
      Parameters:
      ds - The display service.
    • setResults

      public void setResults(AreaData data)
      Set new results.
    • addProgress

      public void addProgress(ProgressData part)
      Display intermediate calculation results.
    • addDataChunk

      public void addDataChunk(PartDataChunk data)
      Set new results.
    • paintComponent

      protected void paintComponent(Graphics g)
      Paint the results.
      Overrides:
      paintComponent in class JComponent
    • scaleToFit

      protected Rectangle scaleToFit(Rectangle bounds, int iwidth, int iheight)
      Calculate draw area for image.
    • getInnerBounds

      protected Rectangle getInnerBounds(boolean scrollarea)
      Get the bounds with respect to insets (if any).
      Parameters:
      scrollarea - True when inner bounds of scroll area instead of visible window space should be considered.
    • getMinimumSize

      public Dimension getMinimumSize()
      Get the desired size of the panel.
      Overrides:
      getMinimumSize in class JComponent
    • getPreferredSize

      public Dimension getPreferredSize()
      Get the desired size of the panel.
      Overrides:
      getPreferredSize in class JComponent
    • setColorScheme

      public void setColorScheme(Color[] scheme, boolean cycle)
      Set the color scheme.
    • dragImage

      protected void dragImage()
      Drag the image according to current drag settings.
    • zoomImage

      protected void zoomImage(int x, int y, double factor)
      Zoom into the given location by the given factor.
    • calcDefaultImage

      protected void calcDefaultImage()
      Set display coordinates to default values.
    • zoomIntoRange

      protected void zoomIntoRange()
      Zoom into the selected range.
    • calcArea

      protected void calcArea(double x1, double x2, double y1, double y2, int sizex, int sizey)
      Calculate the given area.
    • main

      public static void main(String[] args)