mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 02:57:35 -05:00
Code cleanup for waterfall and overlay panels
This commit is contained in:
@@ -96,9 +96,6 @@ public class OverlayPanel extends JPanel
|
|||||||
private Color mColorSpectrumCursor;
|
private Color mColorSpectrumCursor;
|
||||||
private Color mColorSpectrumLine;
|
private Color mColorSpectrumLine;
|
||||||
|
|
||||||
// //All channels
|
|
||||||
// private List<Channel> mChannels = new ArrayList<Channel>();
|
|
||||||
//
|
|
||||||
//Currently visible/displayable channels
|
//Currently visible/displayable channels
|
||||||
private CopyOnWriteArrayList<Channel> mVisibleChannels = new CopyOnWriteArrayList<Channel>();
|
private CopyOnWriteArrayList<Channel> mVisibleChannels = new CopyOnWriteArrayList<Channel>();
|
||||||
private ChannelDisplay mChannelDisplay = ChannelDisplay.ALL;
|
private ChannelDisplay mChannelDisplay = ChannelDisplay.ALL;
|
||||||
|
|||||||
@@ -278,26 +278,27 @@ public class WaterfallPanel extends JPanel implements DFTResultsListener,
|
|||||||
{
|
{
|
||||||
return ( (double)getWidth() * (double)multiplier ) / (double)mDFTSize;
|
return ( (double)getWidth() * (double)multiplier ) / (double)mDFTSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the screen at each refresh
|
* Renders the screen at each refresh
|
||||||
*/
|
*/
|
||||||
public void paintComponent( Graphics g )
|
public void paintComponent( Graphics g )
|
||||||
{
|
{
|
||||||
|
super.paintComponent( g );
|
||||||
|
|
||||||
int multiplier = getZoomMultiplier();
|
int multiplier = getZoomMultiplier();
|
||||||
|
|
||||||
double binPixelWidth = getBinPixelWidth( multiplier );
|
double binPixelWidth = getBinPixelWidth( multiplier );
|
||||||
|
|
||||||
int offset = (int)( getPixelOffset( multiplier ) - binPixelWidth );
|
int offset = (int)( getPixelOffset( multiplier ) - binPixelWidth );
|
||||||
|
|
||||||
g.drawImage( mWaterfallImage,
|
g.drawImage( mWaterfallImage,
|
||||||
offset,
|
offset,
|
||||||
0,
|
0,
|
||||||
( getWidth() * multiplier ) + (int)binPixelWidth,
|
( getWidth() * multiplier ) + (int)binPixelWidth,
|
||||||
mImageHeight,
|
mImageHeight,
|
||||||
this );
|
this );
|
||||||
|
|
||||||
|
|
||||||
Graphics2D graphics = (Graphics2D) g;
|
Graphics2D graphics = (Graphics2D) g;
|
||||||
|
|
||||||
graphics.setColor( mColorSpectrumCursor );
|
graphics.setColor( mColorSpectrumCursor );
|
||||||
|
|||||||
Reference in New Issue
Block a user