Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ch.laoe.clip
Class AChannelPlotter  view AChannelPlotter download AChannelPlotter.java

java.lang.Object
  extended bych.laoe.clip.AObject
      extended bych.laoe.clip.APlotter
          extended bych.laoe.clip.AChannelPlotter
Direct Known Subclasses:
AChannelPlotterSampleCurve, AChannelPlotterSpectrogram

public abstract class AChannelPlotter
extends APlotter

This file is part of LAoE. LAoE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. LAoE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LAoE; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Class: AChannelPlotter Autor: olivier gäumann, neuchâtel (switzerland) JDK: 1.3 Desctription: channel view. History: Date: Description: Autor: 28.12.00 first draft oli4 24.01.01 array-based oli4 28.03.01 bugfix in selection-painting oli4 24.06.01 new x/y-skala painting oli4 04.07.01 add white range on skalas oli4 08.07.01 don't paint skala if range=0, because of hard VM crash !!! oli4 18.07.01 add different sample drawings, with and without points oli4 26.07.01 3rd order interpolation on big zoom oli4 30.07.01 draw selection-dimension oli4 11.01.02 introduce intensity-points oli4 06.05.2003 paint numeric values in rulers oli4


Field Summary
protected  java.awt.Rectangle rectangle
           
private  float xLength
           
private  float xOffset
           
private  float yLength
           
private  float yOffset
           
 
Fields inherited from class ch.laoe.clip.APlotter
model
 
Fields inherited from class ch.laoe.clip.AObject
name
 
Constructor Summary
AChannelPlotter(AModel m)
          constructor
AChannelPlotter(AModel m, AChannelPlotter p)
          constructor
 
Method Summary
private static java.lang.String floatToString(float value)
          same as paintText, but paints formatted numeric value
abstract  float getAutoscaleXLength()
           
abstract  float getAutoscaleXOffset()
           
abstract  float getAutoscaleYLength(int xOffset, int xLength)
           
abstract  float getAutoscaleYOffset(int xOffset, int xLength)
           
 AChannel getChannelModel()
           
private  float getNearestDecade(float value)
           
 java.awt.Rectangle getRectangle()
          get the pixel-rectangle
protected abstract  float getValidYLength()
           
protected abstract  float getValidYOffset()
           
 float getXLength()
          returns the actual x length
 float getXOffset()
          returns the actual x offset
 float getYLength()
          returns the actual y length
 float getYOffset()
          returns the actual y offset
 float graphToPercentY(float y)
           
 float graphToSampleX(int x)
           
 float graphToSampleY(int y)
           
 boolean isInsideChannel(java.awt.Point p)
          returns true, if the point p is inside the sample-curve-rectangle
private  void limitXRange()
          limits x-ranges
private  void limitYRange()
          limits y-ranges
 void paintFrame(java.awt.Graphics2D g2d)
          paint the frame around the sample-curve
 void paintMarker(java.awt.Graphics2D g2d, java.awt.Rectangle rect)
          paints the markers
 void paintMask(java.awt.Graphics2D g2d, java.awt.Color color)
          paints the mask
abstract  void paintSamples(java.awt.Graphics2D g2d, java.awt.Color color)
          paint the sample-curve
 void paintSelection(java.awt.Graphics2D g2d, java.awt.Color color)
          highlight the actually selected part of the sample-curve
private  void paintText(java.awt.Graphics2D g2d, java.lang.String text, int size, int x, int y)
          paints a text, given the center coordinates
 void paintXSkala(java.awt.Graphics2D g2d, java.awt.Rectangle rect)
          highlight the actually selected part of the sample-curve
 void paintYSkala(java.awt.Graphics2D g2d, java.awt.Rectangle rect)
          highlight the actually selected part of the sample-curve
 int percentToGraphY(float y)
           
 int sampleToGraphX(float x)
           
 int sampleToGraphY(float y)
           
 void setDefaultName()
          set the default name of the model
 void setRectangle(java.awt.Rectangle r)
          set the pixel-rectangle, in which the track is painted
 void setXRange(float offset, float length)
          set the sample range
 void setYRange(float offset, float length)
          set the amplitude range
 void translateXOffset(float offset)
          translate the sample offset
 void translateYOffset(float offset)
          translate the amplitude offset
 void zoomX(float factor)
          zoom x
 void zoomY(float factor)
          zoom y
 
Methods inherited from class ch.laoe.clip.AObject
getName, setDefaultName, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xOffset

private float xOffset

xLength

private float xLength

yOffset

private float yOffset

yLength

private float yLength

rectangle

protected java.awt.Rectangle rectangle
Constructor Detail

AChannelPlotter

public AChannelPlotter(AModel m)
constructor


AChannelPlotter

public AChannelPlotter(AModel m,
                       AChannelPlotter p)
constructor

Method Detail

getChannelModel

public AChannel getChannelModel()

setDefaultName

public void setDefaultName()
Description copied from class: AObject
set the default name of the model

Specified by:
setDefaultName in class AObject

getXOffset

public float getXOffset()
returns the actual x offset


getXLength

public float getXLength()
returns the actual x length


getYOffset

public float getYOffset()
returns the actual y offset


getYLength

public float getYLength()
returns the actual y length


getAutoscaleXOffset

public abstract float getAutoscaleXOffset()

getAutoscaleXLength

public abstract float getAutoscaleXLength()

getAutoscaleYOffset

public abstract float getAutoscaleYOffset(int xOffset,
                                          int xLength)

getAutoscaleYLength

public abstract float getAutoscaleYLength(int xOffset,
                                          int xLength)

getValidYOffset

protected abstract float getValidYOffset()

getValidYLength

protected abstract float getValidYLength()

setXRange

public void setXRange(float offset,
                      float length)
set the sample range


setYRange

public void setYRange(float offset,
                      float length)
set the amplitude range


translateXOffset

public void translateXOffset(float offset)
translate the sample offset


translateYOffset

public void translateYOffset(float offset)
translate the amplitude offset


limitXRange

private void limitXRange()
limits x-ranges


limitYRange

private void limitYRange()
limits y-ranges


zoomX

public void zoomX(float factor)
zoom x


zoomY

public void zoomY(float factor)
zoom y


sampleToGraphX

public int sampleToGraphX(float x)

sampleToGraphY

public int sampleToGraphY(float y)

percentToGraphY

public int percentToGraphY(float y)

graphToSampleX

public float graphToSampleX(int x)

graphToSampleY

public float graphToSampleY(int y)

graphToPercentY

public float graphToPercentY(float y)

setRectangle

public void setRectangle(java.awt.Rectangle r)
set the pixel-rectangle, in which the track is painted


getRectangle

public java.awt.Rectangle getRectangle()
get the pixel-rectangle


isInsideChannel

public boolean isInsideChannel(java.awt.Point p)
returns true, if the point p is inside the sample-curve-rectangle


paintFrame

public void paintFrame(java.awt.Graphics2D g2d)
paint the frame around the sample-curve


paintSamples

public abstract void paintSamples(java.awt.Graphics2D g2d,
                                  java.awt.Color color)
paint the sample-curve


paintMask

public void paintMask(java.awt.Graphics2D g2d,
                      java.awt.Color color)
paints the mask


paintMarker

public void paintMarker(java.awt.Graphics2D g2d,
                        java.awt.Rectangle rect)
paints the markers


paintSelection

public void paintSelection(java.awt.Graphics2D g2d,
                           java.awt.Color color)
highlight the actually selected part of the sample-curve


getNearestDecade

private float getNearestDecade(float value)

paintText

private void paintText(java.awt.Graphics2D g2d,
                       java.lang.String text,
                       int size,
                       int x,
                       int y)
paints a text, given the center coordinates


floatToString

private static java.lang.String floatToString(float value)
same as paintText, but paints formatted numeric value


paintXSkala

public void paintXSkala(java.awt.Graphics2D g2d,
                        java.awt.Rectangle rect)
highlight the actually selected part of the sample-curve


paintYSkala

public void paintYSkala(java.awt.Graphics2D g2d,
                        java.awt.Rectangle rect)
highlight the actually selected part of the sample-curve