Class JDialogCaptureScreen.MyGlassPane

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
gov.nih.mipav.view.dialogs.JDialogCaptureScreen.MyGlassPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Enclosing class:
JDialogCaptureScreen

class JDialogCaptureScreen.MyGlassPane extends JComponent
Our special glass panes draw rectangles based on how the user traces them using the mouse. The mouse events aren't captured unless the glass pane is visible.
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • complete

      boolean complete
      When we're done drawing the rectangle, change the color.
    • x

      int x
      Dimensions of rectangle to draw.
    • y

      int y
      Dimensions of rectangle to draw.
    • width

      int width
      Dimensions of rectangle to draw.
    • height

      int height
      Dimensions of rectangle to draw.
  • Constructor Details

    • MyGlassPane

      public MyGlassPane()
      Creates new glass pane and adds the listeners.
  • Method Details

    • paint

      public void paint(Graphics g)
      Paints a yellow rectangle based on the dimensions if not complete; if complete, paints a red rectangle.
      Overrides:
      paint in class JComponent
      Parameters:
      g - Graphics component for this paint.
    • setComplete

      public void setComplete(boolean comp)
      Accessor to tell the glass pane that the rectangle drawing is complete. If so, sets the currentRectangle appropriately.
      Parameters:
      comp - true if drawing is complete, false otherwise.
    • setH

      public void setH(int h)
      Accessor to set the height value of the painted rectangle.
      Parameters:
      h - Height value of painted rectangle.
    • setW

      public void setW(int w)
      Accessor to set the width value of the painted rectangle.
      Parameters:
      w - Width value of painted rectangle.
    • setX

      public void setX(int x)
      Accessor to set the x value of the painted rectangle.
      Parameters:
      x - X value of painted rectangle.
    • setY

      public void setY(int y)
      Accessor to set the y value of the painted rectangle.
      Parameters:
      y - Y value of painted rectangle.