Class MusicShapeEditorCanvas

java.lang.Object
com.softsynth.jmsl.view.MusicShapeEditorCanvas
All Implemented Interfaces:
PVCanvas, PVComponent, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class MusicShapeEditorCanvas
extends java.lang.Object
implements PVCanvas, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
A canvas on which to draw on dimension of one shape
Author:
Nick Didkovsky, (c) 2004 All rights reserved, Email: nick@didkovsky.com
  • Method Details

    • setShowGrid

      public void setShowGrid​(boolean b)
    • getShowGrid

      public boolean getShowGrid()
    • setZoom

      public void setZoom​(double z)
    • getZoom

      public double getZoom()
    • setDimension

      public void setDimension​(int d)
      set the dimension of the shape to draw, and redraw
    • getDimension

      public int getDimension()
    • getShapeMin

      public double getShapeMin()
      Returns:
      the min value current music shape
    • getShapeMax

      public double getShapeMax()
      Returns:
      the max value current music shape
    • getScaleMin

      public double getScaleMin()
      Returns:
      the min value of the current y scale (depends on zoom, shape min and shape max)
    • getScaleMax

      public double getScaleMax()
      Returns:
      the max value of the current y scale (depends on zoom, shape min and shape max)
    • setStartIndex

      public void setStartIndex​(int i)
      set the starting index of the shape that begins at far left of canvas
    • setEndIndex

      public void setEndIndex​(int i)
      set the ending index of the shape that ends at far right of canvas
    • mouseClicked

      public void mouseClicked​(java.awt.event.MouseEvent e)
      Specified by:
      mouseClicked in interface java.awt.event.MouseListener
    • mousePressed

      public void mousePressed​(java.awt.event.MouseEvent e)
      Specified by:
      mousePressed in interface java.awt.event.MouseListener
    • mouseReleased

      public void mouseReleased​(java.awt.event.MouseEvent e)
      Specified by:
      mouseReleased in interface java.awt.event.MouseListener
    • mouseEntered

      public void mouseEntered​(java.awt.event.MouseEvent e)
      Specified by:
      mouseEntered in interface java.awt.event.MouseListener
    • mouseExited

      public void mouseExited​(java.awt.event.MouseEvent e)
      Specified by:
      mouseExited in interface java.awt.event.MouseListener
    • mouseDragged

      public void mouseDragged​(java.awt.event.MouseEvent e)
      Specified by:
      mouseDragged in interface java.awt.event.MouseMotionListener
    • mouseMoved

      public void mouseMoved​(java.awt.event.MouseEvent e)
      Specified by:
      mouseMoved in interface java.awt.event.MouseMotionListener
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • getBounds

      public java.awt.Rectangle getBounds()
      Specified by:
      getBounds in interface PVComponent
      Returns:
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • addKeyListener

      public void addKeyListener​(java.awt.event.KeyListener l)
      Specified by:
      addKeyListener in interface PVComponent
      Parameters:
      l -
    • setCanvasSize

      public void setCanvasSize​(int w, int h)
      Specified by:
      setCanvasSize in interface PVCanvas
      Parameters:
      w -
      h -
    • getParent

      public java.awt.Container getParent()
      Specified by:
      getParent in interface PVComponent
      Returns:
    • repaint

      public void repaint()
      Specified by:
      repaint in interface PVCanvas
    • setLocation

      public void setLocation​(int x, int y)
      Specified by:
      setLocation in interface PVComponent
      Parameters:
      x -
      y -
    • getLocation

      public java.awt.Point getLocation()
      Specified by:
      getLocation in interface PVComponent
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface PVComponent
      Returns:
    • setEnabled

      public void setEnabled​(boolean b)
      Specified by:
      setEnabled in interface PVComponent
      Parameters:
      b -
    • getGraphics

      public java.awt.Graphics getGraphics()
      Specified by:
      getGraphics in interface PVCanvas
      Returns:
    • equals

      public boolean equals​(java.lang.Object arg0)
      Overrides:
      equals in class java.lang.Object
    • removeKeyListener

      public void removeKeyListener​(java.awt.event.KeyListener l)
      Specified by:
      removeKeyListener in interface PVComponent
      Parameters:
      l -
    • getComponent

      public java.awt.Component getComponent()
      Specified by:
      getComponent in interface PVComponent
      Returns:
    • updateMinMaxLabels

      public void updateMinMaxLabels()
    • getStartIndex

      public int getStartIndex()
      Returns:
    • getEndIndex

      public int getEndIndex()
      Returns:
    • getBackground

      public java.awt.Color getBackground()
      Specified by:
      getBackground in interface PVComponent
      Returns:
    • setBackground

      public void setBackground​(java.awt.Color color)
      Specified by:
      setBackground in interface PVComponent
      Parameters:
      color -
    • getHeight

      public int getHeight()
    • getWidth

      public int getWidth()
    • setFont

      public void setFont​(java.awt.Font font)
      Specified by:
      setFont in interface PVComponent
    • getFont

      public java.awt.Font getFont()
      Specified by:
      getFont in interface PVComponent
    • getRangeEndIndex

      public int getRangeEndIndex()
    • getRangeStartIndex

      public int getRangeStartIndex()
    • getRangeX1

      public int getRangeX1()
    • getRangeX2

      public int getRangeX2()
    • clearRange

      public void clearRange()