Class J3DTrend

All Implemented Interfaces:
KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener

public class J3DTrend extends JComponent implements MouseListener, MouseMotionListener, KeyListener
A class to handle a 3D spectrum image viewer using colormap This class should be used with NumberSpectrumTrend3DViewer
See Also:
  • Field Details

    • theImage

      protected BufferedImage theImage
    • margin

      protected Insets margin
    • xOrg

      protected int xOrg
    • yOrg

      protected int yOrg
    • xAxis

      protected JLAxis xAxis
    • xAxisHeight

      protected int xAxisHeight
    • xAxisUpMargin

      protected int xAxisUpMargin
    • yAxis

      protected JLAxis yAxis
    • yAxisWidth

      protected int yAxisWidth
    • yAxisRightMargin

      protected int yAxisRightMargin
    • updateXRange

      protected boolean updateXRange
    • updateYRange

      protected boolean updateYRange
  • Constructor Details

    • J3DTrend

      public J3DTrend()
      Construction
  • Method Details

    • getYAxis

      public JLAxis getYAxis()
      Returns:
      handle to the y axis
    • getXAxis

      public JLAxis getXAxis()
      Returns:
      handle to the x axis
    • setMargin

      public void setMargin(Insets i)
      Sets the margin of the JImage
      Parameters:
      i - Image margin
    • setCursorEnabled

      public void setCursorEnabled(boolean enable)
      Enable cross cursor on mouse click
      Parameters:
      enable - Enable cursor
    • updateXRange

      public void updateXRange(boolean b)
      Tell the viewer to update or not xAxis range.
      Parameters:
      b - True to enable updating range
    • updateYRange

      public void updateYRange(boolean b)
      Tell the viewer to update or not yAxis range.
      Parameters:
      b - True to enable updating range
    • setParent

      public void setParent(J3DTrendListener p)
      Sets the parent of this component
      Parameters:
      p - NumberSpectrumTrend3DViewer parent
    • measureAxis

      protected void measureAxis()
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • setImage

      public void setImage(BufferedImage img, int maxX, int maxY)
      Sets the image
      Parameters:
      img - image
      maxX - Maximum X
      maxY - Maximum Y
    • getImage

      public BufferedImage getImage()
      Returns a handle to the image displayed
      Returns:
      Image handle
    • shiftCursorX

      public void shiftCursorX(int delta)
      Shift the cursor by the specified delta
      Parameters:
      delta - Shift
    • getXCursor

      public int getXCursor()
      Returns:
      X coordinate of the cursor
    • getYCursor

      public int getYCursor()
      Returns:
      Y coordinate of the cursor
    • setCursor

      public void setCursor(int x, int y)
      Sets the cursor position
      Parameters:
      x - X coordinate of the cursor
      y - Y coordinate of the cursor
    • isCursorInside

      public boolean isCursorInside()
      Returns:
      true if the cursor is inside the image.
    • clearCursor

      public void clearCursor()
      Remove the cursor
    • paintAxis

      protected void paintAxis(Graphics g)
    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class JComponent
    • cursorMove

      public void cursorMove()
    • cursorMove

      public void cursorMove(boolean fireUpdate)
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Specified by:
      mouseMoved in interface MouseMotionListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Specified by:
      mouseExited in interface MouseListener
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
    • keyPressed

      public void keyPressed(KeyEvent e)
      Specified by:
      keyPressed in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Specified by:
      keyReleased in interface KeyListener
    • keyTyped

      public void keyTyped(KeyEvent e)
      Specified by:
      keyTyped in interface KeyListener